bbtk::GBoxModel Class Reference

#include <GBoxModel.h>

Inheritance diagram for bbtk::GBoxModel:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

 GBoxModel ()
 ~GBoxModel ()
virtual void setInicPoint (double &x, double &y, double &z)
void addInputPort (GPortModel *inputport)
void addOutputPort (GPortModel *outputport)
int getNumInputPorts ()
int getNumOutputPorts ()
virtual void move (double xx, double yy, double zz)
virtual std::string getStatusText ()
virtual void save (std::string &content)
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


Detailed Description

Definition at line 57 of file GBoxModel.h.


Constructor & Destructor Documentation

bbtk::GBoxModel::GBoxModel (  ) 

Definition at line 43 of file GBoxModel.cxx.

00044         {               
00045         }

bbtk::GBoxModel::~GBoxModel (  ) 

Definition at line 49 of file GBoxModel.cxx.

00050         {
00051         }


Member Function Documentation

void bbtk::GBoxModel::addColons ( std::string &  text  ) 

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  ) 

Definition at line 65 of file GBoxModel.cxx.

References _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  ) 

Definition at line 72 of file GBoxModel.cxx.

References _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]

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  ) 

Definition at line 173 of file GBoxModel.cxx.

References _inputs.

00174         {
00175                 return _inputs[pos];
00176         }

GPortModel * bbtk::GBoxModel::getInputPort ( std::string  name  ) 

Definition at line 145 of file GBoxModel.cxx.

References _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 (  ) 

Definition at line 123 of file GBoxModel.cxx.

References _inputs.

Referenced by bbtk::wxBlackBoxEditionDialog::constructBlackBoxEditionDialog(), bbtk::wxVtkSceneManager::deleteObject(), bbtk::wxVtkSceneManager::getDiagramBBS(), and bbtk::wxVtkSceneManager::saveComplexBoxBBS().

00124         {
00125                 return _inputs;
00126         }

Here is the caller graph for this function:

int bbtk::GBoxModel::getNumInputPorts (  ) 

Definition at line 79 of file GBoxModel.cxx.

References _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 (  ) 

Definition at line 86 of file GBoxModel.cxx.

References _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  ) 

Definition at line 180 of file GBoxModel.cxx.

References _outputs.

00181         {
00182                 return _outputs[pos];
00183         }

GPortModel * bbtk::GBoxModel::getOutputPort ( std::string  name  ) 

Definition at line 159 of file GBoxModel.cxx.

References _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 (  ) 

Definition at line 130 of file GBoxModel.cxx.

References _outputs.

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

00131         {
00132                 return _outputs;
00133         }

Here is the caller graph for this function:

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

Reimplemented from bbtk::GObjectModel.

Reimplemented in bbtk::GBlackBoxModel, and bbtk::GComplexBoxPortModel.

Definition at line 114 of file GBoxModel.cxx.

00115         {
00116                 std::string temp = "";
00117                 
00118                 return temp;
00119         }

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]

Reimplemented from bbtk::GObjectModel.

Definition at line 93 of file GBoxModel.cxx.

References _inputs, _outputs, and 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  ) 

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::GBoxModel::save ( std::string &  content  )  [virtual]

Reimplemented from bbtk::GObjectModel.

Reimplemented in bbtk::GBlackBoxModel, and bbtk::GComplexBoxPortModel.

Definition at line 137 of file GBoxModel.cxx.

00138         {
00139                 content+="\n";
00140         }

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

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

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::GBoxModel::setInicPoint ( double &  x,
double &  y,
double &  z 
) [virtual]

Reimplemented from bbtk::GObjectModel.

Reimplemented in bbtk::GComplexBoxPortModel.

Definition at line 55 of file GBoxModel.cxx.

References bbtk::BOX_HEIGHT, bbtk::BOX_WIDTH, and bbtk::GObjectModel::setFinalPoint().

Referenced by bbtk::wxVtkSceneManager::addObjects(), bbtk::wxVtkSceneManager::configGBlackBox(), bbtk::wxVtkSceneManager::configGComBoxInputOutputPort(), bbtk::wxVtkSceneManager::createGBlackBox(), bbtk::wxVtkSceneManager::DuplicateObjects(), and move().

00056         {
00057                 GObjectModel::setInicPoint(x,y,z);
00058 
00059                 double xFin=x+BOX_WIDTH,yFin=y-BOX_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 (  ) 

Definition at line 187 of file GBoxModel.cxx.

References _inputs, bbtk::GObjectModel::_objectId, and _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]

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

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

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

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

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:22 2012 for bbtkGEditor by  doxygen 1.5.7.1