Salome HOME
NPAL16588: Bug in GetInPlace method.
[modules/geom.git] / src / GEOM_SWIG / geompy.py
index d752a1ee36fa20f75773c6bfe109eb323e829e00..cf5a61fcfb79149d4d2c1343607064f1627085a1 100644 (file)
@@ -1097,6 +1097,27 @@ def GetInPlace(theShapeWhere, theShapeWhat):
       print "GetInPlace : ", ShapesOp.GetErrorCode()
     return anObj
 
+## Get sub-shape(s) of \a theShapeWhere, which are
+#  coincident with \a theShapeWhat or could be a part of it.
+#
+#  Implementation of this method is based on a saved history of an operation,
+#  produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
+#  arguments (an argument shape or a sub-shape of an argument shape).
+#  The operation could be the Partition or one of boolean operations,
+#  performed on simple shapes (not on compounds).
+#
+#  @param theShapeWhere Shape to find sub-shapes of.
+#  @param theShapeWhat Shape, specifying what to find (must be in the
+#                      building history of the ShapeWhere).
+#  @return Group of all found sub-shapes or a single found sub-shape.
+#
+#  Example: see GEOM_TestOthers.py
+def GetInPlaceByHistory(theShapeWhere, theShapeWhat):
+    anObj = ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
+    if ShapesOp.IsDone() == 0:
+      print "GetInPlace : ", ShapesOp.GetErrorCode()
+    return anObj
+
 ## Get sub-shape of theShapeWhere, which is
 #  equal to \a theShapeWhat.
 #  @param theShapeWhere Shape to find sub-shape of.
@@ -1382,11 +1403,12 @@ def MakeFilling(theShape, theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter):
 ## Replace coincident faces in theShape by one face.
 #  @param theShape Initial shape.
 #  @param theTolerance Maximum distance between faces, which can be considered as coincident.
+#  @param doKeepNonSolids If FALSE, only solids will present in the result, otherwise all initial shapes.
 #  @return New GEOM_Object, containing a copy of theShape without coincident faces.
 #
 #  Example: see GEOM_Spanner.py
-def MakeGlueFaces(theShape, theTolerance):
-    anObj = ShapesOp.MakeGlueFaces(theShape, theTolerance)
+def MakeGlueFaces(theShape, theTolerance, doKeepNonSolids=True):
+    anObj = ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
     if ShapesOp.IsDone() == 0:
       print "MakeGlueFaces : ", ShapesOp.GetErrorCode()
     return anObj
@@ -1412,12 +1434,13 @@ def GetGlueFaces(theShape, theTolerance):
 #  @param theTolerance Maximum distance between faces,
 #                      which can be considered as coincident.
 #  @param theFaces List of faces for gluing.
+#  @param doKeepNonSolids If FALSE, only solids will present in the result, otherwise all initial shapes.
 #  @return New GEOM_Object, containing a copy of theShape
 #          without some faces.
 #
 #  Example: see GEOM_Spanner.py
-def MakeGlueFacesByList(theShape, theTolerance, theFaces):
-    anObj = ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces)
+def MakeGlueFacesByList(theShape, theTolerance, theFaces, doKeepNonSolids=True):
+    anObj = ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces, doKeepNonSolids)
     if ShapesOp.IsDone() == 0:
       print "MakeGlueFacesByList : ", ShapesOp.GetErrorCode()
     return anObj