Salome HOME
Join modifications from branch BR_3_1_0deb
[modules/smesh.git] / src / StdMeshersGUI / StdMeshersGUI_DistrPreview.h
1
2 #ifndef STD_MESHERS_GUI_DISTR_PREVIEW_HEADER
3 #define STD_MESHERS_GUI_DISTR_PREVIEW_HEADER
4
5 #include <qwt_plot.h>
6 #include <SALOMEconfig.h>
7 #include CORBA_SERVER_HEADER(SMESH_Mesh)
8 #include CORBA_SERVER_HEADER(SMESH_BasicHypothesis)
9 #include <ExprIntrp_GenExp.hxx>
10 #include <Expr_Array1OfNamedUnknown.hxx>
11 #include <TColStd_Array1OfReal.hxx>
12
13 class StdMeshersGUI_DistrPreview : public QwtPlot
14 {
15   Q_OBJECT
16
17 public:
18   typedef enum { EXPONENT, CUT_NEGATIVE }  Conversion;
19
20   StdMeshersGUI_DistrPreview( QWidget*, StdMeshers::StdMeshers_NumberOfSegments_ptr );
21   virtual ~StdMeshersGUI_DistrPreview();
22
23   QString   function() const;
24   bool      isTableFunc() const;
25   void      tableFunc( SMESH::double_array& ) const;
26   int       pointsCount() const;
27   int       nbSeg() const;
28   bool      isDone() const;
29
30   bool      setParams( const QString&, const int, const int = 50, const bool = true );
31   bool      setParams( const SMESH::double_array&, const int, const bool = true );
32   void      setConversion( Conversion, const bool = true );
33
34 protected:
35   virtual   bool   init( const QString& );
36   virtual   double funcValue( const double, bool& );
37   virtual   bool   createTable( SMESH::double_array& );
38   virtual   bool   convert( double& ) const;
39             void   update();
40
41 private:
42   double calc( bool& );
43   void   showError();
44
45 private:
46   QString                   myFunction;
47   int                       myPoints, myNbSeg;
48   bool                      myIsTable;
49   Conversion                myConv;
50   SMESH::double_array       myTableFunc;
51   long                      myCurve1, myCurve2, myMsg;
52   Handle(ExprIntrp_GenExp)  myExpr;
53   Expr_Array1OfNamedUnknown myVars;
54   TColStd_Array1OfReal      myValues;
55   bool                      myIsDone;
56   StdMeshers::StdMeshers_NumberOfSegments_var  myHypo;
57 };
58
59 #endif