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: 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 __igtlLabelMetaMessage_h
18 #define __igtlLabelMetaMessage_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:
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 SetDeviceName(const char* devname);
50  const char* GetDeviceName() { return this->m_DeviceName.c_str(); };
51 
52  void SetLabel(igtlUint8 label) { this->m_Label = label; };
53  igtlUint8 GetLabel() { return this->m_Label; };
54 
55  void SetRGBA(igtlUint8 rgba[4]);
56  void SetRGBA(igtlUint8 r, igtlUint8 g, igtlUint8 b, igtlUint8 a);
57  void GetRGBA(igtlUint8* rgba);
58  void GetRGBA(igtlUint8& r, igtlUint8& g, igtlUint8& b, igtlUint8& a);
59 
60  void SetSize(igtlUint16 size[3]);
61  void SetSize(igtlUint16 sx, igtlUint16 sy, igtlUint16 sz);
62  void GetSize(igtlUint16* size);
63  void GetSize(igtlUint16& sx, igtlUint16& sy, igtlUint16& sz);
64 
65  int SetOwner(const char* owner);
66  const char* GetOwner() { return this->m_Owner.c_str(); };
67 
68 protected:
71 
72 protected:
73 
74  std::string m_Name; /* Name / description (< 64 bytes)*/
75  std::string m_DeviceName; /* Device name to query the IMAGE and COLORT */
76  igtlUint8 m_Label; /* Label */
77  igtlUint8 m_RGBA[4]; /* Color in RGBA. default: (0, 0, 0, 0) */
78  igtlUint16 m_Size[3]; /* entire image volume size */
79  std::string m_Owner; /* device name of the owner image. (can be empty) */
80 
81 };
82 
83 
85 {
86 public:
91 
94 
95 protected:
96  GetLabelMetaMessage() : MessageBase() { this->m_DefaultBodyType = "GET_LBMETA"; };
98 protected:
99  virtual int GetBodyPackSize() { return 0; };
100  virtual int PackBody() { AllocatePack(); return 1; };
101  virtual int UnpackBody() { return 1; };
102 };
103 
104 
106 {
107 public:
112 
115 
116 public:
117  int AddLabelMetaElement(LabelMetaElement::Pointer& elem);
118  void ClearLabelMetaElement();
119 
120  int GetNumberOfLabelMetaElement();
121  void GetLabelMetaElement(int index, LabelMetaElement::Pointer& elem);
122 
123 
124 protected:
126  ~LabelMetaMessage();
127 
128 protected:
129 
130  virtual int GetBodyPackSize();
131  virtual int PackBody();
132  virtual int UnpackBody();
133 
134  std::vector<LabelMetaElement::Pointer> m_LabelMetaList;
135 
136 };
137 
138 
139 } // namespace igtl
140 
141 #endif // _igtlLabelMetaMessage_h
142 
143 
144 
145 

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