15 #ifndef __igtlNDArrayMessage_h 16 #define __igtlNDArrayMessage_h 25 #define IGTL_STRING_MESSAGE_DEFAULT_ENCODING 3 44 int SetSize(IndexType size);
47 IndexType
GetSize() {
return this->m_Size; };
54 int SetArray(
void * array);
57 igtlUint64 GetRawArraySize();
65 virtual int GetElementSize() = 0;
68 igtlUint32 GetNumberOfElements();
73 igtlUint32 Get1DIndex(IndexType index);
93 if (Get1DIndex(index) <= GetNumberOfElements()) {
94 * (T *) this->m_ByteArray[Get1DIndex(index) *
sizeof(T)] = value;
104 if (Get1DIndex(index) <= GetNumberOfElements()) {
105 value = * (T *) this->m_ByteArray[Get1DIndex(index) *
sizeof(T)];
162 virtual int GetBodyPackSize();
163 virtual int PackBody();
164 virtual int UnpackBody();
177 #endif // _igtlNDArrayMessage_h
ArrayBase * m_Array
A pointer to the N-D array.
std::vector< igtlUint16 > IndexType
Vector type for an index of N-D array.
SmartPointer< const Self > ConstPointer
#define igtlTypeMacro(thisClass, superclass)
The "igtl" namespace contains all OpenIGTLink classes. There are several nested namespaces within the...
ArrayBase * GetArray()
Gets a pointer to the array.
int GetValue(IndexType index, T &value)
Gets a value of the element specified by 'index'.
int GetDimension()
Gets the dimension of the N-D array.
SmartPointer< Self > Pointer
int SetValue(IndexType index, T value)
Sets a value of the element specified by 'index'.
void * GetRawArray()
Gets the raw byte array stored in the class.
IndexType GetSize()
Gets the size of the N-D array.
virtual int GetElementSize()
Gets the size of elements (e.g. 1 byte in case of 8-bit integer)
int GetType()
Gets the type of elements of the array. (e.g. TYPE_INT8)
int m_Type
A variable for the type of the N-D array.