Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef _STD_MESHERS_DISTRIBUTION_HXX_
00030 #define _STD_MESHERS_DISTRIBUTION_HXX_
00031
00032 #include "SMESH_StdMeshers.hxx"
00033
00034 #include <vector>
00035 #include <math_Function.hxx>
00036 #include <ExprIntrp_GenExp.hxx>
00037 #include <Expr_Array1OfNamedUnknown.hxx>
00038 #include <TColStd_Array1OfReal.hxx>
00039
00040
00041 class STDMESHERS_EXPORT Function
00042 {
00043 public:
00044 Function( const int );
00045 virtual ~Function();
00046 virtual bool value( const double, double& ) const;
00047 virtual double integral( const double, const double ) const = 0;
00048
00049 private:
00050 int myConv;
00051 };
00052
00053 class STDMESHERS_EXPORT FunctionIntegral : public Function
00054 {
00055 public:
00056 FunctionIntegral( const Function*, const double );
00057 virtual ~FunctionIntegral();
00058 virtual bool value( const double, double& ) const;
00059 virtual double integral( const double, const double ) const;
00060
00061 private:
00062 Function* myFunc;
00063 double myStart;
00064 };
00065
00066 class STDMESHERS_EXPORT FunctionTable : public Function
00067 {
00068 public:
00069 FunctionTable( const std::vector<double>&, const int );
00070 virtual ~FunctionTable();
00071 virtual bool value( const double, double& ) const;
00072 virtual double integral( const double, const double ) const;
00073
00074 private:
00075 bool findBounds( const double, int&, int& ) const;
00076
00077
00078 double integral( const int i ) const;
00079
00080
00081
00082
00083 double integral( const int i, const double d ) const;
00084
00085 private:
00086 std::vector<double> myData;
00087 };
00088
00089 class STDMESHERS_EXPORT FunctionExpr : public Function, public math_Function
00090 {
00091 public:
00092 FunctionExpr( const char*, const int );
00093 virtual ~FunctionExpr();
00094 virtual Standard_Boolean Value( const Standard_Real, Standard_Real& );
00095 virtual bool value( const double, double& ) const;
00096 virtual double integral( const double, const double ) const;
00097
00098 private:
00099 Handle(ExprIntrp_GenExp) myExpr;
00100 Expr_Array1OfNamedUnknown myVars;
00101 TColStd_Array1OfReal myValues;
00102 };
00103
00104 STDMESHERS_EXPORT
00105 bool buildDistribution( const Function& f,
00106 const double start, const double end,
00107 const int nbSeg,
00108 std::vector<double>& data,
00109 const double eps );
00110
00111 STDMESHERS_EXPORT
00112 bool buildDistribution( const TCollection_AsciiString& f, const int conv, const double start, const double end,
00113 const int nbSeg, std::vector<double>& data, const double eps );
00114 STDMESHERS_EXPORT
00115 bool buildDistribution( const std::vector<double>& f, const int conv, const double start, const double end,
00116 const int nbSeg, std::vector<double>& data, const double eps );
00117
00118 #endif