973c2be1 |
1 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
2 | // |
973c2be1 |
3 | // This file is part of Open CASCADE Technology software library. |
b311480e |
4 | // |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
10 | // |
973c2be1 |
11 | // Alternatively, this file may be used under the terms of Open CASCADE |
12 | // commercial license or contractual agreement. |
b311480e |
13 | |
7fd59977 |
14 | |
42cf5bc1 |
15 | #include <Standard_Type.hxx> |
16 | #include <StepBasic_NamedUnit.hxx> |
7fd59977 |
17 | #include <StepGeom_GeometricRepresentationContext.hxx> |
42cf5bc1 |
18 | #include <StepGeom_GeometricRepresentationContextAndGlobalUnitAssignedContext.hxx> |
7fd59977 |
19 | #include <StepRepr_GlobalUnitAssignedContext.hxx> |
42cf5bc1 |
20 | #include <TCollection_HAsciiString.hxx> |
7fd59977 |
21 | |
92efcf78 |
22 | IMPLEMENT_STANDARD_RTTIEXT(StepGeom_GeometricRepresentationContextAndGlobalUnitAssignedContext,StepRepr_RepresentationContext) |
23 | |
7fd59977 |
24 | StepGeom_GeometricRepresentationContextAndGlobalUnitAssignedContext::StepGeom_GeometricRepresentationContextAndGlobalUnitAssignedContext () {} |
25 | |
7fd59977 |
26 | void StepGeom_GeometricRepresentationContextAndGlobalUnitAssignedContext::Init( |
27 | const Handle(TCollection_HAsciiString)& aContextIdentifier, |
28 | const Handle(TCollection_HAsciiString)& aContextType, |
29 | const Handle(StepGeom_GeometricRepresentationContext)& aGeometricRepresentationContext, |
30 | const Handle(StepRepr_GlobalUnitAssignedContext)& aGlobalUnitAssignedContext) |
31 | { |
32 | // --- classe own fields --- |
33 | geometricRepresentationContext = aGeometricRepresentationContext; |
34 | globalUnitAssignedContext = aGlobalUnitAssignedContext; |
35 | // --- classe inherited fields --- |
36 | StepRepr_RepresentationContext::Init(aContextIdentifier, aContextType); |
37 | } |
38 | |
39 | |
40 | void StepGeom_GeometricRepresentationContextAndGlobalUnitAssignedContext::Init( |
41 | const Handle(TCollection_HAsciiString)& aContextIdentifier, |
42 | const Handle(TCollection_HAsciiString)& aContextType, |
43 | const Standard_Integer aCoordinateSpaceDimension, |
44 | const Handle(StepBasic_HArray1OfNamedUnit)& aUnits) |
45 | { |
46 | // --- classe inherited fields --- |
47 | |
48 | StepRepr_RepresentationContext::Init(aContextIdentifier, aContextType); |
49 | |
50 | // --- ANDOR componant fields --- |
51 | |
52 | geometricRepresentationContext = new StepGeom_GeometricRepresentationContext(); |
53 | geometricRepresentationContext->Init(aContextIdentifier, aContextType, aCoordinateSpaceDimension); |
54 | |
55 | // --- ANDOR componant fields --- |
56 | |
57 | globalUnitAssignedContext = new StepRepr_GlobalUnitAssignedContext(); |
58 | globalUnitAssignedContext->Init(aContextIdentifier, aContextType, aUnits); |
59 | } |
60 | |
61 | |
62 | void StepGeom_GeometricRepresentationContextAndGlobalUnitAssignedContext::SetGeometricRepresentationContext(const Handle(StepGeom_GeometricRepresentationContext)& aGeometricRepresentationContext) |
63 | { |
64 | geometricRepresentationContext = aGeometricRepresentationContext; |
65 | } |
66 | |
67 | Handle(StepGeom_GeometricRepresentationContext) StepGeom_GeometricRepresentationContextAndGlobalUnitAssignedContext::GeometricRepresentationContext() const |
68 | { |
69 | return geometricRepresentationContext; |
70 | } |
71 | |
72 | void StepGeom_GeometricRepresentationContextAndGlobalUnitAssignedContext::SetGlobalUnitAssignedContext(const Handle(StepRepr_GlobalUnitAssignedContext)& aGlobalUnitAssignedContext) |
73 | { |
74 | globalUnitAssignedContext = aGlobalUnitAssignedContext; |
75 | } |
76 | |
77 | Handle(StepRepr_GlobalUnitAssignedContext) StepGeom_GeometricRepresentationContextAndGlobalUnitAssignedContext::GlobalUnitAssignedContext() const |
78 | { |
79 | return globalUnitAssignedContext; |
80 | } |
81 | |
82 | //--- Specific Methods for AND classe field access --- |
83 | |
84 | |
85 | void StepGeom_GeometricRepresentationContextAndGlobalUnitAssignedContext::SetCoordinateSpaceDimension(const Standard_Integer aCoordinateSpaceDimension) |
86 | { |
87 | geometricRepresentationContext->SetCoordinateSpaceDimension(aCoordinateSpaceDimension); |
88 | } |
89 | |
90 | Standard_Integer StepGeom_GeometricRepresentationContextAndGlobalUnitAssignedContext::CoordinateSpaceDimension() const |
91 | { |
92 | return geometricRepresentationContext->CoordinateSpaceDimension(); |
93 | } |
94 | |
95 | //--- Specific Methods for AND classe field access --- |
96 | |
97 | |
98 | void StepGeom_GeometricRepresentationContextAndGlobalUnitAssignedContext::SetUnits(const Handle(StepBasic_HArray1OfNamedUnit)& aUnits) |
99 | { |
100 | globalUnitAssignedContext->SetUnits(aUnits); |
101 | } |
102 | |
103 | Handle(StepBasic_HArray1OfNamedUnit) StepGeom_GeometricRepresentationContextAndGlobalUnitAssignedContext::Units() const |
104 | { |
105 | return globalUnitAssignedContext->Units(); |
106 | } |
107 | |
108 | Handle(StepBasic_NamedUnit) StepGeom_GeometricRepresentationContextAndGlobalUnitAssignedContext::UnitsValue(const Standard_Integer num) const |
109 | { |
110 | return globalUnitAssignedContext->UnitsValue(num); |
111 | } |
112 | |
113 | Standard_Integer StepGeom_GeometricRepresentationContextAndGlobalUnitAssignedContext::NbUnits () const |
114 | { |
115 | return globalUnitAssignedContext->NbUnits(); |
116 | } |