Salome HOME
b3725061612bc66a2e023e043d286a2ac253bd24
[samples/sierpinsky.git] / src / SierpinskyGUI / SierpinskyGUI_RunDlg.h
1 // Copyright (C) 2005-2013  OPEN CASCADE
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    : SierpinskyGUI_RunDlg.h
22 // Author  : Vadim SANDLER (OCN)
23 // Created : 13/07/05
24 ///////////////////////////////////////////////////////////
25 //
26 #ifndef __SIERPINSKYGUI_RUNDLG_H
27 #define __SIERPINSKYGUI_RUNDLG_H
28
29 #include <QDialog>
30
31 class QLineEdit;
32 class QCheckBox;
33 class QSpinBox;
34 class QPushButton;
35 class QGroupBox;
36 class QtxDoubleSpinBox;
37 class MyThread;
38 class QProgressBar;
39 class SierpinskyGUI;
40
41 class SierpinskyGUI_RunDlg : public QDialog
42 {
43   Q_OBJECT
44
45 public:
46   // Constructor
47   SierpinskyGUI_RunDlg( QWidget*, SierpinskyGUI* );
48   // Destructor
49   ~SierpinskyGUI_RunDlg();
50
51   // Progress thread calls this method to update progress bar state
52   void nextStep( const int );
53
54 protected:
55   // process progress event
56   void customEvent( QEvent* );
57
58 protected slots:
59   void accept();          // Called when user presses 'Start' button
60   void stop();            // Called when user presses 'Stop' button
61   void onBrowse();        // Browse file
62   void updateState();     // Update widgets state
63   void toggled();         // Toggle 'Base points' mode
64
65 private:
66   // module
67   SierpinskyGUI*     myModule;
68   
69   // widgets
70   QGroupBox*         box1;
71   QtxDoubleSpinBox*  myStartX;
72   QtxDoubleSpinBox*  myStartY;
73   QCheckBox*         myStartRandom;
74
75   QGroupBox*         box2;
76   QtxDoubleSpinBox*  myX1;
77   QtxDoubleSpinBox*  myY1;
78   QtxDoubleSpinBox*  myX2;
79   QtxDoubleSpinBox*  myY2;
80   QtxDoubleSpinBox*  myX3;
81   QtxDoubleSpinBox*  myY3;
82   QCheckBox*         myBaseRandom;
83   QCheckBox*         myBaseDefault;
84
85   QSpinBox*          myIter;
86
87   QGroupBox*         box3;
88   QCheckBox*         myJpegCheck;
89   QLineEdit*         myJpegFile;
90   QPushButton*       myJpegBtn;
91   QSpinBox*          myJpegSize;
92   QCheckBox*         myMedCheck;
93   QLineEdit*         myMedFile;
94   QPushButton*       myMedBtn;
95   QtxDoubleSpinBox*  myMedSize;
96   QCheckBox*         myVisuCheck;
97
98   QPushButton*       myStartBtn;
99   QPushButton*       myCancelBtn;
100
101   QProgressBar*      myProgress;
102
103   // progress thread
104   MyThread*          myThread;
105 };
106
107 #endif // __SIERPINSKYGUI_RUNDLG_H