1 // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // File : SALOMEDSImpl_AttributeFlags.cxx
21 // Author : Sergey LITONIN
24 #include "SALOMEDSImpl_AttributeFlags.hxx"
25 #include <Standard_GUID.hxx>
31 Class : SALOMEDSImpl_AttributeFlags
32 Description : This class is intended for storing different object attributes that
33 have only two states (0 and 1).
36 IMPLEMENT_STANDARD_HANDLE( SALOMEDSImpl_AttributeFlags, SALOMEDSImpl_GenericAttribute )
37 IMPLEMENT_STANDARD_RTTIEXT( SALOMEDSImpl_AttributeFlags, SALOMEDSImpl_GenericAttribute )
39 //=======================================================================
40 //function : SALOMEDSImpl_AttributeFlags::GetID
41 //purpose : Get GUID of this attribute
42 //=======================================================================
43 const Standard_GUID& SALOMEDSImpl_AttributeFlags::GetID ()
45 static Standard_GUID SALOMEDSImpl_AttributeFlagsID( "866EEC9F-A517-4cb4-88E6-E208DB8FC96F" );
46 return SALOMEDSImpl_AttributeFlagsID;
49 //=======================================================================
50 //function : SALOMEDSImpl_AttributeFlags::Set
51 //purpose : Set value of the attribute
52 //=======================================================================
53 Handle(SALOMEDSImpl_AttributeFlags) SALOMEDSImpl_AttributeFlags::Set(const TDF_Label& L,
54 const Standard_Integer value )
56 Handle(SALOMEDSImpl_AttributeFlags) A;
57 if ( !L.FindAttribute(SALOMEDSImpl_AttributeFlags::GetID(),A ) )
59 A = new SALOMEDSImpl_AttributeFlags();
67 //=======================================================================
68 //function : SALOMEDSImpl_AttributeFlags::SALOMEDSImpl_AttributeFlags
69 //purpose : Constructor
70 //=======================================================================
71 SALOMEDSImpl_AttributeFlags::SALOMEDSImpl_AttributeFlags()
72 :SALOMEDSImpl_GenericAttribute("AttributeFlags")
77 SALOMEDSImpl_AttributeFlags::~SALOMEDSImpl_AttributeFlags()
81 //=======================================================================
82 //function : SALOMEDSImpl_AttributeFlags::ID
83 //purpose : Get GUID of this attribute
84 //=======================================================================
85 const Standard_GUID& SALOMEDSImpl_AttributeFlags::ID () const
90 //=======================================================================
91 //function : SALOMEDSImpl_AttributeFlags::NewEmpty
92 //purpose : Create new empty attribute
93 //=======================================================================
95 Handle(TDF_Attribute) SALOMEDSImpl_AttributeFlags::NewEmpty () const
97 return new SALOMEDSImpl_AttributeFlags();
100 //=======================================================================
101 //function : SALOMEDSImpl_AttributeFlags::Restore
102 //purpose : Assign given value to the attribute
103 //=======================================================================
104 void SALOMEDSImpl_AttributeFlags::Restore( const Handle(TDF_Attribute)& with )
106 myValue = Handle(SALOMEDSImpl_AttributeFlags)::DownCast( with )->Get();
110 //=======================================================================
111 //function : SALOMEDSImpl_AttributeFlags::Paste
112 //purpose : Assign internal value to the given attribute
113 //=======================================================================
114 void SALOMEDSImpl_AttributeFlags::Paste(const Handle(TDF_Attribute)& into,
115 const Handle(TDF_RelocationTable)& RT ) const
117 Handle(SALOMEDSImpl_AttributeFlags)::DownCast( into )->Set( myValue );
120 //=======================================================================
121 //function : SALOMEDSImpl_AttributeFlags::Set
122 //purpose : Set value
123 //=======================================================================
124 void SALOMEDSImpl_AttributeFlags::Set( const Standard_Integer v )
130 //=======================================================================
131 //function : SALOMEDSImpl_AttributeFlags::Get
133 //=======================================================================
134 Standard_Integer SALOMEDSImpl_AttributeFlags::Get() const