}
//=========================================================================
+ bool GBlackBoxController::OnMouseMove()
+ {
+
+ if ( _vtkInteractorStyleBaseView!=NULL)
+ {
+ int X,Y;
+ wxVTKRenderWindowInteractor *_wxVTKiren;
+ _wxVTKiren= _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
+ _wxVTKiren->GetEventPosition( X , Y );
+
+ int state = _view->getState();
+
+ //Evaluate new state
+ if( state == DRAG)
+ {
+ moveObject(X,Y);
+ }
+
+ if(state == NOTHING_HAPPENS)
+ {
+ if(_view->isPointInside(X,Y))
+ {
+ _view->setState(HIGHLIGHTED);
+ }
+ }
+ if( state==HIGHLIGHTED)
+ {
+ if(!_view->isPointInside(X,Y))
+ {
+ _view->setState(NOTHING_HAPPENS);
+ }
+ }
+
+ _model->notifyObservers(_id);
+
+ }
+ return true;
+ }
+
+ //=========================================================================
+
+ bool GBlackBoxController::OnLeftButtonDown()
+ {
+
+ if ( _vtkInteractorStyleBaseView!=NULL )
+ {
+ int X,Y;
+ wxVTKRenderWindowInteractor *wxVTKiren;
+ wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
+ wxVTKiren->GetEventPosition(X,Y);
+
+ int state = _view->getState();
+
+ //Evaluate new state
+ if( state==HIGHLIGHTED)
+ {
+ _view->isStartDragging(true);
+ _view->setState(DRAG);
+ }
+
+ if( state == SELECTED)
+ {
+ if(_view->isPointInside(X,Y))
+ {
+ _view->isStartDragging(true);
+ _view->setState(DRAG);
+ }
+ }
+
+ _model->notifyObservers(_id);
+ }
+ return true;
+ }
+
+ //=========================================================================
+
+ bool GBlackBoxController::OnLeftButtonUp()
+ {
+ if ( _vtkInteractorStyleBaseView!=NULL )
+ {
+ int X,Y;
+ wxVTKRenderWindowInteractor *wxVTKiren;
+ wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
+ wxVTKiren->GetEventPosition(X,Y);
+
+ int state = _view->getState();
+
+ //Evaluate new state
+ if(state==CLICKED)
+ {
+ _view->setState(SELECTED);
+ }
+
+ if( state == DRAG)
+ {
+ _view->setState(SELECTED);
+ }
+
+ _model->notifyObservers(_id);
+
+ }
+ return true;
+ }
+
+ //=========================================================================
+
+ bool GBlackBoxController::OnLeftDClick()
+ {
+ if ( _vtkInteractorStyleBaseView!=NULL )
+ {
+ int X,Y;
+ wxVTKRenderWindowInteractor *wxVTKiren;
+ wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
+ wxVTKiren->GetEventPosition(X,Y);
+
+ _model->notifyObservers(_id);
+ }
+ return true;
+ }
+
+ //=========================================================================
+
+ bool GBlackBoxController::OnRightButtonDown()
+ {
+ if( _vtkInteractorStyleBaseView!= NULL )
+ {
+ int X,Y;
+ wxVTKRenderWindowInteractor *wxVTKiren;
+ wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
+ wxVTKiren->GetEventPosition(X, Y);
+
+ int state = _view->getState();
+
+ //Evaluate new state
+ if( state == SELECTED)
+ {
+ _view->setState(NOTHING_HAPPENS);
+ }
+
+ _model->notifyObservers(_id);
+ }
+ return true;
+ }
//=========================================================================