Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  
igtlColorTableMessage.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 __igtlColorTableMessage_h
16 #define __igtlColorTableMessage_h
17 
18 #include "igtlObject.h"
19 #include "igtlMacro.h"
20 #include "igtlMath.h"
21 #include "igtlMessageBase.h"
22 
23 namespace igtl
24 {
25 
28 {
29 public:
34 
37 
38 protected:
39  GetColorTableMessage() : MessageBase() { this->m_DefaultBodyType = "GET_COLORT"; };
41 
42 protected:
43  virtual int GetBodyPackSize() { return 0; };
44  virtual int PackBody() { AllocatePack(); return 1; };
45  virtual int UnpackBody() { return 1; };
46 };
47 
48 
51 {
52 public:
57 
60 
61 public:
62 
64  enum {
65  INDEX_UINT8 = 3,
66  INDEX_UINT16 = 5,
67  MAP_UINT8 = 3,
68  MAP_UINT16 = 5,
69  MAP_RGB = 19,
70  };
71 
72 public:
73 
75  void SetIndexType(int t) { indexType = t; };
76 
78  void SetIndexTypeToUint8() { indexType = INDEX_UINT8; };
79 
81  void SetIndexTypeToUint16() { indexType = INDEX_UINT16; };
82 
84  int GetIndexType() { return indexType; };
85 
87  void SetMapType(int t) { mapType = t; };
88 
90  void SetMapTypeToUint8() { mapType = MAP_UINT8; };
91 
93  void SetMapTypeToUint16() { mapType = MAP_UINT16; };
94 
96  int GetMapType() { return mapType; };
97 
99  int GetColorTableSize();
100 
102  void AllocateTable();
103 
105  void* GetTablePointer();
106 
107 protected:
110 
111 protected:
112 
113  virtual int GetBodyPackSize();
114  virtual int PackBody();
115  virtual int UnpackBody();
116 
119 
121  int mapType;
122 
124  unsigned char* m_ColorTableHeader;
125 
127  unsigned char* m_ColorTable;
128 
129 };
130 
131 
132 } // namespace igtl
133 
134 #endif // _igtlColorTableMessage_h
135 
136 
igtl::GetColorTableMessage::GetBodyPackSize
virtual int GetBodyPackSize()
Gets the size of the serialized body.
Definition: igtlColorTableMessage.h:43
igtlMessageBase.h
igtl::ColorTableMessage::m_ColorTableHeader
unsigned char * m_ColorTableHeader
A pointer to the header for the color table.
Definition: igtlColorTableMessage.h:124
igtl::ColorTableMessage::indexType
int indexType
A variable to store the index type. Either INDEX_UINT8 or INDEX_UINT16.
Definition: igtlColorTableMessage.h:118
igtl::ColorTableMessage::SetIndexType
void SetIndexType(int t)
Sets the index type for the color type.
Definition: igtlColorTableMessage.h:75
igtl::ColorTableMessage::SetIndexTypeToUint16
void SetIndexTypeToUint16()
Sets the index type for the color type to 16-bit unsigned integer.
Definition: igtlColorTableMessage.h:81
igtlMacro.h
igtl::ColorTableMessage::SetMapType
void SetMapType(int t)
Sets the scalar type of the map.
Definition: igtlColorTableMessage.h:87
igtlNewMacro
#define igtlNewMacro(x)
Definition: igtlMacro.h:431
igtlMath.h
igtl::MessageBase
Definition: igtlMessageBase.h:55
igtl::ColorTableMessage::Pointer
SmartPointer< Self > Pointer
Definition: igtlColorTableMessage.h:55
igtl::ColorTableMessage::SetMapTypeToUint8
void SetMapTypeToUint8()
Sets the scalar type of the map to 8-bit unsigned integer.
Definition: igtlColorTableMessage.h:90
igtl::ColorTableMessage
A class for the COLORT message type.
Definition: igtlColorTableMessage.h:50
igtl::GetColorTableMessage::~GetColorTableMessage
~GetColorTableMessage()
Definition: igtlColorTableMessage.h:40
igtl::ColorTableMessage::GetMapType
int GetMapType()
Gets the type of the map.
Definition: igtlColorTableMessage.h:96
igtl::GetColorTableMessage
A class for the GET_COLORT message type.
Definition: igtlColorTableMessage.h:27
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::GetColorTableMessage::GetColorTableMessage
GetColorTableMessage()
Definition: igtlColorTableMessage.h:39
igtl::GetColorTableMessage::Pointer
SmartPointer< Self > Pointer
Definition: igtlColorTableMessage.h:32
igtl::GetColorTableMessage::PackBody
virtual int PackBody()
Packs (serialize) the body. Must be implemented in a child class.
Definition: igtlColorTableMessage.h:44
igtl::ColorTableMessage::mapType
int mapType
A variable to store the type of the map. Either MAP_UINT8, MAP_UINT16 or MAP_RGB.
Definition: igtlColorTableMessage.h:121
igtl::ColorTableMessage::Superclass
MessageBase Superclass
Definition: igtlColorTableMessage.h:54
igtl::GetColorTableMessage::Self
GetColorTableMessage Self
Definition: igtlColorTableMessage.h:30
igtl::ColorTableMessage::GetIndexType
int GetIndexType()
Gets the index type. Returns either INDEX_UINT8 or INDEX_UINT16.
Definition: igtlColorTableMessage.h:84
igtl::ColorTableMessage::m_ColorTable
unsigned char * m_ColorTable
A pointer to the color table data.
Definition: igtlColorTableMessage.h:127
igtl::GetColorTableMessage::UnpackBody
virtual int UnpackBody()
Unpacks (deserialize) the body. Must be implemented in a child class.
Definition: igtlColorTableMessage.h:45
igtl::GetColorTableMessage::Superclass
MessageBase Superclass
Definition: igtlColorTableMessage.h:31
igtl::ColorTableMessage::SetIndexTypeToUint8
void SetIndexTypeToUint8()
Sets the index type for the color type to 8-bit unsigned integer.
Definition: igtlColorTableMessage.h:78
igtl::ColorTableMessage::Self
ColorTableMessage Self
Definition: igtlColorTableMessage.h:53
igtl::GetColorTableMessage::ConstPointer
SmartPointer< const Self > ConstPointer
Definition: igtlColorTableMessage.h:33
igtl::SmartPointer< Self >
igtlTypeMacro
#define igtlTypeMacro(thisClass, superclass)
Definition: igtlMacro.h:486
igtlObject.h
igtl::ColorTableMessage::SetMapTypeToUint16
void SetMapTypeToUint16()
Sets the scalar type of the map to 16-bit unsigned integer.
Definition: igtlColorTableMessage.h:93
igtl::ColorTableMessage::ConstPointer
SmartPointer< const Self > ConstPointer
Definition: igtlColorTableMessage.h:56

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