Fraxinus  18.10
An IGT application
cxToolImpl.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 CXTOOLIMPL_H
12 #define CXTOOLIMPL_H
13 
14 #include "cxResourceExport.h"
15 
16 #include "cxTool.h"
17 #include "cxToolFileParser.h"
18 
19 namespace cx
20 {
21 typedef boost::shared_ptr<class TrackingPositionFilter> TrackingPositionFilterPtr;
22 
30 class cxResource_EXPORT ToolImpl : public Tool
31 {
32  Q_OBJECT
33 public:
34  explicit ToolImpl(const QString& uid="", const QString& name ="");
35  virtual ~ToolImpl();
36 
37  virtual TimedTransformMapPtr getPositionHistory();
38  virtual TimedTransformMap getSessionHistory(double startTime, double stopTime);
39  virtual Transform3D get_prMt() const;
40 
41  virtual ToolPositionMetadata getMetadata() const;
42  virtual const std::map<double, ToolPositionMetadata>& getMetadataHistory();
43 
44  virtual double getTooltipOffset() const;
45  virtual void setTooltipOffset(double val);
46 
47  virtual void resetTrackingPositionFilter(TrackingPositionFilterPtr filter);
48  virtual bool isNull() { return false; }
49 
50  virtual void addXml(QDomNode& dataNode) {Q_UNUSED(dataNode)}
51  virtual void parseXml(QDomNode& dataNode) {Q_UNUSED(dataNode)}
52 
53  virtual vtkPolyDataPtr getGraphicsPolyData() const;
54  virtual bool hasReferencePointWithId(int id);
55 protected:
56  virtual void set_prMt(const Transform3D& prMt, double timestamp);
57  void createToolGraphic();
58 
61  TrackingPositionFilterPtr mTrackingPositionFilter;
62  std::map<double, ToolPositionMetadata> mMetadata;
64 
65  virtual std::set<Type> getTypes() const;
66  virtual std::map<int, Vector3D> getReferencePoints() const;
68 private:
69  double mTooltipOffset;
70 };
71 typedef boost::shared_ptr<ToolImpl> cxToolPtr;
72 
73 } // namespace cx
74 
75 #endif // CXTOOLIMPL_H
TimedTransformMapPtr mPositionHistory
Definition: cxToolImpl.h:59
boost::shared_ptr< ToolInternalStructure > ToolInternalStructurePtr
TrackingPositionFilterPtr mTrackingPositionFilter
Definition: cxToolImpl.h:61
Interface to a tool, i.e. a pointer, US probe or similar.
Definition: cxTool.h:61
virtual void parseXml(QDomNode &dataNode)
Definition: cxToolImpl.h:51
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
boost::shared_ptr< ToolImpl > cxToolPtr
Definition: cxToolImpl.h:71
Common functionality for Tool subclasses.
Definition: cxToolImpl.h:30
vtkPolyDataPtr mPolyData
the polydata used to represent the tool graphically
Definition: cxToolImpl.h:63
virtual bool isNull()
Definition: cxToolImpl.h:48
virtual ToolFileParser::ToolInternalStructurePtr getToolFileToolStructure() const
Definition: cxToolImpl.h:67
boost::shared_ptr< TimedTransformMap > TimedTransformMapPtr
Definition: cxTool.h:36
vtkSmartPointer< vtkPolyData > vtkPolyDataPtr
std::map< double, ToolPositionMetadata > mMetadata
Definition: cxToolImpl.h:62
virtual void addXml(QDomNode &dataNode)
Definition: cxToolImpl.h:50
boost::shared_ptr< class TrackingPositionFilter > TrackingPositionFilterPtr
Definition: cxTool.h:37
std::map< double, Transform3D > TimedTransformMap
Transform3D m_prMt
the transform from the tool to the patient reference
Definition: cxToolImpl.h:60
Namespace for all CustusX production code.