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;
46 class OCCViewer_ClipPlaneInteractor;
49 \class OCCViewer_ClippingDlg
50 \brief Dialog allowing to assign parameters of clipping plane
52 class OCCVIEWER_EXPORT OCCViewer_ClippingDlg : public QDialog
57 OCCViewer_ClippingDlg(OCCViewer_ViewWindow* parrent, OCCViewer_Viewer* model);
58 ~OCCViewer_ClippingDlg();
61 void SetCurrentPlaneParam();
65 virtual void closeEvent( QCloseEvent* e );
66 virtual void showEvent ( QShowEvent * );
67 virtual void hideEvent ( QHideEvent * );
69 void displayPreview();
73 void updateClipping();
74 void updateControls();
76 OCCViewer_ClipPlane& getClipPlane( int );
77 int clipPlanesCount();
79 QComboBox* ComboBoxPlanes;
80 QCheckBox* isActivePlane;
81 QPushButton* buttonNew;
83 QPushButton* buttonDelete;
84 QPushButton* buttonDisableAll;
86 QStackedLayout *ModeStackedLayout;
88 QGroupBox* GroupAbsolutePoint;
92 QtxDoubleSpinBox* SpinBox_X;
93 QtxDoubleSpinBox* SpinBox_Y;
94 QtxDoubleSpinBox* SpinBox_Z;
95 QPushButton* resetButton;
97 QGroupBox* GroupAbsoluteDirection;
101 QtxDoubleSpinBox* SpinBox_Dx;
102 QtxDoubleSpinBox* SpinBox_Dy;
103 QtxDoubleSpinBox* SpinBox_Dz;
104 QPushButton* invertButton;
105 QComboBox* CBAbsoluteOrientation;
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;
120 QCheckBox* PreviewCheckBox;
121 QCheckBox* AutoApplyCheckBox;
123 QPushButton* buttonOk;
124 QPushButton* buttonApply;
125 QPushButton* buttonClose;
127 OCCViewer_Viewer* myModel;
128 Handle(V3d_View) myView3d;
130 Standard_Integer myCurrentClipPlaneMode;
131 std::vector<Handle(AIS_Plane)> myPreviewPlaneVector;
133 bool myIsSelectPlane;
134 bool myIsUpdatingControls;
136 bool myIsPlaneCreation;
138 ClipPlanesList myLocalPlanes;
140 OCCViewer_ClipPlaneInteractor* myInteractor;
148 void ClickOnDelete();
149 void ClickOnDisableAll();
155 void onModeAbsolute();
156 void onModeRelative();
158 void onValueChanged();
159 void onSelectPlane( int );
163 void onOrientationAbsoluteChanged( int );
164 void onOrientationRelativeChanged( int );
166 void onPreview( bool on );
167 void onAutoApply(bool);
169 void SliderDistanceHasMoved(int);
170 void SliderRotation1HasMoved(int);
171 void SliderRotation2HasMoved(int);
173 void onPlaneClicked( const Handle_AIS_Plane& thePlane );
174 void onPlaneDragged( const Handle_AIS_Plane& thePlane );
177 #endif // OCCVIEWER_CLIPPINGDLG_H