1 // Created on: 1996-12-16
2 // Created by: Christian CAILLET
3 // Copyright (c) 1996-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _StepData_SelectMember_HeaderFile
18 #define _StepData_SelectMember_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <MMgt_TShared.hxx>
24 #include <Standard_Boolean.hxx>
25 #include <Standard_CString.hxx>
26 #include <Standard_Integer.hxx>
27 #include <Interface_ParamType.hxx>
28 #include <StepData_Logical.hxx>
29 #include <Standard_Real.hxx>
32 class StepData_SelectMember;
33 DEFINE_STANDARD_HANDLE(StepData_SelectMember, MMgt_TShared)
35 //! The general form for a Select Member. A Select Member can,
36 //! either define a value of a basic type (such as an integer)
37 //! with an additional information : a name or list of names
38 //! which precise the meaning of this value
39 //! or be an alternate value in a select, which also accepts an
40 //! entity (in this case, the name is not mandatory)
42 //! Several sub-types of SelectMember are defined for integer and
43 //! real value, plus an "universal" one for any, and one more to
44 //! describe a select with several names
46 //! It is also possible to define a specific subtype by redefining
47 //! virtual method, then give a better control
49 //! Remark : this class itself could be deferred, because at least
50 //! one of its virtual methods must be redefined to be usable
51 class StepData_SelectMember : public MMgt_TShared
57 Standard_EXPORT StepData_SelectMember();
59 //! Tells if a SelectMember has a name. Default is False
60 Standard_EXPORT virtual Standard_Boolean HasName() const;
62 //! Returns the name of a SelectMember. Default is empty
63 Standard_EXPORT virtual Standard_CString Name() const;
65 //! Sets the name of a SelectMember, returns True if done, False
66 //! if no name is allowed
67 //! Default does nothing and returns False
68 Standard_EXPORT virtual Standard_Boolean SetName (const Standard_CString name);
70 //! Tells if the name of a SelectMember matches a given one
71 //! By default, compares the strings, can be redefined (optimised)
72 Standard_EXPORT virtual Standard_Boolean Matches (const Standard_CString name) const;
74 Standard_EXPORT virtual Standard_Integer Kind() const;
76 Standard_EXPORT virtual void SetKind (const Standard_Integer kind);
78 //! Returns the Kind of the SelectMember, under the form of an
80 Standard_EXPORT Interface_ParamType ParamType() const;
82 //! This internal method gives access to a value implemented by an
83 //! Integer (to read it)
84 Standard_EXPORT virtual Standard_Integer Int() const;
86 //! This internal method gives access to a value implemented by an
87 //! Integer (to set it)
88 Standard_EXPORT virtual void SetInt (const Standard_Integer val);
90 //! Gets the value as an Integer
91 Standard_EXPORT Standard_Integer Integer() const;
93 Standard_EXPORT void SetInteger (const Standard_Integer val);
95 Standard_EXPORT Standard_Boolean Boolean() const;
97 Standard_EXPORT void SetBoolean (const Standard_Boolean val);
99 Standard_EXPORT StepData_Logical Logical() const;
101 Standard_EXPORT void SetLogical (const StepData_Logical val);
103 Standard_EXPORT virtual Standard_Real Real() const;
105 Standard_EXPORT virtual void SetReal (const Standard_Real val);
107 Standard_EXPORT virtual Standard_CString String() const;
109 Standard_EXPORT virtual void SetString (const Standard_CString val);
111 Standard_EXPORT Standard_Integer Enum() const;
113 Standard_EXPORT virtual Standard_CString EnumText() const;
115 Standard_EXPORT void SetEnum (const Standard_Integer val, const Standard_CString text = "");
117 Standard_EXPORT virtual void SetEnumText (const Standard_Integer val, const Standard_CString text);
122 DEFINE_STANDARD_RTTI(StepData_SelectMember,MMgt_TShared)
142 #endif // _StepData_SelectMember_HeaderFile