Version: 9.12.0
OCCViewer_ClippingDlg.h
Go to the documentation of this file.
1 // Copyright (C) 2007-2023 CEA, EDF, 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, or (at your option) any later version.
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;
41 class QtxIntSpinSlider;
42 class QStackedLayout;
43 class QSlider;
44 class QMenu;
45 
46 class OCCViewer_Viewer;
49 
55 {
56  Q_OBJECT
57 
58  public:
61 
62  void synchronize();
63  void SetCurrentPlaneParam();
64 
65 private :
66 
67  virtual void closeEvent( QCloseEvent* e );
68  virtual void showEvent ( QShowEvent * );
69  virtual void hideEvent ( QHideEvent * );
70  void initParam();
71  void setPlaneParam( OCCViewer_ClipPlane& thePlane );
72  void displayPreview();
73  void erasePreview();
74  void updatePreview();
75  bool isValid();
76  void updateClipping();
77  void updateControls();
78 
79  OCCViewer_ClipPlane& getClipPlane( int );
80  int clipPlanesCount();
81 
82  OCCViewer_ClipPlane::PlaneMode currentPlaneMode() const;
83 
84 private:
85 
87  QCheckBox* isActivePlane;
88  QPushButton* buttonNew;
90  QPushButton* buttonDelete;
91  QPushButton* buttonDisableAll;
92 
93  QStackedLayout *ModeStackedLayout;
94 
102  QPushButton* resetButton;
103 
111  QPushButton* invertButton;
113 
123 
124  QCheckBox* PreviewCheckBox;
125  QCheckBox* AutoApplyCheckBox;
126 
127  QPushButton* buttonOk;
128  QPushButton* buttonApply;
129  QPushButton* buttonClose;
130 
132  Handle(V3d_View) myView3d;
133 
134  std::vector<Handle(AIS_Plane)> myPreviewPlaneVector;
135 
138  bool myBusy;
140 
142 
144 
145 public slots:
146  void onApply();
147 
148 private slots:
149 
150  void ClickOnNew();
151  void ClickOnDelete();
152  void ClickOnDisableAll();
153  void ClickOnOk();
154  void ClickOnApply();
155  void ClickOnClose();
156  void ClickOnHelp();
157 
158  void onModeAbsolute();
159  void onModeRelative();
160 
161  void onValueChanged();
162  void onSelectPlane( int );
163 
164  void onReset();
165  void onInvert();
166  void onOrientationAbsoluteChanged( int );
167  void onOrientationRelativeChanged( int );
168 
169  void onPreview( bool on );
170  void onAutoApply(bool);
171 
172  void onPlaneClicked( const Handle_AIS_Plane& thePlane );
173  void onPlaneDragged( const Handle_AIS_Plane& thePlane );
174 };
175 
176 #endif // OCCVIEWER_CLIPPINGDLG_H
Handle(TDocStd_Application) CAF_Application
Get OCAF application.
Definition: CAF_Application.cxx:97
#define OCCVIEWER_EXPORT
Definition: OCCViewer.h:33
std::vector< OCCViewer_ClipPlane > ClipPlanesList
Definition: OCCViewer_ClipPlane.h:123
TrgItem synchronize(const SrcItem &, const TrgItem &, const TreeData &)
Synchronize two data trees by recurive comparing of the corresponding items.
Definition: SUIT_TreeSync.h:118
bool isValid(const QPolygon *thePoints, const QPoint &theCurrent)
Definition: SVTK_InteractorStyle.cxx:1746
The class provides mouse dragging operations with AIS_Plane: 1) Sliding plane by dragging it with poi...
Definition: OCCViewer_ClipPlaneInteractor.h:47
Definition: OCCViewer_ClipPlane.h:36
PlaneMode
Definition: OCCViewer_ClipPlane.h:40
Dialog allowing to assign parameters of clipping plane.
Definition: OCCViewer_ClippingDlg.h:55
QtxDoubleSpinBox * SpinBox_Dx
Definition: OCCViewer_ClippingDlg.h:108
QPushButton * buttonApply
Definition: OCCViewer_ClippingDlg.h:128
QPushButton * resetButton
Definition: OCCViewer_ClippingDlg.h:102
QtxDoubleSpinBox * SpinBox_Y
Definition: OCCViewer_ClippingDlg.h:100
bool myIsSelectPlane
Definition: OCCViewer_ClippingDlg.h:136
Handle(V3d_View) myView3d
QCheckBox * isActivePlane
Definition: OCCViewer_ClippingDlg.h:87
QtxDoubleSpinBox * SpinBox_X
Definition: OCCViewer_ClippingDlg.h:99
QLabel * TextLabelY
Definition: OCCViewer_ClippingDlg.h:97
OCCViewer_Viewer * myModel
Definition: OCCViewer_ClippingDlg.h:131
QGroupBox * GroupAbsoluteDirection
Definition: OCCViewer_ClippingDlg.h:104
QCheckBox * PreviewCheckBox
Definition: OCCViewer_ClippingDlg.h:124
bool myIsUpdatingControls
Definition: OCCViewer_ClippingDlg.h:137
QtxDoubleSpinBox * SpinBox_Dz
Definition: OCCViewer_ClippingDlg.h:110
QtxDoubleSpinBox * SpinBox_Z
Definition: OCCViewer_ClippingDlg.h:101
QPushButton * buttonOk
Definition: OCCViewer_ClippingDlg.h:127
QtxIntSpinSlider * SpinSliderRotation2
Definition: OCCViewer_ClippingDlg.h:121
QStackedLayout * ModeStackedLayout
Definition: OCCViewer_ClippingDlg.h:93
QtxDoubleSpinSlider * SpinSliderDistance
Definition: OCCViewer_ClippingDlg.h:119
QtxIntSpinSlider * SpinSliderRotation1
Definition: OCCViewer_ClippingDlg.h:120
QGroupBox * GroupAbsolutePoint
Definition: OCCViewer_ClippingDlg.h:95
QLabel * TextLabelDy
Definition: OCCViewer_ClippingDlg.h:106
QLabel * TextLabelRotation1
Definition: OCCViewer_ClippingDlg.h:117
QComboBox * ComboBoxPlanes
Definition: OCCViewer_ClippingDlg.h:86
QLabel * TextLabelX
Definition: OCCViewer_ClippingDlg.h:96
std::vector< Handle(AIS_Plane)> myPreviewPlaneVector
Definition: OCCViewer_ClippingDlg.h:134
QPushButton * buttonDelete
Definition: OCCViewer_ClippingDlg.h:90
QLabel * TextLabelDz
Definition: OCCViewer_ClippingDlg.h:107
QPushButton * buttonDisableAll
Definition: OCCViewer_ClippingDlg.h:91
QPushButton * buttonClose
Definition: OCCViewer_ClippingDlg.h:129
QLabel * TextLabelOrientation
Definition: OCCViewer_ClippingDlg.h:115
QComboBox * CBAbsoluteOrientation
Definition: OCCViewer_ClippingDlg.h:112
QPushButton * invertButton
Definition: OCCViewer_ClippingDlg.h:111
ClipPlanesList myLocalPlanes
Definition: OCCViewer_ClippingDlg.h:141
QGroupBox * GroupRelative
Definition: OCCViewer_ClippingDlg.h:114
OCCViewer_ClipPlaneInteractor * myInteractor
Definition: OCCViewer_ClippingDlg.h:143
QLabel * TextLabelRotation2
Definition: OCCViewer_ClippingDlg.h:118
QCheckBox * AutoApplyCheckBox
Definition: OCCViewer_ClippingDlg.h:125
QPushButton * buttonNew
Definition: OCCViewer_ClippingDlg.h:88
QMenu * MenuMode
Definition: OCCViewer_ClippingDlg.h:89
bool myBusy
Definition: OCCViewer_ClippingDlg.h:138
QLabel * TextLabelDistance
Definition: OCCViewer_ClippingDlg.h:116
QComboBox * CBRelativeOrientation
Definition: OCCViewer_ClippingDlg.h:122
QLabel * TextLabelZ
Definition: OCCViewer_ClippingDlg.h:98
QtxDoubleSpinBox * SpinBox_Dy
Definition: OCCViewer_ClippingDlg.h:109
QLabel * TextLabelDx
Definition: OCCViewer_ClippingDlg.h:105
bool myIsPlaneCreation
Definition: OCCViewer_ClippingDlg.h:139
Definition: OCCViewer_ViewWindow.h:147
Definition: OCCViewer_ViewModel.h:77
Enhanced version of the Qt's double spin box.
Definition: QtxDoubleSpinBox.h:32
Definition: QtxDoubleSpinSlider.h:35
Definition: QtxIntSpinSlider.h:35