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