Salome HOME
0021208: Performance issue when loading SMESH with an hdf file containing a big mesh
[modules/smesh.git] / src / SMESH_I / SMESH_Filter_i.hxx
index 9ca20ddb4b32167001eecb11edc797310c9948f0..2930f941db0fa280404b924d4b69b979ada909aa 100644 (file)
@@ -1,23 +1,23 @@
-//  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 //  SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
@@ -39,6 +39,8 @@
 #include "SALOME_GenericObj_i.hh"
 #include "SMESH_ControlsDef.hxx"
 
+#include <list>
+
 class SMESHDS_Mesh;
 
 namespace SMESH
@@ -626,6 +628,57 @@ namespace SMESH
   };
   
   
+  /*
+    Class       : EqualNodes_i
+    Description : Predicate for equal nodes
+  */
+  class SMESH_I_EXPORT EqualNodes_i: public virtual POA_SMESH::EqualNodes,
+                                     public virtual Predicate_i
+  {
+  public:
+    EqualNodes_i();
+    FunctorType                     GetFunctorType();
+    void                            SetTolerance( double );
+    double                          GetTolerance();
+
+  private:
+    Controls::CoincidentNodesPtr myCoincidentNodesPtr;
+  };
+  /*
+    Class       : EqualEdges_i
+    Description : Predicate for equal edges
+  */
+  class SMESH_I_EXPORT EqualEdges_i: public virtual POA_SMESH::EqualEdges,
+                                     public virtual Predicate_i
+  {
+  public:
+    EqualEdges_i();
+    FunctorType                     GetFunctorType();
+  };
+  /*
+    Class       : EqualFaces_i
+    Description : Predicate for equal Faces
+  */
+  class SMESH_I_EXPORT EqualFaces_i: public virtual POA_SMESH::EqualFaces,
+                                     public virtual Predicate_i
+  {
+  public:
+    EqualFaces_i();
+    FunctorType                     GetFunctorType();
+  };
+  /*
+    Class       : EqualVolumes_i
+    Description : Predicate for equal Volumes
+  */
+  class SMESH_I_EXPORT EqualVolumes_i: public virtual POA_SMESH::EqualVolumes,
+                                       public virtual Predicate_i
+  {
+  public:
+    EqualVolumes_i();
+    FunctorType                     GetFunctorType();
+  };
+  
+  
   /*
     Class       : RangeOfIds_i
     Description : Predicate for Range of Ids
@@ -866,7 +919,7 @@ namespace SMESH
     FILTER
   */
   class SMESH_I_EXPORT Filter_i: public virtual POA_SMESH::Filter,
-                  public virtual SALOME::GenericObj_i
+                                 public virtual SALOME::GenericObj_i
   {
   public:
     Filter_i();
@@ -920,11 +973,24 @@ namespace SMESH
     virtual SMESH::long_array*           GetMeshInfo();
     virtual SMESH::array_of_ElementType* GetTypes();
     virtual SMESH::SMESH_Mesh_ptr        GetMesh();
+    virtual bool                         IsMeshInfoCorrect() { return true; }
+
+    /*!
+     * \brief Object notified on change of predicate
+     */
+    struct TPredicateChangeWaiter
+    {
+      virtual void PredicateChanged() = 0;
+    };
+    void AddWaiter( TPredicateChangeWaiter* waiter );
+    void RemoveWaiter( TPredicateChangeWaiter* waiter );
 
   private:
     Controls::Filter myFilter;
     Predicate_i*     myPredicate;
     SMESH_Mesh_var   myMesh;
+
+    std::list<TPredicateChangeWaiter*> myWaiters;
   };
   
   
@@ -932,7 +998,7 @@ namespace SMESH
     FILTER LIBRARY
   */
   class SMESH_I_EXPORT FilterLibrary_i: public virtual POA_SMESH::FilterLibrary,
-                         public virtual SALOME::GenericObj_i
+                                        public virtual SALOME::GenericObj_i
   {
   public:
     FilterLibrary_i( const char* theFileName );
@@ -1002,7 +1068,12 @@ namespace SMESH
     FreeEdges_ptr             CreateFreeEdges();
     FreeNodes_ptr             CreateFreeNodes();
     FreeFaces_ptr             CreateFreeFaces();
-    
+
+    EqualNodes_ptr            CreateEqualNodes();
+    EqualEdges_ptr            CreateEqualEdges();
+    EqualFaces_ptr            CreateEqualFaces();
+    EqualVolumes_ptr          CreateEqualVolumes();
+
     RangeOfIds_ptr            CreateRangeOfIds();
     BadOrientedVolume_ptr     CreateBadOrientedVolume();
     BareBorderFace_ptr        CreateBareBorderFace();
@@ -1032,6 +1103,9 @@ namespace SMESH
   
   Predicate_i* 
   GetPredicate( SMESH::Predicate_ptr thePredicate );
+
+  const char*        FunctorTypeToString(SMESH::FunctorType ft);
+  SMESH::FunctorType StringToFunctorType(const char*       str);
 }