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