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"
30 #include <AIS_Plane.hxx>
31 #include <V3d_Plane.hxx>
38 class QtxDoubleSpinBox;
44 class OCCViewer_ViewWindow;
46 enum Mode { Absolute, Relative };
50 \brief Parameters of clipping plane in relative mode
63 \brief Parameters of clipping plane
67 OrientedPlane RelativeMode;
68 double X,Y,Z,Dx,Dy,Dz;
75 typedef ClipPlane* Pnt_ClipPlane;
76 typedef std::vector<Pnt_ClipPlane> ClipPlaneVector;
79 \class OCCViewer_ClippingDlg
80 \brief Dialog allowing to assign parameters of clipping plane
82 class OCCViewer_ClippingDlg : public QDialog
87 OCCViewer_ClippingDlg(OCCViewer_ViewWindow* , const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
88 ~OCCViewer_ClippingDlg();
90 void SetAction( QtxAction* theAction ) { myAction = theAction; }
92 void SetCurrentPlaneParam();
94 ClipPlaneVector myClippingPlanes;
99 virtual void closeEvent( QCloseEvent* e );
100 virtual void showEvent ( QShowEvent * );
101 virtual void hideEvent ( QHideEvent * );
103 void displayPreview();
108 QComboBox* ComboBoxPlanes;
109 QCheckBox* isActivePlane;
110 QPushButton* buttonNew;
112 QPushButton* buttonDelete;
113 QPushButton* buttonDisableAll;
115 QStackedLayout *ModeStackedLayout;
117 QGroupBox* GroupAbsolutePoint;
121 QtxDoubleSpinBox* SpinBox_X;
122 QtxDoubleSpinBox* SpinBox_Y;
123 QtxDoubleSpinBox* SpinBox_Z;
124 QPushButton* resetButton;
126 QGroupBox* GroupAbsoluteDirection;
130 QtxDoubleSpinBox* SpinBox_Dx;
131 QtxDoubleSpinBox* SpinBox_Dy;
132 QtxDoubleSpinBox* SpinBox_Dz;
133 QPushButton* invertButton;
134 QComboBox* CBAbsoluteOrientation;
136 QGroupBox* GroupRelative;
137 QLabel* TextLabelOrientation;
138 QLabel* TextLabelDistance;
139 QLabel* TextLabelRotation1;
140 QLabel* TextLabelRotation2;
141 QLabel* TLValueDistance;
142 QLabel* TLValueRotation1;
143 QLabel* TLValueRotation2;
144 QSlider* SliderDistance;
145 QSlider* SliderRotation1;
146 QSlider* SliderRotation2;
147 QComboBox* CBRelativeOrientation;
149 QCheckBox* PreviewCheckBox;
150 QCheckBox* AutoApplyCheckBox;
152 QPushButton* buttonOk;
153 QPushButton* buttonApply;
154 QPushButton* buttonClose;
156 OCCViewer_ViewWindow* myView;
157 Handle(V3d_View) myView3d;
159 std::vector<Handle(AIS_Plane)> myPreviewPlaneVector;
161 bool myIsSelectPlane;
174 void ClickOnDelete();
175 void ClickOnDisableAll();
181 void onModeAbsolute();
182 void onModeRelative();
184 void onValueChanged();
185 void onSelectPlane( int );
189 void onOrientationAbsoluteChanged( int );
190 void onOrientationRelativeChanged (int);
192 void onPreview( bool on );
193 void onAutoApply(bool);
198 void SliderDistanceHasMoved(int);
199 void SliderRotation1HasMoved(int);
200 void SliderRotation2HasMoved(int);
203 #endif // OCCVIEWER_CLIPPINGDLG_H