SHAPER  9.12.0
Selector_Intersect Class Reference

Kind of selection algorithm: sub-shape is intersection of higher level objects. More...

Inheritance diagram for Selector_Intersect:
Inheritance graph

Public Types

enum  Selector_Type {
  SELTYPE_CONTAINER , SELTYPE_INTERSECT , SELTYPE_PRIMITIVE , SELTYPE_MODIFICATION ,
  SELTYPE_FILTER_BY_NEIGHBOR , SELTYPE_WEAK_NAMING
}
 Type of a selector algorithm: on this type depends what is stored in this label and how to restore it on update. More...
 

Public Member Functions

bool select (const TopoDS_Shape theContext, const TopoDS_Shape theValue)
 Initializes the selection of this kind. More...
 
virtual void store () override
 Stores the name to the label and sub-labels tree. More...
 
virtual bool restore () override
 Restores the selected shape by the topological naming kept in the data structure Returns true if it can restore structure correctly. More...
 
virtual TDF_Label restoreByName (std::wstring theName, const TopAbs_ShapeEnum theShapeType, Selector_NameGenerator *theNameGenerator) override
 Restores the selected shape by the topological name string. More...
 
virtual bool solve (const TopoDS_Shape &theContext) override
 Updates the current shape by the stored topological name. More...
 
virtual std::wstring name (Selector_NameGenerator *theNameGenerator) override
 Returns the naming name of the selection. More...
 
void clearSubAlgos ()
 Erases the sub-algorithms stored. More...
 
TDF_Label newSubLabel ()
 Returns the next label for a new sub-selector created. More...
 
bool append (Selector_Algo *theAlgo, const bool theEraseIfNull=true)
 Appends a new algorithm to the list, erases list if it is null (failed) More...
 
std::list< Selector_Algo * > & list ()
 Returns the stored list of sub-algorithms. More...
 
TopoDS_Shape value ()
 Returns the current sub-shape value (null if can not resolve) More...
 
void setGeometricalNaming ()
 Sets geometrical naming flag to true. More...
 

Static Public Member Functions

static Selector_Algoselect (const TopoDS_Shape theContext, const TopoDS_Shape theValue, const TDF_Label theAccess, const TDF_Label theBaseDocument, const bool theGeometricalNaming=false, const bool theUseNeighbors=true, const bool theUseIntersections=true, const bool theAlwaysGeometricalNaming=false)
 Initializes the selector structure on the label. More...
 
static Selector_AlgorestoreByName (TDF_Label theLab, TDF_Label theBaseDocLab, std::wstring theName, const TopAbs_ShapeEnum theShapeType, const bool theGeomNaming, Selector_NameGenerator *theNameGenerator, TDF_Label &theContextLab)
 Restores the selected sub-algorithm by the naming name. More...
 
static Selector_AlgorestoreByLab (TDF_Label theLab, TDF_Label theBaseDocLab)
 Restores sub-algorithm of a given type by the storage-label. More...
 
static bool sameGeometry (const TopoDS_Shape theShape1, const TopoDS_Shape theShape2)
 Returns true if the given shapes are based on the same geometry. More...
 
static Selector_AlgorelesectWithAllGeometry (Selector_Algo *theOldAlgo, const TopoDS_Shape theContext)
 Creates a new selection algorithm for selection of all topology based on the same geometry. More...
 

Protected Member Functions

void store (const TopoDS_Shape theShape)
 Stores result of selection at the given label. More...
 
const TDF_Label & label () const
 Returns label where this algorithm is attached to, or just an access label to the document. More...
 
void storeBaseArray (const TDF_LabelList &theRef, const TDF_Label &theLast)
 Stores the array of references to theLab: references to elements of ref-list, then the last. More...
 
bool restoreBaseArray (TDF_LabelList &theRef, TDF_Label &theLast)
 Restores references to the labels: references to elements of ref-list, then the last. More...
 
const TDF_Label & baseDocument () const
 Returns an access-label of the document that may contain initial shapes. More...
 
bool geometricalNaming () const
 Returns the geometrical naming flag. More...
 
bool alwaysGeometricalNaming () const
 Returns always geometrical naming flag. More...
 
bool useNeighbors () const
 Returns use neighbors flag. More...
 
bool useIntersections () const
 Returns use intersections flag. More...
 
void storeType (const Selector_Type theType)
 Stores the type of an algorithm in the data tree (in myLab) More...
 
bool findNewVersion (const TopoDS_Shape &theContext, TopoDS_Shape &theResult) const
 Searches the newer version of the shape in the document if the base shape does not belong to context. More...
 

Static Protected Member Functions

static const Standard_GUID & weakID ()
 Returns GUID for the weak index (integer attribute) of the sub-shape. More...
 
static const Standard_GUID & shapeTypeID ()
 Returns GUID for the type of the shape, stored in case it is intersection or container. More...
 
static const std::wstring & oldWeakNameID ()
 old string identifier of the weak name in modification or intersection types of algorithm More...
 
static const std::wstring & oldPureWeakNameID ()
 old string identifier of the pure weak name More...
 
static const std::wstring & weakNameID ()
 string identifier of the weak name in modification or intersection types of algorithm More...
 
static const std::wstring & pureWeakNameID ()
 string identifier of the pure weak name More...
 

Friends

class Selector_Algo
 

Detailed Description

Kind of selection algorithm: sub-shape is intersection of higher level objects.

Member Enumeration Documentation

◆ Selector_Type

Type of a selector algorithm: on this type depends what is stored in this label and how to restore it on update.

Enumerator
SELTYPE_CONTAINER 

just a container of sub-elements, keeps the shape type of container

SELTYPE_INTERSECT 

sub-shape is intersection of higher level objects

SELTYPE_PRIMITIVE 

sub-shape found as a primitive on some label

SELTYPE_MODIFICATION 

modification of base shapes to the final label

SELTYPE_FILTER_BY_NEIGHBOR 

identification by neighbor shapes in context

SELTYPE_WEAK_NAMING 

pure weak naming by weak index in context

Member Function Documentation

◆ select() [1/2]

bool Selector_Intersect::select ( const TopoDS_Shape  theContext,
const TopoDS_Shape  theValue 
)

Initializes the selection of this kind.

◆ store() [1/2]

void Selector_Intersect::store ( )
overridevirtual

Stores the name to the label and sub-labels tree.

Implements Selector_Algo.

◆ restore()

bool Selector_Intersect::restore ( )
overridevirtual

Restores the selected shape by the topological naming kept in the data structure Returns true if it can restore structure correctly.

Implements Selector_Algo.

◆ restoreByName() [1/2]

TDF_Label Selector_Intersect::restoreByName ( std::wstring  theName,
const TopAbs_ShapeEnum  theShapeType,
Selector_NameGenerator theNameGenerator 
)
overridevirtual

Restores the selected shape by the topological name string.

Returns not empty label of the context.

Implements Selector_Algo.

◆ solve()

bool Selector_Intersect::solve ( const TopoDS_Shape &  theContext)
overridevirtual

Updates the current shape by the stored topological name.

Implements Selector_Algo.

◆ name()

std::wstring Selector_Intersect::name ( Selector_NameGenerator theNameGenerator)
overridevirtual

Returns the naming name of the selection.

Implements Selector_Algo.

◆ clearSubAlgos()

void Selector_AlgoWithSubs::clearSubAlgos ( )
inherited

Erases the sub-algorithms stored.

◆ newSubLabel()

TDF_Label Selector_AlgoWithSubs::newSubLabel ( )
inherited

Returns the next label for a new sub-selector created.

◆ append()

bool Selector_AlgoWithSubs::append ( Selector_Algo theAlgo,
const bool  theEraseIfNull = true 
)
inherited

Appends a new algorithm to the list, erases list if it is null (failed)

◆ list()

std::list< Selector_Algo * > & Selector_AlgoWithSubs::list ( )
inherited

Returns the stored list of sub-algorithms.

◆ select() [2/2]

Selector_Algo * Selector_Algo::select ( const TopoDS_Shape  theContext,
const TopoDS_Shape  theValue,
const TDF_Label  theAccess,
const TDF_Label  theBaseDocument,
const bool  theGeometricalNaming = false,
const bool  theUseNeighbors = true,
const bool  theUseIntersections = true,
const bool  theAlwaysGeometricalNaming = false 
)
staticinherited

Initializes the selector structure on the label.

Stores the name data to restore after modification.

Parameters
theContextwhole shape that contains the selected sub-shape
theValueselected subshape
theGeometricalNamingtreats selection with equal surfaces as one
theUseNeighborsenables searching algorithm by neighbors
theUseIntersectionsenables searching algorithm by intersection of higher level shapes

◆ store() [2/2]

void Selector_Algo::store ( const TopoDS_Shape  theShape)
protectedinherited

Stores result of selection at the given label.

◆ restoreByName() [2/2]

Selector_Algo * Selector_Algo::restoreByName ( TDF_Label  theLab,
TDF_Label  theBaseDocLab,
std::wstring  theName,
const TopAbs_ShapeEnum  theShapeType,
const bool  theGeomNaming,
Selector_NameGenerator theNameGenerator,
TDF_Label &  theContextLab 
)
staticinherited

Restores the selected sub-algorithm by the naming name.

Returns not empty label of the context.

◆ value()

TopoDS_Shape Selector_Algo::value ( )
inherited

Returns the current sub-shape value (null if can not resolve)

◆ restoreByLab()

Selector_Algo * Selector_Algo::restoreByLab ( TDF_Label  theLab,
TDF_Label  theBaseDocLab 
)
staticinherited

Restores sub-algorithm of a given type by the storage-label.

◆ sameGeometry()

bool Selector_Algo::sameGeometry ( const TopoDS_Shape  theShape1,
const TopoDS_Shape  theShape2 
)
staticinherited

Returns true if the given shapes are based on the same geometry.

◆ relesectWithAllGeometry()

Selector_Algo * Selector_Algo::relesectWithAllGeometry ( Selector_Algo theOldAlgo,
const TopoDS_Shape  theContext 
)
staticinherited

Creates a new selection algorithm for selection of all topology based on the same geometry.

◆ setGeometricalNaming()

void Selector_Algo::setGeometricalNaming ( )
inlineinherited

Sets geometrical naming flag to true.

◆ label()

const TDF_Label& Selector_Algo::label ( ) const
inlineprotectedinherited

Returns label where this algorithm is attached to, or just an access label to the document.

◆ storeBaseArray()

void Selector_Algo::storeBaseArray ( const TDF_LabelList &  theRef,
const TDF_Label &  theLast 
)
protectedinherited

Stores the array of references to theLab: references to elements of ref-list, then the last.

◆ restoreBaseArray()

bool Selector_Algo::restoreBaseArray ( TDF_LabelList &  theRef,
TDF_Label &  theLast 
)
protectedinherited

Restores references to the labels: references to elements of ref-list, then the last.

◆ baseDocument()

const TDF_Label& Selector_Algo::baseDocument ( ) const
inlineprotectedinherited

Returns an access-label of the document that may contain initial shapes.

◆ geometricalNaming()

bool Selector_Algo::geometricalNaming ( ) const
inlineprotectedinherited

Returns the geometrical naming flag.

◆ alwaysGeometricalNaming()

bool Selector_Algo::alwaysGeometricalNaming ( ) const
inlineprotectedinherited

Returns always geometrical naming flag.

◆ useNeighbors()

bool Selector_Algo::useNeighbors ( ) const
inlineprotectedinherited

Returns use neighbors flag.

◆ useIntersections()

bool Selector_Algo::useIntersections ( ) const
inlineprotectedinherited

Returns use intersections flag.

◆ weakID()

static const Standard_GUID& Selector_Algo::weakID ( )
inlinestaticprotectedinherited

Returns GUID for the weak index (integer attribute) of the sub-shape.

◆ shapeTypeID()

static const Standard_GUID& Selector_Algo::shapeTypeID ( )
inlinestaticprotectedinherited

Returns GUID for the type of the shape, stored in case it is intersection or container.

◆ oldWeakNameID()

static const std::wstring& Selector_Algo::oldWeakNameID ( )
inlinestaticprotectedinherited

old string identifier of the weak name in modification or intersection types of algorithm

◆ oldPureWeakNameID()

static const std::wstring& Selector_Algo::oldPureWeakNameID ( )
inlinestaticprotectedinherited

old string identifier of the pure weak name

◆ weakNameID()

static const std::wstring& Selector_Algo::weakNameID ( )
inlinestaticprotectedinherited

string identifier of the weak name in modification or intersection types of algorithm

◆ pureWeakNameID()

static const std::wstring& Selector_Algo::pureWeakNameID ( )
inlinestaticprotectedinherited

string identifier of the pure weak name

◆ storeType()

void Selector_Algo::storeType ( const Selector_Type  theType)
protectedinherited

Stores the type of an algorithm in the data tree (in myLab)

◆ findNewVersion()

bool Selector_Algo::findNewVersion ( const TopoDS_Shape &  theContext,
TopoDS_Shape &  theResult 
) const
protectedinherited

Searches the newer version of the shape in the document if the base shape does not belong to context.

Returns it in theResult (if any). Returns true is theResult is changed.