1 // Copyright (C) 2007-2008 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
22 // File : SALOMEDSImpl_AttributeFlags.cxx
23 // Author : Sergey LITONIN
26 #include "SALOMEDSImpl_AttributeFlags.hxx"
32 Class : SALOMEDSImpl_AttributeFlags
33 Description : This class is intended for storing different object attributes that
34 have only two states (0 and 1).
37 //=======================================================================
38 //function : SALOMEDSImpl_AttributeFlags::GetID
39 //purpose : Get GUID of this attribute
40 //=======================================================================
41 const std::string& SALOMEDSImpl_AttributeFlags::GetID ()
43 static std::string SALOMEDSImpl_AttributeFlagsID( "866EEC9F-A517-4cb4-88E6-E208DB8FC96F" );
44 return SALOMEDSImpl_AttributeFlagsID;
47 //=======================================================================
48 //function : SALOMEDSImpl_AttributeFlags::Set
49 //purpose : Set value of the attribute
50 //=======================================================================
51 SALOMEDSImpl_AttributeFlags* SALOMEDSImpl_AttributeFlags::Set(const DF_Label& L,
54 SALOMEDSImpl_AttributeFlags* A = NULL;
55 if ( !(A=(SALOMEDSImpl_AttributeFlags*)L.FindAttribute(SALOMEDSImpl_AttributeFlags::GetID())) )
57 A = new SALOMEDSImpl_AttributeFlags();
65 //=======================================================================
66 //function : SALOMEDSImpl_AttributeFlags::SALOMEDSImpl_AttributeFlags
67 //purpose : Constructor
68 //=======================================================================
69 SALOMEDSImpl_AttributeFlags::SALOMEDSImpl_AttributeFlags()
70 :SALOMEDSImpl_GenericAttribute("AttributeFlags")
75 SALOMEDSImpl_AttributeFlags::~SALOMEDSImpl_AttributeFlags()
79 //=======================================================================
80 //function : SALOMEDSImpl_AttributeFlags::ID
81 //purpose : Get GUID of this attribute
82 //=======================================================================
83 const std::string& SALOMEDSImpl_AttributeFlags::ID () const
88 //=======================================================================
89 //function : SALOMEDSImpl_AttributeFlags::NewEmpty
90 //purpose : Create new empty attribute
91 //=======================================================================
93 DF_Attribute* SALOMEDSImpl_AttributeFlags::NewEmpty () const
95 return new SALOMEDSImpl_AttributeFlags();
98 //=======================================================================
99 //function : SALOMEDSImpl_AttributeFlags::Restore
100 //purpose : Assign given value to the attribute
101 //=======================================================================
102 void SALOMEDSImpl_AttributeFlags::Restore( DF_Attribute* with )
104 myValue = dynamic_cast<SALOMEDSImpl_AttributeFlags*>( with )->Get();
108 //=======================================================================
109 //function : SALOMEDSImpl_AttributeFlags::Paste
110 //purpose : Assign internal value to the given attribute
111 //=======================================================================
112 void SALOMEDSImpl_AttributeFlags::Paste( DF_Attribute* into)
114 dynamic_cast<SALOMEDSImpl_AttributeFlags*>( into )->Set( myValue );
117 //=======================================================================
118 //function : SALOMEDSImpl_AttributeFlags::Set
119 //purpose : Set value
120 //=======================================================================
121 void SALOMEDSImpl_AttributeFlags::Set( const int v )
127 //=======================================================================
128 //function : SALOMEDSImpl_AttributeFlags::Get
130 //=======================================================================
131 int SALOMEDSImpl_AttributeFlags::Get() const