PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
IntuitiveDaVinci.h
Go to the documentation of this file.
1 /*=Plus=header=begin======================================================
2 Program: Plus
3 Copyright (c) Laboratory for Percutaneous Surgery. All rights reserved.
4 See License.txt for details.
5 =========================================================Plus=header=end*/
6 
7 #ifndef _INTUITIVE_DAVINCI_H_
8 #define _INTUITIVE_DAVINCI_H_
9 
10 #ifdef WIN32
11  #define _CRT_SECURE_NO_WARNINGS
12  #include <windows.h>
13 #endif
14 
15 // OS includes
16 #include <assert.h>
17 #include <ctype.h>
18 #include <stdio.h>
19 #include <stdlib.h>
20 
21 // STL includes
22 #include <iostream>
23 #include <sstream>
24 #include <vector>
25 
26 // Intuitive includes
27 #include <isi_api_types.h>
28 #include <isi_api.h>
29 
31 {
32 public:
33  // Constructor
35 
36  // Destructor
38 
39  // Start streaming from the da Vinci
40  bool start();
41 
42  // Stop streaming from the da Vinci
43  void stop();
44 
45  // Make a request to connect to the da Vinci
46  ISI_STATUS connect();
47 
48  // Make a request to disconnect from the da Vinci
49  ISI_STATUS disconnect();
50 
51  // Subscribe to all events and fields, and set up the given callbacks.
52  // If the stream fails, disconnect from the da Vinci.
53  ISI_STATUS subscribe(ISI_EVENT_CALLBACK eCB, ISI_STREAM_CALLBACK sCB, void* eventUserData, void* streamUserData);
54 
55  // Subscribe the given stream callback
56  ISI_STATUS setStreamCallback(ISI_STREAM_CALLBACK sCB, void* userData);
57 
58  // Subscribe the given event callback
59  ISI_STATUS setEventCallback(ISI_EVENT_CALLBACK eCB, void* userData);
60 
61  // Added. Return a vector of the manipulator names.
62  std::vector<std::string> getManipulatorNames();
63 
64  // From the previously set manipIndex, get the TIP TRANSFORM.
65  void getPosition(ISI_TRANSFORM* T);
66 
67  // Print out the 6DOF from the given transform.
68  void printTransform(const ISI_TRANSFORM* T);
69 
70  // Print out help.
71  void printHelp();
72 
73  // Added. Accessor for library version.
74  std::string getLibraryVersion();
75 
76  // Added. Accessor for connected state.
77  bool isConnected();
78 
79  // Added. Mutator for connection arguments.
80  void setHostInfo(const std::string ip, const unsigned int port, const std::string pass);
81 
82  void setIpAddr(const std::string ip);
83 
84  void setPort(const unsigned int port);
85 
86  void setPassword(const std::string password);
87 
88 protected:
89  // Moved. Connect with hardcoded arguments for our custom config.
90  ISI_STATUS connectWithArgs();
91 
92  void copyTransform(ISI_TRANSFORM* in, ISI_TRANSFORM* out);
93 
94  void printStreamState(ISI_MANIP_INDEX manipIndex);
95 
96  void printVersion();
97 
98 protected:
99  ISI_BOOLEAN mPrintStream;
100  ISI_STATUS mStatus;
101  ISI_BOOLEAN mQuit;
102  ISI_MANIP_INDEX mManipIndex;
103 
105 
106  unsigned int mRateHz;
107  std::string mIpAddr;
108  unsigned int mPort;
109  std::string mPassword;
110 };
111 
112 #endif
ISI_MANIP_INDEX mManipIndex
ISI_BOOLEAN mPrintStream
void setHostInfo(const std::string ip, const unsigned int port, const std::string pass)
void printTransform(const ISI_TRANSFORM *T)
ISI_STATUS setEventCallback(ISI_EVENT_CALLBACK eCB, void *userData)
void getPosition(ISI_TRANSFORM *T)
int port
Definition: phidget22.h:2454
unsigned int mRateHz
std::string mPassword
void setPassword(const std::string password)
ISI_STATUS disconnect()
std::vector< std::string > getManipulatorNames()
void copyTransform(ISI_TRANSFORM *in, ISI_TRANSFORM *out)
ISI_STATUS subscribe(ISI_EVENT_CALLBACK eCB, ISI_STREAM_CALLBACK sCB, void *eventUserData, void *streamUserData)
unsigned int mPort
ISI_STATUS connect()
const char int const char * password
Definition: phidget22.h:2552
ISI_STATUS connectWithArgs()
void setPort(const unsigned int port)
ISI_STATUS setStreamCallback(ISI_STREAM_CALLBACK sCB, void *userData)
void setIpAddr(const std::string ip)
void printStreamState(ISI_MANIP_INDEX manipIndex)
std::string getLibraryVersion()