Salome HOME
Merge from V6_main_20120808 08Aug12
[plugins/hexoticplugin.git] / src / GUI / HexoticPluginGUI_HypothesisCreator.h
1 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 // ---
21 // File   : HexoticPluginGUI_HypothesisCreator.h
22 // Author : Lioka RAZAFINDRAZAKA (CEA)
23 // ---
24 //
25 #ifndef HexoticPLUGINGUI_HypothesisCreator_H
26 #define HexoticPLUGINGUI_HypothesisCreator_H
27
28 #include "HexoticPluginGUI.h"
29
30 #include <SMESHGUI_Hypotheses.h>
31
32 class QtxIntSpinBox;
33 class QCheckBox;
34 class QLineEdit;
35
36 typedef struct
37 {
38   QString  myName;
39   int      myHexesMinLevel, myHexesMaxLevel;
40   bool     myHexoticQuadrangles;
41   bool     myHexoticInvalidElements;
42   bool     myHexoticIgnoreRidges;
43   int      myHexoticSharpAngleThreshold;
44   int      myHexoticNbProc;
45   QString  myHexoticWorkingDir;
46 } HexoticHypothesisData;
47
48 /*!
49  * \brief Class for creation of Hexotic hypotheses
50 */
51 class HEXOTICPLUGIN_GUI_EXPORT HexoticPluginGUI_HypothesisCreator : public SMESHGUI_GenericHypothesisCreator
52 {
53   Q_OBJECT
54
55 public:
56   HexoticPluginGUI_HypothesisCreator( const QString& );
57   virtual ~HexoticPluginGUI_HypothesisCreator();
58
59   virtual bool checkParams() const;
60   virtual QString  helpPage() const;
61
62 protected:
63   virtual QFrame*  buildFrame    ();
64   virtual void     retrieveParams() const;
65   virtual QString  storeParams   () const;
66   
67   virtual QString  caption() const;
68   virtual QPixmap  icon() const;
69   virtual QString  type() const;
70   
71 protected slots:
72   void             onDirBtnClicked();
73
74 private:
75   bool readParamsFromHypo( HexoticHypothesisData& ) const;
76   bool readParamsFromWidgets( HexoticHypothesisData& ) const;
77   bool storeParamsToHypo( const HexoticHypothesisData& ) const;
78
79 private:
80  QLineEdit*       myName;
81  QtxIntSpinBox*   myHexesMinLevel;
82  QtxIntSpinBox*   myHexesMaxLevel;
83  QCheckBox*       myHexoticQuadrangles;
84  QCheckBox*       myHexoticIgnoreRidges;
85  QCheckBox*       myHexoticInvalidElements;
86  QtxIntSpinBox*   myHexoticSharpAngleThreshold;
87  QtxIntSpinBox*   myHexoticNbProc;
88  QLineEdit*       myHexoticWorkingDir;
89
90  bool             myIs3D;
91 };
92
93 #endif