CustusX  22.04-rc5
An IGT application
cxToolProxy.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 #ifndef CXTOOLPROXY_H
12 #define CXTOOLPROXY_H
13 
14 #include "cxTool.h"
16 
17 class ctkPluginContext;
18 
19 namespace cx
20 {
21 typedef boost::shared_ptr<class TrackingService> TrackingServicePtr;
22 
27 class cxResource_EXPORT ToolProxy: public Tool
28 {
29  Q_OBJECT
30 public:
31  static ToolPtr create(ToolPtr base, ctkPluginContext *pluginContext);
32 
33  virtual ~ToolProxy() {}
34 
35  virtual std::set<Type> getTypes() const;
36  virtual vtkPolyDataPtr getGraphicsPolyData() const;
37  virtual TimedTransformMapPtr getPositionHistory();
38  virtual ToolPositionMetadata getMetadata() const;
39  virtual const std::map<double, ToolPositionMetadata>& getMetadataHistory();
40 
41  virtual bool getVisible() const;
42  virtual bool isInitialized() const;
43 
44  virtual QString getUid() const;
45  virtual QString getName() const;
46 
47  virtual bool isCalibrated() const;
48  virtual Transform3D getCalibration_sMt() const;
49  virtual void setCalibration_sMt(Transform3D calibration);
50 
51  virtual ProbePtr getProbe() const;
52  virtual double getTimestamp() const;
53  virtual void printSelf(std::ostream &os, Indent indent);
54 
55  virtual double getTooltipOffset() const;
56  virtual void setTooltipOffset(double val);
57  virtual std::map<QString, Vector3D> getReferencePoints() const;
58  virtual bool hasReferencePointWithId(QString id);
59 
60  virtual TimedTransformMap getSessionHistory(double startTime, double stopTime);
61  virtual Transform3D get_prMt() const;
62 
63  virtual void resetTrackingPositionFilter(TrackingPositionFilterPtr filter);
64 
65  virtual void set_prMt(const Transform3D& prMt, double timestamp);
66  virtual void setVisible(bool vis);
67 
68  virtual ToolPtr getBaseTool();
69 
70  virtual bool isNull();
71 
72 private slots:
73  void onStateChanged();
74 private:
75  ToolProxy(ToolPtr base, ctkPluginContext *pluginContext);
76  void initServiceListener();
77  void onServiceAdded(TrackingService* service);
78  void onServiceRemoved(TrackingService *service);
79  void checkToolValidity();
80 
81  ctkPluginContext *mPluginContext;
82  ToolPtr mTool;
83  TrackingServicePtr mTrackingService;
84  boost::shared_ptr<ServiceTrackerListener<TrackingService> > mServiceListener;
85 
86 };
87 
88 } // namespace cx
89 
90 #endif // CXTOOLPROXY_H
Interface to a tool, i.e. a pointer, US probe or similar.
Definition: cxTool.h:61
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
boost::shared_ptr< class TrackingService > TrackingServicePtr
boost::shared_ptr< Probe > ProbePtr
Definition: cxProbe.h:72
boost::shared_ptr< TimedTransformMap > TimedTransformMapPtr
Definition: cxTool.h:36
Formatting class for debug printing of the ssc library.
Definition: cxIndent.h:28
Service providing tools and tracking systems.
vtkSmartPointer< vtkPolyData > vtkPolyDataPtr
virtual ~ToolProxy()
Definition: cxToolProxy.h:33
boost::shared_ptr< class TrackingPositionFilter > TrackingPositionFilterPtr
Definition: cxTool.h:37
std::map< double, Transform3D > TimedTransformMap
Namespace for all CustusX production code.
boost::shared_ptr< class Tool > ToolPtr