]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
WIP : Subsequent addNode v1.0, no AN + Volume
authorNicolas RECHATIN <nicolas.rechatin@cea.fr>
Mon, 23 Jan 2023 15:33:02 +0000 (16:33 +0100)
committerNicolas RECHATIN <nicolas.rechatin@cea.fr>
Mon, 23 Jan 2023 15:33:02 +0000 (16:33 +0100)
src/OperaPlugin/OperaPlugin_AddNode.cpp

index 7054d83a2a68f46ad3f3f6d20adbf22b12031b84..a78b5a013fffb71b9be36bf201b00dd3ec1daa86 100644 (file)
@@ -110,13 +110,25 @@ void OperaPlugin_AddNode::execute()
 
   // Get older tools and main shape
   if (aMainObjectShape->shapeType() == GeomAPI_Shape::COMPOUND){
-    ListOfShape aMainObjectSubShapes = aMainObjectShape->subShapes(GeomAPI_Shape::SOLID);
-    for (auto it = aMainObjectSubShapes.begin(); it != aMainObjectSubShapes.end(); it++) {
-      if (it == aMainObjectSubShapes.begin())
-        aMainObjectShape = *it;
-      else
+    //Get COMPOUND and SOLID Shape list
+    ListOfShape aSubSolidShapeList = aMainObjectShape->subShapes(GeomAPI_Shape::SOLID);
+    ListOfShape aSubCompoundShapeList = aMainObjectShape->subShapes(GeomAPI_Shape::COMPOUND);
+    //Get main solid
+    aMainObjectShape = *(aSubSolidShapeList.begin());
+    //Only add node in compound
+    if (aSubCompoundShapeList.size() > 1) {
+      aSubCompoundShapeList.pop_back();
+      for (auto it = aSubCompoundShapeList.begin(); it != aSubCompoundShapeList.end(); it++)
         aToolList.push_back(*it);
     }
+    // Only solid in compound
+    else
+    {
+      aSubSolidShapeList.pop_front();
+      for (auto it = aSubCompoundShapeList.begin(); it != aSubCompoundShapeList.end(); it++)
+        aToolList.push_back(*it);
+    }
+    //TODO Merge to allow both in AddNode
   }
 
   // Get Case