Salome HOME
Merge from BR_size_maps
[plugins/hexoticplugin.git] / src / GUI / HexoticPluginGUI_HypothesisCreator.h
1 // Copyright (C) 2007-2013  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 #include "StdMeshersGUI_ObjectReferenceParamWdg.h"
32 #include "HexoticPlugin_Hypothesis.hxx"
33
34 class QtxIntSpinBox;
35 class QCheckBox;
36 class QLineEdit;
37
38 class HexoticPluginGUI_StdWidget;
39 class HexoticPluginGUI_SizeMapsWidget;
40
41 typedef struct
42 {
43   QString  myName;
44   int      myHexesMinLevel, myHexesMaxLevel;
45   double   myMinSize, myMaxSize;
46   bool     myHexoticInvalidElements;
47   bool     myHexoticIgnoreRidges;
48   double   myHexoticSharpAngleThreshold;
49   int      myHexoticNbProc;
50   QString  myHexoticWorkingDir;
51   int      myHexoticVerbosity;
52   int      myHexoticMaxMemory;
53   int      myHexoticSdMode;
54   HexoticPlugin_Hypothesis::THexoticSizeMaps mySizeMaps;
55 } HexoticHypothesisData;
56
57 /*!
58  * \brief Class for creation of Hexotic hypotheses
59 */
60 class HEXOTICPLUGIN_GUI_EXPORT HexoticPluginGUI_HypothesisCreator : public SMESHGUI_GenericHypothesisCreator
61 {
62   Q_OBJECT
63
64 public:
65   HexoticPluginGUI_HypothesisCreator( const QString& );
66   virtual ~HexoticPluginGUI_HypothesisCreator();
67
68   virtual bool checkParams(QString&) const;
69   virtual QString  helpPage() const;
70
71 protected:
72   virtual QFrame*  buildFrame    ();
73   virtual void     retrieveParams() const;
74   virtual QString  storeParams   () const;
75   
76   virtual QString  caption() const;
77   virtual QPixmap  icon() const;
78   virtual QString  type() const;
79   
80 private:
81   bool readParamsFromHypo( HexoticHypothesisData& ) const;
82   bool readParamsFromWidgets( HexoticHypothesisData& ) const;
83   bool readSizeMapsFromWidgets( HexoticHypothesisData& ) const;
84   void insertLocalSizeInWidget( std::string entry, std::string shapeName, double size, int row ) const;
85   bool storeParamsToHypo( const HexoticHypothesisData& ) const;
86   void resizeEvent(QResizeEvent *event);
87   void printData(HexoticHypothesisData&) const;
88   
89   GEOM::GEOM_Object_var entryToObject( std::string entry) const;
90
91 private:
92
93 //  QWidget*            myStdGroup;
94   QLineEdit*    myName;
95   HexoticPluginGUI_StdWidget*            myStdWidget;
96   HexoticPluginGUI_SizeMapsWidget*       mySmpWidget;
97   StdMeshersGUI_ObjectReferenceParamWdg* myGeomSelWdg;
98
99   bool             myIs3D;
100   bool             mySizeMapRemoved;
101  
102 protected slots:
103   void             onAddLocalSize();
104   void             onRemoveLocalSize();
105   
106 };
107
108 #endif