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 
igtlMessageBase.h
igtl::PointElement::Self
PointElement Self
Definition: igtlPointMessage.h:36
igtl::PointMessage::Self
PointMessage Self
Definition: igtlPointMessage.h:147
igtl::PointElement::m_Name
std::string m_Name
name / description (< 64 bytes)
Definition: igtlPointMessage.h:101
igtl::PointElement::GetRadius
igtlFloat32 GetRadius()
Gets the radius of the point.
Definition: igtlPointMessage.h:86
igtlNewMacro
#define igtlNewMacro(x)
Definition: igtlMacro.h:431
igtlImageMessage.h
igtl::GetPointMessage::Superclass
MessageBase Superclass
Definition: igtlPointMessage.h:125
igtl::PointElement::GetName
const char * GetName()
Gets the name/description of the point.
Definition: igtlPointMessage.h:50
igtlMath.h
igtl::GetPointMessage::PackBody
virtual int PackBody()
Packs (serialize) the body. Must be implemented in a child class.
Definition: igtlPointMessage.h:137
igtl::MessageBase
Definition: igtlMessageBase.h:55
igtl::PointMessage::ConstPointer
SmartPointer< const Self > ConstPointer
Definition: igtlPointMessage.h:150
igtl::Object
Base class for most igtl classes.
Definition: igtlObject.h:60
igtl::PointElement::Superclass
Object Superclass
Definition: igtlPointMessage.h:37
igtl
The "igtl" namespace contains all OpenIGTLink classes. There are several nested namespaces within the...
Definition: igtlBindMessage.h:25
IGTLCommon_EXPORT
#define IGTLCommon_EXPORT
Definition: igtlWin32Header.h:151
igtl::PointElement::m_Radius
igtlFloat32 m_Radius
Radius of the point. Can be 0.
Definition: igtlPointMessage.h:113
igtl::PointMessage::Pointer
SmartPointer< Self > Pointer
Definition: igtlPointMessage.h:149
igtl::GetPointMessage::UnpackBody
virtual int UnpackBody()
Unpacks (deserialize) the body. Must be implemented in a child class.
Definition: igtlPointMessage.h:138
igtl::GetPointMessage::GetBodyPackSize
virtual int GetBodyPackSize()
Gets the size of the serialized body.
Definition: igtlPointMessage.h:136
igtl::PointElement
A class to manage point information.
Definition: igtlPointMessage.h:33
igtl::PointMessage
Definition: igtlPointMessage.h:144
igtl::PointElement::SetRadius
void SetRadius(igtlFloat32 radius)
Sets the radius of the point.
Definition: igtlPointMessage.h:83
igtl::PointElement::m_Owner
std::string m_Owner
Device name of the ower image.
Definition: igtlPointMessage.h:116
igtl::GetPointMessage::ConstPointer
SmartPointer< const Self > ConstPointer
Definition: igtlPointMessage.h:127
igtl::GetPointMessage::Self
GetPointMessage Self
Definition: igtlPointMessage.h:124
igtl::GetPointMessage::~GetPointMessage
~GetPointMessage()
Definition: igtlPointMessage.h:134
igtl::PointElement::GetOwner
const char * GetOwner()
Gets the name of the image that owns this label map.
Definition: igtlPointMessage.h:92
igtl::GetPointMessage::Pointer
SmartPointer< Self > Pointer
Definition: igtlPointMessage.h:126
igtl::GetPointMessage
A class for the GET_POINT message type.
Definition: igtlPointMessage.h:121
igtl::PointElement::ConstPointer
SmartPointer< const Self > ConstPointer
Definition: igtlPointMessage.h:39
igtl::SmartPointer< Self >
igtl::PointElement::m_GroupName
std::string m_GroupName
Can be "Labeled Point", "Landmark", Fiducial", ...
Definition: igtlPointMessage.h:104
igtlTypeMacro
#define igtlTypeMacro(thisClass, superclass)
Definition: igtlMacro.h:486
igtlObject.h
igtl::PointElement::Pointer
SmartPointer< Self > Pointer
Definition: igtlPointMessage.h:38
igtlTypes.h
igtl::PointElement::GetGroupName
const char * GetGroupName()
Gets the group name.
Definition: igtlPointMessage.h:56
igtl::GetPointMessage::GetPointMessage
GetPointMessage()
Definition: igtlPointMessage.h:133
igtl::PointMessage::m_PointList
std::vector< PointElement::Pointer > m_PointList
A list of pointers to the points.
Definition: igtlPointMessage.h:182
igtl::PointMessage::Superclass
MessageBase Superclass
Definition: igtlPointMessage.h:148

Generated for OpenIGTLink by Doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2012