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