bbtk::GPortController Class Reference

#include <GPortController.h>

Inheritance diagram for bbtk::GPortController:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

 GPortController ()
 ~GPortController ()
virtual bool OnLeftButtonDown ()
virtual bool OnLeftButtonUp ()
void setModelAndView (GObjectModel *model, vtkGObjectView *view)
int getGObjectType ()
GObjectModelgetModel ()
vtkGObjectViewgetView ()
std::string getStatusText ()
int getId ()
void setId (int id)
virtual void removeFromScene ()

Protected Member Functions

virtual bool OnMouseMove ()
virtual bool OnLeftDClick ()
virtual bool OnMiddleButtonDown ()
virtual void moveObject (int X, int Y)

Protected Attributes

GObjectModel_model
vtkGObjectView_view
bool _isLeftClickDown


Detailed Description

Definition at line 62 of file GPortController.h.


Constructor & Destructor Documentation

bbtk::GPortController::GPortController (  ) 

Definition at line 44 of file GPortController.cxx.

References bbtk::GObjectController::_isLeftClickDown.

00045         {
00046                 _isLeftClickDown=false;
00047         }

bbtk::GPortController::~GPortController (  ) 

Definition at line 50 of file GPortController.cxx.

00051         {
00052         }


Member Function Documentation

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

int bbtk::GObjectController::getId (  )  [inherited]

GObjectModel * bbtk::GObjectController::getModel (  )  [inherited]

std::string bbtk::GObjectController::getStatusText (  )  [inherited]

Definition at line 181 of file GObjectController.cxx.

References bbtk::GObjectController::_model, and bbtk::GObjectModel::getStatusText().

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

00181                                                 {
00182         return _model->getStatusText( ) ;
00183     }

Here is the call graph for this function:

Here is the caller graph for this function:

vtkGObjectView * bbtk::GObjectController::getView (  )  [inherited]

void bbtk::GObjectController::moveObject ( int  X,
int  Y 
) [protected, virtual, inherited]

Definition at line 145 of file GObjectController.cxx.

References bbtk::GObjectController::_view, and bbtk::vtkGObjectView::moveObject().

00145                                                       {
00146         _view->moveObject( X , Y ) ;
00147     }

Here is the call graph for this function:

bool bbtk::GPortController::OnLeftButtonDown (  )  [virtual]

Reimplemented from bbtk::GObjectController.

Definition at line 55 of file GPortController.cxx.

References bbtk::GObjectController::_isLeftClickDown, bbtk::GObjectController::_view, bbtk::vtkGObjectView::getState(), and bbtk::HIGHLIGHTED.

00056         {
00057 
00058                 int state  = _view->getState();
00059 
00060                 //Evaluate new state
00061                 if(state == HIGHLIGHTED)
00062                 {
00063                         _isLeftClickDown=true;
00064                 }
00065                 return true;
00066         }

Here is the call graph for this function:

bool bbtk::GPortController::OnLeftButtonUp (  )  [virtual]

Reimplemented from bbtk::GObjectController.

Definition at line 68 of file GPortController.cxx.

References bbtk::GObjectController::_isLeftClickDown, bbtk::GObjectController::_model, bbtk::GObjectController::_view, bbtk::FIN_CREATION_CONTOUR, bbtk::GObjectController::getId(), bbtk::vtkGObjectView::getState(), bbtk::GINPUTPORT, bbtk::GOUTPUTPORT, bbtk::HIGHLIGHTED, bbtk::INIT_CREATION_CONTOUR, bbtk::NOTHING_HAPPENS, bbtk::Observable::notifyObservers(), and bbtk::vtkGObjectView::setState().

00069         {
00070                 int state  = _view->getState();
00071                 if(_isLeftClickDown)
00072                 {
00073                         if(state==HIGHLIGHTED)
00074                         {
00075                                 int portType = ((GPortModel*)_model)->getPortType();
00076 
00077                                 //Evaluate new state
00078                                 if(portType==GOUTPUTPORT)
00079                                 {
00080                                         _model->notifyObservers(getId(),INIT_CREATION_CONTOUR);
00081                                 }
00082                                 else if (portType==GINPUTPORT)
00083                                 {
00084                                         _model->notifyObservers(getId(),FIN_CREATION_CONTOUR);
00085                                 }
00086                         }
00087                         else
00088                         {
00089                                 _view->setState(NOTHING_HAPPENS);
00090                         }
00091                         _isLeftClickDown=false;
00092                 }
00093 
00094                 return true;
00095         }

Here is the call graph for this function:

bool bbtk::GObjectController::OnLeftDClick (  )  [protected, virtual, inherited]

Reimplemented in bbtk::GConnectorController.

Definition at line 130 of file GObjectController.cxx.

00131     {
00132 
00133         return true ;
00134     }

bool bbtk::GObjectController::OnMiddleButtonDown (  )  [protected, virtual, inherited]

Reimplemented in bbtk::GBlackBoxController, bbtk::GBoxController, and bbtk::GConnectorController.

Definition at line 138 of file GObjectController.cxx.

00139     {
00140         return true ;
00141     }

bool bbtk::GObjectController::OnMouseMove (  )  [protected, virtual, inherited]

Reimplemented in bbtk::GBlackBoxController, bbtk::GBoxController, and bbtk::GConnectorController.

Definition at line 65 of file GObjectController.cxx.

References bbtk::GObjectController::_model, bbtk::GObjectController::_view, bbtk::GObjectController::getId(), bbtk::vtkGObjectView::getState(), bbtk::HIGHLIGHTED, bbtk::vtkGObjectView::isPointInside(), bbtk::NOTHING_HAPPENS, bbtk::Observable::notifyObservers(), bbtk::POSSIBLE_CONNECTION, bbtk::SELECTED_POSSIBLE_CONNECTION, and bbtk::vtkGObjectView::setState().

00065                                          {
00066         int X , Y ;
00067         wxVTKRenderWindowInteractor *_wxVTKiren ;
00068         _wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView( )->GetWxVTKRenderWindowInteractor( ) ;
00069         _wxVTKiren->GetEventPosition( X , Y ) ;
00070         int state = _view->getState( ) ;
00071 
00072 
00073         //Evaluate new state
00074         if ( state == NOTHING_HAPPENS ) {
00075             if ( _view->isPointInside( X , Y ) ) {
00076                 _view->setState( HIGHLIGHTED ) ;
00077             }
00078         }
00079         if ( state == HIGHLIGHTED ) {
00080             if ( !_view->isPointInside( X , Y ) ) {
00081                 _view->setState( NOTHING_HAPPENS ) ;
00082             }
00083         }
00084 
00085         // JGRR & CM WH
00086 
00087         if ( state == POSSIBLE_CONNECTION ) {
00088             if ( _view->isPointInside( X , Y ) ) {
00089                 _view->setState( SELECTED_POSSIBLE_CONNECTION ) ;
00090             }
00091         }
00092 
00093         if ( state == SELECTED_POSSIBLE_CONNECTION ) {
00094             if ( !_view->isPointInside( X , Y ) ) {
00095                 _view->setState( POSSIBLE_CONNECTION ) ;
00096             }
00097         }
00098 
00099         // EO JGRR & CM WH
00100 
00101         _model->notifyObservers( getId( ) ) ;
00102 
00103 
00104         return true ;
00105     }

Here is the call graph for this function:

void bbtk::GObjectController::removeFromScene (  )  [virtual, inherited]

Reimplemented in bbtk::GConnectorController.

Definition at line 187 of file GObjectController.cxx.

References bbtk::GObjectController::_view, and bbtk::vtkGObjectView::removeFromScene().

Referenced by bbtk::wxVtkSceneManager::deleteAllBoxes(), and bbtk::wxVtkSceneManager::deleteObject().

00187                                              {
00188         _view->removeFromScene( ) ;
00189     }

Here is the call graph for this function:

Here is the caller graph for this function:

void bbtk::GObjectController::setId ( int  id  )  [inherited]

Definition at line 175 of file GObjectController.cxx.

References bbtk::GObjectController::_model, and bbtk::GObjectModel::setObjectId().

00175                                           {
00176         _model->setObjectId( id ) ;
00177     }

Here is the call graph for this function:

void bbtk::GObjectController::setModelAndView ( GObjectModel model,
vtkGObjectView view 
) [inherited]


Member Data Documentation

bool bbtk::GObjectController::_isLeftClickDown [protected, inherited]


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

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