Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  
igtlPointMessage.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: The OpenIGTLink Library
4  Language: C++
5  Web page: http://openigtlink.org/
6 
7  Copyright (c) Insight Software Consortium. All rights reserved.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notices for more information.
12 
13 =========================================================================*/
14 
15 #ifndef __igtlPointMessage_h
16 #define __igtlPointMessage_h
17 
18 #include <vector>
19 #include <string>
20 
21 #include "igtlObject.h"
22 #include "igtlMath.h"
23 #include "igtlMessageBase.h"
24 #include "igtlTypes.h"
25 
26 #include "igtlImageMessage.h"
27 
28 namespace igtl
29 {
30 
31 
34 {
35 public:
36  typedef PointElement Self;
37  typedef Object Superclass;
40 
43 
44 public:
45 
47  int SetName(const char* name);
48 
50  const char* GetName() { return this->m_Name.c_str(); };
51 
53  int SetGroupName(const char* grpname);
54 
56  const char* GetGroupName() { return this->m_GroupName.c_str(); };
57 
59  void SetRGBA(igtlUint8 rgba[4]);
60 
62  void SetRGBA(igtlUint8 r, igtlUint8 g, igtlUint8 b, igtlUint8 a);
63 
65  void GetRGBA(igtlUint8* rgba);
66 
68  void GetRGBA(igtlUint8& r, igtlUint8& g, igtlUint8& b, igtlUint8& a);
69 
71  void SetPosition(igtlFloat32 position[3]);
72 
74  void SetPosition(igtlFloat32 x, igtlFloat32 y, igtlFloat32 z);
75 
77  void GetPosition(igtlFloat32* position);
78 
80  void GetPosition(igtlFloat32& x, igtlFloat32& y, igtlFloat32& z);
81 
83  void SetRadius(igtlFloat32 radius) { this->m_Radius = radius; };
84 
86  igtlFloat32 GetRadius() { return this->m_Radius; };
87 
89  int SetOwner(const char* owner);
90 
92  const char* GetOwner() { return this->m_Owner.c_str(); };
93 
94 protected:
95  PointElement();
96  ~PointElement();
97 
98 protected:
99 
101  std::string m_Name;
102 
104  std::string m_GroupName;
105 
107  igtlUint8 m_RGBA[4];
108 
110  igtlFloat32 m_Position[3];
111 
113  igtlFloat32 m_Radius;
114 
116  std::string m_Owner;
117 };
118 
119 
122 {
123 public:
128 
131 
132 protected:
133  GetPointMessage() : MessageBase() { this->m_DefaultBodyType = "GET_POINT"; };
135 protected:
136  virtual int GetBodyPackSize() { return 0; };
137  virtual int PackBody() { AllocatePack(); return 1; };
138  virtual int UnpackBody() { return 1; };
139 };
140 
141 
145 {
146 public:
151 
154 
155 public:
156 
159  int AddPointElement(PointElement::Pointer& elem);
160 
162  void ClearPointElement();
163 
165  int GetNumberOfPointElement();
166 
168  void GetPointElement(int index, PointElement::Pointer& elem);
169 
170 
171 protected:
172  PointMessage();
173  ~PointMessage();
174 
175 protected:
176 
177  virtual int GetBodyPackSize();
178  virtual int PackBody();
179  virtual int UnpackBody();
180 
182  std::vector<PointElement::Pointer> m_PointList;
183 
184 };
185 
186 
187 } // namespace igtl
188 
189 #endif // _igtlPointMessage_h
190 
191 
192 
std::string m_Owner
Device name of the ower image.
SmartPointer< Self > Pointer
std::string m_Name
name / description (&lt; 64 bytes)
#define igtlTypeMacro(thisClass, superclass)
Definition: igtlMacro.h:486
std::vector< PointElement::Pointer > m_PointList
A list of pointers to the points.
igtlFloat32 m_Radius
Radius of the point. Can be 0.
SmartPointer< const Self > ConstPointer
const char * GetOwner()
Gets the name of the image that owns this label map.
A class to manage point information.
igtlFloat32 GetRadius()
Gets the radius of the point.
#define IGTLCommon_EXPORT
SmartPointer< const Self > ConstPointer
A class for the GET_POINT message type.
SmartPointer< Self > Pointer
virtual int UnpackBody()
Unpacks (deserialize) the body. Must be implemented in a child class.
virtual int PackBody()
Packs (serialize) the body. Must be implemented in a child class.
const char * GetGroupName()
Gets the group name.
void SetRadius(igtlFloat32 radius)
Sets the radius of the point.
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
virtual int GetBodyPackSize()
Gets the size of the serialized body.
#define igtlNewMacro(x)
Definition: igtlMacro.h:431
const char * GetName()
Gets the name/description of the point.
std::string m_GroupName
Can be &quot;Labeled Point&quot;, &quot;Landmark&quot;, Fiducial", ...
Base class for most igtl classes.
Definition: igtlObject.h:60

Generated at Mon Nov 11 2013 05:19:48 for OpenIGTLink by doxygen 1.8.5 written by Dimitri van Heesch, © 1997-2012