1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
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
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.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
14 #include <StepData_SelectMember.ixx>
16 // Definitions reprises de Field :
26 StepData_SelectMember::StepData_SelectMember () { }
28 Standard_Boolean StepData_SelectMember::HasName () const { return Standard_False; }
29 Standard_CString StepData_SelectMember::Name () const { return ""; }
31 Standard_Boolean StepData_SelectMember::SetName (const Standard_CString /*bid*/)
32 { return Standard_False; }
34 Standard_Boolean StepData_SelectMember::Matches (const Standard_CString name) const
35 { return !strcmp (name,Name()); }
37 Standard_Integer StepData_SelectMember::Kind () const { return 0; }
38 void StepData_SelectMember::SetKind (const Standard_Integer ) { }
40 Interface_ParamType StepData_SelectMember::ParamType () const
42 Standard_Integer kind = Kind();
43 if (kind == 0) return Interface_ParamVoid;
44 if (kind == 1) return Interface_ParamInteger;
45 if (kind == 2 || kind == 3) return Interface_ParamLogical;
46 if (kind == 4) return Interface_ParamEnum;
47 if (kind == 5) return Interface_ParamReal;
48 if (kind == 6) return Interface_ParamText;
49 return Interface_ParamMisc;
52 Standard_Integer StepData_SelectMember::Int () const { return 0; }
53 void StepData_SelectMember::SetInt (const Standard_Integer ) { }
55 Standard_Integer StepData_SelectMember::Integer () const { return Int(); }
56 void StepData_SelectMember::SetInteger (const Standard_Integer val)
57 { SetKind(KindInteger); SetInt(val); }
58 Standard_Boolean StepData_SelectMember::Boolean () const { return (Int() > 0); }
59 void StepData_SelectMember::SetBoolean (const Standard_Boolean val)
60 { SetKind(KindBoolean); SetInt((val ? 1 : 0)); }
62 StepData_Logical StepData_SelectMember::Logical () const
64 Standard_Integer ival = Int();
65 if (ival == 0) return StepData_LFalse;
66 if (ival == 1) return StepData_LTrue;
67 return StepData_LUnknown;
70 void StepData_SelectMember::SetLogical (const StepData_Logical val)
73 if (val == StepData_LFalse) SetInt(0);
74 if (val == StepData_LTrue) SetInt(0);
75 if (val == StepData_LUnknown) SetInt(0);
78 Standard_Real StepData_SelectMember::Real () const { return 0.0; }
79 void StepData_SelectMember::SetReal (const Standard_Real ) { }
81 Standard_CString StepData_SelectMember::String () const { return ""; }
82 void StepData_SelectMember::SetString (const Standard_CString ) { }
84 Standard_Integer StepData_SelectMember::Enum () const { return Int(); }
85 Standard_CString StepData_SelectMember::EnumText () const { return String(); }
87 void StepData_SelectMember::SetEnum (const Standard_Integer val,
88 const Standard_CString text)
92 if (text && text[0] != '\0') SetEnumText(val,text);
95 void StepData_SelectMember::SetEnumText (const Standard_Integer /*val*/,
96 const Standard_CString text)