X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FEditorGraphicBBS%2FbbsVtkGUIEditorGraphic%2FGObjectController.cxx;h=c4b0837ee52477062db225e0bfc1bba5e2f66a2c;hb=098558ac7780900858114a8ae01fe93847d67043;hp=f00541cc38624a249b5b7d4008233d6f849dc905;hpb=64fc9f949ff91d6e9d448ca0567e6205ee4d5be4;p=bbtkGEditor.git diff --git a/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GObjectController.cxx b/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GObjectController.cxx index f00541c..c4b0837 100644 --- a/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GObjectController.cxx +++ b/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GObjectController.cxx @@ -59,6 +59,133 @@ namespace bbtk } //========================================================================= +bool GObjectController::OnMouseMove() +{ + cout<<"RaC GObjectController::OnMouseMove "<GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor(); + _wxVTKiren->GetEventPosition( X , Y ); + + int state = _model->getState(); + + //Evaluate new state + if(state == CLICKED) + { + _model->setState(DRAG); + //MoveObject(X,Y); + + } + if(state == DRAG) + { + //MoveObject(X,Y); + + } + if(state == NOTHING_HAPPENS) + { + if(_view->isPointInside(X,Y)) + { + _model->setState(HIGHLIGHTED); + } + } + if(state==HIGHLIGHTED) + { + if(!_view->isPointInside(X,Y)) + { + _model->setState(NOTHING_HAPPENS); + } + } + + _view->update(); + } + return true; +} +//========================================================================= +bool GObjectController::OnLeftButtonDown() +{ + + if ( _vtkInteractorStyleBaseView!=NULL ) + { + int X,Y; + wxVTKRenderWindowInteractor *wxVTKiren; + wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor(); + wxVTKiren->GetEventPosition(X,Y); + + //MouseClickLeft(X,Y); + } + return true; +} +//========================================================================= +bool GObjectController::OnLeftButtonUp() +{ + if ( _vtkInteractorStyleBaseView!=NULL ) + { + int X,Y; + wxVTKRenderWindowInteractor *wxVTKiren; + wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor(); + wxVTKiren->GetEventPosition(X,Y); + //MouseReleaseLeft(X,Y); + } + return true; +} +//========================================================================= +bool GObjectController::OnLeftDClick() +{ + if ( _vtkInteractorStyleBaseView!=NULL ) + { + int X,Y; + wxVTKRenderWindowInteractor *wxVTKiren; + wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor(); + wxVTKiren->GetEventPosition(X,Y); + + //this->MouseDLeft(X,Y); + } + return true; +} +//========================================================================= +bool GObjectController::OnMiddleButtonDown() +{ + if ( _vtkInteractorStyleBaseView!=NULL ) + { + int X,Y; + wxVTKRenderWindowInteractor *wxVTKiren; + wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor(); + wxVTKiren->GetEventPosition(X,Y); + //GetManualViewBaseContour()->InitMove( X, Y,GetZ()); + } + return true; +} +//========================================================================= +bool GObjectController::OnMiddleButtonUp() +{ + return true; +} +//========================================================================= +bool GObjectController::OnRightButtonDown() +{ + if( _vtkInteractorStyleBaseView!= NULL ) + { + int X,Y; + wxVTKRenderWindowInteractor *wxVTKiren; + wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor(); + wxVTKiren->GetEventPosition(X, Y); + + //SetCompleteCreation( true ); + //SetKeyBoardMoving( false ); + //this->GetManualContourModel()->SetCloseContour(true); + //MouseClickRight(X,Y); + } + return true; +} +//========================================================================= +bool GObjectController::OnRightButtonUp() +{ + return true; +} +//========================================================================= + } // EO namespace bbtk // EOF