Salome HOME
23368: [CEA 1865] Possibility to define faces to mesh as a single one: transpatch...
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_Filter.h
index 4f912cdb8a78654f2311a5fdb394f9ff978e89dc..ec36f46d6e76900d8eb64f3ccbe901e8eccdc21d 100755 (executable)
@@ -1,53 +1,60 @@
-//  SMESHGUI_Filter : Filters for VTK viewer
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-//  File   : SMESHGUI_Filter.h
-//  Author : Sergey LITONIN
-//  Module : SMESH
 
-#ifndef SMESHGUI_Filter_HeaderFile
-#define SMESHGUI_Filter_HeaderFile
+// SMESHGUI_Filter : Filters for VTK viewer
+// File   : SMESHGUI_Filter.h
+// Author : Sergey LITONIN, Open CASCADE S.A.S.
+//
+#ifndef SMESHGUI_FILTER_H
+#define SMESHGUI_FILTER_H
 
+// SMESH includes
 #include "SMESH_SMESHGUI.hxx"
+#include "SMDSAbs_ElementType.hxx"
 
-#include "VTKViewer_Filter.h"
+// SALOME GUI includes
+#include <VTKViewer_Filter.h>
 
+// IDL includes
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(SMESH_Filter)
 
 class SALOME_Actor;
 
-enum SMESHGUI_FilterType
+namespace SMESH
 {
-  SMESHGUI_UnknownFilter      = -1,
-  SMESHGUI_NodeFilter         =  0,
-  SMESHGUI_EdgeFilter         =  1,
-  SMESHGUI_FaceFilter         =  2,
-  SMESHGUI_VolumeFilter       =  3,
-  SMESHGUI_AllElementsFilter  =  4,
-  SMESHGUI_QuadFilter         =  5,
-  SMESHGUI_TriaFilter         =  6,
-  SMESHGUI_LastFilter
+  enum SMESHGUI_FilterType {
+    UnknownFilter           = -1,
+    NodeFilter              =  0,
+    EdgeFilter              =  1,
+    FaceFilter              =  2,
+    VolumeFilter            =  3,
+    AllElementsFilter       =  4,
+    QuadFilter              =  5,
+    TriaFilter              =  6,
+    FirstGeometryTypeFilter,
+    FirstEntityTypeFilter   = FirstGeometryTypeFilter + SMDSGeom_NONE,
+    LastFilter              = FirstEntityTypeFilter   + SMDSEntity_Last
+  };
 };
 
 /*
@@ -59,12 +66,11 @@ DEFINE_STANDARD_HANDLE(SMESHGUI_Filter, VTKViewer_Filter)
 
 class SMESHGUI_Filter : public VTKViewer_Filter
 {
-
 public:
+  Standard_EXPORT virtual bool IsObjValid( const int ) const = 0;
 
-  virtual bool                IsObjValid( const int theObjId ) const = 0;
 public:
-  DEFINE_STANDARD_RTTI(SMESHGUI_Filter)
+  OCCT_DEFINE_STANDARD_RTTIEXT(SMESHGUI_Filter,VTKViewer_Filter)
 };
 
 /*
@@ -77,25 +83,23 @@ DEFINE_STANDARD_HANDLE(SMESHGUI_PredicateFilter, SMESHGUI_Filter)
 
 class SMESHGUI_PredicateFilter : public SMESHGUI_Filter
 {
-
 public:
-                              SMESHGUI_PredicateFilter();
-  virtual                     ~SMESHGUI_PredicateFilter();
+  Standard_EXPORT SMESHGUI_PredicateFilter();
+  Standard_EXPORT virtual ~SMESHGUI_PredicateFilter();
 
-  virtual bool                IsValid( const int theCellId ) const;
-  virtual bool                IsObjValid( const int theObjId ) const;
-  virtual int                 GetId() const;
-  virtual bool                IsNodeFilter() const;
-  void                        SetPredicate( SMESH::Predicate_ptr );
+  Standard_EXPORT virtual bool IsValid( const int ) const;
+  Standard_EXPORT virtual bool IsObjValid( const int ) const;
+  Standard_EXPORT virtual int  GetId() const;
+  Standard_EXPORT virtual bool IsNodeFilter() const;
+  Standard_EXPORT void         SetPredicate( SMESH::Predicate_ptr );
 
-  void                        SetActor( SALOME_Actor* );
+  Standard_EXPORT void         SetActor( SALOME_Actor* );
 
 private:
-
   SMESH::Predicate_var        myPred;
 
 public:
-  DEFINE_STANDARD_RTTI(SMESHGUI_PredicateFilter)
+  OCCT_DEFINE_STANDARD_RTTIEXT(SMESHGUI_PredicateFilter,SMESHGUI_Filter)
 };
 
 /*
@@ -107,18 +111,17 @@ DEFINE_STANDARD_HANDLE(SMESHGUI_QuadrangleFilter, SMESHGUI_Filter)
 
 class SMESHGUI_QuadrangleFilter : public SMESHGUI_Filter
 {
-
 public:
-                              SMESHGUI_QuadrangleFilter();
-  virtual                     ~SMESHGUI_QuadrangleFilter();
+  Standard_EXPORT SMESHGUI_QuadrangleFilter();
+  Standard_EXPORT virtual ~SMESHGUI_QuadrangleFilter();
 
-  virtual bool                IsValid( const int theCellId ) const;
-  virtual bool                IsObjValid( const int theObjId ) const;
-  virtual int                 GetId() const;
-  virtual bool                IsNodeFilter() const;
+  Standard_EXPORT virtual bool IsValid( const int ) const;
+  Standard_EXPORT virtual bool IsObjValid( const int ) const;
+  Standard_EXPORT virtual int  GetId() const;
+  Standard_EXPORT virtual bool IsNodeFilter() const;
 
 public:
-  DEFINE_STANDARD_RTTI(SMESHGUI_QuadrangleFilter)
+  OCCT_DEFINE_STANDARD_RTTIEXT(SMESHGUI_QuadrangleFilter,SMESHGUI_Filter)
 };
 
 /*
@@ -130,18 +133,17 @@ DEFINE_STANDARD_HANDLE(SMESHGUI_TriangleFilter, SMESHGUI_Filter)
 
 class SMESHGUI_TriangleFilter : public SMESHGUI_Filter
 {
-
 public:
-                              SMESHGUI_TriangleFilter();
-  virtual                     ~SMESHGUI_TriangleFilter();
+  Standard_EXPORT SMESHGUI_TriangleFilter();
+  Standard_EXPORT virtual ~SMESHGUI_TriangleFilter();
 
-  virtual bool                IsValid( const int theCellId ) const;
-  virtual bool                IsObjValid( const int theObjId ) const;
-  virtual int                 GetId() const;
-  virtual bool                IsNodeFilter() const;  
+  Standard_EXPORT virtual bool IsValid( const int ) const;
+  Standard_EXPORT virtual bool IsObjValid( const int ) const;
+  Standard_EXPORT virtual int  GetId() const;
+  Standard_EXPORT virtual bool IsNodeFilter() const;  
 
 public:
-  DEFINE_STANDARD_RTTI(SMESHGUI_TriangleFilter)
+  OCCT_DEFINE_STANDARD_RTTIEXT(SMESHGUI_TriangleFilter,SMESHGUI_Filter)
 };
 
 /*
@@ -153,18 +155,17 @@ DEFINE_STANDARD_HANDLE(SMESHGUI_FacesFilter, SMESHGUI_Filter)
 
 class SMESHGUI_FacesFilter : public SMESHGUI_Filter
 {
-
 public:
-                              SMESHGUI_FacesFilter();
-  virtual                     ~SMESHGUI_FacesFilter();
+  Standard_EXPORT SMESHGUI_FacesFilter();
+  Standard_EXPORT virtual ~SMESHGUI_FacesFilter();
 
-  virtual bool                IsValid( const int theCellId ) const;
-  virtual bool                IsObjValid( const int theObjId ) const;
-  virtual int                 GetId() const;
-  virtual bool                IsNodeFilter() const;  
+  Standard_EXPORT virtual bool IsValid( const int ) const;
+  Standard_EXPORT virtual bool IsObjValid( const int ) const;
+  Standard_EXPORT virtual int  GetId() const;
+  Standard_EXPORT virtual bool IsNodeFilter() const;  
 
 public:
-  DEFINE_STANDARD_RTTI(SMESHGUI_FacesFilter)
+  OCCT_DEFINE_STANDARD_RTTIEXT(SMESHGUI_FacesFilter,SMESHGUI_Filter)
 };
 
 /*
@@ -176,18 +177,41 @@ DEFINE_STANDARD_HANDLE(SMESHGUI_VolumesFilter, SMESHGUI_Filter)
 
 class SMESHGUI_VolumesFilter : public SMESHGUI_Filter
 {
+public:
+  Standard_EXPORT SMESHGUI_VolumesFilter();
+  Standard_EXPORT virtual ~SMESHGUI_VolumesFilter();
 
+  Standard_EXPORT virtual bool IsValid( const int ) const;
+  Standard_EXPORT virtual bool IsObjValid( const int ) const;
+  Standard_EXPORT virtual int  GetId() const;
+  Standard_EXPORT virtual bool IsNodeFilter() const;
+
+public:
+  OCCT_DEFINE_STANDARD_RTTIEXT(SMESHGUI_VolumesFilter,SMESHGUI_Filter)
+};
+
+/*
+  Class       : SMESHGUI_VolumeShapeFilter
+  Description : Verify whether selected cell is a volume of a certain shape
+*/
+
+DEFINE_STANDARD_HANDLE(SMESHGUI_VolumeShapeFilter, SMESHGUI_Filter)
+
+class SMESHGUI_VolumeShapeFilter : public SMESHGUI_Filter
+{
+  SMDSAbs_GeometryType myGeometryType;
 public:
-                              SMESHGUI_VolumesFilter();
-  virtual                     ~SMESHGUI_VolumesFilter();
+  Standard_EXPORT SMESHGUI_VolumeShapeFilter(const SMDSAbs_GeometryType shape);
+
+  Standard_EXPORT virtual bool IsValid( const int ) const;
+  Standard_EXPORT virtual bool IsObjValid( const int ) const;
+  Standard_EXPORT virtual int  GetId() const;
+  Standard_EXPORT virtual bool IsNodeFilter() const;
 
-  virtual bool                IsValid( const int theCellId ) const;
-  virtual bool                IsObjValid( const int theObjId ) const;
-  virtual int                 GetId() const;
-  virtual bool                IsNodeFilter() const;  
+  Standard_EXPORT static int GetId( SMDSAbs_GeometryType geom );
 
 public:
-  DEFINE_STANDARD_RTTI(SMESHGUI_VolumesFilter)
+  OCCT_DEFINE_STANDARD_RTTIEXT(SMESHGUI_VolumeShapeFilter,SMESHGUI_Filter)
 };
 
-#endif
+#endif // SMESHGUI_FILTER_H