bbtk::GPortModel Class Reference

#include <GPortModel.h>

Inheritance diagram for bbtk::GPortModel:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

 GPortModel ()
virtual ~GPortModel ()
void registerInBox (GBoxModel *blackBox, int portType, int pos)
void updatePortPosition ()
int getPortType ()
GBoxModelgetParentBox ()
int getPosInBox ()
bool isConnected ()
void setConnected (bool value)
bool isValueSet ()
void setValue (std::string value)
std::string getValue ()
virtual std::string getStatusText ()
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)
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

GBoxModel_parentBox
int _portType
int _posInBox
bool _isConnected
std::string _value
bool _isValueSet


Detailed Description

Definition at line 64 of file GPortModel.h.


Constructor & Destructor Documentation

bbtk::GPortModel::GPortModel (  ) 

Definition at line 48 of file GPortModel.cxx.

References _isConnected, _isValueSet, _parentBox, _portType, _posInBox, and _value.

00048                             {
00049         _parentBox = NULL ;
00050         _portType = -1 ;
00051         _posInBox = 0 ;
00052         _isConnected = false ;
00053         _value = "" ;
00054         _isValueSet = false ;
00055     }

bbtk::GPortModel::~GPortModel (  )  [virtual]

Definition at line 59 of file GPortModel.cxx.

00059                              {
00060     }


Member Function Documentation

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

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]

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

GBoxModel * bbtk::GPortModel::getParentBox (  ) 

int bbtk::GPortModel::getPortType (  ) 

Definition at line 100 of file GPortModel.cxx.

References _portType.

Referenced by bbtk::wxVtkSceneManager::OnLeftButtonDown(), and bbtk::wxVtkSceneManager::update().

00100                                  {
00101         return _portType ;
00102     }

Here is the caller graph for this function:

int bbtk::GPortModel::getPosInBox (  ) 

Definition at line 106 of file GPortModel.cxx.

References _posInBox.

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

00106                                  {
00107         return _posInBox ;
00108     }

Here is the caller graph for this function:

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

Reimplemented from bbtk::GObjectModel.

Definition at line 112 of file GPortModel.cxx.

References bbtk::GObjectModel::_bbtkName, bbtk::GObjectModel::_bbtkType, _value, and isValueSet().

00112                                          {
00113         std::string temp = "" ;
00114 
00115         temp += _bbtkName ;
00116         if ( isValueSet( ) ) {
00117             temp += "(" ;
00118             temp += _value ;
00119             temp += ")" ;
00120         }
00121         temp += " " ;
00122         temp += _bbtkType ;
00123 
00124         return temp ;
00125     }

Here is the call graph for this function:

std::string bbtk::GPortModel::getValue (  ) 

Definition at line 160 of file GPortModel.cxx.

References _value.

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

00160                                     {
00161         return _value ;
00162     }

Here is the caller graph for this function:

bool bbtk::GPortModel::isConnected (  ) 

Definition at line 135 of file GPortModel.cxx.

References _isConnected.

Referenced by bbtk::wxBlackBoxEditionDialog::constructBlackBoxEditionDialog(), and bbtk::vtkGPortView::updateColors().

00135                                   {
00136         return _isConnected ;
00137     }

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:

bool bbtk::GPortModel::isValueSet (  ) 

Definition at line 166 of file GPortModel.cxx.

References _isValueSet.

Referenced by bbtk::wxVtkSceneManager::getDiagramBBS(), getStatusText(), bbtk::wxVtkSceneManager::saveComplexBoxBBS(), and bbtk::vtkGPortView::updateColors().

00166                                  {
00167         return _isValueSet ;
00168     }

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::GPortModel::registerInBox ( GBoxModel blackBox,
int  portType,
int  pos 
)

Definition at line 63 of file GPortModel.cxx.

References _parentBox, _portType, _posInBox, and updatePortPosition().

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

00063                                                                                  {
00064         _parentBox = blackBox ;
00065         _portType = portType ;
00066         _posInBox = pos ;
00067 
00068         updatePortPosition( ) ;
00069 
00070     }

Here is the call graph for this function:

Here is the caller graph for this function:

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

Reimplemented from bbtk::GObjectModel.

Definition at line 172 of file GPortModel.cxx.

References bbtk::GObjectModel::_bbtkName, and _value.

00172                                               {
00173         content += "PORT\n" ;
00174 
00175         // Port value info
00176         content += _bbtkName ;
00177         content += ":" ;
00178         content += _value ;
00179         content += "\n" ;
00180     }

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

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

void bbtk::GPortModel::setConnected ( bool  value  ) 

Definition at line 141 of file GPortModel.cxx.

References _isConnected, bbtk::GObjectModel::_objectId, and bbtk::Observable::notifyObservers().

Referenced by bbtk::GConnectorModel::disconnectConnection(), bbtk::GConnectorModel::setEndPort(), and bbtk::GConnectorModel::setStartPort().

00141                                               {
00142         _isConnected = value ;
00143         notifyObservers( _objectId ) ;
00144     }

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(), bbtk::GConnectorModel::setStartPort(), and updatePortPosition().

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

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::GPortModel::setValue ( std::string  value  ) 

Definition at line 148 of file GPortModel.cxx.

References _isValueSet, bbtk::GObjectModel::_objectId, _value, and bbtk::Observable::notifyObservers().

00148                                                {
00149         _value = value ;
00150         if ( _value == "" ) {
00151             _isValueSet = false ;
00152         } else {
00153             _isValueSet = true ;
00154         }
00155         notifyObservers( _objectId ) ;
00156     }

Here is the call graph for this function:

void bbtk::GPortModel::updatePortPosition (  ) 

Definition at line 74 of file GPortModel.cxx.

References _parentBox, _portType, _posInBox, bbtk::GObjectModel::getFinalPoint(), bbtk::GObjectModel::getInicPoint(), bbtk::GINPUTPORT, bbtk::GOUTPUTPORT, bbtk::PORT_HEIGHT, bbtk::PORT_WIDTH, bbtk::GObjectModel::setFinalPoint(), and bbtk::GObjectModel::setInicPoint().

Referenced by registerInBox().

00074                                          {
00075         double xInic , yInic , zInic , xFin , yFin , zFin ;
00076         _parentBox->getInicPoint( xInic , yInic , zInic ) ;
00077         _parentBox->getFinalPoint( xFin , yFin , zFin ) ;
00078 
00079         double posX = xInic , posY = yInic , posZ = zInic ;
00080         if ( _portType == GOUTPUTPORT ) {
00081             posY = yFin ;
00082         } else if ( _portType == GINPUTPORT ) {
00083             posY = yInic + PORT_HEIGHT ;
00084         }
00085 
00086         //Attribute '_posInBox' starts with value 0 and it represents the position of the port in the box from left to right
00087         posX = xInic + ( PORT_WIDTH / 2 ) + _posInBox * 1.1 * PORT_WIDTH ;
00088 
00089         setInicPoint( posX , posY , posZ ) ;
00090 
00091         posX = posX + PORT_WIDTH ;
00092         posY = posY - PORT_HEIGHT ;
00093 
00094         setFinalPoint( posX , posY , posZ ) ;
00095 
00096     }

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]

Definition at line 113 of file GPortModel.h.

Referenced by GPortModel(), isConnected(), and setConnected().

Definition at line 116 of file GPortModel.h.

Referenced by GPortModel(), isValueSet(), and setValue().

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

Definition at line 105 of file GPortModel.h.

Referenced by getParentBox(), GPortModel(), registerInBox(), and updatePortPosition().

Definition at line 108 of file GPortModel.h.

Referenced by getPortType(), GPortModel(), registerInBox(), and updatePortPosition().

Definition at line 111 of file GPortModel.h.

Referenced by getPosInBox(), GPortModel(), registerInBox(), and updatePortPosition().

std::string bbtk::GPortModel::_value [private]

Definition at line 115 of file GPortModel.h.

Referenced by getStatusText(), getValue(), GPortModel(), save(), and setValue().

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