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