SHAPER  9.12.0
ModelAPI_Feature Class Referenceabstract

Feature function that represents the particular functionality of this operation. More...

Inherits ModelAPI_Object.

Inherited by BuildPlugin_Compound, BuildPlugin_Edge, BuildPlugin_Filling, BuildPlugin_Interpolation, BuildPlugin_Polyline, BuildPlugin_Shape, BuildPlugin_SubShapes, BuildPlugin_Vertex, BuildPlugin_Wire, CollectionPlugin_Field, CollectionPlugin_Group, ConstructionPlugin_Axis, ConstructionPlugin_Plane, ConstructionPlugin_Point, ExchangePlugin_Dump, ExchangePlugin_ExportFeature, ExchangePlugin_ExportPart, ExchangePlugin_ImportBase, ExchangePlugin_ImportPart, FeaturesPlugin_BoundingBoxBase, FeaturesPlugin_CommonSharedFaces, FeaturesPlugin_Copy, FeaturesPlugin_Defeaturing, FeaturesPlugin_Fillet1D, FeaturesPlugin_FusionFaces, FeaturesPlugin_GeometryCalculation, FeaturesPlugin_GlueFaces, FeaturesPlugin_InspectNormalToFace, FeaturesPlugin_LimitTolerance, FeaturesPlugin_Loft, FeaturesPlugin_Measurement, FeaturesPlugin_MultiRotation, FeaturesPlugin_MultiTranslation, FeaturesPlugin_NormalToFace, FeaturesPlugin_Pipe, FeaturesPlugin_Placement, FeaturesPlugin_PointCloudOnFace, FeaturesPlugin_PointCoordinates, FeaturesPlugin_Recover, FeaturesPlugin_RemoveResults, FeaturesPlugin_RemoveSubShapes, FeaturesPlugin_Rotation, FeaturesPlugin_Scale, FeaturesPlugin_Sewing, FeaturesPlugin_Symmetry, FeaturesPlugin_Translation, FeaturesPlugin_VersionedBoolean, FeaturesPlugin_VersionedChFi, GDMLPlugin_ConeSegment, GDMLPlugin_Ellipsoid, ModelAPI_CompositeFeature, ModelAPI_FiltersFeature, Model_SelectionInPartFeature, ParametersPlugin_Parameter, ParametersPlugin_ParametersMgr, PartSetPlugin_Duplicate, PartSetPlugin_Remove, PrimitivesPlugin_Box, PrimitivesPlugin_Cone, PrimitivesPlugin_Cylinder, PrimitivesPlugin_Sphere, PrimitivesPlugin_Torus, PrimitivesPlugin_Tube, SamplePanelPlugin_Feature, SketchPlugin_Feature, SketchPlugin_SketchCopy, and SketchPlugin_SketchDrawer.

Public Member Functions

virtual const std::string & getKind ()=0
 Returns the unique kind of a feature (like "Point") More...
 
virtual std::shared_ptr< ModelAPI_Documentdocument () const
 Returns document this feature belongs to. More...
 
virtual std::string groupName ()
 Returns the group identifier of this result. More...
 
virtual void execute ()=0
 Computes or recomputes the results. More...
 
virtual bool compute (const std::string &)
 Computes the attribute value on the base of other attributes if the value can be computed. More...
 
virtual MODELAPI_EXPORT void setError (const std::string &theError, bool isSend=true, bool isTranslate=true)
 Registers error during the execution, causes the ExecutionFailed state. More...
 
virtual std::string error () const
 Returns error, arose during the execution. More...
 
MODELAPI_EXPORT const std::list< std::shared_ptr< ModelAPI_Result > > & results ()
 returns the current results of the feature More...
 
MODELAPI_EXPORT std::shared_ptr< ModelAPI_ResultfirstResult () const
 returns the first result in the list or NULL reference More...
 
MODELAPI_EXPORT std::shared_ptr< ModelAPI_ResultlastResult ()
 returns the last result in the list or NULL reference More...
 
MODELAPI_EXPORT void setResult (const std::shared_ptr< ModelAPI_Result > &theResult)
 sets the alone result More...
 
MODELAPI_EXPORT void setResult (const std::shared_ptr< ModelAPI_Result > &theResult, const int theIndex)
 sets the result by index (zero based), results before this must be set before More...
 
MODELAPI_EXPORT void removeResults (const int theSinceIndex, const bool theForever=true, const bool theFlush=true)
 removes all results starting from the given index (zero-based) More...
 
MODELAPI_EXPORT void eraseResults (const bool theForever=true)
 removes all results from the feature More...
 
virtual MODELAPI_EXPORT void erase ()
 removes all fields from this feature: results, data, etc More...
 
MODELAPI_EXPORT void eraseResultFromList (const std::shared_ptr< ModelAPI_Result > &theResult)
 removes the result from the list of feature (not doing in disabled): normally this method is not used from features. More...
 
virtual bool isPersistentResult ()
 Returns true if result is persistent (stored in document) and on undo-redo, save-open it is not needed to recompute it. More...
 
virtual bool isAction ()
 Returns true if this feature must not be created: this is just an action that is not stored in the features history and data model (like "delete part"). More...
 
virtual MODELAPI_EXPORT bool isMacro () const
 Returns true if this feature is used as macro: creates other features and then removed. More...
 
virtual MODELAPI_EXPORT bool isPreviewNeeded () const
 Returns true if preview update during the edition needed. More...
 
virtual MODELAPI_EXPORT const std::string & documentToAdd ()
 Must return document where the new feature must be added to By default it is empty: it is added to the document this method is called to. More...
 
virtual MODELAPI_EXPORT bool setDisabled (const bool theFlag)
 Enables/disables the feature. More...
 
virtual MODELAPI_EXPORT bool isDisabled ()
 Returns the feature is disabled or not. More...
 
virtual MODELAPI_EXPORT ~ModelAPI_Feature ()
 To virtually destroy the fields of successors. More...
 
virtual MODELAPI_EXPORT bool setStable (const bool theFlag)
 Set the stable feature flag. More...
 
virtual MODELAPI_EXPORT bool isStable ()
 Returns the feature is stable or not. More...
 
virtual MODELAPI_EXPORT bool isEditable ()
 Returns the feature is editable or not. Most of features are editable. More...
 
virtual MODELAPI_EXPORT bool customAction (const std::string &theActionId)
 Performs some custom feature specific functionality (normally called by some GUI button) More...
 
std::wstring name ()
 Returns the name stored in the attribute. More...
 
std::shared_ptr< ModelAPI_AttributeBooleanboolean (const std::string &theID)
 Returns the Boolean attribute by the identifier. More...
 
std::shared_ptr< ModelAPI_AttributeDocRefdocument (const std::string &theID)
 Returns the document reference attribute. More...
 
std::shared_ptr< ModelAPI_AttributeDoublereal (const std::string &theID)
 Returns the real attribute by the identifier. More...
 
std::shared_ptr< ModelAPI_AttributeIntegerinteger (const std::string &theID)
 Returns the integer attribute by the identifier. More...
 
std::shared_ptr< ModelAPI_AttributeIntArrayintArray (const std::string &theID)
 Returns the integer array attribute by the identifier. More...
 
std::shared_ptr< ModelAPI_AttributeRefAttrrefattr (const std::string &theID)
 Returns the reference attribute by the identifier. More...
 
std::shared_ptr< ModelAPI_AttributeRefAttrListrefattrlist (const std::string &theID)
 Returns the refattrlist attribute by the identifier. More...
 
std::shared_ptr< ModelAPI_AttributeReferencereference (const std::string &theID)
 Returns the reference attribute by the identifier. More...
 
std::shared_ptr< ModelAPI_AttributeRefListreflist (const std::string &theID)
 Returns the list of references attribute by the identifier. More...
 
std::shared_ptr< ModelAPI_AttributeSelectionselection (const std::string &theID)
 Returns the shape selection attribute by the identifier. More...
 
std::shared_ptr< ModelAPI_AttributeSelectionListselectionList (const std::string &theID)
 Returns the list of shape selections attribute by the identifier. More...
 
std::shared_ptr< ModelAPI_AttributeStringstring (const std::string &theID)
 Returns the string attribute by the identifier. More...
 
std::shared_ptr< ModelAPI_AttributeStringArraystringArray (const std::string &theID)
 Returns the string array attribute by the identifier. More...
 
std::shared_ptr< ModelAPI_AttributeTablestables (const std::string &theID)
 Returns the tables attribute by the identifier. More...
 
std::shared_ptr< ModelAPI_Attributeattribute (const std::string &theID)
 Returns the attribute by the identifier. More...
 
virtual bool isInHistory ()
 By default object is displayed in the object browser. More...
 
virtual void setInHistory (const std::shared_ptr< ModelAPI_Object > theObject, const bool theFlag)
 Makes object presented or not in the history of the created objects. More...
 
virtual std::shared_ptr< ModelAPI_Datadata () const
 Returns the data manager of this object: attributes. More...
 
virtual bool isSame (const std::shared_ptr< ModelAPI_Object > &theObject)
 Returns true if object refers to the same data model instance. More...
 
virtual void initAttributes ()=0
 Request for initialization of data model of the object: adding all attributes. More...
 
virtual void colorConfigInfo (std::string &, std::string &, std::string &)
 Returns the parameters of color definition in the resources config manager. More...
 
virtual void attributeChanged (const std::string &theID)
 Called on change of any argument-attribute of this object. More...
 
virtual bool isDisplayed ()
 Returns true if object must be displayed in the viewer: flag is stored in the data model, so on undo/redo, open/save or recreation of object by history-playing it keeps the original state in the current transaction. More...
 
virtual void setDisplayed (const bool theDisplay)
 Sets the displayed/hidden state of the object. More...
 
virtual bool hasTexture ()
 
virtual void emptyFunction () const
 Empty function which is added for virtualiation of the interface. More...
 

Static Public Member Functions

static std::string group ()
 Returns the group identifier of all features. More...
 
static MODELAPI_EXPORT std::shared_ptr< ModelAPI_Featurefeature (ObjectPtr theObject)
 Returns the feature by the object (result). More...
 

Protected Member Functions

virtual MODELAPI_EXPORT void init ()
 This method is called just after creation of the object: it must initialize all fields, normally initialized in the constructor. More...
 
virtual void setData (std::shared_ptr< ModelAPI_Data > theData)
 Sets the data manager of an object (document does) More...
 
virtual void setDoc (std::shared_ptr< ModelAPI_Document > theDoc)
 Sets the data manager of an object (document does) More...
 

Friends

class Model_Document
 
class Model_Objects
 

Detailed Description

Feature function that represents the particular functionality of this operation.

Produces results by the arguments.

Constructor & Destructor Documentation

◆ ~ModelAPI_Feature()

ModelAPI_Feature::~ModelAPI_Feature ( )
virtual

To virtually destroy the fields of successors.

Member Function Documentation

◆ getKind()

virtual const std::string& ModelAPI_Feature::getKind ( )
pure virtual

Returns the unique kind of a feature (like "Point")

Implemented in ExchangePlugin_ImportFeatureBase, ExchangePlugin_Import_ImageFeature, ExchangePlugin_ImportFeature, ExchangePlugin_Import_Image, ExchangePlugin_Import, SketchPlugin_Trim, SketchPlugin_Split, SketchPlugin_SketchDrawer, SketchPlugin_SketchCopy, SketchPlugin_Sketch, SketchPlugin_Projection, SketchPlugin_Point, SketchPlugin_Offset, SketchPlugin_MultiTranslation, SketchPlugin_MultiRotation, SketchPlugin_MacroEllipticArc, SketchPlugin_MacroEllipse, SketchPlugin_MacroCircle, SketchPlugin_MacroBSplinePeriodic, SketchPlugin_MacroBSpline, SketchPlugin_MacroArc, SketchPlugin_Line, SketchPlugin_IntersectionPoint, SketchPlugin_Fillet, SketchPlugin_EllipticArc, SketchPlugin_Ellipse, SketchPlugin_CurveFitting, SketchPlugin_ConstraintVertical, SketchPlugin_ConstraintTangent, SketchPlugin_ConstraintRigid, SketchPlugin_ConstraintRadius, SketchPlugin_ConstraintPerpendicular, SketchPlugin_ConstraintParallel, SketchPlugin_ConstraintMirror, SketchPlugin_ConstraintMiddle, SketchPlugin_ConstraintLength, SketchPlugin_ConstraintHorizontal, SketchPlugin_ConstraintEqual, SketchPlugin_ConstraintDistanceVertical, SketchPlugin_ConstraintDistanceHorizontal, SketchPlugin_ConstraintDistance, SketchPlugin_ConstraintCollinear, SketchPlugin_ConstraintCoincidenceInternal, SketchPlugin_ConstraintCoincidence, SketchPlugin_ConstraintAngle, SketchPlugin_Circle, SketchPlugin_BSplinePeriodic, SketchPlugin_BSpline, SketchPlugin_Arc, SamplePanelPlugin_Feature, PrimitivesPlugin_Tube, PrimitivesPlugin_Torus, PrimitivesPlugin_Sphere, PrimitivesPlugin_Cylinder, PrimitivesPlugin_Cone, PrimitivesPlugin_Box, PartSetPlugin_Remove, PartSetPlugin_Part, PartSetPlugin_Duplicate, ParametersPlugin_ParametersMgr, ParametersPlugin_Parameter, Model_SelectionInPartFeature, GDMLPlugin_Ellipsoid, GDMLPlugin_ConeSegment, FiltersPlugin_Selection, FeaturesPlugin_Union, FeaturesPlugin_Translation, FeaturesPlugin_Symmetry, FeaturesPlugin_SharedFaces, FeaturesPlugin_Sewing, FeaturesPlugin_Scale, FeaturesPlugin_Rotation, FeaturesPlugin_RevolutionFuse, FeaturesPlugin_RevolutionCut, FeaturesPlugin_Revolution, FeaturesPlugin_RemoveSubShapes, FeaturesPlugin_RemoveResults, FeaturesPlugin_Recover, FeaturesPlugin_PointCoordinates, FeaturesPlugin_PointCloudOnFace, FeaturesPlugin_Placement, FeaturesPlugin_Pipe, FeaturesPlugin_Partition, FeaturesPlugin_NormalToFace, FeaturesPlugin_MultiTranslation, FeaturesPlugin_MultiRotation, FeaturesPlugin_Measurement, FeaturesPlugin_Loft, FeaturesPlugin_LimitTolerance, FeaturesPlugin_Intersection, FeaturesPlugin_InspectNormalToFace, FeaturesPlugin_InspectBoundingBox, FeaturesPlugin_ImportResult, FeaturesPlugin_GroupSharedFaces, FeaturesPlugin_GlueFaces, FeaturesPlugin_GeometryCalculation, FeaturesPlugin_FusionFaces, FeaturesPlugin_Fillet1D, FeaturesPlugin_Fillet, FeaturesPlugin_ExtrusionFuse, FeaturesPlugin_ExtrusionCut, FeaturesPlugin_Extrusion, FeaturesPlugin_Defeaturing, FeaturesPlugin_Copy, FeaturesPlugin_Chamfer, FeaturesPlugin_BoundingBox, FeaturesPlugin_BooleanSmash, FeaturesPlugin_BooleanFuse, FeaturesPlugin_BooleanFill, FeaturesPlugin_BooleanCut, FeaturesPlugin_BooleanCommon, ExchangePlugin_ImportPart, ExchangePlugin_ExportPart, ExchangePlugin_ExportFeature, ExchangePlugin_Dump, ConstructionPlugin_Point, ConstructionPlugin_Plane, ConstructionPlugin_Axis, CollectionPlugin_GroupSubstraction, CollectionPlugin_GroupShape, CollectionPlugin_GroupIntersection, CollectionPlugin_GroupAddition, CollectionPlugin_Group, CollectionPlugin_Field, BuildPlugin_Wire, BuildPlugin_Vertex, BuildPlugin_SubShapes, BuildPlugin_Solid, BuildPlugin_Shell, BuildPlugin_Polyline, BuildPlugin_Interpolation, BuildPlugin_Filling, BuildPlugin_Face, BuildPlugin_Edge, BuildPlugin_CompSolid, and BuildPlugin_Compound.

◆ group()

static std::string ModelAPI_Feature::group ( )
inlinestatic

Returns the group identifier of all features.

◆ document() [1/2]

virtual std::shared_ptr<ModelAPI_Document> ModelAPI_Feature::document ( ) const
inlinevirtual

Returns document this feature belongs to.

Reimplemented from ModelAPI_Object.

◆ groupName()

virtual std::string ModelAPI_Feature::groupName ( )
inlinevirtual

Returns the group identifier of this result.

Implements ModelAPI_Object.

◆ execute()

virtual void ModelAPI_Feature::execute ( )
pure virtual

Computes or recomputes the results.

Implemented in ExchangePlugin_ImportFeatureBase, ExchangePlugin_ImportBase, ExchangePlugin_Import_ImageFeature, ExchangePlugin_ImportFeature, ExchangePlugin_Import_Image, ExchangePlugin_Import, SketchPlugin_Trim, SketchPlugin_Split, SketchPlugin_SketchDrawer, SketchPlugin_SketchCopy, SketchPlugin_Sketch, SketchPlugin_Projection, SketchPlugin_Point, SketchPlugin_Offset, SketchPlugin_MultiTranslation, SketchPlugin_MultiRotation, SketchPlugin_MacroEllipticArc, SketchPlugin_MacroEllipse, SketchPlugin_MacroCircle, SketchPlugin_MacroBSpline, SketchPlugin_MacroArc, SketchPlugin_Line, SketchPlugin_IntersectionPoint, SketchPlugin_Fillet, SketchPlugin_EllipticArc, SketchPlugin_Ellipse, SketchPlugin_CurveFitting, SketchPlugin_ConstraintVertical, SketchPlugin_ConstraintTangent, SketchPlugin_ConstraintRigid, SketchPlugin_ConstraintRadius, SketchPlugin_ConstraintPerpendicular, SketchPlugin_ConstraintParallel, SketchPlugin_ConstraintMirror, SketchPlugin_ConstraintMiddle, SketchPlugin_ConstraintLength, SketchPlugin_ConstraintHorizontal, SketchPlugin_ConstraintEqual, SketchPlugin_ConstraintDistanceAlongDir, SketchPlugin_ConstraintDistance, SketchPlugin_ConstraintCollinear, SketchPlugin_ConstraintCoincidenceInternal, SketchPlugin_ConstraintCoincidence, SketchPlugin_ConstraintAngle, SketchPlugin_Circle, SketchPlugin_BSplineBase, SketchPlugin_Arc, SamplePanelPlugin_Feature, PrimitivesPlugin_Tube, PrimitivesPlugin_Torus, PrimitivesPlugin_Sphere, PrimitivesPlugin_Cylinder, PrimitivesPlugin_Cone, PrimitivesPlugin_Box, PartSetPlugin_Remove, PartSetPlugin_Part, PartSetPlugin_Duplicate, ParametersPlugin_ParametersMgr, ParametersPlugin_Parameter, Model_SelectionInPartFeature, GDMLPlugin_Ellipsoid, GDMLPlugin_ConeSegment, FiltersPlugin_Selection, FeaturesPlugin_VersionedChFi, FeaturesPlugin_Union, FeaturesPlugin_Translation, FeaturesPlugin_Symmetry, FeaturesPlugin_SharedFaces, FeaturesPlugin_Sewing, FeaturesPlugin_Scale, FeaturesPlugin_Rotation, FeaturesPlugin_RevolutionFuse, FeaturesPlugin_RevolutionCut, FeaturesPlugin_Revolution, FeaturesPlugin_RemoveSubShapes, FeaturesPlugin_RemoveResults, FeaturesPlugin_Recover, FeaturesPlugin_PointCoordinates, FeaturesPlugin_PointCloudOnFace, FeaturesPlugin_Placement, FeaturesPlugin_Pipe, FeaturesPlugin_Partition, FeaturesPlugin_NormalToFace, FeaturesPlugin_MultiTranslation, FeaturesPlugin_MultiRotation, FeaturesPlugin_Measurement, FeaturesPlugin_Loft, FeaturesPlugin_LimitTolerance, FeaturesPlugin_Intersection, FeaturesPlugin_InspectNormalToFace, FeaturesPlugin_InspectBoundingBox, FeaturesPlugin_ImportResult, FeaturesPlugin_GroupSharedFaces, FeaturesPlugin_GlueFaces, FeaturesPlugin_GeometryCalculation, FeaturesPlugin_FusionFaces, FeaturesPlugin_Fillet1D, FeaturesPlugin_ExtrusionFuse, FeaturesPlugin_ExtrusionCut, FeaturesPlugin_Extrusion, FeaturesPlugin_Defeaturing, FeaturesPlugin_Copy, FeaturesPlugin_CommonSharedFaces, FeaturesPlugin_BoundingBoxBase, FeaturesPlugin_BoundingBox, FeaturesPlugin_BooleanSmash, FeaturesPlugin_BooleanFuse, FeaturesPlugin_BooleanFill, FeaturesPlugin_BooleanCut, FeaturesPlugin_BooleanCommon, ExchangePlugin_ImportPart, ExchangePlugin_ExportPart, ExchangePlugin_ExportFeature, ExchangePlugin_Dump, ConstructionPlugin_Point, ConstructionPlugin_Plane, ConstructionPlugin_Axis, CollectionPlugin_GroupSubstraction, CollectionPlugin_GroupShape, CollectionPlugin_GroupIntersection, CollectionPlugin_GroupAddition, CollectionPlugin_Group, CollectionPlugin_Field, BuildPlugin_Wire, BuildPlugin_Vertex, BuildPlugin_SubShapes, BuildPlugin_Solid, BuildPlugin_Shell, BuildPlugin_Polyline, BuildPlugin_Interpolation, BuildPlugin_Filling, BuildPlugin_Face, BuildPlugin_Edge, and BuildPlugin_Compound.

◆ compute()

virtual bool ModelAPI_Feature::compute ( const std::string &  )
inlinevirtual

Computes the attribute value on the base of other attributes if the value can be computed.

Parameters
theAttributeIdan attribute index to be computed
Returns
a boolean value about it is computed

Reimplemented in SketchPlugin_ConstraintRadius, SketchPlugin_ConstraintLength, and SketchPlugin_ConstraintAngle.

◆ setError()

void ModelAPI_Feature::setError ( const std::string &  theError,
bool  isSend = true,
bool  isTranslate = true 
)
virtual

Registers error during the execution, causes the ExecutionFailed state.

◆ error()

virtual std::string ModelAPI_Feature::error ( ) const
inlinevirtual

Returns error, arose during the execution.

◆ results()

const std::list< std::shared_ptr< ModelAPI_Result > > & ModelAPI_Feature::results ( )

returns the current results of the feature

◆ firstResult()

std::shared_ptr< ModelAPI_Result > ModelAPI_Feature::firstResult ( ) const

returns the first result in the list or NULL reference

◆ lastResult()

std::shared_ptr< ModelAPI_Result > ModelAPI_Feature::lastResult ( )

returns the last result in the list or NULL reference

◆ setResult() [1/2]

void ModelAPI_Feature::setResult ( const std::shared_ptr< ModelAPI_Result > &  theResult)

sets the alone result

◆ setResult() [2/2]

void ModelAPI_Feature::setResult ( const std::shared_ptr< ModelAPI_Result > &  theResult,
const int  theIndex 
)

sets the result by index (zero based), results before this must be set before

◆ removeResults()

void ModelAPI_Feature::removeResults ( const int  theSinceIndex,
const bool  theForever = true,
const bool  theFlush = true 
)

removes all results starting from the given index (zero-based)

Parameters
theSinceIndex- index of the deleted result and all after also will be deleted
theForever- removes results for long period (not just because of feature disabling)
theFlush- if it is false, REDISPLAY message is not flushed

◆ eraseResults()

void ModelAPI_Feature::eraseResults ( const bool  theForever = true)

removes all results from the feature

◆ erase()

void ModelAPI_Feature::erase ( )
virtual

removes all fields from this feature: results, data, etc

Reimplemented from ModelAPI_Object.

Reimplemented in SketchPlugin_MultiTranslation, SketchPlugin_MultiRotation, SketchPlugin_ConstraintMirror, PartSetPlugin_Part, and ModelAPI_CompositeFeature.

◆ eraseResultFromList()

void ModelAPI_Feature::eraseResultFromList ( const std::shared_ptr< ModelAPI_Result > &  theResult)

removes the result from the list of feature (not doing in disabled): normally this method is not used from features.

only internally

◆ isPersistentResult()

virtual bool ModelAPI_Feature::isPersistentResult ( )
inlinevirtual

Returns true if result is persistent (stored in document) and on undo-redo, save-open it is not needed to recompute it.

Reimplemented in ParametersPlugin_ParametersMgr, CollectionPlugin_GroupOperation, CollectionPlugin_Group, and CollectionPlugin_Field.

◆ isAction()

virtual bool ModelAPI_Feature::isAction ( )
inlinevirtual

Returns true if this feature must not be created: this is just an action that is not stored in the features history and data model (like "delete part").

Reimplemented in PartSetPlugin_Remove, and PartSetPlugin_Duplicate.

◆ isMacro()

◆ isPreviewNeeded()

◆ documentToAdd()

const std::string & ModelAPI_Feature::documentToAdd ( )
virtual

Must return document where the new feature must be added to By default it is empty: it is added to the document this method is called to.

Reimplemented in PartSetPlugin_Part.

◆ setDisabled()

bool ModelAPI_Feature::setDisabled ( const bool  theFlag)
virtual

Enables/disables the feature.

The disabled feature has no results and does not participate in any calculation.

Returns
true if state is really changed

◆ isDisabled()

bool ModelAPI_Feature::isDisabled ( )
virtual

Returns the feature is disabled or not.

Implements ModelAPI_Object.

◆ feature()

FeaturePtr ModelAPI_Feature::feature ( ObjectPtr  theObject)
static

Returns the feature by the object (result).

◆ setStable()

bool ModelAPI_Feature::setStable ( const bool  theFlag)
virtual

Set the stable feature flag.

If feature is currently editing then it is not stable.

Returns
true if state is really changed

◆ isStable()

bool ModelAPI_Feature::isStable ( )
virtual

Returns the feature is stable or not.

◆ isEditable()

bool ModelAPI_Feature::isEditable ( )
virtual

Returns the feature is editable or not. Most of features are editable.

Reimplemented in ExchangePlugin_ImportFeature.

◆ customAction()

bool ModelAPI_Feature::customAction ( const std::string &  theActionId)
virtual

Performs some custom feature specific functionality (normally called by some GUI button)

Parameters
theActionIdan action key
Returns
a boolean value about it is performed

Reimplemented in SketchPlugin_Sketch, SketchPlugin_Offset, SketchPlugin_CurveFitting, SketchPlugin_BSplineBase, CollectionPlugin_Group, and BuildPlugin_Wire.

◆ name()

std::wstring ModelAPI_Feature::name ( )
inline

Returns the name stored in the attribute.

◆ boolean()

std::shared_ptr<ModelAPI_AttributeBoolean> ModelAPI_Feature::boolean ( const std::string &  theID)
inline

Returns the Boolean attribute by the identifier.

◆ document() [2/2]

std::shared_ptr<ModelAPI_AttributeDocRef> ModelAPI_Feature::document ( const std::string &  theID)
inline

Returns the document reference attribute.

◆ real()

std::shared_ptr<ModelAPI_AttributeDouble> ModelAPI_Feature::real ( const std::string &  theID)
inline

Returns the real attribute by the identifier.

◆ integer()

std::shared_ptr<ModelAPI_AttributeInteger> ModelAPI_Feature::integer ( const std::string &  theID)
inline

Returns the integer attribute by the identifier.

◆ intArray()

std::shared_ptr<ModelAPI_AttributeIntArray> ModelAPI_Feature::intArray ( const std::string &  theID)
inline

Returns the integer array attribute by the identifier.

◆ refattr()

std::shared_ptr<ModelAPI_AttributeRefAttr> ModelAPI_Feature::refattr ( const std::string &  theID)
inline

Returns the reference attribute by the identifier.

◆ refattrlist()

std::shared_ptr<ModelAPI_AttributeRefAttrList> ModelAPI_Feature::refattrlist ( const std::string &  theID)
inline

Returns the refattrlist attribute by the identifier.

◆ reference()

std::shared_ptr<ModelAPI_AttributeReference> ModelAPI_Feature::reference ( const std::string &  theID)
inline

Returns the reference attribute by the identifier.

◆ reflist()

std::shared_ptr<ModelAPI_AttributeRefList> ModelAPI_Feature::reflist ( const std::string &  theID)
inline

Returns the list of references attribute by the identifier.

◆ selection()

std::shared_ptr<ModelAPI_AttributeSelection> ModelAPI_Feature::selection ( const std::string &  theID)
inline

Returns the shape selection attribute by the identifier.

◆ selectionList()

std::shared_ptr<ModelAPI_AttributeSelectionList> ModelAPI_Feature::selectionList ( const std::string &  theID)
inline

Returns the list of shape selections attribute by the identifier.

◆ string()

std::shared_ptr<ModelAPI_AttributeString> ModelAPI_Feature::string ( const std::string &  theID)
inline

Returns the string attribute by the identifier.

◆ stringArray()

std::shared_ptr<ModelAPI_AttributeStringArray> ModelAPI_Feature::stringArray ( const std::string &  theID)
inline

Returns the string array attribute by the identifier.

◆ tables()

std::shared_ptr<ModelAPI_AttributeTables> ModelAPI_Feature::tables ( const std::string &  theID)
inline

Returns the tables attribute by the identifier.

◆ attribute()

std::shared_ptr<ModelAPI_Attribute> ModelAPI_Feature::attribute ( const std::string &  theID)
inline

Returns the attribute by the identifier.

◆ init()

void ModelAPI_Feature::init ( )
protectedvirtual

This method is called just after creation of the object: it must initialize all fields, normally initialized in the constructor.

Implements ModelAPI_Object.

◆ isInHistory()

bool ModelAPI_Object::isInHistory ( )
virtualinherited

◆ setInHistory()

void ModelAPI_Object::setInHistory ( const std::shared_ptr< ModelAPI_Object theObject,
const bool  theFlag 
)
virtualinherited

Makes object presented or not in the history of the created objects.

Parameters
theObjectis shared pointer to "this"
theFlagis boolean value: to add or remove from the history

◆ data()

std::shared_ptr< ModelAPI_Data > ModelAPI_Object::data ( ) const
virtualinherited

Returns the data manager of this object: attributes.

◆ isSame()

bool ModelAPI_Object::isSame ( const std::shared_ptr< ModelAPI_Object > &  theObject)
virtualinherited

Returns true if object refers to the same data model instance.

◆ initAttributes()

virtual void ModelAPI_Object::initAttributes ( )
pure virtualinherited

Request for initialization of data model of the object: adding all attributes.

Implemented in ModelAPI_ResultParameter, FiltersPlugin_Selection, SketchPlugin_Trim, SketchPlugin_Split, SketchPlugin_SketchEntity, SketchPlugin_SketchDrawer, SketchPlugin_SketchCopy, SketchPlugin_Sketch, SketchPlugin_Offset, SketchPlugin_MultiTranslation, SketchPlugin_MultiRotation, SketchPlugin_MacroEllipticArc, SketchPlugin_MacroEllipse, SketchPlugin_MacroCircle, SketchPlugin_MacroBSpline, SketchPlugin_MacroArc, SketchPlugin_Line, SketchPlugin_Fillet, SketchPlugin_ConstraintVertical, SketchPlugin_ConstraintTangent, SketchPlugin_ConstraintRigid, SketchPlugin_ConstraintRadius, SketchPlugin_ConstraintPerpendicular, SketchPlugin_ConstraintParallel, SketchPlugin_ConstraintMirror, SketchPlugin_ConstraintMiddle, SketchPlugin_ConstraintLength, SketchPlugin_ConstraintHorizontal, SketchPlugin_ConstraintEqual, SketchPlugin_ConstraintDistanceAlongDir, SketchPlugin_ConstraintDistance, SketchPlugin_ConstraintCollinear, SketchPlugin_ConstraintCoincidenceInternal, SketchPlugin_ConstraintCoincidence, SketchPlugin_ConstraintAngle, SamplePanelPlugin_Feature, PrimitivesPlugin_Tube, PrimitivesPlugin_Torus, PrimitivesPlugin_Sphere, PrimitivesPlugin_Cylinder, PrimitivesPlugin_Cone, PrimitivesPlugin_Box, PartSetPlugin_Remove, PartSetPlugin_Part, PartSetPlugin_Duplicate, ParametersPlugin_ParametersMgr, ParametersPlugin_Parameter, ModelAPI_ResultField::ModelAPI_FieldStep, ModelAPI_Result, ModelAPI_Folder, Model_ResultPart, Model_ResultParameter, Model_ResultBody, Model_SelectionInPartFeature, GDMLPlugin_Ellipsoid, GDMLPlugin_ConeSegment, FeaturesPlugin_Union, FeaturesPlugin_Translation, FeaturesPlugin_Symmetry, FeaturesPlugin_SharedFaces, FeaturesPlugin_Sewing, FeaturesPlugin_Scale, FeaturesPlugin_Rotation, FeaturesPlugin_RevolutionBoolean, FeaturesPlugin_Revolution, FeaturesPlugin_RemoveSubShapes, FeaturesPlugin_RemoveResults, FeaturesPlugin_Recover, FeaturesPlugin_PointCoordinates, FeaturesPlugin_PointCloudOnFace, FeaturesPlugin_Placement, FeaturesPlugin_Pipe, FeaturesPlugin_Partition, FeaturesPlugin_NormalToFace, FeaturesPlugin_MultiTranslation, FeaturesPlugin_MultiRotation, FeaturesPlugin_Measurement, FeaturesPlugin_Loft, FeaturesPlugin_LimitTolerance, FeaturesPlugin_Intersection, FeaturesPlugin_InspectNormalToFace, FeaturesPlugin_InspectBoundingBox, FeaturesPlugin_ImportResult, FeaturesPlugin_GroupSharedFaces, FeaturesPlugin_GlueFaces, FeaturesPlugin_GeometryCalculation, FeaturesPlugin_FusionFaces, FeaturesPlugin_Fillet1D, FeaturesPlugin_Fillet, FeaturesPlugin_ExtrusionBoolean, FeaturesPlugin_Extrusion, FeaturesPlugin_Defeaturing, FeaturesPlugin_Copy, FeaturesPlugin_Chamfer, FeaturesPlugin_BoundingBox, FeaturesPlugin_BooleanSmash, FeaturesPlugin_BooleanFuse, FeaturesPlugin_BooleanFill, FeaturesPlugin_BooleanCut, FeaturesPlugin_BooleanCommon, FeaturesPlugin_Boolean, ExchangePlugin_ImportPart, ExchangePlugin_ImportFeature, ExchangePlugin_ImportFeatureBase, ExchangePlugin_Import, ExchangePlugin_ImportBase, ExchangePlugin_ExportPart, ExchangePlugin_ExportFeature, ExchangePlugin_Dump, ConstructionPlugin_Point, ConstructionPlugin_Plane, ConstructionPlugin_Axis, CollectionPlugin_GroupSubstraction, CollectionPlugin_GroupMerge, CollectionPlugin_GroupIntersection, CollectionPlugin_Group, CollectionPlugin_Field, BuildPlugin_Wire, BuildPlugin_Vertex, BuildPlugin_SubShapes, BuildPlugin_Solid, BuildPlugin_Shell, BuildPlugin_Polyline, BuildPlugin_Interpolation, BuildPlugin_Filling, BuildPlugin_Face, BuildPlugin_Edge, BuildPlugin_CompSolid, and BuildPlugin_Compound.

◆ colorConfigInfo()

virtual void ModelAPI_Object::colorConfigInfo ( std::string &  ,
std::string &  ,
std::string &   
)
inlinevirtualinherited

◆ attributeChanged()

void ModelAPI_Object::attributeChanged ( const std::string &  theID)
virtualinherited

◆ isDisplayed()

bool ModelAPI_Object::isDisplayed ( )
virtualinherited

Returns true if object must be displayed in the viewer: flag is stored in the data model, so on undo/redo, open/save or recreation of object by history-playing it keeps the original state in the current transaction.

Reimplemented in ModelAPI_ResultField::ModelAPI_FieldStep.

◆ setDisplayed()

void ModelAPI_Object::setDisplayed ( const bool  theDisplay)
virtualinherited

Sets the displayed/hidden state of the object.

If it is changed, sends the "redisplay" signal.

Reimplemented in ModelAPI_ResultField, ModelAPI_ResultField::ModelAPI_FieldStep, and ModelAPI_ResultBody.

◆ setData()

void ModelAPI_Object::setData ( std::shared_ptr< ModelAPI_Data theData)
protectedvirtualinherited

Sets the data manager of an object (document does)

◆ setDoc()

void ModelAPI_Object::setDoc ( std::shared_ptr< ModelAPI_Document theDoc)
protectedvirtualinherited

Sets the data manager of an object (document does)

◆ emptyFunction()

virtual void ModelAPI_Entity::emptyFunction ( ) const
inlinevirtualinherited

Empty function which is added for virtualiation of the interface.