Salome HOME
Fix pb with Animation
[modules/visu.git] / src / VISUGUI / VisuGUI_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   : VisuGUI_CubeAxesDlg.h
23 //  Author : Sergey LITONIN
24 //  Module : VISU
25
26
27 #ifndef VisuGUI_CubeAxesDlg_H
28 #define VisuGUI_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 VisuGUI_FontWg;
40 class QGroupBox;
41 class VisuGUI_AxisWg;
42 class vtkAxisActor2D;
43
44 /*!
45  * Class       : VisuGUI_CubeAxesDlg
46  * Description : Dialog for specifynig cube axes properties
47  */
48 class VisuGUI_CubeAxesDlg : public QDialog
49 {
50   Q_OBJECT
51
52 public:
53                   VisuGUI_CubeAxesDlg( QWidget* );
54   virtual         ~VisuGUI_CubeAxesDlg();
55
56   bool            Init();
57
58 private slots:
59   void            onOk();
60   bool            onApply();
61   void            onClose();
62
63   void            onWindowActivated( QWidget* );
64
65 private:
66   QWidget*        createButtonFrame( QWidget* );
67   QWidget*        createMainFrame  ( QWidget* );
68   bool            isValid() const;
69
70 private:
71   QTabWidget*     myTabWg;
72   QCheckBox*      myIsVisible;
73
74   QPushButton*    myOkBtn;
75   QPushButton*    myApplyBtn;
76   QPushButton*    myCloseBtn;
77   VisuGUI_AxisWg* myAxes[ 3 ];
78 };
79
80 /*!
81  * Class       : VisuGUI_AxisWg
82  * Description : Tab of dialog
83  */
84 class VisuGUI_AxisWg : public QFrame
85 {
86   Q_OBJECT
87
88 public:
89                   VisuGUI_AxisWg( QWidget* );
90                   ~VisuGUI_AxisWg();
91
92   void            UseName( const bool );
93   void            SetName( const QString& );
94   void            SetNameFont( const QColor&, const int, const bool, const bool, const bool );
95   bool            ReadData( vtkAxisActor2D* );
96   bool            Apply( vtkAxisActor2D* );
97
98 protected:
99   bool            eventFilter(QObject*, QEvent*);
100
101 private slots:
102   void            onNameChecked();
103   void            onLabelsChecked();
104   void            onTicksChecked();
105
106 private:
107   void            updateControlState();
108   void            setEnabled( QGroupBox*, const bool );
109
110 private:
111   // name
112   QGroupBox*      myNameGrp;
113   QCheckBox*      myIsNameVisible;
114   QLineEdit*      myAxisName;
115   VisuGUI_FontWg* myNameFont;
116
117   // labels
118   QGroupBox*      myLabelsGrp;
119   QCheckBox*      myIsLabelsVisible;
120   QLineEdit*      myLabelNumber;
121   QLineEdit*      myLabelOffset;
122   VisuGUI_FontWg* myLabelsFont;
123
124   // tick marks
125   QGroupBox*      myTicksGrp;
126   QCheckBox*      myIsTicksVisible;
127   QLineEdit*      myTickLength;
128
129   friend class VisuGUI_CubeAxesDlg;
130 };
131
132 #endif