SHAPER  9.12.0
ModelAPI_AttributeSelection Class Referenceabstract

Attribute that contains reference to the sub-shape of some result, the selected shape. More...

Inheritance diagram for ModelAPI_AttributeSelection:
Inheritance graph

Public Types

enum  CenterType { NOT_CENTER , CIRCLE_CENTER , ELLIPSE_FIRST_FOCUS , ELLIPSE_SECOND_FOCUS }
 Type of the center of the circular of elliptic edge. More...
 

Public Member Functions

virtual bool setValue (const ObjectPtr &theContext, const std::shared_ptr< GeomAPI_Shape > &theSubShape, const bool theTemporarily=false)=0
 Defines the result and its selected sub-shape. More...
 
virtual void setValueCenter (const ObjectPtr &theContext, const std::shared_ptr< GeomAPI_Edge > &theEdge, const CenterType theCenterType, const bool theTemporarily=false)=0
 Same as SetValue, but it takes an edge (on circular or elliptic curve) and stores the vertex of the central point (for ellipse the first or the second focus point) More...
 
virtual void selectValue (const std::shared_ptr< ModelAPI_AttributeSelection > &theSource)=0
 Makes this selection attribute selects the same as in theSource selection. More...
 
virtual void removeTemporaryValues ()=0
 Reset temporary stored values. More...
 
virtual std::shared_ptr< GeomAPI_Shapevalue ()=0
 Returns the selected subshape. More...
 
virtual ResultPtr context ()=0
 Returns the context of the selection (the whole shape owner) More...
 
virtual std::shared_ptr< ModelAPI_FeaturecontextFeature ()=0
 Returns the context of the selection if the whole feature was selected. More...
 
virtual std::shared_ptr< ModelAPI_ObjectcontextObject ()=0
 Returns the context of the selection : result or feature. More...
 
virtual bool update ()=0
 Updates the selection due to the changes in the referenced objects. More...
 
virtual std::string attributeType ()
 Returns the type of this class of attributes, not static method. More...
 
virtual std::wstring namingName (const std::wstring &theDefaultValue=L"")=0
 Returns a textual string of the selection. More...
 
virtual void setId (int theID)=0
 Defines an id of the selection. More...
 
virtual void selectSubShape (const std::string &theType, const std::wstring &theSubShapeName)=0
 Selects sub-shape by the textual Name. More...
 
virtual void selectSubShape (const std::string &theType, const std::shared_ptr< GeomAPI_Pnt > &thePoint)=0
 Selects sub-shape by its inner point. More...
 
virtual void selectSubShape (const std::string &theType, const std::wstring &theContextName, const int theIndex)=0
 Selects sub-shape by weak naming index. More...
 
virtual bool isInvalid ()=0
 Returns true if recompute of selection become impossible. More...
 
virtual bool isGeometricalSelection () const =0
 Returns true if is geometrical selection. More...
 
virtual ~ModelAPI_AttributeSelection ()
 To virtually destroy the fields of successors. More...
 
virtual std::wstring contextName (const ResultPtr &theContext) const =0
 Returns the name by context. Adds the part name if the context is located in other document. More...
 
virtual void combineGeometrical ()=0
 Makes the current local selection becomes all sub-shapes with same base geometry. More...
 
virtual void updateInHistory (bool &theRemove)=0
 Updates the arguments of selection if something was affected by creation or reorder of features upper in the history line. 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_AttributeSelection ()
 Objects are created for features automatically. 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 reference to the sub-shape of some result, the selected shape.

Member Enumeration Documentation

◆ CenterType

Type of the center of the circular of elliptic edge.

Enumerator
NOT_CENTER 

this is not a center

CIRCLE_CENTER 

center of the circle

ELLIPSE_FIRST_FOCUS 

first focus point of the ellipse

ELLIPSE_SECOND_FOCUS 

second focus point of the ellipse

Constructor & Destructor Documentation

◆ ~ModelAPI_AttributeSelection()

ModelAPI_AttributeSelection::~ModelAPI_AttributeSelection ( )
virtual

To virtually destroy the fields of successors.

◆ ModelAPI_AttributeSelection()

ModelAPI_AttributeSelection::ModelAPI_AttributeSelection ( )
protected

Objects are created for features automatically.

Member Function Documentation

◆ setValue()

virtual bool ModelAPI_AttributeSelection::setValue ( const ObjectPtr &  theContext,
const std::shared_ptr< GeomAPI_Shape > &  theSubShape,
const bool  theTemporarily = false 
)
pure virtual

Defines the result and its selected sub-shape.

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)
Returns
true if attribute was updated

Implemented in Model_AttributeSelection.

◆ setValueCenter()

virtual void ModelAPI_AttributeSelection::setValueCenter ( const ObjectPtr &  theContext,
const std::shared_ptr< GeomAPI_Edge > &  theEdge,
const CenterType  theCenterType,
const bool  theTemporarily = false 
)
pure virtual

Same as SetValue, but it takes an edge (on circular or elliptic curve) and stores the vertex of the central point (for ellipse the first or the second focus point)

Implemented in Model_AttributeSelection.

◆ selectValue()

virtual void ModelAPI_AttributeSelection::selectValue ( const std::shared_ptr< ModelAPI_AttributeSelection > &  theSource)
pure virtual

Makes this selection attribute selects the same as in theSource selection.

Implemented in Model_AttributeSelection.

◆ removeTemporaryValues()

virtual void ModelAPI_AttributeSelection::removeTemporaryValues ( )
pure virtual

Reset temporary stored values.

Implemented in Model_AttributeSelection.

◆ value()

virtual std::shared_ptr<GeomAPI_Shape> ModelAPI_AttributeSelection::value ( )
pure virtual

Returns the selected subshape.

Implemented in Model_AttributeSelection.

◆ context()

virtual ResultPtr ModelAPI_AttributeSelection::context ( )
pure virtual

Returns the context of the selection (the whole shape owner)

Implemented in Model_AttributeSelection.

◆ contextFeature()

virtual std::shared_ptr<ModelAPI_Feature> ModelAPI_AttributeSelection::contextFeature ( )
pure virtual

Returns the context of the selection if the whole feature was selected.

Implemented in Model_AttributeSelection.

◆ contextObject()

virtual std::shared_ptr<ModelAPI_Object> ModelAPI_AttributeSelection::contextObject ( )
pure virtual

Returns the context of the selection : result or feature.

Implemented in Model_AttributeSelection.

◆ update()

virtual bool ModelAPI_AttributeSelection::update ( )
pure virtual

Updates the selection due to the changes in the referenced objects.

Returns
false if update is failed

Implemented in Model_AttributeSelection.

◆ typeId()

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

Returns the type of this class of attributes.

◆ attributeType()

std::string ModelAPI_AttributeSelection::attributeType ( )
virtual

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

Implements ModelAPI_Attribute.

◆ namingName()

virtual std::wstring ModelAPI_AttributeSelection::namingName ( const std::wstring &  theDefaultValue = L"")
pure virtual

Returns a textual string of the selection.

Parameters
theDefaultValuea value, which is used if the naming name can not be obtained

Implemented in Model_AttributeSelection.

◆ setId()

virtual void ModelAPI_AttributeSelection::setId ( int  theID)
pure virtual

Defines an id of the selection.

Implemented in Model_AttributeSelection.

◆ selectSubShape() [1/3]

virtual void ModelAPI_AttributeSelection::selectSubShape ( const std::string &  theType,
const std::wstring &  theSubShapeName 
)
pure virtual

Selects sub-shape by the textual Name.

Implemented in Model_AttributeSelection.

◆ selectSubShape() [2/3]

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

Selects sub-shape by its inner point.

Implemented in Model_AttributeSelection.

◆ selectSubShape() [3/3]

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

Selects sub-shape by weak naming index.

Implemented in Model_AttributeSelection.

◆ isInvalid()

virtual bool ModelAPI_AttributeSelection::isInvalid ( )
pure virtual

Returns true if recompute of selection become impossible.

Implemented in Model_AttributeSelection.

◆ isGeometricalSelection()

virtual bool ModelAPI_AttributeSelection::isGeometricalSelection ( ) const
pure virtual

Returns true if is geometrical selection.

Implemented in Model_AttributeSelection.

◆ contextName()

virtual std::wstring ModelAPI_AttributeSelection::contextName ( const ResultPtr &  theContext) const
pure virtual

Returns the name by context. Adds the part name if the context is located in other document.

Implemented in Model_AttributeSelection.

◆ combineGeometrical()

virtual void ModelAPI_AttributeSelection::combineGeometrical ( )
pure virtual

Makes the current local selection becomes all sub-shapes with same base geometry.

Implemented in Model_AttributeSelection.

◆ updateInHistory()

virtual void ModelAPI_AttributeSelection::updateInHistory ( bool &  theRemove)
pure virtual

Updates the arguments of selection if something was affected by creation or reorder of features upper in the history line.

Returns theRemove true if this attribute must be removed (become deleted)

Implemented in Model_AttributeSelection.

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