Salome HOME
192668cdd7b148b0828e526e169349610e8d7fd8
[modules/gui.git] / src / OCCViewer / OCCViewer_ClippingDlg.h
1 // Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
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/
18 //
19 #ifndef OCCVIEWER_CLIPPINGDLG_H
20 #define OCCVIEWER_CLIPPINGDLG_H
21
22 #include "OCCViewer.h"
23
24 #include <qdialog.h>
25
26 #include <AIS_Plane.hxx>
27 #include <V3d_Plane.hxx>
28
29 class QGroupBox;
30 class QLabel;
31 class QPushButton;
32 class QComboBox;
33 class QCheckBox;
34 class QtxDblSpinBox;
35 class QtxAction;
36
37 class OCCViewer_ViewWindow;
38
39
40 /*!
41   \class OCCViewer_ClippingDlg
42   \brief Dialog allowing to assign parameters of clipping plane
43 */
44 class OCCViewer_ClippingDlg : public QDialog
45 {
46     Q_OBJECT
47     
48     public:
49     OCCViewer_ClippingDlg(OCCViewer_ViewWindow* , QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0);
50     ~OCCViewer_ClippingDlg();
51
52     void SetAction( QtxAction* theAction ) { myAction = theAction; }
53     
54 private :
55
56     virtual void closeEvent( QCloseEvent* e );
57     virtual void showEvent ( QShowEvent * );
58     virtual void hideEvent ( QHideEvent * );
59     void displayPreview();
60     void erasePreview();
61     void ReserveClippingPlane();
62
63     bool isValid();
64      
65     QGroupBox* GroupPoint;
66     QLabel* TextLabelX;
67     QLabel* TextLabelY;
68     QLabel* TextLabelZ;
69     QtxDblSpinBox* SpinBox_X;
70     QtxDblSpinBox* SpinBox_Y;
71     QtxDblSpinBox* SpinBox_Z;
72     QPushButton* resetButton;
73     
74     QGroupBox* GroupDirection;
75     QLabel* TextLabelDx;
76     QLabel* TextLabelDy;
77     QLabel* TextLabelDz;
78     QtxDblSpinBox* SpinBox_Dx;
79     QtxDblSpinBox* SpinBox_Dy;
80     QtxDblSpinBox* SpinBox_Dz;
81     QPushButton* invertButton;
82     
83     QComboBox* DirectionCB;
84
85     QCheckBox* PreviewChB;
86
87     QPushButton*    buttonApply;
88     QPushButton*    buttonClose;
89     
90     OCCViewer_ViewWindow* myView;
91
92     Handle(AIS_Plane) myPreviewPlane;
93     Handle(V3d_Plane) myClippingPlane;
94     
95     bool myBusy;
96
97     QtxAction* myAction;
98     
99 private slots:
100   void ClickOnApply();
101   void ClickOnClose();
102
103   void onReset();
104   void onInvert();
105   void onModeChanged( int mode );
106   void onValueChanged();
107   void onPreview( bool on );
108 };
109
110 #endif // OCCVIEWER_CLIPPINGDLG_H