1 // Copyright (C) 2007-2010 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"
50 #if defined SMESHCONTROLS_EXPORTS || defined SMESHControls_EXPORTS
51 #define SMESHCONTROLS_EXPORT __declspec( dllexport )
53 #define SMESHCONTROLS_EXPORT __declspec( dllimport )
56 #define SMESHCONTROLS_EXPORT
59 class SMDS_MeshElement;
65 class SMESHDS_SubMesh;
72 class SMESHCONTROLS_EXPORT TSequenceOfXYZ
74 typedef std::vector<gp_XYZ>::size_type size_type;
79 TSequenceOfXYZ(size_type n);
81 TSequenceOfXYZ(size_type n, const gp_XYZ& t);
83 TSequenceOfXYZ(const TSequenceOfXYZ& theSequenceOfXYZ);
85 template <class InputIterator>
86 TSequenceOfXYZ(InputIterator theBegin, InputIterator theEnd);
90 TSequenceOfXYZ& operator=(const TSequenceOfXYZ& theSequenceOfXYZ);
92 gp_XYZ& operator()(size_type n);
94 const gp_XYZ& operator()(size_type n) const;
98 void reserve(size_type n);
100 void push_back(const gp_XYZ& v);
102 size_type size() const;
105 std::vector<gp_XYZ> myArray;
110 Description : Root of all Functors
112 class SMESHCONTROLS_EXPORT Functor
116 virtual void SetMesh( const SMDS_Mesh* theMesh ) = 0;
117 virtual SMDSAbs_ElementType GetType() const = 0;
121 Class : NumericalFunctor
122 Description : Root of all Functors returning numeric value
124 class SMESHCONTROLS_EXPORT NumericalFunctor: public virtual Functor{
127 virtual void SetMesh( const SMDS_Mesh* theMesh );
128 virtual double GetValue( long theElementId );
129 virtual double GetValue(const TSequenceOfXYZ& thePoints) { return -1.0;};
130 void GetHistogram(int nbIntervals,
131 std::vector<int>& nbEvents,
132 std::vector<double>& funValues,
133 const std::vector<int>& elements,
134 const double* minmax=0);
135 virtual SMDSAbs_ElementType GetType() const = 0;
136 virtual double GetBadRate( double Value, int nbNodes ) const = 0;
137 long GetPrecision() const;
138 void SetPrecision( const long thePrecision );
140 bool GetPoints(const int theId,
141 TSequenceOfXYZ& theRes) const;
142 static bool GetPoints(const SMDS_MeshElement* theElem,
143 TSequenceOfXYZ& theRes);
145 const SMDS_Mesh* myMesh;
146 const SMDS_MeshElement* myCurrElement;
153 Description : Functor calculating volume of 3D mesh element
155 class SMESHCONTROLS_EXPORT Volume: public virtual NumericalFunctor{
157 virtual double GetValue( long theElementId );
158 //virtual double GetValue( const TSequenceOfXYZ& thePoints );
159 virtual double GetBadRate( double Value, int nbNodes ) const;
160 virtual SMDSAbs_ElementType GetType() const;
165 Class : MaxElementLength2D
166 Description : Functor calculating maximum length of 2D element
168 class SMESHCONTROLS_EXPORT MaxElementLength2D: public virtual NumericalFunctor{
170 virtual double GetValue( long theElementId );
171 virtual double GetBadRate( double Value, int nbNodes ) const;
172 virtual SMDSAbs_ElementType GetType() const;
177 Class : MaxElementLength3D
178 Description : Functor calculating maximum length of 3D element
180 class SMESHCONTROLS_EXPORT MaxElementLength3D: public virtual NumericalFunctor{
182 virtual double GetValue( long theElementId );
183 virtual double GetBadRate( double Value, int nbNodes ) const;
184 virtual SMDSAbs_ElementType GetType() const;
189 Class : SMESH_MinimumAngle
190 Description : Functor for calculation of minimum angle
192 class SMESHCONTROLS_EXPORT MinimumAngle: public virtual NumericalFunctor{
194 virtual double GetValue( const TSequenceOfXYZ& thePoints );
195 virtual double GetBadRate( double Value, int nbNodes ) const;
196 virtual SMDSAbs_ElementType GetType() const;
202 Description : Functor for calculating aspect ratio
204 class SMESHCONTROLS_EXPORT AspectRatio: public virtual NumericalFunctor{
206 virtual double GetValue( const TSequenceOfXYZ& thePoints );
207 virtual double GetBadRate( double Value, int nbNodes ) const;
208 virtual SMDSAbs_ElementType GetType() const;
213 Class : AspectRatio3D
214 Description : Functor for calculating aspect ratio of 3D elems.
216 class SMESHCONTROLS_EXPORT AspectRatio3D: public virtual NumericalFunctor{
218 virtual double GetValue( const TSequenceOfXYZ& thePoints );
219 virtual double GetBadRate( double Value, int nbNodes ) const;
220 virtual SMDSAbs_ElementType GetType() const;
226 Description : Functor for calculating warping
228 class SMESHCONTROLS_EXPORT Warping: public virtual NumericalFunctor{
230 virtual double GetValue( const TSequenceOfXYZ& thePoints );
231 virtual double GetBadRate( double Value, int nbNodes ) const;
232 virtual SMDSAbs_ElementType GetType() const;
235 double ComputeA( const gp_XYZ&, const gp_XYZ&, const gp_XYZ&, const gp_XYZ& ) const;
241 Description : Functor for calculating taper
243 class SMESHCONTROLS_EXPORT Taper: public virtual NumericalFunctor{
245 virtual double GetValue( const TSequenceOfXYZ& thePoints );
246 virtual double GetBadRate( double Value, int nbNodes ) const;
247 virtual SMDSAbs_ElementType GetType() const;
253 Description : Functor for calculating skew in degrees
255 class SMESHCONTROLS_EXPORT Skew: public virtual NumericalFunctor{
257 virtual double GetValue( const TSequenceOfXYZ& thePoints );
258 virtual double GetBadRate( double Value, int nbNodes ) const;
259 virtual SMDSAbs_ElementType GetType() const;
265 Description : Functor for calculating area
267 class SMESHCONTROLS_EXPORT Area: public virtual NumericalFunctor{
269 virtual double GetValue( const TSequenceOfXYZ& thePoints );
270 virtual double GetBadRate( double Value, int nbNodes ) const;
271 virtual SMDSAbs_ElementType GetType() const;
277 Description : Functor for calculating length of edge
279 class SMESHCONTROLS_EXPORT Length: public virtual NumericalFunctor{
281 virtual double GetValue( const TSequenceOfXYZ& thePoints );
282 virtual double GetBadRate( double Value, int nbNodes ) const;
283 virtual SMDSAbs_ElementType GetType() const;
288 Description : Functor for calculating length of edge
290 class SMESHCONTROLS_EXPORT Length2D: public virtual NumericalFunctor{
292 virtual double GetValue( long theElementId );
293 virtual double GetBadRate( double Value, int nbNodes ) const;
294 virtual SMDSAbs_ElementType GetType() const;
298 Value(double theLength, long thePntId1, long thePntId2);
299 bool operator<(const Value& x) const;
301 typedef std::set<Value> TValues;
302 void GetValues(TValues& theValues);
304 typedef boost::shared_ptr<Length2D> Length2DPtr;
307 Class : MultiConnection
308 Description : Functor for calculating number of faces conneted to the edge
310 class SMESHCONTROLS_EXPORT MultiConnection: public virtual NumericalFunctor{
312 virtual double GetValue( long theElementId );
313 virtual double GetValue( const TSequenceOfXYZ& thePoints );
314 virtual double GetBadRate( double Value, int nbNodes ) const;
315 virtual SMDSAbs_ElementType GetType() const;
319 Class : MultiConnection2D
320 Description : Functor for calculating number of faces conneted to the edge
322 class SMESHCONTROLS_EXPORT MultiConnection2D: public virtual NumericalFunctor{
324 virtual double GetValue( long theElementId );
325 virtual double GetValue( const TSequenceOfXYZ& thePoints );
326 virtual double GetBadRate( double Value, int nbNodes ) const;
327 virtual SMDSAbs_ElementType GetType() const;
330 Value(long thePntId1, long thePntId2);
331 bool operator<(const Value& x) const;
333 typedef std::map<Value,int> MValues;
335 void GetValues(MValues& theValues);
337 typedef boost::shared_ptr<MultiConnection2D> MultiConnection2DPtr;
343 Description : Base class for all predicates
345 class SMESHCONTROLS_EXPORT Predicate: public virtual Functor{
347 virtual bool IsSatisfy( long theElementId ) = 0;
348 virtual SMDSAbs_ElementType GetType() const = 0;
354 Description : Predicate for free borders
356 class SMESHCONTROLS_EXPORT FreeBorders: public virtual Predicate{
359 virtual void SetMesh( const SMDS_Mesh* theMesh );
360 virtual bool IsSatisfy( long theElementId );
361 virtual SMDSAbs_ElementType GetType() const;
364 const SMDS_Mesh* myMesh;
369 Class : BadOrientedVolume
370 Description : Predicate bad oriented volumes
372 class SMESHCONTROLS_EXPORT BadOrientedVolume: public virtual Predicate{
375 virtual void SetMesh( const SMDS_Mesh* theMesh );
376 virtual bool IsSatisfy( long theElementId );
377 virtual SMDSAbs_ElementType GetType() const;
380 const SMDS_Mesh* myMesh;
386 class SMESHCONTROLS_EXPORT BareBorderVolume: public Predicate
389 BareBorderVolume():myMesh(0) {}
390 virtual void SetMesh( const SMDS_Mesh* theMesh ) { myMesh = theMesh; }
391 virtual SMDSAbs_ElementType GetType() const { return SMDSAbs_Volume; }
392 virtual bool IsSatisfy( long theElementId );
394 const SMDS_Mesh* myMesh;
396 typedef boost::shared_ptr<BareBorderVolume> BareBorderVolumePtr;
401 class SMESHCONTROLS_EXPORT BareBorderFace: public Predicate
404 BareBorderFace():myMesh(0) {}
405 virtual void SetMesh( const SMDS_Mesh* theMesh ) { myMesh = theMesh; }
406 virtual SMDSAbs_ElementType GetType() const { return SMDSAbs_Face; }
407 virtual bool IsSatisfy( long theElementId );
409 const SMDS_Mesh* myMesh;
410 std::vector< const SMDS_MeshNode* > myLinkNodes;
412 typedef boost::shared_ptr<BareBorderFace> BareBorderFacePtr;
415 OverConstrainedVolume
417 class SMESHCONTROLS_EXPORT OverConstrainedVolume: public Predicate
420 OverConstrainedVolume():myMesh(0) {}
421 virtual void SetMesh( const SMDS_Mesh* theMesh ) { myMesh = theMesh; }
422 virtual SMDSAbs_ElementType GetType() const { return SMDSAbs_Volume; }
423 virtual bool IsSatisfy( long theElementId );
425 const SMDS_Mesh* myMesh;
427 typedef boost::shared_ptr<OverConstrainedVolume> OverConstrainedVolumePtr;
432 class SMESHCONTROLS_EXPORT OverConstrainedFace: public Predicate
435 OverConstrainedFace():myMesh(0) {}
436 virtual void SetMesh( const SMDS_Mesh* theMesh ) { myMesh = theMesh; }
437 virtual SMDSAbs_ElementType GetType() const { return SMDSAbs_Face; }
438 virtual bool IsSatisfy( long theElementId );
440 const SMDS_Mesh* myMesh;
441 std::vector< const SMDS_MeshNode* > myLinkNodes;
443 typedef boost::shared_ptr<OverConstrainedFace> OverConstrainedFacePtr;
447 Description : Predicate for free Edges
449 class SMESHCONTROLS_EXPORT FreeEdges: public virtual Predicate{
452 virtual void SetMesh( const SMDS_Mesh* theMesh );
453 virtual bool IsSatisfy( long theElementId );
454 virtual SMDSAbs_ElementType GetType() const;
455 static bool IsFreeEdge( const SMDS_MeshNode** theNodes, const int theFaceId );
456 typedef long TElemId;
460 Border(long theElemId, long thePntId1, long thePntId2);
461 bool operator<(const Border& x) const;
463 typedef std::set<Border> TBorders;
464 void GetBoreders(TBorders& theBorders);
467 const SMDS_Mesh* myMesh;
469 typedef boost::shared_ptr<FreeEdges> FreeEdgesPtr;
474 Description : Predicate for free nodes
476 class SMESHCONTROLS_EXPORT FreeNodes: public virtual Predicate{
479 virtual void SetMesh( const SMDS_Mesh* theMesh );
480 virtual bool IsSatisfy( long theNodeId );
481 virtual SMDSAbs_ElementType GetType() const;
484 const SMDS_Mesh* myMesh;
490 Description : Predicate for Range of Ids.
491 Range may be specified with two ways.
492 1. Using AddToRange method
493 2. With SetRangeStr method. Parameter of this method is a string
494 like as "1,2,3,50-60,63,67,70-"
496 class SMESHCONTROLS_EXPORT RangeOfIds: public virtual Predicate
500 virtual void SetMesh( const SMDS_Mesh* theMesh );
501 virtual bool IsSatisfy( long theNodeId );
502 virtual SMDSAbs_ElementType GetType() const;
503 virtual void SetType( SMDSAbs_ElementType theType );
505 bool AddToRange( long theEntityId );
506 void GetRangeStr( TCollection_AsciiString& );
507 bool SetRangeStr( const TCollection_AsciiString& );
510 const SMDS_Mesh* myMesh;
512 TColStd_SequenceOfInteger myMin;
513 TColStd_SequenceOfInteger myMax;
514 TColStd_MapOfInteger myIds;
516 SMDSAbs_ElementType myType;
519 typedef boost::shared_ptr<RangeOfIds> RangeOfIdsPtr;
524 Description : Base class for comparators
526 class SMESHCONTROLS_EXPORT Comparator: public virtual Predicate{
529 virtual ~Comparator();
530 virtual void SetMesh( const SMDS_Mesh* theMesh );
531 virtual void SetMargin(double theValue);
532 virtual void SetNumFunctor(NumericalFunctorPtr theFunct);
533 virtual bool IsSatisfy( long theElementId ) = 0;
534 virtual SMDSAbs_ElementType GetType() const;
539 NumericalFunctorPtr myFunctor;
541 typedef boost::shared_ptr<Comparator> ComparatorPtr;
546 Description : Comparator "<"
548 class SMESHCONTROLS_EXPORT LessThan: public virtual Comparator{
550 virtual bool IsSatisfy( long theElementId );
556 Description : Comparator ">"
558 class SMESHCONTROLS_EXPORT MoreThan: public virtual Comparator{
560 virtual bool IsSatisfy( long theElementId );
566 Description : Comparator "="
568 class SMESHCONTROLS_EXPORT EqualTo: public virtual Comparator{
571 virtual bool IsSatisfy( long theElementId );
572 virtual void SetTolerance( double theTol );
573 virtual double GetTolerance();
578 typedef boost::shared_ptr<EqualTo> EqualToPtr;
583 Description : Logical NOT predicate
585 class SMESHCONTROLS_EXPORT LogicalNOT: public virtual Predicate{
588 virtual ~LogicalNOT();
589 virtual bool IsSatisfy( long theElementId );
590 virtual void SetMesh( const SMDS_Mesh* theMesh );
591 virtual void SetPredicate(PredicatePtr thePred);
592 virtual SMDSAbs_ElementType GetType() const;
595 PredicatePtr myPredicate;
597 typedef boost::shared_ptr<LogicalNOT> LogicalNOTPtr;
601 Class : LogicalBinary
602 Description : Base class for binary logical predicate
604 class SMESHCONTROLS_EXPORT LogicalBinary: public virtual Predicate{
607 virtual ~LogicalBinary();
608 virtual void SetMesh( const SMDS_Mesh* theMesh );
609 virtual void SetPredicate1(PredicatePtr thePred);
610 virtual void SetPredicate2(PredicatePtr thePred);
611 virtual SMDSAbs_ElementType GetType() const;
614 PredicatePtr myPredicate1;
615 PredicatePtr myPredicate2;
617 typedef boost::shared_ptr<LogicalBinary> LogicalBinaryPtr;
622 Description : Logical AND
624 class SMESHCONTROLS_EXPORT LogicalAND: public virtual LogicalBinary{
626 virtual bool IsSatisfy( long theElementId );
632 Description : Logical OR
634 class SMESHCONTROLS_EXPORT LogicalOR: public virtual LogicalBinary{
636 virtual bool IsSatisfy( long theElementId );
642 Description : Predicate for manifold part of mesh
644 class SMESHCONTROLS_EXPORT ManifoldPart: public virtual Predicate{
647 /* internal class for algorithm uses */
651 Link( SMDS_MeshNode* theNode1,
652 SMDS_MeshNode* theNode2 );
655 bool IsEqual( const ManifoldPart::Link& theLink ) const;
656 bool operator<(const ManifoldPart::Link& x) const;
658 SMDS_MeshNode* myNode1;
659 SMDS_MeshNode* myNode2;
662 bool IsEqual( const ManifoldPart::Link& theLink1,
663 const ManifoldPart::Link& theLink2 );
665 typedef std::set<ManifoldPart::Link> TMapOfLink;
666 typedef std::vector<SMDS_MeshFace*> TVectorOfFacePtr;
667 typedef std::vector<ManifoldPart::Link> TVectorOfLink;
668 typedef std::map<SMDS_MeshFace*,int> TDataMapFacePtrInt;
669 typedef std::map<ManifoldPart::Link,SMDS_MeshFace*> TDataMapOfLinkFacePtr;
673 virtual void SetMesh( const SMDS_Mesh* theMesh );
674 // inoke when all parameters already set
675 virtual bool IsSatisfy( long theElementId );
676 virtual SMDSAbs_ElementType GetType() const;
678 void SetAngleTolerance( const double theAngToler );
679 double GetAngleTolerance() const;
680 void SetIsOnlyManifold( const bool theIsOnly );
681 void SetStartElem( const long theStartElemId );
685 bool findConnected( const TDataMapFacePtrInt& theAllFacePtrInt,
686 SMDS_MeshFace* theStartFace,
687 TMapOfLink& theNonManifold,
688 TColStd_MapOfInteger& theResFaces );
689 bool isInPlane( const SMDS_MeshFace* theFace1,
690 const SMDS_MeshFace* theFace2 );
691 void expandBoundary( TMapOfLink& theMapOfBoundary,
692 TVectorOfLink& theSeqOfBoundary,
693 TDataMapOfLinkFacePtr& theDMapLinkFacePtr,
694 TMapOfLink& theNonManifold,
695 SMDS_MeshFace* theNextFace ) const;
697 void getFacesByLink( const Link& theLink,
698 TVectorOfFacePtr& theFaces ) const;
701 const SMDS_Mesh* myMesh;
702 TColStd_MapOfInteger myMapIds;
703 TColStd_MapOfInteger myMapBadGeomIds;
704 TVectorOfFacePtr myAllFacePtr;
705 TDataMapFacePtrInt myAllFacePtrIntDMap;
707 bool myIsOnlyManifold;
711 typedef boost::shared_ptr<ManifoldPart> ManifoldPartPtr;
715 Class : ElementsOnSurface
716 Description : Predicate elements that lying on indicated surface
719 class SMESHCONTROLS_EXPORT ElementsOnSurface : public virtual Predicate {
722 ~ElementsOnSurface();
723 virtual void SetMesh( const SMDS_Mesh* theMesh );
724 virtual bool IsSatisfy( long theElementId );
725 virtual SMDSAbs_ElementType GetType() const;
727 void SetTolerance( const double theToler );
728 double GetTolerance() const;
729 void SetSurface( const TopoDS_Shape& theShape,
730 const SMDSAbs_ElementType theType );
731 void SetUseBoundaries( bool theUse );
732 bool GetUseBoundaries() const { return myUseBoundaries; }
736 void process( const SMDS_MeshElement* theElem );
737 bool isOnSurface( const SMDS_MeshNode* theNode );
740 const SMDS_Mesh* myMesh;
741 TColStd_MapOfInteger myIds;
742 SMDSAbs_ElementType myType;
743 //Handle(Geom_Surface) mySurf;
746 bool myUseBoundaries;
747 GeomAPI_ProjectPointOnSurf myProjector;
750 typedef boost::shared_ptr<ElementsOnSurface> ElementsOnSurfacePtr;
754 Class : ElementsOnShape
755 Description : Predicate elements that lying on indicated shape
758 class SMESHCONTROLS_EXPORT ElementsOnShape : public virtual Predicate
764 virtual void SetMesh (const SMDS_Mesh* theMesh);
765 virtual bool IsSatisfy (long theElementId);
766 virtual SMDSAbs_ElementType GetType() const;
768 void SetTolerance (const double theToler);
769 double GetTolerance() const;
770 void SetAllNodes (bool theAllNodes);
771 bool GetAllNodes() const { return myAllNodesFlag; }
772 void SetShape (const TopoDS_Shape& theShape,
773 const SMDSAbs_ElementType theType);
776 void addShape (const TopoDS_Shape& theShape);
778 void process (const SMDS_MeshElement* theElem);
781 const SMDS_Mesh* myMesh;
782 TColStd_MapOfInteger myIds;
783 SMDSAbs_ElementType myType;
784 TopoDS_Shape myShape;
788 TopTools_MapOfShape myShapesMap;
789 TopAbs_ShapeEnum myCurShapeType; // type of current sub-shape
790 BRepClass3d_SolidClassifier myCurSC; // current SOLID
791 GeomAPI_ProjectPointOnSurf myCurProjFace; // current FACE
792 TopoDS_Face myCurFace; // current FACE
793 GeomAPI_ProjectPointOnCurve myCurProjEdge; // current EDGE
794 gp_Pnt myCurPnt; // current VERTEX
797 typedef boost::shared_ptr<ElementsOnShape> ElementsOnShapePtr;
802 Description : Predicate for free faces
804 class SMESHCONTROLS_EXPORT FreeFaces: public virtual Predicate{
807 virtual void SetMesh( const SMDS_Mesh* theMesh );
808 virtual bool IsSatisfy( long theElementId );
809 virtual SMDSAbs_ElementType GetType() const;
812 const SMDS_Mesh* myMesh;
816 Class : LinearOrQuadratic
817 Description : Predicate for free faces
819 class SMESHCONTROLS_EXPORT LinearOrQuadratic: public virtual Predicate{
822 virtual void SetMesh( const SMDS_Mesh* theMesh );
823 virtual bool IsSatisfy( long theElementId );
824 void SetType( SMDSAbs_ElementType theType );
825 virtual SMDSAbs_ElementType GetType() const;
828 const SMDS_Mesh* myMesh;
829 SMDSAbs_ElementType myType;
831 typedef boost::shared_ptr<LinearOrQuadratic> LinearOrQuadraticPtr;
835 Description : Functor for check color of group to whic mesh element belongs to
837 class SMESHCONTROLS_EXPORT GroupColor: public virtual Predicate{
840 virtual void SetMesh( const SMDS_Mesh* theMesh );
841 virtual bool IsSatisfy( long theElementId );
842 void SetType( SMDSAbs_ElementType theType );
843 virtual SMDSAbs_ElementType GetType() const;
844 void SetColorStr( const TCollection_AsciiString& );
845 void GetColorStr( TCollection_AsciiString& ) const;
848 typedef std::set< long > TIDs;
850 Quantity_Color myColor;
851 SMDSAbs_ElementType myType;
854 typedef boost::shared_ptr<GroupColor> GroupColorPtr;
858 Description : Predicate to check element geometry type
860 class SMESHCONTROLS_EXPORT ElemGeomType: public virtual Predicate{
863 virtual void SetMesh( const SMDS_Mesh* theMesh );
864 virtual bool IsSatisfy( long theElementId );
865 void SetType( SMDSAbs_ElementType theType );
866 virtual SMDSAbs_ElementType GetType() const;
867 void SetGeomType( SMDSAbs_GeometryType theType );
868 virtual SMDSAbs_GeometryType GetGeomType() const;
871 const SMDS_Mesh* myMesh;
872 SMDSAbs_ElementType myType;
873 SMDSAbs_GeometryType myGeomType;
875 typedef boost::shared_ptr<ElemGeomType> ElemGeomTypePtr;
878 Class : CoplanarFaces
879 Description : Predicate to check angle between faces
881 class SMESHCONTROLS_EXPORT CoplanarFaces: public virtual Predicate
885 void SetFace( long theID ) { myFaceID = theID; }
886 long GetFace() const { return myFaceID; }
887 void SetTolerance (const double theToler) { myToler = theToler; }
888 double GetTolerance () const { return myToler; }
889 virtual void SetMesh( const SMDS_Mesh* theMesh ) { myMesh = theMesh; }
890 virtual SMDSAbs_ElementType GetType() const { return SMDSAbs_Face; }
892 virtual bool IsSatisfy( long theElementId );
895 const SMDS_Mesh* myMesh;
898 std::set< long > myCoplanarIDs;
900 typedef boost::shared_ptr<CoplanarFaces> CoplanarFacesPtr;
905 class SMESHCONTROLS_EXPORT Filter{
909 virtual void SetPredicate(PredicatePtr thePred);
911 typedef std::vector<long> TIdSequence;
915 GetElementsId( const SMDS_Mesh* theMesh,
916 TIdSequence& theSequence );
920 GetElementsId( const SMDS_Mesh* theMesh,
921 PredicatePtr thePredicate,
922 TIdSequence& theSequence );
925 PredicatePtr myPredicate;