1 // Created on: 2003-06-04
2 // Created by: Galina KULIKOVA
3 // Copyright (c) 2003-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.2
18 #include <Standard_Type.hxx>
19 #include <StepBasic_MeasureWithUnit.hxx>
20 #include <StepDimTol_GeometricToleranceTarget.hxx>
21 #include <StepDimTol_GeometricToleranceWithDatumReference.hxx>
22 #include <StepRepr_ShapeAspect.hxx>
23 #include <TCollection_HAsciiString.hxx>
25 IMPLEMENT_STANDARD_RTTIEXT(StepDimTol_GeometricToleranceWithDatumReference,StepDimTol_GeometricTolerance)
27 //=======================================================================
28 //function : StepDimTol_GeometricToleranceWithDatumReference
30 //=======================================================================
31 StepDimTol_GeometricToleranceWithDatumReference::StepDimTol_GeometricToleranceWithDatumReference ()
35 //=======================================================================
38 //=======================================================================
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)
46 StepDimTol_GeometricTolerance::Init(theGeometricTolerance_Name,
47 theGeometricTolerance_Description,
48 theGeometricTolerance_Magnitude,
49 theGeometricTolerance_TolerancedShapeAspect);
51 myDatumSystem = new StepDimTol_HArray1OfDatumSystemOrReference(theDatumSystem->Lower(), theDatumSystem->Upper());
52 StepDimTol_DatumSystemOrReference anAux;
53 for (Standard_Integer i = theDatumSystem->Lower(); i <= theDatumSystem->Upper(); i++) {
54 anAux.SetValue(theDatumSystem->Value(i));
55 myDatumSystem->SetValue(i, anAux);
59 //=======================================================================
62 //=======================================================================
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)
70 StepDimTol_GeometricTolerance::Init(theGeometricTolerance_Name,
71 theGeometricTolerance_Description,
72 theGeometricTolerance_Magnitude,
73 theGeometricTolerance_TolerancedShapeAspect);
75 myDatumSystem = theDatumSystem;
78 //=======================================================================
79 //function : DatumSystem
81 //=======================================================================
83 Handle(StepDimTol_HArray1OfDatumReference) StepDimTol_GeometricToleranceWithDatumReference::DatumSystem () const
85 Handle(StepDimTol_HArray1OfDatumReference) aDatumSystem;
86 aDatumSystem = new StepDimTol_HArray1OfDatumReference(myDatumSystem->Lower(), myDatumSystem->Upper());
87 for (Standard_Integer i = aDatumSystem->Lower(); i <= aDatumSystem->Upper(); i++) {
88 aDatumSystem->SetValue(i, myDatumSystem->Value(i).DatumReference());
93 //=======================================================================
94 //function : DatumSystemAP242
96 //=======================================================================
98 Handle(StepDimTol_HArray1OfDatumSystemOrReference) StepDimTol_GeometricToleranceWithDatumReference::DatumSystemAP242 () const
100 return myDatumSystem;
103 //=======================================================================
104 //function : SetDatumSystem
106 //=======================================================================
108 void StepDimTol_GeometricToleranceWithDatumReference::SetDatumSystem (const Handle(StepDimTol_HArray1OfDatumReference) &theDatumSystem)
110 myDatumSystem = new StepDimTol_HArray1OfDatumSystemOrReference(theDatumSystem->Lower(), theDatumSystem->Upper());
111 StepDimTol_DatumSystemOrReference anAux;
112 for (Standard_Integer i = theDatumSystem->Lower(); i <= theDatumSystem->Upper(); i++) {
113 anAux.SetValue(theDatumSystem->Value(i));
114 myDatumSystem->SetValue(i, anAux);
118 //=======================================================================
119 //function : SetDatumSystem
121 //=======================================================================
123 void StepDimTol_GeometricToleranceWithDatumReference::SetDatumSystem (const Handle(StepDimTol_HArray1OfDatumSystemOrReference) &theDatumSystem)
125 myDatumSystem = theDatumSystem;