SHAPER  9.12.0
GeomAPI_ShapeHierarchy Class Reference

Storage for the hierarchy of shapes and their parents (compounds or compsolids) More...

Data Structures

class  iterator
 

Public Member Functions

void addObject (const GeomShapePtr &theObject)
 Add an object of the operation (low-level shape in the hierarchy) More...
 
void addParent (const GeomShapePtr &theShape, const GeomShapePtr &theParent)
 Store link between shape and its parent. More...
 
GeomShapePtr parent (const GeomShapePtr &theShape, bool theMarkProcessed=true)
 Return parent shape for the given, or empty if it is a high-level shape. More...
 
GeomShapePtr root (const GeomShapePtr &theShape, bool theMarkProcessed=true)
 Get root shape for the specified sub-shape. More...
 
void markProcessed (const GeomShapePtr &theShape)
 Mark the shape as already processed. More...
 
void markProcessed (const ListOfShape &theShapes)
 Mark list ofshapes as already processed. More...
 
void markModified (const GeomShapePtr &theSource, const GeomShapePtr &theModified)
 Mark the shape as modified and store its image. More...
 
void splitCompound (const GeomShapePtr &theCompShape, ListOfShape &theUsed, ListOfShape &theNotUsed) const
 Split compound/compsolid shape for subshapes selected for operation and the others. More...
 
void compoundsOfUnusedObjects (ListOfShape &theDestination) const
 Generates the list of top-level compounds, which exclude the objects of operation. More...
 
void topLevelObjects (ListOfShape &theDestination) const
 Generates the list of top-level compounds, with modified objects of operation. More...
 
bool empty () const
 Return true if there is no object in hierarchy. More...
 
const ListOfShape & objects () const
 Return list of objects. More...
 
const ListOfShape & objects (GeomShapePtr theParent) const
 Return list of low-level objects for the parent shape. More...
 
void objectsByType (ListOfShape &theShapesByType, ListOfShape &theOtherShapes, const GeomAPI_Shape::ShapeType theMinType=GeomAPI_Shape::COMPOUND, const GeomAPI_Shape::ShapeType theMaxType=GeomAPI_Shape::SHAPE) const
 Separate objects of the given range of types and all other objects. More...
 
iterator begin ()
 
iterator end ()
 

Detailed Description

Storage for the hierarchy of shapes and their parents (compounds or compsolids)

Member Function Documentation

◆ addObject()

void GeomAPI_ShapeHierarchy::addObject ( const GeomShapePtr &  theObject)

Add an object of the operation (low-level shape in the hierarchy)

◆ addParent()

void GeomAPI_ShapeHierarchy::addParent ( const GeomShapePtr &  theShape,
const GeomShapePtr &  theParent 
)

Store link between shape and its parent.

Has to be called by high-level algorithm, because the parent compound/compsolid is usually stored as a top-level result

◆ parent()

GeomShapePtr GeomAPI_ShapeHierarchy::parent ( const GeomShapePtr &  theShape,
bool  theMarkProcessed = true 
)

Return parent shape for the given, or empty if it is a high-level shape.

By default, the parent and all its subshapes are marked as processed for further skip.

◆ root()

GeomShapePtr GeomAPI_ShapeHierarchy::root ( const GeomShapePtr &  theShape,
bool  theMarkProcessed = true 
)

Get root shape for the specified sub-shape.

By default, the parent and all its subshapes are marked as processed for further skip.

◆ markProcessed() [1/2]

void GeomAPI_ShapeHierarchy::markProcessed ( const GeomShapePtr &  theShape)

Mark the shape as already processed.

◆ markProcessed() [2/2]

void GeomAPI_ShapeHierarchy::markProcessed ( const ListOfShape &  theShapes)

Mark list ofshapes as already processed.

◆ markModified()

void GeomAPI_ShapeHierarchy::markModified ( const GeomShapePtr &  theSource,
const GeomShapePtr &  theModified 
)

Mark the shape as modified and store its image.

◆ splitCompound()

void GeomAPI_ShapeHierarchy::splitCompound ( const GeomShapePtr &  theCompShape,
ListOfShape &  theUsed,
ListOfShape &  theNotUsed 
) const

Split compound/compsolid shape for subshapes selected for operation and the others.

◆ compoundsOfUnusedObjects()

void GeomAPI_ShapeHierarchy::compoundsOfUnusedObjects ( ListOfShape &  theDestination) const

Generates the list of top-level compounds, which exclude the objects of operation.

◆ topLevelObjects()

void GeomAPI_ShapeHierarchy::topLevelObjects ( ListOfShape &  theDestination) const

Generates the list of top-level compounds, with modified objects of operation.

◆ empty()

bool GeomAPI_ShapeHierarchy::empty ( ) const

Return true if there is no object in hierarchy.

◆ objects() [1/2]

const ListOfShape& GeomAPI_ShapeHierarchy::objects ( ) const
inline

Return list of objects.

◆ objects() [2/2]

const ListOfShape & GeomAPI_ShapeHierarchy::objects ( GeomShapePtr  theParent) const

Return list of low-level objects for the parent shape.

◆ objectsByType()

void GeomAPI_ShapeHierarchy::objectsByType ( ListOfShape &  theShapesByType,
ListOfShape &  theOtherShapes,
const GeomAPI_Shape::ShapeType  theMinType = GeomAPI_Shape::COMPOUND,
const GeomAPI_Shape::ShapeType  theMaxType = GeomAPI_Shape::SHAPE 
) const

Separate objects of the given range of types and all other objects.