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: Open IGT Link Library
4  Module: $HeadURL: http://svn.na-mic.org/NAMICSandBox/trunk/OpenIGTLink2_beta/Source/igtlImgmetaMessage.h $
5  Language: C++
6  Date: $Date: 2009-12-16 23:58:02 -0500 (Wed, 16 Dec 2009) $
7  Version: $Revision: 5466 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10 
11  This software is distributed WITHOUT ANY WARRANTY; without even
12  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13  PURPOSE. See the above copyright notices for more information.
14 
15 =========================================================================*/
16 
17 #ifndef __igtlPointMessage_h
18 #define __igtlPointMessage_h
19 
20 #include <vector>
21 #include <string>
22 
23 #include "igtlObject.h"
24 //#include "igtlMacros.h"
25 #include "igtlMath.h"
26 #include "igtlMessageBase.h"
27 #include "igtlTypes.h"
28 
29 #include "igtlImageMessage.h"
30 
31 namespace igtl
32 {
33 
35 {
36 public:
37  typedef PointElement Self;
38  typedef Object Superclass;
41 
44 
45 public:
46  int SetName(const char* name);
47  const char* GetName() { return this->m_Name.c_str(); };
48 
49  int SetGroupName(const char* grpname);
50  const char* GetGroupName() { return this->m_GroupName.c_str(); };
51 
52  void SetRGBA(igtlUint8 rgba[4]);
53  void SetRGBA(igtlUint8 r, igtlUint8 g, igtlUint8 b, igtlUint8 a);
54  void GetRGBA(igtlUint8* rgba);
55  void GetRGBA(igtlUint8& r, igtlUint8& g, igtlUint8& b, igtlUint8& a);
56 
57  void SetPosition(igtlFloat32 position[3]);
58  void SetPosition(igtlFloat32 x, igtlFloat32 y, igtlFloat32 z);
59  void GetPosition(igtlFloat32* position);
60  void GetPosition(igtlFloat32& x, igtlFloat32& y, igtlFloat32& z);
61 
62  void SetRadius(igtlFloat32 radius) { this->m_Radius = radius; };
63  igtlFloat32 GetRadius() { return this->m_Radius; };
64 
65  int SetOwner(const char* owner);
66  const char* GetOwner() { return this->m_Owner.c_str(); };
67 
68 protected:
69  PointElement();
70  ~PointElement();
71 
72 protected:
73 
74  std::string m_Name; /* name / description (< 64 bytes)*/
75  std::string m_GroupName; /* Can be "Labeled Point", "Landmark", Fiducial", ... */
76  igtlUint8 m_RGBA[4]; /* Color in R/G/B/A */
77  igtlFloat32 m_Position[3]; /* Position */
78  igtlFloat32 m_Radius; /* Radius of the point. Can be 0. */
79  std::string m_Owner; /* Device name of the ower image */
80 };
81 
82 
84 {
85 public:
90 
93 
94 protected:
95  GetPointMessage() : MessageBase() { this->m_DefaultBodyType = "GET_POINT"; };
97 protected:
98  virtual int GetBodyPackSize() { return 0; };
99  virtual int PackBody() { AllocatePack(); return 1; };
100  virtual int UnpackBody() { return 1; };
101 };
102 
103 
105 {
106 public:
111 
114 
115 public:
116  int AddPointElement(PointElement::Pointer& elem);
117  void ClearPointElement();
118 
119  int GetNumberOfPointElement();
120  void GetPointElement(int index, PointElement::Pointer& elem);
121 
122 
123 protected:
124  PointMessage();
125  ~PointMessage();
126 
127 protected:
128 
129  virtual int GetBodyPackSize();
130  virtual int PackBody();
131  virtual int UnpackBody();
132 
133  std::vector<PointElement::Pointer> m_PointList;
134 
135 };
136 
137 
138 } // namespace igtl
139 
140 #endif // _igtlPointMessage_h
141 
142 
143 
144 

Generated at Thu Mar 20 2014 16:32:06 for OpenIGTLink by doxygen 1.8.1.2 written by Dimitri van Heesch, © 1997-2000