X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FEditorGraphicBBS%2FbbsVtkGUIEditorGraphic%2FGBlackBoxController.cxx;h=93e06fa2fe1eec7e4595764be469d77281f2db6f;hb=5cf9c7b92a97ee411e6a441beca8a06d2bffc8b3;hp=bafa37f019402b0de5a36bc0c19179e6334afe1a;hpb=50851761f4216d932217db8e8fe56dd5aac6b0fb;p=bbtkGEditor.git diff --git a/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GBlackBoxController.cxx b/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GBlackBoxController.cxx index bafa37f..93e06fa 100644 --- a/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GBlackBoxController.cxx +++ b/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GBlackBoxController.cxx @@ -81,7 +81,7 @@ namespace bbtk } } - _model->notifyObservers(_id); + _model->notifyObservers(getId()); } return true; @@ -98,7 +98,7 @@ namespace bbtk { _isLeftClickDown=true; _view->setState(SELECTED); - _model->notifyObservers(_id,ADD_TO_SELECTED); + _model->notifyObservers(getId(),ADD_TO_SELECTED); } return true; @@ -123,7 +123,7 @@ namespace bbtk { // It is supposed that I'm always inside even if the box is in drag _view->setState(SELECTED); - _model->notifyObservers(_id); + _model->notifyObservers(getId()); } } return true; @@ -131,17 +131,39 @@ namespace bbtk } //========================================================================= - - bool GBlackBoxController::OnLeftDClick() + + bool GBlackBoxController::OnRightButtonUp() { - return true; } - + //========================================================================= - - bool GBlackBoxController::OnRightButtonDown() + + bool GBlackBoxController::OnMiddleButtonDown() { + int X,Y; + wxVTKRenderWindowInteractor *wxVTKiren; + wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor(); + wxVTKiren->GetEventPosition(X,Y); + + int state = _view->getState(); + + //Evaluate new state + if(_view->isPointInside(X,Y)) + { + GBlackBoxModel *bbmodel = (GBlackBoxModel*)_model; + _view->setState(HIGHLIGHTED); + if(bbmodel->isExecutable()) + { + bbmodel->setExecutable(false); + } + else + { + bbmodel->setExecutable(true); + } + bbmodel->notifyObservers(getId()); + } + return true; }