Fraxinus  2023.01.05-dev+develop.0da12
An IGT application
cxEraserWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 #ifndef CXERASERWIDGET_H_
13 #define CXERASERWIDGET_H_
14 
15 #include "cxGuiExport.h"
16 
17 #include "cxBaseWidget.h"
18 
19 #include "cxVector3D.h"
20 #include "vtkForwardDeclarations.h"
21 #include "cxDoubleProperty.h"
22 #include "cxActiveImageProxy.h"
23 
24 typedef vtkSmartPointer<class vtkSphereWidget> vtkSphereWidgetPtr;
25 
26 namespace cx
27 {
28 
43 class cxGui_EXPORT EraserWidget: public BaseWidget
44 {
45 Q_OBJECT
46 
47 public:
48  EraserWidget(PatientModelServicePtr patientModelService, ViewServicePtr viewService, QWidget* parent);
49 
50  virtual ~EraserWidget();
51 private:
52  QCheckBox* mContinousEraseCheckBox;
53  vtkSphereSourcePtr mSphere;
54  QCheckBox* mShowEraserCheckBox;
55  DoublePropertyPtr mSphereSizeAdapter;
56  DoublePropertyPtr mEraseValueAdapter;
57  QAction* mDuplicateAction;
58  QAction* mSaveAction;
59  QAction* mRemoveAction;
60  QWidget* mSphereSize;
61  QWidget* mEraseValueWidget;
62 
63  void enableButtons();
64  template <class TYPE>
65  void eraseVolume(TYPE* volumePointer);
66 
67  QTimer* mContinousEraseTimer;
68 
69  Vector3D mPreviousCenter;
70  double mPreviousRadius;
71 
72  ActiveImageProxyPtr mActiveImageProxy;
73  PatientModelServicePtr mPatientModelService;
74  ViewServicePtr mViewService;
75  ActiveDataPtr mActiveData;
76 
77 protected slots:
78  void toggleShowEraser(bool on);
79  void toggleContinous(bool on);
80  void saveSlot();
81  void removeSlot();
82  void continousRemoveSlot();
83  void duplicateSlot();
84  void sphereSizeChangedSlot();
85  void activeImageChangedSlot();
86 };
87 
88 }
89 
90 #endif /* CXERASERWIDGET_H_ */
boost::shared_ptr< class ActiveImageProxy > ActiveImageProxyPtr
boost::shared_ptr< class ActiveData > ActiveDataPtr
Definition: cxColorWidget.h:21
boost::shared_ptr< class ViewService > ViewServicePtr
vtkSmartPointer< class vtkSphereWidget > vtkSphereWidgetPtr
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
vtkSmartPointer< class vtkSphereSource > vtkSphereSourcePtr
boost::shared_ptr< class DoubleProperty > DoublePropertyPtr
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:42
Interface for QWidget which handles widgets uniformly for the system.
Definition: cxBaseWidget.h:88
Widget for erasing parts of images/meshes.
Namespace for all CustusX production code.