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)
23 // Size maps developement: Nicolas GEIMER (OCC) & Gilles DAVID (EURIWARE)
26 #ifndef BLSURFPLUGINGUI_HypothesisCreator_H
27 #define BLSURFPLUGINGUI_HypothesisCreator_H
30 #ifdef BLSURFPLUGIN_GUI_EXPORTS
31 #define BLSURFPLUGIN_GUI_EXPORT __declspec( dllexport )
33 #define BLSURFPLUGIN_GUI_EXPORT __declspec( dllimport )
36 #define BLSURFPLUGIN_GUI_EXPORT
40 #include <SMESHGUI_Hypotheses.h>
41 #include <SALOMEconfig.h>
44 #include <TopAbs_ShapeEnum.hxx>
45 #include <GeomSelectionTools.h>
46 #include CORBA_SERVER_HEADER(BLSURFPlugin_Algorithm)
49 class QtxDoubleSpinBox;
59 class LightApp_SelectionMgr;
63 int myTopology, myVerbosity;
64 int myPhysicalMesh, myGeometricMesh;
65 double myAngleMeshS, myAngleMeshC, myGradation;
66 QString myPhySize, myGeoMin, myGeoMax, myPhyMin,myPhyMax;
67 bool myAllowQuadrangles, myDecimesh,mySmpsurface,mySmpedge,mySmppoint;
69 } BlsurfHypothesisData;
73 * \brief Class for creation of BLSURF hypotheses
75 class BLSURFPLUGIN_GUI_EXPORT BLSURFPluginGUI_HypothesisCreator : public SMESHGUI_GenericHypothesisCreator
80 BLSURFPluginGUI_HypothesisCreator( const QString& );
81 virtual ~BLSURFPluginGUI_HypothesisCreator();
83 virtual bool checkParams() const;
84 virtual QString helpPage() const;
85 void insertElementType( TopAbs_ShapeEnum );
86 static LightApp_SelectionMgr* selectionMgr();
89 virtual QFrame* buildFrame ();
90 virtual void retrieveParams() const;
91 virtual QString storeParams () const;
93 virtual QString caption() const;
94 virtual QPixmap icon() const;
95 virtual QString type() const;
98 void onPhysicalMeshChanged();
99 void onGeometricMeshChanged();
101 void onDeleteOption();
102 void onOptionChosenInPopup( QAction* );
103 void onAddMapOnSurface();
104 void onAddMapOnEdge();
105 void onAddMapOnPoint();
107 void onSetSizeMap(int,int);
110 bool readParamsFromHypo( BlsurfHypothesisData& ) const;
111 QString readParamsFromWidgets( BlsurfHypothesisData& ) const;
112 bool storeParamsToHypo( const BlsurfHypothesisData& ) const;
113 bool sizeMapsValidation();
114 bool sizeMapValidationFromRow(int,bool displayError = true);
115 bool sizeMapValidationFromEntry(QString,bool displayError = true);
116 GeomSelectionTools* getGeomSelectionTool();
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 *addAttractorButton;
142 QPushButton *addSurfaceButton;
143 QPushButton *addEdgeButton;
144 QPushButton *addPointButton;
145 QPushButton *removeButton;
147 // map = entry , size map
148 QMap<QString, QString> mySMPMap;
149 QMap<QString, TopAbs_ShapeEnum> mySMPShapeTypeMap;
150 GeomSelectionTools* GeomToolSelected;
151 LightApp_SelectionMgr* aSel;
153 BLSURFPlugin::string_array_var myOptions;
156 PyObject * main_dict;
159 #endif // BLSURFPLUGINGUI_HypothesisCreator_H