Fraxinus  2023.01.05-dev+develop.0da12
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  virtual ToolPtr getBaseTool();
41 
42  virtual ToolPositionMetadata getMetadata() const;
43  virtual const std::map<double, ToolPositionMetadata>& getMetadataHistory();
44 
45  virtual double getTooltipOffset() const;
46  virtual void setTooltipOffset(double val);
47 
48  virtual void resetTrackingPositionFilter(TrackingPositionFilterPtr filter);
49  virtual bool isNull() { return false; }
50 
51  virtual void addXml(QDomNode& dataNode) {Q_UNUSED(dataNode)}
52  virtual void parseXml(QDomNode& dataNode) {Q_UNUSED(dataNode)}
53 
54  virtual vtkPolyDataPtr getGraphicsPolyData() const;
55  virtual bool hasReferencePointWithId(QString id);
56 protected:
57  virtual void set_prMt(const Transform3D& prMt, double timestamp);
58  void createToolGraphic();
59 
62  TrackingPositionFilterPtr mTrackingPositionFilter;
63  std::map<double, ToolPositionMetadata> mMetadata;
65 
66  virtual std::set<Type> getTypes() const;
67  virtual std::map<QString, Vector3D> getReferencePoints() const;
69 private:
70  double mTooltipOffset;
71 };
72 typedef boost::shared_ptr<ToolImpl> cxToolPtr;
73 
74 } // namespace cx
75 
76 #endif // CXTOOLIMPL_H
TimedTransformMapPtr mPositionHistory
Definition: cxToolImpl.h:60
boost::shared_ptr< ToolInternalStructure > ToolInternalStructurePtr
TrackingPositionFilterPtr mTrackingPositionFilter
Definition: cxToolImpl.h:62
Interface to a tool, i.e. a pointer, US probe or similar.
Definition: cxTool.h:61
virtual void parseXml(QDomNode &dataNode)
Definition: cxToolImpl.h:52
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
boost::shared_ptr< ToolImpl > cxToolPtr
Definition: cxToolImpl.h:72
Common functionality for Tool subclasses.
Definition: cxToolImpl.h:30
vtkPolyDataPtr mPolyData
the polydata used to represent the tool graphically
Definition: cxToolImpl.h:64
virtual bool isNull()
Definition: cxToolImpl.h:49
virtual ToolFileParser::ToolInternalStructurePtr getToolFileToolStructure() const
Definition: cxToolImpl.h:68
boost::shared_ptr< TimedTransformMap > TimedTransformMapPtr
Definition: cxTool.h:36
vtkSmartPointer< vtkPolyData > vtkPolyDataPtr
std::map< double, ToolPositionMetadata > mMetadata
Definition: cxToolImpl.h:63
virtual void addXml(QDomNode &dataNode)
Definition: cxToolImpl.h:51
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:61
Namespace for all CustusX production code.
boost::shared_ptr< class Tool > ToolPtr