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