cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mtsMedtronicStealthlink.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
3 
4 /*
5 
6  Author(s): Peter Kazanzides, Anton Deguet
7  Created on: 2006
8 
9  (C) Copyright 2006-2011 Johns Hopkins University (JHU), All Rights Reserved.
10 
11 --- begin cisst license - do not edit ---
12 
13 This software is provided "as is" under an open source license, with
14 no warranty. The complete license can be found in license.txt and
15 http://www.cisst.org/cisst/license.txt.
16 
17 --- end cisst license ---
18 */
19 
20 #ifndef _mtsMedtronicStealthlink_h
21 #define _mtsMedtronicStealthlink_h
22 
28 
29 // data types used for wrapper
31 
32 // Always include last
34 
35 // forward declarations of Stealthlink types
36 class AsCL_Client;
37 class mtsMedtronicStealthlink_AsCL_Utils;
38 namespace MNavStealthLink {
39  class StealthServer;
40  class SurgicalPlan;
41  class Exam;
42  template <typename T> class Subscription;
43 }
44 
46 {
48 
49  protected:
50  template <typename T> friend class MNavStealthLink::Subscription;
51  AsCL_Client * Client;
52  MNavStealthLink::StealthServer * StealthServerProxy;
53  mtsMedtronicStealthlink_AsCL_Utils * Utils;
54 
55  // State data
61 
62  // Other persistent data
63  mtsDoubleVec SurgicalPlan; // entry point + target point
65 
66  // Class used to store tool information using cisstParameterTypes
67  class Tool
68  {
69  std::string StealthName;
70  std::string InterfaceName;
71  public:
72  Tool(const std::string &stealthName, const std::string &interfaceName) :
73  StealthName(stealthName), InterfaceName(interfaceName) {}
74  ~Tool(void) {}
75  const std::string & GetStealthName(void) const { return StealthName; }
76  const std::string & GetInterfaceName(void) const { return InterfaceName; }
79  };
80 
81  typedef std::vector<Tool *> ToolsContainer;
83  Tool * CurrentTool, * CurrentFrame;
84 
85  // Tracking MultTools flag
87  enum { MAX_MULT_TOOLS = 5 };
88  Tool * CurrentMultTool[MAX_MULT_TOOLS];
89 
90 
91  // Class used to store registration data
93  {
94  public:
98  };
100 
101  // Class used to store exam info
103  {
104  public:
105  mtsDouble3 VoxelScale;
106  mtsInt3 Size;
107  bool Valid;
108  };
110  void RequestExamInformation(void);
111 
112  // surgical plan
113  void RequestSurgicalPlan(void);
114  void GetSurgicalPlan(mtsDoubleVec & plan) const;
115 
117  void ResetAllTools(void);
118 
120  Tool * FindTool(const std::string & stealthName) const;
121 
123  Tool * AddTool(const std::string & stealthName, const std::string & interfaceName);
124 
125  void Init(void);
126 
127  // Stealthlink 2.0 callbacks
128 
129  void operator()(MNavStealthLink::Instrument& instrument_in);
130  void operator()(const MNavStealthLink::Frame& frame_in);
131  void operator()(const MNavStealthLink::Registration& registration_in);
132  void operator()(const MNavStealthLink::Exam& exam_in);
133  void operator()(MNavStealthLink::SurgicalPlan& surgicalPlan_in);
134 
135  //Stealthlink 2.0 Subscriptions
136 
142 
143 
144  public:
145  mtsMedtronicStealthlink(const std::string & taskName, const double & periodInSeconds);
148 
149  void Startup(void) {}
150 
158  void Configure(const std::string & filename = "");
159 
160  void Run(void);
161 
162  void Cleanup(void);
163 };
164 
166 
167 #endif // _mtsMedtronicStealthlink_h
#define CISST_EXPORT
Definition: cmnExportMacros.h:50
Typedef for different transformations.
Definition: mtsMedtronicStealthlink2Types.h:119
Definition: mtsMedtronicStealthlink2Types.h:156
Definition: mtsTaskPeriodic.h:38
const int CMN_DYNAMIC_CREATION_ONEARG
Definition: cmnClassRegisterMacros.h:333
Definition: mtsMedtronicStealthlink2Types.h:80
virtual void Configure(const std::string &CMN_UNUSED(filename)="")
Definition: mtsTask.h:218
#define CMN_DECLARE_SERVICES(hasDynamicCreation, lod)
Definition: cmnClassRegisterMacros.h:116
Defines a periodic task.
virtual void Run(void)=0
Definition: mtsTaskPeriodic.h:80
Definition: mtsMedtronicStealthlink2Types.h:189
virtual void Cleanup(void)
Definition: mtsComponent.h:267
#define CMN_LOG_ALLOW_DEFAULT
Definition: cmnLogLoD.h:76
Definition: prmPositionCartesianGet.h:37