b311480e |
1 | // Created on: 2003-06-04 |
2 | // Created by: Galina KULIKOVA |
973c2be1 |
3 | // Copyright (c) 2003-2014 OPEN CASCADE SAS |
b311480e |
4 | // |
973c2be1 |
5 | // This file is part of Open CASCADE Technology software library. |
b311480e |
6 | // |
d5f74e42 |
7 | // This library is free software; you can redistribute it and/or modify it under |
8 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
9 | // by the Free Software Foundation, with special exception defined in the file |
10 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
11 | // distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
12 | // |
973c2be1 |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
b311480e |
15 | |
7fd59977 |
16 | // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.2 |
7fd59977 |
17 | |
42cf5bc1 |
18 | #include <Standard_Type.hxx> |
19 | #include <StepBasic_MeasureWithUnit.hxx> |
28a73c1f |
20 | #include <StepDimTol_GeometricToleranceTarget.hxx> |
42cf5bc1 |
21 | #include <StepDimTol_GeometricToleranceWithDatumReference.hxx> |
22 | #include <StepRepr_ShapeAspect.hxx> |
23 | #include <TCollection_HAsciiString.hxx> |
7fd59977 |
24 | |
92efcf78 |
25 | IMPLEMENT_STANDARD_RTTIEXT(StepDimTol_GeometricToleranceWithDatumReference,StepDimTol_GeometricTolerance) |
26 | |
7fd59977 |
27 | //======================================================================= |
28 | //function : StepDimTol_GeometricToleranceWithDatumReference |
29 | //purpose : |
30 | //======================================================================= |
7fd59977 |
31 | StepDimTol_GeometricToleranceWithDatumReference::StepDimTol_GeometricToleranceWithDatumReference () |
32 | { |
33 | } |
34 | |
35 | //======================================================================= |
36 | //function : Init |
37 | //purpose : |
38 | //======================================================================= |
39 | |
2f220b97 |
40 | void StepDimTol_GeometricToleranceWithDatumReference::Init (const Handle(TCollection_HAsciiString) &theGeometricTolerance_Name, |
41 | const Handle(TCollection_HAsciiString) &theGeometricTolerance_Description, |
42 | const Handle(StepBasic_MeasureWithUnit) &theGeometricTolerance_Magnitude, |
43 | const Handle(StepRepr_ShapeAspect) &theGeometricTolerance_TolerancedShapeAspect, |
44 | const Handle(StepDimTol_HArray1OfDatumReference) &theDatumSystem) |
7fd59977 |
45 | { |
2f220b97 |
46 | StepDimTol_GeometricTolerance::Init(theGeometricTolerance_Name, |
47 | theGeometricTolerance_Description, |
48 | theGeometricTolerance_Magnitude, |
49 | theGeometricTolerance_TolerancedShapeAspect); |
7fd59977 |
50 | |
2f220b97 |
51 | myDatumSystem = new StepDimTol_HArray1OfDatumSystemOrReference(theDatumSystem->Lower(), theDatumSystem->Upper()); |
28a73c1f |
52 | StepDimTol_DatumSystemOrReference anAux; |
2f220b97 |
53 | for (Standard_Integer i = theDatumSystem->Lower(); i <= theDatumSystem->Upper(); i++) { |
54 | anAux.SetValue(theDatumSystem->Value(i)); |
55 | myDatumSystem->SetValue(i, anAux); |
28a73c1f |
56 | } |
57 | } |
58 | |
59 | //======================================================================= |
60 | //function : Init |
61 | //purpose : |
62 | //======================================================================= |
63 | |
2f220b97 |
64 | void StepDimTol_GeometricToleranceWithDatumReference::Init (const Handle(TCollection_HAsciiString) &theGeometricTolerance_Name, |
65 | const Handle(TCollection_HAsciiString) &theGeometricTolerance_Description, |
66 | const Handle(StepBasic_MeasureWithUnit) &theGeometricTolerance_Magnitude, |
67 | const StepDimTol_GeometricToleranceTarget &theGeometricTolerance_TolerancedShapeAspect, |
68 | const Handle(StepDimTol_HArray1OfDatumSystemOrReference) &theDatumSystem) |
28a73c1f |
69 | { |
2f220b97 |
70 | StepDimTol_GeometricTolerance::Init(theGeometricTolerance_Name, |
71 | theGeometricTolerance_Description, |
72 | theGeometricTolerance_Magnitude, |
73 | theGeometricTolerance_TolerancedShapeAspect); |
28a73c1f |
74 | |
2f220b97 |
75 | myDatumSystem = theDatumSystem; |
7fd59977 |
76 | } |
77 | |
78 | //======================================================================= |
79 | //function : DatumSystem |
80 | //purpose : |
81 | //======================================================================= |
82 | |
83 | Handle(StepDimTol_HArray1OfDatumReference) StepDimTol_GeometricToleranceWithDatumReference::DatumSystem () const |
28a73c1f |
84 | { |
85 | Handle(StepDimTol_HArray1OfDatumReference) aDatumSystem; |
2f220b97 |
86 | aDatumSystem = new StepDimTol_HArray1OfDatumReference(myDatumSystem->Lower(), myDatumSystem->Upper()); |
28a73c1f |
87 | for (Standard_Integer i = aDatumSystem->Lower(); i <= aDatumSystem->Upper(); i++) { |
2f220b97 |
88 | aDatumSystem->SetValue(i, myDatumSystem->Value(i).DatumReference()); |
28a73c1f |
89 | } |
90 | return aDatumSystem; |
91 | } |
92 | |
93 | //======================================================================= |
94 | //function : DatumSystemAP242 |
95 | //purpose : |
96 | //======================================================================= |
97 | |
98 | Handle(StepDimTol_HArray1OfDatumSystemOrReference) StepDimTol_GeometricToleranceWithDatumReference::DatumSystemAP242 () const |
7fd59977 |
99 | { |
2f220b97 |
100 | return myDatumSystem; |
7fd59977 |
101 | } |
102 | |
103 | //======================================================================= |
104 | //function : SetDatumSystem |
105 | //purpose : |
106 | //======================================================================= |
107 | |
2f220b97 |
108 | void StepDimTol_GeometricToleranceWithDatumReference::SetDatumSystem (const Handle(StepDimTol_HArray1OfDatumReference) &theDatumSystem) |
28a73c1f |
109 | { |
2f220b97 |
110 | myDatumSystem = new StepDimTol_HArray1OfDatumSystemOrReference(theDatumSystem->Lower(), theDatumSystem->Upper()); |
28a73c1f |
111 | StepDimTol_DatumSystemOrReference anAux; |
2f220b97 |
112 | for (Standard_Integer i = theDatumSystem->Lower(); i <= theDatumSystem->Upper(); i++) { |
113 | anAux.SetValue(theDatumSystem->Value(i)); |
114 | myDatumSystem->SetValue(i, anAux); |
28a73c1f |
115 | } |
116 | } |
117 | |
118 | //======================================================================= |
119 | //function : SetDatumSystem |
120 | //purpose : |
121 | //======================================================================= |
122 | |
2f220b97 |
123 | void StepDimTol_GeometricToleranceWithDatumReference::SetDatumSystem (const Handle(StepDimTol_HArray1OfDatumSystemOrReference) &theDatumSystem) |
7fd59977 |
124 | { |
2f220b97 |
125 | myDatumSystem = theDatumSystem; |
7fd59977 |
126 | } |