1 // Copyright (C) 2007-2012 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"
46 #include "SMESH_TypeDefs.hxx"
48 #include "SMESH_Controls.hxx"
50 class SMDS_MeshElement;
56 class SMESHDS_SubMesh;
63 class SMESHCONTROLS_EXPORT TSequenceOfXYZ
65 typedef std::vector<gp_XYZ>::size_type size_type;
70 TSequenceOfXYZ(size_type n);
72 TSequenceOfXYZ(size_type n, const gp_XYZ& t);
74 TSequenceOfXYZ(const TSequenceOfXYZ& theSequenceOfXYZ);
76 template <class InputIterator>
77 TSequenceOfXYZ(InputIterator theBegin, InputIterator theEnd);
81 TSequenceOfXYZ& operator=(const TSequenceOfXYZ& theSequenceOfXYZ);
83 gp_XYZ& operator()(size_type n);
85 const gp_XYZ& operator()(size_type n) const;
89 void reserve(size_type n);
91 void push_back(const gp_XYZ& v);
93 size_type size() const;
96 std::vector<gp_XYZ> myArray;
100 * \brief Class used to detect mesh modification: IsMeshModified() returns
101 * true if a mesh has changed since last calling IsMeshModified()
103 class SMESHCONTROLS_EXPORT TMeshModifTracer
105 unsigned long myMeshModifTime;
106 const SMDS_Mesh* myMesh;
109 void SetMesh( const SMDS_Mesh* theMesh );
110 const SMDS_Mesh* GetMesh() const { return myMesh; }
111 bool IsMeshModified();
115 Class : NumericalFunctor
116 Description : Root of all Functors returning numeric value
118 class SMESHCONTROLS_EXPORT NumericalFunctor: public virtual Functor{
121 virtual void SetMesh( const SMDS_Mesh* theMesh );
122 virtual double GetValue( long theElementId );
123 virtual double GetValue(const TSequenceOfXYZ& thePoints) { return -1.0;};
124 void GetHistogram(int nbIntervals,
125 std::vector<int>& nbEvents,
126 std::vector<double>& funValues,
127 const std::vector<int>& elements,
128 const double* minmax=0);
129 virtual SMDSAbs_ElementType GetType() const = 0;
130 virtual double GetBadRate( double Value, int nbNodes ) const = 0;
131 long GetPrecision() const;
132 void SetPrecision( const long thePrecision );
133 double Round( const double & value );
135 bool GetPoints(const int theId, TSequenceOfXYZ& theRes) const;
136 static bool GetPoints(const SMDS_MeshElement* theElem, TSequenceOfXYZ& theRes);
138 const SMDS_Mesh* myMesh;
139 const SMDS_MeshElement* myCurrElement;
141 double myPrecisionValue;
147 Description : Functor calculating volume of 3D mesh element
149 class SMESHCONTROLS_EXPORT Volume: public virtual NumericalFunctor{
151 virtual double GetValue( long theElementId );
152 //virtual double GetValue( const TSequenceOfXYZ& thePoints );
153 virtual double GetBadRate( double Value, int nbNodes ) const;
154 virtual SMDSAbs_ElementType GetType() const;
159 Class : MaxElementLength2D
160 Description : Functor calculating maximum length of 2D element
162 class SMESHCONTROLS_EXPORT MaxElementLength2D: public virtual NumericalFunctor{
164 virtual double GetValue( long theElementId );
165 virtual double GetBadRate( double Value, int nbNodes ) const;
166 virtual SMDSAbs_ElementType GetType() const;
171 Class : MaxElementLength3D
172 Description : Functor calculating maximum length of 3D element
174 class SMESHCONTROLS_EXPORT MaxElementLength3D: public virtual NumericalFunctor{
176 virtual double GetValue( long theElementId );
177 virtual double GetBadRate( double Value, int nbNodes ) const;
178 virtual SMDSAbs_ElementType GetType() const;
183 Class : SMESH_MinimumAngle
184 Description : Functor for calculation of minimum angle
186 class SMESHCONTROLS_EXPORT MinimumAngle: public virtual NumericalFunctor{
188 virtual double GetValue( const TSequenceOfXYZ& thePoints );
189 virtual double GetBadRate( double Value, int nbNodes ) const;
190 virtual SMDSAbs_ElementType GetType() const;
196 Description : Functor for calculating aspect ratio
198 class SMESHCONTROLS_EXPORT AspectRatio: public virtual NumericalFunctor{
200 virtual double GetValue( long theElementId );
201 virtual double GetValue( const TSequenceOfXYZ& thePoints );
202 virtual double GetBadRate( double Value, int nbNodes ) const;
203 virtual SMDSAbs_ElementType GetType() const;
208 Class : AspectRatio3D
209 Description : Functor for calculating aspect ratio of 3D elems.
211 class SMESHCONTROLS_EXPORT AspectRatio3D: public virtual NumericalFunctor{
213 virtual double GetValue( long theElementId );
214 virtual double GetValue( const TSequenceOfXYZ& thePoints );
215 virtual double GetBadRate( double Value, int nbNodes ) const;
216 virtual SMDSAbs_ElementType GetType() const;
222 Description : Functor for calculating warping
224 class SMESHCONTROLS_EXPORT Warping: 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;
231 double ComputeA( const gp_XYZ&, const gp_XYZ&, const gp_XYZ&, const gp_XYZ& ) const;
237 Description : Functor for calculating taper
239 class SMESHCONTROLS_EXPORT Taper: public virtual NumericalFunctor{
241 virtual double GetValue( const TSequenceOfXYZ& thePoints );
242 virtual double GetBadRate( double Value, int nbNodes ) const;
243 virtual SMDSAbs_ElementType GetType() const;
249 Description : Functor for calculating skew in degrees
251 class SMESHCONTROLS_EXPORT Skew: public virtual NumericalFunctor{
253 virtual double GetValue( const TSequenceOfXYZ& thePoints );
254 virtual double GetBadRate( double Value, int nbNodes ) const;
255 virtual SMDSAbs_ElementType GetType() const;
261 Description : Functor for calculating area
263 class SMESHCONTROLS_EXPORT Area: public virtual NumericalFunctor{
265 virtual double GetValue( const TSequenceOfXYZ& thePoints );
266 virtual double GetBadRate( double Value, int nbNodes ) const;
267 virtual SMDSAbs_ElementType GetType() const;
273 Description : Functor for calculating length of edge
275 class SMESHCONTROLS_EXPORT Length: public virtual NumericalFunctor{
277 virtual double GetValue( const TSequenceOfXYZ& thePoints );
278 virtual double GetBadRate( double Value, int nbNodes ) const;
279 virtual SMDSAbs_ElementType GetType() const;
284 Description : Functor for calculating length of edge
286 class SMESHCONTROLS_EXPORT Length2D: public virtual NumericalFunctor{
288 virtual double GetValue( long theElementId );
289 virtual double GetBadRate( double Value, int nbNodes ) const;
290 virtual SMDSAbs_ElementType GetType() const;
294 Value(double theLength, long thePntId1, long thePntId2);
295 bool operator<(const Value& x) const;
297 typedef std::set<Value> TValues;
298 void GetValues(TValues& theValues);
300 typedef boost::shared_ptr<Length2D> Length2DPtr;
303 Class : MultiConnection
304 Description : Functor for calculating number of faces conneted to the edge
306 class SMESHCONTROLS_EXPORT MultiConnection: public virtual NumericalFunctor{
308 virtual double GetValue( long theElementId );
309 virtual double GetValue( const TSequenceOfXYZ& thePoints );
310 virtual double GetBadRate( double Value, int nbNodes ) const;
311 virtual SMDSAbs_ElementType GetType() const;
315 Class : MultiConnection2D
316 Description : Functor for calculating number of faces conneted to the edge
318 class SMESHCONTROLS_EXPORT MultiConnection2D: public virtual NumericalFunctor{
320 virtual double GetValue( long theElementId );
321 virtual double GetValue( const TSequenceOfXYZ& thePoints );
322 virtual double GetBadRate( double Value, int nbNodes ) const;
323 virtual SMDSAbs_ElementType GetType() const;
326 Value(long thePntId1, long thePntId2);
327 bool operator<(const Value& x) const;
329 typedef std::map<Value,int> MValues;
331 void GetValues(MValues& theValues);
333 typedef boost::shared_ptr<MultiConnection2D> MultiConnection2DPtr;
338 Class : CoincidentNodes
339 Description : Predicate of Coincident Nodes
340 Note : This class is suitable only for visualization of Coincident Nodes
342 class SMESHCONTROLS_EXPORT CoincidentNodes: public Predicate {
345 virtual void SetMesh( const SMDS_Mesh* theMesh );
346 virtual bool IsSatisfy( long theElementId );
347 virtual SMDSAbs_ElementType GetType() const;
349 void SetTolerance (const double theToler) { myToler = theToler; }
350 double GetTolerance () const { return myToler; }
354 TColStd_MapOfInteger myCoincidentIDs;
355 TMeshModifTracer myMeshModifTracer;
357 typedef boost::shared_ptr<CoincidentNodes> CoincidentNodesPtr;
360 Class : CoincidentElements
361 Description : Predicate of Coincident Elements
362 Note : This class is suitable only for visualization of Coincident Elements
364 class SMESHCONTROLS_EXPORT CoincidentElements: public Predicate {
366 CoincidentElements();
367 virtual void SetMesh( const SMDS_Mesh* theMesh );
368 virtual bool IsSatisfy( long theElementId );
371 const SMDS_Mesh* myMesh;
373 class SMESHCONTROLS_EXPORT CoincidentElements1D: public CoincidentElements {
375 virtual SMDSAbs_ElementType GetType() const;
377 class SMESHCONTROLS_EXPORT CoincidentElements2D: public CoincidentElements {
379 virtual SMDSAbs_ElementType GetType() const;
381 class SMESHCONTROLS_EXPORT CoincidentElements3D: public CoincidentElements {
383 virtual SMDSAbs_ElementType GetType() const;
388 Description : Predicate for free borders
390 class SMESHCONTROLS_EXPORT FreeBorders: public virtual Predicate{
393 virtual void SetMesh( const SMDS_Mesh* theMesh );
394 virtual bool IsSatisfy( long theElementId );
395 virtual SMDSAbs_ElementType GetType() const;
398 const SMDS_Mesh* myMesh;
403 Class : BadOrientedVolume
404 Description : Predicate bad oriented volumes
406 class SMESHCONTROLS_EXPORT BadOrientedVolume: public virtual Predicate{
409 virtual void SetMesh( const SMDS_Mesh* theMesh );
410 virtual bool IsSatisfy( long theElementId );
411 virtual SMDSAbs_ElementType GetType() const;
414 const SMDS_Mesh* myMesh;
420 class SMESHCONTROLS_EXPORT BareBorderVolume: public Predicate
423 BareBorderVolume():myMesh(0) {}
424 virtual void SetMesh( const SMDS_Mesh* theMesh ) { myMesh = theMesh; }
425 virtual SMDSAbs_ElementType GetType() const { return SMDSAbs_Volume; }
426 virtual bool IsSatisfy( long theElementId );
428 const SMDS_Mesh* myMesh;
430 typedef boost::shared_ptr<BareBorderVolume> BareBorderVolumePtr;
435 class SMESHCONTROLS_EXPORT BareBorderFace: public Predicate
438 BareBorderFace():myMesh(0) {}
439 virtual void SetMesh( const SMDS_Mesh* theMesh ) { myMesh = theMesh; }
440 virtual SMDSAbs_ElementType GetType() const { return SMDSAbs_Face; }
441 virtual bool IsSatisfy( long theElementId );
443 const SMDS_Mesh* myMesh;
444 std::vector< const SMDS_MeshNode* > myLinkNodes;
446 typedef boost::shared_ptr<BareBorderFace> BareBorderFacePtr;
449 OverConstrainedVolume
451 class SMESHCONTROLS_EXPORT OverConstrainedVolume: public Predicate
454 OverConstrainedVolume():myMesh(0) {}
455 virtual void SetMesh( const SMDS_Mesh* theMesh ) { myMesh = theMesh; }
456 virtual SMDSAbs_ElementType GetType() const { return SMDSAbs_Volume; }
457 virtual bool IsSatisfy( long theElementId );
459 const SMDS_Mesh* myMesh;
461 typedef boost::shared_ptr<OverConstrainedVolume> OverConstrainedVolumePtr;
466 class SMESHCONTROLS_EXPORT OverConstrainedFace: public Predicate
469 OverConstrainedFace():myMesh(0) {}
470 virtual void SetMesh( const SMDS_Mesh* theMesh ) { myMesh = theMesh; }
471 virtual SMDSAbs_ElementType GetType() const { return SMDSAbs_Face; }
472 virtual bool IsSatisfy( long theElementId );
474 const SMDS_Mesh* myMesh;
476 typedef boost::shared_ptr<OverConstrainedFace> OverConstrainedFacePtr;
480 Description : Predicate for free Edges
482 class SMESHCONTROLS_EXPORT FreeEdges: public virtual Predicate{
485 virtual void SetMesh( const SMDS_Mesh* theMesh );
486 virtual bool IsSatisfy( long theElementId );
487 virtual SMDSAbs_ElementType GetType() const;
488 static bool IsFreeEdge( const SMDS_MeshNode** theNodes, const int theFaceId );
489 typedef long TElemId;
493 Border(long theElemId, long thePntId1, long thePntId2);
494 bool operator<(const Border& x) const;
496 typedef std::set<Border> TBorders;
497 void GetBoreders(TBorders& theBorders);
500 const SMDS_Mesh* myMesh;
502 typedef boost::shared_ptr<FreeEdges> FreeEdgesPtr;
507 Description : Predicate for free nodes
509 class SMESHCONTROLS_EXPORT FreeNodes: public virtual Predicate{
512 virtual void SetMesh( const SMDS_Mesh* theMesh );
513 virtual bool IsSatisfy( long theNodeId );
514 virtual SMDSAbs_ElementType GetType() const;
517 const SMDS_Mesh* myMesh;
523 Description : Predicate for Range of Ids.
524 Range may be specified with two ways.
525 1. Using AddToRange method
526 2. With SetRangeStr method. Parameter of this method is a string
527 like as "1,2,3,50-60,63,67,70-"
529 class SMESHCONTROLS_EXPORT RangeOfIds: public virtual Predicate
533 virtual void SetMesh( const SMDS_Mesh* theMesh );
534 virtual bool IsSatisfy( long theNodeId );
535 virtual SMDSAbs_ElementType GetType() const;
536 virtual void SetType( SMDSAbs_ElementType theType );
538 bool AddToRange( long theEntityId );
539 void GetRangeStr( TCollection_AsciiString& );
540 bool SetRangeStr( const TCollection_AsciiString& );
543 const SMDS_Mesh* myMesh;
545 TColStd_SequenceOfInteger myMin;
546 TColStd_SequenceOfInteger myMax;
547 TColStd_MapOfInteger myIds;
549 SMDSAbs_ElementType myType;
552 typedef boost::shared_ptr<RangeOfIds> RangeOfIdsPtr;
557 Description : Base class for comparators
559 class SMESHCONTROLS_EXPORT Comparator: public virtual Predicate{
562 virtual ~Comparator();
563 virtual void SetMesh( const SMDS_Mesh* theMesh );
564 virtual void SetMargin(double theValue);
565 virtual void SetNumFunctor(NumericalFunctorPtr theFunct);
566 virtual bool IsSatisfy( long theElementId ) = 0;
567 virtual SMDSAbs_ElementType GetType() const;
572 NumericalFunctorPtr myFunctor;
574 typedef boost::shared_ptr<Comparator> ComparatorPtr;
579 Description : Comparator "<"
581 class SMESHCONTROLS_EXPORT LessThan: public virtual Comparator{
583 virtual bool IsSatisfy( long theElementId );
589 Description : Comparator ">"
591 class SMESHCONTROLS_EXPORT MoreThan: public virtual Comparator{
593 virtual bool IsSatisfy( long theElementId );
599 Description : Comparator "="
601 class SMESHCONTROLS_EXPORT EqualTo: public virtual Comparator{
604 virtual bool IsSatisfy( long theElementId );
605 virtual void SetTolerance( double theTol );
606 virtual double GetTolerance();
611 typedef boost::shared_ptr<EqualTo> EqualToPtr;
616 Description : Logical NOT predicate
618 class SMESHCONTROLS_EXPORT LogicalNOT: public virtual Predicate{
621 virtual ~LogicalNOT();
622 virtual bool IsSatisfy( long theElementId );
623 virtual void SetMesh( const SMDS_Mesh* theMesh );
624 virtual void SetPredicate(PredicatePtr thePred);
625 virtual SMDSAbs_ElementType GetType() const;
628 PredicatePtr myPredicate;
630 typedef boost::shared_ptr<LogicalNOT> LogicalNOTPtr;
634 Class : LogicalBinary
635 Description : Base class for binary logical predicate
637 class SMESHCONTROLS_EXPORT LogicalBinary: public virtual Predicate{
640 virtual ~LogicalBinary();
641 virtual void SetMesh( const SMDS_Mesh* theMesh );
642 virtual void SetPredicate1(PredicatePtr thePred);
643 virtual void SetPredicate2(PredicatePtr thePred);
644 virtual SMDSAbs_ElementType GetType() const;
647 PredicatePtr myPredicate1;
648 PredicatePtr myPredicate2;
650 typedef boost::shared_ptr<LogicalBinary> LogicalBinaryPtr;
655 Description : Logical AND
657 class SMESHCONTROLS_EXPORT LogicalAND: public virtual LogicalBinary{
659 virtual bool IsSatisfy( long theElementId );
665 Description : Logical OR
667 class SMESHCONTROLS_EXPORT LogicalOR: public virtual LogicalBinary{
669 virtual bool IsSatisfy( long theElementId );
675 Description : Predicate for manifold part of mesh
677 class SMESHCONTROLS_EXPORT ManifoldPart: public virtual Predicate{
680 /* internal class for algorithm uses */
684 Link( SMDS_MeshNode* theNode1,
685 SMDS_MeshNode* theNode2 );
688 bool IsEqual( const ManifoldPart::Link& theLink ) const;
689 bool operator<(const ManifoldPart::Link& x) const;
691 SMDS_MeshNode* myNode1;
692 SMDS_MeshNode* myNode2;
695 bool IsEqual( const ManifoldPart::Link& theLink1,
696 const ManifoldPart::Link& theLink2 );
698 typedef std::set<ManifoldPart::Link> TMapOfLink;
699 typedef std::vector<SMDS_MeshFace*> TVectorOfFacePtr;
700 typedef std::vector<ManifoldPart::Link> TVectorOfLink;
701 typedef std::map<SMDS_MeshFace*,int> TDataMapFacePtrInt;
702 typedef std::map<ManifoldPart::Link,SMDS_MeshFace*> TDataMapOfLinkFacePtr;
706 virtual void SetMesh( const SMDS_Mesh* theMesh );
707 // inoke when all parameters already set
708 virtual bool IsSatisfy( long theElementId );
709 virtual SMDSAbs_ElementType GetType() const;
711 void SetAngleTolerance( const double theAngToler );
712 double GetAngleTolerance() const;
713 void SetIsOnlyManifold( const bool theIsOnly );
714 void SetStartElem( const long theStartElemId );
718 bool findConnected( const TDataMapFacePtrInt& theAllFacePtrInt,
719 SMDS_MeshFace* theStartFace,
720 TMapOfLink& theNonManifold,
721 TColStd_MapOfInteger& theResFaces );
722 bool isInPlane( const SMDS_MeshFace* theFace1,
723 const SMDS_MeshFace* theFace2 );
724 void expandBoundary( TMapOfLink& theMapOfBoundary,
725 TVectorOfLink& theSeqOfBoundary,
726 TDataMapOfLinkFacePtr& theDMapLinkFacePtr,
727 TMapOfLink& theNonManifold,
728 SMDS_MeshFace* theNextFace ) const;
730 void getFacesByLink( const Link& theLink,
731 TVectorOfFacePtr& theFaces ) const;
734 const SMDS_Mesh* myMesh;
735 TColStd_MapOfInteger myMapIds;
736 TColStd_MapOfInteger myMapBadGeomIds;
737 TVectorOfFacePtr myAllFacePtr;
738 TDataMapFacePtrInt myAllFacePtrIntDMap;
740 bool myIsOnlyManifold;
744 typedef boost::shared_ptr<ManifoldPart> ManifoldPartPtr;
748 Class : ElementsOnSurface
749 Description : Predicate elements that lying on indicated surface
752 class SMESHCONTROLS_EXPORT ElementsOnSurface : public virtual Predicate {
755 ~ElementsOnSurface();
756 virtual void SetMesh( const SMDS_Mesh* theMesh );
757 virtual bool IsSatisfy( long theElementId );
758 virtual SMDSAbs_ElementType GetType() const;
760 void SetTolerance( const double theToler );
761 double GetTolerance() const;
762 void SetSurface( const TopoDS_Shape& theShape,
763 const SMDSAbs_ElementType theType );
764 void SetUseBoundaries( bool theUse );
765 bool GetUseBoundaries() const { return myUseBoundaries; }
769 void process( const SMDS_MeshElement* theElem );
770 bool isOnSurface( const SMDS_MeshNode* theNode );
773 const SMDS_Mesh* myMesh;
774 TColStd_MapOfInteger myIds;
775 SMDSAbs_ElementType myType;
776 //Handle(Geom_Surface) mySurf;
779 bool myUseBoundaries;
780 GeomAPI_ProjectPointOnSurf myProjector;
783 typedef boost::shared_ptr<ElementsOnSurface> ElementsOnSurfacePtr;
787 Class : ElementsOnShape
788 Description : Predicate elements that lying on indicated shape
791 class SMESHCONTROLS_EXPORT ElementsOnShape : public virtual Predicate
797 virtual void SetMesh (const SMDS_Mesh* theMesh);
798 virtual bool IsSatisfy (long theElementId);
799 virtual SMDSAbs_ElementType GetType() const;
801 void SetTolerance (const double theToler);
802 double GetTolerance() const;
803 void SetAllNodes (bool theAllNodes);
804 bool GetAllNodes() const { return myAllNodesFlag; }
805 void SetShape (const TopoDS_Shape& theShape,
806 const SMDSAbs_ElementType theType);
809 void addShape (const TopoDS_Shape& theShape);
811 void process (const SMDS_MeshElement* theElem);
814 TMeshModifTracer myMeshModifTracer;
815 TColStd_MapOfInteger myIds;
816 SMDSAbs_ElementType myType;
817 TopoDS_Shape myShape;
821 TopTools_MapOfShape myShapesMap;
822 TopAbs_ShapeEnum myCurShapeType; // type of current sub-shape
823 BRepClass3d_SolidClassifier myCurSC; // current SOLID
824 GeomAPI_ProjectPointOnSurf myCurProjFace; // current FACE
825 TopoDS_Face myCurFace; // current FACE
826 GeomAPI_ProjectPointOnCurve myCurProjEdge; // current EDGE
827 gp_Pnt myCurPnt; // current VERTEX
830 typedef boost::shared_ptr<ElementsOnShape> ElementsOnShapePtr;
835 Description : Predicate for free faces
837 class SMESHCONTROLS_EXPORT FreeFaces: public virtual Predicate{
840 virtual void SetMesh( const SMDS_Mesh* theMesh );
841 virtual bool IsSatisfy( long theElementId );
842 virtual SMDSAbs_ElementType GetType() const;
845 const SMDS_Mesh* myMesh;
849 Class : LinearOrQuadratic
850 Description : Predicate for free faces
852 class SMESHCONTROLS_EXPORT LinearOrQuadratic: public virtual Predicate{
855 virtual void SetMesh( const SMDS_Mesh* theMesh );
856 virtual bool IsSatisfy( long theElementId );
857 void SetType( SMDSAbs_ElementType theType );
858 virtual SMDSAbs_ElementType GetType() const;
861 const SMDS_Mesh* myMesh;
862 SMDSAbs_ElementType myType;
864 typedef boost::shared_ptr<LinearOrQuadratic> LinearOrQuadraticPtr;
868 Description : Functor for check color of group to whic mesh element belongs to
870 class SMESHCONTROLS_EXPORT GroupColor: public virtual Predicate{
873 virtual void SetMesh( const SMDS_Mesh* theMesh );
874 virtual bool IsSatisfy( long theElementId );
875 void SetType( SMDSAbs_ElementType theType );
876 virtual SMDSAbs_ElementType GetType() const;
877 void SetColorStr( const TCollection_AsciiString& );
878 void GetColorStr( TCollection_AsciiString& ) const;
881 typedef std::set< long > TIDs;
883 Quantity_Color myColor;
884 SMDSAbs_ElementType myType;
887 typedef boost::shared_ptr<GroupColor> GroupColorPtr;
891 Description : Predicate to check element geometry type
893 class SMESHCONTROLS_EXPORT ElemGeomType: public virtual Predicate{
896 virtual void SetMesh( const SMDS_Mesh* theMesh );
897 virtual bool IsSatisfy( long theElementId );
898 void SetType( SMDSAbs_ElementType theType );
899 virtual SMDSAbs_ElementType GetType() const;
900 void SetGeomType( SMDSAbs_GeometryType theType );
901 virtual SMDSAbs_GeometryType GetGeomType() const;
904 const SMDS_Mesh* myMesh;
905 SMDSAbs_ElementType myType;
906 SMDSAbs_GeometryType myGeomType;
908 typedef boost::shared_ptr<ElemGeomType> ElemGeomTypePtr;
911 Class : CoplanarFaces
912 Description : Predicate to check angle between faces
914 class SMESHCONTROLS_EXPORT CoplanarFaces: public virtual Predicate
918 void SetFace( long theID ) { myFaceID = theID; }
919 long GetFace() const { return myFaceID; }
920 void SetTolerance (const double theToler) { myToler = theToler; }
921 double GetTolerance () const { return myToler; }
922 virtual SMDSAbs_ElementType GetType() const { return SMDSAbs_Face; }
924 virtual void SetMesh( const SMDS_Mesh* theMesh );
925 virtual bool IsSatisfy( long theElementId );
928 TMeshModifTracer myMeshModifTracer;
931 std::set< long > myCoplanarIDs;
933 typedef boost::shared_ptr<CoplanarFaces> CoplanarFacesPtr;
938 class SMESHCONTROLS_EXPORT Filter{
942 virtual void SetPredicate(PredicatePtr thePred);
944 typedef std::vector<long> TIdSequence;
948 GetElementsId( const SMDS_Mesh* theMesh,
949 TIdSequence& theSequence );
953 GetElementsId( const SMDS_Mesh* theMesh,
954 PredicatePtr thePredicate,
955 TIdSequence& theSequence );
958 PredicatePtr myPredicate;