Salome HOME
Issue 0020370: Symbols multi defined
[modules/smesh.git] / src / Controls / SMESH_ControlsDef.hxx
1 //  Copyright (C) 2007-2008  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 #ifndef _SMESH_CONTROLSDEF_HXX_
23 #define _SMESH_CONTROLSDEF_HXX_
24
25 #include <set>
26 #include <map>
27 #include <vector>
28 #include <boost/shared_ptr.hpp>
29 #include <gp_XYZ.hxx>
30 //#include <Geom_Surface.hxx>
31 #include <GeomAPI_ProjectPointOnSurf.hxx>
32 #include <GeomAPI_ProjectPointOnCurve.hxx>
33 #include <TColStd_SequenceOfInteger.hxx>
34 #include <TColStd_MapOfInteger.hxx>
35 #include <TCollection_AsciiString.hxx>
36 #include <TopoDS_Face.hxx>
37 #include <TopTools_MapOfShape.hxx>
38 #include <BRepClass3d_SolidClassifier.hxx>
39
40 #include "SMDSAbs_ElementType.hxx"
41 #include "SMDS_MeshNode.hxx"
42
43 #include "SMESH_Controls.hxx"
44
45 #ifdef WNT
46  #if defined SMESHCONTROLS_EXPORTS
47   #define SMESHCONTROLS_EXPORT __declspec( dllexport )
48  #else
49   #define SMESHCONTROLS_EXPORT __declspec( dllimport )
50  #endif
51 #else
52  #define SMESHCONTROLS_EXPORT
53 #endif
54
55 class SMDS_MeshElement;
56 class SMDS_MeshFace;
57 class SMDS_MeshNode;
58 class SMDS_Mesh;
59
60 class SMESHDS_Mesh;
61 class SMESHDS_SubMesh;
62
63 class gp_Pnt;
64 //class TopoDS_Shape;
65
66 namespace SMESH{
67   namespace Controls{
68
69     class SMESHCONTROLS_EXPORT TSequenceOfXYZ: public std::vector<gp_XYZ>
70     {
71     public:
72       TSequenceOfXYZ();
73
74       TSequenceOfXYZ(size_type n);
75
76       TSequenceOfXYZ(size_type n, const value_type& t);
77
78       TSequenceOfXYZ(const TSequenceOfXYZ& theSequenceOfXYZ);
79
80       template <class InputIterator>
81       TSequenceOfXYZ(InputIterator theBegin, InputIterator theEnd);
82
83       TSequenceOfXYZ& operator=(const TSequenceOfXYZ& theSequenceOfXYZ);
84
85       reference operator()(size_type n);
86
87       const_reference operator()(size_type n) const;
88
89     private:
90       reference operator[](size_type n);
91
92       const_reference operator[](size_type n) const;
93     };
94
95     /*
96       Class       : Functor
97       Description : Root of all Functors
98     */
99     class SMESHCONTROLS_EXPORT Functor
100     {
101     public:
102       ~Functor(){}
103       virtual void SetMesh( const SMDS_Mesh* theMesh ) = 0;
104       virtual SMDSAbs_ElementType GetType() const = 0;
105     };
106
107     /*
108       Class       : NumericalFunctor
109       Description : Root of all Functors returning numeric value
110     */
111     class SMESHCONTROLS_EXPORT NumericalFunctor: public virtual Functor{
112     public:
113       NumericalFunctor();
114       virtual void SetMesh( const SMDS_Mesh* theMesh );
115       virtual double GetValue( long theElementId );
116       virtual double GetValue(const TSequenceOfXYZ& thePoints) { return -1.0;};
117       virtual SMDSAbs_ElementType GetType() const = 0;
118       virtual double GetBadRate( double Value, int nbNodes ) const = 0;
119       long  GetPrecision() const;
120       void  SetPrecision( const long thePrecision );
121       
122       bool GetPoints(const int theId, 
123                      TSequenceOfXYZ& theRes) const;
124       static bool GetPoints(const SMDS_MeshElement* theElem, 
125                             TSequenceOfXYZ& theRes);
126     protected:
127       const SMDS_Mesh* myMesh;
128       const SMDS_MeshElement* myCurrElement;
129       long       myPrecision;
130     };
131   
132   
133     /*
134       Class       : Volume
135       Description : Functor calculating volume of 3D mesh element
136     */
137     class SMESHCONTROLS_EXPORT Volume: public virtual NumericalFunctor{
138     public:
139       virtual double GetValue( long theElementId );
140       //virtual double GetValue( const TSequenceOfXYZ& thePoints );
141       virtual double GetBadRate( double Value, int nbNodes ) const;
142       virtual SMDSAbs_ElementType GetType() const;
143     };
144   
145   
146     /*
147       Class       : SMESH_MinimumAngle
148       Description : Functor for calculation of minimum angle
149     */
150     class SMESHCONTROLS_EXPORT MinimumAngle: public virtual NumericalFunctor{
151     public:
152       virtual double GetValue( const TSequenceOfXYZ& thePoints );
153       virtual double GetBadRate( double Value, int nbNodes ) const;
154       virtual SMDSAbs_ElementType GetType() const;
155     };
156   
157   
158     /*
159       Class       : AspectRatio
160       Description : Functor for calculating aspect ratio
161     */
162     class SMESHCONTROLS_EXPORT AspectRatio: public virtual NumericalFunctor{
163     public:
164       virtual double GetValue( const TSequenceOfXYZ& thePoints );
165       virtual double GetBadRate( double Value, int nbNodes ) const;
166       virtual SMDSAbs_ElementType GetType() const;
167     };
168   
169   
170     /*
171       Class       : AspectRatio3D
172       Description : Functor for calculating aspect ratio of 3D elems.
173     */
174     class SMESHCONTROLS_EXPORT AspectRatio3D: public virtual NumericalFunctor{
175     public:
176       virtual double GetValue( const TSequenceOfXYZ& thePoints );
177       virtual double GetBadRate( double Value, int nbNodes ) const;
178       virtual SMDSAbs_ElementType GetType() const;
179     };
180   
181   
182     /*
183       Class       : Warping
184       Description : Functor for calculating warping
185     */
186     class SMESHCONTROLS_EXPORT Warping: public virtual NumericalFunctor{
187     public:
188       virtual double GetValue( const TSequenceOfXYZ& thePoints );
189       virtual double GetBadRate( double Value, int nbNodes ) const;
190       virtual SMDSAbs_ElementType GetType() const;
191       
192     private:
193       double ComputeA( const gp_XYZ&, const gp_XYZ&, const gp_XYZ&, const gp_XYZ& ) const;
194     };
195   
196   
197     /*
198       Class       : Taper
199       Description : Functor for calculating taper
200     */
201     class SMESHCONTROLS_EXPORT Taper: public virtual NumericalFunctor{
202     public:
203       virtual double GetValue( const TSequenceOfXYZ& thePoints );
204       virtual double GetBadRate( double Value, int nbNodes ) const;
205       virtual SMDSAbs_ElementType GetType() const;
206     };
207     
208   
209     /*
210       Class       : Skew
211       Description : Functor for calculating skew in degrees
212     */
213     class SMESHCONTROLS_EXPORT Skew: public virtual NumericalFunctor{
214     public:
215       virtual double GetValue( const TSequenceOfXYZ& thePoints );
216       virtual double GetBadRate( double Value, int nbNodes ) const;
217       virtual SMDSAbs_ElementType GetType() const;
218     };
219   
220     
221     /*
222       Class       : Area
223       Description : Functor for calculating area
224     */
225     class SMESHCONTROLS_EXPORT Area: public virtual NumericalFunctor{
226     public:
227       virtual double GetValue( const TSequenceOfXYZ& thePoints );
228       virtual double GetBadRate( double Value, int nbNodes ) const;
229       virtual SMDSAbs_ElementType GetType() const;
230     };
231   
232   
233     /*
234       Class       : Length
235       Description : Functor for calculating length of edge
236     */
237     class SMESHCONTROLS_EXPORT Length: public virtual NumericalFunctor{
238     public:
239       virtual double GetValue( const TSequenceOfXYZ& thePoints );
240       virtual double GetBadRate( double Value, int nbNodes ) const;
241       virtual SMDSAbs_ElementType GetType() const;
242     };
243   
244     /*
245       Class       : Length2D
246       Description : Functor for calculating length of edge
247     */
248     class SMESHCONTROLS_EXPORT Length2D: public virtual NumericalFunctor{
249     public:
250       virtual double GetValue( long theElementId );
251       virtual double GetBadRate( double Value, int nbNodes ) const;
252       virtual SMDSAbs_ElementType GetType() const;
253       struct Value{
254         double myLength;
255         long myPntId[2];
256         Value(double theLength, long thePntId1, long thePntId2);
257         bool operator<(const Value& x) const;
258       };
259       typedef std::set<Value> TValues;
260       void GetValues(TValues& theValues);
261       
262     };
263     typedef boost::shared_ptr<Length2D> Length2DPtr;
264
265     /*
266       Class       : MultiConnection
267       Description : Functor for calculating number of faces conneted to the edge
268     */
269     class SMESHCONTROLS_EXPORT MultiConnection: public virtual NumericalFunctor{
270     public:
271       virtual double GetValue( long theElementId );
272       virtual double GetValue( const TSequenceOfXYZ& thePoints );
273       virtual double GetBadRate( double Value, int nbNodes ) const;
274       virtual SMDSAbs_ElementType GetType() const;
275     };
276     
277     /*
278       Class       : MultiConnection2D
279       Description : Functor for calculating number of faces conneted to the edge
280     */
281     class SMESHCONTROLS_EXPORT MultiConnection2D: public virtual NumericalFunctor{
282     public:
283       virtual double GetValue( long theElementId );
284       virtual double GetValue( const TSequenceOfXYZ& thePoints );
285       virtual double GetBadRate( double Value, int nbNodes ) const;
286       virtual SMDSAbs_ElementType GetType() const;
287       struct Value{
288         long myPntId[2];
289         Value(long thePntId1, long thePntId2);
290         bool operator<(const Value& x) const;
291       };
292       typedef std::map<Value,int> MValues;
293
294       void GetValues(MValues& theValues);
295     };
296     typedef boost::shared_ptr<MultiConnection2D> MultiConnection2DPtr;
297     /*
298       PREDICATES
299     */
300     /*
301       Class       : Predicate
302       Description : Base class for all predicates
303     */
304     class SMESHCONTROLS_EXPORT Predicate: public virtual Functor{
305     public:
306       virtual bool IsSatisfy( long theElementId ) = 0;
307       virtual SMDSAbs_ElementType GetType() const = 0;
308     };
309     
310   
311   
312     /*
313       Class       : FreeBorders
314       Description : Predicate for free borders
315     */
316     class SMESHCONTROLS_EXPORT FreeBorders: public virtual Predicate{
317     public:
318       FreeBorders();
319       virtual void SetMesh( const SMDS_Mesh* theMesh );
320       virtual bool IsSatisfy( long theElementId );
321       virtual SMDSAbs_ElementType GetType() const;
322             
323     protected:
324       const SMDS_Mesh* myMesh;
325     };
326    
327
328     /*
329       Class       : BadOrientedVolume
330       Description : Predicate bad oriented volumes
331     */
332     class SMESHCONTROLS_EXPORT BadOrientedVolume: public virtual Predicate{
333     public:
334       BadOrientedVolume();
335       virtual void SetMesh( const SMDS_Mesh* theMesh );
336       virtual bool IsSatisfy( long theElementId );
337       virtual SMDSAbs_ElementType GetType() const;
338             
339     protected:
340       const SMDS_Mesh* myMesh;
341     };
342    
343
344     /*
345       Class       : FreeEdges
346       Description : Predicate for free Edges
347     */
348     class SMESHCONTROLS_EXPORT FreeEdges: public virtual Predicate{
349     public:
350       FreeEdges();
351       virtual void SetMesh( const SMDS_Mesh* theMesh );
352       virtual bool IsSatisfy( long theElementId );
353       virtual SMDSAbs_ElementType GetType() const;
354       static bool IsFreeEdge( const SMDS_MeshNode** theNodes, const int theFaceId  );
355       typedef long TElemId;
356       struct Border{
357         TElemId myElemId;
358         TElemId myPntId[2];
359         Border(long theElemId, long thePntId1, long thePntId2);
360         bool operator<(const Border& x) const;
361       };
362       typedef std::set<Border> TBorders;
363       void GetBoreders(TBorders& theBorders);
364       
365     protected:
366       const SMDS_Mesh* myMesh;
367     };
368     typedef boost::shared_ptr<FreeEdges> FreeEdgesPtr;
369
370
371     /*
372       Class       : RangeOfIds
373       Description : Predicate for Range of Ids.
374                     Range may be specified with two ways.
375                     1. Using AddToRange method
376                     2. With SetRangeStr method. Parameter of this method is a string
377                        like as "1,2,3,50-60,63,67,70-"
378     */
379     class SMESHCONTROLS_EXPORT RangeOfIds: public virtual Predicate
380     {
381     public:
382                                     RangeOfIds();
383       virtual void                  SetMesh( const SMDS_Mesh* theMesh );
384       virtual bool                  IsSatisfy( long theNodeId );
385       virtual SMDSAbs_ElementType   GetType() const;
386       virtual void                  SetType( SMDSAbs_ElementType theType );
387
388       bool                          AddToRange( long theEntityId );
389       void                          GetRangeStr( TCollection_AsciiString& );
390       bool                          SetRangeStr( const TCollection_AsciiString& );
391
392     protected:
393       const SMDS_Mesh*              myMesh;
394
395       TColStd_SequenceOfInteger     myMin;
396       TColStd_SequenceOfInteger     myMax;
397       TColStd_MapOfInteger          myIds;
398
399       SMDSAbs_ElementType           myType;
400     };
401     
402     typedef boost::shared_ptr<RangeOfIds> RangeOfIdsPtr;
403    
404     
405     /*
406       Class       : Comparator
407       Description : Base class for comparators
408     */
409     class SMESHCONTROLS_EXPORT Comparator: public virtual Predicate{
410     public:
411       Comparator();
412       virtual ~Comparator();
413       virtual void SetMesh( const SMDS_Mesh* theMesh );
414       virtual void SetMargin(double theValue);
415       virtual void SetNumFunctor(NumericalFunctorPtr theFunct);
416       virtual bool IsSatisfy( long theElementId ) = 0;
417       virtual SMDSAbs_ElementType GetType() const;
418       double  GetMargin();
419   
420     protected:
421       double myMargin;
422       NumericalFunctorPtr myFunctor;
423     };
424     typedef boost::shared_ptr<Comparator> ComparatorPtr;
425   
426   
427     /*
428       Class       : LessThan
429       Description : Comparator "<"
430     */
431     class SMESHCONTROLS_EXPORT LessThan: public virtual Comparator{
432     public:
433       virtual bool IsSatisfy( long theElementId );
434     };
435   
436   
437     /*
438       Class       : MoreThan
439       Description : Comparator ">"
440     */
441     class SMESHCONTROLS_EXPORT MoreThan: public virtual Comparator{
442     public:
443       virtual bool IsSatisfy( long theElementId );
444     };
445   
446   
447     /*
448       Class       : EqualTo
449       Description : Comparator "="
450     */
451     class SMESHCONTROLS_EXPORT EqualTo: public virtual Comparator{
452     public:
453       EqualTo();
454       virtual bool IsSatisfy( long theElementId );
455       virtual void SetTolerance( double theTol );
456       virtual double GetTolerance();
457   
458     private:
459       double myToler;
460     };
461     typedef boost::shared_ptr<EqualTo> EqualToPtr;
462   
463     
464     /*
465       Class       : LogicalNOT
466       Description : Logical NOT predicate
467     */
468     class SMESHCONTROLS_EXPORT LogicalNOT: public virtual Predicate{
469     public:
470       LogicalNOT();
471       virtual ~LogicalNOT();
472       virtual bool IsSatisfy( long theElementId );
473       virtual void SetMesh( const SMDS_Mesh* theMesh );
474       virtual void SetPredicate(PredicatePtr thePred);
475       virtual SMDSAbs_ElementType GetType() const;
476   
477     private:
478       PredicatePtr myPredicate;
479     };
480     typedef boost::shared_ptr<LogicalNOT> LogicalNOTPtr;
481     
482   
483     /*
484       Class       : LogicalBinary
485       Description : Base class for binary logical predicate
486     */
487     class SMESHCONTROLS_EXPORT LogicalBinary: public virtual Predicate{
488     public:
489       LogicalBinary();
490       virtual ~LogicalBinary();
491       virtual void SetMesh( const SMDS_Mesh* theMesh );
492       virtual void SetPredicate1(PredicatePtr thePred);
493       virtual void SetPredicate2(PredicatePtr thePred);
494       virtual SMDSAbs_ElementType GetType() const;
495   
496     protected:
497       PredicatePtr myPredicate1;
498       PredicatePtr myPredicate2;
499     };
500     typedef boost::shared_ptr<LogicalBinary> LogicalBinaryPtr;
501   
502   
503     /*
504       Class       : LogicalAND
505       Description : Logical AND
506     */
507     class SMESHCONTROLS_EXPORT LogicalAND: public virtual LogicalBinary{
508     public:
509       virtual bool IsSatisfy( long theElementId );
510     };
511   
512   
513     /*
514       Class       : LogicalOR
515       Description : Logical OR
516     */
517     class SMESHCONTROLS_EXPORT LogicalOR: public virtual LogicalBinary{
518     public:
519       virtual bool IsSatisfy( long theElementId );
520     };
521   
522   
523     /*
524       Class       : ManifoldPart
525       Description : Predicate for manifold part of mesh
526     */
527     class SMESHCONTROLS_EXPORT ManifoldPart: public virtual Predicate{
528     public:
529
530       /* internal class for algorithm uses */
531       class Link
532       {
533       public:
534         Link( SMDS_MeshNode* theNode1,
535               SMDS_MeshNode* theNode2 );
536         ~Link();
537         
538         bool IsEqual( const ManifoldPart::Link& theLink ) const;
539         bool operator<(const ManifoldPart::Link& x) const;
540         
541         SMDS_MeshNode* myNode1;
542         SMDS_MeshNode* myNode2;
543       };
544
545       bool IsEqual( const ManifoldPart::Link& theLink1,
546                     const ManifoldPart::Link& theLink2 );
547       
548       typedef std::set<ManifoldPart::Link>                TMapOfLink;
549       typedef std::vector<SMDS_MeshFace*>                 TVectorOfFacePtr;
550       typedef std::vector<ManifoldPart::Link>             TVectorOfLink;
551       typedef std::map<SMDS_MeshFace*,int>                TDataMapFacePtrInt;
552       typedef std::map<ManifoldPart::Link,SMDS_MeshFace*> TDataMapOfLinkFacePtr;
553       
554       ManifoldPart();
555       ~ManifoldPart();
556       virtual void SetMesh( const SMDS_Mesh* theMesh );
557       // inoke when all parameters already set
558       virtual bool IsSatisfy( long theElementId );
559       virtual      SMDSAbs_ElementType GetType() const;
560
561       void    SetAngleTolerance( const double theAngToler );
562       double  GetAngleTolerance() const;
563       void    SetIsOnlyManifold( const bool theIsOnly );
564       void    SetStartElem( const long  theStartElemId );
565
566     private:
567       bool    process();
568       bool    findConnected( const TDataMapFacePtrInt& theAllFacePtrInt,
569                              SMDS_MeshFace*            theStartFace,
570                              TMapOfLink&               theNonManifold,
571                              TColStd_MapOfInteger&     theResFaces );
572       bool    isInPlane( const SMDS_MeshFace* theFace1,
573                           const SMDS_MeshFace* theFace2 );
574       void    expandBoundary( TMapOfLink&            theMapOfBoundary,
575                               TVectorOfLink&         theSeqOfBoundary,
576                               TDataMapOfLinkFacePtr& theDMapLinkFacePtr,
577                               TMapOfLink&            theNonManifold,
578                               SMDS_MeshFace*         theNextFace ) const;
579
580      void     getFacesByLink( const Link& theLink,
581                               TVectorOfFacePtr& theFaces ) const;
582
583     private:
584       const SMDS_Mesh*      myMesh;
585       TColStd_MapOfInteger  myMapIds;
586       TColStd_MapOfInteger  myMapBadGeomIds;
587       TVectorOfFacePtr      myAllFacePtr;
588       TDataMapFacePtrInt    myAllFacePtrIntDMap;
589       double                myAngToler;
590       bool                  myIsOnlyManifold;
591       long                  myStartElemId;
592
593     };
594     typedef boost::shared_ptr<ManifoldPart> ManifoldPartPtr;
595                          
596
597     /*
598       Class       : ElementsOnSurface
599       Description : Predicate elements that lying on indicated surface
600                     (plane or cylinder)
601     */
602     class SMESHCONTROLS_EXPORT ElementsOnSurface : public virtual Predicate {
603     public:
604       ElementsOnSurface();
605       ~ElementsOnSurface();
606       virtual void SetMesh( const SMDS_Mesh* theMesh );
607       virtual bool IsSatisfy( long theElementId );
608       virtual      SMDSAbs_ElementType GetType() const;
609
610       void    SetTolerance( const double theToler );
611       double  GetTolerance() const;
612       void    SetSurface( const TopoDS_Shape& theShape,
613                           const SMDSAbs_ElementType theType );
614       void    SetUseBoundaries( bool theUse );
615       bool    GetUseBoundaries() const { return myUseBoundaries; }
616
617     private:
618       void    process();
619       void    process( const SMDS_MeshElement* theElem  );
620       bool    isOnSurface( const SMDS_MeshNode* theNode );
621
622     private:
623       const SMDS_Mesh*      myMesh;
624       TColStd_MapOfInteger  myIds;
625       SMDSAbs_ElementType   myType;
626       //Handle(Geom_Surface)  mySurf;
627       TopoDS_Face           mySurf;
628       double                myToler;
629       bool                  myUseBoundaries;
630       GeomAPI_ProjectPointOnSurf myProjector;
631     };
632     
633     typedef boost::shared_ptr<ElementsOnSurface> ElementsOnSurfacePtr;
634
635     /*
636       Class       : ElementsOnShape
637       Description : Predicate elements that lying on indicated shape
638                     (1D, 2D or 3D)
639     */
640     class SMESHCONTROLS_EXPORT ElementsOnShape : public virtual Predicate
641     {
642     public:
643       ElementsOnShape();
644       ~ElementsOnShape();
645
646       virtual void SetMesh (const SMDS_Mesh* theMesh);
647       virtual bool IsSatisfy (long theElementId);
648       virtual SMDSAbs_ElementType GetType() const;
649
650       void    SetTolerance (const double theToler);
651       double  GetTolerance() const;
652       void    SetAllNodes (bool theAllNodes);
653       bool    GetAllNodes() const { return myAllNodesFlag; }
654       void    SetShape (const TopoDS_Shape& theShape,
655                         const SMDSAbs_ElementType theType);
656
657     private:
658       void    addShape (const TopoDS_Shape& theShape);
659       void    process();
660       void    process (const SMDS_MeshElement* theElem);
661
662     private:
663       const SMDS_Mesh*      myMesh;
664       TColStd_MapOfInteger  myIds;
665       SMDSAbs_ElementType   myType;
666       TopoDS_Shape          myShape;
667       double                myToler;
668       bool                  myAllNodesFlag;
669
670       TopTools_MapOfShape         myShapesMap;
671       TopAbs_ShapeEnum            myCurShapeType; // type of current sub-shape
672       BRepClass3d_SolidClassifier myCurSC;        // current SOLID
673       GeomAPI_ProjectPointOnSurf  myCurProjFace;  // current FACE
674       TopoDS_Face                 myCurFace;      // current FACE
675       GeomAPI_ProjectPointOnCurve myCurProjEdge;  // current EDGE
676       gp_Pnt                      myCurPnt;       // current VERTEX
677     };
678
679     typedef boost::shared_ptr<ElementsOnShape> ElementsOnShapePtr;
680       
681
682     /*
683       FILTER
684     */
685     class SMESHCONTROLS_EXPORT Filter{
686     public:
687       Filter();
688       virtual ~Filter();
689       virtual void SetPredicate(PredicatePtr thePred);
690
691       typedef std::vector<long> TIdSequence;
692
693       virtual 
694       void
695       GetElementsId( const SMDS_Mesh* theMesh,
696                      TIdSequence& theSequence );
697
698       static
699       void
700       GetElementsId( const SMDS_Mesh* theMesh, 
701                      PredicatePtr thePredicate,
702                      TIdSequence& theSequence );
703       
704     protected:
705       PredicatePtr myPredicate;
706     };
707   };  
708 };
709
710
711 #endif