X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelAPI%2FModelAPI_Attribute.h;h=cfef5172421791a08ebd6958ca018a3000be1378;hb=a5a4efb5a57703a634a60c097b6ab9179a04e6d4;hp=e868e0d31b3a73d461eb385989a301f33d82ae4d;hpb=d3be0c9eaeb82488d43150f1d220a822a7fbe766;p=modules%2Fshaper.git diff --git a/src/ModelAPI/ModelAPI_Attribute.h b/src/ModelAPI/ModelAPI_Attribute.h index e868e0d31..cfef51724 100644 --- a/src/ModelAPI/ModelAPI_Attribute.h +++ b/src/ModelAPI/ModelAPI_Attribute.h @@ -22,8 +22,9 @@ class ModelAPI_Attribute protected: // accessible from the attributes bool myIsInitialized; - bool myIsComputedDefault; bool myIsArgument; + bool myIsImmutable; + public: /// Returns the type of this class of attributes, not static method @@ -35,7 +36,7 @@ class ModelAPI_Attribute } /// Sets the owner of this attribute - MODELAPI_EXPORT void setObject(const boost::shared_ptr& theObject) + MODELAPI_EXPORT virtual void setObject(const boost::shared_ptr& theObject) { myObject = theObject; } @@ -58,19 +59,6 @@ class ModelAPI_Attribute myIsInitialized = true; } - /// Returns true if attribute's default value was computed - MODELAPI_EXPORT bool isComputedDefault() - { - return myIsComputedDefault; - } - - /// Tells that attribute's default value was computed - MODELAPI_EXPORT void setComputedDefault() - { - myIsComputedDefault = true; - myIsInitialized = false; - } - /// Set this attribute is argument for result (change of this attribute requires update of result). /// By default it is true. MODELAPI_EXPORT void setIsArgument(const bool theFlag) @@ -84,13 +72,29 @@ class ModelAPI_Attribute return myIsArgument; } + /// Immutable argument can not be changed programaticaly (e.g. by constraint) + /// By default it is false. + /// Returns the previous state of the attribute's immutability. + MODELAPI_EXPORT bool setImmutable(const bool theFlag) + { + bool aResult = myIsImmutable; + myIsImmutable = theFlag; + return aResult; + } + + /// Returns true if can not be changed programaticaly + MODELAPI_EXPORT bool isImmutable() + { + return myIsImmutable; + } + protected: /// Objects are created for features automatically ModelAPI_Attribute() { myIsInitialized = false; - myIsComputedDefault = false; myIsArgument = true; + myIsImmutable = false; } };