]> Creatis software - bbtkGEditor.git/blobdiff - lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx
#3253 Select manual of boxes
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsWxGUIEditorGraphic / wxVtkSceneManager.cxx
index 1d8dc2957e68a4d5a5dbbbba61394369b4d00623..f1a057f33b9626515c38b57aa274014fd5028bae 100644 (file)
@@ -3089,11 +3089,8 @@ std::vector< std::string> wxVtkSceneManager::GetExternalInputsNames()
 }
 
 //=========================================================================
-
-
-
-void wxVtkSceneManager::printAll(int com , int sta ){
-        
+void wxVtkSceneManager::printAll(int com , int sta )
+{
          int tmpState = sta ;
         if ( tmpState == NOTHING_HAPPENS ) {
             std::cout << "CONTROLER STATE---->NOTHING_HAPPENS\n" ;
@@ -3144,6 +3141,48 @@ void wxVtkSceneManager::printAll(int com , int sta ){
         
     }
 
+//=========================================================================
+//EED 2022-10-28
+void wxVtkSceneManager::SelectBoxWithPossibleName( std::string possibleName )
+{
+    UnSelectBlackBoxes();
+    std::map<int, GObjectController*>::iterator it;
+    GObjectController                           *desc;
+    int                                         type;
+    int                                         id;
+    int                                         pos;
+    std::string possibleNameAA = possibleName;
+    std::string boxNameBB;
+    int i,size;
+    size = possibleNameAA.length();
+    for (i=0;i<size;i++)
+    {
+        if ((possibleNameAA[i]>='A')&&(possibleNameAA[i]<='Z')) { possibleNameAA[i]=possibleNameAA[i]+32; }
+    } //for  i
+    for (it = _controllers.begin(); it != _controllers.end(); ++it)
+    {
+        desc    = it->second;
+        type    = desc->getGObjectType();
+        if ( type==GBLACKBOX)
+        {
+            boxNameBB = desc->getModel()->getBBTKType() +":"+ desc->getModel()->getBBTKName();
+            size=boxNameBB.length();
+            for (i=0;i<size;i++)
+            {
+                if ((boxNameBB[i]>='A')&&(boxNameBB[i]<='Z')) { boxNameBB[i]=boxNameBB[i]+32; }
+            } // for  i
+
+            pos=boxNameBB.find( possibleNameAA );
+            if  (pos>=0)
+            {
+                desc->getView()->setState(SELECTED);
+                id = desc->getModel()->getObjectId();
+                desc->getModel()->notifyObservers( id , ADD_TO_SELECTED );
+            } // if pos
+        } // if type == 1
+    } // for it
+    refresh();
+}
 
 } // EO namespace bbtk