Salome HOME
Merge from V5_1_4_BR 07/05/2010
[plugins/netgenplugin.git] / src / GUI / NETGENPluginGUI_HypothesisCreator.h
1 //  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 //  NETGENPlugin GUI: GUI for plugged-in mesher NETGENPlugin
24 //  File   : NETGENPluginGUI_HypothesisCreator.h
25 //  Author : Michael Zorin
26 //  Module : NETGENPlugin
27 //  $Header: 
28 //
29 #ifndef NETGENPLUGINGUI_HypothesisCreator_HeaderFile
30 #define NETGENPLUGINGUI_HypothesisCreator_HeaderFile
31
32 #include "NETGENPluginGUI.h"
33
34 #include <SMESHGUI_Hypotheses.h>
35
36 class SMESHGUI_SpinBox;
37 class QComboBox;
38 class QCheckBox;
39 class QLineEdit;
40
41 typedef struct
42 {
43   double              myMaxSize, myGrowthRate, myNbSegPerEdge, myNbSegPerRadius;
44   int                 myFineness;
45   bool                mySecondOrder, myAllowQuadrangles, myOptimize;
46   QString             myName;
47   QString             myMaxSizeVar, myGrowthRateVar, myNbSegPerEdgeVar, myNbSegPerRadiusVar;
48 } NetgenHypothesisData;
49
50 /*!
51  * \brief Class for creation of NETGEN2D and NETGEN3D hypotheses
52 */
53 class NETGENPLUGIN_GUI_EXPORT NETGENPluginGUI_HypothesisCreator : public SMESHGUI_GenericHypothesisCreator
54 {
55   Q_OBJECT
56
57 public:
58   NETGENPluginGUI_HypothesisCreator( const QString& );
59   virtual ~NETGENPluginGUI_HypothesisCreator();
60
61   virtual bool     checkParams(QString& msg) const;
62   virtual QString  helpPage() const;
63
64 protected:
65   virtual QFrame*  buildFrame    ();
66   virtual void     retrieveParams() const;
67   virtual QString  storeParams   () const;
68   
69   virtual QString  caption() const;
70   virtual QPixmap  icon() const;
71   virtual QString  type() const;
72
73 protected slots:
74   virtual void     onFinenessChanged();
75
76 private:
77   bool readParamsFromHypo( NetgenHypothesisData& ) const;
78   bool readParamsFromWidgets( NetgenHypothesisData& ) const;
79   bool storeParamsToHypo( const NetgenHypothesisData& ) const;
80
81 private:
82  QLineEdit*        myName;
83  SMESHGUI_SpinBox* myMaxSize;
84  QCheckBox*        mySecondOrder;
85  QCheckBox*        myOptimize;
86  QComboBox*        myFineness;
87  SMESHGUI_SpinBox* myGrowthRate;
88  SMESHGUI_SpinBox* myNbSegPerEdge;
89  SMESHGUI_SpinBox* myNbSegPerRadius;
90  QCheckBox*        myAllowQuadrangles;
91
92  bool myIs2D;
93 };
94
95 #endif