]> OCCT Git - occt.git/blob
f93cf3a9246af7e6227bce78d9642007e6cc9f96
[occt.git] /
1 // Created on: 1995-12-07
2 // Created by: Frederic MAUPAS
3 // Copyright (c) 1995-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #include <Standard_Type.hxx>
18 #include <StepGeom_GeometricRepresentationContext.hxx>
19 #include <StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx.hxx>
20 #include <StepRepr_GlobalUncertaintyAssignedContext.hxx>
21 #include <StepRepr_GlobalUnitAssignedContext.hxx>
22 #include <TCollection_HAsciiString.hxx>
23
24 IMPLEMENT_STANDARD_RTTIEXT(StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx,
25                            StepRepr_RepresentationContext)
26
27 // --------------------------------------------------------------------------------------------------
28 // Method  :
29 // Purpose :
30 // --------------------------------------------------------------------------------------------------
31 StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::
32   StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx()
33 {
34 }
35
36 // --------------------------------------------------------------------------------------------------
37 // Method  :
38 // Purpose :
39 // --------------------------------------------------------------------------------------------------
40
41 void StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::Init(
42   const Handle(TCollection_HAsciiString)&                  aContextIdentifier,
43   const Handle(TCollection_HAsciiString)&                  aContextType,
44   const Handle(StepGeom_GeometricRepresentationContext)&   aGeometricRepresentationContext,
45   const Handle(StepRepr_GlobalUnitAssignedContext)&        aGlobalUnitAssignedContext,
46   const Handle(StepRepr_GlobalUncertaintyAssignedContext)& aGlobalUncertaintyAssignedCtx)
47 {
48   // --- classe own fields ---
49   geometricRepresentationContext   = aGeometricRepresentationContext;
50   globalUnitAssignedContext        = aGlobalUnitAssignedContext;
51   globalUncertaintyAssignedContext = aGlobalUncertaintyAssignedCtx;
52   // --- classe inherited fields ---
53   StepRepr_RepresentationContext::Init(aContextIdentifier, aContextType);
54 }
55
56 // --------------------------------------------------------------------------------------------------
57 // Method  :
58 // Purpose :
59 // --------------------------------------------------------------------------------------------------
60
61 void StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::Init(
62   const Handle(TCollection_HAsciiString)&                      aContextIdentifier,
63   const Handle(TCollection_HAsciiString)&                      aContextType,
64   const Standard_Integer                                       aCoordinateSpaceDimension,
65   const Handle(StepBasic_HArray1OfNamedUnit)&                  aUnits,
66   const Handle(StepBasic_HArray1OfUncertaintyMeasureWithUnit)& anUncertainty)
67 {
68   // --- classe inherited fields ---
69
70   StepRepr_RepresentationContext::Init(aContextIdentifier, aContextType);
71
72   // --- ANDOR component fields : GeometricRepresentationContext ---
73
74   geometricRepresentationContext = new StepGeom_GeometricRepresentationContext();
75   geometricRepresentationContext->Init(aContextIdentifier, aContextType, aCoordinateSpaceDimension);
76
77   // --- ANDOR component fields : GlobalUnitAssignedContext ---
78
79   globalUnitAssignedContext = new StepRepr_GlobalUnitAssignedContext();
80   globalUnitAssignedContext->Init(aContextIdentifier, aContextType, aUnits);
81
82   // --- ANDOR component fields : GlobalUncertaintyAssignedContext ---
83
84   globalUncertaintyAssignedContext = new StepRepr_GlobalUncertaintyAssignedContext();
85   globalUncertaintyAssignedContext->Init(aContextIdentifier, aContextType, anUncertainty);
86 }
87
88 // --------------------------------------------------------------------------------------------------
89 // Method  :
90 // Purpose :
91 // --------------------------------------------------------------------------------------------------
92
93 void StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::
94   SetGeometricRepresentationContext(
95     const Handle(StepGeom_GeometricRepresentationContext)& aGeometricRepresentationContext)
96 {
97   geometricRepresentationContext = aGeometricRepresentationContext;
98 }
99
100 // --------------------------------------------------------------------------------------------------
101 // Method  :
102 // Purpose :
103 // --------------------------------------------------------------------------------------------------
104
105 Handle(StepGeom_GeometricRepresentationContext)
106   StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::GeometricRepresentationContext()
107     const
108 {
109   return geometricRepresentationContext;
110 }
111
112 // --------------------------------------------------------------------------------------------------
113 // Method  :
114 // Purpose :
115 // --------------------------------------------------------------------------------------------------
116
117 void StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::SetGlobalUnitAssignedContext(
118   const Handle(StepRepr_GlobalUnitAssignedContext)& aGlobalUnitAssignedContext)
119 {
120   globalUnitAssignedContext = aGlobalUnitAssignedContext;
121 }
122
123 // --------------------------------------------------------------------------------------------------
124 // Method  :
125 // Purpose :
126 // --------------------------------------------------------------------------------------------------
127
128 Handle(StepRepr_GlobalUnitAssignedContext)
129   StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::GlobalUnitAssignedContext()
130     const
131 {
132   return globalUnitAssignedContext;
133 }
134
135 // --------------------------------------------------------------------------------------------------
136 // Method  :
137 // Purpose :
138 // --------------------------------------------------------------------------------------------------
139
140 void StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::
141   SetGlobalUncertaintyAssignedContext(
142     const Handle(StepRepr_GlobalUncertaintyAssignedContext)& aGlobalUncertaintyAssignedCtx)
143 {
144   globalUncertaintyAssignedContext = aGlobalUncertaintyAssignedCtx;
145 }
146
147 // --------------------------------------------------------------------------------------------------
148 // Method  :
149 // Purpose :
150 // --------------------------------------------------------------------------------------------------
151
152 Handle(StepRepr_GlobalUncertaintyAssignedContext)
153   StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::
154     GlobalUncertaintyAssignedContext() const
155 {
156   return globalUncertaintyAssignedContext;
157 }
158
159 //-------------------------------------------------------------------------------------
160 //--- Specific Methods for AND classe field access : GeometricRepresentationContext ---
161 //-------------------------------------------------------------------------------------
162
163 // --------------------------------------------------------------------------------------------------
164 // Method  :
165 // Purpose :
166 // --------------------------------------------------------------------------------------------------
167
168 void StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::SetCoordinateSpaceDimension(
169   const Standard_Integer aCoordinateSpaceDimension)
170 {
171   geometricRepresentationContext->SetCoordinateSpaceDimension(aCoordinateSpaceDimension);
172 }
173
174 // --------------------------------------------------------------------------------------------------
175 // Method  :
176 // Purpose :
177 // --------------------------------------------------------------------------------------------------
178
179 Standard_Integer StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::
180   CoordinateSpaceDimension() const
181 {
182   return geometricRepresentationContext->CoordinateSpaceDimension();
183 }
184
185 //---------------------------------------------------------------------------------
186 //--- Specific Methods for AND classe field access : GlobalUnitAssignedContext  ---
187 //---------------------------------------------------------------------------------
188
189 // --------------------------------------------------------------------------------------------------
190 // Method  :
191 // Purpose :
192 // --------------------------------------------------------------------------------------------------
193
194 void StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::SetUnits(
195   const Handle(StepBasic_HArray1OfNamedUnit)& aUnits)
196 {
197   globalUnitAssignedContext->SetUnits(aUnits);
198 }
199
200 // --------------------------------------------------------------------------------------------------
201 // Method  :
202 // Purpose :
203 // --------------------------------------------------------------------------------------------------
204
205 Handle(StepBasic_HArray1OfNamedUnit)
206   StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::Units() const
207 {
208   return globalUnitAssignedContext->Units();
209 }
210
211 // --------------------------------------------------------------------------------------------------
212 // Method  :
213 // Purpose :
214 // --------------------------------------------------------------------------------------------------
215
216 Handle(StepBasic_NamedUnit) StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::
217   UnitsValue(const Standard_Integer num) const
218 {
219   return globalUnitAssignedContext->UnitsValue(num);
220 }
221
222 // --------------------------------------------------------------------------------------------------
223 // Method  :
224 // Purpose :
225 // --------------------------------------------------------------------------------------------------
226
227 Standard_Integer StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::NbUnits() const
228 {
229   return globalUnitAssignedContext->NbUnits();
230 }
231
232 //----------------------------------------------------------------------------------------
233 //--- Specific Methods for AND classe field access : GlobalUncertaintyAssignedContext  ---
234 //----------------------------------------------------------------------------------------
235
236 // --------------------------------------------------------------------------------------------------
237 // Method  :
238 // Purpose :
239 // --------------------------------------------------------------------------------------------------
240
241 void StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::SetUncertainty(
242   const Handle(StepBasic_HArray1OfUncertaintyMeasureWithUnit)& aUncertainty)
243 {
244   globalUncertaintyAssignedContext->SetUncertainty(aUncertainty);
245 }
246
247 // --------------------------------------------------------------------------------------------------
248 // Method  :
249 // Purpose :
250 // --------------------------------------------------------------------------------------------------
251
252 Handle(StepBasic_HArray1OfUncertaintyMeasureWithUnit)
253   StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::Uncertainty() const
254 {
255   return globalUncertaintyAssignedContext->Uncertainty();
256 }
257
258 // --------------------------------------------------------------------------------------------------
259 // Method  :
260 // Purpose :
261 // --------------------------------------------------------------------------------------------------
262
263 Handle(StepBasic_UncertaintyMeasureWithUnit)
264   StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::UncertaintyValue(
265     const Standard_Integer num) const
266 {
267   return globalUncertaintyAssignedContext->UncertaintyValue(num);
268 }
269
270 // --------------------------------------------------------------------------------------------------
271 // Method  :
272 // Purpose :
273 // --------------------------------------------------------------------------------------------------
274
275 Standard_Integer StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::NbUncertainty()
276   const
277 {
278   return globalUncertaintyAssignedContext->NbUncertainty();
279 }