CustusX  2021.09.21-dev+develop.e3cd0
An IGT application
cxInteractiveClipper.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 CXINTERACTIVECLIPPER_H_
13 #define CXINTERACTIVECLIPPER_H_
14 
15 #include "cxResourceVisualizationExport.h"
16 
17 #include <vector>
18 #include <QObject>
19 #include "cxDefinitions.h"
20 #include "cxForwardDeclarations.h"
21 class QDomNode;
22 
23 namespace cx
24 {
25 typedef boost::shared_ptr<class CoreServices> CoreServicesPtr;
26 
38 class cxResourceVisualization_EXPORT InteractiveClipper: public QObject
39 {
40  Q_OBJECT
41  QString getDataUids();
42  void setDataUids(QString uids);
43 public:
44  InteractiveClipper(CoreServicesPtr services);
45 
46  void setSlicePlane(PLANE_TYPE plane);
47  void saveClipPlaneToVolume();
48  void clearClipPlanesInVolume();
49  PLANE_TYPE getSlicePlane();
50  bool getUseClipper() const;
51  bool getInvertPlane() const;
52  std::vector<PLANE_TYPE> getAvailableSlicePlanes() const;
53  DataPtr getData() const;
54  void setData(DataPtr data);
55 
56  void addData(DataPtr data);
57  void removeData(DataPtr data);
58  bool exists(DataPtr data);
59  std::map<QString, DataPtr> getDatas();
60  void setTool(ToolPtr tool);
61  void useActiveTool(bool on);
62  void parseXml(QDomNode dataNode);
63  void addXml(QDomNode &dataNode);
64 signals:
65  void changed();
66 public slots:
67  void useClipper(bool on);
68  void invertPlane(bool on);
69 private slots:
70  void changedSlot();
71  void activeToolChangedSlot();
72 
73 protected:
74  PLANE_TYPE getPlaneType();
79  CoreServicesPtr mServices;
80  std::map<QString, DataPtr> mDatas;
82  void removeAllInterActiveClipPlanes();
83  void addAllInteractiveClipPlanes();
84  void updateClipPlanesInData();
85 };
86 typedef boost::shared_ptr<InteractiveClipper> InteractiveClipperPtr;
87 
91 } // namespace cx
92 
93 #endif /* CXINTERACTIVECLIPPER_H_ */
SlicePlaneClipperPtr mSlicePlaneClipper
boost::shared_ptr< class SlicePlanesProxy > SlicePlanesProxyPtr
boost::shared_ptr< class Data > DataPtr
std::map< QString, DataPtr > mDatas
SlicePlanesProxyPtr mSlicePlanesProxy
boost::shared_ptr< class SlicePlaneClipper > SlicePlaneClipperPtr
boost::shared_ptr< class CoreServices > CoreServicesPtr
Definition: cxCameraStyle.h:37
boost::shared_ptr< class InteractiveClipper > InteractiveClipperPtr
Namespace for all CustusX production code.
boost::shared_ptr< class Tool > ToolPtr