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 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 );
139 bool GetPoints(const int theId,
140 TSequenceOfXYZ& theRes) const;
141 static bool GetPoints(const SMDS_MeshElement* theElem,
142 TSequenceOfXYZ& theRes);
144 const SMDS_Mesh* myMesh;
145 const SMDS_MeshElement* myCurrElement;
152 Description : Functor calculating volume of 3D mesh element
154 class SMESHCONTROLS_EXPORT Volume: public virtual NumericalFunctor{
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;
164 Class : MaxElementLength2D
165 Description : Functor calculating maximum length of 2D element
167 class SMESHCONTROLS_EXPORT MaxElementLength2D: public virtual NumericalFunctor{
169 virtual double GetValue( long theElementId );
170 virtual double GetBadRate( double Value, int nbNodes ) const;
171 virtual SMDSAbs_ElementType GetType() const;
176 Class : MaxElementLength3D
177 Description : Functor calculating maximum length of 3D element
179 class SMESHCONTROLS_EXPORT MaxElementLength3D: public virtual NumericalFunctor{
181 virtual double GetValue( long theElementId );
182 virtual double GetBadRate( double Value, int nbNodes ) const;
183 virtual SMDSAbs_ElementType GetType() const;
188 Class : SMESH_MinimumAngle
189 Description : Functor for calculation of minimum angle
191 class SMESHCONTROLS_EXPORT MinimumAngle: public virtual NumericalFunctor{
193 virtual double GetValue( const TSequenceOfXYZ& thePoints );
194 virtual double GetBadRate( double Value, int nbNodes ) const;
195 virtual SMDSAbs_ElementType GetType() const;
201 Description : Functor for calculating aspect ratio
203 class SMESHCONTROLS_EXPORT AspectRatio: public virtual NumericalFunctor{
205 virtual double GetValue( const TSequenceOfXYZ& thePoints );
206 virtual double GetBadRate( double Value, int nbNodes ) const;
207 virtual SMDSAbs_ElementType GetType() const;
212 Class : AspectRatio3D
213 Description : Functor for calculating aspect ratio of 3D elems.
215 class SMESHCONTROLS_EXPORT AspectRatio3D: public virtual NumericalFunctor{
217 virtual double GetValue( const TSequenceOfXYZ& thePoints );
218 virtual double GetBadRate( double Value, int nbNodes ) const;
219 virtual SMDSAbs_ElementType GetType() const;
225 Description : Functor for calculating warping
227 class SMESHCONTROLS_EXPORT Warping: public virtual NumericalFunctor{
229 virtual double GetValue( const TSequenceOfXYZ& thePoints );
230 virtual double GetBadRate( double Value, int nbNodes ) const;
231 virtual SMDSAbs_ElementType GetType() const;
234 double ComputeA( const gp_XYZ&, const gp_XYZ&, const gp_XYZ&, const gp_XYZ& ) const;
240 Description : Functor for calculating taper
242 class SMESHCONTROLS_EXPORT Taper: public virtual NumericalFunctor{
244 virtual double GetValue( const TSequenceOfXYZ& thePoints );
245 virtual double GetBadRate( double Value, int nbNodes ) const;
246 virtual SMDSAbs_ElementType GetType() const;
252 Description : Functor for calculating skew in degrees
254 class SMESHCONTROLS_EXPORT Skew: public virtual NumericalFunctor{
256 virtual double GetValue( const TSequenceOfXYZ& thePoints );
257 virtual double GetBadRate( double Value, int nbNodes ) const;
258 virtual SMDSAbs_ElementType GetType() const;
264 Description : Functor for calculating area
266 class SMESHCONTROLS_EXPORT Area: public virtual NumericalFunctor{
268 virtual double GetValue( const TSequenceOfXYZ& thePoints );
269 virtual double GetBadRate( double Value, int nbNodes ) const;
270 virtual SMDSAbs_ElementType GetType() const;
276 Description : Functor for calculating length of edge
278 class SMESHCONTROLS_EXPORT Length: public virtual NumericalFunctor{
280 virtual double GetValue( const TSequenceOfXYZ& thePoints );
281 virtual double GetBadRate( double Value, int nbNodes ) const;
282 virtual SMDSAbs_ElementType GetType() const;
287 Description : Functor for calculating length of edge
289 class SMESHCONTROLS_EXPORT Length2D: public virtual NumericalFunctor{
291 virtual double GetValue( long theElementId );
292 virtual double GetBadRate( double Value, int nbNodes ) const;
293 virtual SMDSAbs_ElementType GetType() const;
297 Value(double theLength, long thePntId1, long thePntId2);
298 bool operator<(const Value& x) const;
300 typedef std::set<Value> TValues;
301 void GetValues(TValues& theValues);
303 typedef boost::shared_ptr<Length2D> Length2DPtr;
306 Class : MultiConnection
307 Description : Functor for calculating number of faces conneted to the edge
309 class SMESHCONTROLS_EXPORT MultiConnection: public virtual NumericalFunctor{
311 virtual double GetValue( long theElementId );
312 virtual double GetValue( const TSequenceOfXYZ& thePoints );
313 virtual double GetBadRate( double Value, int nbNodes ) const;
314 virtual SMDSAbs_ElementType GetType() const;
318 Class : MultiConnection2D
319 Description : Functor for calculating number of faces conneted to the edge
321 class SMESHCONTROLS_EXPORT MultiConnection2D: public virtual NumericalFunctor{
323 virtual double GetValue( long theElementId );
324 virtual double GetValue( const TSequenceOfXYZ& thePoints );
325 virtual double GetBadRate( double Value, int nbNodes ) const;
326 virtual SMDSAbs_ElementType GetType() const;
329 Value(long thePntId1, long thePntId2);
330 bool operator<(const Value& x) const;
332 typedef std::map<Value,int> MValues;
334 void GetValues(MValues& theValues);
336 typedef boost::shared_ptr<MultiConnection2D> MultiConnection2DPtr;
342 Description : Base class for all predicates
344 class SMESHCONTROLS_EXPORT Predicate: public virtual Functor{
346 virtual bool IsSatisfy( long theElementId ) = 0;
347 virtual SMDSAbs_ElementType GetType() const = 0;
353 Description : Predicate for free borders
355 class SMESHCONTROLS_EXPORT FreeBorders: public virtual Predicate{
358 virtual void SetMesh( const SMDS_Mesh* theMesh );
359 virtual bool IsSatisfy( long theElementId );
360 virtual SMDSAbs_ElementType GetType() const;
363 const SMDS_Mesh* myMesh;
368 Class : BadOrientedVolume
369 Description : Predicate bad oriented volumes
371 class SMESHCONTROLS_EXPORT BadOrientedVolume: public virtual Predicate{
374 virtual void SetMesh( const SMDS_Mesh* theMesh );
375 virtual bool IsSatisfy( long theElementId );
376 virtual SMDSAbs_ElementType GetType() const;
379 const SMDS_Mesh* myMesh;
385 class SMESHCONTROLS_EXPORT BareBorderVolume: public Predicate
388 BareBorderVolume():myMesh(0) {}
389 virtual void SetMesh( const SMDS_Mesh* theMesh ) { myMesh = theMesh; }
390 virtual SMDSAbs_ElementType GetType() const { return SMDSAbs_Volume; }
391 virtual bool IsSatisfy( long theElementId );
393 const SMDS_Mesh* myMesh;
395 typedef boost::shared_ptr<BareBorderVolume> BareBorderVolumePtr;
400 class SMESHCONTROLS_EXPORT BareBorderFace: public Predicate
403 BareBorderFace():myMesh(0) {}
404 virtual void SetMesh( const SMDS_Mesh* theMesh ) { myMesh = theMesh; }
405 virtual SMDSAbs_ElementType GetType() const { return SMDSAbs_Face; }
406 virtual bool IsSatisfy( long theElementId );
408 const SMDS_Mesh* myMesh;
409 std::vector< const SMDS_MeshNode* > myLinkNodes;
411 typedef boost::shared_ptr<BareBorderFace> BareBorderFacePtr;
414 OverConstrainedVolume
416 class SMESHCONTROLS_EXPORT OverConstrainedVolume: public Predicate
419 OverConstrainedVolume():myMesh(0) {}
420 virtual void SetMesh( const SMDS_Mesh* theMesh ) { myMesh = theMesh; }
421 virtual SMDSAbs_ElementType GetType() const { return SMDSAbs_Volume; }
422 virtual bool IsSatisfy( long theElementId );
424 const SMDS_Mesh* myMesh;
426 typedef boost::shared_ptr<OverConstrainedVolume> OverConstrainedVolumePtr;
431 class SMESHCONTROLS_EXPORT OverConstrainedFace: public Predicate
434 OverConstrainedFace():myMesh(0) {}
435 virtual void SetMesh( const SMDS_Mesh* theMesh ) { myMesh = theMesh; }
436 virtual SMDSAbs_ElementType GetType() const { return SMDSAbs_Face; }
437 virtual bool IsSatisfy( long theElementId );
439 const SMDS_Mesh* myMesh;
440 std::vector< const SMDS_MeshNode* > myLinkNodes;
442 typedef boost::shared_ptr<OverConstrainedFace> OverConstrainedFacePtr;
446 Description : Predicate for free Edges
448 class SMESHCONTROLS_EXPORT FreeEdges: public virtual Predicate{
451 virtual void SetMesh( const SMDS_Mesh* theMesh );
452 virtual bool IsSatisfy( long theElementId );
453 virtual SMDSAbs_ElementType GetType() const;
454 static bool IsFreeEdge( const SMDS_MeshNode** theNodes, const int theFaceId );
455 typedef long TElemId;
459 Border(long theElemId, long thePntId1, long thePntId2);
460 bool operator<(const Border& x) const;
462 typedef std::set<Border> TBorders;
463 void GetBoreders(TBorders& theBorders);
466 const SMDS_Mesh* myMesh;
468 typedef boost::shared_ptr<FreeEdges> FreeEdgesPtr;
473 Description : Predicate for free nodes
475 class SMESHCONTROLS_EXPORT FreeNodes: public virtual Predicate{
478 virtual void SetMesh( const SMDS_Mesh* theMesh );
479 virtual bool IsSatisfy( long theNodeId );
480 virtual SMDSAbs_ElementType GetType() const;
483 const SMDS_Mesh* myMesh;
489 Description : Predicate for Range of Ids.
490 Range may be specified with two ways.
491 1. Using AddToRange method
492 2. With SetRangeStr method. Parameter of this method is a string
493 like as "1,2,3,50-60,63,67,70-"
495 class SMESHCONTROLS_EXPORT RangeOfIds: public virtual Predicate
499 virtual void SetMesh( const SMDS_Mesh* theMesh );
500 virtual bool IsSatisfy( long theNodeId );
501 virtual SMDSAbs_ElementType GetType() const;
502 virtual void SetType( SMDSAbs_ElementType theType );
504 bool AddToRange( long theEntityId );
505 void GetRangeStr( TCollection_AsciiString& );
506 bool SetRangeStr( const TCollection_AsciiString& );
509 const SMDS_Mesh* myMesh;
511 TColStd_SequenceOfInteger myMin;
512 TColStd_SequenceOfInteger myMax;
513 TColStd_MapOfInteger myIds;
515 SMDSAbs_ElementType myType;
518 typedef boost::shared_ptr<RangeOfIds> RangeOfIdsPtr;
523 Description : Base class for comparators
525 class SMESHCONTROLS_EXPORT Comparator: public virtual Predicate{
528 virtual ~Comparator();
529 virtual void SetMesh( const SMDS_Mesh* theMesh );
530 virtual void SetMargin(double theValue);
531 virtual void SetNumFunctor(NumericalFunctorPtr theFunct);
532 virtual bool IsSatisfy( long theElementId ) = 0;
533 virtual SMDSAbs_ElementType GetType() const;
538 NumericalFunctorPtr myFunctor;
540 typedef boost::shared_ptr<Comparator> ComparatorPtr;
545 Description : Comparator "<"
547 class SMESHCONTROLS_EXPORT LessThan: public virtual Comparator{
549 virtual bool IsSatisfy( long theElementId );
555 Description : Comparator ">"
557 class SMESHCONTROLS_EXPORT MoreThan: public virtual Comparator{
559 virtual bool IsSatisfy( long theElementId );
565 Description : Comparator "="
567 class SMESHCONTROLS_EXPORT EqualTo: public virtual Comparator{
570 virtual bool IsSatisfy( long theElementId );
571 virtual void SetTolerance( double theTol );
572 virtual double GetTolerance();
577 typedef boost::shared_ptr<EqualTo> EqualToPtr;
582 Description : Logical NOT predicate
584 class SMESHCONTROLS_EXPORT LogicalNOT: public virtual Predicate{
587 virtual ~LogicalNOT();
588 virtual bool IsSatisfy( long theElementId );
589 virtual void SetMesh( const SMDS_Mesh* theMesh );
590 virtual void SetPredicate(PredicatePtr thePred);
591 virtual SMDSAbs_ElementType GetType() const;
594 PredicatePtr myPredicate;
596 typedef boost::shared_ptr<LogicalNOT> LogicalNOTPtr;
600 Class : LogicalBinary
601 Description : Base class for binary logical predicate
603 class SMESHCONTROLS_EXPORT LogicalBinary: public virtual Predicate{
606 virtual ~LogicalBinary();
607 virtual void SetMesh( const SMDS_Mesh* theMesh );
608 virtual void SetPredicate1(PredicatePtr thePred);
609 virtual void SetPredicate2(PredicatePtr thePred);
610 virtual SMDSAbs_ElementType GetType() const;
613 PredicatePtr myPredicate1;
614 PredicatePtr myPredicate2;
616 typedef boost::shared_ptr<LogicalBinary> LogicalBinaryPtr;
621 Description : Logical AND
623 class SMESHCONTROLS_EXPORT LogicalAND: public virtual LogicalBinary{
625 virtual bool IsSatisfy( long theElementId );
631 Description : Logical OR
633 class SMESHCONTROLS_EXPORT LogicalOR: public virtual LogicalBinary{
635 virtual bool IsSatisfy( long theElementId );
641 Description : Predicate for manifold part of mesh
643 class SMESHCONTROLS_EXPORT ManifoldPart: public virtual Predicate{
646 /* internal class for algorithm uses */
650 Link( SMDS_MeshNode* theNode1,
651 SMDS_MeshNode* theNode2 );
654 bool IsEqual( const ManifoldPart::Link& theLink ) const;
655 bool operator<(const ManifoldPart::Link& x) const;
657 SMDS_MeshNode* myNode1;
658 SMDS_MeshNode* myNode2;
661 bool IsEqual( const ManifoldPart::Link& theLink1,
662 const ManifoldPart::Link& theLink2 );
664 typedef std::set<ManifoldPart::Link> TMapOfLink;
665 typedef std::vector<SMDS_MeshFace*> TVectorOfFacePtr;
666 typedef std::vector<ManifoldPart::Link> TVectorOfLink;
667 typedef std::map<SMDS_MeshFace*,int> TDataMapFacePtrInt;
668 typedef std::map<ManifoldPart::Link,SMDS_MeshFace*> TDataMapOfLinkFacePtr;
672 virtual void SetMesh( const SMDS_Mesh* theMesh );
673 // inoke when all parameters already set
674 virtual bool IsSatisfy( long theElementId );
675 virtual SMDSAbs_ElementType GetType() const;
677 void SetAngleTolerance( const double theAngToler );
678 double GetAngleTolerance() const;
679 void SetIsOnlyManifold( const bool theIsOnly );
680 void SetStartElem( const long theStartElemId );
684 bool findConnected( const TDataMapFacePtrInt& theAllFacePtrInt,
685 SMDS_MeshFace* theStartFace,
686 TMapOfLink& theNonManifold,
687 TColStd_MapOfInteger& theResFaces );
688 bool isInPlane( const SMDS_MeshFace* theFace1,
689 const SMDS_MeshFace* theFace2 );
690 void expandBoundary( TMapOfLink& theMapOfBoundary,
691 TVectorOfLink& theSeqOfBoundary,
692 TDataMapOfLinkFacePtr& theDMapLinkFacePtr,
693 TMapOfLink& theNonManifold,
694 SMDS_MeshFace* theNextFace ) const;
696 void getFacesByLink( const Link& theLink,
697 TVectorOfFacePtr& theFaces ) const;
700 const SMDS_Mesh* myMesh;
701 TColStd_MapOfInteger myMapIds;
702 TColStd_MapOfInteger myMapBadGeomIds;
703 TVectorOfFacePtr myAllFacePtr;
704 TDataMapFacePtrInt myAllFacePtrIntDMap;
706 bool myIsOnlyManifold;
710 typedef boost::shared_ptr<ManifoldPart> ManifoldPartPtr;
714 Class : ElementsOnSurface
715 Description : Predicate elements that lying on indicated surface
718 class SMESHCONTROLS_EXPORT ElementsOnSurface : public virtual Predicate {
721 ~ElementsOnSurface();
722 virtual void SetMesh( const SMDS_Mesh* theMesh );
723 virtual bool IsSatisfy( long theElementId );
724 virtual SMDSAbs_ElementType GetType() const;
726 void SetTolerance( const double theToler );
727 double GetTolerance() const;
728 void SetSurface( const TopoDS_Shape& theShape,
729 const SMDSAbs_ElementType theType );
730 void SetUseBoundaries( bool theUse );
731 bool GetUseBoundaries() const { return myUseBoundaries; }
735 void process( const SMDS_MeshElement* theElem );
736 bool isOnSurface( const SMDS_MeshNode* theNode );
739 const SMDS_Mesh* myMesh;
740 TColStd_MapOfInteger myIds;
741 SMDSAbs_ElementType myType;
742 //Handle(Geom_Surface) mySurf;
745 bool myUseBoundaries;
746 GeomAPI_ProjectPointOnSurf myProjector;
749 typedef boost::shared_ptr<ElementsOnSurface> ElementsOnSurfacePtr;
753 Class : ElementsOnShape
754 Description : Predicate elements that lying on indicated shape
757 class SMESHCONTROLS_EXPORT ElementsOnShape : public virtual Predicate
763 virtual void SetMesh (const SMDS_Mesh* theMesh);
764 virtual bool IsSatisfy (long theElementId);
765 virtual SMDSAbs_ElementType GetType() const;
767 void SetTolerance (const double theToler);
768 double GetTolerance() const;
769 void SetAllNodes (bool theAllNodes);
770 bool GetAllNodes() const { return myAllNodesFlag; }
771 void SetShape (const TopoDS_Shape& theShape,
772 const SMDSAbs_ElementType theType);
775 void addShape (const TopoDS_Shape& theShape);
777 void process (const SMDS_MeshElement* theElem);
780 const SMDS_Mesh* myMesh;
781 TColStd_MapOfInteger myIds;
782 SMDSAbs_ElementType myType;
783 TopoDS_Shape myShape;
787 TopTools_MapOfShape myShapesMap;
788 TopAbs_ShapeEnum myCurShapeType; // type of current sub-shape
789 BRepClass3d_SolidClassifier myCurSC; // current SOLID
790 GeomAPI_ProjectPointOnSurf myCurProjFace; // current FACE
791 TopoDS_Face myCurFace; // current FACE
792 GeomAPI_ProjectPointOnCurve myCurProjEdge; // current EDGE
793 gp_Pnt myCurPnt; // current VERTEX
796 typedef boost::shared_ptr<ElementsOnShape> ElementsOnShapePtr;
801 Description : Predicate for free faces
803 class SMESHCONTROLS_EXPORT FreeFaces: public virtual Predicate{
806 virtual void SetMesh( const SMDS_Mesh* theMesh );
807 virtual bool IsSatisfy( long theElementId );
808 virtual SMDSAbs_ElementType GetType() const;
811 const SMDS_Mesh* myMesh;
815 Class : LinearOrQuadratic
816 Description : Predicate for free faces
818 class SMESHCONTROLS_EXPORT LinearOrQuadratic: public virtual Predicate{
821 virtual void SetMesh( const SMDS_Mesh* theMesh );
822 virtual bool IsSatisfy( long theElementId );
823 void SetType( SMDSAbs_ElementType theType );
824 virtual SMDSAbs_ElementType GetType() const;
827 const SMDS_Mesh* myMesh;
828 SMDSAbs_ElementType myType;
830 typedef boost::shared_ptr<LinearOrQuadratic> LinearOrQuadraticPtr;
834 Description : Functor for check color of group to whic mesh element belongs to
836 class SMESHCONTROLS_EXPORT GroupColor: public virtual Predicate{
839 virtual void SetMesh( const SMDS_Mesh* theMesh );
840 virtual bool IsSatisfy( long theElementId );
841 void SetType( SMDSAbs_ElementType theType );
842 virtual SMDSAbs_ElementType GetType() const;
843 void SetColorStr( const TCollection_AsciiString& );
844 void GetColorStr( TCollection_AsciiString& ) const;
847 typedef std::set< long > TIDs;
849 Quantity_Color myColor;
850 SMDSAbs_ElementType myType;
853 typedef boost::shared_ptr<GroupColor> GroupColorPtr;
857 Description : Predicate to check element geometry type
859 class SMESHCONTROLS_EXPORT ElemGeomType: public virtual Predicate{
862 virtual void SetMesh( const SMDS_Mesh* theMesh );
863 virtual bool IsSatisfy( long theElementId );
864 void SetType( SMDSAbs_ElementType theType );
865 virtual SMDSAbs_ElementType GetType() const;
866 void SetGeomType( SMDSAbs_GeometryType theType );
867 virtual SMDSAbs_GeometryType GetGeomType() const;
870 const SMDS_Mesh* myMesh;
871 SMDSAbs_ElementType myType;
872 SMDSAbs_GeometryType myGeomType;
874 typedef boost::shared_ptr<ElemGeomType> ElemGeomTypePtr;
879 class SMESHCONTROLS_EXPORT Filter{
883 virtual void SetPredicate(PredicatePtr thePred);
885 typedef std::vector<long> TIdSequence;
889 GetElementsId( const SMDS_Mesh* theMesh,
890 TIdSequence& theSequence );
894 GetElementsId( const SMDS_Mesh* theMesh,
895 PredicatePtr thePredicate,
896 TIdSequence& theSequence );
899 PredicatePtr myPredicate;