Salome HOME
d77126e4ca6ed9c3eb1db3a95b8776ef47bb5fb3
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_FunctionPreview.h
1
2 #ifndef SMESHGUI_FUNCTION_PREVIEW_HEADER
3 #define SMESHGUI_FUNCTION_PREVIEW_HEADER
4
5 #include "qwt_plot.h"
6 #include <SALOMEconfig.h>
7 #include CORBA_SERVER_HEADER(SMESH_Mesh)
8 #include <ExprIntrp_GenExp.hxx>
9 #include <Expr_Array1OfNamedUnknown.hxx>
10 #include <TColStd_Array1OfReal.hxx>
11
12 class SMESHGUI_FunctionPreview : public QwtPlot
13 {
14   Q_OBJECT
15
16 public:
17   SMESHGUI_FunctionPreview( QWidget* );
18   virtual ~SMESHGUI_FunctionPreview();
19
20   QString   function() const;
21   bool      isTableFunc() const;
22   void      tableFunc( SMESH::double_array& ) const;
23   void      interval( double&, double& ) const;
24   int       pointsCount() const;
25   bool      isDone() const;
26
27   bool      setParams( const QString&, const double = 0.0, const double = 1.0, const int = 50, const bool = true );
28   bool      setParams( const SMESH::double_array&, const double = 0.0, const double = 1.0, const bool = true );
29   void      setIsExp( const bool, const bool = true );
30
31 protected:
32   virtual   bool   init( const QString& );
33   virtual   double funcValue( const double, bool& );
34   virtual   bool   createTable( SMESH::double_array& );
35   virtual   void   drawContents( QPainter* );
36
37 private:
38   double calc( bool& );
39
40 private:
41   QString              myFunction;
42   double               myXmin, myXmax;
43   int                  myPoints;
44   bool                 myIsTable;
45   bool                 myIsExp;
46   SMESH::double_array  myTableFunc;
47   long                 myCurve;
48   Handle(ExprIntrp_GenExp)  myExpr;
49   Expr_Array1OfNamedUnknown myVars;
50   TColStd_Array1OfReal  myValues;
51   bool                 myIsDone;
52 };
53
54 #endif