1 // File : SALOMEDSImpl_AttributeSelectable.cxx
2 // Author : Sergey RUIN
5 #include "SALOMEDSImpl_AttributeSelectable.hxx"
6 #include <Standard_GUID.hxx>
10 IMPLEMENT_STANDARD_HANDLE( SALOMEDSImpl_AttributeSelectable, SALOMEDSImpl_GenericAttribute )
11 IMPLEMENT_STANDARD_RTTIEXT( SALOMEDSImpl_AttributeSelectable, SALOMEDSImpl_GenericAttribute )
13 //=======================================================================
16 //=======================================================================
18 const Standard_GUID& SALOMEDSImpl_AttributeSelectable::GetID ()
20 static Standard_GUID SALOMEDSImpl_AttributeSelectableID ("12837188-8F52-11d6-A8A3-0001021E8C7F");
21 return SALOMEDSImpl_AttributeSelectableID;
26 //=======================================================================
29 //=======================================================================
31 Handle(SALOMEDSImpl_AttributeSelectable) SALOMEDSImpl_AttributeSelectable::Set (const TDF_Label& L,
32 const Standard_Integer value)
34 Handle(SALOMEDSImpl_AttributeSelectable) A;
35 if (!L.FindAttribute(SALOMEDSImpl_AttributeSelectable::GetID(),A)) {
36 A = new SALOMEDSImpl_AttributeSelectable();
40 A->SetSelectable (value);
45 //=======================================================================
46 //function : constructor
48 //=======================================================================
49 SALOMEDSImpl_AttributeSelectable::SALOMEDSImpl_AttributeSelectable()
50 :SALOMEDSImpl_GenericAttribute("AttributeSelectable")
55 //=======================================================================
56 //function : SetSelectable
58 //=======================================================================
59 void SALOMEDSImpl_AttributeSelectable::SetSelectable(const Standard_Integer theValue)
63 (theValue!=0)?myValue=1:myValue=0;
66 //=======================================================================
69 //=======================================================================
71 const Standard_GUID& SALOMEDSImpl_AttributeSelectable::ID () const { return GetID(); }
74 //=======================================================================
77 //=======================================================================
79 Handle(TDF_Attribute) SALOMEDSImpl_AttributeSelectable::NewEmpty () const
81 return new SALOMEDSImpl_AttributeSelectable();
84 //=======================================================================
87 //=======================================================================
89 void SALOMEDSImpl_AttributeSelectable::Restore(const Handle(TDF_Attribute)& with)
91 myValue = Handle(SALOMEDSImpl_AttributeSelectable)::DownCast (with)->IsSelectable ();
94 //=======================================================================
97 //=======================================================================
99 void SALOMEDSImpl_AttributeSelectable::Paste (const Handle(TDF_Attribute)& into,
100 const Handle(TDF_RelocationTable)& RT) const
102 Handle(SALOMEDSImpl_AttributeSelectable)::DownCast (into)->SetSelectable (myValue);