This class encapsulates an algorithm of extraction of sub-shapes from the main shape.
#include <GEOMAlgo_Extractor.hxx>
Public Member Functions | |
Standard_EXPORT | GEOMAlgo_Extractor () |
Empty constructor. More... | |
virtual Standard_EXPORT | ~GEOMAlgo_Extractor () |
Virtual destructor. More... | |
Standard_EXPORT void | SetShape (const TopoDS_Shape &theShape) |
This method sets the main shape. More... | |
const TopoDS_Shape & | GetShape () const |
This method returns the main shape. More... | |
Standard_EXPORT void | SetShapesToRemove (const TopTools_ListOfShape &theSubShapes) |
This method sets the list of sub-shapes to be removed from the main shape. More... | |
const TopTools_ListOfShape & | GetShapesToRemove () const |
This method returns the list of sub-shapes to be removed from the main shape. More... | |
virtual Standard_EXPORT void | Perform () |
This method performs computation of the extracted shape. More... | |
Standard_EXPORT const TopoDS_Shape & | GetResult () const |
This method returns the result of the algorithm. More... | |
const TopTools_ListOfShape & | GetRemoved () const |
This method returns the sub-shapes removed from the main shape. More... | |
const TopTools_ListOfShape & | GetModified () const |
This method returns the sub-shapes modified in the main shape. More... | |
const TopTools_ListOfShape & | GetNew () const |
This method returns the newly created sub-shapes in the result shape. More... | |
Public Member Functions inherited from GEOMAlgo_Algo | |
Standard_EXPORT Standard_Integer | ErrorStatus () const |
Standard_EXPORT Standard_Integer | WarningStatus () const |
Standard_EXPORT void | ComputeInternalShapes (const Standard_Boolean theFlag) |
Allows to omit of creation of internal shapes (manifold topology). More... | |
Protected Attributes | |
TopoDS_Shape | myShape |
TopoDS_Shape | myResult |
TopTools_ListOfShape | mySubShapes |
TopTools_ListOfShape | myRemoved |
TopTools_ListOfShape | myModified |
TopTools_ListOfShape | myNew |
TopTools_DataMapOfShapeListOfShape | myMapShapeAnc |
TopTools_MapOfShape | myMapRemoved |
TopTools_DataMapOfShapeListOfShape | myMapModified |
TopTools_DataMapOfShapeListOfShape | myMapNewShapeAnc |
Protected Attributes inherited from GEOMAlgo_Algo | |
Standard_Integer | myErrorStatus |
Standard_Integer | myWarningStatus |
Standard_Boolean | myComputeInternalShapes |
Private Member Functions | |
void | clear () |
This method reinitializes the shape. More... | |
void | checkData () |
This method checks the input data. More... | |
void | makeMapShapeAncestors (const TopoDS_Shape &theShape) |
This method fills the map of shapes and ancestors for the whole sub-shapes of theShape. More... | |
void | markShapes () |
This method marks shapes to be removed and to be modified. More... | |
void | markRemoved (const TopoDS_Shape &theShape) |
This method marks theShape to be removed. More... | |
void | markAncestorsModified (const TopoDS_Shape &theShape) |
This method marks ancestors of theShape to be modified. More... | |
void | processShapes (const TopAbs_ShapeEnum &theType) |
This method performs computation of modified shapes of the provided type. More... | |
void | processEdge (const TopoDS_Shape &theEdge) |
This method performs computation of a modified edge. More... | |
void | processWire (const TopoDS_Shape &theWire) |
This method performs computation of a modified wire. More... | |
void | processFOrSo (const TopoDS_Shape &theFOrSo) |
This method performs computation of a modified face or solid. More... | |
void | processShOrCS (const TopoDS_Shape &theShOrCS) |
This method performs computation of a modified shell or comp-solid. More... | |
void | processCompound (const TopoDS_Shape &theCompound) |
This method performs computation of a modified compound. More... | |
void | removeBoundsOnFOrSo (const TopAbs_ShapeEnum theType) |
This method removes hanging edges (faces) built for faces (solids) if they lie on created faces (solids). More... | |
TopoDS_Shape | oriented (const TopoDS_Shape &theShape, const TopoDS_Shape &theContext) |
Returns theShape with an orientation composed with theContext's orientation. More... | |
TopoDS_Shape | makeShape (const TopoDS_Shape &theShape, const TopTools_ListOfShape &theSubShapes) |
This method makes a shape as an empty copy of theShape adding subshapes to it. More... | |
TopoDS_Shape | getShapeFromSubShapes (const TopoDS_Shape &theShape, const TopTools_ListOfShape &theSubShapes) |
This method returns the shape from the list of sub-shapes if there is any shape created already with these sub-shapes. More... | |
TopoDS_Shape | makeResult (const TopoDS_Shape &theShape) |
This method makes the result for the given shape. More... | |
void | makeHistory (const TopoDS_Shape &theShape, TopTools_MapOfShape &theMapFence) |
This method fills the lists of shapes myRemoved, myModified and myNew with removed, modified and newly created shapes correspondingly. More... | |
Standard_Boolean | removeCommonEdges (const TopoDS_Shape &theWire, const TopTools_IndexedMapOfShape &theMapEdgesToRm, TopTools_ListOfShape &theNewWires) |
This method removes edges that are in theMapEdgesToRm from theWire and re-creates one or more wires from the rest edges. More... | |
Standard_Boolean | removeCommonFaces (const TopoDS_Shape &theShell, const TopTools_IndexedMapOfShape &theMapFacesToRm, TopTools_ListOfShape &theNewShells) |
This method removes faces that are in theMapFacesToRm from theShell and re-creates one or more shells from the rest faces. More... | |
void | makeWires (const TopoDS_Shape &theWire, NCollection_List< TopTools_ListOfShape > &theListListEdges, TopTools_ListOfShape &theWires) |
This method creates wires from the list of list of edges. More... | |
void | groupViaBounds (const TopoDS_Shape &theShape, const TopTools_ListOfShape &theSubShapes, TopTools_ListOfShape &theNewShapes) |
This method collects the shapes in theShapes via common bounds. More... | |
void | getModified (const TopoDS_Shape &theShape, TopTools_ListOfShape &theModifShapes, const TopAbs_ShapeEnum theShapeType=TopAbs_SHAPE) |
This method returns the list of modified shapes obtained from theShape. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from GEOMAlgo_Algo | |
Standard_EXPORT | GEOMAlgo_Algo () |
virtual Standard_EXPORT | ~GEOMAlgo_Algo () |
virtual Standard_EXPORT void | CheckData () |
virtual Standard_EXPORT void | CheckResult () |
GEOMAlgo_Extractor::GEOMAlgo_Extractor | ( | ) |
|
virtual |
|
private |
|
private |
|
inline |
References myModified.
|
private |
It performs recursive search in myMapModified. theModifShapes is not cleared at first. If theShapeType filter is equal to TopAbs_SHAPE (default value) all modified shapes will be returned, otherwise shapes of particular type will only be returned.
theShape | the shape examined. |
theModifShapes | the list of modified shapes. Output parameter. |
theShapeType | the shape type filter. |
References myMapModified.
|
inline |
References myNew.
|
inline |
References myRemoved.
const TopoDS_Shape & GEOMAlgo_Extractor::GetResult | ( | ) | const |
References myResult.
|
inline |
References myShape.
|
private |
|
inline |
References mySubShapes.
|
private |
This method is used to group faces into shells via common edges or solids into compsolids via common faces. Collected lists of shapes are used to create new shapes from theShape that are returned in theNewShapes. theNewShapes is not cleared at first.
theShape | the original shape. |
theSubShapes | the list of shapes to be connected. |
theNewShapes | the list of newly created shapes. Output parameter. |
|
private |
This method is called recursively for sub-shapes of the shape.
theShape | the shape. |
theMapFence | the map of already treated shapes. |
References anIter(), getModified(), myMapModified, myMapRemoved, myModified, myNew, and myRemoved.
|
private |
This method is recursively called up to the lowest level of sub-shapes i.e. vertices.
theShape | the shape. |
References anIter(), and myMapShapeAnc.
|
private |
If it is removed the result is a compound of its modified sub-shapes (or a single modified sub-shape if it in only one).
theShape | the shape. |
References anIter(), aResult, getModified(), myMapModified, myMapRemoved, and oriented().
|
private |
|
private |
theWire | the input wire. |
theListListEdges | the list of list of edges. Can be modified on output. |
theWires | the list of created wires. Output parameter. |
References anIter(), and GEOM::Vertices.
|
private |
It is recursively called up to the level of main shape.
theShape | the shape. |
References myMapModified, myMapRemoved, and myMapShapeAnc.
|
private |
If it is required, it recursively marks its sub-shapes to be removed.
theShape | the shape. |
References anIter(), myMapRemoved, and myMapShapeAnc.
|
private |
References anIter(), markAncestorsModified(), markRemoved(), and mySubShapes.
|
private |
theShape | the shape to be re-oriented. |
theContext | the context shape. |
References aResult.
|
virtual |
Implements GEOMAlgo_Algo.
References checkData(), clear(), makeHistory(), makeResult(), markShapes(), GEOMAlgo_Algo::myErrorStatus, myResult, myShape, GEOMAlgo_Algo::myWarningStatus, and processShapes().
|
private |
theCompound | the modified compound (should be forward). |
References anIter(), getModified(), makeShape(), myMapModified, myMapRemoved, and oriented().
|
private |
theEdge | the modified edge (should be forward). |
References anIter(), makeShape(), myMapModified, and myMapRemoved.
|
private |
theFOrSo | the modified face or solid (should be forward). |
References anIter(), getModified(), makeShape(), myMapModified, myMapRemoved, and oriented().
|
private |
theType | the processed shape type. |
References myMapModified, myMapRemoved, myShape, processCompound(), processEdge(), processFOrSo(), processShOrCS(), processWire(), and removeBoundsOnFOrSo().
|
private |
theShOrCS | the modified shell or comp-solid (should be forward). |
References anIter(), getModified(), groupViaBounds(), myMapModified, myMapRemoved, and oriented().
|
private |
theWire | the modified wire (should be forward). |
References anEdge, anIter(), getModified(), makeWires(), myMapModified, myMapRemoved, myMapShapeAnc, and oriented().
|
private |
theType | the shape type. Should be either face or solid. |
References anIter(), getModified(), myMapModified, myMapRemoved, myShape, removeCommonEdges(), and removeCommonFaces().
|
private |
theNewWires contains the modified wire(s).
theWire | the input wire. |
theMapEdgesToRm | the map of edges to be extracted from theWire. |
theNewWires | is the list of new wires. Output parameter. |
References anEdge, and GEOM::Vertices.
|
private |
theNewShells contains the modified shell(s).
theShell | the input shell. |
theMapFacesToRm | the map of faces to be extracted from theShell. |
theNewShells | is the list of new shells. Output parameter. |
void GEOMAlgo_Extractor::SetShape | ( | const TopoDS_Shape & | theShape | ) |
theShape | the main shape. |
References clear(), myMapShapeAnc, and myShape.
void GEOMAlgo_Extractor::SetShapesToRemove | ( | const TopTools_ListOfShape & | theSubShapes | ) |
theSubShapes | the sub-shapes to be removed. |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |