]> Creatis software - bbtkGEditor.git/blobdiff - lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx
This commit was manufactured by cvs2svn to create tag 'CREATOOLS_2-0-3'.
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsWxGUIEditorGraphic / wxVtkSceneManager.cxx
index 3d551feec6900e36cdf8fc5cd8aee482b94fecc2..3cb95f86f21e22778fb95e3f97f47a42029d7e57 100644 (file)
@@ -825,22 +825,8 @@ printf("EED  wxVtkSceneManager::createGComplexBoxOutputPort 900-450\n");
 
                        if(isOverPort==false)
                        {
-                               _worldState=NOTHING_HAPPENS;
-                               //int lastId = _controllers.size()-1;
-//EED2Oct2010                          GConnectorController *connector = (GConnectorController*)_controllers[_controllers.size()-1];
-                               GConnectorController *connector = (GConnectorController*)_controllers[_idConnectionInCreation];
-
-                               connector->removeFromScene();
-                               unregisterController(connector);
-                               _controllers.erase(_controllers.size()-1);
-
-                               for(it = _controllers.begin(); it != _controllers.end(); ++it)
-                               {
-                                       GObjectController *desc = it->second;
-                                       desc->SetActive(true);
-                                       desc->getView()->setState(NOTHING_HAPPENS);
-                                       desc->getModel()->notifyObservers(_idManager);
-                               } // for
+                               CancelConnection();
+                               UnSelectBlackBoxes();
                        } // isOverPort
 
                } else {  //_worldState
@@ -897,19 +883,18 @@ printf("EED  wxVtkSceneManager::createGComplexBoxOutputPort 900-450\n");
        }
 
        //=========================================================================
-
-       bool wxVtkSceneManager::OnRightButtonUp()
+       void wxVtkSceneManager::CancelConnection()
        {
                if(_worldState==INIT_CREATION_CONTOUR)
                {
                        _worldState=NOTHING_HAPPENS;
                        //int lastId = _controllers.size()-1;
-
+                       
                        GConnectorController *connector = (GConnectorController*)_controllers[_idConnectionInCreation];
                        connector->removeFromScene();
                        unregisterController(connector);
                        _controllers.erase(_idConnectionInCreation);
-
+                       
                        std::map<int, GObjectController*>::iterator it;
                        for(it = _controllers.begin(); it != _controllers.end(); ++it)
                        {
@@ -917,21 +902,20 @@ printf("EED  wxVtkSceneManager::createGComplexBoxOutputPort 900-450\n");
                                desc->SetActive(true);
                                desc->getView()->setState(NOTHING_HAPPENS);
                                desc->getModel()->notifyObservers(_idManager);
-                       }
-               }
-
+                       } // for
+               }// if          
+       }
+       
+       
+       //=========================================================================
 
-               for (int i = 0; i < (int)_selectedObjects.size(); i++)
+       bool wxVtkSceneManager::OnRightButtonUp()
+       {
+               if(_worldState==INIT_CREATION_CONTOUR)
                {
-                       int id = _selectedObjects[i];
-                       GObjectController* cont = _controllers[id];
-                       cont->SetActive(true);
-                       cont->getView()->setState(NOTHING_HAPPENS);
-                       cont->getModel()->notifyObservers(_idManager);
+                       CancelConnection();
                }
-
-               _selectedObjects.clear();
-
+               UnSelectBlackBoxes();
                return true;
        }