Version: 6.3.1

src/SMESH_I/SMESH_Filter_i.hxx

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