bbtk::GBoxController Class Reference

#include <GBoxController.h>

Inheritance diagram for bbtk::GBoxController:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

 GBoxController ()
 ~GBoxController ()
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 OnLeftButtonDown ()
virtual bool OnLeftButtonUp ()
virtual bool OnMiddleButtonDown ()
virtual bool OnRightButtonUp ()
virtual bool OnLeftDClick ()
virtual void moveObject (int X, int Y)

Protected Attributes

GObjectModel_model
vtkGObjectView_view
bool _isLeftClickDown


Detailed Description

Definition at line 61 of file GBoxController.h.


Constructor & Destructor Documentation

bbtk::GBoxController::GBoxController (  ) 

Definition at line 47 of file GBoxController.cxx.

00048         {
00049 
00050         }

bbtk::GBoxController::~GBoxController (  ) 

Definition at line 53 of file GBoxController.cxx.

00054         {
00055         }


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::GBoxController::OnLeftButtonDown (  )  [protected, virtual]

Reimplemented from bbtk::GObjectController.

Reimplemented in bbtk::GBlackBoxController.

Definition at line 95 of file GBoxController.cxx.

References bbtk::GObjectController::_isLeftClickDown, bbtk::GObjectController::_model, bbtk::GObjectController::_view, bbtk::ADD_TO_SELECTED, bbtk::GObjectController::getId(), bbtk::vtkGObjectView::getState(), bbtk::HIGHLIGHTED, bbtk::Observable::notifyObservers(), bbtk::SELECTED, and bbtk::vtkGObjectView::setState().

00096         {
00097             bool ok=true;
00098 printf("EED GBoxController::OnLeftButtonDown \n");
00099                 int state  = _view->getState();
00100 
00101                 //Evaluate new state
00102                 if(state == HIGHLIGHTED)
00103                 {
00104                     ok=false;
00105                         _isLeftClickDown=true;
00106                         _view->setState(SELECTED);
00107                         _model->notifyObservers(getId(),ADD_TO_SELECTED);
00108                 }
00109                 return ok;
00110 
00111         }

Here is the call graph for this function:

bool bbtk::GBoxController::OnLeftButtonUp (  )  [protected, virtual]

Reimplemented from bbtk::GObjectController.

Reimplemented in bbtk::GBlackBoxController.

Definition at line 115 of file GBoxController.cxx.

References bbtk::GObjectController::_isLeftClickDown, bbtk::GObjectController::_model, bbtk::GObjectController::_view, bbtk::GObjectController::getId(), bbtk::vtkGObjectView::getState(), bbtk::vtkGObjectView::isPointInside(), bbtk::Observable::notifyObservers(), bbtk::SELECTED, and bbtk::vtkGObjectView::setState().

00116         {
00117                 int X,Y;
00118                 wxVTKRenderWindowInteractor *wxVTKiren;
00119                 wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
00120                 wxVTKiren->GetEventPosition(X,Y);
00121 
00122                 int state  = _view->getState();
00123                 //Evaluate new state
00124                 if(_isLeftClickDown)
00125                 {
00126                         _isLeftClickDown=false;
00127                         if(_view->isPointInside(X,Y))
00128                         {
00129                                 // It is supposed that I'm always inside even if the box is in drag
00130                                 _view->setState(SELECTED);
00131                                 _model->notifyObservers(getId());
00132                         }
00133                 }
00134         return true;
00135 
00136         }

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::GBoxController::OnMiddleButtonDown (  )  [protected, virtual]

Reimplemented from bbtk::GObjectController.

Reimplemented in bbtk::GBlackBoxController.

Definition at line 147 of file GBoxController.cxx.

00148         {
00149                 return true;
00150         }

bool bbtk::GBoxController::OnMouseMove (  )  [protected, virtual]

Reimplemented from bbtk::GObjectController.

Reimplemented in bbtk::GBlackBoxController.

Definition at line 58 of file GBoxController.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(), and bbtk::vtkGObjectView::setState().

00059         {
00060 
00061                 if ( _vtkInteractorStyleBaseView!=NULL)
00062                 {
00063                         int X,Y;
00064                         wxVTKRenderWindowInteractor *_wxVTKiren;
00065                         _wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
00066                         _wxVTKiren->GetEventPosition( X , Y );
00067 
00068                         int state  = _view->getState();
00069 
00070                         //Evaluate new state
00071 
00072                         if(state == NOTHING_HAPPENS)
00073                         {
00074                                 if(_view->isPointInside(X,Y))
00075                                 {
00076                                         _view->setState(HIGHLIGHTED);
00077                                 }
00078                         }
00079                         if( state==HIGHLIGHTED)
00080                         {
00081                                 if(!_view->isPointInside(X,Y))
00082                                 {
00083                                         _view->setState(NOTHING_HAPPENS);
00084                                 }
00085                         }
00086 
00087                         _model->notifyObservers(getId());
00088 
00089                 }
00090                 return true;
00091         }

Here is the call graph for this function:

bool bbtk::GBoxController::OnRightButtonUp (  )  [protected, virtual]

Reimplemented in bbtk::GBlackBoxController.

Definition at line 140 of file GBoxController.cxx.

00141         {
00142                 return true;
00143         }

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