X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelAPI%2FModelAPI_Attribute.h;h=cfef5172421791a08ebd6958ca018a3000be1378;hb=a5a4efb5a57703a634a60c097b6ab9179a04e6d4;hp=c54b395561b908739737abb7ba47674b92e11f43;hpb=b5e6786b95d33825a3d1537d5453492e774d6399;p=modules%2Fshaper.git diff --git a/src/ModelAPI/ModelAPI_Attribute.h b/src/ModelAPI/ModelAPI_Attribute.h index c54b39556..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 @@ -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; } };