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