1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // File : BLSURFPluginGUI_HypothesisCreator.h
21 // Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA) & Lioka RAZAFINDRAZAKA (CEA)
22 // & Aurelien ALLEAUME (DISTENE)
25 #ifndef BLSURFPLUGINGUI_HypothesisCreator_H
26 #define BLSURFPLUGINGUI_HypothesisCreator_H
29 #ifdef BLSURFPLUGIN_GUI_EXPORTS
30 #define BLSURFPLUGIN_GUI_EXPORT __declspec( dllexport )
32 #define BLSURFPLUGIN_GUI_EXPORT __declspec( dllimport )
35 #define BLSURFPLUGIN_GUI_EXPORT
39 #include <SMESHGUI_Hypotheses.h>
40 #include <SALOMEconfig.h>
43 #include <TopAbs_ShapeEnum.hxx>
44 #include <GeomSelectionTools.h>
45 #include CORBA_SERVER_HEADER(BLSURFPlugin_Algorithm)
48 class QtxDoubleSpinBox;
54 class QStandardItemModel;
60 class LightApp_SelectionMgr;
64 int myTopology, myVerbosity;
65 int myPhysicalMesh, myGeometricMesh;
66 double myAngleMeshS, myAngleMeshC, myGradation;
67 QString myPhySize, myGeoMin, myGeoMax, myPhyMin,myPhyMax;
68 bool myAllowQuadrangles, myDecimesh,mySmpsurface,mySmpedge,mySmppoint;
70 } BlsurfHypothesisData;
74 * \brief Class for creation of BLSURF hypotheses
76 class BLSURFPLUGIN_GUI_EXPORT BLSURFPluginGUI_HypothesisCreator : public SMESHGUI_GenericHypothesisCreator
81 BLSURFPluginGUI_HypothesisCreator( const QString& );
82 virtual ~BLSURFPluginGUI_HypothesisCreator();
84 virtual bool checkParams() const;
85 virtual QString helpPage() const;
86 void insertElementType( TopAbs_ShapeEnum );
87 static LightApp_SelectionMgr* selectionMgr();
90 virtual QFrame* buildFrame ();
91 virtual void retrieveParams() const;
92 virtual QString storeParams () const;
94 virtual QString caption() const;
95 virtual QPixmap icon() const;
96 virtual QString type() const;
99 void onPhysicalMeshChanged();
100 void onGeometricMeshChanged();
102 void onDeleteOption();
103 void onOptionChosenInPopup( QAction* );
104 void onAddMapOnSurface();
105 void onAddMapOnEdge();
106 void onAddMapOnPoint();
108 void onSetSizeMap(int,int);
111 bool readParamsFromHypo( BlsurfHypothesisData& ) const;
112 QString readParamsFromWidgets( BlsurfHypothesisData& ) const;
113 bool storeParamsToHypo( const BlsurfHypothesisData& ) const;
114 bool sizeMapsValidation();
115 bool sizeMapValidationFromRow(int);
116 bool sizeMapValidationFromEntry(QString);
121 QComboBox* myPhysicalMesh;
122 QLineEdit* myPhySize;
125 QComboBox* myGeometricMesh;
126 QtxDoubleSpinBox* myAngleMeshS;
127 QtxDoubleSpinBox* myAngleMeshC;
130 QtxDoubleSpinBox* myGradation;
131 QCheckBox* myAllowQuadrangles;
132 QCheckBox* myDecimesh;
135 QComboBox* myTopology;
136 QSpinBox* myVerbosity;
137 QTableWidget* myOptionTable;
140 QTableWidget *mySizeMapTable;
141 QPushButton *addEdgeButton;
142 QPushButton *addSurfaceButton;
143 QPushButton *addPointButton;
144 QPushButton *removeButton;
146 // map = entry , size map
147 QMap<QString, QString> mySMPMap;
148 QMap<QString, TopAbs_ShapeEnum> mySMPShapeTypeMap;
149 GeomSelectionTools* GeomToolSelected;
151 BLSURFPlugin::string_array_var myOptions;
154 PyObject * main_dict;
157 #endif // BLSURFPLUGINGUI_HypothesisCreator_H