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