0030686: Visualization, SelectMgr_ViewerSelector - sorting issues of transformation...
[occt.git] / src / StepData / StepData_SelectMember.hxx
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
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _StepData_SelectMember_HeaderFile
18 #define _StepData_SelectMember_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
23 #include <Standard_Transient.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>
30
31
32 class StepData_SelectMember;
33 DEFINE_STANDARD_HANDLE(StepData_SelectMember, Standard_Transient)
34
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)
41 //!
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
45 //!
46 //! It is also possible to define a specific subtype by redefining
47 //! virtual method, then give a better control
48 //!
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 Standard_Transient
52 {
53
54 public:
55
56   
57   Standard_EXPORT StepData_SelectMember();
58   
59   //! Tells if a SelectMember has a name. Default is False
60   Standard_EXPORT virtual Standard_Boolean HasName() const;
61   
62   //! Returns the name of a SelectMember. Default is empty
63   Standard_EXPORT virtual Standard_CString Name() const;
64   
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);
69   
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;
73   
74   Standard_EXPORT virtual Standard_Integer Kind() const;
75   
76   Standard_EXPORT virtual void SetKind (const Standard_Integer kind);
77   
78   //! Returns the Kind of the SelectMember, under the form of an
79   //! enum ParamType
80   Standard_EXPORT Interface_ParamType ParamType() const;
81   
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;
85   
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);
89   
90   //! Gets the value as an Integer
91   Standard_EXPORT Standard_Integer Integer() const;
92   
93   Standard_EXPORT void SetInteger (const Standard_Integer val);
94   
95   Standard_EXPORT Standard_Boolean Boolean() const;
96   
97   Standard_EXPORT void SetBoolean (const Standard_Boolean val);
98   
99   Standard_EXPORT StepData_Logical Logical() const;
100   
101   Standard_EXPORT void SetLogical (const StepData_Logical val);
102   
103   Standard_EXPORT virtual Standard_Real Real() const;
104   
105   Standard_EXPORT virtual void SetReal (const Standard_Real val);
106   
107   Standard_EXPORT virtual Standard_CString String() const;
108   
109   Standard_EXPORT virtual void SetString (const Standard_CString val);
110   
111   Standard_EXPORT Standard_Integer Enum() const;
112   
113   Standard_EXPORT virtual Standard_CString EnumText() const;
114   
115   Standard_EXPORT void SetEnum (const Standard_Integer val, const Standard_CString text = "");
116   
117   Standard_EXPORT virtual void SetEnumText (const Standard_Integer val, const Standard_CString text);
118
119
120
121
122   DEFINE_STANDARD_RTTIEXT(StepData_SelectMember,Standard_Transient)
123
124 protected:
125
126
127
128
129 private:
130
131
132
133
134 };
135
136
137
138
139
140
141
142 #endif // _StepData_SelectMember_HeaderFile