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
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
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>
24 IMPLEMENT_STANDARD_RTTIEXT(StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx,
25 StepRepr_RepresentationContext)
27 // --------------------------------------------------------------------------------------------------
30 // --------------------------------------------------------------------------------------------------
31 StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::
32 StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx()
36 // --------------------------------------------------------------------------------------------------
39 // --------------------------------------------------------------------------------------------------
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)
48 // --- classe own fields ---
49 geometricRepresentationContext = aGeometricRepresentationContext;
50 globalUnitAssignedContext = aGlobalUnitAssignedContext;
51 globalUncertaintyAssignedContext = aGlobalUncertaintyAssignedCtx;
52 // --- classe inherited fields ---
53 StepRepr_RepresentationContext::Init(aContextIdentifier, aContextType);
56 // --------------------------------------------------------------------------------------------------
59 // --------------------------------------------------------------------------------------------------
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)
68 // --- classe inherited fields ---
70 StepRepr_RepresentationContext::Init(aContextIdentifier, aContextType);
72 // --- ANDOR component fields : GeometricRepresentationContext ---
74 geometricRepresentationContext = new StepGeom_GeometricRepresentationContext();
75 geometricRepresentationContext->Init(aContextIdentifier, aContextType, aCoordinateSpaceDimension);
77 // --- ANDOR component fields : GlobalUnitAssignedContext ---
79 globalUnitAssignedContext = new StepRepr_GlobalUnitAssignedContext();
80 globalUnitAssignedContext->Init(aContextIdentifier, aContextType, aUnits);
82 // --- ANDOR component fields : GlobalUncertaintyAssignedContext ---
84 globalUncertaintyAssignedContext = new StepRepr_GlobalUncertaintyAssignedContext();
85 globalUncertaintyAssignedContext->Init(aContextIdentifier, aContextType, anUncertainty);
88 // --------------------------------------------------------------------------------------------------
91 // --------------------------------------------------------------------------------------------------
93 void StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::
94 SetGeometricRepresentationContext(
95 const Handle(StepGeom_GeometricRepresentationContext)& aGeometricRepresentationContext)
97 geometricRepresentationContext = aGeometricRepresentationContext;
100 // --------------------------------------------------------------------------------------------------
103 // --------------------------------------------------------------------------------------------------
105 Handle(StepGeom_GeometricRepresentationContext)
106 StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::GeometricRepresentationContext()
109 return geometricRepresentationContext;
112 // --------------------------------------------------------------------------------------------------
115 // --------------------------------------------------------------------------------------------------
117 void StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::SetGlobalUnitAssignedContext(
118 const Handle(StepRepr_GlobalUnitAssignedContext)& aGlobalUnitAssignedContext)
120 globalUnitAssignedContext = aGlobalUnitAssignedContext;
123 // --------------------------------------------------------------------------------------------------
126 // --------------------------------------------------------------------------------------------------
128 Handle(StepRepr_GlobalUnitAssignedContext)
129 StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::GlobalUnitAssignedContext()
132 return globalUnitAssignedContext;
135 // --------------------------------------------------------------------------------------------------
138 // --------------------------------------------------------------------------------------------------
140 void StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::
141 SetGlobalUncertaintyAssignedContext(
142 const Handle(StepRepr_GlobalUncertaintyAssignedContext)& aGlobalUncertaintyAssignedCtx)
144 globalUncertaintyAssignedContext = aGlobalUncertaintyAssignedCtx;
147 // --------------------------------------------------------------------------------------------------
150 // --------------------------------------------------------------------------------------------------
152 Handle(StepRepr_GlobalUncertaintyAssignedContext)
153 StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::
154 GlobalUncertaintyAssignedContext() const
156 return globalUncertaintyAssignedContext;
159 //-------------------------------------------------------------------------------------
160 //--- Specific Methods for AND classe field access : GeometricRepresentationContext ---
161 //-------------------------------------------------------------------------------------
163 // --------------------------------------------------------------------------------------------------
166 // --------------------------------------------------------------------------------------------------
168 void StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::SetCoordinateSpaceDimension(
169 const Standard_Integer aCoordinateSpaceDimension)
171 geometricRepresentationContext->SetCoordinateSpaceDimension(aCoordinateSpaceDimension);
174 // --------------------------------------------------------------------------------------------------
177 // --------------------------------------------------------------------------------------------------
179 Standard_Integer StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::
180 CoordinateSpaceDimension() const
182 return geometricRepresentationContext->CoordinateSpaceDimension();
185 //---------------------------------------------------------------------------------
186 //--- Specific Methods for AND classe field access : GlobalUnitAssignedContext ---
187 //---------------------------------------------------------------------------------
189 // --------------------------------------------------------------------------------------------------
192 // --------------------------------------------------------------------------------------------------
194 void StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::SetUnits(
195 const Handle(StepBasic_HArray1OfNamedUnit)& aUnits)
197 globalUnitAssignedContext->SetUnits(aUnits);
200 // --------------------------------------------------------------------------------------------------
203 // --------------------------------------------------------------------------------------------------
205 Handle(StepBasic_HArray1OfNamedUnit)
206 StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::Units() const
208 return globalUnitAssignedContext->Units();
211 // --------------------------------------------------------------------------------------------------
214 // --------------------------------------------------------------------------------------------------
216 Handle(StepBasic_NamedUnit) StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::
217 UnitsValue(const Standard_Integer num) const
219 return globalUnitAssignedContext->UnitsValue(num);
222 // --------------------------------------------------------------------------------------------------
225 // --------------------------------------------------------------------------------------------------
227 Standard_Integer StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::NbUnits() const
229 return globalUnitAssignedContext->NbUnits();
232 //----------------------------------------------------------------------------------------
233 //--- Specific Methods for AND classe field access : GlobalUncertaintyAssignedContext ---
234 //----------------------------------------------------------------------------------------
236 // --------------------------------------------------------------------------------------------------
239 // --------------------------------------------------------------------------------------------------
241 void StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::SetUncertainty(
242 const Handle(StepBasic_HArray1OfUncertaintyMeasureWithUnit)& aUncertainty)
244 globalUncertaintyAssignedContext->SetUncertainty(aUncertainty);
247 // --------------------------------------------------------------------------------------------------
250 // --------------------------------------------------------------------------------------------------
252 Handle(StepBasic_HArray1OfUncertaintyMeasureWithUnit)
253 StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::Uncertainty() const
255 return globalUncertaintyAssignedContext->Uncertainty();
258 // --------------------------------------------------------------------------------------------------
261 // --------------------------------------------------------------------------------------------------
263 Handle(StepBasic_UncertaintyMeasureWithUnit)
264 StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::UncertaintyValue(
265 const Standard_Integer num) const
267 return globalUncertaintyAssignedContext->UncertaintyValue(num);
270 // --------------------------------------------------------------------------------------------------
273 // --------------------------------------------------------------------------------------------------
275 Standard_Integer StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::NbUncertainty()
278 return globalUncertaintyAssignedContext->NbUncertainty();