Back to index

salome-smesh  6.5.0
SMESH_Filter_i.hxx
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 //  SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
00024 //  File   : SMESH_Filter_i.hxx
00025 //  Author : Alexey Petrov, OCC
00026 //  Module : SMESH
00027 //
00028 #ifndef _SMESH_FILTER_I_HXX_
00029 #define _SMESH_FILTER_I_HXX_
00030 
00031 #include "SMESH.hxx"
00032 
00033 #include <SALOMEconfig.h>
00034 #include CORBA_SERVER_HEADER(SMESH_Filter)
00035 
00036 #include <LDOM_Document.hxx>
00037 #include <TopoDS_Shape.hxx>
00038 
00039 #include "SALOME_GenericObj_i.hh"
00040 #include "SMESH_ControlsDef.hxx"
00041 
00042 #include <list>
00043 
00044 class SMESHDS_Mesh;
00045 
00046 namespace SMESH
00047 {
00048 
00049   // ================================================================================
00050   namespace Controls
00051   {
00052 
00053     /*
00054       Class       : BelongToGeom
00055       Description : Predicate for verifying whether entiy belong to
00056       specified geometrical support
00057     */
00058     class SMESH_I_EXPORT BelongToGeom: public virtual Predicate
00059     {
00060     public:
00061       BelongToGeom();
00062 
00063       virtual void                    SetMesh( const SMDS_Mesh* theMesh );
00064       virtual void                    SetGeom( const TopoDS_Shape& theShape );
00065 
00066       virtual bool                    IsSatisfy( long theElementId );
00067 
00068       virtual void                    SetType( SMDSAbs_ElementType theType );
00069       virtual                         SMDSAbs_ElementType GetType() const;
00070 
00071       TopoDS_Shape                    GetShape();
00072       const SMESHDS_Mesh*             GetMeshDS() const;
00073 
00074       void                            SetTolerance( double );
00075       double                          GetTolerance();
00076 
00077     private:
00078       virtual void                    init();
00079 
00080       TopoDS_Shape                    myShape;
00081       const SMESHDS_Mesh*             myMeshDS;
00082       SMDSAbs_ElementType             myType;
00083       bool                            myIsSubshape;
00084       double                          myTolerance;          // only if myIsSubshape == false
00085       Controls::ElementsOnShapePtr    myElementsOnShapePtr; // only if myIsSubshape == false
00086     };
00087     typedef boost::shared_ptr<BelongToGeom> BelongToGeomPtr;
00088 
00089     /*
00090       Class       : LyingOnGeom
00091       Description : Predicate for verifying whether entiy lying or partially lying on
00092       specified geometrical support
00093     */
00094     class SMESH_I_EXPORT LyingOnGeom: public virtual Predicate
00095     {
00096     public:
00097       LyingOnGeom();
00098       
00099       virtual void                    SetMesh( const SMDS_Mesh* theMesh );
00100       virtual void                    SetGeom( const TopoDS_Shape& theShape );
00101       
00102       virtual bool                    IsSatisfy( long theElementId );
00103       
00104       virtual void                    SetType( SMDSAbs_ElementType theType );
00105       virtual                         SMDSAbs_ElementType GetType() const;
00106       
00107       TopoDS_Shape                    GetShape();
00108       const SMESHDS_Mesh*             GetMeshDS() const;
00109 
00110       void                            SetTolerance( double );
00111       double                          GetTolerance();
00112       
00113       virtual bool                    Contains( const SMESHDS_Mesh*     theMeshDS,
00114                                                 const TopoDS_Shape&     theShape,
00115                                                 const SMDS_MeshElement* theElem,
00116                                                 TopAbs_ShapeEnum        theFindShapeEnum,
00117                                                 TopAbs_ShapeEnum        theAvoidShapeEnum = TopAbs_SHAPE );
00118     private:
00119       virtual void                    init();
00120 
00121       TopoDS_Shape                    myShape;
00122       const SMESHDS_Mesh*             myMeshDS;
00123       SMDSAbs_ElementType             myType;
00124       bool                            myIsSubshape;
00125       double                          myTolerance;          // only if myIsSubshape == false
00126       Controls::ElementsOnShapePtr    myElementsOnShapePtr; // only if myIsSubshape == false
00127     };
00128     typedef boost::shared_ptr<LyingOnGeom> LyingOnGeomPtr;
00129 
00130   } // namespace Controls
00131 
00132   // ================================================================================
00133   /*
00134     FUNCTORS
00135   */
00136   
00137   /*
00138     Class       : Functor_i
00139     Description : An abstact class for all functors 
00140   */
00141   class SMESH_I_EXPORT Functor_i: public virtual POA_SMESH::Functor,
00142                    public virtual SALOME::GenericObj_i
00143   {
00144   public:
00145     void                            SetMesh( SMESH_Mesh_ptr theMesh );
00146     Controls::FunctorPtr            GetFunctor(){ return myFunctorPtr;}
00147     ElementType                     GetElementType();
00148     
00149   protected:
00150     Functor_i();
00151     ~Functor_i();
00152   protected:                                
00153     Controls::FunctorPtr            myFunctorPtr;
00154   };
00155   
00156   /*
00157     Class       : NumericalFunctor_i
00158     Description : Base class for numerical functors 
00159   */
00160   class SMESH_I_EXPORT NumericalFunctor_i: public virtual POA_SMESH::NumericalFunctor,
00161                             public virtual Functor_i
00162   {
00163   public:
00164     CORBA::Double                   GetValue( CORBA::Long theElementId );
00165     SMESH::Histogram*               GetHistogram(CORBA::Short nbIntervals);
00166     void                            SetPrecision( CORBA::Long thePrecision );
00167     CORBA::Long                     GetPrecision();
00168     Controls::NumericalFunctorPtr   GetNumericalFunctor();
00169     
00170   protected:
00171     Controls::NumericalFunctorPtr   myNumericalFunctorPtr;
00172   };
00173   
00174   
00175   /*
00176     Class       : SMESH_MinimumAngleFunct
00177     Description : Functor for calculation of minimum angle
00178   */
00179   class SMESH_I_EXPORT MinimumAngle_i: public virtual POA_SMESH::MinimumAngle,
00180                         public virtual NumericalFunctor_i
00181   {
00182   public:
00183     MinimumAngle_i();
00184     FunctorType                     GetFunctorType();
00185   };
00186   
00187   
00188   /*
00189     Class       : AspectRatio_i
00190     Description : Functor for calculating aspect ratio
00191   */
00192   class SMESH_I_EXPORT AspectRatio_i: public virtual POA_SMESH::AspectRatio,
00193                        public virtual NumericalFunctor_i
00194   {
00195   public:
00196     AspectRatio_i();
00197     FunctorType                     GetFunctorType();
00198   };
00199   
00200   
00201   /*
00202     Class       : AspectRatio3D_i
00203     Description : Functor for calculating aspect ratio for 3D
00204   */
00205   class SMESH_I_EXPORT AspectRatio3D_i: public virtual POA_SMESH::AspectRatio3D,
00206                          public virtual NumericalFunctor_i
00207   {
00208   public:
00209     AspectRatio3D_i();
00210     FunctorType                     GetFunctorType();
00211   };
00212   
00213 
00214   /*
00215     Class       : Warping_i
00216     Description : Functor for calculating warping
00217   */
00218   class SMESH_I_EXPORT Warping_i: public virtual POA_SMESH::Warping,
00219                    public virtual NumericalFunctor_i
00220   {
00221   public:
00222     Warping_i();
00223     FunctorType                     GetFunctorType();
00224   };
00225   
00226   
00227   /*
00228     Class       : Taper_i
00229     Description : Functor for calculating taper
00230   */
00231   class SMESH_I_EXPORT Taper_i: public virtual POA_SMESH::Taper,
00232                  public virtual NumericalFunctor_i
00233   {
00234   public:
00235     Taper_i();
00236     FunctorType                     GetFunctorType();
00237   };
00238   
00239   
00240   /*
00241     Class       : Skew_i
00242     Description : Functor for calculating skew in degrees
00243   */
00244   class SMESH_I_EXPORT Skew_i: public virtual POA_SMESH::Skew,
00245                 public virtual NumericalFunctor_i
00246   {
00247   public:
00248     Skew_i();
00249     FunctorType                     GetFunctorType();
00250   };
00251   
00252   
00253   /*
00254     Class       : Area_i
00255     Description : Functor for calculating area
00256   */
00257   class SMESH_I_EXPORT Area_i: public virtual POA_SMESH::Area,
00258                 public virtual NumericalFunctor_i
00259   {
00260   public:
00261     Area_i();
00262     FunctorType                     GetFunctorType();
00263   };
00264   
00265   
00266   /*
00267     Class       : Volume3D_i
00268     Description : Functor for calculating volume of 3D element
00269   */
00270   class SMESH_I_EXPORT Volume3D_i: public virtual POA_SMESH::Volume3D,
00271                     public virtual NumericalFunctor_i
00272   {
00273   public:
00274     Volume3D_i();
00275     FunctorType                     GetFunctorType();
00276   };
00277   
00278   
00279   /*
00280     Class       : MaxElementLength2D_i
00281     Description : Functor for calculating maximum length of 2D element
00282   */
00283   class SMESH_I_EXPORT MaxElementLength2D_i: public virtual POA_SMESH::MaxElementLength2D,
00284                                              public virtual NumericalFunctor_i
00285   {
00286   public:
00287     MaxElementLength2D_i();
00288     FunctorType                     GetFunctorType();
00289   };
00290   
00291   
00292   /*
00293     Class       : MaxElementLength3D_i
00294     Description : Functor for calculating maximum length of 3D element
00295   */
00296   class SMESH_I_EXPORT MaxElementLength3D_i: public virtual POA_SMESH::MaxElementLength3D,
00297                                              public virtual NumericalFunctor_i
00298   {
00299   public:
00300     MaxElementLength3D_i();
00301     FunctorType                     GetFunctorType();
00302   };
00303   
00304   
00305   /*
00306     Class       : Length_i
00307     Description : Functor for calculating length of edge
00308   */
00309   class SMESH_I_EXPORT Length_i: public virtual POA_SMESH::Length,
00310                   public virtual NumericalFunctor_i
00311   {
00312   public:
00313     Length_i();
00314     FunctorType                     GetFunctorType();
00315   };
00316   
00317   /*
00318     Class       : Length2D_i
00319     Description : Functor for calculating length of edge
00320   */
00321   class SMESH_I_EXPORT Length2D_i: public virtual POA_SMESH::Length2D,
00322                     public virtual NumericalFunctor_i
00323   {
00324   public:
00325     Length2D_i();
00326     SMESH::Length2D::Values*        GetValues();
00327     FunctorType                     GetFunctorType();
00328     
00329   protected:
00330     Controls::Length2DPtr          myLength2DPtr;
00331   };
00332   
00333   
00334   /*
00335     Class       : MultiConnection_i
00336     Description : Functor for calculating number of faces conneted to the edge
00337   */
00338   class SMESH_I_EXPORT MultiConnection_i: public virtual POA_SMESH::MultiConnection,
00339                            public virtual NumericalFunctor_i
00340   {
00341   public:
00342     MultiConnection_i();
00343     FunctorType                     GetFunctorType();
00344   };
00345   
00346   /*
00347     Class       : MultiConnection2D_i
00348     Description : Functor for calculating number of faces conneted to the edge
00349   */
00350   class SMESH_I_EXPORT MultiConnection2D_i: public virtual POA_SMESH::MultiConnection2D,
00351                              public virtual NumericalFunctor_i
00352   {
00353   public:
00354     MultiConnection2D_i();
00355     SMESH::MultiConnection2D::Values*  GetValues();
00356     FunctorType                        GetFunctorType();
00357     
00358   protected:
00359     Controls::MultiConnection2DPtr     myMulticonnection2DPtr;
00360   };
00361   
00362   
00363   /*
00364     PREDICATES
00365   */
00366   /*
00367     Class       : Predicate_i
00368     Description : Base class for all predicates
00369   */
00370   class SMESH_I_EXPORT Predicate_i: public virtual POA_SMESH::Predicate,
00371                      public virtual Functor_i
00372   {
00373   public:
00374     CORBA::Boolean                  IsSatisfy( CORBA::Long theElementId );
00375     Controls::PredicatePtr          GetPredicate();
00376     
00377   protected:
00378     Controls::PredicatePtr          myPredicatePtr;
00379   };
00380   
00381   
00382   /*
00383     Class       : BadOrientedVolume_i
00384     Description : Verify whether a mesh volume is incorrectly oriented from
00385     the point of view of MED convention
00386   */
00387   class SMESH_I_EXPORT BadOrientedVolume_i: public virtual POA_SMESH::BadOrientedVolume,
00388                              public virtual Predicate_i
00389   {
00390   public:
00391     BadOrientedVolume_i();
00392     FunctorType                     GetFunctorType();
00393   };
00394   
00395   /*
00396     Class       : BareBorderVolume_i
00397     Description : Verify whether a mesh volume has a free facet without a face on it
00398   */
00399   class SMESH_I_EXPORT BareBorderVolume_i: public virtual POA_SMESH::BareBorderVolume,
00400                                            public virtual Predicate_i
00401   {
00402   public:
00403     BareBorderVolume_i();
00404     FunctorType                     GetFunctorType();
00405   };
00406   
00407   /*
00408     Class       : BareBorderFace_i
00409     Description : Verify whether a mesh face has a free border without an edge on it
00410   */
00411   class SMESH_I_EXPORT BareBorderFace_i: public virtual POA_SMESH::BareBorderFace,
00412                                            public virtual Predicate_i
00413   {
00414   public:
00415     BareBorderFace_i();
00416     FunctorType                     GetFunctorType();
00417   };
00418   
00419   /*
00420     Class       : OverConstrainedVolume_i
00421     Description : Verify whether a mesh volume has only one facet shared with other volumes
00422   */
00423   class SMESH_I_EXPORT OverConstrainedVolume_i: public virtual POA_SMESH::OverConstrainedVolume,
00424                                            public virtual Predicate_i
00425   {
00426   public:
00427     OverConstrainedVolume_i();
00428     FunctorType                     GetFunctorType();
00429   };
00430   
00431   /*
00432     Class       : OverConstrainedFace_i
00433     Description : Verify whether a mesh face has only one border shared with other faces
00434   */
00435   class SMESH_I_EXPORT OverConstrainedFace_i: public virtual POA_SMESH::OverConstrainedFace,
00436                                            public virtual Predicate_i
00437   {
00438   public:
00439     OverConstrainedFace_i();
00440     FunctorType                     GetFunctorType();
00441   };
00442   
00443   /*
00444     Class       : BelongToGeom_i
00445     Description : Predicate for selection on geometrical support
00446   */
00447   class SMESH_I_EXPORT BelongToGeom_i: public virtual POA_SMESH::BelongToGeom,
00448                         public virtual Predicate_i
00449   {
00450   public:
00451     BelongToGeom_i();
00452     virtual                         ~BelongToGeom_i();
00453     
00454     void                            SetGeom( GEOM::GEOM_Object_ptr theGeom );
00455     void                            SetElementType( ElementType theType );
00456     FunctorType                     GetFunctorType();
00457     
00458     void                            SetGeom( const TopoDS_Shape& theShape );
00459     
00460     void                            SetShapeName( const char* theName );
00461     void                            SetShape( const char* theID, const char* theName );
00462     char*                           GetShapeName();
00463     char*                           GetShapeID();
00464 
00465     void                            SetTolerance( CORBA::Double );
00466     CORBA::Double                   GetTolerance();
00467     
00468   protected:
00469     Controls::BelongToGeomPtr       myBelongToGeomPtr;
00470     char*                           myShapeName;
00471     char*                           myShapeID;
00472   };
00473   
00474   /*
00475     Class       : BelongToSurface_i
00476     Description : Verify whether mesh element lie in pointed Geom planar object
00477   */
00478   class SMESH_I_EXPORT BelongToSurface_i: public virtual POA_SMESH::BelongToSurface,
00479                            public virtual Predicate_i
00480   {
00481   public:
00482     BelongToSurface_i( const Handle(Standard_Type)& );
00483     virtual                         ~BelongToSurface_i();
00484     
00485     void                            SetSurface( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
00486     
00487     void                            SetShapeName( const char* theName, ElementType theType );
00488     void                            SetShape( const char* theID, const char* theName, ElementType theType );
00489     char*                           GetShapeName();
00490     char*                           GetShapeID();
00491 
00492     void                            SetTolerance( CORBA::Double );
00493     CORBA::Double                   GetTolerance();
00494     
00495     void                            SetUseBoundaries( CORBA::Boolean theUseBndRestrictions );
00496     CORBA::Boolean                  GetUseBoundaries();
00497 
00498   protected:
00499     Controls::ElementsOnSurfacePtr  myElementsOnSurfacePtr;
00500     char*                           myShapeName;
00501     char*                           myShapeID;
00502     Handle(Standard_Type)           mySurfaceType;
00503   };
00504   
00505   /*
00506     Class       : BelongToPlane_i
00507     Description : Verify whether mesh element lie in pointed Geom planar object
00508   */
00509   class SMESH_I_EXPORT BelongToPlane_i: public virtual POA_SMESH::BelongToPlane,
00510                          public virtual BelongToSurface_i
00511   {
00512   public:
00513     BelongToPlane_i();
00514     void                            SetPlane( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
00515     FunctorType                     GetFunctorType();
00516   };
00517   
00518   /*
00519     Class       : BelongToCylinder_i
00520     Description : Verify whether mesh element lie in pointed Geom cylindrical object
00521   */
00522   class SMESH_I_EXPORT BelongToCylinder_i: public virtual POA_SMESH::BelongToCylinder,
00523                             public virtual BelongToSurface_i
00524   {
00525   public:
00526     BelongToCylinder_i();
00527     void                            SetCylinder( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
00528     FunctorType                     GetFunctorType();
00529   };
00530 
00531   /*
00532     Class       : BelongToGenSurface_i
00533     Description : Verify whether mesh element lie on pointed Geom surfasic object
00534   */
00535   class BelongToGenSurface_i: public virtual POA_SMESH::BelongToGenSurface,
00536                               public virtual BelongToSurface_i
00537   {
00538   public:
00539     BelongToGenSurface_i();
00540     void                            SetSurface( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
00541     FunctorType                     GetFunctorType();
00542   };
00543   
00544   /*
00545     Class       : LyingOnGeom_i
00546     Description : Predicate for selection on geometrical support(lying or partially lying)
00547   */
00548   class SMESH_I_EXPORT LyingOnGeom_i: public virtual POA_SMESH::LyingOnGeom,
00549                        public virtual Predicate_i
00550   {
00551   public:
00552     LyingOnGeom_i();
00553     virtual                         ~LyingOnGeom_i();
00554     
00555     void                            SetGeom( GEOM::GEOM_Object_ptr theGeom );
00556     void                            SetElementType( ElementType theType );
00557     FunctorType                     GetFunctorType();
00558     
00559     void                            SetGeom( const TopoDS_Shape& theShape );
00560     
00561     void                            SetShapeName( const char* theName );
00562     void                            SetShape( const char* theID, const char* theName );
00563     char*                           GetShapeName();
00564     char*                           GetShapeID();
00565 
00566     void                            SetTolerance( CORBA::Double );
00567     CORBA::Double                   GetTolerance();
00568     
00569   protected:
00570     Controls::LyingOnGeomPtr        myLyingOnGeomPtr;
00571     char*                           myShapeName;
00572     char*                           myShapeID;
00573   };
00574   
00575   /*
00576     Class       : FreeBorders_i
00577     Description : Predicate for free borders
00578   */
00579   class SMESH_I_EXPORT FreeBorders_i: public virtual POA_SMESH::FreeBorders,
00580                        public virtual Predicate_i
00581   {
00582   public:
00583     FreeBorders_i();
00584     FunctorType                     GetFunctorType();
00585   };
00586   
00587   
00588   /*
00589     Class       : FreeEdges_i
00590     Description : Predicate for free edges
00591   */
00592   class SMESH_I_EXPORT FreeEdges_i: public virtual POA_SMESH::FreeEdges,
00593                      public virtual Predicate_i
00594   {
00595   public:
00596     FreeEdges_i();
00597     SMESH::FreeEdges::Borders*      GetBorders();
00598     FunctorType                     GetFunctorType();
00599     
00600   protected:
00601     Controls::FreeEdgesPtr          myFreeEdgesPtr;
00602   };
00603   
00604 
00605   /*
00606     Class       : FreeFaces_i
00607     Description : Predicate for free faces
00608   */
00609   class SMESH_I_EXPORT FreeFaces_i: public virtual POA_SMESH::FreeFaces,
00610                        public virtual Predicate_i
00611   {
00612   public:
00613     FreeFaces_i();
00614     FunctorType                     GetFunctorType();
00615   };
00616   
00617 
00618   /*
00619     Class       : FreeNodes_i
00620     Description : Predicate for free nodes
00621   */
00622   class SMESH_I_EXPORT FreeNodes_i: public virtual POA_SMESH::FreeNodes,
00623                        public virtual Predicate_i
00624   {
00625   public:
00626     FreeNodes_i();
00627     FunctorType                     GetFunctorType();
00628   };
00629   
00630   
00631   /*
00632     Class       : EqualNodes_i
00633     Description : Predicate for equal nodes
00634   */
00635   class SMESH_I_EXPORT EqualNodes_i: public virtual POA_SMESH::EqualNodes,
00636                                      public virtual Predicate_i
00637   {
00638   public:
00639     EqualNodes_i();
00640     FunctorType                     GetFunctorType();
00641     void                            SetTolerance( double );
00642     double                          GetTolerance();
00643 
00644   private:
00645     Controls::CoincidentNodesPtr myCoincidentNodesPtr;
00646   };
00647   /*
00648     Class       : EqualEdges_i
00649     Description : Predicate for equal edges
00650   */
00651   class SMESH_I_EXPORT EqualEdges_i: public virtual POA_SMESH::EqualEdges,
00652                                      public virtual Predicate_i
00653   {
00654   public:
00655     EqualEdges_i();
00656     FunctorType                     GetFunctorType();
00657   };
00658   /*
00659     Class       : EqualFaces_i
00660     Description : Predicate for equal Faces
00661   */
00662   class SMESH_I_EXPORT EqualFaces_i: public virtual POA_SMESH::EqualFaces,
00663                                      public virtual Predicate_i
00664   {
00665   public:
00666     EqualFaces_i();
00667     FunctorType                     GetFunctorType();
00668   };
00669   /*
00670     Class       : EqualVolumes_i
00671     Description : Predicate for equal Volumes
00672   */
00673   class SMESH_I_EXPORT EqualVolumes_i: public virtual POA_SMESH::EqualVolumes,
00674                                        public virtual Predicate_i
00675   {
00676   public:
00677     EqualVolumes_i();
00678     FunctorType                     GetFunctorType();
00679   };
00680   
00681   
00682   /*
00683     Class       : RangeOfIds_i
00684     Description : Predicate for Range of Ids
00685   */
00686   class SMESH_I_EXPORT RangeOfIds_i: public virtual POA_SMESH::RangeOfIds,
00687                       public virtual Predicate_i
00688   {
00689   public:
00690     RangeOfIds_i();
00691     void                            SetRange( const SMESH::long_array& theIds );
00692     CORBA::Boolean                  SetRangeStr( const char* theRange );
00693     char*                           GetRangeStr();
00694     
00695     void                            SetElementType( ElementType theType );
00696     FunctorType                     GetFunctorType();
00697     
00698   protected:
00699     Controls::RangeOfIdsPtr         myRangeOfIdsPtr;
00700   };
00701 
00702   /*
00703     Class       : LinearOrQuadratic_i
00704     Description : Verify whether a mesh element is linear
00705   */
00706   class SMESH_I_EXPORT LinearOrQuadratic_i: public virtual POA_SMESH::LinearOrQuadratic,
00707                              public virtual Predicate_i
00708   {
00709   public:
00710     LinearOrQuadratic_i();
00711     FunctorType                    GetFunctorType();
00712     void                           SetElementType( ElementType theType );
00713 
00714   private:
00715    Controls::LinearOrQuadraticPtr  myLinearOrQuadraticPtr;
00716   };
00717   
00718   /*
00719     Class       : GroupColor_i
00720     Description : Functor for check color of group to whic mesh element belongs to
00721   */
00722   class SMESH_I_EXPORT GroupColor_i: public virtual POA_SMESH::GroupColor,
00723                   public virtual Predicate_i
00724   {
00725   public:
00726     GroupColor_i();
00727     FunctorType             GetFunctorType();
00728 
00729     void                    SetElementType( ElementType theType );
00730     void                    SetColorStr( const char* theColor );
00731     char*                   GetColorStr();
00732 
00733   private:
00734     Controls::GroupColorPtr myGroupColorPtr;
00735   };
00736   
00737   /*
00738     Class       : ElemGeomType_i
00739     Description : Functor for check element geometry type
00740   */
00741   class SMESH_I_EXPORT ElemGeomType_i: public virtual POA_SMESH::ElemGeomType,
00742                   public virtual Predicate_i
00743   {
00744   public:
00745     ElemGeomType_i();
00746     FunctorType             GetFunctorType();
00747 
00748     void                    SetElementType ( ElementType  theType );
00749     void                    SetGeometryType( GeometryType theType );
00750     GeometryType            GetGeometryType() const;
00751 
00752   private:
00753     Controls::ElemGeomTypePtr myElemGeomTypePtr;
00754   };
00755   
00756   /*
00757     Class       : CoplanarFaces_i
00758     Description : Returns true if a mesh face is a coplanar neighbour to a given one
00759   */
00760   class SMESH_I_EXPORT CoplanarFaces_i: public virtual POA_SMESH::CoplanarFaces,
00761                   public virtual Predicate_i
00762   {
00763   public:
00764     CoplanarFaces_i();
00765     FunctorType             GetFunctorType();
00766 
00767     void                    SetFace ( CORBA::Long theFaceID );
00768     void                    SetTolerance( CORBA::Double theToler );
00769     char*                   GetFaceAsString () const;
00770     CORBA::Long             GetFace () const;
00771     CORBA::Double           GetTolerance () const;
00772   private:
00773     Controls::CoplanarFacesPtr myCoplanarFacesPtr;
00774   };
00775   
00776   /*
00777     Class       : Comparator_i
00778     Description : Base class for comparators
00779   */
00780   class SMESH_I_EXPORT Comparator_i: public virtual POA_SMESH::Comparator,
00781                       public virtual Predicate_i
00782   {
00783   public:
00784     virtual                         ~Comparator_i();
00785     
00786     virtual void                    SetMargin( CORBA::Double );
00787     virtual void                    SetNumFunctor( NumericalFunctor_ptr );
00788     
00789     Controls::ComparatorPtr         GetComparator();
00790     NumericalFunctor_i*             GetNumFunctor_i();
00791     CORBA::Double                   GetMargin();
00792     
00793   protected:
00794     Comparator_i();
00795   protected:                                  
00796     Controls::ComparatorPtr         myComparatorPtr;
00797     NumericalFunctor_i*             myNumericalFunctor;
00798   };
00799   
00800   
00801   /*
00802     Class       : LessThan_i
00803     Description : Comparator "<"
00804   */
00805   class SMESH_I_EXPORT LessThan_i: public virtual POA_SMESH::LessThan,
00806                     public virtual Comparator_i
00807   {
00808   public:
00809     LessThan_i();
00810     FunctorType                     GetFunctorType();
00811   };
00812   
00813   
00814   /*
00815     Class       : MoreThan_i
00816     Description : Comparator ">"
00817   */
00818   class SMESH_I_EXPORT MoreThan_i: public virtual POA_SMESH::MoreThan,
00819                     public virtual Comparator_i
00820   {
00821   public:
00822     MoreThan_i();
00823     FunctorType                     GetFunctorType();
00824   };
00825   
00826   
00827   /*
00828     Class       : EqualTo_i
00829     Description : Comparator "="
00830   */
00831   class SMESH_I_EXPORT EqualTo_i: public virtual POA_SMESH::EqualTo,
00832                    public virtual Comparator_i
00833   {
00834   public:
00835     EqualTo_i();
00836     virtual void                    SetTolerance( CORBA::Double );
00837     CORBA::Double                   GetTolerance();
00838     FunctorType                     GetFunctorType();
00839     
00840   protected:
00841     Controls::EqualToPtr            myEqualToPtr;
00842   };
00843   
00844   
00845   /*
00846     Class       : LogicalNOT_i
00847     Description : Logical NOT predicate
00848   */
00849   class SMESH_I_EXPORT LogicalNOT_i: public virtual POA_SMESH::LogicalNOT,
00850                       public virtual Predicate_i
00851   {
00852   public:
00853     LogicalNOT_i();
00854   virtual                         ~LogicalNOT_i();
00855     
00856     virtual void                    SetPredicate( Predicate_ptr );
00857     Predicate_i*                    GetPredicate_i();
00858     FunctorType                     GetFunctorType();
00859     
00860   protected:
00861     Controls::LogicalNOTPtr         myLogicalNOTPtr;
00862     Predicate_i*                    myPredicate;
00863   };
00864   
00865   
00866   /*
00867     Class       : LogicalBinary_i
00868     Description : Base class for binary logical predicate
00869   */
00870   class SMESH_I_EXPORT LogicalBinary_i: public virtual POA_SMESH::LogicalBinary,
00871                          public virtual Predicate_i
00872   {
00873   public:
00874     virtual                         ~LogicalBinary_i();
00875     virtual void                    SetMesh( SMESH_Mesh_ptr theMesh );
00876     virtual void                    SetPredicate1( Predicate_ptr );
00877     virtual void                    SetPredicate2( Predicate_ptr );
00878     
00879     Controls::LogicalBinaryPtr      GetLogicalBinary();
00880     Predicate_i*                    GetPredicate1_i();
00881     Predicate_i*                    GetPredicate2_i();
00882     
00883   protected:
00884     LogicalBinary_i();
00885   protected:  
00886     Controls::LogicalBinaryPtr      myLogicalBinaryPtr;
00887     Predicate_i*                    myPredicate1;
00888     Predicate_i*                    myPredicate2;
00889   };
00890   
00891   
00892   /*
00893     Class       : LogicalAND_i
00894     Description : Logical AND
00895   */
00896   class SMESH_I_EXPORT LogicalAND_i: public virtual POA_SMESH::LogicalAND,
00897                       public virtual LogicalBinary_i
00898   {
00899   public:
00900     LogicalAND_i();
00901     FunctorType                     GetFunctorType();
00902   };
00903   
00904   
00905   /*
00906     Class       : LogicalOR_i
00907     Description : Logical OR
00908   */
00909   class SMESH_I_EXPORT LogicalOR_i: public virtual POA_SMESH::LogicalOR,
00910                      public virtual LogicalBinary_i
00911   {
00912   public:
00913     LogicalOR_i();
00914     FunctorType                     GetFunctorType();
00915   };
00916   
00917   
00918   /*
00919     FILTER
00920   */
00921   class SMESH_I_EXPORT Filter_i: public virtual POA_SMESH::Filter,
00922                                  public virtual SALOME::GenericObj_i
00923   {
00924   public:
00925     Filter_i();
00926     ~Filter_i();
00927     
00928     virtual
00929     void
00930     SetPredicate( Predicate_ptr );
00931 
00932     virtual
00933     void
00934     SetMesh( SMESH_Mesh_ptr );
00935 
00936     static
00937     void
00938     GetElementsId( Predicate_i*,
00939                    const SMDS_Mesh*,
00940                    Controls::Filter::TIdSequence& );
00941     static
00942     void           
00943     GetElementsId( Predicate_i*,
00944                    SMESH_Mesh_ptr,
00945                    Controls::Filter::TIdSequence& );
00946     
00947     virtual
00948     long_array*      
00949     GetElementsId( SMESH_Mesh_ptr );
00950 
00951     virtual
00952     ElementType      
00953     GetElementType();
00954     
00955     virtual
00956     CORBA::Boolean   
00957     GetCriteria( SMESH::Filter::Criteria_out theCriteria );
00958 
00959     virtual
00960     CORBA::Boolean
00961     SetCriteria( const SMESH::Filter::Criteria& theCriteria );
00962     
00963     virtual
00964     Predicate_ptr
00965     GetPredicate();
00966 
00967     Predicate_i*     GetPredicate_i();
00968 
00969     // =========================
00970     // SMESH_IDSource interface
00971     // =========================
00972     virtual SMESH::long_array*           GetIDs();
00973     virtual SMESH::long_array*           GetMeshInfo();
00974     virtual SMESH::array_of_ElementType* GetTypes();
00975     virtual SMESH::SMESH_Mesh_ptr        GetMesh();
00976     virtual bool                         IsMeshInfoCorrect() { return true; }
00977 
00981     struct TPredicateChangeWaiter
00982     {
00983       virtual void PredicateChanged() = 0;
00984     };
00985     void AddWaiter( TPredicateChangeWaiter* waiter );
00986     void RemoveWaiter( TPredicateChangeWaiter* waiter );
00987 
00988   private:
00989     Controls::Filter myFilter;
00990     Predicate_i*     myPredicate;
00991     SMESH_Mesh_var   myMesh;
00992 
00993     std::list<TPredicateChangeWaiter*> myWaiters;
00994   };
00995   
00996   
00997   /*
00998     FILTER LIBRARY
00999   */
01000   class SMESH_I_EXPORT FilterLibrary_i: public virtual POA_SMESH::FilterLibrary,
01001                                         public virtual SALOME::GenericObj_i
01002   {
01003   public:
01004     FilterLibrary_i( const char* theFileName );
01005     FilterLibrary_i();
01006     ~FilterLibrary_i();
01007     
01008     Filter_ptr              Copy( const char* theFilterName );
01009     
01010     CORBA::Boolean          Add     ( const char* theFilterName, Filter_ptr theFilter );
01011     CORBA::Boolean          AddEmpty( const char* theFilterName, ElementType theType );
01012     CORBA::Boolean          Delete  ( const char* theFilterName );
01013     CORBA::Boolean          Replace ( const char* theFilterName, 
01014                                       const char* theNewName, 
01015                                       Filter_ptr  theFilter );
01016     
01017     CORBA::Boolean          Save();
01018     CORBA::Boolean          SaveAs( const char* aFileName );
01019     
01020     CORBA::Boolean          IsPresent( const char* aFilterName );
01021     CORBA::Long             NbFilters( ElementType );
01022     string_array*           GetNames( ElementType );
01023     string_array*           GetAllNames();
01024     void                    SetFileName( const char* theFileName );
01025     char*                   GetFileName();
01026     
01027   private:
01028     char*                   myFileName;
01029     LDOM_Document           myDoc;
01030     FilterManager_var       myFilterMgr;
01031   };
01032   
01033   
01034   /*
01035     FILTER MANAGER
01036   */
01037   
01038   class SMESH_I_EXPORT FilterManager_i: public virtual POA_SMESH::FilterManager,
01039                          public virtual SALOME::GenericObj_i
01040   {
01041   public:
01042     FilterManager_i();
01043     ~FilterManager_i();
01044 
01045     MinimumAngle_ptr          CreateMinimumAngle();
01046     AspectRatio_ptr           CreateAspectRatio();
01047     AspectRatio3D_ptr         CreateAspectRatio3D();
01048     Warping_ptr               CreateWarping();
01049     Taper_ptr                 CreateTaper();
01050     Skew_ptr                  CreateSkew();
01051     Area_ptr                  CreateArea();
01052     Volume3D_ptr              CreateVolume3D();
01053     MaxElementLength2D_ptr    CreateMaxElementLength2D();
01054     MaxElementLength3D_ptr    CreateMaxElementLength3D();
01055     Length_ptr                CreateLength();
01056     Length2D_ptr              CreateLength2D();
01057     MultiConnection_ptr       CreateMultiConnection();
01058     MultiConnection2D_ptr     CreateMultiConnection2D();
01059     
01060     BelongToGeom_ptr          CreateBelongToGeom();
01061     BelongToPlane_ptr         CreateBelongToPlane();
01062     BelongToCylinder_ptr      CreateBelongToCylinder();
01063     BelongToGenSurface_ptr    CreateBelongToGenSurface();
01064     
01065     LyingOnGeom_ptr           CreateLyingOnGeom();
01066     
01067     FreeBorders_ptr           CreateFreeBorders();
01068     FreeEdges_ptr             CreateFreeEdges();
01069     FreeNodes_ptr             CreateFreeNodes();
01070     FreeFaces_ptr             CreateFreeFaces();
01071 
01072     EqualNodes_ptr            CreateEqualNodes();
01073     EqualEdges_ptr            CreateEqualEdges();
01074     EqualFaces_ptr            CreateEqualFaces();
01075     EqualVolumes_ptr          CreateEqualVolumes();
01076 
01077     RangeOfIds_ptr            CreateRangeOfIds();
01078     BadOrientedVolume_ptr     CreateBadOrientedVolume();
01079     BareBorderFace_ptr        CreateBareBorderFace();
01080     BareBorderVolume_ptr      CreateBareBorderVolume();
01081     OverConstrainedFace_ptr   CreateOverConstrainedFace();
01082     OverConstrainedVolume_ptr CreateOverConstrainedVolume();
01083     LinearOrQuadratic_ptr     CreateLinearOrQuadratic();
01084     GroupColor_ptr            CreateGroupColor();
01085     ElemGeomType_ptr          CreateElemGeomType();
01086     CoplanarFaces_ptr         CreateCoplanarFaces();
01087 
01088     LessThan_ptr              CreateLessThan();
01089     MoreThan_ptr              CreateMoreThan();
01090     EqualTo_ptr               CreateEqualTo();
01091     
01092     LogicalNOT_ptr            CreateLogicalNOT();
01093     LogicalAND_ptr            CreateLogicalAND();
01094     LogicalOR_ptr             CreateLogicalOR();
01095     
01096     Filter_ptr                CreateFilter();
01097     
01098     FilterLibrary_ptr         LoadLibrary( const char* aFileName );
01099     FilterLibrary_ptr         CreateLibrary();
01100     CORBA::Boolean            DeleteLibrary( const char* aFileName );
01101   };
01102   
01103   
01104   Predicate_i* 
01105   GetPredicate( SMESH::Predicate_ptr thePredicate );
01106 
01107   const char*        FunctorTypeToString(SMESH::FunctorType ft);
01108   SMESH::FunctorType StringToFunctorType(const char*       str);
01109 }
01110 
01111 
01112 #endif