1 // Created on: 1999-06-11
2 // Created by: Sergey RUIN
3 // Copyright (c) 1999-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #include <TDataStd_UAttribute.ixx>
18 #include <TDataStd.hxx>
19 #include <TDF_Label.hxx>
21 //=======================================================================
24 //=======================================================================
26 Handle(TDataStd_UAttribute) TDataStd_UAttribute::Set (const TDF_Label& label, const Standard_GUID& guid )
28 Handle(TDataStd_UAttribute) A;
29 if (!label.FindAttribute(guid, A)) {
30 A = new TDataStd_UAttribute ();
32 label.AddAttribute(A);
38 //=======================================================================
39 //function : TDataStd_UAttribute
41 //=======================================================================
43 TDataStd_UAttribute::TDataStd_UAttribute()
47 //=======================================================================
50 //=======================================================================
52 const Standard_GUID& TDataStd_UAttribute::ID() const
56 //=======================================================================
59 //=======================================================================
61 void TDataStd_UAttribute::SetID( const Standard_GUID& guid)
64 if(myID == guid) return;
71 //=======================================================================
74 //=======================================================================
76 Handle(TDF_Attribute) TDataStd_UAttribute::NewEmpty () const
78 Handle(TDataStd_UAttribute) A = new TDataStd_UAttribute();
83 //=======================================================================
86 //=======================================================================
88 void TDataStd_UAttribute::Restore(const Handle(TDF_Attribute)& with)
90 Handle(TDataStd_UAttribute) A = Handle(TDataStd_UAttribute)::DownCast(with);
94 //=======================================================================
97 //=======================================================================
99 void TDataStd_UAttribute::Paste (const Handle(TDF_Attribute)& into,
100 const Handle(TDF_RelocationTable)& /*RT*/) const
102 Handle(TDataStd_UAttribute) A = Handle(TDataStd_UAttribute)::DownCast(into);
106 //=======================================================================
107 //function : References
109 //=======================================================================
111 void TDataStd_UAttribute::References (const Handle(TDF_DataSet)& /*DS*/) const
115 //=======================================================================
118 //=======================================================================
120 Standard_OStream& TDataStd_UAttribute::Dump (Standard_OStream& anOS) const
122 anOS << "UAttribute";
123 TDF_Attribute::Dump(anOS);