1 // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.salome-platform.org/
21 #ifndef SMESHGUI_FUNCTION_PREVIEW_HEADER
22 #define SMESHGUI_FUNCTION_PREVIEW_HEADER
25 #include <SALOMEconfig.h>
26 #include CORBA_SERVER_HEADER(SMESH_Mesh)
27 #include <ExprIntrp_GenExp.hxx>
28 #include <Expr_Array1OfNamedUnknown.hxx>
29 #include <TColStd_Array1OfReal.hxx>
31 class SMESHGUI_FunctionPreview : public QwtPlot
36 SMESHGUI_FunctionPreview( QWidget* );
37 virtual ~SMESHGUI_FunctionPreview();
39 QString function() const;
40 bool isTableFunc() const;
41 void tableFunc( SMESH::double_array& ) const;
42 void interval( double&, double& ) const;
43 int pointsCount() const;
46 bool setParams( const QString&, const double = 0.0, const double = 1.0, const int = 50, const bool = true );
47 bool setParams( const SMESH::double_array&, const double = 0.0, const double = 1.0, const bool = true );
48 void setIsExp( const bool, const bool = true );
51 virtual bool init( const QString& );
52 virtual double funcValue( const double, bool& );
53 virtual bool createTable( SMESH::double_array& );
54 virtual void drawContents( QPainter* );
61 double myXmin, myXmax;
65 SMESH::double_array myTableFunc;
67 Handle(ExprIntrp_GenExp) myExpr;
68 Expr_Array1OfNamedUnknown myVars;
69 TColStd_Array1OfReal myValues;