Salome HOME
8a1766b47121b4ed979e981ee595bfef5c4ee894
[modules/smesh.git] / src / SMESH_I / SMESH_Filter_i.hxx
1 //  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 //  SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
24 //  File   : SMESH_Filter_i.hxx
25 //  Author : Alexey Petrov, OCC
26 //  Module : SMESH
27 //
28 #ifndef _SMESH_FILTER_I_HXX_
29 #define _SMESH_FILTER_I_HXX_
30
31 #include "SMESH.hxx"
32
33 #include <SALOMEconfig.h>
34 #include CORBA_SERVER_HEADER(SMESH_Filter)
35
36 #include <LDOM_Document.hxx>
37 #include <TopoDS_Shape.hxx>
38
39 #include "SALOME_GenericObj_i.hh"
40 #include "SMESH_ControlsDef.hxx"
41
42 class SMESHDS_Mesh;
43
44 namespace SMESH
45 {
46
47   // ================================================================================
48   namespace Controls
49   {
50
51     /*
52       Class       : BelongToGeom
53       Description : Predicate for verifying whether entiy belong to
54       specified geometrical support
55     */
56     class SMESH_I_EXPORT BelongToGeom: public virtual Predicate
57     {
58     public:
59       BelongToGeom();
60
61       virtual void                    SetMesh( const SMDS_Mesh* theMesh );
62       virtual void                    SetGeom( const TopoDS_Shape& theShape );
63
64       virtual bool                    IsSatisfy( long theElementId );
65
66       virtual void                    SetType( SMDSAbs_ElementType theType );
67       virtual                         SMDSAbs_ElementType GetType() const;
68
69       TopoDS_Shape                    GetShape();
70       const SMESHDS_Mesh*             GetMeshDS() const;
71
72       void                            SetTolerance( double );
73       double                          GetTolerance();
74
75     private:
76       virtual void                    init();
77
78       TopoDS_Shape                    myShape;
79       const SMESHDS_Mesh*             myMeshDS;
80       SMDSAbs_ElementType             myType;
81       bool                            myIsSubshape;
82       double                          myTolerance;          // only if myIsSubshape == false
83       Controls::ElementsOnShapePtr    myElementsOnShapePtr; // only if myIsSubshape == false
84     };
85     typedef boost::shared_ptr<BelongToGeom> BelongToGeomPtr;
86
87     /*
88       Class       : LyingOnGeom
89       Description : Predicate for verifying whether entiy lying or partially lying on
90       specified geometrical support
91     */
92     class SMESH_I_EXPORT LyingOnGeom: public virtual Predicate
93     {
94     public:
95       LyingOnGeom();
96       
97       virtual void                    SetMesh( const SMDS_Mesh* theMesh );
98       virtual void                    SetGeom( const TopoDS_Shape& theShape );
99       
100       virtual bool                    IsSatisfy( long theElementId );
101       
102       virtual void                    SetType( SMDSAbs_ElementType theType );
103       virtual                         SMDSAbs_ElementType GetType() const;
104       
105       TopoDS_Shape                    GetShape();
106       const SMESHDS_Mesh*             GetMeshDS() const;
107
108       void                            SetTolerance( double );
109       double                          GetTolerance();
110       
111       virtual bool                    Contains( const SMESHDS_Mesh*     theMeshDS,
112                                                 const TopoDS_Shape&     theShape,
113                                                 const SMDS_MeshElement* theElem,
114                                                 TopAbs_ShapeEnum        theFindShapeEnum,
115                                                 TopAbs_ShapeEnum        theAvoidShapeEnum = TopAbs_SHAPE );
116     private:
117       virtual void                    init();
118
119       TopoDS_Shape                    myShape;
120       const SMESHDS_Mesh*             myMeshDS;
121       SMDSAbs_ElementType             myType;
122       bool                            myIsSubshape;
123       double                          myTolerance;          // only if myIsSubshape == false
124       Controls::ElementsOnShapePtr    myElementsOnShapePtr; // only if myIsSubshape == false
125     };
126     typedef boost::shared_ptr<LyingOnGeom> LyingOnGeomPtr;
127
128   } // namespace Controls
129
130   // ================================================================================
131   /*
132     FUNCTORS
133   */
134   
135   /*
136     Class       : Functor_i
137     Description : An abstact class for all functors 
138   */
139   class SMESH_I_EXPORT Functor_i: public virtual POA_SMESH::Functor,
140                    public virtual SALOME::GenericObj_i
141   {
142   public:
143     void                            SetMesh( SMESH_Mesh_ptr theMesh );
144     Controls::FunctorPtr            GetFunctor(){ return myFunctorPtr;}
145     ElementType                     GetElementType();
146     
147   protected:
148     Functor_i();
149     ~Functor_i();
150   protected:                                
151     Controls::FunctorPtr            myFunctorPtr;
152   };
153   
154   /*
155     Class       : NumericalFunctor_i
156     Description : Base class for numerical functors 
157   */
158   class SMESH_I_EXPORT NumericalFunctor_i: public virtual POA_SMESH::NumericalFunctor,
159                             public virtual Functor_i
160   {
161   public:
162     CORBA::Double                   GetValue( CORBA::Long theElementId );
163     SMESH::Histogram*               GetHistogram(CORBA::Short nbIntervals);
164     void                            SetPrecision( CORBA::Long thePrecision );
165     CORBA::Long                     GetPrecision();
166     Controls::NumericalFunctorPtr   GetNumericalFunctor();
167     
168   protected:
169     Controls::NumericalFunctorPtr   myNumericalFunctorPtr;
170   };
171   
172   
173   /*
174     Class       : SMESH_MinimumAngleFunct
175     Description : Functor for calculation of minimum angle
176   */
177   class SMESH_I_EXPORT MinimumAngle_i: public virtual POA_SMESH::MinimumAngle,
178                         public virtual NumericalFunctor_i
179   {
180   public:
181     MinimumAngle_i();
182     FunctorType                     GetFunctorType();
183   };
184   
185   
186   /*
187     Class       : AspectRatio_i
188     Description : Functor for calculating aspect ratio
189   */
190   class SMESH_I_EXPORT AspectRatio_i: public virtual POA_SMESH::AspectRatio,
191                        public virtual NumericalFunctor_i
192   {
193   public:
194     AspectRatio_i();
195     FunctorType                     GetFunctorType();
196   };
197   
198   
199   /*
200     Class       : AspectRatio3D_i
201     Description : Functor for calculating aspect ratio for 3D
202   */
203   class SMESH_I_EXPORT AspectRatio3D_i: public virtual POA_SMESH::AspectRatio3D,
204                          public virtual NumericalFunctor_i
205   {
206   public:
207     AspectRatio3D_i();
208     FunctorType                     GetFunctorType();
209   };
210   
211
212   /*
213     Class       : Warping_i
214     Description : Functor for calculating warping
215   */
216   class SMESH_I_EXPORT Warping_i: public virtual POA_SMESH::Warping,
217                    public virtual NumericalFunctor_i
218   {
219   public:
220     Warping_i();
221     FunctorType                     GetFunctorType();
222   };
223   
224   
225   /*
226     Class       : Taper_i
227     Description : Functor for calculating taper
228   */
229   class SMESH_I_EXPORT Taper_i: public virtual POA_SMESH::Taper,
230                  public virtual NumericalFunctor_i
231   {
232   public:
233     Taper_i();
234     FunctorType                     GetFunctorType();
235   };
236   
237   
238   /*
239     Class       : Skew_i
240     Description : Functor for calculating skew in degrees
241   */
242   class SMESH_I_EXPORT Skew_i: public virtual POA_SMESH::Skew,
243                 public virtual NumericalFunctor_i
244   {
245   public:
246     Skew_i();
247     FunctorType                     GetFunctorType();
248   };
249   
250   
251   /*
252     Class       : Area_i
253     Description : Functor for calculating area
254   */
255   class SMESH_I_EXPORT Area_i: public virtual POA_SMESH::Area,
256                 public virtual NumericalFunctor_i
257   {
258   public:
259     Area_i();
260     FunctorType                     GetFunctorType();
261   };
262   
263   
264   /*
265     Class       : Volume3D_i
266     Description : Functor for calculating volume of 3D element
267   */
268   class SMESH_I_EXPORT Volume3D_i: public virtual POA_SMESH::Volume3D,
269                     public virtual NumericalFunctor_i
270   {
271   public:
272     Volume3D_i();
273     FunctorType                     GetFunctorType();
274   };
275   
276   
277   /*
278     Class       : MaxElementLength2D_i
279     Description : Functor for calculating maximum length of 2D element
280   */
281   class SMESH_I_EXPORT MaxElementLength2D_i: public virtual POA_SMESH::MaxElementLength2D,
282                                              public virtual NumericalFunctor_i
283   {
284   public:
285     MaxElementLength2D_i();
286     FunctorType                     GetFunctorType();
287   };
288   
289   
290   /*
291     Class       : MaxElementLength3D_i
292     Description : Functor for calculating maximum length of 3D element
293   */
294   class SMESH_I_EXPORT MaxElementLength3D_i: public virtual POA_SMESH::MaxElementLength3D,
295                                              public virtual NumericalFunctor_i
296   {
297   public:
298     MaxElementLength3D_i();
299     FunctorType                     GetFunctorType();
300   };
301   
302   
303   /*
304     Class       : Length_i
305     Description : Functor for calculating length of edge
306   */
307   class SMESH_I_EXPORT Length_i: public virtual POA_SMESH::Length,
308                   public virtual NumericalFunctor_i
309   {
310   public:
311     Length_i();
312     FunctorType                     GetFunctorType();
313   };
314   
315   /*
316     Class       : Length2D_i
317     Description : Functor for calculating length of edge
318   */
319   class SMESH_I_EXPORT Length2D_i: public virtual POA_SMESH::Length2D,
320                     public virtual NumericalFunctor_i
321   {
322   public:
323     Length2D_i();
324     SMESH::Length2D::Values*        GetValues();
325     FunctorType                     GetFunctorType();
326     
327   protected:
328     Controls::Length2DPtr          myLength2DPtr;
329   };
330   
331   
332   /*
333     Class       : MultiConnection_i
334     Description : Functor for calculating number of faces conneted to the edge
335   */
336   class SMESH_I_EXPORT MultiConnection_i: public virtual POA_SMESH::MultiConnection,
337                            public virtual NumericalFunctor_i
338   {
339   public:
340     MultiConnection_i();
341     FunctorType                     GetFunctorType();
342   };
343   
344   /*
345     Class       : MultiConnection2D_i
346     Description : Functor for calculating number of faces conneted to the edge
347   */
348   class SMESH_I_EXPORT MultiConnection2D_i: public virtual POA_SMESH::MultiConnection2D,
349                              public virtual NumericalFunctor_i
350   {
351   public:
352     MultiConnection2D_i();
353     SMESH::MultiConnection2D::Values*  GetValues();
354     FunctorType                        GetFunctorType();
355     
356   protected:
357     Controls::MultiConnection2DPtr     myMulticonnection2DPtr;
358   };
359   
360   
361   /*
362     PREDICATES
363   */
364   /*
365     Class       : Predicate_i
366     Description : Base class for all predicates
367   */
368   class SMESH_I_EXPORT Predicate_i: public virtual POA_SMESH::Predicate,
369                      public virtual Functor_i
370   {
371   public:
372     CORBA::Boolean                  IsSatisfy( CORBA::Long theElementId );
373     Controls::PredicatePtr          GetPredicate();
374     
375   protected:
376     Controls::PredicatePtr          myPredicatePtr;
377   };
378   
379   
380   /*
381     Class       : BadOrientedVolume_i
382     Description : Verify whether a mesh volume is incorrectly oriented from
383     the point of view of MED convention
384   */
385   class SMESH_I_EXPORT BadOrientedVolume_i: public virtual POA_SMESH::BadOrientedVolume,
386                              public virtual Predicate_i
387   {
388   public:
389     BadOrientedVolume_i();
390     FunctorType                     GetFunctorType();
391   };
392   
393   /*
394     Class       : BareBorderVolume_i
395     Description : Verify whether a mesh volume has a free facet without a face on it
396   */
397   class SMESH_I_EXPORT BareBorderVolume_i: public virtual POA_SMESH::BareBorderVolume,
398                                            public virtual Predicate_i
399   {
400   public:
401     BareBorderVolume_i();
402     FunctorType                     GetFunctorType();
403   };
404   
405   /*
406     Class       : BareBorderFace_i
407     Description : Verify whether a mesh face has a free border without an edge on it
408   */
409   class SMESH_I_EXPORT BareBorderFace_i: public virtual POA_SMESH::BareBorderFace,
410                                            public virtual Predicate_i
411   {
412   public:
413     BareBorderFace_i();
414     FunctorType                     GetFunctorType();
415   };
416   
417   /*
418     Class       : OverConstrainedVolume_i
419     Description : Verify whether a mesh volume has only one facet shared with other volumes
420   */
421   class SMESH_I_EXPORT OverConstrainedVolume_i: public virtual POA_SMESH::OverConstrainedVolume,
422                                            public virtual Predicate_i
423   {
424   public:
425     OverConstrainedVolume_i();
426     FunctorType                     GetFunctorType();
427   };
428   
429   /*
430     Class       : OverConstrainedFace_i
431     Description : Verify whether a mesh face has only one border shared with other faces
432   */
433   class SMESH_I_EXPORT OverConstrainedFace_i: public virtual POA_SMESH::OverConstrainedFace,
434                                            public virtual Predicate_i
435   {
436   public:
437     OverConstrainedFace_i();
438     FunctorType                     GetFunctorType();
439   };
440   
441   /*
442     Class       : BelongToGeom_i
443     Description : Predicate for selection on geometrical support
444   */
445   class SMESH_I_EXPORT BelongToGeom_i: public virtual POA_SMESH::BelongToGeom,
446                         public virtual Predicate_i
447   {
448   public:
449     BelongToGeom_i();
450     virtual                         ~BelongToGeom_i();
451     
452     void                            SetGeom( GEOM::GEOM_Object_ptr theGeom );
453     void                            SetElementType( ElementType theType );
454     FunctorType                     GetFunctorType();
455     
456     void                            SetGeom( const TopoDS_Shape& theShape );
457     
458     void                            SetShapeName( const char* theName );
459     void                            SetShape( const char* theID, const char* theName );
460     char*                           GetShapeName();
461     char*                           GetShapeID();
462
463     void                            SetTolerance( CORBA::Double );
464     CORBA::Double                   GetTolerance();
465     
466   protected:
467     Controls::BelongToGeomPtr       myBelongToGeomPtr;
468     char*                           myShapeName;
469     char*                           myShapeID;
470   };
471   
472   /*
473     Class       : BelongToSurface_i
474     Description : Verify whether mesh element lie in pointed Geom planar object
475   */
476   class SMESH_I_EXPORT BelongToSurface_i: public virtual POA_SMESH::BelongToSurface,
477                            public virtual Predicate_i
478   {
479   public:
480     BelongToSurface_i( const Handle(Standard_Type)& );
481     virtual                         ~BelongToSurface_i();
482     
483     void                            SetSurface( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
484     
485     void                            SetShapeName( const char* theName, ElementType theType );
486     void                            SetShape( const char* theID, const char* theName, ElementType theType );
487     char*                           GetShapeName();
488     char*                           GetShapeID();
489
490     void                            SetTolerance( CORBA::Double );
491     CORBA::Double                   GetTolerance();
492     
493     void                            SetUseBoundaries( CORBA::Boolean theUseBndRestrictions );
494     CORBA::Boolean                  GetUseBoundaries();
495
496   protected:
497     Controls::ElementsOnSurfacePtr  myElementsOnSurfacePtr;
498     char*                           myShapeName;
499     char*                           myShapeID;
500     Handle(Standard_Type)           mySurfaceType;
501   };
502   
503   /*
504     Class       : BelongToPlane_i
505     Description : Verify whether mesh element lie in pointed Geom planar object
506   */
507   class SMESH_I_EXPORT BelongToPlane_i: public virtual POA_SMESH::BelongToPlane,
508                          public virtual BelongToSurface_i
509   {
510   public:
511     BelongToPlane_i();
512     void                            SetPlane( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
513     FunctorType                     GetFunctorType();
514   };
515   
516   /*
517     Class       : BelongToCylinder_i
518     Description : Verify whether mesh element lie in pointed Geom cylindrical object
519   */
520   class SMESH_I_EXPORT BelongToCylinder_i: public virtual POA_SMESH::BelongToCylinder,
521                             public virtual BelongToSurface_i
522   {
523   public:
524     BelongToCylinder_i();
525     void                            SetCylinder( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
526     FunctorType                     GetFunctorType();
527   };
528
529   /*
530     Class       : BelongToGenSurface_i
531     Description : Verify whether mesh element lie on pointed Geom surfasic object
532   */
533   class BelongToGenSurface_i: public virtual POA_SMESH::BelongToGenSurface,
534                               public virtual BelongToSurface_i
535   {
536   public:
537     BelongToGenSurface_i();
538     void                            SetSurface( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
539     FunctorType                     GetFunctorType();
540   };
541   
542   /*
543     Class       : LyingOnGeom_i
544     Description : Predicate for selection on geometrical support(lying or partially lying)
545   */
546   class SMESH_I_EXPORT LyingOnGeom_i: public virtual POA_SMESH::LyingOnGeom,
547                        public virtual Predicate_i
548   {
549   public:
550     LyingOnGeom_i();
551     virtual                         ~LyingOnGeom_i();
552     
553     void                            SetGeom( GEOM::GEOM_Object_ptr theGeom );
554     void                            SetElementType( ElementType theType );
555     FunctorType                     GetFunctorType();
556     
557     void                            SetGeom( const TopoDS_Shape& theShape );
558     
559     void                            SetShapeName( const char* theName );
560     void                            SetShape( const char* theID, const char* theName );
561     char*                           GetShapeName();
562     char*                           GetShapeID();
563
564     void                            SetTolerance( CORBA::Double );
565     CORBA::Double                   GetTolerance();
566     
567   protected:
568     Controls::LyingOnGeomPtr        myLyingOnGeomPtr;
569     char*                           myShapeName;
570     char*                           myShapeID;
571   };
572   
573   /*
574     Class       : FreeBorders_i
575     Description : Predicate for free borders
576   */
577   class SMESH_I_EXPORT FreeBorders_i: public virtual POA_SMESH::FreeBorders,
578                        public virtual Predicate_i
579   {
580   public:
581     FreeBorders_i();
582     FunctorType                     GetFunctorType();
583   };
584   
585   
586   /*
587     Class       : FreeEdges_i
588     Description : Predicate for free edges
589   */
590   class SMESH_I_EXPORT FreeEdges_i: public virtual POA_SMESH::FreeEdges,
591                      public virtual Predicate_i
592   {
593   public:
594     FreeEdges_i();
595     SMESH::FreeEdges::Borders*      GetBorders();
596     FunctorType                     GetFunctorType();
597     
598   protected:
599     Controls::FreeEdgesPtr          myFreeEdgesPtr;
600   };
601   
602
603   /*
604     Class       : FreeFaces_i
605     Description : Predicate for free faces
606   */
607   class SMESH_I_EXPORT FreeFaces_i: public virtual POA_SMESH::FreeFaces,
608                        public virtual Predicate_i
609   {
610   public:
611     FreeFaces_i();
612     FunctorType                     GetFunctorType();
613   };
614   
615
616   /*
617     Class       : FreeNodes_i
618     Description : Predicate for free nodes
619   */
620   class SMESH_I_EXPORT FreeNodes_i: public virtual POA_SMESH::FreeNodes,
621                        public virtual Predicate_i
622   {
623   public:
624     FreeNodes_i();
625     FunctorType                     GetFunctorType();
626   };
627   
628   
629   /*
630     Class       : RangeOfIds_i
631     Description : Predicate for Range of Ids
632   */
633   class SMESH_I_EXPORT RangeOfIds_i: public virtual POA_SMESH::RangeOfIds,
634                       public virtual Predicate_i
635   {
636   public:
637     RangeOfIds_i();
638     void                            SetRange( const SMESH::long_array& theIds );
639     CORBA::Boolean                  SetRangeStr( const char* theRange );
640     char*                           GetRangeStr();
641     
642     void                            SetElementType( ElementType theType );
643     FunctorType                     GetFunctorType();
644     
645   protected:
646     Controls::RangeOfIdsPtr         myRangeOfIdsPtr;
647   };
648
649   /*
650     Class       : LinearOrQuadratic_i
651     Description : Verify whether a mesh element is linear
652   */
653   class SMESH_I_EXPORT LinearOrQuadratic_i: public virtual POA_SMESH::LinearOrQuadratic,
654                              public virtual Predicate_i
655   {
656   public:
657     LinearOrQuadratic_i();
658     FunctorType                    GetFunctorType();
659     void                           SetElementType( ElementType theType );
660
661   private:
662    Controls::LinearOrQuadraticPtr  myLinearOrQuadraticPtr;
663   };
664   
665   /*
666     Class       : GroupColor_i
667     Description : Functor for check color of group to whic mesh element belongs to
668   */
669   class SMESH_I_EXPORT GroupColor_i: public virtual POA_SMESH::GroupColor,
670                   public virtual Predicate_i
671   {
672   public:
673     GroupColor_i();
674     FunctorType             GetFunctorType();
675
676     void                    SetElementType( ElementType theType );
677     void                    SetColorStr( const char* theColor );
678     char*                   GetColorStr();
679
680   private:
681     Controls::GroupColorPtr myGroupColorPtr;
682   };
683   
684   /*
685     Class       : ElemGeomType_i
686     Description : Functor for check element geometry type
687   */
688   class SMESH_I_EXPORT ElemGeomType_i: public virtual POA_SMESH::ElemGeomType,
689                   public virtual Predicate_i
690   {
691   public:
692     ElemGeomType_i();
693     FunctorType             GetFunctorType();
694
695     void                    SetElementType ( ElementType  theType );
696     void                    SetGeometryType( GeometryType theType );
697     GeometryType            GetGeometryType() const;
698
699   private:
700     Controls::ElemGeomTypePtr myElemGeomTypePtr;
701   };
702   
703   /*
704     Class       : Comparator_i
705     Description : Base class for comparators
706   */
707   class SMESH_I_EXPORT Comparator_i: public virtual POA_SMESH::Comparator,
708                       public virtual Predicate_i
709   {
710   public:
711     virtual                         ~Comparator_i();
712     
713     virtual void                    SetMargin( CORBA::Double );
714     virtual void                    SetNumFunctor( NumericalFunctor_ptr );
715     
716     Controls::ComparatorPtr         GetComparator();
717     NumericalFunctor_i*             GetNumFunctor_i();
718     CORBA::Double                   GetMargin();
719     
720   protected:
721     Comparator_i();
722   protected:                                  
723     Controls::ComparatorPtr         myComparatorPtr;
724     NumericalFunctor_i*             myNumericalFunctor;
725   };
726   
727   
728   /*
729     Class       : LessThan_i
730     Description : Comparator "<"
731   */
732   class SMESH_I_EXPORT LessThan_i: public virtual POA_SMESH::LessThan,
733                     public virtual Comparator_i
734   {
735   public:
736     LessThan_i();
737     FunctorType                     GetFunctorType();
738   };
739   
740   
741   /*
742     Class       : MoreThan_i
743     Description : Comparator ">"
744   */
745   class SMESH_I_EXPORT MoreThan_i: public virtual POA_SMESH::MoreThan,
746                     public virtual Comparator_i
747   {
748   public:
749     MoreThan_i();
750     FunctorType                     GetFunctorType();
751   };
752   
753   
754   /*
755     Class       : EqualTo_i
756     Description : Comparator "="
757   */
758   class SMESH_I_EXPORT EqualTo_i: public virtual POA_SMESH::EqualTo,
759                    public virtual Comparator_i
760   {
761   public:
762     EqualTo_i();
763     virtual void                    SetTolerance( CORBA::Double );
764     CORBA::Double                   GetTolerance();
765     FunctorType                     GetFunctorType();
766     
767   protected:
768     Controls::EqualToPtr            myEqualToPtr;
769   };
770   
771   
772   /*
773     Class       : LogicalNOT_i
774     Description : Logical NOT predicate
775   */
776   class SMESH_I_EXPORT LogicalNOT_i: public virtual POA_SMESH::LogicalNOT,
777                       public virtual Predicate_i
778   {
779   public:
780     LogicalNOT_i();
781   virtual                         ~LogicalNOT_i();
782     
783     virtual void                    SetPredicate( Predicate_ptr );
784     Predicate_i*                    GetPredicate_i();
785     FunctorType                     GetFunctorType();
786     
787   protected:
788     Controls::LogicalNOTPtr         myLogicalNOTPtr;
789     Predicate_i*                    myPredicate;
790   };
791   
792   
793   /*
794     Class       : LogicalBinary_i
795     Description : Base class for binary logical predicate
796   */
797   class SMESH_I_EXPORT LogicalBinary_i: public virtual POA_SMESH::LogicalBinary,
798                          public virtual Predicate_i
799   {
800   public:
801     virtual                         ~LogicalBinary_i();
802     virtual void                    SetMesh( SMESH_Mesh_ptr theMesh );
803     virtual void                    SetPredicate1( Predicate_ptr );
804     virtual void                    SetPredicate2( Predicate_ptr );
805     
806     Controls::LogicalBinaryPtr      GetLogicalBinary();
807     Predicate_i*                    GetPredicate1_i();
808     Predicate_i*                    GetPredicate2_i();
809     
810   protected:
811     LogicalBinary_i();
812   protected:  
813     Controls::LogicalBinaryPtr      myLogicalBinaryPtr;
814     Predicate_i*                    myPredicate1;
815     Predicate_i*                    myPredicate2;
816   };
817   
818   
819   /*
820     Class       : LogicalAND_i
821     Description : Logical AND
822   */
823   class SMESH_I_EXPORT LogicalAND_i: public virtual POA_SMESH::LogicalAND,
824                       public virtual LogicalBinary_i
825   {
826   public:
827     LogicalAND_i();
828     FunctorType                     GetFunctorType();
829   };
830   
831   
832   /*
833     Class       : LogicalOR_i
834     Description : Logical OR
835   */
836   class SMESH_I_EXPORT LogicalOR_i: public virtual POA_SMESH::LogicalOR,
837                      public virtual LogicalBinary_i
838   {
839   public:
840     LogicalOR_i();
841     FunctorType                     GetFunctorType();
842   };
843   
844   
845   /*
846     FILTER
847   */
848   class SMESH_I_EXPORT Filter_i: public virtual POA_SMESH::Filter,
849                   public virtual SALOME::GenericObj_i
850   {
851   public:
852     Filter_i();
853     ~Filter_i();
854     
855     virtual
856     void
857     SetPredicate( Predicate_ptr );
858
859     virtual
860     void
861     SetMesh( SMESH_Mesh_ptr );
862
863     static
864     void
865     GetElementsId( Predicate_i*,
866                    const SMDS_Mesh*,
867                    Controls::Filter::TIdSequence& );
868     static
869     void           
870     GetElementsId( Predicate_i*,
871                    SMESH_Mesh_ptr,
872                    Controls::Filter::TIdSequence& );
873     
874     virtual
875     long_array*      
876     GetElementsId( SMESH_Mesh_ptr );
877
878     virtual
879     ElementType      
880     GetElementType();
881     
882     virtual
883     CORBA::Boolean   
884     GetCriteria( SMESH::Filter::Criteria_out theCriteria );
885
886     virtual
887     CORBA::Boolean
888     SetCriteria( const SMESH::Filter::Criteria& theCriteria );
889     
890     virtual
891     Predicate_ptr
892     GetPredicate();
893
894     Predicate_i*     GetPredicate_i();
895
896     // =========================
897     // SMESH_IDSource interface
898     // =========================
899     virtual SMESH::long_array*           GetIDs();
900     virtual SMESH::long_array*           GetMeshInfo();
901     virtual SMESH::array_of_ElementType* GetTypes();
902     virtual SMESH::SMESH_Mesh_ptr        GetMesh();
903
904   private:
905     Controls::Filter myFilter;
906     Predicate_i*     myPredicate;
907     SMESH_Mesh_var   myMesh;
908   };
909   
910   
911   /*
912     FILTER LIBRARY
913   */
914   class SMESH_I_EXPORT FilterLibrary_i: public virtual POA_SMESH::FilterLibrary,
915                          public virtual SALOME::GenericObj_i
916   {
917   public:
918     FilterLibrary_i( const char* theFileName );
919     FilterLibrary_i();
920     ~FilterLibrary_i();
921     
922     Filter_ptr              Copy( const char* theFilterName );
923     
924     CORBA::Boolean          Add     ( const char* theFilterName, Filter_ptr theFilter );
925     CORBA::Boolean          AddEmpty( const char* theFilterName, ElementType theType );
926     CORBA::Boolean          Delete  ( const char* theFilterName );
927     CORBA::Boolean          Replace ( const char* theFilterName, 
928                                       const char* theNewName, 
929                                       Filter_ptr  theFilter );
930     
931     CORBA::Boolean          Save();
932     CORBA::Boolean          SaveAs( const char* aFileName );
933     
934     CORBA::Boolean          IsPresent( const char* aFilterName );
935     CORBA::Long             NbFilters( ElementType );
936     string_array*           GetNames( ElementType );
937     string_array*           GetAllNames();
938     void                    SetFileName( const char* theFileName );
939     char*                   GetFileName();
940     
941   private:
942     char*                   myFileName;
943     LDOM_Document           myDoc;
944     FilterManager_var       myFilterMgr;
945   };
946   
947   
948   /*
949     FILTER MANAGER
950   */
951   
952   class SMESH_I_EXPORT FilterManager_i: public virtual POA_SMESH::FilterManager,
953                          public virtual SALOME::GenericObj_i
954   {
955   public:
956     FilterManager_i();
957     ~FilterManager_i();
958
959     MinimumAngle_ptr          CreateMinimumAngle();
960     AspectRatio_ptr           CreateAspectRatio();
961     AspectRatio3D_ptr         CreateAspectRatio3D();
962     Warping_ptr               CreateWarping();
963     Taper_ptr                 CreateTaper();
964     Skew_ptr                  CreateSkew();
965     Area_ptr                  CreateArea();
966     Volume3D_ptr              CreateVolume3D();
967     MaxElementLength2D_ptr    CreateMaxElementLength2D();
968     MaxElementLength3D_ptr    CreateMaxElementLength3D();
969     Length_ptr                CreateLength();
970     Length2D_ptr              CreateLength2D();
971     MultiConnection_ptr       CreateMultiConnection();
972     MultiConnection2D_ptr     CreateMultiConnection2D();
973     
974     BelongToGeom_ptr          CreateBelongToGeom();
975     BelongToPlane_ptr         CreateBelongToPlane();
976     BelongToCylinder_ptr      CreateBelongToCylinder();
977     BelongToGenSurface_ptr    CreateBelongToGenSurface();
978     
979     LyingOnGeom_ptr           CreateLyingOnGeom();
980     
981     FreeBorders_ptr           CreateFreeBorders();
982     FreeEdges_ptr             CreateFreeEdges();
983     FreeNodes_ptr             CreateFreeNodes();
984     FreeFaces_ptr             CreateFreeFaces();
985     
986     RangeOfIds_ptr            CreateRangeOfIds();
987     
988     BadOrientedVolume_ptr     CreateBadOrientedVolume();
989     BareBorderFace_ptr        CreateBareBorderFace();
990     BareBorderVolume_ptr      CreateBareBorderVolume();
991     OverConstrainedFace_ptr   CreateOverConstrainedFace();
992     OverConstrainedVolume_ptr CreateOverConstrainedVolume();
993     LinearOrQuadratic_ptr     CreateLinearOrQuadratic();
994     
995     GroupColor_ptr            CreateGroupColor();
996
997     ElemGeomType_ptr          CreateElemGeomType();
998
999     LessThan_ptr              CreateLessThan();
1000     MoreThan_ptr              CreateMoreThan();
1001     EqualTo_ptr               CreateEqualTo();
1002     
1003     LogicalNOT_ptr            CreateLogicalNOT();
1004     LogicalAND_ptr            CreateLogicalAND();
1005     LogicalOR_ptr             CreateLogicalOR();
1006     
1007     Filter_ptr                CreateFilter();
1008     
1009     FilterLibrary_ptr         LoadLibrary( const char* aFileName );
1010     FilterLibrary_ptr         CreateLibrary();
1011     CORBA::Boolean            DeleteLibrary( const char* aFileName );
1012   };
1013   
1014   
1015   Predicate_i* 
1016   GetPredicate( SMESH::Predicate_ptr thePredicate );
1017 }
1018
1019
1020 #endif