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