1 // Copyright (C) 2014-2023 CEA, EDF
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include <ModelAPI_Attribute.h>
22 ModelAPI_Attribute::~ModelAPI_Attribute()
26 /// Sets the owner of this attribute
27 void ModelAPI_Attribute::setObject(const std::shared_ptr<ModelAPI_Object>& theObject)
32 /// Returns the owner of this attribute
33 const std::shared_ptr<ModelAPI_Object>& ModelAPI_Attribute::owner() const
38 /// Returns true if attribute was initialized by some value
39 bool ModelAPI_Attribute::isInitialized()
41 return myIsInitialized;
44 void ModelAPI_Attribute::setInitialized()
46 if (!mySetInitializedBlocked)
47 myIsInitialized = true;
50 bool ModelAPI_Attribute::blockSetInitialized(const bool theBlock)
52 bool aBlocked = mySetInitializedBlocked;
54 mySetInitializedBlocked = theBlock;
59 void ModelAPI_Attribute::setIsArgument(const bool theFlag)
61 myIsArgument = theFlag;
64 bool ModelAPI_Attribute::isArgument()
69 bool ModelAPI_Attribute::setImmutable(const bool theFlag)
71 bool aResult = myIsImmutable;
72 myIsImmutable = theFlag;
76 bool ModelAPI_Attribute::isImmutable()
81 const std::string& ModelAPI_Attribute::id() const
86 ModelAPI_Attribute::ModelAPI_Attribute()
88 mySetInitializedBlocked = false;
89 myIsInitialized = false;
91 myIsImmutable = false;
94 /// Sets the ID of the attribute in Data (called from Data)
95 void ModelAPI_Attribute::setID(const std::string theID)
100 void ModelAPI_Attribute::reinit() {}
102 void ModelAPI_Attribute::reset()
104 myIsInitialized = false;