+ virtual void SetMesh( const SMDS_Mesh* theMesh );
+ virtual void SetGeom( const TopoDS_Shape& theShape );
+
+ virtual bool IsSatisfy( long theElementId );
+
+ virtual void SetType( SMDSAbs_ElementType theType );
+ virtual SMDSAbs_ElementType GetType() const;
+
+ TopoDS_Shape GetShape();
+ const SMESHDS_Mesh* GetMeshDS() const;
+
+ void SetTolerance( double );
+ double GetTolerance();
+
+ private:
+ virtual void init();
+
+ TopoDS_Shape myShape;
+ TColStd_MapOfInteger mySubShapesIDs;
+ const SMESHDS_Mesh* myMeshDS;
+ SMDSAbs_ElementType myType;
+ bool myIsSubshape;
+ double myTolerance; // only if myIsSubshape == false
+ Controls::ElementsOnShapePtr myElementsOnShapePtr; // only if myIsSubshape == false
+ };
+ typedef boost::shared_ptr<LyingOnGeom> LyingOnGeomPtr;
+
+ /*
+ Class : FreeFaces
+ Description : Predicate for free faces
+ */
+ class SMESHCONTROLS_EXPORT FreeFaces: public virtual Predicate{
+ public:
+ FreeFaces();
+ //virtual Predicate* clone() const { return new FreeFaces( *this ); }
+ virtual void SetMesh( const SMDS_Mesh* theMesh );
+ virtual bool IsSatisfy( long theElementId );
+ virtual SMDSAbs_ElementType GetType() const;
+
+ private:
+ const SMDS_Mesh* myMesh;
+ };
+
+ /*
+ Class : LinearOrQuadratic
+ Description : Predicate for free faces
+ */
+ class SMESHCONTROLS_EXPORT LinearOrQuadratic: public virtual Predicate{
+ public:
+ LinearOrQuadratic();
+ //virtual Predicate* clone() const { return new LinearOrQuadratic( *this ); }
+ virtual void SetMesh( const SMDS_Mesh* theMesh );
+ virtual bool IsSatisfy( long theElementId );
+ void SetType( SMDSAbs_ElementType theType );
+ virtual SMDSAbs_ElementType GetType() const;
+
+ private:
+ const SMDS_Mesh* myMesh;
+ SMDSAbs_ElementType myType;
+ };
+ typedef boost::shared_ptr<LinearOrQuadratic> LinearOrQuadraticPtr;
+
+ /*
+ Class : GroupColor
+ Description : Functor for check color of group to which mesh element belongs to
+ */
+ class SMESHCONTROLS_EXPORT GroupColor: public virtual Predicate{
+ public:
+ GroupColor();
+ //virtual Predicate* clone() const { return new GroupColor( *this ); }
+ virtual void SetMesh( const SMDS_Mesh* theMesh );
+ virtual bool IsSatisfy( long theElementId );
+ void SetType( SMDSAbs_ElementType theType );
+ virtual SMDSAbs_ElementType GetType() const;
+ void SetColorStr( const TCollection_AsciiString& );
+ void GetColorStr( TCollection_AsciiString& ) const;
+
+ private:
+ typedef std::set< long > TIDs;
+
+ Quantity_Color myColor;
+ SMDSAbs_ElementType myType;
+ TIDs myIDs;
+ };
+ typedef boost::shared_ptr<GroupColor> GroupColorPtr;
+
+ /*
+ Class : ElemGeomType
+ Description : Predicate to check element geometry type
+ */
+ class SMESHCONTROLS_EXPORT ElemGeomType: public virtual Predicate{
+ public:
+ ElemGeomType();
+ //virtual Predicate* clone() const { return new ElemGeomType( *this ); }
+ virtual void SetMesh( const SMDS_Mesh* theMesh );
+ virtual bool IsSatisfy( long theElementId );
+ void SetType( SMDSAbs_ElementType theType );
+ virtual SMDSAbs_ElementType GetType() const;
+ void SetGeomType( SMDSAbs_GeometryType theType );
+ SMDSAbs_GeometryType GetGeomType() const;
+
+ private:
+ const SMDS_Mesh* myMesh;
+ SMDSAbs_ElementType myType;
+ SMDSAbs_GeometryType myGeomType;
+ };
+ typedef boost::shared_ptr<ElemGeomType> ElemGeomTypePtr;
+
+ /*
+ Class : CoplanarFaces
+ Description : Predicate to check angle between faces
+ */
+ class SMESHCONTROLS_EXPORT CoplanarFaces: public virtual Predicate
+ {
+ public:
+ CoplanarFaces();
+ //virtual Predicate* clone() const { return new CoplanarFaces( *this ); }
+ void SetFace( long theID ) { myFaceID = theID; }
+ long GetFace() const { return myFaceID; }
+ void SetTolerance (const double theToler) { myToler = theToler; }
+ double GetTolerance () const { return myToler; }
+ virtual SMDSAbs_ElementType GetType() const { return SMDSAbs_Face; }
+
+ virtual void SetMesh( const SMDS_Mesh* theMesh );
+ virtual bool IsSatisfy( long theElementId );
+
+ private:
+ TMeshModifTracer myMeshModifTracer;
+ long myFaceID;
+ double myToler;
+ TColStd_MapOfInteger myCoplanarIDs;
+ };
+ typedef boost::shared_ptr<CoplanarFaces> CoplanarFacesPtr;
+
+ /*
+ Class : ConnectedElements
+ Description : Predicate to get elements of one domain
+ */
+ class SMESHCONTROLS_EXPORT ConnectedElements: public virtual Predicate
+ {
+ public:
+ ConnectedElements();
+ //virtual Predicate* clone() const { return new ConnectedElements( *this ); }
+ void SetNode( int nodeID );
+ void SetPoint( double x, double y, double z );
+ int GetNode() const;
+ std::vector<double> GetPoint() const;
+
+ void SetType( SMDSAbs_ElementType theType );
+ virtual SMDSAbs_ElementType GetType() const;
+
+ virtual void SetMesh( const SMDS_Mesh* theMesh );
+ virtual bool IsSatisfy( long theElementId );
+
+ //const std::set<long>& GetDomainIDs() const { return myOkIDs; }
+
+ private:
+ int myNodeID;
+ std::vector<double> myXYZ;
+ SMDSAbs_ElementType myType;
+ TMeshModifTracer myMeshModifTracer;
+
+ void clearOkIDs();
+ bool myOkIDsReady;
+ std::set< int > myOkIDs; // empty means that there is one domain
+ };
+ typedef boost::shared_ptr<ConnectedElements> ConnectedElementsPtr;