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