From: riveros <> Date: Fri, 25 May 2012 08:08:43 +0000 (+0000) Subject: Reduce Refresh Calls to Boost Speed X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?p=bbtkGEditor.git;a=commitdiff_plain;h=27e3325d47885b491198917840e8162c234a1545 Reduce Refresh Calls to Boost Speed --- diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx index fb33bd0..670ed13 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx @@ -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; } @@ -758,8 +756,7 @@ void wxVtkSceneManager::update(int idController, int command) { manualConnectorContourView * connView = (manualConnectorContourView*) manCont->GetManualViewBaseContour(); - connView->Refresh(); - + std::map::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(); } } - + } //========================================================================= @@ -1631,7 +1629,6 @@ void wxVtkSceneManager::deleteAllBoxes() { } _selectedObjects.clear(); _controllers.clear(); - refreshScene(); } //========================================================================= @@ -1654,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(); - } //========================================================================= @@ -2102,7 +2097,6 @@ void wxVtkSceneManager::loadDiagram(stringstream &inputStream) { } // start - refresh(); } //========================================================================= @@ -2387,7 +2381,6 @@ void wxVtkSceneManager::DuplicateObjects(std::map objec cont->getModel()->notifyObservers(_idManager); } - refreshScene(); }