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