0023947: Eliminate trivial compiler warnings in MSVC++ with warning level 4
[occt.git] / src / TDataStd / TDataStd_NoteBook.cxx
1 // Created on: 1997-07-29
2 // Created by: Denis PASCAL
3 // Copyright (c) 1997-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_NoteBook.ixx>
24 #include <TDF_TagSource.hxx>
25 #include <TDataStd_Real.hxx>
26 #include <TDataStd_Integer.hxx>
27 #include <TDF_Label.hxx> 
28 #include <Standard_DomainError.hxx>
29
30 //=======================================================================
31 //function : Find
32 //purpose  : 
33 //=======================================================================
34
35 Standard_Boolean TDataStd_NoteBook::Find (const TDF_Label& current,
36                                           Handle(TDataStd_NoteBook)& N) 
37 {  
38   TDF_Label L = current;
39   Handle(TDataStd_NoteBook) NB;
40   if (L.IsNull()) return Standard_False; 
41
42   for(;;) {
43     if(L.FindAttribute(TDataStd_NoteBook::GetID(), NB)) break; 
44     L = L.Father();
45     if (L.IsNull()) break; 
46   }
47
48   if (!NB.IsNull()) { 
49     N = NB;
50     return Standard_True; 
51   }
52   return Standard_False; 
53 }
54
55
56 //=======================================================================
57 //function : New
58 //purpose  : 
59 //=======================================================================
60
61 Handle(TDataStd_NoteBook) TDataStd_NoteBook::New (const TDF_Label& label)
62 {  
63   if (label.HasAttribute()) {
64     Standard_DomainError::Raise("TDataStd_NoteBook::New : not an empty label");
65   }
66   Handle(TDataStd_NoteBook) NB = new TDataStd_NoteBook ();  
67   label.AddAttribute(NB);
68   TDF_TagSource::Set(label);    // distributeur de sous label
69   return NB;
70 }
71
72 //=======================================================================
73 //function : GetID
74 //purpose  : 
75 //=======================================================================
76
77 const Standard_GUID& TDataStd_NoteBook::GetID() 
78 {
79   static Standard_GUID TDataStd_NoteBookID("2a96b609-ec8b-11d0-bee7-080009dc3333");
80   return TDataStd_NoteBookID;
81 }
82
83
84 //=======================================================================
85 //function : TDataStd_NoteBook
86 //purpose  : 
87 //=======================================================================
88
89 TDataStd_NoteBook::TDataStd_NoteBook()
90 {
91 }
92
93
94 //=======================================================================
95 //function : Append Real Variable
96 //purpose  : 
97 //=======================================================================
98
99 Handle(TDataStd_Real) TDataStd_NoteBook::Append(const Standard_Real value,
100                                                 const Standard_Boolean ) 
101 {
102   TDF_Label newlabel =  TDF_TagSource::NewChild (Label());
103   Handle(TDataStd_Real) variable = TDataStd_Real::Set ( newlabel, value); 
104   return variable;
105 }
106
107 //=======================================================================
108 //function : Append Integer Variable
109 //purpose  : 
110 //=======================================================================
111
112 Handle(TDataStd_Integer) TDataStd_NoteBook::Append(const Standard_Integer value,
113                                                    const Standard_Boolean ) 
114 {
115   TDF_Label newlabel =  TDF_TagSource::NewChild (Label());
116   Handle(TDataStd_Integer) variable = TDataStd_Integer::Set ( newlabel, value); 
117   return variable;
118 }
119
120 //=======================================================================
121 //function : ID
122 //purpose  : 
123 //=======================================================================
124
125 const Standard_GUID& TDataStd_NoteBook::ID() const
126 { return GetID(); }
127
128
129 //=======================================================================
130 //function : NewEmpty
131 //purpose  : 
132 //=======================================================================
133
134 Handle(TDF_Attribute) TDataStd_NoteBook::NewEmpty () const
135 {  
136   return new TDataStd_NoteBook(); 
137 }
138
139 //=======================================================================
140 //function : Restore
141 //purpose  : 
142 //=======================================================================
143
144 void TDataStd_NoteBook::Restore(const Handle(TDF_Attribute)& ) 
145 {
146 }
147
148 //=======================================================================
149 //function : Paste
150 //purpose  : 
151 //=======================================================================
152
153 void TDataStd_NoteBook::Paste (const Handle(TDF_Attribute)& ,
154                                const Handle(TDF_RelocationTable)& ) const
155 {
156 }
157
158 //=======================================================================
159 //function : Dump
160 //purpose  : 
161 //=======================================================================
162
163 Standard_OStream& TDataStd_NoteBook::Dump (Standard_OStream& anOS) const
164 {  
165   anOS << "NoteBook";
166   return anOS;
167 }
168
169