Salome HOME
Update from local sources
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_Filter.h
1 //  SMESHGUI_Filter : Filters for VTK viewer
2 //
3 //  Copyright (C) 2003  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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
21 //
22 //
23 //
24 //  File   : SMESHGUI_Filter.h
25 //  Author : Sergey LITONIN
26 //  Module : SMESH
27
28 #ifndef SMESHGUI_Filter_HeaderFile
29 #define SMESHGUI_Filter_HeaderFile
30
31 #include "VTKViewer_Filter.h"
32
33 #include <SALOMEconfig.h>
34 #include CORBA_SERVER_HEADER(SMESH_Filter)
35
36 class SALOME_Actor;
37
38 enum SMESHGUI_FilterType
39 {
40   SMESHGUI_UnknownFilter      = -1,
41   SMESHGUI_NodeFilter         =  0,
42   SMESHGUI_EdgeFilter         =  1,
43   SMESHGUI_FaceFilter         =  2,
44   SMESHGUI_VolumeFilter       =  3,
45   SMESHGUI_AllElementsFilter  =  4,
46   SMESHGUI_QuadFilter         =  5,
47   SMESHGUI_TriaFilter         =  6,
48   SMESHGUI_LastFilter
49 };
50
51 /*
52   Class       : SMESHGUI_Filter
53   Description : Base class for SMESH selection filters for VTK viewer.
54 */
55
56 DEFINE_STANDARD_HANDLE(SMESHGUI_Filter, VTKViewer_Filter)
57
58 class SMESHGUI_Filter : public VTKViewer_Filter
59 {
60
61 public:
62
63   virtual bool                IsObjValid( const int theObjId ) const = 0;
64 public:
65   DEFINE_STANDARD_RTTI(SMESHGUI_Filter)
66 };
67
68 /*
69   Class       : SMESHGUI_PredicateFilter
70   Description : Selection filter for VTK viewer. This class aggregate object
71                 of SMESH_Predicate class and uses it for verification of criterion
72 */
73
74 DEFINE_STANDARD_HANDLE(SMESHGUI_PredicateFilter, SMESHGUI_Filter)
75
76 class SMESHGUI_PredicateFilter : public SMESHGUI_Filter
77 {
78
79 public:
80                               SMESHGUI_PredicateFilter();
81   virtual                     ~SMESHGUI_PredicateFilter();
82
83   virtual bool                IsValid( const int theCellId ) const;
84   virtual bool                IsObjValid( const int theObjId ) const;
85   virtual int                 GetId() const;
86   virtual bool                IsNodeFilter() const;
87   void                        SetPredicate( SMESH::Predicate_ptr );
88
89   void                        SetActor( SALOME_Actor* );
90
91 private:
92
93   SMESH::Predicate_var        myPred;
94
95 public:
96   DEFINE_STANDARD_RTTI(SMESHGUI_PredicateFilter)
97 };
98
99 /*
100   Class       : SMESHGUI_QuadrangleFilter
101   Description : Verify whether selected cell is quadranle
102 */
103
104 DEFINE_STANDARD_HANDLE(SMESHGUI_QuadrangleFilter, SMESHGUI_Filter)
105
106 class SMESHGUI_QuadrangleFilter : public SMESHGUI_Filter
107 {
108
109 public:
110                               SMESHGUI_QuadrangleFilter();
111   virtual                     ~SMESHGUI_QuadrangleFilter();
112
113   virtual bool                IsValid( const int theCellId ) const;
114   virtual bool                IsObjValid( const int theObjId ) const;
115   virtual int                 GetId() const;
116   virtual bool                IsNodeFilter() const;
117
118 public:
119   DEFINE_STANDARD_RTTI(SMESHGUI_QuadrangleFilter)
120 };
121
122 /*
123   Class       : SMESHGUI_TriangleFilter
124   Description : Verify whether selected cell is triangle
125 */
126
127 DEFINE_STANDARD_HANDLE(SMESHGUI_TriangleFilter, SMESHGUI_Filter)
128
129 class SMESHGUI_TriangleFilter : public SMESHGUI_Filter
130 {
131
132 public:
133                               SMESHGUI_TriangleFilter();
134   virtual                     ~SMESHGUI_TriangleFilter();
135
136   virtual bool                IsValid( const int theCellId ) const;
137   virtual bool                IsObjValid( const int theObjId ) const;
138   virtual int                 GetId() const;
139   virtual bool                IsNodeFilter() const;  
140
141 public:
142   DEFINE_STANDARD_RTTI(SMESHGUI_TriangleFilter)
143 };
144
145 /*
146   Class       : SMESHGUI_FacesFilter
147   Description : Verify whether selected cell is any face
148 */
149
150 DEFINE_STANDARD_HANDLE(SMESHGUI_FacesFilter, SMESHGUI_Filter)
151
152 class SMESHGUI_FacesFilter : public SMESHGUI_Filter
153 {
154
155 public:
156                               SMESHGUI_FacesFilter();
157   virtual                     ~SMESHGUI_FacesFilter();
158
159   virtual bool                IsValid( const int theCellId ) const;
160   virtual bool                IsObjValid( const int theObjId ) const;
161   virtual int                 GetId() const;
162   virtual bool                IsNodeFilter() const;  
163
164 public:
165   DEFINE_STANDARD_RTTI(SMESHGUI_FacesFilter)
166 };
167
168 /*
169   Class       : SMESHGUI_VolumesFilter
170   Description : Verify whether selected cell is any volume
171 */
172
173 DEFINE_STANDARD_HANDLE(SMESHGUI_VolumesFilter, SMESHGUI_Filter)
174
175 class SMESHGUI_VolumesFilter : public SMESHGUI_Filter
176 {
177
178 public:
179                               SMESHGUI_VolumesFilter();
180   virtual                     ~SMESHGUI_VolumesFilter();
181
182   virtual bool                IsValid( const int theCellId ) const;
183   virtual bool                IsObjValid( const int theObjId ) const;
184   virtual int                 GetId() const;
185   virtual bool                IsNodeFilter() const;  
186
187 public:
188   DEFINE_STANDARD_RTTI(SMESHGUI_VolumesFilter)
189 };
190
191 #endif