0026859: Export of GDT from XCAF to STEP
[occt.git] / src / StepDimTol / StepDimTol_SimpleDatumReferenceModifierMember.cxx
CommitLineData
28a73c1f 1// Created on: 2015-07-16
2// Created by: Irina KRYLOVA
3// Copyright (c) 2015 OPEN CASCADE SAS
4//
5// This file is part of Open CASCADE Technology software library.
6//
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.
12//
13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
15
16#include <StepDimTol_SimpleDatumReferenceModifierMember.hxx>
17#include <StepData_EnumTool.hxx>
18#include <TCollection_AsciiString.hxx>
19
20static StepData_EnumTool tool
21 (".ANY_CROSS_SECTION.",
22 ".ANY_LONGITUDINAL_SECTION.",
23 ".BASIC.",
24 ".CONTACTING_FEATURE.",
25 ".DEGREE_OF_FREEDOM_CONSTRAINT_U.",
26 ".DEGREE_OF_FREEDOM_CONSTRAINT_V.",
27 ".DEGREE_OF_FREEDOM_CONSTRAINT_W.",
28 ".DEGREE_OF_FREEDOM_CONSTRAINT_X.",
29 ".DEGREE_OF_FREEDOM_CONSTRAINT_Y.",
30 ".DEGREE_OF_FREEDOM_CONSTRAINT_Z.",
31 ".DISTANCE_VARIABLE.",
32 ".FREE_STATE.",
33 ".LEAST_MATERIAL_REQUIREMENT.",
34 ".LINE.",
35 ".MAJOR_DIAMETER.",
36 ".MAXIMUM_MATERIAL_REQUIREMENT.",
37 ".MINOR_DIAMETER.",
38 ".ORIENTATION.",
39 ".PITCH_DIAMETER.",
40 ".PLANE.",
41 ".POINT.",
42 ".TRANSLATION.");
43
44//=======================================================================
45//function : StepDimTol_SimpleDatumReferenceModifierMember
46//purpose :
47//=======================================================================
48
49StepDimTol_SimpleDatumReferenceModifierMember::StepDimTol_SimpleDatumReferenceModifierMember () { }
50
51//=======================================================================
52//function : EnumText
53//purpose :
54//=======================================================================
55
56Standard_CString StepDimTol_SimpleDatumReferenceModifierMember::EnumText () const
57 { return tool.Text(Int()).ToCString(); }
58
59//=======================================================================
60//function : SetEnumText
61//purpose :
62//=======================================================================
63
64void StepDimTol_SimpleDatumReferenceModifierMember::SetEnumText (const Standard_Integer /*theValue*/,
65 const Standard_CString theText)
66{
67 Standard_Integer aVal = tool.Value (theText);
68 if (aVal >= 0) SetInt (aVal);
69}
70
71//=======================================================================
72//function : SetValue
73//purpose :
74//=======================================================================
75
76void StepDimTol_SimpleDatumReferenceModifierMember::SetValue (const StepDimTol_SimpleDatumReferenceModifier theValue)
77{
78 SetInt ( Standard_Integer (theValue) );
79}
80
81//=======================================================================
82//function : Value
83//purpose :
84//=======================================================================
85
86StepDimTol_SimpleDatumReferenceModifier StepDimTol_SimpleDatumReferenceModifierMember::Value () const
87{
88 return StepDimTol_SimpleDatumReferenceModifier (Int());
89}
90
91