bbtk::GConnectorModel Class Reference

#include <GConnectorModel.h>

Inheritance diagram for bbtk::GConnectorModel:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

 GConnectorModel ()
 ~GConnectorModel ()
void setStartPort (GPortModel *startPort)
void setEndPort (GPortModel *endPort)
void setManualContourModel (manualContourModel *model)
manualContourModel * getManualContourModel ()
GPortModelgetStartPort ()
GPortModelgetEndPort ()
void updateStartEndPoints ()
void disconnectConnection ()
virtual void save (std::string &content)
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 setInicPoint (double &x, double &y, double &z)
virtual void setFinalPoint (double &x, double &y, double &z)
virtual void move (double xx, double yy, double zz)
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)
virtual std::string getStatusText ()
void addObserver (Observer *observer)
void notifyObservers (int idCaller, int command=NO_COMMAND)

Protected Attributes

double _xInic
double _yInic
double _zInic
double _xFin
double _yFin
double _zFin
int _objectId
int _gObjectType
std::string _bbtkType
std::string _bbtkName

Private Attributes

GPortModel_startPort
GPortModel_endPort
manualContourModel * _model


Detailed Description

Definition at line 56 of file GConnectorModel.h.


Constructor & Destructor Documentation

bbtk::GConnectorModel::GConnectorModel (  ) 

Definition at line 44 of file GConnectorModel.cxx.

References _endPort, and _startPort.

00045         {               
00046                 _startPort = NULL;
00047                 _endPort = NULL;
00048         }

bbtk::GConnectorModel::~GConnectorModel (  ) 

Definition at line 52 of file GConnectorModel.cxx.

00053         {
00054         }


Member Function Documentation

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

void bbtk::GConnectorModel::disconnectConnection (  ) 

Definition at line 143 of file GConnectorModel.cxx.

References _endPort, _startPort, and bbtk::GPortModel::setConnected().

Referenced by bbtk::GConnectorController::removeFromScene().

00144         {
00145                 if(_startPort!=NULL)
00146                 {
00147                         _startPort->setConnected(false);                        
00148                 }
00149 
00150                 if(_endPort!=NULL)
00151                 {
00152                         _endPort->setConnected(false);
00153                 }
00154         }

Here is the call graph for this function:

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]

Definition at line 77 of file GObjectModel.cxx.

References bbtk::GObjectModel::_xFin, bbtk::GObjectModel::_xInic, bbtk::GObjectModel::_yFin, bbtk::GObjectModel::_yInic, bbtk::GObjectModel::_zFin, and bbtk::GObjectModel::_zInic.

Referenced by bbtk::wxVtkSceneManager::OnMouseMove(), setEndPort(), setStartPort(), and updateStartEndPoints().

00078         {
00079                 x = (_xInic+_xFin)/2;
00080                 y = (_yInic+_yFin)/2;
00081                 z = (_zInic+_zFin)/2;
00082         }

Here is the caller graph for this function:

GPortModel * bbtk::GConnectorModel::getEndPort (  ) 

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]

manualContourModel * bbtk::GConnectorModel::getManualContourModel (  ) 

Definition at line 106 of file GConnectorModel.cxx.

References _model.

00107         {
00108                 return _model;
00109         }

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

GPortModel * bbtk::GConnectorModel::getStartPort (  ) 

std::string bbtk::GObjectModel::getStatusText (  )  [virtual, inherited]

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

Definition at line 165 of file GObjectModel.cxx.

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

00166         {
00167                 std::string virt = "";
00168                 return virt;
00169         }

Here is the caller graph for this function:

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::GObjectModel::move ( double  xx,
double  yy,
double  zz 
) [virtual, inherited]

Reimplemented in bbtk::GBoxModel.

Definition at line 130 of file GObjectModel.cxx.

References bbtk::GObjectModel::setInicPoint().

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

00131         {
00132                 setInicPoint(xx,yy,zz);
00133         }

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

Reimplemented from bbtk::GObjectModel.

Definition at line 158 of file GConnectorModel.cxx.

References _endPort, _model, _startPort, bbtk::GObjectModel::getBBTKName(), and bbtk::GPortModel::getParentBox().

00159         {
00160                 char buffer[50];
00161 
00162                 content+="CONNECTION\n";
00163 
00164                 // Connection info
00165                 content+=_startPort->getParentBox()->getBBTKName();
00166                 content+=":";
00167                 content+=_startPort->getBBTKName();
00168                 content+=":";
00169                 content+=_endPort->getParentBox()->getBBTKName();
00170                 content+=":";
00171                 content+=_endPort->getBBTKName();
00172                 content+="\n";
00173                 
00174                 int i,sizeLstPoints = _model->GetSizeLstPoints()-2;
00175                 content+="NumberOfControlPoints:";
00176                 sprintf (buffer, "%d", sizeLstPoints );
00177                 content+=buffer;
00178                 content+="\n";
00179                 
00180                 for (i=0;i<sizeLstPoints;i++)
00181                 {
00182                         manualPoint *mp = _model->GetManualPoint(i+1);
00183                         sprintf (buffer, "%f:%f:%f\n", (float)mp->GetX(),(float)mp->GetY(),(float)mp->GetZ() );
00184                         content+=buffer;
00185                 }               
00186         }

Here is the call graph for this function:

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

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

void bbtk::GConnectorModel::setEndPort ( GPortModel endPort  ) 

Definition at line 73 of file GConnectorModel.cxx.

References _endPort, _model, bbtk::GObjectModel::getCenter(), bbtk::GObjectModel::getInicPoint(), bbtk::GPortModel::setConnected(), and bbtk::GObjectModel::setFinalPoint().

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

00074         {
00075                 _endPort = endPort;
00076                 endPort->setConnected(true);
00077 
00078                 double xCenter,yCenter,zCenter;         
00079                 endPort->getCenter(xCenter,yCenter,zCenter);
00080                 double xIport,yIport,zIport;
00081                 endPort->getInicPoint(xIport,yIport,zIport);
00082 
00083                 setFinalPoint(xCenter,yIport,zCenter);
00084 
00085                 // Sets the last point of the contour model in the position of the end input port
00086                 manualPoint* point = _model->GetManualPoint(_model->GetSizeLstPoints()-1);
00087                 point->SetPoint(xCenter,yIport,zCenter);
00088         }

Here is the call graph for this function:

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

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

Definition at line 85 of file GObjectModel.cxx.

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

Referenced by bbtk::GObjectModel::move(), setStartPort(), and bbtk::GPortModel::updatePortPosition().

00086         {
00087                 _xInic = x;
00088                 _yInic = y;
00089                 _zInic = z;
00090                 
00091         }

Here is the caller graph for this function:

void bbtk::GConnectorModel::setManualContourModel ( manualContourModel *  model  ) 

Definition at line 113 of file GConnectorModel.cxx.

References _model.

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

00114         {
00115                 _model = model;
00116         }

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::GConnectorModel::setStartPort ( GPortModel startPort  ) 

Definition at line 58 of file GConnectorModel.cxx.

References _startPort, bbtk::GObjectModel::getCenter(), bbtk::GObjectModel::getFinalPoint(), bbtk::GPortModel::setConnected(), and bbtk::GObjectModel::setInicPoint().

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

00059         {
00060                 _startPort = startPort;
00061                 startPort->setConnected(true);
00062                 
00063                 double xCenter,yCenter,zCenter;
00064                 startPort->getCenter(xCenter,yCenter,zCenter);
00065                 double xFport,yFport,zFport;
00066                 startPort->getFinalPoint(xFport,yFport,zFport);
00067 
00068                 setInicPoint(xCenter,yFport,zCenter);
00069         }

Here is the call graph for this function:

Here is the caller graph for this function:

void bbtk::GConnectorModel::updateStartEndPoints (  ) 

Definition at line 120 of file GConnectorModel.cxx.

References _endPort, _model, _startPort, bbtk::GObjectModel::getCenter(), bbtk::GObjectModel::getFinalPoint(), and bbtk::GObjectModel::getInicPoint().

Referenced by bbtk::vtkGConnectorView::updateStartEndPoints().

00121         {
00122                 //Start Point
00123                 double xCenter,yCenter,zCenter;         
00124                 _startPort->getCenter(xCenter,yCenter,zCenter);
00125                 double xport,yport,zport;
00126                 _startPort->getFinalPoint(xport,yport,zport);
00127 
00128                 // Refresh the position of the contourModel first point with the data of the connector model
00129                 manualPoint* point = _model->GetManualPoint(0);
00130                 point->SetPoint(xCenter,yport,zCenter);
00131 
00132                 //End Point     
00133                 _endPort->getCenter(xCenter,yCenter,zCenter);
00134                 _endPort->getInicPoint(xport,yport,zport);
00135 
00136                 // Refresh the position of the contourModel last point with the data of the connector model
00137                 point = _model->GetManualPoint(_model->GetSizeLstPoints()-1);
00138                 point->SetPoint(xCenter,yport,zCenter);
00139         }

Here is the call graph for this function:

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]

manualContourModel* bbtk::GConnectorModel::_model [private]

int bbtk::GObjectModel::_objectId [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:27 2012 for bbtkGEditor by  doxygen 1.5.7.1