X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FControls%2FSMESH_Controls.hxx;h=db71dc43e128d98781fd029b957d1ee1e26577e5;hb=refs%2Ftags%2FT3_2_0b2;hp=1c771eb122d25c0bbade3b8a1a9d3636220a4d8c;hpb=c3bf92bd87b770fd81631a3853f7f5bb1ac6a4e8;p=modules%2Fsmesh.git diff --git a/src/Controls/SMESH_Controls.hxx b/src/Controls/SMESH_Controls.hxx index 1c771eb12..db71dc43e 100644 --- a/src/Controls/SMESH_Controls.hxx +++ b/src/Controls/SMESH_Controls.hxx @@ -15,326 +15,29 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #ifndef _SMESH_CONTROLS_HXX_ #define _SMESH_CONTROLS_HXX_ -#include -#include #include -#include "SMDSAbs_ElementType.hxx" - -class SMDS_Mesh; -class gp_Pnt; -class gp_XYZ; -class TColgp_SequenceOfXYZ; namespace SMESH{ namespace Controls{ - class Functor{ - public: - ~Functor(){} - virtual void SetMesh( SMDS_Mesh* theMesh ) = 0; - }; + + class Functor; typedef boost::shared_ptr FunctorPtr; - class NumericalFunctor: public virtual Functor{ - public: - NumericalFunctor(); - virtual void SetMesh( SMDS_Mesh* theMesh ); - virtual double GetValue( long theElementId ) = 0; - virtual SMDSAbs_ElementType GetType() const = 0; - - protected: - bool getPoints( const int theId, - TColgp_SequenceOfXYZ& theRes ) const; - protected: - SMDS_Mesh* myMesh; - }; + + class NumericalFunctor; typedef boost::shared_ptr NumericalFunctorPtr; - /* - Class : SMESH_MinimumAngle - Description : Functor for calculation of minimum angle - */ - class MinimumAngle: public virtual NumericalFunctor{ - public: - virtual double GetValue( long theElementId ); - virtual SMDSAbs_ElementType GetType() const; - }; - - - /* - Class : AspectRatio - Description : Functor for calculating aspect ratio - */ - class AspectRatio: public virtual NumericalFunctor{ - public: - virtual double GetValue( long theElementId ); - virtual SMDSAbs_ElementType GetType() const; - }; - - - /* - Class : Warping - Description : Functor for calculating warping - */ - class Warping: public virtual NumericalFunctor{ - public: - virtual double GetValue( long theElementId ); - virtual SMDSAbs_ElementType GetType() const; - - private: - double ComputeA( const gp_XYZ&, const gp_XYZ&, - const gp_XYZ&, const gp_XYZ& ) const; - }; - - - /* - Class : Taper - Description : Functor for calculating taper - */ - class Taper: public virtual NumericalFunctor{ - public: - virtual double GetValue( long theElementId ); - virtual SMDSAbs_ElementType GetType() const; - }; - - - /* - Class : Skew - Description : Functor for calculating skew in degrees - */ - class Skew: public virtual NumericalFunctor{ - public: - virtual double GetValue( long theElementId ); - virtual SMDSAbs_ElementType GetType() const; - }; - - - /* - Class : Area - Description : Functor for calculating area - */ - class Area: public virtual NumericalFunctor{ - public: - virtual double GetValue( long theElementId ); - virtual SMDSAbs_ElementType GetType() const; - }; - - - /* - Class : Length - Description : Functor for calculating length of edge - */ - class Length: public virtual NumericalFunctor{ - public: - virtual double GetValue( long theElementId ); - virtual SMDSAbs_ElementType GetType() const; - }; - - - /* - Class : MultiConnection - Description : Functor for calculating number of faces conneted to the edge - */ - class MultiConnection: public virtual NumericalFunctor{ - public: - virtual double GetValue( long theElementId ); - virtual SMDSAbs_ElementType GetType() const; - }; - - - /* - PREDICATES - */ - /* - Class : Predicate - Description : Base class for all predicates - */ - class Predicate: public virtual Functor{ - public: - virtual bool IsSatisfy( long theElementId ) = 0; - virtual SMDSAbs_ElementType GetType() const = 0; - }; + class Predicate; typedef boost::shared_ptr PredicatePtr; - - - - /* - Class : FreeBorders - Description : Predicate for free borders - */ - class FreeBorders: public virtual Predicate{ - public: - FreeBorders(); - virtual void SetMesh( SMDS_Mesh* theMesh ); - virtual bool IsSatisfy( long theElementId ); - virtual SMDSAbs_ElementType GetType() const; - - protected: - SMDS_Mesh* myMesh; - }; - - /* - Class : FreeEdges - Description : Predicate for free Edges - */ - class FreeEdges: public virtual Predicate{ - public: - FreeEdges(); - virtual void SetMesh( SMDS_Mesh* theMesh ); - virtual bool IsSatisfy( long theElementId ); - virtual SMDSAbs_ElementType GetType() const; - struct Border{ - long PntId[2]; - Border(long thePntId1, long thePntId2); - }; - typedef long TElemId; - typedef std::map Borders; - void GetBoreders(Borders& theBorders); - - protected: - SMDS_Mesh* myMesh; - }; - typedef boost::shared_ptr FreeEdgesPtr; - - - /* - Class : Comparator - Description : Base class for comparators - */ - class Comparator: public virtual Predicate{ - public: - Comparator(); - virtual ~Comparator(); - virtual void SetMesh( SMDS_Mesh* theMesh ); - virtual void SetMargin(double theValue); - virtual void SetNumFunctor(NumericalFunctorPtr theFunct); - virtual bool IsSatisfy( long theElementId ) = 0; - virtual SMDSAbs_ElementType GetType() const; - - protected: - double myMargin; - NumericalFunctorPtr myFunctor; - }; - typedef boost::shared_ptr ComparatorPtr; - - - /* - Class : LessThan - Description : Comparator "<" - */ - class LessThan: public virtual Comparator{ - public: - virtual bool IsSatisfy( long theElementId ); - }; - - - /* - Class : MoreThan - Description : Comparator ">" - */ - class MoreThan: public virtual Comparator{ - public: - virtual bool IsSatisfy( long theElementId ); - }; - - - /* - Class : EqualTo - Description : Comparator "=" - */ - class EqualTo: public virtual Comparator{ - public: - EqualTo(); - virtual bool IsSatisfy( long theElementId ); - virtual void SetTolerance( double theTol ); - - private: - double myToler; - }; - typedef boost::shared_ptr EqualToPtr; - - - /* - Class : LogicalNOT - Description : Logical NOT predicate - */ - class LogicalNOT: public virtual Predicate{ - public: - LogicalNOT(); - virtual ~LogicalNOT(); - virtual bool IsSatisfy( long theElementId ); - virtual void SetMesh( SMDS_Mesh* theMesh ); - virtual void SetPredicate(PredicatePtr thePred); - virtual SMDSAbs_ElementType GetType() const; - - private: - PredicatePtr myPredicate; - }; - typedef boost::shared_ptr LogicalNOTPtr; - - - /* - Class : LogicalBinary - Description : Base class for binary logical predicate - */ - class LogicalBinary: public virtual Predicate{ - public: - LogicalBinary(); - virtual ~LogicalBinary(); - virtual void SetMesh( SMDS_Mesh* theMesh ); - virtual void SetPredicate1(PredicatePtr thePred); - virtual void SetPredicate2(PredicatePtr thePred); - virtual SMDSAbs_ElementType GetType() const; - - protected: - PredicatePtr myPredicate1; - PredicatePtr myPredicate2; - }; - typedef boost::shared_ptr LogicalBinaryPtr; - - - /* - Class : LogicalAND - Description : Logical AND - */ - class LogicalAND: public virtual LogicalBinary{ - public: - virtual bool IsSatisfy( long theElementId ); - }; - - - /* - Class : LogicalOR - Description : Logical OR - */ - class LogicalOR: public virtual LogicalBinary{ - public: - virtual bool IsSatisfy( long theElementId ); - }; - - - /* - FILTER - */ - class Filter{ - public: - Filter(); - virtual ~Filter(); - virtual void SetPredicate(PredicatePtr thePred); - typedef std::vector TIdSequence; - virtual TIdSequence GetElementsId( SMDS_Mesh* theMesh ); - - protected: - PredicatePtr myPredicate; - }; - }; -}; + } +} #endif