]> SALOME platform Git repositories - plugins/gmshplugin.git/blob - src/GUI/GMSHPluginGUI_HypothesisCreator.h
Salome HOME
depot initial V7_2_0
[plugins/gmshplugin.git] / src / GUI / GMSHPluginGUI_HypothesisCreator.h
1 // Copyright (C) 2012-2013  ALNEOS
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.alneos.com/ or email : contact@alneos.fr
18 //
19 #ifndef GMSHPLUGINGUI_HypothesisCreator_HeaderFile
20 #define GMSHPLUGINGUI_HypothesisCreator_HeaderFile
21
22 #include "GMSHPluginGUI.h"
23
24 #include <SMESHGUI_Hypotheses.h>
25
26 #include <TopAbs_ShapeEnum.hxx>
27
28 #include <QSet>
29
30 class SMESHGUI_SpinBox;
31 class GeomSelectionTools;
32 class QComboBox;
33 class QCheckBox;
34 class QLineEdit;
35 class QTableWidget;
36
37 typedef struct
38 {
39   QString             myName;
40   int                 my2DAlgo,my3DAlgo,myRecomb2DAlgo;
41   bool                myRecombineAll;
42   int                 mySubdivAlgo,myRemeshAlgo,myRemeshPara,mySmouthSteps;
43   bool                myUseIncomplElem;
44   bool                mySecondOrder;
45   double              mySizeFactor,myMaxSize, myMinSize;
46   QString             myMaxSizeVar, myMinSizeVar, mySmouthStepsVar, mySizeFactorVar;
47 } GmshHypothesisData;
48
49 /*!
50  * \brief Class for creation of GMSH2D and GMSH3D hypotheses
51 */
52 class GMSHPLUGIN_GUI_EXPORT GMSHPluginGUI_HypothesisCreator : public SMESHGUI_GenericHypothesisCreator
53 {
54   Q_OBJECT
55
56 public:
57   GMSHPluginGUI_HypothesisCreator( const QString& );
58   virtual ~GMSHPluginGUI_HypothesisCreator();
59
60   virtual bool     checkParams(QString& msg) const;
61   virtual QString  helpPage() const;
62
63 protected:
64   virtual QFrame*  buildFrame    ();
65   virtual void     retrieveParams() const;
66   virtual QString  storeParams   () const;
67   
68   virtual QString  caption() const;
69   virtual QPixmap  icon() const;
70   virtual QString  type() const;
71
72 protected slots:
73   void               updateWidgets();
74   virtual void       onAddCompound();
75   virtual void       onRemoveCompound();
76   
77 private:
78   bool readParamsFromHypo( GmshHypothesisData& ) const;
79   bool readParamsFromWidgets( GmshHypothesisData& ) const;
80   bool storeParamsToHypo( const GmshHypothesisData& ) const;
81   GeomSelectionTools* getGeomSelectionTools();
82
83 private:
84  QLineEdit*        myName;
85  QComboBox*        my2DAlgo;
86  QComboBox*        my3DAlgo;
87  QComboBox*        myRecomb2DAlgo;
88  QCheckBox*        myRecombineAll;
89  QComboBox*        mySubdivAlgo;
90  QComboBox*        myRemeshAlgo;
91  QComboBox*        myRemeshPara;
92  SMESHGUI_SpinBox* mySmouthSteps;
93  SMESHGUI_SpinBox* mySizeFactor;
94  SMESHGUI_SpinBox* myMaxSize;
95  SMESHGUI_SpinBox* myMinSize;
96  QCheckBox*        myUseIncomplElem;
97  QCheckBox*        mySecondOrder;
98  bool myIs2D;
99
100
101  QTableWidget* myCompoundTable;
102  GeomSelectionTools* myGeomSelectionTools;
103  QSet<QString> myCompoundSet;
104  QSet<QString> myCompoundToRemove;
105 };
106
107 #endif