1 // Created on: 2015-07-16
2 // Created by: Irina KRYLOVA
3 // Copyright (c) 2015 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 #include <StepDimTol_SimpleDatumReferenceModifierMember.hxx>
17 #include <StepData_EnumTool.hxx>
18 #include <TCollection_AsciiString.hxx>
20 IMPLEMENT_STANDARD_RTTIEXT(StepDimTol_SimpleDatumReferenceModifierMember,StepData_SelectInt)
22 static StepData_EnumTool tool
23 (".ANY_CROSS_SECTION.",
24 ".ANY_LONGITUDINAL_SECTION.",
26 ".CONTACTING_FEATURE.",
27 ".DEGREE_OF_FREEDOM_CONSTRAINT_U.",
28 ".DEGREE_OF_FREEDOM_CONSTRAINT_V.",
29 ".DEGREE_OF_FREEDOM_CONSTRAINT_W.",
30 ".DEGREE_OF_FREEDOM_CONSTRAINT_X.",
31 ".DEGREE_OF_FREEDOM_CONSTRAINT_Y.",
32 ".DEGREE_OF_FREEDOM_CONSTRAINT_Z.",
33 ".DISTANCE_VARIABLE.",
35 ".LEAST_MATERIAL_REQUIREMENT.",
38 ".MAXIMUM_MATERIAL_REQUIREMENT.",
46 //=======================================================================
47 //function : StepDimTol_SimpleDatumReferenceModifierMember
49 //=======================================================================
51 StepDimTol_SimpleDatumReferenceModifierMember::StepDimTol_SimpleDatumReferenceModifierMember () { }
53 //=======================================================================
56 //=======================================================================
58 Standard_CString StepDimTol_SimpleDatumReferenceModifierMember::EnumText () const
59 { return tool.Text(Int()).ToCString(); }
61 //=======================================================================
62 //function : SetEnumText
64 //=======================================================================
66 void StepDimTol_SimpleDatumReferenceModifierMember::SetEnumText (const Standard_Integer /*theValue*/,
67 const Standard_CString theText)
69 Standard_Integer aVal = tool.Value (theText);
70 if (aVal >= 0) SetInt (aVal);
73 //=======================================================================
76 //=======================================================================
78 void StepDimTol_SimpleDatumReferenceModifierMember::SetValue (const StepDimTol_SimpleDatumReferenceModifier theValue)
80 SetInt ( Standard_Integer (theValue) );
83 //=======================================================================
86 //=======================================================================
88 StepDimTol_SimpleDatumReferenceModifier StepDimTol_SimpleDatumReferenceModifierMember::Value () const
90 return StepDimTol_SimpleDatumReferenceModifier (Int());