]> Creatis software - bbtkGEditor.git/commitdiff
Bug #1682 Crash deleting the actual connection creation
authortorres <>
Thu, 11 Oct 2012 14:35:49 +0000 (14:35 +0000)
committertorres <>
Thu, 11 Oct 2012 14:35:49 +0000 (14:35 +0000)
lib/EditorGraphicBBS/bbsKernelEditorGraphic/GPortModel.cxx
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx

index 2ca30ba2c5d4fc8f843b7c3e74b34df7bbf6698a..20caad2c738f73dc6c8c45fe58c98456b7baad6d 100644 (file)
@@ -52,6 +52,8 @@ namespace bbtk {
         _isConnected   = false ;
         _value                 = "" ;
         _isValueSet            = false ;
+
+
     }
 
     //=========================================================================
index bc9e4b53033c649d7a2ce7250bfdd11ae6e4487f..3a411d84aae13f951de908eb7ca225c46b5dfe04 100644 (file)
@@ -507,7 +507,11 @@ GPortController* wxVtkSceneManager::createGPort(int portType,
 
 //=========================================================================
 
-int wxVtkSceneManager::createGConnector(GPortModel* startPort) {
+int wxVtkSceneManager::createGConnector(GPortModel* startPort) 
+{
+       
+               
+
        int type = GCONNECTOR;
 
        manualConnectorContourController        *manContourControl              = new manualConnectorContourController();
@@ -530,6 +534,8 @@ int wxVtkSceneManager::createGConnector(GPortModel* startPort) {
        manContourView->SetColorEditContour(0.5, 0.5, 0.5);
        manContourView->SetColorSelectContour(1, 0.8, 0);
         
+       
+
         /**
          * JGRR AND CM
          * Width increased from 2 to 3, it simplifies line handling and spline control :P
@@ -677,6 +683,7 @@ void wxVtkSceneManager::update(int idController, int command) {
                        // The last one is the controller of the connector
                        std::map<int, GObjectController*>::iterator it2;
 
+
                        for (it2 = _controllers.begin(); it2 != _controllers.end(); ++it2) {
                                GObjectController *cont = it2->second;
                                if (cont->getGObjectType() == GPORT) {
@@ -953,8 +960,10 @@ void wxVtkSceneManager::CancelConnection()
 
 //=========================================================================
 
-bool wxVtkSceneManager::OnRightButtonUp() {
-       if (_worldState == INIT_CREATION_CONTOUR) {
+bool wxVtkSceneManager::OnRightButtonUp() 
+{
+       if (_worldState == INIT_CREATION_CONTOUR) 
+       {
                CancelConnection();
        }
        UnSelectBlackBoxes();
@@ -1079,8 +1088,21 @@ bool wxVtkSceneManager::OnChar()
         
        // KeyCode 127 : Delete Key
        // KeyCode 8 : Backspace Key
+
+
+       if (keyCode == 8 || keyCode == 127 || keyCode == 27) 
+       {
+               if (_worldState == INIT_CREATION_CONTOUR) 
+               {
+                       CancelConnection();
+                       UnSelectBlackBoxes();
+               }
+       }
+
+
        if (keyCode == 8 || keyCode == 127) 
        {
+
                        for (int i = 0; i < (int) _selectedObjects.size(); i++) 
                        {
                                int id = _selectedObjects[i];