Salome HOME
Porting SMESH module to Qt 4
[modules/smesh.git] / src / StdMeshersGUI / StdMeshersGUI_StdHypothesisCreator.h
1 // Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
3 //
4 // This library is free software; you can redistribute it and/or 
5 // modify it under the terms of the GNU Lesser General Public 
6 // License as published by the Free Software Foundation; either 
7 // version 2.1 of the License. 
8 //
9 // This library is distributed in the hope that it will be useful, 
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12 // Lesser General Public License for more details. 
13 //
14 // You should have received a copy of the GNU Lesser General Public 
15 // License along with this library; if not, write to the Free Software 
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
17 //
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 //
20 // File   : StdMeshersGUI_StdHypothesisCreator.h
21 // Author : Alexander SOLOVYOV, Open CASCADE S.A.S.
22 //
23
24 #ifndef STDMESHERSGUI_STDHYPOTHESISCREATOR_H
25 #define STDMESHERSGUI_STDHYPOTHESISCREATOR_H
26
27 // SMESH includes
28 #include "SMESH_StdMeshersGUI.hxx"
29
30 #include <SMESHGUI_Hypotheses.h>
31
32 /*!
33  * \brief Class for creation of standard hypotheses
34 */
35 class STDMESHERSGUI_EXPORT StdMeshersGUI_StdHypothesisCreator : public SMESHGUI_GenericHypothesisCreator
36 {
37   Q_OBJECT
38
39 public:
40   StdMeshersGUI_StdHypothesisCreator( const QString& );
41   virtual ~StdMeshersGUI_StdHypothesisCreator();
42
43   virtual bool checkParams() const;
44
45 protected:
46   virtual QFrame*  buildFrame    ();
47   virtual void     retrieveParams() const;
48   virtual QString  storeParams   () const;
49   virtual bool     stdParams     ( ListOfStdParams& ) const;
50   virtual void     attuneStdWidget( QWidget*, const int ) const;
51   virtual QString  caption() const;
52   virtual QPixmap  icon() const;
53   virtual QString  type() const;
54   virtual QWidget* getCustomWidget( const StdParam&, QWidget*, const int ) const;
55   virtual bool     getParamFromCustomWidget( StdParam& , QWidget* ) const;
56
57   virtual QString  hypTypeName( const QString& ) const;
58   virtual QWidget* getWidgetForParam( int paramIndex ) const;
59   virtual ListOfWidgets* customWidgets() const;
60   virtual void     onReject();
61
62   template<class T>
63     T* widget(int i) const {
64     return dynamic_cast< T* >( getWidgetForParam( i ));
65   }
66
67   ListOfWidgets    myCustomWidgets;
68 };
69
70 #endif // STDMESHERSGUI_STDHYPOTHESISCREATOR_H