1 // Copyright (C) 2007-2019 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // NETGENPlugin GUI: GUI for plugged-in mesher NETGENPlugin
24 // File : NETGENPluginGUI_HypothesisCreator.h
25 // Author : Michael Zorin
26 // Module : NETGENPlugin
29 #ifndef NETGENPLUGINGUI_HypothesisCreator_HeaderFile
30 #define NETGENPLUGINGUI_HypothesisCreator_HeaderFile
32 #include "NETGENPluginGUI.h"
34 #include <SMESHGUI_Hypotheses.h>
36 #include <TopAbs_ShapeEnum.hxx>
38 class GeomSelectionTools;
43 class SMESHGUI_SpinBox;
44 class SalomeApp_IntSpinBox;
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;
56 * \brief Class for creation of NETGEN2D and NETGEN3D hypotheses
58 class NETGENPLUGIN_GUI_EXPORT NETGENPluginGUI_HypothesisCreator : public SMESHGUI_GenericHypothesisCreator
63 NETGENPluginGUI_HypothesisCreator( const QString& );
64 virtual ~NETGENPluginGUI_HypothesisCreator();
66 virtual bool checkParams(QString& msg) const;
67 virtual QString helpPage() const;
70 virtual QFrame* buildFrame ();
71 virtual void retrieveParams() const;
72 virtual QString storeParams () const;
74 virtual QString caption() const;
75 virtual QPixmap icon() const;
76 virtual QString type() const;
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();
92 bool readParamsFromHypo( NetgenHypothesisData& ) const;
93 bool readParamsFromWidgets( NetgenHypothesisData& ) const;
94 bool storeParamsToHypo( const NetgenHypothesisData& ) const;
95 GeomSelectionTools* getGeomSelectionTools();
96 void addLocalSizeOnShape(TopAbs_ShapeEnum);
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;
113 SMESHGUI_SpinBox* myElemSizeWeight;
114 SalomeApp_IntSpinBox* myNbSurfOptSteps;
115 SalomeApp_IntSpinBox* myNbVolOptSteps;
117 QCheckBox* myFuseEdges;
118 SalomeApp_IntSpinBox* myWorstElemMeasure;
119 QCheckBox* myUseDelauney;
120 QCheckBox* myCheckOverlapping;
121 QCheckBox* myCheckChartBoundary;
123 QCheckBox* myKeepExistingEdges;
124 QCheckBox* myMakeGroupsOfSurfaces;
126 SMESHGUI_SpinBox* myRidgeAngle;
127 SMESHGUI_SpinBox* myEdgeCornerAngle;
128 SMESHGUI_SpinBox* myChartAngle;
129 SMESHGUI_SpinBox* myOuterChartAngle;
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;
144 bool myIs2D; // 2D or 3D
145 bool myIsONLY; // one dim or several
147 QLineEdit* myMeshSizeFile;
148 QTableWidget* myLocalSizeTable;
149 GeomSelectionTools* myGeomSelectionTools;
150 QMap<QString, QString> myLocalSizeMap;