]> SALOME platform Git repositories - plugins/gmshplugin.git/blob - src/GUI/GMSHPluginGUI_HypothesisCreator.h
Salome HOME
0caf52e9b2a38d4070a8e8540a55a72328eb749a
[plugins/gmshplugin.git] / src / GUI / GMSHPluginGUI_HypothesisCreator.h
1 // Copyright (C) 2012-2015  ALNEOS
2 // Copyright (C) 2016  EDF R&D
3 //
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.
8 //
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.
13 //
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
17 //
18 // See http://www.alneos.com/ or email : contact@alneos.fr
19 //
20 #ifndef GMSHPLUGINGUI_HypothesisCreator_HeaderFile
21 #define GMSHPLUGINGUI_HypothesisCreator_HeaderFile
22
23 #include "GMSHPluginGUI.h"
24
25 #include <SMESHGUI_Hypotheses.h>
26
27 #include <TopAbs_ShapeEnum.hxx>
28
29 #include <QSet>
30
31 class SMESHGUI_SpinBox;
32 class GeomSelectionTools;
33 class QComboBox;
34 class QCheckBox;
35 class QLineEdit;
36 class QTableWidget;
37
38 typedef struct
39 {
40   QString             myName;
41   int                 my2DAlgo,my3DAlgo,myRecomb2DAlgo;
42   bool                myRecombineAll;
43   int                 mySubdivAlgo,myRemeshAlgo,myRemeshPara,mySmouthSteps;
44   bool                myUseIncomplElem;
45   bool                mySecondOrder;
46   double              mySizeFactor,myMaxSize, myMinSize;
47   QString             myMaxSizeVar, myMinSizeVar, mySmouthStepsVar, mySizeFactorVar;
48 } GmshHypothesisData;
49
50 /*!
51  * \brief Class for creation of GMSH2D and GMSH3D hypotheses
52 */
53 class GMSHPLUGIN_GUI_EXPORT GMSHPluginGUI_HypothesisCreator : public SMESHGUI_GenericHypothesisCreator
54 {
55   Q_OBJECT
56
57 public:
58   GMSHPluginGUI_HypothesisCreator( const QString& );
59   virtual ~GMSHPluginGUI_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   void               updateWidgets();
75   virtual void       onAddCompound();
76   virtual void       onRemoveCompound();
77   
78 private:
79   bool readParamsFromHypo( GmshHypothesisData& ) const;
80   bool readParamsFromWidgets( GmshHypothesisData& ) const;
81   bool storeParamsToHypo( const GmshHypothesisData& ) const;
82   GeomSelectionTools* getGeomSelectionTools();
83
84 private:
85  QLineEdit*        myName;
86  QComboBox*        my2DAlgo;
87  QComboBox*        my3DAlgo;
88  QComboBox*        myRecomb2DAlgo;
89  QCheckBox*        myRecombineAll;
90  QComboBox*        mySubdivAlgo;
91  QComboBox*        myRemeshAlgo;
92  QComboBox*        myRemeshPara;
93  SMESHGUI_SpinBox* mySmouthSteps;
94  SMESHGUI_SpinBox* mySizeFactor;
95  SMESHGUI_SpinBox* myMaxSize;
96  SMESHGUI_SpinBox* myMinSize;
97  QCheckBox*        myUseIncomplElem;
98  QCheckBox*        mySecondOrder;
99  bool myIs2D;
100
101
102  QTableWidget* myCompoundTable;
103  GeomSelectionTools* myGeomSelectionTools;
104  QSet<QString> myCompoundSet;
105  QSet<QString> myCompoundToRemove;
106 };
107
108 #endif