1 // SMESH SMESHGUI : GUI for SMESH component
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : SMESHGUI_aParameter.h
28 #ifndef SMESHGUI_aParameter_H
29 #define SMESHGUI_aParameter_H
31 #include <boost/shared_ptr.hpp>
35 class SMESHGUI_aParameter;
37 typedef boost::shared_ptr<SMESHGUI_aParameter> SMESHGUI_aParameterPtr;
39 //=================================================================================
40 // class : SMESHGUI_aParameter
42 //=================================================================================
43 class SMESHGUI_aParameter
46 SMESHGUI_aParameter(const QString& label):_label(label) {}
47 virtual ~SMESHGUI_aParameter();
49 enum Type { INT, DOUBLE };
50 virtual Type GetType() const = 0;
51 virtual bool GetNewInt( int & Value ) const = 0;
52 virtual bool GetNewDouble( double & Value ) const = 0;
53 virtual void InitializeWidget( QWidget* ) const = 0;
54 virtual void TakeValue( QWidget* ) = 0;
56 QString & Label() { return _label; }
62 //=================================================================================
63 // class : SMESHGUI_intParameter
65 //=================================================================================
66 class SMESHGUI_intParameter: public SMESHGUI_aParameter
69 SMESHGUI_intParameter(const int initValue = 0,
70 const QString& label = QString::null,
72 const int top = 1000);
73 int & InitValue() { return _initValue; }
74 int & Top() { return _top; }
75 int & Bottom() { return _bottom; }
76 virtual Type GetType() const;
77 virtual bool GetNewInt( int & Value ) const;
78 virtual bool GetNewDouble( double & Value ) const;
79 virtual void InitializeWidget( QWidget* ) const;
80 virtual void TakeValue( QWidget* );
84 int _initValue, _newValue;
87 //=================================================================================
88 // class : SMESHGUI_doubleParameter
90 //=================================================================================
91 class SMESHGUI_doubleParameter: public SMESHGUI_aParameter
94 SMESHGUI_doubleParameter(const double initValue = 0.0,
95 const QString& label = QString::null,
96 const double bottom = -1E6,
97 const double top = +1E6,
98 const double step = 1.0,
99 const int decimals = 3);
100 double & InitValue() { return _initValue; }
101 double & Top() { return _top; }
102 double & Bottom() { return _bottom; }
103 double & Step() { return _step; }
104 int & Decimals() { return _decimals; }
105 virtual Type GetType() const;
106 virtual bool GetNewInt( int & Value ) const;
107 virtual bool GetNewDouble( double & Value ) const;
108 virtual void InitializeWidget( QWidget* ) const;
109 virtual void TakeValue( QWidget* );
112 double _top, _bottom, _step;
113 double _initValue, _newValue;
117 #endif // SMESHGUI_aParameter.h