Fraxinus  16.5.0-fx-rc1
An IGT application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cxDummyToolManager.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 
33 
34 #ifndef CXDUMMYTOOLMANAGER_H_
35 #define CXDUMMYTOOLMANAGER_H_
36 
37 #include "cxResourceExport.h"
38 
39 #include "cxTrackingService.h"
40 #include "cxDummyTool.h"
41 
42 namespace cx
43 {
44 
52 class cxResource_EXPORT DummyToolManager : public TrackingService
53 {
54  Q_OBJECT
55 
56 public:
57  typedef boost::shared_ptr<DummyToolManager> DummyToolManagerPtr;
58  static DummyToolManagerPtr create();
59 
60  virtual ~DummyToolManager();
61 
62  typedef std::map<QString, DummyToolPtr> DummyToolMap;
63 
64  virtual Tool::State getState() const;
65  virtual void setState(const Tool::State val);
66 
67  virtual ToolMap getTools();
68  virtual ToolPtr getTool(const QString& uid);
69 
70  virtual ToolPtr getActiveTool();
71  virtual void setActiveTool(const QString& uid);
72 
73  virtual Transform3D get_rMpr() const;
74  virtual void set_rMpr(const Transform3D& val);
75  virtual ToolPtr getReferenceTool() const;
76 
77  virtual ToolPtr getManualTool() { return ToolPtr(); }
78 // virtual void savePositionHistory() {}
79 // virtual void loadPositionHistory() {}
80 // virtual void addXml(QDomNode& parentNode) {}
81 // virtual void parseXml(QDomNode& dataNode) {}
82 // virtual void clear() {}
83  virtual SessionToolHistoryMap getSessionHistory(double startTime, double stopTime) { return SessionToolHistoryMap(); }
84 
85  virtual bool isPlaybackMode() const { return false; }
86  virtual void setPlaybackMode(PlaybackTimePtr controller) {}
87 // virtual void setLoggingFolder(QString loggingFolder) {}
88  virtual void runDummyTool(DummyToolPtr tool) {}
89  virtual bool isNull() { return false; }
90 
91  void addTool(DummyToolPtr tool);
92  virtual ToolPtr getFirstProbe() { return ToolPtr(); }
94 
95  virtual void installTrackingSystem(TrackingSystemServicePtr system);
96  virtual void unInstallTrackingSystem(TrackingSystemServicePtr system);
97  virtual std::vector<TrackingSystemServicePtr> getTrackingSystems();
98 
99 private:
100  typedef DummyToolMap::iterator DummyToolMapIter;
101  typedef DummyToolMap::const_iterator DummyToolMapConstIter;
102 
104 
105  DummyToolMap mDummyTools;
106  DummyToolPtr mActiveTool;
107  DummyToolPtr mReferenceTool;
108 
109  virtual void startTracking();
110  virtual void stopTracking();
111 
112  Transform3D m_rMpr;
113 // double mToolTipOffset; ///< Common tool tip offset for all tools
114 
115 // bool mConfigured;
116 // bool mInitialized;
117 // bool mIsTracking;
118  Tool::State mState;
119 };
120 
121 }//namespace cx
122 
123 #endif /* CXDUMMYTOOLMANAGER_H_ */
boost::shared_ptr< DummyToolManager > DummyToolManagerPtr
std::map< ToolPtr, TimedTransformMap > SessionToolHistoryMap
virtual ToolPtr getManualTool()
a mouse-controllable virtual tool that is available even when not tracking.
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
virtual SessionToolHistoryMap getSessionHistory(double startTime, double stopTime)
boost::shared_ptr< class PlaybackTime > PlaybackTimePtr
virtual ToolPtr getFirstProbe()
get the active probe or any if none active
boost::shared_ptr< class DummyTool > DummyToolPtr
boost::shared_ptr< class TrackerConfiguration > TrackerConfigurationPtr
std::map< QString, DummyToolPtr > DummyToolMap
virtual void runDummyTool(DummyToolPtr tool)
virtual TrackerConfigurationPtr getConfiguration()
Service providing tools and tracking systems.
virtual bool isPlaybackMode() const
std::map< QString, ToolPtr > ToolMap
Implementation of a ToolManager used for testing.
virtual void setPlaybackMode(PlaybackTimePtr controller)
boost::shared_ptr< class Tool > ToolPtr
boost::shared_ptr< class TrackingSystemService > TrackingSystemServicePtr