Salome HOME
0022767: [EDF] Construction of composite solids
[modules/geom.git] / src / GEOM_I / GEOM_IShapesOperations_i.cc
index 4e619573cb55f31622667cc07a8e3ba3ab22cbd1..dce57e0aab43fff4cae933923f18622ad12ae799 100644 (file)
@@ -406,6 +406,40 @@ GEOM_IShapesOperations_i::MakeCompound (const GEOM::ListOfGO& theShapes)
   return GetObject(anObject);
 }
 
+//=============================================================================
+/*!
+ *  MakeSolidFromConnectedFaces
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeSolidFromConnectedFaces
+                                      (const GEOM::ListOfGO& theFacesOrShells,
+                                       const CORBA::Boolean  isIntersect)
+{
+  GEOM::GEOM_Object_var aGEOMObject;
+
+  //Set a not done flag
+  GetOperations()->SetNotDone();
+
+  int ind, aLen;
+  std::list<Handle(GEOM_Object)> aShapes;
+
+  //Get the shapes
+  aLen = theFacesOrShells.length();
+  for (ind = 0; ind < aLen; ind++) {
+    Handle(GEOM_Object) aSh = GetObjectImpl(theFacesOrShells[ind]);
+    if (aSh.IsNull()) return aGEOMObject._retn();
+    aShapes.push_back(aSh);
+  }
+
+  // Make Solid
+  Handle(GEOM_Object) anObject =
+    GetOperations()->MakeSolidFromConnectedFaces(aShapes, isIntersect);
+  if (!GetOperations()->IsDone() || anObject.IsNull())
+    return aGEOMObject._retn();
+
+  return GetObject(anObject);
+}
+
 //=============================================================================
 /*!
  *  MakeGlueFaces