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