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 #ifndef STDMESHERSGUI_DISTRPREVIEW_H
00027 #define STDMESHERSGUI_DISTRPREVIEW_H
00028
00029
00030 #include "SMESH_StdMeshersGUI.hxx"
00031
00032
00033 #include <qwt_plot.h>
00034
00035
00036 #include <SALOMEconfig.h>
00037 #include CORBA_SERVER_HEADER(SMESH_Mesh)
00038 #include CORBA_SERVER_HEADER(SMESH_BasicHypothesis)
00039
00040
00041 #include <ExprIntrp_GenExp.hxx>
00042 #include <Expr_Array1OfNamedUnknown.hxx>
00043 #include <TColStd_Array1OfReal.hxx>
00044
00045 class QwtPlotCurve;
00046 class QwtPlotMarker;
00047
00048 class STDMESHERSGUI_EXPORT StdMeshersGUI_DistrPreview : public QwtPlot
00049 {
00050 Q_OBJECT
00051
00052 public:
00053 typedef enum { EXPONENT, CUT_NEGATIVE } Conversion;
00054
00055 StdMeshersGUI_DistrPreview( QWidget*, StdMeshers::StdMeshers_NumberOfSegments_ptr );
00056 virtual ~StdMeshersGUI_DistrPreview();
00057
00058 QString function() const;
00059 bool isTableFunc() const;
00060 void tableFunc( SMESH::double_array& ) const;
00061 int pointsCount() const;
00062 int nbSeg() const;
00063 bool isDone() const;
00064
00065 bool setParams( const QString&, const int, const int = 50, const bool = true );
00066 bool setParams( const SMESH::double_array&, const int, const bool = true );
00067 void setConversion( Conversion, const bool = true );
00068
00069 protected:
00070 virtual bool init( const QString& );
00071 virtual double funcValue( const double, bool& );
00072 virtual bool createTable( SMESH::double_array& );
00073 virtual bool convert( double& ) const;
00074 void update();
00075
00076 private:
00077 double calc( bool& );
00078 void showError();
00079
00080 private:
00081 QString myFunction;
00082 int myPoints, myNbSeg;
00083 bool myIsTable;
00084 Conversion myConv;
00085 SMESH::double_array myTableFunc;
00086 QwtPlotCurve* myDensity;
00087 QwtPlotCurve* myDistr;
00088 QwtPlotMarker* myMsg;
00089 Handle(ExprIntrp_GenExp) myExpr;
00090 Expr_Array1OfNamedUnknown myVars;
00091 TColStd_Array1OfReal myValues;
00092 bool myIsDone;
00093 StdMeshers::StdMeshers_NumberOfSegments_var myHypo;
00094 };
00095
00096 #endif // STDMESHERSGUI_DISTRPREVIEW_H