+
+
+ /*
+ Class : ElementsOnShape
+ Description : Predicate elements that lying on indicated shape
+ (1D, 2D or 3D)
+ */
+ class SMESHCONTROLS_EXPORT ElementsOnShape : public Predicate
+ {
+ public:
+ ElementsOnShape();
+ ~ElementsOnShape();
+
+ virtual Predicate* clone() const;
+ virtual void SetMesh (const SMDS_Mesh* theMesh);
+ virtual bool IsSatisfy (long theElementId);
+ virtual SMDSAbs_ElementType GetType() const;
+
+ void SetTolerance (const double theToler);
+ double GetTolerance() const;
+ void SetAllNodes (bool theAllNodes);
+ bool GetAllNodes() const { return myAllNodesFlag; }
+ void SetShape (const TopoDS_Shape& theShape,
+ const SMDSAbs_ElementType theType);
+ bool IsSatisfy (const SMDS_MeshElement* elem);
+ bool IsSatisfy (const SMDS_MeshNode* node, TopoDS_Shape* okShape=0);
+ void GetParams( double & u, double & v ) const { u = myU; v = myV; }
+
+ private:
+
+ struct OctreeClassifier;
+
+ void clearClassifiers();
+ bool getNodeIsOut( const SMDS_MeshNode* n, bool& isOut );
+ void setNodeIsOut( const SMDS_MeshNode* n, bool isOut );
+
+ std::vector< Classifier > myClassifiers;
+ std::vector< Classifier* > myWorkClassifiers;
+ OctreeClassifier* myOctree;
+ SMDSAbs_ElementType myType;
+ TopoDS_Shape myShape;
+ double myToler;
+ double myU, myV; // result of node projection on EDGE or FACE
+ bool myAllNodesFlag;
+
+ TMeshModifTracer myMeshModifTracer;
+ std::vector<bool> myNodeIsChecked;
+ std::vector<bool> myNodeIsOut;
+ };
+
+ typedef boost::shared_ptr<ElementsOnShape> ElementsOnShapePtr;
+
+
+ /*
+ Class : BelongToGeom
+ Description : Predicate for verifying whether entiy belong to
+ specified geometrical support
+ */
+ class SMESHCONTROLS_EXPORT BelongToGeom: public virtual Predicate
+ {
+ public:
+ BelongToGeom();
+ virtual Predicate* clone() const;
+
+ 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<BelongToGeom> BelongToGeomPtr;
+
+ /*
+ Class : LyingOnGeom
+ Description : Predicate for verifying whether entiy lying or partially lying on
+ specified geometrical support
+ */
+ class SMESHCONTROLS_EXPORT LyingOnGeom: public virtual Predicate
+ {
+ public:
+ LyingOnGeom();
+ virtual Predicate* clone() const;
+
+ 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;