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