1 // Created on: 1999-06-11
2 // Created by: Sergey RUIN
3 // Copyright (c) 1999-1999 Matra Datavision
4 // Copyright (c) 1999-2012 OPEN CASCADE SAS
6 // The content of this file is subject to the Open CASCADE Technology Public
7 // License Version 6.5 (the "License"). You may not use the content of this file
8 // except in compliance with the License. Please obtain a copy of the License
9 // at http://www.opencascade.org and read it completely before using this file.
11 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 // The Original Code and all software distributed under the License is
15 // distributed on an "AS IS" basis, without warranty of any kind, and the
16 // Initial Developer hereby disclaims all such warranties, including without
17 // limitation, any warranties of merchantability, fitness for a particular
18 // purpose or non-infringement. Please see the License for the specific terms
19 // and conditions governing the rights and limitations under the License.
23 #include <TDataStd_UAttribute.ixx>
24 #include <TDataStd.hxx>
25 #include <TDF_Label.hxx>
27 //=======================================================================
30 //=======================================================================
32 Handle(TDataStd_UAttribute) TDataStd_UAttribute::Set (const TDF_Label& label, const Standard_GUID& guid )
34 Handle(TDataStd_UAttribute) A;
35 if (!label.FindAttribute(guid, A)) {
36 A = new TDataStd_UAttribute ();
38 label.AddAttribute(A);
44 //=======================================================================
45 //function : TDataStd_UAttribute
47 //=======================================================================
49 TDataStd_UAttribute::TDataStd_UAttribute()
53 //=======================================================================
56 //=======================================================================
58 const Standard_GUID& TDataStd_UAttribute::ID() const
62 //=======================================================================
65 //=======================================================================
67 void TDataStd_UAttribute::SetID( const Standard_GUID& guid)
70 if(myID == guid) return;
77 //=======================================================================
80 //=======================================================================
82 Handle(TDF_Attribute) TDataStd_UAttribute::NewEmpty () const
84 Handle(TDataStd_UAttribute) A = new TDataStd_UAttribute();
89 //=======================================================================
92 //=======================================================================
94 void TDataStd_UAttribute::Restore(const Handle(TDF_Attribute)& with)
96 Handle(TDataStd_UAttribute) A = Handle(TDataStd_UAttribute)::DownCast(with);
100 //=======================================================================
103 //=======================================================================
105 void TDataStd_UAttribute::Paste (const Handle(TDF_Attribute)& into,
106 const Handle(TDF_RelocationTable)& /*RT*/) const
108 Handle(TDataStd_UAttribute) A = Handle(TDataStd_UAttribute)::DownCast(into);
112 //=======================================================================
113 //function : References
115 //=======================================================================
117 void TDataStd_UAttribute::References (const Handle(TDF_DataSet)& /*DS*/) const
121 //=======================================================================
124 //=======================================================================
126 Standard_OStream& TDataStd_UAttribute::Dump (Standard_OStream& anOS) const
128 anOS << "UAttribute";
129 TDF_Attribute::Dump(anOS);