Salome HOME
642306084f6c0e935ffa8ebbe7d57a7b05d0da43
[modules/gui.git] / src / SVTK / SVTK_CubeAxesDlg.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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
19 //
20 //
21 //
22 //  File   : SVTK_CubeAxesDlg.h
23 //  Author : Sergey LITONIN
24 //  Module : VISU
25
26
27 #ifndef SVTK_CubeAxesDlg_H
28 #define SVTK_CubeAxesDlg_H
29
30 #include <qdialog.h>
31 #include <qframe.h>
32
33 class QWidget;
34 class QFrame;
35 class QPushButton;
36 class QTabWidget;
37 class QCheckBox;
38 class QLineEdit;
39 class QGroupBox;
40
41 class QtxAction;
42 class QtxIntSpinBox;
43
44 class vtkAxisActor2D;
45 class SVTK_CubeAxesActor2D;
46
47 class SVTK_FontWidget;
48 class SVTK_AxisWidget;
49 class SVTK_MainWindow;
50
51 /*!
52  * Class       : SVTK_CubeAxesDlg
53  * Description : Dialog for specifynig cube axes properties
54  */
55 class SVTK_CubeAxesDlg : public QDialog
56 {
57   Q_OBJECT
58
59 public:
60                   SVTK_CubeAxesDlg(SVTK_MainWindow* theParent,
61                                    const char* theName,
62                                    QtxAction* theAction);
63   virtual         ~SVTK_CubeAxesDlg();
64
65   void            Update();
66
67 private slots:
68   void            onOk();
69   bool            onApply();
70   void            onClose();
71
72   virtual void    done( int );
73
74 private:
75   QWidget*        createButtonFrame( QWidget* );
76   QWidget*        createMainFrame  ( QWidget* );
77   bool            isValid() const;
78
79 private:
80   SVTK_MainWindow *myMainWindow;
81   SVTK_CubeAxesActor2D* myActor;
82   QtxAction* myAction;
83
84   QTabWidget*     myTabWg;
85   QCheckBox*      myIsVisible;
86
87   QPushButton*    myOkBtn;
88   QPushButton*    myApplyBtn;
89   QPushButton*    myCloseBtn;
90   SVTK_AxisWidget* myAxes[ 3 ];
91 };
92
93 /*!
94  * Class       : SVTK_AxisWidget
95  * Description : Tab of dialog
96  */
97 class SVTK_AxisWidget : public QFrame
98 {
99   Q_OBJECT
100
101 public:
102                   SVTK_AxisWidget( QWidget* );
103                   ~SVTK_AxisWidget();
104
105   void            UseName( const bool );
106   void            SetName( const QString& );
107   void            SetNameFont( const QColor&, const int, const bool, const bool, const bool );
108   bool            ReadData( vtkAxisActor2D* );
109   bool            Apply( vtkAxisActor2D* );
110
111 private slots:
112   void            onNameChecked();
113   void            onLabelsChecked();
114   void            onTicksChecked();
115
116 private:
117   void            updateControlState();
118   void            setEnabled( QGroupBox*, const bool );
119
120 private:
121   // name
122   QGroupBox*      myNameGrp;
123   QCheckBox*      myIsNameVisible;
124   QLineEdit*      myAxisName;
125   SVTK_FontWidget* myNameFont;
126
127   // labels
128   QGroupBox*      myLabelsGrp;
129   QCheckBox*      myIsLabelsVisible;
130   QtxIntSpinBox*  myLabelNumber;
131   QtxIntSpinBox*  myLabelOffset;
132   SVTK_FontWidget* myLabelsFont;
133
134   // tick marks
135   QGroupBox*      myTicksGrp;
136   QCheckBox*      myIsTicksVisible;
137   QtxIntSpinBox*  myTickLength;
138
139   friend class SVTK_CubeAxesDlg;
140 };
141
142 #endif