NorMIT-nav  16.5
An IGT application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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) 2008-2014, SINTEF Department of Medical Technology
5 All rights reserved.
6 
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions are met:
9 
10 1. Redistributions of source code must retain the above copyright notice,
11  this list of conditions and the following disclaimer.
12 
13 2. Redistributions in binary form must reproduce the above copyright notice,
14  this list of conditions and the following disclaimer in the documentation
15  and/or other materials provided with the distribution.
16 
17 3. Neither the name of the copyright holder nor the names of its contributors
18  may be used to endorse or promote products derived from this software
19  without specific prior written permission.
20 
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 =========================================================================*/
32 #ifndef CXTOOLPROXY_H
33 #define CXTOOLPROXY_H
34 
35 #include "cxTool.h"
37 
38 class ctkPluginContext;
39 
40 namespace cx
41 {
42 typedef boost::shared_ptr<class TrackingService> TrackingServicePtr;
43 
48 class cxResource_EXPORT ToolProxy: public Tool
49 {
50  Q_OBJECT
51 public:
52  static ToolPtr create(ToolPtr base, ctkPluginContext *pluginContext);
53 
54  virtual ~ToolProxy() {}
55 
56  virtual std::set<Type> getTypes() const;
57  virtual vtkPolyDataPtr getGraphicsPolyData() const;
58  virtual TimedTransformMapPtr getPositionHistory();
59  virtual ToolPositionMetadata getMetadata() const;
60  virtual const std::map<double, ToolPositionMetadata>& getMetadataHistory();
61 
62  virtual bool getVisible() const;
63  virtual bool isInitialized() const;
64 
65  virtual QString getUid() const;
66  virtual QString getName() const;
67 
68  virtual bool isCalibrated() const;
69  virtual Transform3D getCalibration_sMt() const;
70  virtual void setCalibration_sMt(Transform3D calibration);
71 
72  virtual ProbePtr getProbe() const;
73  virtual double getTimestamp() const;
74  virtual void printSelf(std::ostream &os, Indent indent);
75 
76  virtual double getTooltipOffset() const;
77  virtual void setTooltipOffset(double val);
78  virtual std::map<int, Vector3D> getReferencePoints() const;
79  virtual bool hasReferencePointWithId(int id);
80 
81  virtual TimedTransformMap getSessionHistory(double startTime, double stopTime);
82  virtual Transform3D get_prMt() const;
83 
84  virtual void resetTrackingPositionFilter(TrackingPositionFilterPtr filter);
85 
86  virtual void set_prMt(const Transform3D& prMt, double timestamp);
87  virtual void setVisible(bool vis);
88 
89  virtual bool isNull();
90 
91 private slots:
92  void onStateChanged();
93 private:
94  ToolProxy(ToolPtr base, ctkPluginContext *pluginContext);
95  void initServiceListener();
96  void onServiceAdded(TrackingService* service);
97  void onServiceRemoved(TrackingService *service);
98  void checkToolValidity();
99 
100  ctkPluginContext *mPluginContext;
101  ToolPtr mTool;
102  TrackingServicePtr mTrackingService;
103  boost::shared_ptr<ServiceTrackerListener<TrackingService> > mServiceListener;
104 
105 };
106 
107 } // namespace cx
108 
109 #endif // CXTOOLPROXY_H
Interface to a tool, i.e. a pointer, US probe or similar.
Definition: cxTool.h:82
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:93
vtkSmartPointer< class vtkPolyData > vtkPolyDataPtr
boost::shared_ptr< TimedTransformMap > TimedTransformMapPtr
Definition: cxTool.h:57
Formatting class for debug printing of the ssc library.
Definition: cxIndent.h:49
Service providing tools and tracking systems.
virtual ~ToolProxy()
Definition: cxToolProxy.h:54
boost::shared_ptr< class TrackingPositionFilter > TrackingPositionFilterPtr
Definition: cxTool.h:58
std::map< double, Transform3D > TimedTransformMap
boost::shared_ptr< class Tool > ToolPtr