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/ or email : webmaster.salome@opencascade.com
20 // File : StdMeshersGUI_DistrPreview.h
21 // Author : Open CASCADE S.A.S.
24 #ifndef STDMESHERSGUI_DISTRPREVIEW_H
25 #define STDMESHERSGUI_DISTRPREVIEW_H
28 #include "SMESH_StdMeshersGUI.hxx"
34 #include <SALOMEconfig.h>
35 #include CORBA_SERVER_HEADER(SMESH_Mesh)
36 #include CORBA_SERVER_HEADER(SMESH_BasicHypothesis)
39 #include <ExprIntrp_GenExp.hxx>
40 #include <Expr_Array1OfNamedUnknown.hxx>
41 #include <TColStd_Array1OfReal.hxx>
46 class STDMESHERSGUI_EXPORT StdMeshersGUI_DistrPreview : public QwtPlot
51 typedef enum { EXPONENT, CUT_NEGATIVE } Conversion;
53 StdMeshersGUI_DistrPreview( QWidget*, StdMeshers::StdMeshers_NumberOfSegments_ptr );
54 virtual ~StdMeshersGUI_DistrPreview();
56 QString function() const;
57 bool isTableFunc() const;
58 void tableFunc( SMESH::double_array& ) const;
59 int pointsCount() const;
63 bool setParams( const QString&, const int, const int = 50, const bool = true );
64 bool setParams( const SMESH::double_array&, const int, const bool = true );
65 void setConversion( Conversion, const bool = true );
68 virtual bool init( const QString& );
69 virtual double funcValue( const double, bool& );
70 virtual bool createTable( SMESH::double_array& );
71 virtual bool convert( double& ) const;
80 int myPoints, myNbSeg;
83 SMESH::double_array myTableFunc;
84 QwtPlotCurve* myDensity;
85 QwtPlotCurve* myDistr;
87 Handle(ExprIntrp_GenExp) myExpr;
88 Expr_Array1OfNamedUnknown myVars;
89 TColStd_Array1OfReal myValues;
91 StdMeshers::StdMeshers_NumberOfSegments_var myHypo;
94 #endif // STDMESHERSGUI_DISTRPREVIEW_H