PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
vtkPlusCommandResponse.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 __VTKPLUSCOMMANDRESPONSE_H
8 #define __VTKPLUSCOMMANDRESPONSE_H
9 
10 // Local includes
11 #include "PlusConfigure.h"
12 #include "vtkPlusDevice.h"
13 
14 // VTK includes
15 #include <vtkImageData.h>
16 #include <vtkMatrix4x4.h>
17 #include <vtkPolyData.h>
18 
19 // IGTL includes
20 #include <igtlMessageBase.h>
21 
22 #if (_MSC_VER == 1500)
23  #include <stdint.h>
24 #endif
25 
31 class vtkPlusCommandResponse : public vtkObject
32 {
33 public:
34  static vtkPlusCommandResponse* New();
35  vtkTypeMacro(vtkPlusCommandResponse, vtkObject);
36 
37  vtkGetMacro(RespondWithCommandMessage, bool);
38  vtkSetMacro(RespondWithCommandMessage, bool);
39  vtkGetMacro(DeviceName, std::string);
40  vtkSetMacro(DeviceName, std::string);
41  vtkGetMacro(ClientId, unsigned int);
42  vtkSetMacro(ClientId, unsigned int);
43  vtkGetMacro(Status, PlusStatus);
44  vtkSetMacro(Status, PlusStatus);
45 protected:
47  : ClientId(0)
48  , Id(0)
50  {
51  }
53  std::string DeviceName;
54  unsigned int ClientId;
55  uint32_t Id;
56  PlusStatus Status; // indicates if the command is succeeded or failed
57 private:
59  void operator=(const vtkPlusCommandResponse&);
60 };
61 
62 typedef std::list< vtkSmartPointer<vtkPlusCommandResponse> > PlusCommandResponseList;
63 
64 //----------------------------------------------------------------------------
66 {
67 public:
70 
71  vtkGetMacro(Message, std::string);
72  vtkSetMacro(Message, std::string);
73 protected:
75  {
76  }
77  std::string Message;
78 private:
80  void operator=(const vtkPlusCommandStringResponse&);
81 };
82 
83 //----------------------------------------------------------------------------
85 {
86 public:
89 
90  vtkGetMacro(OriginalId, uint32_t);
91  vtkSetMacro(OriginalId, uint32_t);
92  vtkGetMacro(CommandName, std::string);
93  vtkSetMacro(CommandName, std::string);
94  vtkGetMacro(ErrorString, std::string);
95  vtkSetMacro(ErrorString, std::string);
96  vtkGetMacro(ResultString, std::string);
97  vtkSetMacro(ResultString, std::string);
98  vtkSetMacro(UseDefaultFormat, bool);
99  vtkGetMacro(UseDefaultFormat, bool);
100  vtkBooleanMacro(UseDefaultFormat, bool);
101 
102  void SetParameters(const igtl::MessageBase::MetaDataMap& values);
103  const igtl::MessageBase::MetaDataMap& GetParameters() const;
104 
105 protected:
107  : UseDefaultFormat(true)
108  {
109  }
110  uint32_t OriginalId;
111  std::string CommandName;
112  std::string ErrorString;
113  std::string ResultString;
114  igtl::MessageBase::MetaDataMap Parameters;
116 
117 private:
119  void operator=(const vtkPlusCommandRTSCommandResponse&);
120 };
121 
122 //----------------------------------------------------------------------------
124 {
125 public:
128 
129  vtkGetMacro(ImageName, std::string);
130  vtkSetMacro(ImageName, std::string);
131  vtkSetObjectMacro(ImageData, vtkImageData);
132  vtkGetMacro(ImageData, vtkImageData*);
133  vtkSetObjectMacro(ImageToReferenceTransform, vtkMatrix4x4);
134  vtkGetMacro(ImageToReferenceTransform, vtkMatrix4x4*);
135 protected:
137  : ImageData(NULL)
139  {
140  }
142  {
143  SetImageData(NULL);
145  }
146  std::string ImageName;
147  vtkImageData* ImageData;
149 private:
150  // We have pointers in this class, so make sure we don't try to accidentally copy it
152  void operator=(const vtkPlusCommandImageResponse&);
153 };
154 
155 //----------------------------------------------------------------------------
157 {
158 public:
161 
162  vtkGetMacro(PolyDataName, std::string);
163  vtkSetMacro(PolyDataName, std::string);
164  vtkSetObjectMacro(PolyData, vtkPolyData);
165  vtkGetMacro(PolyData, vtkPolyData*);
166 protected:
168  : PolyData(NULL)
169  {
170  }
172  {
173  SetPolyData(NULL);
174  }
175  std::string PolyDataName;
176  vtkPolyData* PolyData;
177 
178 private:
180  void operator=(const vtkPlusCommandPolydataResponse&);
181 };
182 
183 //----------------------------------------------------------------------------
185 {
186 public:
189 
190  void GetImageMetaDataItems(igsioCommon::ImageMetaDataList& list)
191  {
192  list = this->ImageMetaDataItems;
193  }
194  void SetImageMetaDataItems(const igsioCommon::ImageMetaDataList& list)
195  {
196  this->ImageMetaDataItems = list;
197  }
198 protected:
200  {
201  }
202  igsioCommon::ImageMetaDataList ImageMetaDataItems;
203 private:
205  void operator=(const vtkPlusCommandImageMetaDataResponse&);
206 };
207 
208 #endif
static vtkPlusCommandResponse * New()
static vtkPlusCommandStringResponse * New()
igsioCommon::ImageMetaDataList ImageMetaDataItems
void SetParameters(const igtl::MessageBase::MetaDataMap &values)
igsioStatus PlusStatus
Definition: PlusCommon.h:40
static vtkPlusCommandPolydataResponse * New()
virtual void SetImageToReferenceTransform(vtkMatrix4x4 *)
const igtl::MessageBase::MetaDataMap & GetParameters() const
igtl::MessageBase::MetaDataMap Parameters
#define PLUS_SUCCESS
Definition: PlusCommon.h:44
virtual void SetImageData(vtkImageData *)
static vtkPlusCommandImageMetaDataResponse * New()
static vtkPlusCommandRTSCommandResponse * New()
void GetImageMetaDataItems(igsioCommon::ImageMetaDataList &list)
static vtkPlusCommandImageResponse * New()
void SetImageMetaDataItems(const igsioCommon::ImageMetaDataList &list)
std::list< vtkSmartPointer< vtkPlusCommandResponse > > PlusCommandResponseList
virtual void SetPolyData(vtkPolyData *)