]> Creatis software - bbtkGEditor.git/blobdiff - lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GBlackBoxController.cxx
Feature #1347
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsVtkGUIEditorGraphic / GBlackBoxController.cxx
index 6cf2b9c99f7ed935144241ca40375a52a39dba0d..bdec8ae4b6e14e5e24889e09c7ff789d0a6ccfd6 100644 (file)
@@ -36,6 +36,9 @@ Version:   $Revision$
 
 #include "GBlackBoxController.h"
 
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#endif
 namespace bbtk
 {
 
@@ -55,8 +58,6 @@ namespace bbtk
        bool GBlackBoxController::OnMouseMove()
        {
 
-printf("EED GBlackBoxController::OnMouseMove START \n");
-
                if ( _vtkInteractorStyleBaseView!=NULL)
                {
                        int X,Y;
@@ -90,7 +91,6 @@ printf("EED GBlackBoxController::OnMouseMove START \n");
                            _objHasBeenMoved=true;
                        } // state
 
-printf("EED GBlackBoxController::OnMouseMove state=%d\n", state);
                        _model->notifyObservers(getId());
 
                }
@@ -104,34 +104,40 @@ printf("EED GBlackBoxController::OnMouseMove state=%d\n", state);
                _objHasBeenMoved = false;
                _isLeftClickDown = true;
         bool ok=true;
+               
+               int X,Y;
+               wxVTKRenderWindowInteractor *_wxVTKiren;
+               _wxVTKiren= _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
+               _wxVTKiren->GetEventPosition( X , Y );
+               
+               
+               
                int state  = _view->getState();
-printf("EED GBlackBoxController::OnLeftButtonDown state=%d \n", state);
                //Evaluate new state
-               if(state == HIGHLIGHTED)
+               
+               if(_view->isPointInside(X,Y))
+               
+//             if(state == HIGHLIGHTED)
 //EED3oct2010          if ( (state == HIGHLIGHTED) && (ctrlkey==1  ) )
                {
                    ok=false;
                        _view->setState(SELECTED);
                        _model->notifyObservers(getId(),ADD_TO_SELECTED);
                }
-
-
-
-               int X,Y;
-               wxVTKRenderWindowInteractor *wxVTKiren;
-               wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
-               wxVTKiren->GetEventPosition(X,Y);
-        int ctrlkey=_vtkInteractorStyleBaseView->GetInteractor()->GetControlKey();
+               
+      
+               int shiftkey            = _vtkInteractorStyleBaseView->GetInteractor()->GetShiftKey();
+               int ctrlkey             = _vtkInteractorStyleBaseView->GetInteractor()->GetControlKey();
+               ctrlkey = ctrlkey + shiftkey;
+               
+               
                if ( (state==DRAG) && (ctrlkey==1) &&  (_view->isPointInside(X,Y)==true) )
                {
                        _view->setState(NOTHING_HAPPENS);
                        _model->notifyObservers(getId(),REMOVE_FROM_SELECTED);
                }
 
-printf("EED GBlackBoxController::OnLeftButtonDown END\n" );
-
                return ok;
-
        }
 
        //=========================================================================
@@ -140,7 +146,6 @@ printf("EED GBlackBoxController::OnLeftButtonDown END\n" );
        {
         _isLeftClickDown    = false;
                int state           = _view->getState();
-printf("EED GBlackBoxController::OnLeftButtonUp START state=%d \n", state);
 
                //Evaluate new state
 
@@ -162,8 +167,11 @@ printf("EED GBlackBoxController::OnLeftButtonUp START state=%d \n", state);
 
 
 
-        int ctrlkey=_vtkInteractorStyleBaseView->GetInteractor()->GetControlKey();
-
+               int shiftkey            = _vtkInteractorStyleBaseView->GetInteractor()->GetShiftKey();
+               int ctrlkey             = _vtkInteractorStyleBaseView->GetInteractor()->GetControlKey();
+               ctrlkey = ctrlkey + shiftkey;
+               
+               
                if ( (state==SELECTED) && (ctrlkey==0) && (_objHasBeenMoved==false))
                {
                        _view->setState(NOTHING_HAPPENS);
@@ -171,7 +179,6 @@ printf("EED GBlackBoxController::OnLeftButtonUp START state=%d \n", state);
                }
 
 
-printf("EED GBlackBoxController::OnLeftButtonUp END state=%d \n", state);
 
                return true;
 
@@ -193,7 +200,7 @@ printf("EED GBlackBoxController::OnLeftButtonUp END state=%d \n", state);
                wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
                wxVTKiren->GetEventPosition(X,Y);
 
-               int state  = _view->getState();
+//             int state  = _view->getState();
 
                //Evaluate new state
                if(_view->isPointInside(X,Y))