]> Creatis software - bbtkGEditor.git/blobdiff - lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GObjectController.cxx
Changes to manage the events capturing in the vtkWorld. Some problems with that ....
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsVtkGUIEditorGraphic / GObjectController.cxx
index f00541cc38624a249b5b7d4008233d6f849dc905..fba50c45ef59811a2b094e1db6af6f881e34bd65 100644 (file)
@@ -59,6 +59,126 @@ namespace bbtk
        }
        //=========================================================================
 
+bool GObjectController::OnMouseMove()
+{
+       cout<<"RaC GObjectController::OnMouseMove "<<endl;
+       if ( _vtkInteractorStyleBaseView!=NULL)
+       {
+               int X,Y;
+               wxVTKRenderWindowInteractor *_wxVTKiren;
+               _wxVTKiren= _vtkInteractorStyleBaseView->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);                          
+                       }
+               }
+               
+               _view->refresh();
+       }
+       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