SHAPER  9.12.0
ModelAPI_AttributeSelectionList Class Referenceabstract

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

Inheritance diagram for ModelAPI_AttributeSelectionList:
Inheritance graph

Public Member Functions

virtual void append (const ObjectPtr &theContext, const std::shared_ptr< GeomAPI_Shape > &theSubShape, const bool theTemporarily=false)=0
 Adds the new reference to the end of the list. More...
 
virtual void append (const std::wstring &theNamingName, const std::string &theType="")=0
 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)=0
 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)=0
 Adds the new reference to the end of the list by weak naming index. More...
 
virtual void copyTo (std::shared_ptr< ModelAPI_AttributeSelectionList > theTarget) const =0
 Copy the selection list to the destination attribute. More...
 
virtual void removeTemporaryValues ()=0
 Reset temporary stored values. More...
 
virtual void removeLast ()=0
 Removes the last element in the list. More...
 
virtual void remove (const std::set< int > &theIndices)=0
 Removes the elements from the list. More...
 
virtual int size ()=0
 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)=0
 Returns true if the object with the shape are in list. More...
 
virtual const std::string selectionType () const =0
 The type of all elements selection. More...
 
virtual void setSelectionType (const std::string &theType)=0
 Sets the type of all elements selection. More...
 
virtual std::shared_ptr< ModelAPI_AttributeSelectionvalue (const int theIndex)=0
 Returns the attribute selection by the index (zero based) More...
 
virtual void clear ()=0
 Removes all attributes of the list. More...
 
virtual void cashValues (const bool theEnabled)=0
 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)=0
 
virtual bool isGeometricalSelection () const =0
 Returns true if is geometrical selection. More...
 
virtual std::string attributeType ()
 Returns the type of this class of attributes, not static method. More...
 
virtual ~ModelAPI_AttributeSelectionList ()
 To virtually destroy the fields of successors. More...
 
virtual FiltersFeaturePtr filters () const =0
 Returns a selection filters feature if it is defined for this selection list. More...
 
virtual void setFilters (FiltersFeaturePtr theFeature)=0
 Sets a selection filters feature if it is defined for this selection list. 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...
 
virtual bool isInitialized ()
 Returns true if attribute was initialized by some value. 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

 ModelAPI_AttributeSelectionList ()
 Default constructor. More...
 
virtual void setID (const std::string theID)
 Sets the ID of the attribute in Data (called from Data) More...
 
virtual void reinit ()
 Reinitializes the internal state of the attribute (may be needed on undo/redo, abort, etc) 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...
 

Detailed Description

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

Constructor & Destructor Documentation

◆ ~ModelAPI_AttributeSelectionList()

ModelAPI_AttributeSelectionList::~ModelAPI_AttributeSelectionList ( )
virtual

To virtually destroy the fields of successors.

◆ ModelAPI_AttributeSelectionList()

ModelAPI_AttributeSelectionList::ModelAPI_AttributeSelectionList ( )
inlineprotected

Default constructor.

Member Function Documentation

◆ append() [1/4]

virtual void ModelAPI_AttributeSelectionList::append ( const ObjectPtr &  theContext,
const std::shared_ptr< GeomAPI_Shape > &  theSubShape,
const bool  theTemporarily = false 
)
pure 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)

Implemented in Model_AttributeSelectionList.

◆ append() [2/4]

virtual void ModelAPI_AttributeSelectionList::append ( const std::wstring &  theNamingName,
const std::string &  theType = "" 
)
pure 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.

Implemented in Model_AttributeSelectionList.

◆ append() [3/4]

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

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

Implemented in Model_AttributeSelectionList.

◆ append() [4/4]

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

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

Implemented in Model_AttributeSelectionList.

◆ copyTo()

virtual void ModelAPI_AttributeSelectionList::copyTo ( std::shared_ptr< ModelAPI_AttributeSelectionList theTarget) const
pure virtual

Copy the selection list to the destination attribute.

Implemented in Model_AttributeSelectionList.

◆ removeTemporaryValues()

virtual void ModelAPI_AttributeSelectionList::removeTemporaryValues ( )
pure virtual

Reset temporary stored values.

Implemented in Model_AttributeSelectionList.

◆ removeLast()

virtual void ModelAPI_AttributeSelectionList::removeLast ( )
pure virtual

Removes the last element in the list.

Implemented in Model_AttributeSelectionList.

◆ remove()

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

Removes the elements from the list.

Parameters
theIndicesa list of indices of elements to be removed

Implemented in Model_AttributeSelectionList.

◆ size()

virtual int ModelAPI_AttributeSelectionList::size ( )
pure virtual

Returns the number of selection attributes in the list.

Implemented in Model_AttributeSelectionList.

◆ isInList()

virtual bool ModelAPI_AttributeSelectionList::isInList ( const ObjectPtr &  theContext,
const std::shared_ptr< GeomAPI_Shape > &  theSubShape,
const bool  theTemporarily = false 
)
pure 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

Implemented in Model_AttributeSelectionList.

◆ selectionType()

virtual const std::string ModelAPI_AttributeSelectionList::selectionType ( ) const
pure virtual

The type of all elements selection.

Returns
the index of the enumeration of the type of shape

Implemented in Model_AttributeSelectionList.

◆ setSelectionType()

virtual void ModelAPI_AttributeSelectionList::setSelectionType ( const std::string &  theType)
pure virtual

Sets the type of all elements selection.

Parameters
theTypethe index of the enumeration of the type of shape

Implemented in Model_AttributeSelectionList.

◆ value()

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

Returns the attribute selection by the index (zero based)

Implemented in Model_AttributeSelectionList.

◆ clear()

virtual void ModelAPI_AttributeSelectionList::clear ( )
pure virtual

Removes all attributes of the list.

Implemented in Model_AttributeSelectionList.

◆ cashValues()

virtual void ModelAPI_AttributeSelectionList::cashValues ( const bool  theEnabled)
pure 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)

Implemented in Model_AttributeSelectionList.

◆ isGeometricalSelection()

virtual bool ModelAPI_AttributeSelectionList::isGeometricalSelection ( ) const
pure virtual

Returns true if is geometrical selection.

Implemented in Model_AttributeSelectionList.

◆ typeId()

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

Returns the type of this class of attributes.

◆ attributeType()

std::string ModelAPI_AttributeSelectionList::attributeType ( )
virtual

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

Implements ModelAPI_Attribute.

◆ filters()

virtual FiltersFeaturePtr ModelAPI_AttributeSelectionList::filters ( ) const
pure virtual

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

Implemented in Model_AttributeSelectionList.

◆ setFilters()

virtual void ModelAPI_AttributeSelectionList::setFilters ( FiltersFeaturePtr  theFeature)
pure virtual

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

Implemented in Model_AttributeSelectionList.

◆ isWholeResultAllowed()

virtual const bool ModelAPI_AttributeSelectionList::isWholeResultAllowed ( ) const
inlinevirtual

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

◆ setWholeResultAllowed()

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

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

◆ isMakeCopy()

virtual const bool ModelAPI_AttributeSelectionList::isMakeCopy ( ) const
inlinevirtual

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

◆ setMakeCopy()

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

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.

◆ isInitialized()

bool ModelAPI_Attribute::isInitialized ( )
virtualinherited

◆ 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.

◆ reinit()

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)