From 6a326b219e8d69c186f8cff4e82c64b622fc9288 Mon Sep 17 00:00:00 2001 From: davila <> Date: Wed, 8 Sep 2010 23:16:58 +0000 Subject: [PATCH] no message --- .../bbtkwxGUIEditorGraphicBBS.cxx | 4 +- .../wxBlackBoxEditionDialog.cxx | 15 +++-- .../wxVtkSceneManager.cxx | 67 +++++++++++++------ .../bbsWxGUIEditorGraphic/wxVtkSceneManager.h | 3 + 4 files changed, 62 insertions(+), 27 deletions(-) diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx index 16cce2b..5233d3c 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx @@ -353,12 +353,12 @@ namespace bbtk //command += ConfigurationFile::GetInstance().Get_bin_path(); //EED command +="C:/temp/bbtkBIN/RelWithDebInfo//"; //EED command +="C:/Program Files/CreaTools/bbtk-0.9.5/bin"; - command +="."; #ifdef MACOSX - command += separator + "bbi.app/Contents/MacOS/bbi\" "; + command += separator + "usr/local/bin/bbi.app/Contents/MacOS/bbi\" "; #else + command +="."; command += separator + "bbi\" "; #endif command += "\""+filename + "\""; diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxBlackBoxEditionDialog.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxBlackBoxEditionDialog.cxx index f8eaac2..3cf0c06 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxBlackBoxEditionDialog.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxBlackBoxEditionDialog.cxx @@ -84,13 +84,13 @@ namespace bbtk if(port->getValue()!="") { - txtValue->SetLabel(crea::std2wx(port->getValue())); + txtValue->SetValue(crea::std2wx(port->getValue())); } if(port->isConnected()) { std::string connected("--Port Connected--"); - txtValue->SetLabel(crea::std2wx(connected)); + txtValue->SetValue(crea::std2wx(connected)); txtValue->SetEditable(false); } @@ -98,7 +98,7 @@ namespace bbtk if(type.find(et)!=-1) { std::string noEditable("--No editable--"); - txtValue->SetLabel(crea::std2wx(noEditable)); + txtValue->SetValue(crea::std2wx(noEditable)); txtValue->SetEditable(false); } @@ -141,13 +141,15 @@ namespace bbtk void wxBlackBoxEditionDialog::onClickOk(wxCommandEvent& event) { - - for(int i=0;i<_lstValues.size();i++) +printf("EED wxBlackBoxEditionDialog::onClickOk size %d \n", (int)_lstValues.size() ); + for(int i=0;i<(int)_lstValues.size();i++) { - std::string text = wx2std(_lstValues[i]->GetLabelText()); + std::string text = wx2std(_lstValues[i]->GetValue()); +printf("EED wxBlackBoxEditionDialog::onClickOk text %s \n", text.c_str() ); //TOFIX Search a better alternative if(text!="--No editable--" && text!="--Port Connected--") { +printf("EED wxBlackBoxEditionDialog::onClickOk text %s \n", text.c_str() ); _model->setValueToInputPort(i,text); } } @@ -159,6 +161,7 @@ namespace bbtk void wxBlackBoxEditionDialog::onClickClose(wxCommandEvent& event) { +printf("EED wxBlackBoxEditionDialog::onClickClose\n"); Close(true); } diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx index e6b41ad..4a30692 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx @@ -798,10 +798,15 @@ namespace bbtk { if(_selectedObjects.size()>0) { - for(int i=0;i<_selectedObjects.size();i++) + for(int i=0;i<(int)_selectedObjects.size();i++) { - int id = _selectedObjects[i]; - deleteObject(id); + int id = _selectedObjects[i]; + std::map::iterator it; + it = _controllers.find(id); + if (it!=_controllers.end()) + { + deleteObject(id); + } } _selectedObjects.clear(); } @@ -812,6 +817,28 @@ namespace bbtk //========================================================================= + void wxVtkSceneManager::AddControlerToBeRemove(std::vector *controllersToRemove, int id) + { + + int i; + bool ok=true; + for(i=0 ; i < (int)controllersToRemove->size() ; i++ ) + { + if (id == (*controllersToRemove)[i] ) + { + ok=false; + } + } + + if (ok==true) + { + controllersToRemove->push_back( id ); + } + + } + + //========================================================================= + void wxVtkSceneManager::deleteObject(int id) { GObjectController *control = _controllers[id]; @@ -825,9 +852,9 @@ namespace bbtk bool boxConnected = false; // Add box input controllers to be removed - for(int i = 0;igetObjectId()); + AddControlerToBeRemove( &controllersToRemove, inputs[i]->getObjectId() ); if(inputs[i]->isConnected()) { boxConnected = true; @@ -837,9 +864,9 @@ namespace bbtk std::vector outputs = bbmod->getOutputPorts(); // Add box output controllers to be removed - for(int i = 0;igetObjectId()); + AddControlerToBeRemove( &controllersToRemove, outputs[i]->getObjectId() ); if(outputs[i]->isConnected()) { boxConnected = true; @@ -857,37 +884,39 @@ namespace bbtk GConnectorModel *conMod = (GConnectorModel*)cont->getModel(); if(conMod->getStartPort()!=NULL && conMod->getStartPort()->getParentBox()->getObjectId() == bbmod->getObjectId()) { - controllersToRemove.push_back(conMod->getObjectId()); + AddControlerToBeRemove( &controllersToRemove, conMod->getObjectId() ); } if(conMod->getEndPort()!=NULL && conMod->getEndPort()->getParentBox()->getObjectId() == bbmod->getObjectId()) { - controllersToRemove.push_back(conMod->getObjectId()); + AddControlerToBeRemove( &controllersToRemove, conMod->getObjectId() ); } } } // Add box controller to be removed - controllersToRemove.push_back(bbmod->getObjectId()); + AddControlerToBeRemove( &controllersToRemove, bbmod->getObjectId() ); } else if(control->getGObjectType()==GCONNECTOR) { GConnectorModel *conMod = (GConnectorModel*)control->getModel(); - controllersToRemove.push_back(conMod->getObjectId()); + AddControlerToBeRemove( &controllersToRemove, conMod->getObjectId() ); } - for(int i = 0;i::iterator it; + + for(int i = 0;i<(int)controllersToRemove.size();i++) { - int id = controllersToRemove[i]; - GObjectController *cont = _controllers[id]; + int key = controllersToRemove[i]; + it = _controllers.find( key ); + GObjectController *cont = _controllers[ key ]; if(cont!=NULL) { cont->removeFromScene(); unregisterController((InteractorStyleMaracas*)cont); - _controllers.erase(id); - } - } - - + _controllers.erase(it); + }//if + }// for } //========================================================================= diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.h b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.h index 14e1a1d..14f53f0 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.h +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.h @@ -157,6 +157,9 @@ namespace bbtk //Delete the object in the list of controllers with the id given by parameter. void deleteObject(int id); + + void AddControlerToBeRemove(std::vector *controllersToRemove, int id); + //Clear list of controllers and refresh void deleteAllBoxes(); -- 2.45.1