Salome HOME
6d8d7cb380afb40bd320aed10daccca6ffa8fbfe
[plugins/gmshplugin.git] / src / GUI / GMSHPluginGUI_HypothesisCreator.h
1 // Copyright (C) 2012-2015  ALNEOS
2 // Copyright (C) 2016-2022  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, or (at your option) any later version.
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 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 //
21 #ifndef GMSHPLUGINGUI_HypothesisCreator_HeaderFile
22 #define GMSHPLUGINGUI_HypothesisCreator_HeaderFile
23
24 #include "GmshVersion.h"
25 #include "GMSHPluginGUI.h"
26
27 #include <SMESHGUI_Hypotheses.h>
28
29 #include <TopAbs_ShapeEnum.hxx>
30
31 #include <QSet>
32
33 class SMESHGUI_SpinBox;
34 class GeomSelectionTools;
35 class QComboBox;
36 class QCheckBox;
37 class QLineEdit;
38 class QTableWidget;
39
40 typedef struct
41 {
42   QString             myName;
43   int                 my2DAlgo,my3DAlgo,myRecomb2DAlgo;
44   bool                myRecombineAll;
45   int                 mySubdivAlgo,myRemeshAlgo,myRemeshPara,mySmouthSteps;
46   bool                myUseIncomplElem;
47   bool                mySecondOrder;
48   double              mySizeFactor,myMaxSize, myMinSize;
49   QString             myMaxSizeVar, myMinSizeVar, mySmouthStepsVar, mySizeFactorVar;
50   mutable QString     myErrorMsg;
51 } GmshHypothesisData;
52
53 /*!
54  * \brief Class for creation of GMSH2D and GMSH3D hypotheses
55 */
56 class GMSHPLUGIN_GUI_EXPORT GMSHPluginGUI_HypothesisCreator : public SMESHGUI_GenericHypothesisCreator
57 {
58   Q_OBJECT
59
60 public:
61   GMSHPluginGUI_HypothesisCreator( const QString& );
62   virtual ~GMSHPluginGUI_HypothesisCreator();
63
64   virtual bool     checkParams(QString& msg) const;
65   virtual QString  helpPage() const;
66
67 protected:
68   virtual QFrame*  buildFrame    ();
69   virtual void     retrieveParams() const;
70   virtual QString  storeParams   () const;
71   
72   virtual QString  caption() const;
73   virtual QPixmap  icon() const;
74   virtual QString  type() const;
75
76 protected slots:
77   void               updateWidgets();
78   virtual void       onAddCompound();
79   virtual void       onRemoveCompound();
80   
81 private:
82   bool readParamsFromHypo( GmshHypothesisData& ) const;
83   bool readParamsFromWidgets( GmshHypothesisData& ) const;
84   bool storeParamsToHypo( const GmshHypothesisData& ) const;
85   GeomSelectionTools* getGeomSelectionTools();
86
87 private:
88  QLineEdit*        myName;
89  QComboBox*        my2DAlgo;
90  QComboBox*        my3DAlgo;
91  QComboBox*        myRecomb2DAlgo;
92  QCheckBox*        myRecombineAll;
93  QComboBox*        mySubdivAlgo;
94  QComboBox*        myRemeshAlgo;
95  QComboBox*        myRemeshPara;
96  SMESHGUI_SpinBox* mySmouthSteps;
97  SMESHGUI_SpinBox* mySizeFactor;
98  SMESHGUI_SpinBox* myMaxSize;
99  SMESHGUI_SpinBox* myMinSize;
100  QCheckBox*        myUseIncomplElem;
101  QCheckBox*        mySecondOrder;
102  bool myIs2D;
103
104
105  QTableWidget* myCompoundTable;
106  GeomSelectionTools* myGeomSelectionTools;
107  QSet<QString> myCompoundSet;
108  QSet<QString> myCompoundToRemove;
109 };
110
111 #endif