]> SALOME platform Git repositories - modules/geom.git/blobdiff - src/GEOM_I/GEOM_IShapesOperations_i.cc
Salome HOME
[GITHUB #1] updated TUI command doc for make sphere from point and radius
[modules/geom.git] / src / GEOM_I / GEOM_IShapesOperations_i.cc
index 73a42c007dc4c68693f3c27eac487b88578d343c..1e02554d7788ac4d7f02ce9cadf5753fe07bd92a 100644 (file)
@@ -186,7 +186,8 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeEdgeWire
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeWire
                            (const GEOM::ListOfGO& theEdgesAndWires,
-                            const CORBA::Double   theTolerance)
+                            const CORBA::Double   theTolerance,
+                            const GEOM::wire_build_mode theMode)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
@@ -204,9 +205,22 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeWire
     aShapes.push_back(aSh);
   }
 
+  // Mode of gaps closing
+  GEOMImpl_WireBuildMode aMode = GEOMImpl_WBM_FixTolerance;
+  switch (theMode) {
+  case GEOM::WBM_Approximation:
+    aMode = GEOMImpl_WBM_Approximation;
+    break;
+  case GEOM::WBM_KeepCurveType:
+    aMode = GEOMImpl_WBM_KeepCurveType;
+    break;
+  default:
+    break;
+  }
+
   // Make Solid
   Handle(::GEOM_Object) anObject =
-    GetOperations()->MakeWire(aShapes, theTolerance);
+    GetOperations()->MakeWire(aShapes, theTolerance, aMode);
   if (!GetOperations()->IsDone() || anObject.IsNull())
     return aGEOMObject._retn();
 
@@ -310,6 +324,47 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeFaceFromSurface
   return GetObject(anObject);
 }
 
+//=============================================================================
+/*!
+ *  MakeWrappedFace
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeWrappedFace
+                                  (const GEOM::ListOfGO& theEdges,
+                                   const GEOM::ListOfGO& theVertices,
+                                   const CORBA::Double theTolerance)
+{
+  GEOM::GEOM_Object_var aGEOMObject;
+
+  //Set a not done flag
+  GetOperations()->SetNotDone();
+
+  //Get the edges
+  std::list<Handle(::GEOM_Object)> anEdges;
+  for( CORBA::ULong ind = 0; ind < theEdges.length(); ind++ ) {
+    Handle(::GEOM_Object) anObject = GetObjectImpl( theEdges[ind] );
+    anEdges.push_back(anObject);
+  }
+
+  //Get the vertices
+  std::list<Handle(::GEOM_Object)> aVertices;
+  for( CORBA::ULong ind = 0; ind < theVertices.length(); ind++ ) {
+    Handle(::GEOM_Object) anObject = GetObjectImpl( theVertices[ind] );
+    aVertices.push_back(anObject);
+  }
+
+  //Create the Face
+  Handle(::GEOM_Object) anObject =
+    GetOperations()->MakeWrappedFace(anEdges, aVertices, theTolerance);
+
+  // enable warning status
+  if (anObject.IsNull())
+    return aGEOMObject._retn();
+
+  return GetObject(anObject);
+}
+
+
 //=============================================================================
 /*!
  *  MakeFaceWithConstraints