Salome HOME
[bos #36460][EDF] Define (u,v) coordinates in meshed faces. Solve Projection1D2D...
[plugins/gmshplugin.git] / src / GUI / GMSHPluginGUI_HypothesisCreator.h
1 // Copyright (C) 2012-2015  ALNEOS
2 // Copyright (C) 2016-2024  EDF
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 #if GMSH_MAJOR_VERSION >=4 && GMSH_MINOR_VERSION >=10
49   double              mySizeFactor,myMaxSize, myMinSize, myMeshCurvatureSize;
50   QString             myMaxSizeVar, myMinSizeVar, mySmouthStepsVar, mySizeFactorVar, myMeshCurvatureSizeVar;
51 #else
52   double              mySizeFactor,myMaxSize, myMinSize;
53   QString             myMaxSizeVar, myMinSizeVar, mySmouthStepsVar, mySizeFactorVar;
54 #endif
55   mutable QString     myErrorMsg;
56   int                 myVerbLvl;
57 } GmshHypothesisData;
58
59 /*!
60  * \brief Class for creation of GMSH2D and GMSH3D hypotheses
61 */
62 class GMSHPLUGIN_GUI_EXPORT GMSHPluginGUI_HypothesisCreator : public SMESHGUI_GenericHypothesisCreator
63 {
64   Q_OBJECT
65
66 public:
67   GMSHPluginGUI_HypothesisCreator( const QString& );
68   virtual ~GMSHPluginGUI_HypothesisCreator();
69
70   virtual bool     checkParams(QString& msg) const;
71   virtual QString  helpPage() const;
72
73 protected:
74   virtual QFrame*  buildFrame    ();
75   virtual void     retrieveParams() const;
76   virtual QString  storeParams   () const;
77
78   virtual QString  caption() const;
79   virtual QPixmap  icon() const;
80   virtual QString  type() const;
81
82 protected slots:
83   void               updateWidgets();
84   virtual void       onAddCompound();
85   virtual void       onRemoveCompound();
86
87 private:
88   bool readParamsFromHypo( GmshHypothesisData& ) const;
89   bool readParamsFromWidgets( GmshHypothesisData& ) const;
90   bool storeParamsToHypo( const GmshHypothesisData& ) const;
91   GeomSelectionTools* getGeomSelectionTools();
92
93 private:
94  QLineEdit*        myName;
95  QComboBox*        my2DAlgo;
96  QComboBox*        my3DAlgo;
97  QComboBox*        myRecomb2DAlgo;
98  QCheckBox*        myRecombineAll;
99  QComboBox*        mySubdivAlgo;
100  QComboBox*        myRemeshAlgo;
101  QComboBox*        myRemeshPara;
102  SMESHGUI_SpinBox* mySmouthSteps;
103  SMESHGUI_SpinBox* mySizeFactor;
104 #if GMSH_MAJOR_VERSION >=4 && GMSH_MINOR_VERSION >=10
105  SMESHGUI_SpinBox* myMeshCurvatureSize;
106 #endif
107  SMESHGUI_SpinBox* myMaxSize;
108  SMESHGUI_SpinBox* myMinSize;
109  QCheckBox*        myUseIncomplElem;
110  QCheckBox*        mySecondOrder;
111  QComboBox*        myVerbLvl;
112  bool myIs2D;
113  bool myIs3D;
114
115  QTableWidget* myCompoundTable;
116  GeomSelectionTools* myGeomSelectionTools;
117  QSet<QString> myCompoundSet;
118  QSet<QString> myCompoundToRemove;
119 };
120
121 #endif