bbtk::GComplexBoxPortModel Class Reference

#include <GComplexBoxPortModel.h>

Inheritance diagram for bbtk::GComplexBoxPortModel:

Inheritance graph
[legend]
Collaboration diagram for bbtk::GComplexBoxPortModel:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 GComplexBoxPortModel ()
 ~GComplexBoxPortModel ()
virtual void setInicPoint (double &x, double &y, double &z)
int getComplexPortType ()
void setComplexPortType (int pType)
virtual std::string getStatusText ()
virtual void save (std::string &content)
void addInputPort (GPortModel *inputport)
void addOutputPort (GPortModel *outputport)
int getNumInputPorts ()
int getNumOutputPorts ()
virtual void move (double xx, double yy, double zz)
std::vector< GPortModel * > getInputPorts ()
std::vector< GPortModel * > getOutputPorts ()
GPortModelgetInputPort (std::string name)
GPortModelgetInputPort (int pos)
GPortModelgetOutputPort (std::string name)
GPortModelgetOutputPort (int pos)
void updatePorts ()
void addColons (std::string &text)
void removeColons (std::string &text)
void getInicPoint (double &x, double &y, double &z)
void getFinalPoint (double &x, double &y, double &z)
void getCenter (double &x, double &y, double &z)
virtual void setFinalPoint (double &x, double &y, double &z)
virtual bool isPointInside (double x, double y, double z)
int getGObjectType ()
void setGObjectType (int obtype)
std::string getBBTKType ()
void setBBTKType (std::string obtype)
std::string getBBTKName ()
void setBBTKName (std::string obname)
int getObjectId ()
void setObjectId (int id)
void addObserver (Observer *observer)
void notifyObservers (int idCaller, int command=NO_COMMAND)

Protected Attributes

std::vector< GPortModel * > _inputs
std::vector< GPortModel * > _outputs
double _xInic
double _yInic
double _zInic
double _xFin
double _yFin
double _zFin
int _objectId
int _gObjectType
std::string _bbtkType
std::string _bbtkName

Private Attributes

int _complexPortType


Detailed Description

Definition at line 55 of file GComplexBoxPortModel.h.


Constructor & Destructor Documentation

bbtk::GComplexBoxPortModel::GComplexBoxPortModel (  ) 

Definition at line 43 of file GComplexBoxPortModel.cxx.

00044         {               
00045         }

bbtk::GComplexBoxPortModel::~GComplexBoxPortModel (  ) 

Definition at line 49 of file GComplexBoxPortModel.cxx.

00050         {
00051         }


Member Function Documentation

void bbtk::GBoxModel::addColons ( std::string &  text  )  [inherited]

Definition at line 202 of file GBoxModel.cxx.

00203         {
00204                 std::string character("&&2P&&");                                
00205                 size_t pos;
00206                 pos = text.find(character);
00207                 while(pos != std::string::npos)
00208                 {
00209                 //We replace the character "&&2P&&" with ":" for all the string
00210                         text.replace(pos, character.length(),":");
00211                         pos = text.find(character, pos);
00212                 }
00213         }

void bbtk::GBoxModel::addInputPort ( GPortModel inputport  )  [inherited]

Definition at line 65 of file GBoxModel.cxx.

References bbtk::GBoxModel::_inputs.

Referenced by bbtk::wxVtkSceneManager::createGComplexBoxOutputPort(), and bbtk::wxVtkSceneManager::createGInputPort().

00066         {
00067                 _inputs.push_back(inputport);
00068         }

Here is the caller graph for this function:

void bbtk::Observable::addObserver ( Observer observer  )  [inherited]

void bbtk::GBoxModel::addOutputPort ( GPortModel outputport  )  [inherited]

Definition at line 72 of file GBoxModel.cxx.

References bbtk::GBoxModel::_outputs.

Referenced by bbtk::wxVtkSceneManager::createGComplexBoxInputPort(), and bbtk::wxVtkSceneManager::createGOutputPort().

00073         {
00074                 _outputs.push_back(outputport);
00075         }

Here is the caller graph for this function:

std::string bbtk::GObjectModel::getBBTKName (  )  [inherited]

std::string bbtk::GObjectModel::getBBTKType (  )  [inherited]

void bbtk::GObjectModel::getCenter ( double &  x,
double &  y,
double &  z 
) [inherited]

int bbtk::GComplexBoxPortModel::getComplexPortType (  ) 

Definition at line 100 of file GComplexBoxPortModel.cxx.

References _complexPortType.

Referenced by bbtk::vtkGComplexBoxPortView::updateColors().

00101         {
00102                 return _complexPortType;
00103         }

Here is the caller graph for this function:

void bbtk::GObjectModel::getFinalPoint ( double &  x,
double &  y,
double &  z 
) [inherited]

int bbtk::GObjectModel::getGObjectType (  )  [inherited]

Definition at line 109 of file GObjectModel.cxx.

References bbtk::GObjectModel::_gObjectType.

Referenced by bbtk::GObjectController::getGObjectType(), bbtk::wxVtkSceneManager::saveComplexBoxBBS(), and bbtk::wxVtkSceneManager::update().

00110         {
00111                 return _gObjectType;
00112         }

Here is the caller graph for this function:

void bbtk::GObjectModel::getInicPoint ( double &  x,
double &  y,
double &  z 
) [inherited]

GPortModel * bbtk::GBoxModel::getInputPort ( int  pos  )  [inherited]

Definition at line 173 of file GBoxModel.cxx.

References bbtk::GBoxModel::_inputs.

00174         {
00175                 return _inputs[pos];
00176         }

GPortModel * bbtk::GBoxModel::getInputPort ( std::string  name  )  [inherited]

Definition at line 145 of file GBoxModel.cxx.

References bbtk::GBoxModel::_inputs, and bbtk::GObjectModel::getBBTKName().

Referenced by bbtk::wxVtkSceneManager::addObjects(), bbtk::wxVtkSceneManager::configGConnetion(), bbtk::wxVtkSceneManager::DuplicateObjects(), and bbtk::vtkGBlackBoxView::update_X_Fin().

00146         {
00147                 for(int i = 0; i<(int)_inputs.size();i++)
00148                 {
00149                         if(_inputs[i]->getBBTKName()==name)
00150                         {
00151                                 return _inputs[i];
00152                         }
00153                 }
00154                 return NULL;
00155         }

Here is the call graph for this function:

Here is the caller graph for this function:

std::vector< GPortModel * > bbtk::GBoxModel::getInputPorts (  )  [inherited]

int bbtk::GBoxModel::getNumInputPorts (  )  [inherited]

Definition at line 79 of file GBoxModel.cxx.

References bbtk::GBoxModel::_inputs.

Referenced by bbtk::wxVtkSceneManager::addObjects(), bbtk::wxVtkSceneManager::DuplicateObjects(), and bbtk::vtkGBlackBoxView::update_X_Fin().

00080         {
00081                 return _inputs.size();
00082         }

Here is the caller graph for this function:

int bbtk::GBoxModel::getNumOutputPorts (  )  [inherited]

Definition at line 86 of file GBoxModel.cxx.

References bbtk::GBoxModel::_outputs.

Referenced by bbtk::vtkGBlackBoxView::update_X_Fin().

00087         {
00088                 return _outputs.size();
00089         }

Here is the caller graph for this function:

int bbtk::GObjectModel::getObjectId (  )  [inherited]

GPortModel * bbtk::GBoxModel::getOutputPort ( int  pos  )  [inherited]

Definition at line 180 of file GBoxModel.cxx.

References bbtk::GBoxModel::_outputs.

00181         {
00182                 return _outputs[pos];
00183         }

GPortModel * bbtk::GBoxModel::getOutputPort ( std::string  name  )  [inherited]

Definition at line 159 of file GBoxModel.cxx.

References bbtk::GBoxModel::_outputs, and bbtk::GObjectModel::getBBTKName().

Referenced by bbtk::wxVtkSceneManager::addObjects(), bbtk::wxVtkSceneManager::configGConnetion(), bbtk::wxVtkSceneManager::DuplicateObjects(), and bbtk::vtkGBlackBoxView::update_X_Fin().

00160         {
00161                 for(int i = 0; i<(int)_outputs.size();i++)
00162                 {
00163                         if(_outputs[i]->getBBTKName()==name)
00164                         {
00165                                 return _outputs[i];
00166                         }
00167                 }
00168                 return NULL;
00169         }

Here is the call graph for this function:

Here is the caller graph for this function:

std::vector< GPortModel * > bbtk::GBoxModel::getOutputPorts (  )  [inherited]

Definition at line 130 of file GBoxModel.cxx.

References bbtk::GBoxModel::_outputs.

Referenced by bbtk::wxVtkSceneManager::deleteObject().

00131         {
00132                 return _outputs;
00133         }

Here is the caller graph for this function:

std::string bbtk::GComplexBoxPortModel::getStatusText (  )  [virtual]

Reimplemented from bbtk::GBoxModel.

Definition at line 65 of file GComplexBoxPortModel.cxx.

References bbtk::GObjectModel::_bbtkName.

00066         {
00067                 std::string temp = "";
00068                 temp+=_bbtkName;
00069                 
00070                 return temp;
00071         }

bool bbtk::GObjectModel::isPointInside ( double  x,
double  y,
double  z 
) [virtual, inherited]

Definition at line 116 of file GObjectModel.cxx.

References bbtk::GObjectModel::_xFin, bbtk::GObjectModel::_xInic, and bbtk::GObjectModel::_yFin.

Referenced by bbtk::vtkGObjectView::isPointInside().

00117         {
00118                 if(x>=_xInic && x<=_xFin && y<=_yInic && y>=_yFin)
00119                 {
00120                         return true;
00121                 }
00122                 else
00123                 {
00124                         return false;
00125                 }
00126         }

Here is the caller graph for this function:

void bbtk::GBoxModel::move ( double  xx,
double  yy,
double  zz 
) [virtual, inherited]

Reimplemented from bbtk::GObjectModel.

Definition at line 93 of file GBoxModel.cxx.

References bbtk::GBoxModel::_inputs, bbtk::GBoxModel::_outputs, and bbtk::GBoxModel::setInicPoint().

Referenced by bbtk::wxVtkSceneManager::DuplicateObjects().

00094         {
00095                 setInicPoint(xx,yy,zz);
00096 
00097                 //Refresh inputs position
00098                 int i;
00099                 for(i=0;i<(int)_inputs.size();i++)
00100                 {
00101                         _inputs[i]->updatePortPosition();
00102                 }
00103                 
00104                 //Refresh outputs position
00105                 for(i=0;i<(int)_outputs.size();i++)
00106                 {
00107                         _outputs[i]->updatePortPosition();
00108                 }
00109 
00110         }

Here is the call graph for this function:

Here is the caller graph for this function:

void bbtk::Observable::notifyObservers ( int  idCaller,
int  command = NO_COMMAND 
) [inherited]

void bbtk::GBoxModel::removeColons ( std::string &  text  )  [inherited]

Definition at line 215 of file GBoxModel.cxx.

00216         {
00217                 std::string character(":");                             
00218                 size_t pos;
00219                 pos = text.find(character);
00220                 while(pos != std::string::npos)
00221                 {
00222                         //We replace the character ":" with "&&2P&&" for all the string
00223                         text.replace(pos, character.length(),"&&2P&&");
00224                         pos = text.find(character, pos);
00225                         }
00226         }

void bbtk::GComplexBoxPortModel::save ( std::string &  content  )  [virtual]

Reimplemented from bbtk::GBoxModel.

Definition at line 75 of file GComplexBoxPortModel.cxx.

References bbtk::GObjectModel::_bbtkName, bbtk::GObjectModel::_xInic, bbtk::GObjectModel::_yInic, and bbtk::GObjectModel::_zInic.

00076         {
00077                 content+="COMPLEX_PORT\n";
00078                 // Box info
00079                 content+=_bbtkName;
00080                 content+="\n";
00081                 
00082                 //Box Position
00083                 char buffer [50];
00084                 sprintf (buffer, "%f", _xInic);
00085                 content+=buffer;
00086                 content+=":";
00087                 sprintf (buffer, "%f", _yInic);
00088                 content+=buffer;
00089                 content+=":";
00090                 sprintf (buffer, "%f", _zInic);
00091                 content+=buffer;
00092                 content+="\n";
00093 
00094                 content+="FIN_COMPLEX_PORT\n";
00095 
00096         }

void bbtk::GObjectModel::setBBTKName ( std::string  obname  )  [inherited]

void bbtk::GObjectModel::setBBTKType ( std::string  obtype  )  [inherited]

void bbtk::GComplexBoxPortModel::setComplexPortType ( int  pType  ) 

Definition at line 107 of file GComplexBoxPortModel.cxx.

References _complexPortType.

Referenced by bbtk::wxVtkSceneManager::createGComplexBoxInputPort(), and bbtk::wxVtkSceneManager::createGComplexBoxOutputPort().

00108         {
00109                 _complexPortType=pType;
00110         }

Here is the caller graph for this function:

void bbtk::GObjectModel::setFinalPoint ( double &  x,
double &  y,
double &  z 
) [virtual, inherited]

void bbtk::GObjectModel::setGObjectType ( int  obtype  )  [inherited]

Definition at line 102 of file GObjectModel.cxx.

References bbtk::GObjectModel::_gObjectType.

Referenced by bbtk::wxVtkSceneManager::createGConnector(), and bbtk::GObjectsMVCFactory::createGObjectModel().

00103         {
00104                 _gObjectType = gObjectType;
00105         }

Here is the caller graph for this function:

void bbtk::GComplexBoxPortModel::setInicPoint ( double &  x,
double &  y,
double &  z 
) [virtual]

Reimplemented from bbtk::GBoxModel.

Definition at line 55 of file GComplexBoxPortModel.cxx.

References bbtk::COMPLEXPORT_HEIGHT, bbtk::COMPLEXPORT_WIDTH, and bbtk::GObjectModel::setFinalPoint().

Referenced by bbtk::wxVtkSceneManager::createGComplexBoxInputPort(), and bbtk::wxVtkSceneManager::createGComplexBoxOutputPort().

00056         {
00057                 GObjectModel::setInicPoint(x,y,z);
00058 
00059                 double xFin=x+COMPLEXPORT_WIDTH,yFin=y-COMPLEXPORT_HEIGHT;
00060                 setFinalPoint(xFin,yFin,z);
00061         }

Here is the call graph for this function:

Here is the caller graph for this function:

void bbtk::GObjectModel::setObjectId ( int  id  )  [inherited]

Definition at line 180 of file GObjectModel.cxx.

References bbtk::GObjectModel::_objectId.

Referenced by bbtk::GObjectController::setId().

00181         {
00182                 _objectId=id;
00183         }

Here is the caller graph for this function:

void bbtk::GBoxModel::updatePorts (  )  [inherited]

Definition at line 187 of file GBoxModel.cxx.

References bbtk::GBoxModel::_inputs, bbtk::GObjectModel::_objectId, and bbtk::GBoxModel::_outputs.

Referenced by bbtk::vtkGBoxView::updatePorts().

00188         {
00189                 for(int i = 0; i<(int)_inputs.size();i++)
00190                 {       
00191                         _inputs[i]->updatePortPosition();
00192                         _inputs[i]->notifyObservers(_objectId);
00193                 }
00194 
00195                 for(int i = 0; i<_outputs.size();i++)
00196                 {
00197                         _outputs[i]->updatePortPosition();
00198                         _outputs[i]->notifyObservers(_objectId);
00199                 }
00200         }

Here is the caller graph for this function:


Member Data Documentation

std::string bbtk::GObjectModel::_bbtkName [protected, inherited]

std::string bbtk::GObjectModel::_bbtkType [protected, inherited]

Definition at line 79 of file GComplexBoxPortModel.h.

Referenced by getComplexPortType(), and setComplexPortType().

int bbtk::GObjectModel::_gObjectType [protected, inherited]

std::vector<GPortModel*> bbtk::GBoxModel::_inputs [protected, inherited]

int bbtk::GObjectModel::_objectId [protected, inherited]

std::vector<GPortModel*> bbtk::GBoxModel::_outputs [protected, inherited]

double bbtk::GObjectModel::_xFin [protected, inherited]

double bbtk::GObjectModel::_xInic [protected, inherited]

double bbtk::GObjectModel::_yFin [protected, inherited]

double bbtk::GObjectModel::_yInic [protected, inherited]

double bbtk::GObjectModel::_zFin [protected, inherited]

double bbtk::GObjectModel::_zInic [protected, inherited]


The documentation for this class was generated from the following files:

Generated on Thu May 31 15:13:23 2012 for bbtkGEditor by  doxygen 1.5.7.1