0027961: Visualization - remove unused and no more working OpenGl_AVIWriter
[occt.git] / src / XCAFDoc / XCAFDoc_DimTol.cxx
1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
2 //
3 // This file is part of Open CASCADE Technology software library.
4 //
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
10 //
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
13
14
15 #include <Standard_GUID.hxx>
16 #include <Standard_Type.hxx>
17 #include <TCollection_HAsciiString.hxx>
18 #include <TDF_Attribute.hxx>
19 #include <TDF_Label.hxx>
20 #include <TDF_RelocationTable.hxx>
21 #include <XCAFDoc_DimTol.hxx>
22
23 IMPLEMENT_STANDARD_RTTIEXT(XCAFDoc_DimTol,TDF_Attribute)
24
25 //=======================================================================
26 //function : XCAFDoc_DimTol
27 //purpose  : 
28 //=======================================================================
29 XCAFDoc_DimTol::XCAFDoc_DimTol()
30 {
31 }
32
33
34 //=======================================================================
35 //function : GetID
36 //purpose  : 
37 //=======================================================================
38
39 const Standard_GUID& XCAFDoc_DimTol::GetID() 
40 {
41   static Standard_GUID DGTID ("58ed092d-44de-11d8-8776-001083004c77");
42   //static Standard_GUID ID("efd212e9-6dfd-11d4-b9c8-0060b0ee281b");
43   return DGTID; 
44   //return ID;
45 }
46
47
48 //=======================================================================
49 //function : Set
50 //purpose  : 
51 //=======================================================================
52
53 Handle(XCAFDoc_DimTol) XCAFDoc_DimTol::Set(const TDF_Label& label,
54                                            const Standard_Integer kind,
55                                            const Handle(TColStd_HArray1OfReal)& aVal,
56                                            const Handle(TCollection_HAsciiString)& aName,
57                                            const Handle(TCollection_HAsciiString)& aDescription) 
58 {
59   Handle(XCAFDoc_DimTol) A;
60   if (!label.FindAttribute(XCAFDoc_DimTol::GetID(), A)) {
61     A = new XCAFDoc_DimTol();
62     label.AddAttribute(A);
63   }
64   A->Set(kind,aVal,aName,aDescription); 
65   return A;
66 }
67
68
69 //=======================================================================
70 //function : Set
71 //purpose  : 
72 //=======================================================================
73
74 void XCAFDoc_DimTol::Set(const Standard_Integer kind,
75                          const Handle(TColStd_HArray1OfReal)& aVal,
76                          const Handle(TCollection_HAsciiString)& aName,
77                          const Handle(TCollection_HAsciiString)& aDescription) 
78 {
79   Backup();
80   myKind = kind;
81   myVal = aVal;
82   myName = aName;
83   myDescription = aDescription;
84 }
85
86
87 //=======================================================================
88 //function : GetKind
89 //purpose  : 
90 //=======================================================================
91
92 Standard_Integer XCAFDoc_DimTol::GetKind() const
93 {
94   return myKind;
95 }
96
97
98 //=======================================================================
99 //function : GetVal
100 //purpose  : 
101 //=======================================================================
102
103 Handle(TColStd_HArray1OfReal) XCAFDoc_DimTol::GetVal() const
104 {
105   return myVal;
106 }
107
108
109 //=======================================================================
110 //function : GetName
111 //purpose  : 
112 //=======================================================================
113
114 Handle(TCollection_HAsciiString) XCAFDoc_DimTol::GetName() const
115 {
116   return myName;
117 }
118
119
120 //=======================================================================
121 //function : GetDescription
122 //purpose  : 
123 //=======================================================================
124
125 Handle(TCollection_HAsciiString) XCAFDoc_DimTol::GetDescription() const
126 {
127   return myDescription;
128 }
129
130
131 //=======================================================================
132 //function : ID
133 //purpose  : 
134 //=======================================================================
135
136 const Standard_GUID& XCAFDoc_DimTol::ID() const
137 {
138   return GetID();
139 }
140
141
142 //=======================================================================
143 //function : Restore
144 //purpose  : 
145 //=======================================================================
146
147 void XCAFDoc_DimTol::Restore(const Handle(TDF_Attribute)& With) 
148 {
149   myKind = Handle(XCAFDoc_DimTol)::DownCast(With)->GetKind();
150   myVal = Handle(XCAFDoc_DimTol)::DownCast(With)->GetVal();
151   myName = Handle(XCAFDoc_DimTol)::DownCast(With)->GetName();
152   myDescription = Handle(XCAFDoc_DimTol)::DownCast(With)->GetDescription();
153 }
154
155
156 //=======================================================================
157 //function : NewEmpty
158 //purpose  : 
159 //=======================================================================
160
161 Handle(TDF_Attribute) XCAFDoc_DimTol::NewEmpty() const
162 {
163   return new XCAFDoc_DimTol();
164 }
165
166
167 //=======================================================================
168 //function : Paste
169 //purpose  : 
170 //=======================================================================
171
172 void XCAFDoc_DimTol::Paste(const Handle(TDF_Attribute)& Into,
173                            const Handle(TDF_RelocationTable)& /*RT*/) const
174 {
175   Handle(XCAFDoc_DimTol)::DownCast(Into)->Set(myKind,myVal,myName,myDescription);
176 }
177