X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FEditorGraphicBBS%2FbbsVtkGUIEditorGraphic%2FGObjectController.cxx;h=7926e68ca20b4050a064ddd4c2cc3a5c3c02616e;hb=3babfd57a9b4b3cffba34415e928239592e7d4a1;hp=0dffa0ec1a4d4d929ca092bde21663c4445e8e50;hpb=878ac6ad472bc459f4e364c16890e5026c401944;p=bbtkGEditor.git diff --git a/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GObjectController.cxx b/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GObjectController.cxx index 0dffa0e..7926e68 100644 --- a/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GObjectController.cxx +++ b/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GObjectController.cxx @@ -64,178 +64,64 @@ namespace bbtk bool GObjectController::OnMouseMove() { + int X,Y; + wxVTKRenderWindowInteractor *_wxVTKiren; + _wxVTKiren= _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor(); + _wxVTKiren->GetEventPosition( X , Y ); + int state = _view->getState(); - /********************** VIRTUAL *************************/ - - if ( _vtkInteractorStyleBaseView!=NULL) + //Evaluate new state + if( state == NOTHING_HAPPENS) { - int X,Y; - wxVTKRenderWindowInteractor *_wxVTKiren; - _wxVTKiren= _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor(); - _wxVTKiren->GetEventPosition( X , Y ); - - int state = _view->getState(); - - //Evaluate new state - if(!_model->hasChanged() && state == DRAG) + if(_view->isPointInside(X,Y)) { - moveObject(X,Y); - _model->setChanged(); - } - - if(!_model->hasChanged() && state == NOTHING_HAPPENS) - { - if(_view->isPointInside(X,Y)) - { - _view->setState(HIGHLIGHTED); - _model->setChanged(); - } - } - if(!_model->hasChanged() && state==HIGHLIGHTED) - { - if(!_view->isPointInside(X,Y)) - { - _view->setState(NOTHING_HAPPENS); - _model->setChanged(); - } - } - - _model->notifyObservers(_id); - + _view->setState(HIGHLIGHTED); + } } - - /**/ - - return true; - } - - //========================================================================= - - bool GObjectController::OnLeftButtonDown() - { - /********************** VIRTUAL ************************* - - if ( _vtkInteractorStyleBaseView!=NULL ) + if( state==HIGHLIGHTED) { - int X,Y; - wxVTKRenderWindowInteractor *wxVTKiren; - wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor(); - wxVTKiren->GetEventPosition(X,Y); - - int state = _model->getState(); - - //Evaluate new state - if(!_model->hasChanged() && state==HIGHLIGHTED) - { - _view->isStartDragging(true); - _model->setState(DRAG); - _model->setChanged(); - } - - if( !_model->hasChanged() && state == SELECTED) + if(!_view->isPointInside(X,Y)) { - if(_view->isPointInside(X,Y)) - { - _view->isStartDragging(true); - _model->setState(DRAG); - _model->setChanged(); - } + _view->setState(NOTHING_HAPPENS); } - - _model->notifyObservers(); } - - */ + + _model->notifyObservers(_id); + return true; } //========================================================================= - bool GObjectController::OnLeftButtonUp() + bool GObjectController::OnLeftButtonDown()//virtual { - - /********************** VIRTUAL ************************* - - if ( _vtkInteractorStyleBaseView!=NULL ) - { - int X,Y; - wxVTKRenderWindowInteractor *wxVTKiren; - wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor(); - wxVTKiren->GetEventPosition(X,Y); - - int state = _model->getState(); + int state = _view->getState(); - //Evaluate new state - if(!_model->hasChanged() && state==CLICKED) - { - _model->setState(SELECTED); - _model->setChanged(); - } - - if( !_model->hasChanged() && state == DRAG) - { - _model->setState(SELECTED); - _model->setChanged(); - } - - _model->notifyObservers(); - + //Evaluate new state + if(state == HIGHLIGHTED) + { + _isLeftClickDown=true; + _view->setState(SELECTED); + //_model->notifyObservers(_id, } - - */ return true; } //========================================================================= - bool GObjectController::OnLeftDClick() + bool GObjectController::OnLeftButtonUp()//virtual { - /********************** VIRTUAL ************************* - - if ( _vtkInteractorStyleBaseView!=NULL ) - { - int X,Y; - wxVTKRenderWindowInteractor *wxVTKiren; - wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor(); - wxVTKiren->GetEventPosition(X,Y); - _model->notifyObservers(); - } - - */ return true; } //========================================================================= - - bool GObjectController::OnRightButtonDown() + + bool GObjectController::OnLeftDClick()//virtual { - /********************** VIRTUAL *************************/ - - if( _vtkInteractorStyleBaseView!= NULL ) - { - int X,Y; - wxVTKRenderWindowInteractor *wxVTKiren; - wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor(); - wxVTKiren->GetEventPosition(X, Y); - - int state = _view->getState(); - - //Evaluate new state - if( !_model->hasChanged() && state == SELECTED) - { - _view->setState(NOTHING_HAPPENS); - _model->setChanged(); - } - - _model->notifyObservers(_id); - } - - /**/ return true; - } //========================================================================= @@ -282,6 +168,13 @@ namespace bbtk //========================================================================= + std::string GObjectController::getStatusText() + { + return _model->getStatusText(); + } + + //========================================================================= + } // EO namespace bbtk // EOF