Back to index

salome-smesh  6.5.0
SMESHGUI_Filter.h
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 // SMESHGUI_Filter : Filters for VTK viewer
00024 // File   : SMESHGUI_Filter.h
00025 // Author : Sergey LITONIN, Open CASCADE S.A.S.
00026 //
00027 #ifndef SMESHGUI_FILTER_H
00028 #define SMESHGUI_FILTER_H
00029 
00030 // SMESH includes
00031 #include "SMESH_SMESHGUI.hxx"
00032 
00033 // SALOME GUI includes
00034 #include <VTKViewer_Filter.h>
00035 
00036 // IDL includes
00037 #include <SALOMEconfig.h>
00038 #include CORBA_SERVER_HEADER(SMESH_Filter)
00039 
00040 class SALOME_Actor;
00041 
00042 namespace SMESH
00043 {
00044   enum SMESHGUI_FilterType {
00045     UnknownFilter      = -1,
00046     NodeFilter         =  0,
00047     EdgeFilter         =  1,
00048     FaceFilter         =  2,
00049     VolumeFilter       =  3,
00050     AllElementsFilter  =  4,
00051     QuadFilter         =  5,
00052     TriaFilter         =  6,
00053     LastFilter
00054   };
00055 };
00056 
00057 /*
00058   Class       : SMESHGUI_Filter
00059   Description : Base class for SMESH selection filters for VTK viewer.
00060 */
00061 
00062 DEFINE_STANDARD_HANDLE(SMESHGUI_Filter, VTKViewer_Filter)
00063 
00064 class SMESHGUI_Filter : public VTKViewer_Filter
00065 {
00066 public:
00067   Standard_EXPORT virtual bool IsObjValid( const int ) const = 0;
00068 
00069 public:
00070   DEFINE_STANDARD_RTTI(SMESHGUI_Filter)
00071 };
00072 
00073 /*
00074   Class       : SMESHGUI_PredicateFilter
00075   Description : Selection filter for VTK viewer. This class aggregate object
00076                 of SMESH_Predicate class and uses it for verification of criterion
00077 */
00078 
00079 DEFINE_STANDARD_HANDLE(SMESHGUI_PredicateFilter, SMESHGUI_Filter)
00080 
00081 class SMESHGUI_PredicateFilter : public SMESHGUI_Filter
00082 {
00083 public:
00084   Standard_EXPORT SMESHGUI_PredicateFilter();
00085   Standard_EXPORT virtual ~SMESHGUI_PredicateFilter();
00086 
00087   Standard_EXPORT virtual bool IsValid( const int ) const;
00088   Standard_EXPORT virtual bool IsObjValid( const int ) const;
00089   Standard_EXPORT virtual int  GetId() const;
00090   Standard_EXPORT virtual bool IsNodeFilter() const;
00091   Standard_EXPORT void         SetPredicate( SMESH::Predicate_ptr );
00092 
00093   Standard_EXPORT void         SetActor( SALOME_Actor* );
00094 
00095 private:
00096   SMESH::Predicate_var        myPred;
00097 
00098 public:
00099   DEFINE_STANDARD_RTTI(SMESHGUI_PredicateFilter)
00100 };
00101 
00102 /*
00103   Class       : SMESHGUI_QuadrangleFilter
00104   Description : Verify whether selected cell is quadranle
00105 */
00106 
00107 DEFINE_STANDARD_HANDLE(SMESHGUI_QuadrangleFilter, SMESHGUI_Filter)
00108 
00109 class SMESHGUI_QuadrangleFilter : public SMESHGUI_Filter
00110 {
00111 public:
00112   Standard_EXPORT SMESHGUI_QuadrangleFilter();
00113   Standard_EXPORT virtual ~SMESHGUI_QuadrangleFilter();
00114 
00115   Standard_EXPORT virtual bool IsValid( const int ) const;
00116   Standard_EXPORT virtual bool IsObjValid( const int ) const;
00117   Standard_EXPORT virtual int  GetId() const;
00118   Standard_EXPORT virtual bool IsNodeFilter() const;
00119 
00120 public:
00121   DEFINE_STANDARD_RTTI(SMESHGUI_QuadrangleFilter)
00122 };
00123 
00124 /*
00125   Class       : SMESHGUI_TriangleFilter
00126   Description : Verify whether selected cell is triangle
00127 */
00128 
00129 DEFINE_STANDARD_HANDLE(SMESHGUI_TriangleFilter, SMESHGUI_Filter)
00130 
00131 class SMESHGUI_TriangleFilter : public SMESHGUI_Filter
00132 {
00133 public:
00134   Standard_EXPORT SMESHGUI_TriangleFilter();
00135   Standard_EXPORT virtual ~SMESHGUI_TriangleFilter();
00136 
00137   Standard_EXPORT virtual bool IsValid( const int ) const;
00138   Standard_EXPORT virtual bool IsObjValid( const int ) const;
00139   Standard_EXPORT virtual int  GetId() const;
00140   Standard_EXPORT virtual bool IsNodeFilter() const;  
00141 
00142 public:
00143   DEFINE_STANDARD_RTTI(SMESHGUI_TriangleFilter)
00144 };
00145 
00146 /*
00147   Class       : SMESHGUI_FacesFilter
00148   Description : Verify whether selected cell is any face
00149 */
00150 
00151 DEFINE_STANDARD_HANDLE(SMESHGUI_FacesFilter, SMESHGUI_Filter)
00152 
00153 class SMESHGUI_FacesFilter : public SMESHGUI_Filter
00154 {
00155 public:
00156   Standard_EXPORT SMESHGUI_FacesFilter();
00157   Standard_EXPORT virtual ~SMESHGUI_FacesFilter();
00158 
00159   Standard_EXPORT virtual bool IsValid( const int ) const;
00160   Standard_EXPORT virtual bool IsObjValid( const int ) const;
00161   Standard_EXPORT virtual int  GetId() const;
00162   Standard_EXPORT virtual bool IsNodeFilter() const;  
00163 
00164 public:
00165   DEFINE_STANDARD_RTTI(SMESHGUI_FacesFilter)
00166 };
00167 
00168 /*
00169   Class       : SMESHGUI_VolumesFilter
00170   Description : Verify whether selected cell is any volume
00171 */
00172 
00173 DEFINE_STANDARD_HANDLE(SMESHGUI_VolumesFilter, SMESHGUI_Filter)
00174 
00175 class SMESHGUI_VolumesFilter : public SMESHGUI_Filter
00176 {
00177 public:
00178   Standard_EXPORT SMESHGUI_VolumesFilter();
00179   Standard_EXPORT virtual ~SMESHGUI_VolumesFilter();
00180 
00181   Standard_EXPORT virtual bool IsValid( const int ) const;
00182   Standard_EXPORT virtual bool IsObjValid( const int ) const;
00183   Standard_EXPORT virtual int  GetId() const;
00184   Standard_EXPORT virtual bool IsNodeFilter() const;  
00185 
00186 public:
00187   DEFINE_STANDARD_RTTI(SMESHGUI_VolumesFilter)
00188 };
00189 
00190 #endif // SMESHGUI_FILTER_H