1 // Copyright (C) 2007-2016 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, or (at your option) any later version.
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;
40 class QtxDoubleSpinSlider;
41 class QtxIntSpinSlider;
46 class OCCViewer_Viewer;
47 class OCCViewer_ViewWindow;
48 class OCCViewer_ClipPlaneInteractor;
51 \class OCCViewer_ClippingDlg
52 \brief Dialog allowing to assign parameters of clipping plane
54 class OCCVIEWER_EXPORT OCCViewer_ClippingDlg : public QDialog
59 OCCViewer_ClippingDlg(OCCViewer_ViewWindow* parrent, OCCViewer_Viewer* model);
60 ~OCCViewer_ClippingDlg();
63 void SetCurrentPlaneParam();
67 virtual void closeEvent( QCloseEvent* e );
68 virtual void showEvent ( QShowEvent * );
69 virtual void hideEvent ( QHideEvent * );
71 void setPlaneParam( OCCViewer_ClipPlane& thePlane );
72 void displayPreview();
76 void updateClipping();
77 void updateControls();
79 OCCViewer_ClipPlane& getClipPlane( int );
80 int clipPlanesCount();
82 OCCViewer_ClipPlane::PlaneMode currentPlaneMode() const;
86 QComboBox* ComboBoxPlanes;
87 QCheckBox* isActivePlane;
88 QPushButton* buttonNew;
90 QPushButton* buttonDelete;
91 QPushButton* buttonDisableAll;
93 QStackedLayout *ModeStackedLayout;
95 QGroupBox* GroupAbsolutePoint;
99 QtxDoubleSpinBox* SpinBox_X;
100 QtxDoubleSpinBox* SpinBox_Y;
101 QtxDoubleSpinBox* SpinBox_Z;
102 QPushButton* resetButton;
104 QGroupBox* GroupAbsoluteDirection;
108 QtxDoubleSpinBox* SpinBox_Dx;
109 QtxDoubleSpinBox* SpinBox_Dy;
110 QtxDoubleSpinBox* SpinBox_Dz;
111 QPushButton* invertButton;
112 QComboBox* CBAbsoluteOrientation;
114 QGroupBox* GroupRelative;
115 QLabel* TextLabelOrientation;
116 QLabel* TextLabelDistance;
117 QLabel* TextLabelRotation1;
118 QLabel* TextLabelRotation2;
119 QtxDoubleSpinSlider* SpinSliderDistance;
120 QtxIntSpinSlider* SpinSliderRotation1;
121 QtxIntSpinSlider* SpinSliderRotation2;
122 QComboBox* CBRelativeOrientation;
124 QCheckBox* PreviewCheckBox;
125 QCheckBox* AutoApplyCheckBox;
127 QPushButton* buttonOk;
128 QPushButton* buttonApply;
129 QPushButton* buttonClose;
131 OCCViewer_Viewer* myModel;
132 Handle(V3d_View) myView3d;
134 std::vector<Handle(AIS_Plane)> myPreviewPlaneVector;
136 bool myIsSelectPlane;
137 bool myIsUpdatingControls;
139 bool myIsPlaneCreation;
141 ClipPlanesList myLocalPlanes;
143 OCCViewer_ClipPlaneInteractor* myInteractor;
151 void ClickOnDelete();
152 void ClickOnDisableAll();
158 void onModeAbsolute();
159 void onModeRelative();
161 void onValueChanged();
162 void onSelectPlane( int );
166 void onOrientationAbsoluteChanged( int );
167 void onOrientationRelativeChanged( int );
169 void onPreview( bool on );
170 void onAutoApply(bool);
172 void onPlaneClicked( const Handle_AIS_Plane& thePlane );
173 void onPlaneDragged( const Handle_AIS_Plane& thePlane );
176 #endif // OCCVIEWER_CLIPPINGDLG_H