]> SALOME platform Git repositories - modules/gui.git/blob - src/OCCViewer/OCCViewer_ClippingDlg.h
Salome HOME
e8f1795a66ac8450720c89e70003e4b7d2deea67
[modules/gui.git] / src / OCCViewer / OCCViewer_ClippingDlg.h
1 // Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 #ifndef OCCVIEWER_CLIPPINGDLG_H
24 #define OCCVIEWER_CLIPPINGDLG_H
25
26 #include "OCCViewer.h"
27 #include "OCCViewer_ClipPlane.h"
28
29 #include <QDialog>
30
31 #include <AIS_Plane.hxx>
32 #include <V3d_Plane.hxx>
33
34 class QGroupBox;
35 class QLabel;
36 class QPushButton;
37 class QComboBox;
38 class QCheckBox;
39 class QtxDoubleSpinBox;
40 class QStackedLayout;
41 class QSlider;
42 class QMenu;
43
44 class OCCViewer_Viewer;
45 class OCCViewer_ViewWindow;
46 class OCCViewer_ClipPlaneInteractor;
47
48 /*!
49   \class OCCViewer_ClippingDlg
50   \brief Dialog allowing to assign parameters of clipping plane
51 */
52 class OCCVIEWER_EXPORT OCCViewer_ClippingDlg : public QDialog
53 {
54     Q_OBJECT
55
56   public:
57   OCCViewer_ClippingDlg(OCCViewer_ViewWindow* parrent, OCCViewer_Viewer* model);
58   ~OCCViewer_ClippingDlg();
59
60   void synchronize();
61   void SetCurrentPlaneParam();
62
63 private :
64
65   virtual void closeEvent( QCloseEvent* e );
66   virtual void showEvent ( QShowEvent * );
67   virtual void hideEvent ( QHideEvent * );
68   void initParam();
69   void displayPreview();
70   void erasePreview();
71   void updatePreview();
72   bool isValid();
73   void updateClipping();
74   void updateControls();
75
76   OCCViewer_ClipPlane& getClipPlane( int );
77   int clipPlanesCount();
78
79   QComboBox* ComboBoxPlanes;
80   QCheckBox* isActivePlane;
81   QPushButton* buttonNew;
82   QMenu* MenuMode;
83   QPushButton* buttonDelete;
84   QPushButton* buttonDisableAll;
85
86   QStackedLayout *ModeStackedLayout;
87
88   QGroupBox* GroupAbsolutePoint;
89   QLabel* TextLabelX;
90   QLabel* TextLabelY;
91   QLabel* TextLabelZ;
92   QtxDoubleSpinBox* SpinBox_X;
93   QtxDoubleSpinBox* SpinBox_Y;
94   QtxDoubleSpinBox* SpinBox_Z;
95   QPushButton* resetButton;
96
97   QGroupBox* GroupAbsoluteDirection;
98   QLabel* TextLabelDx;
99   QLabel* TextLabelDy;
100   QLabel* TextLabelDz;
101   QtxDoubleSpinBox* SpinBox_Dx;
102   QtxDoubleSpinBox* SpinBox_Dy;
103   QtxDoubleSpinBox* SpinBox_Dz;
104   QPushButton* invertButton;
105   QComboBox* CBAbsoluteOrientation;
106
107   QGroupBox* GroupRelative;
108   QLabel* TextLabelOrientation;
109   QLabel* TextLabelDistance;
110   QLabel* TextLabelRotation1;
111   QLabel* TextLabelRotation2;
112   QLabel* TLValueDistance;
113   QLabel* TLValueRotation1;
114   QLabel* TLValueRotation2;
115   QSlider* SliderDistance;
116   QSlider* SliderRotation1;
117   QSlider* SliderRotation2;
118   QComboBox* CBRelativeOrientation;
119
120   QCheckBox* PreviewCheckBox;
121   QCheckBox* AutoApplyCheckBox;
122
123   QPushButton* buttonOk;
124   QPushButton* buttonApply;
125   QPushButton* buttonClose;
126
127   OCCViewer_Viewer* myModel;
128   Handle(V3d_View) myView3d;
129
130   Standard_Integer myCurrentClipPlaneMode;
131   std::vector<Handle(AIS_Plane)> myPreviewPlaneVector;
132
133   bool myIsSelectPlane;
134   bool myIsUpdatingControls;
135   bool myBusy;
136   bool myIsPlaneCreation;
137
138   ClipPlanesList myLocalPlanes;
139
140   OCCViewer_ClipPlaneInteractor* myInteractor;
141
142 public slots:
143   void onApply();
144
145 private slots:
146
147   void ClickOnNew();
148   void ClickOnDelete();
149   void ClickOnDisableAll();
150   void ClickOnOk();
151   void ClickOnApply();
152   void ClickOnClose();
153   void ClickOnHelp();
154
155   void onModeAbsolute();
156   void onModeRelative();
157
158   void onValueChanged();
159   void onSelectPlane( int );
160
161   void onReset();
162   void onInvert();
163   void onOrientationAbsoluteChanged( int );
164   void onOrientationRelativeChanged( int );
165
166   void onPreview( bool on );
167   void onAutoApply(bool);
168
169   void SliderDistanceHasMoved(int);
170   void SliderRotation1HasMoved(int);
171   void SliderRotation2HasMoved(int);
172
173   void onPlaneClicked( const Handle_AIS_Plane& thePlane );
174   void onPlaneDragged( const Handle_AIS_Plane& thePlane );
175 };
176
177 #endif // OCCVIEWER_CLIPPINGDLG_H