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