1 // Copyright (C) 2014-2017 CEA/DEN, EDF R&D
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
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #include <ModelAPI_Attribute.h>
23 ModelAPI_Attribute::~ModelAPI_Attribute()
27 /// Sets the owner of this attribute
28 void ModelAPI_Attribute::setObject(const std::shared_ptr<ModelAPI_Object>& theObject)
33 /// Returns the owner of this attribute
34 const std::shared_ptr<ModelAPI_Object>& ModelAPI_Attribute::owner() const
39 /// Returns true if attribute was initialized by some value
40 bool ModelAPI_Attribute::isInitialized()
42 return myIsInitialized;
45 void ModelAPI_Attribute::setInitialized()
47 if (!mySetInitializedBlocked)
48 myIsInitialized = true;
51 bool ModelAPI_Attribute::blockSetInitialized(const bool theBlock)
53 bool aBlocked = mySetInitializedBlocked;
55 mySetInitializedBlocked = theBlock;
60 void ModelAPI_Attribute::setIsArgument(const bool theFlag)
62 myIsArgument = theFlag;
65 bool ModelAPI_Attribute::isArgument()
70 bool ModelAPI_Attribute::setImmutable(const bool theFlag)
72 bool aResult = myIsImmutable;
73 myIsImmutable = theFlag;
77 bool ModelAPI_Attribute::isImmutable()
82 const std::string& ModelAPI_Attribute::id() const
87 ModelAPI_Attribute::ModelAPI_Attribute()
89 mySetInitializedBlocked = false;
90 myIsInitialized = false;
92 myIsImmutable = false;
95 /// Sets the ID of the attribute in Data (called from Data)
96 void ModelAPI_Attribute::setID(const std::string theID)
101 void ModelAPI_Attribute::reinit() {}
103 void ModelAPI_Attribute::reset()
105 myIsInitialized = false;