SHAPER  9.12.0
Model_AttributeSelectionList Class Reference

Attribute that contains list of references to the sub-shapes with possibility to manage them. More...

Inheritance diagram for Model_AttributeSelectionList:
Inheritance graph

Public Member Functions

virtual void append (const ObjectPtr &theContext, const std::shared_ptr< GeomAPI_Shape > &theSubShape, const bool theTemporarily=false)
 Adds the new reference to the end of the list. More...
 
virtual void append (const std::wstring &theNamingName, const std::string &theType="")
 Adds the new reference to the end of the list by the naming name of the selected shape The type of shape is taken from the current selection type if the given is empty. More...
 
virtual void append (const std::shared_ptr< GeomAPI_Pnt > &thePoint, const std::string &theType)
 Adds the new reference to the end of the list by inner point on the selected shape. More...
 
virtual void append (const std::string &theType, const std::wstring &theContextName, const int theIndex)
 Adds the new reference to the end of the list by weak naming index. More...
 
virtual void copyTo (AttributeSelectionListPtr theTarget) const
 Copy the selection list to the destination attribute. More...
 
virtual void removeTemporaryValues ()
 Reset temporary stored values. More...
 
virtual void removeLast ()
 Removes the last element in the list. More...
 
virtual void remove (const std::set< int > &theIndices)
 Removes the elements from the list. More...
 
virtual int size ()
 Returns the number of selection attributes in the list. More...
 
virtual bool isInList (const ObjectPtr &theContext, const std::shared_ptr< GeomAPI_Shape > &theSubShape, const bool theTemporarily=false)
 Returns true if the object with the shape are in list. More...
 
virtual const std::string selectionType () const
 The type of all elements selection. More...
 
virtual void setSelectionType (const std::string &theType)
 Sets the type of all elements selection. More...
 
virtual std::shared_ptr< ModelAPI_AttributeSelectionvalue (const int theIndex)
 Returns the attribute selection by the index (zero based) More...
 
virtual void clear ()
 Returns all attributes. More...
 
virtual bool isInitialized ()
 Returns true if attribute was initialized by some value. More...
 
virtual void cashValues (const bool theEnabled)
 Starts or stops cashing of the values in the attribute (the cash may become invalid on modification of the attribute or sub-elements, so the cash must be enabled only during non-modification operations with this attribute) More...
 
virtual void setGeometricalSelection (const bool theIsGeometricalSelection) override
 
virtual bool isGeometricalSelection () const override
 Returns true if is geometrical selection. More...
 
virtual FiltersFeaturePtr filters () const
 Returns a selection filters feature if it is defined for this selection list. More...
 
virtual void setFilters (FiltersFeaturePtr theFeature)
 Sets a selection filters feature if it is defined for this selection list. More...
 
virtual std::string attributeType ()
 Returns the type of this class of attributes, not static method. More...
 
virtual const bool isWholeResultAllowed () const
 Returns true if the whole result selection corresponds to selection of all sub-shapes. More...
 
virtual void setWholeResultAllowed (const bool theFlag)
 Sets whether the whole result selection corresponds to selection of all sub-shapes. More...
 
virtual const bool isMakeCopy () const
 Returns true if a copy features must be used in update in history. More...
 
virtual void setMakeCopy (const bool theFlag)
 Sets true if a copy features must be used in update in history. More...
 
virtual void setObject (const std::shared_ptr< ModelAPI_Object > &theObject)
 Sets the owner of this attribute. More...
 
const std::shared_ptr< ModelAPI_Object > & owner () const
 Returns the owner of this attribute. More...
 
void setInitialized ()
 Makes attribute initialized. More...
 
bool blockSetInitialized (const bool theBlock)
 Blocks sending "attribute updated" if theBlock is true. More...
 
void setIsArgument (const bool theFlag)
 Set this attribute is argument for result (change of this attribute requires update of result). More...
 
bool isArgument ()
 Returns true if attribute causes the result change. More...
 
bool setImmutable (const bool theFlag)
 Immutable argument can not be changed programmatically (e.g. More...
 
bool isImmutable ()
 Returns true if can not be changed programmatically. More...
 
const std::string & id () const
 ID of the attribute in Data. More...
 
virtual void reset ()
 Resets attribute to deafult state. More...
 

Static Public Member Functions

static std::string typeId ()
 Returns the type of this class of attributes. More...
 

Protected Member Functions

 Model_AttributeSelectionList (TDF_Label &theLabel)
 Objects are created for features automatically. More...
 
virtual void reinit ()
 Reinitializes the internal state of the attribute (may be needed on undo/redo, abort, etc) More...
 
bool merge (Model_AttributeSelection *theStart)
 Tries to merge attributes in this list with the same result shape. More...
 
virtual void setID (const std::string theID)
 Sets the ID of the attribute in Data (called from Data) More...
 

Protected Attributes

bool myIsInitialized
 is some value assigned to this attribute More...
 
bool mySetInitializedBlocked
 is initialized blocked More...
 
bool myIsArgument
 is this attribute used as an argument for execution More...
 
bool myIsImmutable
 is this attribute can be changed programmatically (e.g. by constraint) More...
 

Friends

class Model_Data
 
class Model_AttributeSelection
 

Detailed Description

Attribute that contains list of references to the sub-shapes with possibility to manage them.

Constructor & Destructor Documentation

◆ Model_AttributeSelectionList()

Model_AttributeSelectionList::Model_AttributeSelectionList ( TDF_Label &  theLabel)
protected

Objects are created for features automatically.

Member Function Documentation

◆ append() [1/4]

void Model_AttributeSelectionList::append ( const ObjectPtr &  theContext,
const std::shared_ptr< GeomAPI_Shape > &  theSubShape,
const bool  theTemporarily = false 
)
virtual

Adds the new reference to the end of the list.

Parameters
theContextobject where the sub-shape was selected
theSubShapeselected sub-shape (if null, the whole context is selected)
theTemporarilyif it is true, do not store and name the added in the data framework (used to remove immediately, without the following updates)

Implements ModelAPI_AttributeSelectionList.

◆ append() [2/4]

void Model_AttributeSelectionList::append ( const std::wstring &  theNamingName,
const std::string &  theType = "" 
)
virtual

Adds the new reference to the end of the list by the naming name of the selected shape The type of shape is taken from the current selection type if the given is empty.

Implements ModelAPI_AttributeSelectionList.

◆ append() [3/4]

void Model_AttributeSelectionList::append ( const std::shared_ptr< GeomAPI_Pnt > &  thePoint,
const std::string &  theType 
)
virtual

Adds the new reference to the end of the list by inner point on the selected shape.

Implements ModelAPI_AttributeSelectionList.

◆ append() [4/4]

void Model_AttributeSelectionList::append ( const std::string &  theType,
const std::wstring &  theContextName,
const int  theIndex 
)
virtual

Adds the new reference to the end of the list by weak naming index.

Implements ModelAPI_AttributeSelectionList.

◆ copyTo()

void Model_AttributeSelectionList::copyTo ( AttributeSelectionListPtr  theTarget) const
virtual

Copy the selection list to the destination attribute.

Implements ModelAPI_AttributeSelectionList.

◆ removeTemporaryValues()

void Model_AttributeSelectionList::removeTemporaryValues ( )
virtual

Reset temporary stored values.

Implements ModelAPI_AttributeSelectionList.

◆ removeLast()

void Model_AttributeSelectionList::removeLast ( )
virtual

Removes the last element in the list.

Implements ModelAPI_AttributeSelectionList.

◆ remove()

void Model_AttributeSelectionList::remove ( const std::set< int > &  theIndices)
virtual

Removes the elements from the list.

Parameters
theIndicesa list of indices of elements to be removed

Implements ModelAPI_AttributeSelectionList.

◆ size()

int Model_AttributeSelectionList::size ( )
virtual

Returns the number of selection attributes in the list.

Implements ModelAPI_AttributeSelectionList.

◆ isInList()

bool Model_AttributeSelectionList::isInList ( const ObjectPtr &  theContext,
const std::shared_ptr< GeomAPI_Shape > &  theSubShape,
const bool  theTemporarily = false 
)
virtual

Returns true if the object with the shape are in list.

Parameters
theContextobject where the sub-shape was selected
theSubShapeselected sub-shape (if null, the whole context is selected)
theTemporarilyif it is true, it checks also the temporary added item
Returns
true if the pair is found in the attribute

Implements ModelAPI_AttributeSelectionList.

◆ selectionType()

const std::string Model_AttributeSelectionList::selectionType ( ) const
virtual

The type of all elements selection.

Returns
the index of the OCCT enumeration of the type of shape

Implements ModelAPI_AttributeSelectionList.

◆ setSelectionType()

void Model_AttributeSelectionList::setSelectionType ( const std::string &  theType)
virtual

Sets the type of all elements selection.

Parameters
theTypethe index of the OCCT enumeration of the type of shape

Implements ModelAPI_AttributeSelectionList.

◆ value()

std::shared_ptr< ModelAPI_AttributeSelection > Model_AttributeSelectionList::value ( const int  theIndex)
virtual

Returns the attribute selection by the index (zero based)

Implements ModelAPI_AttributeSelectionList.

◆ clear()

void Model_AttributeSelectionList::clear ( )
virtual

Returns all attributes.

Implements ModelAPI_AttributeSelectionList.

◆ isInitialized()

bool Model_AttributeSelectionList::isInitialized ( )
virtual

Returns true if attribute was initialized by some value.

Reimplemented from ModelAPI_Attribute.

◆ cashValues()

void Model_AttributeSelectionList::cashValues ( const bool  theEnabled)
virtual

Starts or stops cashing of the values in the attribute (the cash may become invalid on modification of the attribute or sub-elements, so the cash must be enabled only during non-modification operations with this attribute)

Implements ModelAPI_AttributeSelectionList.

◆ isGeometricalSelection()

bool Model_AttributeSelectionList::isGeometricalSelection ( ) const
overridevirtual

Returns true if is geometrical selection.

Implements ModelAPI_AttributeSelectionList.

◆ filters()

FiltersFeaturePtr Model_AttributeSelectionList::filters ( ) const
virtual

Returns a selection filters feature if it is defined for this selection list.

Implements ModelAPI_AttributeSelectionList.

◆ setFilters()

void Model_AttributeSelectionList::setFilters ( FiltersFeaturePtr  theFeature)
virtual

Sets a selection filters feature if it is defined for this selection list.

Implements ModelAPI_AttributeSelectionList.

◆ reinit()

void Model_AttributeSelectionList::reinit ( )
protectedvirtual

Reinitializes the internal state of the attribute (may be needed on undo/redo, abort, etc)

Reimplemented from ModelAPI_Attribute.

◆ merge()

bool Model_AttributeSelectionList::merge ( Model_AttributeSelection theStart)
protected

Tries to merge attributes in this list with the same result shape.

Returns true if theStart matches with some later attribute and theStart is removed from the list.

◆ typeId()

static std::string ModelAPI_AttributeSelectionList::typeId ( )
inlinestaticinherited

Returns the type of this class of attributes.

◆ attributeType()

std::string ModelAPI_AttributeSelectionList::attributeType ( )
virtualinherited

Returns the type of this class of attributes, not static method.

Implements ModelAPI_Attribute.

◆ isWholeResultAllowed()

virtual const bool ModelAPI_AttributeSelectionList::isWholeResultAllowed ( ) const
inlinevirtualinherited

Returns true if the whole result selection corresponds to selection of all sub-shapes.

◆ setWholeResultAllowed()

virtual void ModelAPI_AttributeSelectionList::setWholeResultAllowed ( const bool  theFlag)
inlinevirtualinherited

Sets whether the whole result selection corresponds to selection of all sub-shapes.

◆ isMakeCopy()

virtual const bool ModelAPI_AttributeSelectionList::isMakeCopy ( ) const
inlinevirtualinherited

Returns true if a copy features must be used in update in history.

◆ setMakeCopy()

virtual void ModelAPI_AttributeSelectionList::setMakeCopy ( const bool  theFlag)
inlinevirtualinherited

Sets true if a copy features must be used in update in history.

◆ setObject()

void ModelAPI_Attribute::setObject ( const std::shared_ptr< ModelAPI_Object > &  theObject)
virtualinherited

Sets the owner of this attribute.

Reimplemented in Model_AttributeSelection, and Model_AttributeReference.

◆ owner()

const std::shared_ptr< ModelAPI_Object > & ModelAPI_Attribute::owner ( ) const
inherited

Returns the owner of this attribute.

◆ setInitialized()

void ModelAPI_Attribute::setInitialized ( )
inherited

Makes attribute initialized.

◆ blockSetInitialized()

bool ModelAPI_Attribute::blockSetInitialized ( const bool  theBlock)
inherited

Blocks sending "attribute updated" if theBlock is true.

Parameters
theBlocka block value
Returns
the previous block value

◆ setIsArgument()

void ModelAPI_Attribute::setIsArgument ( const bool  theFlag)
inherited

Set this attribute is argument for result (change of this attribute requires update of result).

By default it is true.

◆ isArgument()

bool ModelAPI_Attribute::isArgument ( )
inherited

Returns true if attribute causes the result change.

◆ setImmutable()

bool ModelAPI_Attribute::setImmutable ( const bool  theFlag)
inherited

Immutable argument can not be changed programmatically (e.g.

by constraint) By default it is false. Returns the previous state of the attribute's immutability.

◆ isImmutable()

bool ModelAPI_Attribute::isImmutable ( )
inherited

Returns true if can not be changed programmatically.

◆ id()

const std::string & ModelAPI_Attribute::id ( ) const
inherited

ID of the attribute in Data.

◆ reset()

void ModelAPI_Attribute::reset ( )
virtualinherited

Resets attribute to deafult state.

Reimplemented in Model_AttributeSelection, Model_AttributeDouble, GeomData_Point2D, and GeomData_Dir.

◆ setID()

void ModelAPI_Attribute::setID ( const std::string  theID)
protectedvirtualinherited

Sets the ID of the attribute in Data (called from Data)

Reimplemented in Model_AttributeSelection.

Field Documentation

◆ myIsInitialized

bool ModelAPI_Attribute::myIsInitialized
protectedinherited

is some value assigned to this attribute

◆ mySetInitializedBlocked

bool ModelAPI_Attribute::mySetInitializedBlocked
protectedinherited

is initialized blocked

◆ myIsArgument

bool ModelAPI_Attribute::myIsArgument
protectedinherited

is this attribute used as an argument for execution

◆ myIsImmutable

bool ModelAPI_Attribute::myIsImmutable
protectedinherited

is this attribute can be changed programmatically (e.g. by constraint)