+ ## Explode a shape into edges sorted in a row from a starting point.
+ # @param theShape the shape to be exploded on edges.
+ # @param theStartPoint the starting point.
+ # @param theName Object name; when specified, this parameter is used
+ # for result publication in the study. Otherwise, if automatic
+ # publication is switched on, default value is used for result name.
+ # @return List of GEOM.GEOM_Object that is actually an ordered list
+ # of edges sorted in a row from a starting point.
+ #
+ # @ref swig_GetSubShapeEdgeSorted "Example"
+ @ManageTransactions("ShapesOp")
+ def GetSubShapeEdgeSorted(self, theShape, theStartPoint, theName=None):
+ """
+ Explode a shape into edges sorted in a row from a starting point.
+
+ Parameters:
+ theShape the shape to be exploded on edges.
+ theStartPoint the starting point.
+ theName Object name; when specified, this parameter is used
+ for result publication in the study. Otherwise, if automatic
+ publication is switched on, default value is used for result name.
+
+ Returns:
+ List of GEOM.GEOM_Object that is actually an ordered list
+ of edges sorted in a row from a starting point.
+ """
+ # Example: see GEOM_TestAll.py
+ ListObj = self.ShapesOp.GetSubShapeEdgeSorted(theShape, theStartPoint)
+ RaiseIfFailed("GetSubShapeEdgeSorted", self.ShapesOp)
+ self._autoPublish(ListObj, theName, "SortedEdges")
+ return ListObj
+
+ ##
+ # Return the list of subshapes that satisfies a certain tolerance
+ # criterion. The user defines the type of shapes to be returned, the
+ # condition and the tolerance value. The operation is defined for
+ # faces, edges and vertices only. E.g. for theShapeType FACE,
+ # theCondition GEOM::CC_GT and theTolerance 1.e-7 this method returns
+ # all faces of theShape that have tolerances greater then 1.e7.
+ #
+ # @param theShape the shape to be exploded
+ # @param theShapeType the type of sub-shapes to be returned (see
+ # ShapeType()). Can have the values FACE, EDGE and VERTEX only.
+ # @param theCondition the condition type (see GEOM::comparison_condition).
+ # @param theTolerance the tolerance filter.
+ # @param theName Object name; when specified, this parameter is used
+ # for result publication in the study. Otherwise, if automatic
+ # publication is switched on, default value is used for result name.
+ # @return the list of shapes that satisfy the conditions.
+ #
+ # @ref swig_GetSubShapesWithTolerance "Example"
+ @ManageTransactions("ShapesOp")
+ def GetSubShapesWithTolerance(self, theShape, theShapeType,
+ theCondition, theTolerance, theName=None):
+ """
+ Return the list of subshapes that satisfies a certain tolerance
+ criterion. The user defines the type of shapes to be returned, the
+ condition and the tolerance value. The operation is defined for
+ faces, edges and vertices only. E.g. for theShapeType FACE,
+ theCondition GEOM::CC_GT and theTolerance 1.e-7 this method returns
+ all faces of theShape that have tolerances greater then 1.e7.
+
+ Parameters:
+ theShape the shape to be exploded
+ theShapeType the type of sub-shapes to be returned (see
+ ShapeType()). Can have the values FACE,
+ EDGE and VERTEX only.
+ theCondition the condition type (see GEOM::comparison_condition).
+ theTolerance the tolerance filter.
+ theName Object name; when specified, this parameter is used
+ for result publication in the study. Otherwise, if automatic
+ publication is switched on, default value is used for result name.
+
+ Returns:
+ The list of shapes that satisfy the conditions.
+ """
+ # Example: see GEOM_TestAll.py
+ ListObj = self.ShapesOp.GetSubShapesWithTolerance(theShape, EnumToLong(theShapeType),
+ theCondition, theTolerance)
+ RaiseIfFailed("GetSubShapesWithTolerance", self.ShapesOp)
+ self._autoPublish(ListObj, theName, "SubShapeWithTolerance")
+ return ListObj
+
+ ## Check if the object is a sub-object of another GEOM object.
+ # @param aSubObject Checked sub-object (or its parent object, in case if
+ # \a theSubObjectIndex is non-zero).
+ # @param anObject An object that is checked for ownership (or its parent object,
+ # in case if \a theObjectIndex is non-zero).
+ # @param aSubObjectIndex When non-zero, specifies a sub-shape index that
+ # identifies a sub-object within its parent specified via \a theSubObject.
+ # @param anObjectIndex When non-zero, specifies a sub-shape index that
+ # identifies an object within its parent specified via \a theObject.
+ # @return TRUE, if the given object contains sub-object.
+ @ManageTransactions("ShapesOp")
+ def IsSubShapeBelongsTo(self, aSubObject, anObject, aSubObjectIndex = 0, anObjectIndex = 0):
+ """
+ Check if the object is a sub-object of another GEOM object.
+
+ Parameters:
+ aSubObject Checked sub-object (or its parent object, in case if
+ \a theSubObjectIndex is non-zero).
+ anObject An object that is checked for ownership (or its parent object,
+ in case if \a theObjectIndex is non-zero).
+ aSubObjectIndex When non-zero, specifies a sub-shape index that
+ identifies a sub-object within its parent specified via \a theSubObject.
+ anObjectIndex When non-zero, specifies a sub-shape index that
+ identifies an object within its parent specified via \a theObject.
+
+ Returns
+ TRUE, if the given object contains sub-object.
+ """
+ IsOk = self.ShapesOp.IsSubShapeBelongsTo(aSubObject, aSubObjectIndex, anObject, anObjectIndex)
+ RaiseIfFailed("IsSubShapeBelongsTo", self.ShapesOp)
+ return IsOk
+
+ ## Perform extraction of sub-shapes from the main shape.
+ #
+ # @param theShape the main shape
+ # @param theListOfID the list of sub-shape IDs to be extracted from
+ # the main shape.
+ # @return New GEOM.GEOM_Object, containing the shape without
+ # extracted sub-shapes.
+ #
+ # @ref swig_MakeExtraction "Example"
+ @ManageTransactions("ShapesOp")
+ def MakeExtraction(self, theShape, theListOfID, theName=None):
+ """
+ Perform extraction of sub-shapes from the main shape.
+
+ Parameters:
+ theShape the main shape
+ theListOfID the list of sub-shape IDs to be extracted from
+ the main shape.
+
+ Returns
+ New GEOM.GEOM_Object, containing the shape without
+ extracted sub-shapes.
+ """
+ # Example: see GEOM_TestAll.py
+ (anObj, aStat) = self.ShapesOp.MakeExtraction(theShape, theListOfID)
+ RaiseIfFailed("MakeExtraction", self.ShapesOp)
+ self._autoPublish(anObj, theName, "Extraction")
+ return anObj
+