1 // Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 #ifndef _SMESH_CONTROLSDEF_HXX_
24 #define _SMESH_CONTROLSDEF_HXX_
30 #include <boost/shared_ptr.hpp>
33 #include <GeomAPI_ProjectPointOnSurf.hxx>
34 #include <GeomAPI_ProjectPointOnCurve.hxx>
35 #include <TColStd_SequenceOfInteger.hxx>
36 #include <TColStd_MapOfInteger.hxx>
37 #include <TCollection_AsciiString.hxx>
39 #include <TopoDS_Face.hxx>
40 #include <TopTools_MapOfShape.hxx>
41 #include <BRepClass3d_SolidClassifier.hxx>
42 #include <Quantity_Color.hxx>
44 #include "SMDSAbs_ElementType.hxx"
45 #include "SMDS_MeshNode.hxx"
47 #include "SMESH_Controls.hxx"
49 class SMDS_MeshElement;
55 class SMESHDS_SubMesh;
62 class SMESHCONTROLS_EXPORT TSequenceOfXYZ
64 typedef std::vector<gp_XYZ>::size_type size_type;
69 TSequenceOfXYZ(size_type n);
71 TSequenceOfXYZ(size_type n, const gp_XYZ& t);
73 TSequenceOfXYZ(const TSequenceOfXYZ& theSequenceOfXYZ);
75 template <class InputIterator>
76 TSequenceOfXYZ(InputIterator theBegin, InputIterator theEnd);
80 TSequenceOfXYZ& operator=(const TSequenceOfXYZ& theSequenceOfXYZ);
82 gp_XYZ& operator()(size_type n);
84 const gp_XYZ& operator()(size_type n) const;
88 void reserve(size_type n);
90 void push_back(const gp_XYZ& v);
92 size_type size() const;
95 std::vector<gp_XYZ> myArray;
99 Class : NumericalFunctor
100 Description : Root of all Functors returning numeric value
102 class SMESHCONTROLS_EXPORT NumericalFunctor: public virtual Functor{
105 virtual void SetMesh( const SMDS_Mesh* theMesh );
106 virtual double GetValue( long theElementId );
107 virtual double GetValue(const TSequenceOfXYZ& thePoints) { return -1.0;};
108 void GetHistogram(int nbIntervals,
109 std::vector<int>& nbEvents,
110 std::vector<double>& funValues,
111 const std::vector<int>& elements,
112 const double* minmax=0);
113 virtual SMDSAbs_ElementType GetType() const = 0;
114 virtual double GetBadRate( double Value, int nbNodes ) const = 0;
115 long GetPrecision() const;
116 void SetPrecision( const long thePrecision );
117 double Round( const double & value );
119 bool GetPoints(const int theId,
120 TSequenceOfXYZ& theRes) const;
121 static bool GetPoints(const SMDS_MeshElement* theElem,
122 TSequenceOfXYZ& theRes);
124 const SMDS_Mesh* myMesh;
125 const SMDS_MeshElement* myCurrElement;
127 double myPrecisionValue;
133 Description : Functor calculating volume of 3D mesh element
135 class SMESHCONTROLS_EXPORT Volume: public virtual NumericalFunctor{
137 virtual double GetValue( long theElementId );
138 //virtual double GetValue( const TSequenceOfXYZ& thePoints );
139 virtual double GetBadRate( double Value, int nbNodes ) const;
140 virtual SMDSAbs_ElementType GetType() const;
145 Class : MaxElementLength2D
146 Description : Functor calculating maximum length of 2D element
148 class SMESHCONTROLS_EXPORT MaxElementLength2D: public virtual NumericalFunctor{
150 virtual double GetValue( long theElementId );
151 virtual double GetBadRate( double Value, int nbNodes ) const;
152 virtual SMDSAbs_ElementType GetType() const;
157 Class : MaxElementLength3D
158 Description : Functor calculating maximum length of 3D element
160 class SMESHCONTROLS_EXPORT MaxElementLength3D: public virtual NumericalFunctor{
162 virtual double GetValue( long theElementId );
163 virtual double GetBadRate( double Value, int nbNodes ) const;
164 virtual SMDSAbs_ElementType GetType() const;
169 Class : SMESH_MinimumAngle
170 Description : Functor for calculation of minimum angle
172 class SMESHCONTROLS_EXPORT MinimumAngle: public virtual NumericalFunctor{
174 virtual double GetValue( const TSequenceOfXYZ& thePoints );
175 virtual double GetBadRate( double Value, int nbNodes ) const;
176 virtual SMDSAbs_ElementType GetType() const;
182 Description : Functor for calculating aspect ratio
184 class SMESHCONTROLS_EXPORT AspectRatio: public virtual NumericalFunctor{
186 virtual double GetValue( const TSequenceOfXYZ& thePoints );
187 virtual double GetBadRate( double Value, int nbNodes ) const;
188 virtual SMDSAbs_ElementType GetType() const;
193 Class : AspectRatio3D
194 Description : Functor for calculating aspect ratio of 3D elems.
196 class SMESHCONTROLS_EXPORT AspectRatio3D: public virtual NumericalFunctor{
198 virtual double GetValue( long theElementId );
199 virtual double GetValue( const TSequenceOfXYZ& thePoints );
200 virtual double GetBadRate( double Value, int nbNodes ) const;
201 virtual SMDSAbs_ElementType GetType() const;
207 Description : Functor for calculating warping
209 class SMESHCONTROLS_EXPORT Warping: public virtual NumericalFunctor{
211 virtual double GetValue( const TSequenceOfXYZ& thePoints );
212 virtual double GetBadRate( double Value, int nbNodes ) const;
213 virtual SMDSAbs_ElementType GetType() const;
216 double ComputeA( const gp_XYZ&, const gp_XYZ&, const gp_XYZ&, const gp_XYZ& ) const;
222 Description : Functor for calculating taper
224 class SMESHCONTROLS_EXPORT Taper: public virtual NumericalFunctor{
226 virtual double GetValue( const TSequenceOfXYZ& thePoints );
227 virtual double GetBadRate( double Value, int nbNodes ) const;
228 virtual SMDSAbs_ElementType GetType() const;
234 Description : Functor for calculating skew in degrees
236 class SMESHCONTROLS_EXPORT Skew: public virtual NumericalFunctor{
238 virtual double GetValue( const TSequenceOfXYZ& thePoints );
239 virtual double GetBadRate( double Value, int nbNodes ) const;
240 virtual SMDSAbs_ElementType GetType() const;
246 Description : Functor for calculating area
248 class SMESHCONTROLS_EXPORT Area: public virtual NumericalFunctor{
250 virtual double GetValue( const TSequenceOfXYZ& thePoints );
251 virtual double GetBadRate( double Value, int nbNodes ) const;
252 virtual SMDSAbs_ElementType GetType() const;
258 Description : Functor for calculating length of edge
260 class SMESHCONTROLS_EXPORT Length: public virtual NumericalFunctor{
262 virtual double GetValue( const TSequenceOfXYZ& thePoints );
263 virtual double GetBadRate( double Value, int nbNodes ) const;
264 virtual SMDSAbs_ElementType GetType() const;
269 Description : Functor for calculating length of edge
271 class SMESHCONTROLS_EXPORT Length2D: public virtual NumericalFunctor{
273 virtual double GetValue( long theElementId );
274 virtual double GetBadRate( double Value, int nbNodes ) const;
275 virtual SMDSAbs_ElementType GetType() const;
279 Value(double theLength, long thePntId1, long thePntId2);
280 bool operator<(const Value& x) const;
282 typedef std::set<Value> TValues;
283 void GetValues(TValues& theValues);
285 typedef boost::shared_ptr<Length2D> Length2DPtr;
288 Class : MultiConnection
289 Description : Functor for calculating number of faces conneted to the edge
291 class SMESHCONTROLS_EXPORT MultiConnection: public virtual NumericalFunctor{
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;
300 Class : MultiConnection2D
301 Description : Functor for calculating number of faces conneted to the edge
303 class SMESHCONTROLS_EXPORT MultiConnection2D: public virtual NumericalFunctor{
305 virtual double GetValue( long theElementId );
306 virtual double GetValue( const TSequenceOfXYZ& thePoints );
307 virtual double GetBadRate( double Value, int nbNodes ) const;
308 virtual SMDSAbs_ElementType GetType() const;
311 Value(long thePntId1, long thePntId2);
312 bool operator<(const Value& x) const;
314 typedef std::map<Value,int> MValues;
316 void GetValues(MValues& theValues);
318 typedef boost::shared_ptr<MultiConnection2D> MultiConnection2DPtr;
324 Description : Predicate for free borders
326 class SMESHCONTROLS_EXPORT FreeBorders: public virtual Predicate{
329 virtual void SetMesh( const SMDS_Mesh* theMesh );
330 virtual bool IsSatisfy( long theElementId );
331 virtual SMDSAbs_ElementType GetType() const;
334 const SMDS_Mesh* myMesh;
339 Class : BadOrientedVolume
340 Description : Predicate bad oriented volumes
342 class SMESHCONTROLS_EXPORT BadOrientedVolume: public virtual Predicate{
345 virtual void SetMesh( const SMDS_Mesh* theMesh );
346 virtual bool IsSatisfy( long theElementId );
347 virtual SMDSAbs_ElementType GetType() const;
350 const SMDS_Mesh* myMesh;
356 class SMESHCONTROLS_EXPORT BareBorderVolume: public Predicate
359 BareBorderVolume():myMesh(0) {}
360 virtual void SetMesh( const SMDS_Mesh* theMesh ) { myMesh = theMesh; }
361 virtual SMDSAbs_ElementType GetType() const { return SMDSAbs_Volume; }
362 virtual bool IsSatisfy( long theElementId );
364 const SMDS_Mesh* myMesh;
366 typedef boost::shared_ptr<BareBorderVolume> BareBorderVolumePtr;
371 class SMESHCONTROLS_EXPORT BareBorderFace: public Predicate
374 BareBorderFace():myMesh(0) {}
375 virtual void SetMesh( const SMDS_Mesh* theMesh ) { myMesh = theMesh; }
376 virtual SMDSAbs_ElementType GetType() const { return SMDSAbs_Face; }
377 virtual bool IsSatisfy( long theElementId );
379 const SMDS_Mesh* myMesh;
380 std::vector< const SMDS_MeshNode* > myLinkNodes;
382 typedef boost::shared_ptr<BareBorderFace> BareBorderFacePtr;
385 OverConstrainedVolume
387 class SMESHCONTROLS_EXPORT OverConstrainedVolume: public Predicate
390 OverConstrainedVolume():myMesh(0) {}
391 virtual void SetMesh( const SMDS_Mesh* theMesh ) { myMesh = theMesh; }
392 virtual SMDSAbs_ElementType GetType() const { return SMDSAbs_Volume; }
393 virtual bool IsSatisfy( long theElementId );
395 const SMDS_Mesh* myMesh;
397 typedef boost::shared_ptr<OverConstrainedVolume> OverConstrainedVolumePtr;
402 class SMESHCONTROLS_EXPORT OverConstrainedFace: public Predicate
405 OverConstrainedFace():myMesh(0) {}
406 virtual void SetMesh( const SMDS_Mesh* theMesh ) { myMesh = theMesh; }
407 virtual SMDSAbs_ElementType GetType() const { return SMDSAbs_Face; }
408 virtual bool IsSatisfy( long theElementId );
410 const SMDS_Mesh* myMesh;
411 std::vector< const SMDS_MeshNode* > myLinkNodes;
413 typedef boost::shared_ptr<OverConstrainedFace> OverConstrainedFacePtr;
417 Description : Predicate for free Edges
419 class SMESHCONTROLS_EXPORT FreeEdges: public virtual Predicate{
422 virtual void SetMesh( const SMDS_Mesh* theMesh );
423 virtual bool IsSatisfy( long theElementId );
424 virtual SMDSAbs_ElementType GetType() const;
425 static bool IsFreeEdge( const SMDS_MeshNode** theNodes, const int theFaceId );
426 typedef long TElemId;
430 Border(long theElemId, long thePntId1, long thePntId2);
431 bool operator<(const Border& x) const;
433 typedef std::set<Border> TBorders;
434 void GetBoreders(TBorders& theBorders);
437 const SMDS_Mesh* myMesh;
439 typedef boost::shared_ptr<FreeEdges> FreeEdgesPtr;
444 Description : Predicate for free nodes
446 class SMESHCONTROLS_EXPORT FreeNodes: public virtual Predicate{
449 virtual void SetMesh( const SMDS_Mesh* theMesh );
450 virtual bool IsSatisfy( long theNodeId );
451 virtual SMDSAbs_ElementType GetType() const;
454 const SMDS_Mesh* myMesh;
460 Description : Predicate for Range of Ids.
461 Range may be specified with two ways.
462 1. Using AddToRange method
463 2. With SetRangeStr method. Parameter of this method is a string
464 like as "1,2,3,50-60,63,67,70-"
466 class SMESHCONTROLS_EXPORT RangeOfIds: public virtual Predicate
470 virtual void SetMesh( const SMDS_Mesh* theMesh );
471 virtual bool IsSatisfy( long theNodeId );
472 virtual SMDSAbs_ElementType GetType() const;
473 virtual void SetType( SMDSAbs_ElementType theType );
475 bool AddToRange( long theEntityId );
476 void GetRangeStr( TCollection_AsciiString& );
477 bool SetRangeStr( const TCollection_AsciiString& );
480 const SMDS_Mesh* myMesh;
482 TColStd_SequenceOfInteger myMin;
483 TColStd_SequenceOfInteger myMax;
484 TColStd_MapOfInteger myIds;
486 SMDSAbs_ElementType myType;
489 typedef boost::shared_ptr<RangeOfIds> RangeOfIdsPtr;
494 Description : Base class for comparators
496 class SMESHCONTROLS_EXPORT Comparator: public virtual Predicate{
499 virtual ~Comparator();
500 virtual void SetMesh( const SMDS_Mesh* theMesh );
501 virtual void SetMargin(double theValue);
502 virtual void SetNumFunctor(NumericalFunctorPtr theFunct);
503 virtual bool IsSatisfy( long theElementId ) = 0;
504 virtual SMDSAbs_ElementType GetType() const;
509 NumericalFunctorPtr myFunctor;
511 typedef boost::shared_ptr<Comparator> ComparatorPtr;
516 Description : Comparator "<"
518 class SMESHCONTROLS_EXPORT LessThan: public virtual Comparator{
520 virtual bool IsSatisfy( long theElementId );
526 Description : Comparator ">"
528 class SMESHCONTROLS_EXPORT MoreThan: public virtual Comparator{
530 virtual bool IsSatisfy( long theElementId );
536 Description : Comparator "="
538 class SMESHCONTROLS_EXPORT EqualTo: public virtual Comparator{
541 virtual bool IsSatisfy( long theElementId );
542 virtual void SetTolerance( double theTol );
543 virtual double GetTolerance();
548 typedef boost::shared_ptr<EqualTo> EqualToPtr;
553 Description : Logical NOT predicate
555 class SMESHCONTROLS_EXPORT LogicalNOT: public virtual Predicate{
558 virtual ~LogicalNOT();
559 virtual bool IsSatisfy( long theElementId );
560 virtual void SetMesh( const SMDS_Mesh* theMesh );
561 virtual void SetPredicate(PredicatePtr thePred);
562 virtual SMDSAbs_ElementType GetType() const;
565 PredicatePtr myPredicate;
567 typedef boost::shared_ptr<LogicalNOT> LogicalNOTPtr;
571 Class : LogicalBinary
572 Description : Base class for binary logical predicate
574 class SMESHCONTROLS_EXPORT LogicalBinary: public virtual Predicate{
577 virtual ~LogicalBinary();
578 virtual void SetMesh( const SMDS_Mesh* theMesh );
579 virtual void SetPredicate1(PredicatePtr thePred);
580 virtual void SetPredicate2(PredicatePtr thePred);
581 virtual SMDSAbs_ElementType GetType() const;
584 PredicatePtr myPredicate1;
585 PredicatePtr myPredicate2;
587 typedef boost::shared_ptr<LogicalBinary> LogicalBinaryPtr;
592 Description : Logical AND
594 class SMESHCONTROLS_EXPORT LogicalAND: public virtual LogicalBinary{
596 virtual bool IsSatisfy( long theElementId );
602 Description : Logical OR
604 class SMESHCONTROLS_EXPORT LogicalOR: public virtual LogicalBinary{
606 virtual bool IsSatisfy( long theElementId );
612 Description : Predicate for manifold part of mesh
614 class SMESHCONTROLS_EXPORT ManifoldPart: public virtual Predicate{
617 /* internal class for algorithm uses */
621 Link( SMDS_MeshNode* theNode1,
622 SMDS_MeshNode* theNode2 );
625 bool IsEqual( const ManifoldPart::Link& theLink ) const;
626 bool operator<(const ManifoldPart::Link& x) const;
628 SMDS_MeshNode* myNode1;
629 SMDS_MeshNode* myNode2;
632 bool IsEqual( const ManifoldPart::Link& theLink1,
633 const ManifoldPart::Link& theLink2 );
635 typedef std::set<ManifoldPart::Link> TMapOfLink;
636 typedef std::vector<SMDS_MeshFace*> TVectorOfFacePtr;
637 typedef std::vector<ManifoldPart::Link> TVectorOfLink;
638 typedef std::map<SMDS_MeshFace*,int> TDataMapFacePtrInt;
639 typedef std::map<ManifoldPart::Link,SMDS_MeshFace*> TDataMapOfLinkFacePtr;
643 virtual void SetMesh( const SMDS_Mesh* theMesh );
644 // inoke when all parameters already set
645 virtual bool IsSatisfy( long theElementId );
646 virtual SMDSAbs_ElementType GetType() const;
648 void SetAngleTolerance( const double theAngToler );
649 double GetAngleTolerance() const;
650 void SetIsOnlyManifold( const bool theIsOnly );
651 void SetStartElem( const long theStartElemId );
655 bool findConnected( const TDataMapFacePtrInt& theAllFacePtrInt,
656 SMDS_MeshFace* theStartFace,
657 TMapOfLink& theNonManifold,
658 TColStd_MapOfInteger& theResFaces );
659 bool isInPlane( const SMDS_MeshFace* theFace1,
660 const SMDS_MeshFace* theFace2 );
661 void expandBoundary( TMapOfLink& theMapOfBoundary,
662 TVectorOfLink& theSeqOfBoundary,
663 TDataMapOfLinkFacePtr& theDMapLinkFacePtr,
664 TMapOfLink& theNonManifold,
665 SMDS_MeshFace* theNextFace ) const;
667 void getFacesByLink( const Link& theLink,
668 TVectorOfFacePtr& theFaces ) const;
671 const SMDS_Mesh* myMesh;
672 TColStd_MapOfInteger myMapIds;
673 TColStd_MapOfInteger myMapBadGeomIds;
674 TVectorOfFacePtr myAllFacePtr;
675 TDataMapFacePtrInt myAllFacePtrIntDMap;
677 bool myIsOnlyManifold;
681 typedef boost::shared_ptr<ManifoldPart> ManifoldPartPtr;
685 Class : ElementsOnSurface
686 Description : Predicate elements that lying on indicated surface
689 class SMESHCONTROLS_EXPORT ElementsOnSurface : public virtual Predicate {
692 ~ElementsOnSurface();
693 virtual void SetMesh( const SMDS_Mesh* theMesh );
694 virtual bool IsSatisfy( long theElementId );
695 virtual SMDSAbs_ElementType GetType() const;
697 void SetTolerance( const double theToler );
698 double GetTolerance() const;
699 void SetSurface( const TopoDS_Shape& theShape,
700 const SMDSAbs_ElementType theType );
701 void SetUseBoundaries( bool theUse );
702 bool GetUseBoundaries() const { return myUseBoundaries; }
706 void process( const SMDS_MeshElement* theElem );
707 bool isOnSurface( const SMDS_MeshNode* theNode );
710 const SMDS_Mesh* myMesh;
711 TColStd_MapOfInteger myIds;
712 SMDSAbs_ElementType myType;
713 //Handle(Geom_Surface) mySurf;
716 bool myUseBoundaries;
717 GeomAPI_ProjectPointOnSurf myProjector;
720 typedef boost::shared_ptr<ElementsOnSurface> ElementsOnSurfacePtr;
724 Class : ElementsOnShape
725 Description : Predicate elements that lying on indicated shape
728 class SMESHCONTROLS_EXPORT ElementsOnShape : public virtual Predicate
734 virtual void SetMesh (const SMDS_Mesh* theMesh);
735 virtual bool IsSatisfy (long theElementId);
736 virtual SMDSAbs_ElementType GetType() const;
738 void SetTolerance (const double theToler);
739 double GetTolerance() const;
740 void SetAllNodes (bool theAllNodes);
741 bool GetAllNodes() const { return myAllNodesFlag; }
742 void SetShape (const TopoDS_Shape& theShape,
743 const SMDSAbs_ElementType theType);
746 void addShape (const TopoDS_Shape& theShape);
748 void process (const SMDS_MeshElement* theElem);
751 const SMDS_Mesh* myMesh;
752 TColStd_MapOfInteger myIds;
753 SMDSAbs_ElementType myType;
754 TopoDS_Shape myShape;
758 TopTools_MapOfShape myShapesMap;
759 TopAbs_ShapeEnum myCurShapeType; // type of current sub-shape
760 BRepClass3d_SolidClassifier myCurSC; // current SOLID
761 GeomAPI_ProjectPointOnSurf myCurProjFace; // current FACE
762 TopoDS_Face myCurFace; // current FACE
763 GeomAPI_ProjectPointOnCurve myCurProjEdge; // current EDGE
764 gp_Pnt myCurPnt; // current VERTEX
767 typedef boost::shared_ptr<ElementsOnShape> ElementsOnShapePtr;
772 Description : Predicate for free faces
774 class SMESHCONTROLS_EXPORT FreeFaces: public virtual Predicate{
777 virtual void SetMesh( const SMDS_Mesh* theMesh );
778 virtual bool IsSatisfy( long theElementId );
779 virtual SMDSAbs_ElementType GetType() const;
782 const SMDS_Mesh* myMesh;
786 Class : LinearOrQuadratic
787 Description : Predicate for free faces
789 class SMESHCONTROLS_EXPORT LinearOrQuadratic: public virtual Predicate{
792 virtual void SetMesh( const SMDS_Mesh* theMesh );
793 virtual bool IsSatisfy( long theElementId );
794 void SetType( SMDSAbs_ElementType theType );
795 virtual SMDSAbs_ElementType GetType() const;
798 const SMDS_Mesh* myMesh;
799 SMDSAbs_ElementType myType;
801 typedef boost::shared_ptr<LinearOrQuadratic> LinearOrQuadraticPtr;
805 Description : Functor for check color of group to whic mesh element belongs to
807 class SMESHCONTROLS_EXPORT GroupColor: public virtual Predicate{
810 virtual void SetMesh( const SMDS_Mesh* theMesh );
811 virtual bool IsSatisfy( long theElementId );
812 void SetType( SMDSAbs_ElementType theType );
813 virtual SMDSAbs_ElementType GetType() const;
814 void SetColorStr( const TCollection_AsciiString& );
815 void GetColorStr( TCollection_AsciiString& ) const;
818 typedef std::set< long > TIDs;
820 Quantity_Color myColor;
821 SMDSAbs_ElementType myType;
824 typedef boost::shared_ptr<GroupColor> GroupColorPtr;
828 Description : Predicate to check element geometry type
830 class SMESHCONTROLS_EXPORT ElemGeomType: public virtual Predicate{
833 virtual void SetMesh( const SMDS_Mesh* theMesh );
834 virtual bool IsSatisfy( long theElementId );
835 void SetType( SMDSAbs_ElementType theType );
836 virtual SMDSAbs_ElementType GetType() const;
837 void SetGeomType( SMDSAbs_GeometryType theType );
838 virtual SMDSAbs_GeometryType GetGeomType() const;
841 const SMDS_Mesh* myMesh;
842 SMDSAbs_ElementType myType;
843 SMDSAbs_GeometryType myGeomType;
845 typedef boost::shared_ptr<ElemGeomType> ElemGeomTypePtr;
848 Class : CoplanarFaces
849 Description : Predicate to check angle between faces
851 class SMESHCONTROLS_EXPORT CoplanarFaces: public virtual Predicate
855 void SetFace( long theID ) { myFaceID = theID; }
856 long GetFace() const { return myFaceID; }
857 void SetTolerance (const double theToler) { myToler = theToler; }
858 double GetTolerance () const { return myToler; }
859 virtual void SetMesh( const SMDS_Mesh* theMesh ) { myMesh = theMesh; }
860 virtual SMDSAbs_ElementType GetType() const { return SMDSAbs_Face; }
862 virtual bool IsSatisfy( long theElementId );
865 const SMDS_Mesh* myMesh;
868 std::set< long > myCoplanarIDs;
870 typedef boost::shared_ptr<CoplanarFaces> CoplanarFacesPtr;
875 class SMESHCONTROLS_EXPORT Filter{
879 virtual void SetPredicate(PredicatePtr thePred);
881 typedef std::vector<long> TIdSequence;
885 GetElementsId( const SMDS_Mesh* theMesh,
886 TIdSequence& theSequence );
890 GetElementsId( const SMDS_Mesh* theMesh,
891 PredicatePtr thePredicate,
892 TIdSequence& theSequence );
895 PredicatePtr myPredicate;