1 // Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 #ifndef OCCVIEWER_CLIPPINGDLG_H
24 #define OCCVIEWER_CLIPPINGDLG_H
26 #include "OCCViewer.h"
27 #include "OCCViewer_ClipPlane.h"
31 #include <AIS_Plane.hxx>
32 #include <V3d_Plane.hxx>
39 class QtxDoubleSpinBox;
44 class OCCViewer_Viewer;
45 class OCCViewer_ViewWindow;
48 \class OCCViewer_ClippingDlg
49 \brief Dialog allowing to assign parameters of clipping plane
51 class OCCVIEWER_EXPORT OCCViewer_ClippingDlg : public QDialog
56 OCCViewer_ClippingDlg(OCCViewer_ViewWindow* parrent, OCCViewer_Viewer* model);
57 ~OCCViewer_ClippingDlg();
60 void SetCurrentPlaneParam();
64 virtual void closeEvent( QCloseEvent* e );
65 virtual void showEvent ( QShowEvent * );
66 virtual void hideEvent ( QHideEvent * );
68 void displayPreview();
72 void updateClipping();
74 OCCViewer_ClipPlane& getClipPlane (int theIndex);
75 int clipPlanesCount();
77 QComboBox* ComboBoxPlanes;
78 QCheckBox* isActivePlane;
79 QPushButton* buttonNew;
81 QPushButton* buttonDelete;
82 QPushButton* buttonDisableAll;
84 QStackedLayout *ModeStackedLayout;
86 QGroupBox* GroupAbsolutePoint;
90 QtxDoubleSpinBox* SpinBox_X;
91 QtxDoubleSpinBox* SpinBox_Y;
92 QtxDoubleSpinBox* SpinBox_Z;
93 QPushButton* resetButton;
95 QGroupBox* GroupAbsoluteDirection;
99 QtxDoubleSpinBox* SpinBox_Dx;
100 QtxDoubleSpinBox* SpinBox_Dy;
101 QtxDoubleSpinBox* SpinBox_Dz;
102 QPushButton* invertButton;
103 QComboBox* CBAbsoluteOrientation;
105 QGroupBox* GroupRelative;
106 QLabel* TextLabelOrientation;
107 QLabel* TextLabelDistance;
108 QLabel* TextLabelRotation1;
109 QLabel* TextLabelRotation2;
110 QLabel* TLValueDistance;
111 QLabel* TLValueRotation1;
112 QLabel* TLValueRotation2;
113 QSlider* SliderDistance;
114 QSlider* SliderRotation1;
115 QSlider* SliderRotation2;
116 QComboBox* CBRelativeOrientation;
118 QCheckBox* PreviewCheckBox;
119 QCheckBox* AutoApplyCheckBox;
121 QPushButton* buttonOk;
122 QPushButton* buttonApply;
123 QPushButton* buttonClose;
125 OCCViewer_Viewer* myModel;
126 Handle(V3d_View) myView3d;
128 Standard_Integer myCurrentClipPlaneMode;
129 std::vector<Handle(AIS_Plane)> myPreviewPlaneVector;
131 bool myIsSelectPlane;
133 bool myIsPlaneCreation;
135 ClipPlanesList myLocalPlanes;
143 void ClickOnDelete();
144 void ClickOnDisableAll();
150 void onModeAbsolute();
151 void onModeRelative();
153 void onValueChanged();
154 void onSelectPlane( int );
158 void onOrientationAbsoluteChanged( int );
159 void onOrientationRelativeChanged (int);
161 void onPreview( bool on );
162 void onAutoApply(bool);
164 void SliderDistanceHasMoved(int);
165 void SliderRotation1HasMoved(int);
166 void SliderRotation2HasMoved(int);
169 #endif // OCCVIEWER_CLIPPINGDLG_H