Salome HOME
IPAL21120 SIGSEGV on Meshing attached Compound with Automatic Hexadralization
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_Filter.h
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //  SMESHGUI_Filter : Filters for VTK viewer
23 //  File   : SMESHGUI_Filter.h
24 //  Author : Sergey LITONIN
25 //  Module : SMESH
26 //
27 #ifndef SMESHGUI_Filter_HeaderFile
28 #define SMESHGUI_Filter_HeaderFile
29
30 #include "SMESH_SMESHGUI.hxx"
31
32 #include "VTKViewer_Filter.h"
33
34 #include <SALOMEconfig.h>
35 #include CORBA_SERVER_HEADER(SMESH_Filter)
36
37 class SALOME_Actor;
38
39 enum SMESHGUI_FilterType
40 {
41   SMESHGUI_UnknownFilter      = -1,
42   SMESHGUI_NodeFilter         =  0,
43   SMESHGUI_EdgeFilter         =  1,
44   SMESHGUI_FaceFilter         =  2,
45   SMESHGUI_VolumeFilter       =  3,
46   SMESHGUI_AllElementsFilter  =  4,
47   SMESHGUI_QuadFilter         =  5,
48   SMESHGUI_TriaFilter         =  6,
49   SMESHGUI_LastFilter
50 };
51
52 /*
53   Class       : SMESHGUI_Filter
54   Description : Base class for SMESH selection filters for VTK viewer.
55 */
56
57 DEFINE_STANDARD_HANDLE(SMESHGUI_Filter, VTKViewer_Filter)
58
59 class SMESHGUI_Filter : public VTKViewer_Filter
60 {
61
62 public:
63
64   virtual bool                IsObjValid( const int theObjId ) const = 0;
65 public:
66   DEFINE_STANDARD_RTTI(SMESHGUI_Filter)
67 };
68
69 /*
70   Class       : SMESHGUI_PredicateFilter
71   Description : Selection filter for VTK viewer. This class aggregate object
72                 of SMESH_Predicate class and uses it for verification of criterion
73 */
74
75 DEFINE_STANDARD_HANDLE(SMESHGUI_PredicateFilter, SMESHGUI_Filter)
76
77 class SMESHGUI_PredicateFilter : public SMESHGUI_Filter
78 {
79
80 public:
81                               SMESHGUI_PredicateFilter();
82   virtual                     ~SMESHGUI_PredicateFilter();
83
84   virtual bool                IsValid( const int theCellId ) const;
85   virtual bool                IsObjValid( const int theObjId ) const;
86   virtual int                 GetId() const;
87   virtual bool                IsNodeFilter() const;
88   void                        SetPredicate( SMESH::Predicate_ptr );
89
90   void                        SetActor( SALOME_Actor* );
91
92 private:
93
94   SMESH::Predicate_var        myPred;
95
96 public:
97   DEFINE_STANDARD_RTTI(SMESHGUI_PredicateFilter)
98 };
99
100 /*
101   Class       : SMESHGUI_QuadrangleFilter
102   Description : Verify whether selected cell is quadranle
103 */
104
105 DEFINE_STANDARD_HANDLE(SMESHGUI_QuadrangleFilter, SMESHGUI_Filter)
106
107 class SMESHGUI_QuadrangleFilter : public SMESHGUI_Filter
108 {
109
110 public:
111                               SMESHGUI_QuadrangleFilter();
112   virtual                     ~SMESHGUI_QuadrangleFilter();
113
114   virtual bool                IsValid( const int theCellId ) const;
115   virtual bool                IsObjValid( const int theObjId ) const;
116   virtual int                 GetId() const;
117   virtual bool                IsNodeFilter() const;
118
119 public:
120   DEFINE_STANDARD_RTTI(SMESHGUI_QuadrangleFilter)
121 };
122
123 /*
124   Class       : SMESHGUI_TriangleFilter
125   Description : Verify whether selected cell is triangle
126 */
127
128 DEFINE_STANDARD_HANDLE(SMESHGUI_TriangleFilter, SMESHGUI_Filter)
129
130 class SMESHGUI_TriangleFilter : public SMESHGUI_Filter
131 {
132
133 public:
134                               SMESHGUI_TriangleFilter();
135   virtual                     ~SMESHGUI_TriangleFilter();
136
137   virtual bool                IsValid( const int theCellId ) const;
138   virtual bool                IsObjValid( const int theObjId ) const;
139   virtual int                 GetId() const;
140   virtual bool                IsNodeFilter() const;  
141
142 public:
143   DEFINE_STANDARD_RTTI(SMESHGUI_TriangleFilter)
144 };
145
146 /*
147   Class       : SMESHGUI_FacesFilter
148   Description : Verify whether selected cell is any face
149 */
150
151 DEFINE_STANDARD_HANDLE(SMESHGUI_FacesFilter, SMESHGUI_Filter)
152
153 class SMESHGUI_FacesFilter : public SMESHGUI_Filter
154 {
155
156 public:
157                               SMESHGUI_FacesFilter();
158   virtual                     ~SMESHGUI_FacesFilter();
159
160   virtual bool                IsValid( const int theCellId ) const;
161   virtual bool                IsObjValid( const int theObjId ) const;
162   virtual int                 GetId() const;
163   virtual bool                IsNodeFilter() const;  
164
165 public:
166   DEFINE_STANDARD_RTTI(SMESHGUI_FacesFilter)
167 };
168
169 /*
170   Class       : SMESHGUI_VolumesFilter
171   Description : Verify whether selected cell is any volume
172 */
173
174 DEFINE_STANDARD_HANDLE(SMESHGUI_VolumesFilter, SMESHGUI_Filter)
175
176 class SMESHGUI_VolumesFilter : public SMESHGUI_Filter
177 {
178
179 public:
180                               SMESHGUI_VolumesFilter();
181   virtual                     ~SMESHGUI_VolumesFilter();
182
183   virtual bool                IsValid( const int theCellId ) const;
184   virtual bool                IsObjValid( const int theObjId ) const;
185   virtual int                 GetId() const;
186   virtual bool                IsNodeFilter() const;  
187
188 public:
189   DEFINE_STANDARD_RTTI(SMESHGUI_VolumesFilter)
190 };
191
192 #endif