X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelAPI%2FModelAPI_Attribute.h;h=cfef5172421791a08ebd6958ca018a3000be1378;hb=a5a4efb5a57703a634a60c097b6ab9179a04e6d4;hp=a73044d4a1ebcd57319cc2cd3548bb3ef7e55f9f;hpb=d77708ba98445935aae7a0d93b5506e1f16018de;p=modules%2Fshaper.git diff --git a/src/ModelAPI/ModelAPI_Attribute.h b/src/ModelAPI/ModelAPI_Attribute.h index a73044d4a..cfef51724 100644 --- a/src/ModelAPI/ModelAPI_Attribute.h +++ b/src/ModelAPI/ModelAPI_Attribute.h @@ -23,6 +23,8 @@ class ModelAPI_Attribute // accessible from the attributes bool myIsInitialized; bool myIsArgument; + bool myIsImmutable; + public: /// Returns the type of this class of attributes, not static method @@ -34,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; } @@ -70,12 +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; myIsArgument = true; + myIsImmutable = false; } };