Salome HOME
#18963 Minimize compiler warnings
[plugins/netgenplugin.git] / src / GUI / NETGENPluginGUI_HypothesisCreator.h
1 // Copyright (C) 2007-2020  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, or (at your option) any later version.
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 #include <TopAbs_ShapeEnum.hxx>
37
38 class GeomSelectionTools;
39 class QCheckBox;
40 class QComboBox;
41 class QLineEdit;
42 class QTableWidget;
43 class SMESHGUI_SpinBox;
44 class SalomeApp_IntSpinBox;
45
46 typedef struct
47 {
48   double  myMaxSize, myMinSize, myGrowthRate, myNbSegPerEdge, myNbSegPerRadius, myRidgeAngle, myChordalError, myElemSizeWeight, myEdgeCornerAngle, myChartAngle, myOuterChartAngle, myRestHChartDistFactor, myRestHLineLengthFactor, myRestHCloseEdgeFactor, myRestHSurfCurvFactor, myRestHEdgeAngleFactor, myRestHSurfMeshCurvFactor;
49   int     myFineness, myNbSurfOptSteps, myNbVolOptSteps, myWorstElemMeasure;
50   bool    mySecondOrder, myAllowQuadrangles, myOptimize, mySurfaceCurvature, myFuseEdges, myChordalErrorEnabled, myUseDelauney, myCheckOverlapping, myCheckChartBoundary, myRestHChartDistEnable, myRestHLineLengthEnable, myRestHCloseEdgeEnable, myRestHSurfCurvEnable, myRestHEdgeAngleEnable, myRestHSurfMeshCurvEnable, myKeepExistingEdges, myMakeGroupsOfSurfaces;
51   QString myName, myMeshSizeFile;
52   QString myMaxSizeVar, myMinSizeVar, myGrowthRateVar, myNbSegPerEdgeVar, myNbSegPerRadiusVar, myRidgeAngleVar, myChordalErrorVar, myNbSurfOptStepsVar, myNbVolOptStepsVar, myElemSizeWeightVar, myWorstElemMeasureVar, myEdgeCornerAngleVar, myChartAngleVar, myOuterChartAngleVar, myRestHChartDistFactorVar, myRestHLineLengthFactorVar, myRestHCloseEdgeFactorVar, myRestHSurfCurvFactorVar, myRestHEdgeAngleFactorVar, myRestHSurfMeshCurvFactorVar;
53 } NetgenHypothesisData;
54
55 /*!
56  * \brief Class for creation of NETGEN2D and NETGEN3D hypotheses
57 */
58 class NETGENPLUGIN_GUI_EXPORT NETGENPluginGUI_HypothesisCreator : public SMESHGUI_GenericHypothesisCreator
59 {
60   Q_OBJECT
61
62 public:
63   NETGENPluginGUI_HypothesisCreator( const QString& );
64   virtual ~NETGENPluginGUI_HypothesisCreator();
65
66   virtual bool     checkParams(QString&) const;
67   virtual QString  helpPage() const;
68
69 protected:
70   virtual QFrame*  buildFrame    ();
71   virtual void     retrieveParams() const;
72   virtual QString  storeParams   () const;
73   
74   virtual QString  caption() const;
75   virtual QPixmap  icon() const;
76   virtual QString  type() const;
77
78 protected slots:
79   virtual void     onFinenessChanged();
80   virtual void     onChordalErrorEnabled();
81   virtual void     onSurfaceCurvatureChanged();
82   virtual void     onAddLocalSizeOnVertex();
83   virtual void     onAddLocalSizeOnEdge();
84   virtual void     onAddLocalSizeOnFace();
85   virtual void     onAddLocalSizeOnSolid();
86   virtual void     onRemoveLocalSizeOnShape();
87   virtual void     onSetLocalSize(int,int);
88   virtual void     onSetSizeFile();
89   virtual void     onSTLEnable();
90
91 private:
92   bool readParamsFromHypo( NetgenHypothesisData& ) const;
93   bool readParamsFromWidgets( NetgenHypothesisData& ) const;
94   bool storeParamsToHypo( const NetgenHypothesisData& ) const;
95   GeomSelectionTools* getGeomSelectionTools();
96   void addLocalSizeOnShape(TopAbs_ShapeEnum);
97
98 private:
99  QLineEdit*            myName;
100  SMESHGUI_SpinBox*     myMaxSize;
101  SMESHGUI_SpinBox*     myMinSize;
102  QCheckBox*            mySecondOrder;
103  QCheckBox*            myOptimize;
104  QComboBox*            myFineness;
105  SMESHGUI_SpinBox*     myGrowthRate;
106  SMESHGUI_SpinBox*     myNbSegPerEdge;
107  SMESHGUI_SpinBox*     myNbSegPerRadius;
108  QCheckBox*            myChordalErrorEnabled;
109  SMESHGUI_SpinBox*     myChordalError;
110  QCheckBox*            myAllowQuadrangles;
111  QCheckBox*            mySurfaceCurvature;
112  // optimizer
113  SMESHGUI_SpinBox*     myElemSizeWeight;
114  SalomeApp_IntSpinBox* myNbSurfOptSteps;
115  SalomeApp_IntSpinBox* myNbVolOptSteps;
116  // insider
117  QCheckBox*            myFuseEdges;
118  SalomeApp_IntSpinBox* myWorstElemMeasure;
119  QCheckBox*            myUseDelauney;
120  QCheckBox*            myCheckOverlapping;
121  QCheckBox*            myCheckChartBoundary;
122  // stl options
123  QCheckBox*            myKeepExistingEdges;
124  QCheckBox*            myMakeGroupsOfSurfaces;
125  // stl charts
126  SMESHGUI_SpinBox*     myRidgeAngle;
127  SMESHGUI_SpinBox*     myEdgeCornerAngle;
128  SMESHGUI_SpinBox*     myChartAngle;
129  SMESHGUI_SpinBox*     myOuterChartAngle;
130  // stl size
131  SMESHGUI_SpinBox*     myRestHChartDistFactor;
132  SMESHGUI_SpinBox*     myRestHLineLengthFactor;
133  SMESHGUI_SpinBox*     myRestHCloseEdgeFactor;
134  SMESHGUI_SpinBox*     myRestHSurfCurvFactor;
135  SMESHGUI_SpinBox*     myRestHEdgeAngleFactor;
136  SMESHGUI_SpinBox*     myRestHSurfMeshCurvFactor;
137  QCheckBox*            myRestHChartDistEnable;
138  QCheckBox*            myRestHLineLengthEnable;
139  QCheckBox*            myRestHCloseEdgeEnable;
140  QCheckBox*            myRestHSurfCurvEnable;
141  QCheckBox*            myRestHEdgeAngleEnable;
142  QCheckBox*            myRestHSurfMeshCurvEnable;
143
144  bool myIs2D;   // 2D or 3D
145  bool myIsONLY; // one dim or several
146
147  QLineEdit*             myMeshSizeFile;
148  QTableWidget*          myLocalSizeTable;
149  GeomSelectionTools*    myGeomSelectionTools;
150  QMap<QString, QString> myLocalSizeMap;
151 };
152
153 #endif