Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  
igtlLabelMetaMessage.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 __igtlLabelMetaMessage_h
16 #define __igtlLabelMetaMessage_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 
32 {
33 public:
35  typedef Object Superclass;
38 
41 
42 public:
43 
45  int SetName(const char* name);
46 
48  const char* GetName() { return this->m_Name.c_str(); };
49 
52  int SetDeviceName(const char* devname);
53 
55  const char* GetDeviceName() { return this->m_DeviceName.c_str(); };
56 
58  void SetLabel(igtlUint8 label) { this->m_Label = label; };
59 
61  igtlUint8 GetLabel() { return this->m_Label; };
62 
64  void SetRGBA(igtlUint8 rgba[4]);
65 
67  void SetRGBA(igtlUint8 r, igtlUint8 g, igtlUint8 b, igtlUint8 a);
68 
70  void GetRGBA(igtlUint8* rgba);
71 
73  void GetRGBA(igtlUint8& r, igtlUint8& g, igtlUint8& b, igtlUint8& a);
74 
77  void SetSize(igtlUint16 size[3]);
78 
80  void SetSize(igtlUint16 si, igtlUint16 sj, igtlUint16 sk);
81 
84  void GetSize(igtlUint16* size);
85 
87  void GetSize(igtlUint16& si, igtlUint16& sj, igtlUint16& sk);
88 
90  int SetOwner(const char* owner);
91 
93  const char* GetOwner() { return this->m_Owner.c_str(); };
94 
95 protected:
98 
99 protected:
100 
102  std::string m_Name;
103 
105  std::string m_DeviceName;
106 
108  igtlUint8 m_Label;
109 
111  igtlUint8 m_RGBA[4];
112 
114  igtlUint16 m_Size[3];
115 
117  std::string m_Owner;
118 
119 };
120 
121 
124 {
125 public:
130 
133 
134 protected:
135  GetLabelMetaMessage() : MessageBase() { this->m_DefaultBodyType = "GET_LBMETA"; };
137 protected:
138  virtual int GetBodyPackSize() { return 0; };
139  virtual int PackBody() { AllocatePack(); return 1; };
140  virtual int UnpackBody() { return 1; };
141 };
142 
143 
148 {
149 public:
154 
157 
158 public:
159 
161  int AddLabelMetaElement(LabelMetaElement::Pointer& elem);
162 
164  void ClearLabelMetaElement();
165 
167  int GetNumberOfLabelMetaElement();
168 
170  void GetLabelMetaElement(int index, LabelMetaElement::Pointer& elem);
171 
172 
173 protected:
175  ~LabelMetaMessage();
176 
177 protected:
178 
179  virtual int GetBodyPackSize();
180  virtual int PackBody();
181  virtual int UnpackBody();
182 
183  // A list of pointers to label meta data.
184  std::vector<LabelMetaElement::Pointer> m_LabelMetaList;
185 
186 };
187 
188 
189 } // namespace igtl
190 
191 #endif // _igtlLabelMetaMessage_h
192 
193 
194 
virtual int GetBodyPackSize()
Gets the size of the serialized body.
const char * GetOwner()
Gets the name of the image that owns this label map.
std::vector< LabelMetaElement::Pointer > m_LabelMetaList
std::string m_DeviceName
Device name to query the IMAGE and COLORT.
std::string m_Owner
device name of the owner image. (can be empty)
#define igtlTypeMacro(thisClass, superclass)
Definition: igtlMacro.h:486
virtual int PackBody()
Packs (serialize) the body. Must be implemented in a child class.
const char * GetDeviceName()
Gets the device name (message name).
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
SmartPointer< const Self > ConstPointer
void SetLabel(igtlUint8 label)
Sets the label of the structure.
const char * GetName()
Gets the image name/description.
#define IGTLCommon_EXPORT
A class for the GET_LBMETA message type.
SmartPointer< const Self > ConstPointer
virtual int UnpackBody()
Unpacks (deserialize) the body. Must be implemented in a child class.
#define igtlNewMacro(x)
Definition: igtlMacro.h:431
std::string m_Name
Name / description (&lt;= 64 bytes)
SmartPointer< Self > Pointer
Base class for most igtl classes.
Definition: igtlObject.h:60
igtlUint8 GetLabel()
Gets the label of the structure.
SmartPointer< Self > Pointer

Generated at Mon Nov 11 2013 00:36:45 for OpenIGTLink by doxygen 1.8.5 written by Dimitri van Heesch, © 1997-2012