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