0024057: Eliminate compiler warning C4100 in MSVC++ with warning level 4
[occt.git] / src / TDataStd / TDataStd_UAttribute.cxx
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
5 //
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.
10 //
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.
13 //
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.
20
21
22
23 #include <TDataStd_UAttribute.ixx>
24 #include <TDataStd.hxx>
25 #include <TDF_Label.hxx>
26
27 //=======================================================================
28 //function : Set
29 //purpose  : 
30 //=======================================================================
31
32 Handle(TDataStd_UAttribute) TDataStd_UAttribute::Set (const TDF_Label& label, const Standard_GUID& guid )
33 {
34   Handle(TDataStd_UAttribute) A;  
35   if (!label.FindAttribute(guid, A)) {
36     A = new TDataStd_UAttribute ();
37     A->SetID(guid);
38     label.AddAttribute(A);                      
39   }
40   return A;
41 }
42
43
44 //=======================================================================
45 //function : TDataStd_UAttribute
46 //purpose  : 
47 //=======================================================================
48
49 TDataStd_UAttribute::TDataStd_UAttribute()
50 {
51 }
52
53 //=======================================================================
54 //function : ID
55 //purpose  : 
56 //=======================================================================
57
58 const Standard_GUID& TDataStd_UAttribute::ID() const
59 { return myID; }
60
61
62 //=======================================================================
63 //function : SetID
64 //purpose  : 
65 //=======================================================================
66
67 void TDataStd_UAttribute::SetID( const Standard_GUID&  guid)
68 {
69   // OCC2932 correction
70   if(myID == guid) return;
71
72   Backup();
73   myID = guid;
74 }
75
76
77 //=======================================================================
78 //function : NewEmpty
79 //purpose  : 
80 //=======================================================================
81
82 Handle(TDF_Attribute) TDataStd_UAttribute::NewEmpty () const
83
84   Handle(TDataStd_UAttribute) A = new TDataStd_UAttribute();
85   A->SetID(myID);
86   return A; 
87 }
88
89 //=======================================================================
90 //function : Restore
91 //purpose  : 
92 //=======================================================================
93
94 void TDataStd_UAttribute::Restore(const Handle(TDF_Attribute)& with) 
95 {  
96   Handle(TDataStd_UAttribute) A = Handle(TDataStd_UAttribute)::DownCast(with);
97   SetID( A->ID() );
98 }
99
100 //=======================================================================
101 //function : Paste
102 //purpose  : 
103 //=======================================================================
104
105 void TDataStd_UAttribute::Paste (const Handle(TDF_Attribute)& into,
106                            const Handle(TDF_RelocationTable)& /*RT*/) const
107 {
108   Handle(TDataStd_UAttribute) A = Handle(TDataStd_UAttribute)::DownCast(into);
109   A->SetID( myID );
110 }
111
112 //=======================================================================
113 //function : References
114 //purpose  : 
115 //=======================================================================
116
117 void TDataStd_UAttribute::References (const Handle(TDF_DataSet)& /*DS*/) const
118 {  
119 }
120  
121 //=======================================================================
122 //function : Dump
123 //purpose  : 
124 //=======================================================================
125
126 Standard_OStream& TDataStd_UAttribute::Dump (Standard_OStream& anOS) const
127 {  
128   anOS << "UAttribute";
129   TDF_Attribute::Dump(anOS);
130   return anOS;
131 }
132
133