Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
OCCViewer_ClippingDlg.h
Go to the documentation of this file.
1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D, 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 
136  bool myIsSelectPlane;
137  bool myIsUpdatingControls;
138  bool myBusy;
139  bool myIsPlaneCreation;
140 
141  ClipPlanesList myLocalPlanes;
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