]> Creatis software - bbtkGEditor.git/blobdiff - lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx
Feature #1380
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsWxGUIEditorGraphic / wxVtkSceneManager.cxx
index c8270fb93ba85745708c6f0816fb45f30ca6f7cd..6de30402b985bce8502bfbb80e2fdc5cb7e3a249 100644 (file)
@@ -114,7 +114,6 @@ void wxVtkSceneManager::configureBaseView() {
 
        _baseView->GetRenderer()->SetBackground(0.9, 0.9, 0.9);
        _baseView->GetRenderer()->GradientBackgroundOn();
-       _baseView->Refresh();
 
        // Actos Port_Text
        _textActor = vtkTextActor3D::New();
@@ -544,7 +543,6 @@ int wxVtkSceneManager::createGConnector(GPortModel* startPort) {
 
        manContourControl->CreateNewManualContour();
 
-       manContourView->RefreshContour();
 
        double x, y, z;
        connectorModel->getInicPoint(x, y, z);
@@ -560,8 +558,7 @@ int wxVtkSceneManager::createGConnector(GPortModel* startPort) {
 
        int bak = manContourControl->GetNumberOfPointsManualContour() - 1;
        manContourControl->_bakIdPoint = bak;
-       manContourView->Refresh();
-
+       
        manContourControl->SetMoving(false);
 
        connectorcontroller->setModelAndView(connectorModel, connectorView);
@@ -577,6 +574,7 @@ int wxVtkSceneManager::createGConnector(GPortModel* startPort) {
        connectorModel->addObserver(connectorView);
        connectorModel->addObserver(this);
 
+        manContourView->Refresh();
        return newId;
 }
 
@@ -749,7 +747,7 @@ void wxVtkSceneManager::update(int idController, int command) {
                                 }
                                 // EO JGRR CM                                
                     
-                                _parent->saveTempDiagram();
+                                                               _parent->saveTempandUpdate("create connection");
                        }
 
                        manualConnectorContourController
@@ -758,8 +756,7 @@ void wxVtkSceneManager::update(int idController, int command) {
                        manualConnectorContourView
                                        * connView =
                                                        (manualConnectorContourView*) manCont->GetManualViewBaseContour();
-                       connView->Refresh();
-
+                                     
                        std::map<int, GObjectController*>::iterator it2;
 
                        for (it2 = _controllers.begin(); it2 != _controllers.end(); ++it2) {
@@ -770,10 +767,11 @@ void wxVtkSceneManager::update(int idController, int command) {
                                }
                                cont->SetActive(true);
                        }
+                        connView->Refresh();          
                }
 
        }
-
+        
 }
 
 //=========================================================================
@@ -1026,6 +1024,7 @@ void wxVtkSceneManager::UnSelectBlackBoxes() {
                int id = _selectedObjects[i];
                GObjectController* control = _controllers[id];
                control->getView()->setState(NOTHING_HAPPENS);
+               control->getModel()->notifyObservers(_idManager);
        }// for _selectedObjects
        _selectedObjects.clear();
 }
@@ -1213,7 +1212,7 @@ void wxVtkSceneManager::deleteObject(int id) {
                        _controllers.erase(it);
                }//if
        }// for
-       _parent->saveTempandUpdate();
+       _parent->saveTempandUpdate("delete object");
 }
 
 //=========================================================================
@@ -1630,7 +1629,6 @@ void wxVtkSceneManager::deleteAllBoxes() {
        }
        _selectedObjects.clear();
        _controllers.clear();
-       refreshScene();
 }
 
 //=========================================================================
@@ -1653,8 +1651,6 @@ void wxVtkSceneManager::centerView() {
        _baseView->GetRenderer()->GetActiveCamera()->SetFocalPoint(0, 0, temp[2]);
        _baseView->GetRenderer()->GetActiveCamera()->GetPosition(temp);
        _baseView->GetRenderer()->GetActiveCamera()->SetPosition(0, 0, temp[2]);
-       _baseView->RefreshView();
-
 }
 
 //=========================================================================
@@ -2101,7 +2097,6 @@ void wxVtkSceneManager::loadDiagram(stringstream &inputStream) {
 
        } // start
 
-       refresh();
 }
 //=========================================================================
 
@@ -2386,7 +2381,6 @@ void wxVtkSceneManager::DuplicateObjects(std::map<int, GObjectController*> objec
             cont->getModel()->notifyObservers(_idManager);
 
         }
-        refreshScene();
     }