SHAPER  9.12.0
GeomData_Point2D Class Reference

Attribute that contains 2D point. More...

Inheritance diagram for GeomData_Point2D:
Inheritance graph

Public Types

enum  PointComponent { C_X = 0 , C_Y = 1 }
 Point component (x,y) More...
 

Public Member Functions

virtual void setValue (const double theX, const double theY)
 Defines the double value. More...
 
virtual void setValue (const std::shared_ptr< GeomAPI_Pnt2d > &thePoint)
 Defines the point. More...
 
virtual double x () const
 Returns the X double value. More...
 
virtual double y () const
 Returns the Y double value. More...
 
virtual std::shared_ptr< GeomAPI_Pnt2dpnt ()
 Returns the 2D point. More...
 
virtual void setCalculatedValue (const double theX, const double theY)
 Defines the calculated double value. More...
 
virtual void setText (const std::wstring &theX, const std::wstring &theY)
 Defines the text values. More...
 
virtual std::wstring textX ()
 Returns the text values. More...
 
virtual std::wstring textY ()
 Returns the text value for Y. More...
 
virtual void setExpressionInvalid (int, const bool theFlag)
 Allows to set expression (text) as invalid (by the parameters listener) More...
 
virtual bool expressionInvalid (int)
 Returns true if text is invalid. More...
 
virtual void setExpressionError (int theComponent, const std::string &theError)
 Allows to set expression (text) error (by the parameters listener) More...
 
virtual std::string expressionError (int theComponent)
 Returns an expression error. More...
 
virtual void setUsedParameters (int theComponent, const std::set< std::wstring > &theUsedParameters)
 Defines the used parameters. More...
 
virtual std::set< std::wstring > usedParameters (int theComponent) const
 Returns the used parameters. More...
 
GEOMDATAAPI_EXPORT void move (const double theDeltaX, const double theDeltaY)
 Appends the delta values to point. More...
 
virtual GEOMDATAAPI_EXPORT std::string attributeType ()
 Returns the type of this class of attributes, not static method. 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...
 

Static Public Member Functions

static std::string typeId ()
 Returns the type of this class of attributes. More...
 
static GEOMDATAAPI_EXPORT std::shared_ptr< GeomDataAPI_Point2DgetPoint2D (const DataPtr &theData, const std::string &theAttribute)
 Returns this attribute from the data if it is possible. More...
 

Protected Member Functions

 GeomData_Point2D ()
 Initializes attributes. More...
 
virtual void reinit ()
 Reinitializes the internal state of the attribute (may be needed on undo/redo, abort, etc) More...
 
virtual void reset ()
 Resets attribute to deafult state. 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
 

Detailed Description

Attribute that contains 2D point.

Member Enumeration Documentation

◆ PointComponent

Point component (x,y)

Constructor & Destructor Documentation

◆ GeomData_Point2D()

GeomData_Point2D::GeomData_Point2D ( )
protected

Initializes attributes.

Member Function Documentation

◆ setValue() [1/2]

void GeomData_Point2D::setValue ( const double  theX,
const double  theY 
)
virtual

Defines the double value.

Implements GeomDataAPI_Point2D.

◆ setValue() [2/2]

void GeomData_Point2D::setValue ( const std::shared_ptr< GeomAPI_Pnt2d > &  thePoint)
virtual

Defines the point.

Implements GeomDataAPI_Point2D.

◆ x()

double GeomData_Point2D::x ( ) const
virtual

Returns the X double value.

Implements GeomDataAPI_Point2D.

◆ y()

double GeomData_Point2D::y ( ) const
virtual

Returns the Y double value.

Implements GeomDataAPI_Point2D.

◆ pnt()

std::shared_ptr< GeomAPI_Pnt2d > GeomData_Point2D::pnt ( )
virtual

Returns the 2D point.

Implements GeomDataAPI_Point2D.

◆ setCalculatedValue()

void GeomData_Point2D::setCalculatedValue ( const double  theX,
const double  theY 
)
virtual

Defines the calculated double value.

Implements GeomDataAPI_Point2D.

◆ setText()

void GeomData_Point2D::setText ( const std::wstring &  theX,
const std::wstring &  theY 
)
virtual

Defines the text values.

Implements GeomDataAPI_Point2D.

◆ textX()

std::wstring GeomData_Point2D::textX ( )
virtual

Returns the text values.

Implements GeomDataAPI_Point2D.

◆ textY()

std::wstring GeomData_Point2D::textY ( )
virtual

Returns the text value for Y.

Implements GeomDataAPI_Point2D.

◆ setExpressionInvalid()

void GeomData_Point2D::setExpressionInvalid ( int  theComponent,
const bool  theFlag 
)
virtual

Allows to set expression (text) as invalid (by the parameters listener)

Implements GeomDataAPI_Point2D.

◆ expressionInvalid()

bool GeomData_Point2D::expressionInvalid ( int  theComponent)
virtual

Returns true if text is invalid.

Implements GeomDataAPI_Point2D.

◆ setExpressionError()

void GeomData_Point2D::setExpressionError ( int  theComponent,
const std::string &  theError 
)
virtual

Allows to set expression (text) error (by the parameters listener)

Implements GeomDataAPI_Point2D.

◆ expressionError()

std::string GeomData_Point2D::expressionError ( int  theComponent)
virtual

Returns an expression error.

Implements GeomDataAPI_Point2D.

◆ setUsedParameters()

void GeomData_Point2D::setUsedParameters ( int  theComponent,
const std::set< std::wstring > &  theUsedParameters 
)
virtual

Defines the used parameters.

Implements GeomDataAPI_Point2D.

◆ usedParameters()

std::set< std::wstring > GeomData_Point2D::usedParameters ( int  theComponent) const
virtual

Returns the used parameters.

Implements GeomDataAPI_Point2D.

◆ reinit()

void GeomData_Point2D::reinit ( )
protectedvirtual

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

Reimplemented from ModelAPI_Attribute.

◆ reset()

void GeomData_Point2D::reset ( )
protectedvirtual

Resets attribute to deafult state.

Reimplemented from ModelAPI_Attribute.

◆ move()

void GeomDataAPI_Point2D::move ( const double  theDeltaX,
const double  theDeltaY 
)
inherited

Appends the delta values to point.

◆ typeId()

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

Returns the type of this class of attributes.

◆ attributeType()

std::string GeomDataAPI_Point2D::attributeType ( )
virtualinherited

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

Implements ModelAPI_Attribute.

◆ getPoint2D()

std::shared_ptr< GeomDataAPI_Point2D > GeomDataAPI_Point2D::getPoint2D ( const DataPtr &  theData,
const std::string &  theAttribute 
)
staticinherited

Returns this attribute from the data if it is possible.

Parameters
theDataa model data
theAttributean attribute index

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

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