1 // Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // File : SALOMEDSImpl_AttributeFlags.cxx
24 // Author : Sergey LITONIN
27 #include "SALOMEDSImpl_AttributeFlags.hxx"
30 Class : SALOMEDSImpl_AttributeFlags
31 Description : This class is intended for storing different object attributes that
32 have only two states (0 and 1).
35 //=======================================================================
36 //function : SALOMEDSImpl_AttributeFlags::GetID
37 //purpose : Get GUID of this attribute
38 //=======================================================================
39 const std::string& SALOMEDSImpl_AttributeFlags::GetID ()
41 static std::string SALOMEDSImpl_AttributeFlagsID( "866EEC9F-A517-4cb4-88E6-E208DB8FC96F" );
42 return SALOMEDSImpl_AttributeFlagsID;
45 //=======================================================================
46 //function : SALOMEDSImpl_AttributeFlags::Set
47 //purpose : Set value of the attribute
48 //=======================================================================
49 SALOMEDSImpl_AttributeFlags* SALOMEDSImpl_AttributeFlags::Set(const DF_Label& L,
52 SALOMEDSImpl_AttributeFlags* A = NULL;
53 if ( !(A=(SALOMEDSImpl_AttributeFlags*)L.FindAttribute(SALOMEDSImpl_AttributeFlags::GetID())) )
55 A = new SALOMEDSImpl_AttributeFlags();
63 //=======================================================================
64 //function : SALOMEDSImpl_AttributeFlags::SALOMEDSImpl_AttributeFlags
65 //purpose : Constructor
66 //=======================================================================
67 SALOMEDSImpl_AttributeFlags::SALOMEDSImpl_AttributeFlags()
68 :SALOMEDSImpl_GenericAttribute("AttributeFlags")
73 SALOMEDSImpl_AttributeFlags::~SALOMEDSImpl_AttributeFlags()
77 //=======================================================================
78 //function : SALOMEDSImpl_AttributeFlags::ID
79 //purpose : Get GUID of this attribute
80 //=======================================================================
81 const std::string& SALOMEDSImpl_AttributeFlags::ID () const
86 //=======================================================================
87 //function : SALOMEDSImpl_AttributeFlags::NewEmpty
88 //purpose : Create new empty attribute
89 //=======================================================================
91 DF_Attribute* SALOMEDSImpl_AttributeFlags::NewEmpty () const
93 return new SALOMEDSImpl_AttributeFlags();
96 //=======================================================================
97 //function : SALOMEDSImpl_AttributeFlags::Restore
98 //purpose : Assign given value to the attribute
99 //=======================================================================
100 void SALOMEDSImpl_AttributeFlags::Restore( DF_Attribute* with )
102 myValue = dynamic_cast<SALOMEDSImpl_AttributeFlags*>( with )->Get();
106 //=======================================================================
107 //function : SALOMEDSImpl_AttributeFlags::Paste
108 //purpose : Assign internal value to the given attribute
109 //=======================================================================
110 void SALOMEDSImpl_AttributeFlags::Paste( DF_Attribute* into)
112 dynamic_cast<SALOMEDSImpl_AttributeFlags*>( into )->Set( myValue );
115 //=======================================================================
116 //function : SALOMEDSImpl_AttributeFlags::Set
117 //purpose : Set value
118 //=======================================================================
119 void SALOMEDSImpl_AttributeFlags::Set( const int v )
125 //=======================================================================
126 //function : SALOMEDSImpl_AttributeFlags::Get
128 //=======================================================================
129 int SALOMEDSImpl_AttributeFlags::Get() const