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.
18 #include <Standard_Type.hxx>
19 #include <StepBasic_NamedUnit.hxx>
20 #include <StepBasic_UncertaintyMeasureWithUnit.hxx>
21 #include <StepGeom_GeometricRepresentationContext.hxx>
22 #include <StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx.hxx>
23 #include <StepRepr_GlobalUncertaintyAssignedContext.hxx>
24 #include <StepRepr_GlobalUnitAssignedContext.hxx>
25 #include <TCollection_HAsciiString.hxx>
27 IMPLEMENT_STANDARD_RTTIEXT(StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx,StepRepr_RepresentationContext)
29 // --------------------------------------------------------------------------------------------------
32 // --------------------------------------------------------------------------------------------------
33 StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx () {}
35 // --------------------------------------------------------------------------------------------------
38 // --------------------------------------------------------------------------------------------------
40 void StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::Init
41 (const Handle(TCollection_HAsciiString)& aContextIdentifier,
42 const Handle(TCollection_HAsciiString)& aContextType,
43 const Handle(StepGeom_GeometricRepresentationContext)& aGeometricRepresentationContext,
44 const Handle(StepRepr_GlobalUnitAssignedContext)& aGlobalUnitAssignedContext,
45 const Handle(StepRepr_GlobalUncertaintyAssignedContext)& aGlobalUncertaintyAssignedCtx)
47 // --- classe own fields ---
48 geometricRepresentationContext = aGeometricRepresentationContext;
49 globalUnitAssignedContext = aGlobalUnitAssignedContext;
50 globalUncertaintyAssignedContext = aGlobalUncertaintyAssignedCtx;
51 // --- classe inherited fields ---
52 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 componant fields : GeometricRepresentationContext ---
74 geometricRepresentationContext = new StepGeom_GeometricRepresentationContext();
75 geometricRepresentationContext->Init(aContextIdentifier, aContextType, aCoordinateSpaceDimension);
77 // --- ANDOR componant fields : GlobalUnitAssignedContext ---
79 globalUnitAssignedContext = new StepRepr_GlobalUnitAssignedContext();
80 globalUnitAssignedContext->Init(aContextIdentifier, aContextType, aUnits);
82 // --- ANDOR componant fields : GlobalUncertaintyAssignedContext ---
84 globalUncertaintyAssignedContext = new StepRepr_GlobalUncertaintyAssignedContext();
85 globalUncertaintyAssignedContext->Init(aContextIdentifier, aContextType, anUncertainty);
89 // --------------------------------------------------------------------------------------------------
92 // --------------------------------------------------------------------------------------------------
94 void StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::SetGeometricRepresentationContext(const Handle(StepGeom_GeometricRepresentationContext)& aGeometricRepresentationContext)
96 geometricRepresentationContext = aGeometricRepresentationContext;
99 // --------------------------------------------------------------------------------------------------
102 // --------------------------------------------------------------------------------------------------
104 Handle(StepGeom_GeometricRepresentationContext) StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::GeometricRepresentationContext() const
106 return geometricRepresentationContext;
109 // --------------------------------------------------------------------------------------------------
112 // --------------------------------------------------------------------------------------------------
114 void StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::SetGlobalUnitAssignedContext
115 (const Handle(StepRepr_GlobalUnitAssignedContext)& aGlobalUnitAssignedContext)
117 globalUnitAssignedContext = aGlobalUnitAssignedContext;
120 // --------------------------------------------------------------------------------------------------
123 // --------------------------------------------------------------------------------------------------
125 Handle(StepRepr_GlobalUnitAssignedContext) StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::GlobalUnitAssignedContext() const
127 return globalUnitAssignedContext;
130 // --------------------------------------------------------------------------------------------------
133 // --------------------------------------------------------------------------------------------------
135 void StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::SetGlobalUncertaintyAssignedContext
136 (const Handle(StepRepr_GlobalUncertaintyAssignedContext)& aGlobalUncertaintyAssignedCtx)
138 globalUncertaintyAssignedContext = aGlobalUncertaintyAssignedCtx;
142 // --------------------------------------------------------------------------------------------------
145 // --------------------------------------------------------------------------------------------------
147 Handle(StepRepr_GlobalUncertaintyAssignedContext) StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::GlobalUncertaintyAssignedContext() const
149 return globalUncertaintyAssignedContext;
152 //-------------------------------------------------------------------------------------
153 //--- Specific Methods for AND classe field access : GeometricRepresentationContext ---
154 //-------------------------------------------------------------------------------------
156 // --------------------------------------------------------------------------------------------------
159 // --------------------------------------------------------------------------------------------------
161 void StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::SetCoordinateSpaceDimension(const Standard_Integer aCoordinateSpaceDimension)
163 geometricRepresentationContext->SetCoordinateSpaceDimension(aCoordinateSpaceDimension);
166 // --------------------------------------------------------------------------------------------------
169 // --------------------------------------------------------------------------------------------------
171 Standard_Integer StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::CoordinateSpaceDimension() const
173 return geometricRepresentationContext->CoordinateSpaceDimension();
176 //---------------------------------------------------------------------------------
177 //--- Specific Methods for AND classe field access : GlobalUnitAssignedContext ---
178 //---------------------------------------------------------------------------------
180 // --------------------------------------------------------------------------------------------------
183 // --------------------------------------------------------------------------------------------------
185 void StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::SetUnits(const Handle(StepBasic_HArray1OfNamedUnit)& aUnits)
187 globalUnitAssignedContext->SetUnits(aUnits);
190 // --------------------------------------------------------------------------------------------------
193 // --------------------------------------------------------------------------------------------------
195 Handle(StepBasic_HArray1OfNamedUnit) StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::Units() const
197 return globalUnitAssignedContext->Units();
200 // --------------------------------------------------------------------------------------------------
203 // --------------------------------------------------------------------------------------------------
205 Handle(StepBasic_NamedUnit) StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::UnitsValue(const Standard_Integer num) const
207 return globalUnitAssignedContext->UnitsValue(num);
210 // --------------------------------------------------------------------------------------------------
213 // --------------------------------------------------------------------------------------------------
215 Standard_Integer StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::NbUnits () const
217 return globalUnitAssignedContext->NbUnits();
221 //----------------------------------------------------------------------------------------
222 //--- Specific Methods for AND classe field access : GlobalUncertaintyAssignedContext ---
223 //----------------------------------------------------------------------------------------
225 // --------------------------------------------------------------------------------------------------
228 // --------------------------------------------------------------------------------------------------
230 void StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::SetUncertainty(const Handle(StepBasic_HArray1OfUncertaintyMeasureWithUnit)& aUncertainty)
232 globalUncertaintyAssignedContext->SetUncertainty(aUncertainty);
235 // --------------------------------------------------------------------------------------------------
238 // --------------------------------------------------------------------------------------------------
240 Handle(StepBasic_HArray1OfUncertaintyMeasureWithUnit) StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::Uncertainty() const
242 return globalUncertaintyAssignedContext->Uncertainty();
245 // --------------------------------------------------------------------------------------------------
248 // --------------------------------------------------------------------------------------------------
250 Handle(StepBasic_UncertaintyMeasureWithUnit) StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::UncertaintyValue(const Standard_Integer num) const
252 return globalUncertaintyAssignedContext->UncertaintyValue(num);
255 // --------------------------------------------------------------------------------------------------
258 // --------------------------------------------------------------------------------------------------
260 Standard_Integer StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::NbUncertainty() const
262 return globalUncertaintyAssignedContext->NbUncertainty();