Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  
igtlSensorMessage.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 __igtlSensorMessage_h
16#define __igtlSensorMessage_h
17
18#include <string>
19
20#include "igtlObject.h"
21#include "igtlMath.h"
22#include "igtlMessageBase.h"
23#include "igtlTypes.h"
24
25#include "igtlUnit.h"
26
27namespace igtl
28{
29
34{
35public:
40
43
44public:
45
47 int SetLength(unsigned int n);
48
50 unsigned int GetLength();
51
53 int SetUnit(igtlUnit unit);
54
56 int SetUnit(igtl::Unit * unit);
57
60
62 int GetUnit(igtl::Unit * unit);
63
65 int SetValue(igtlFloat64 * data);
66
68 int SetValue(unsigned int i, igtlFloat64 value);
69
71 igtlFloat64 GetValue(unsigned int i);
72
73protected:
76
77protected:
78
79 virtual int GetBodyPackSize();
80 virtual int PackBody();
81 virtual int UnpackBody();
82
84 igtlUint8 m_Length;
85
87 igtlUint8 m_Status;
88
91
93 std::vector<igtlFloat64> m_Array;
94};
95
96
97} // namespace igtl
98
99#endif // _igtlSensorMessage_h
100
101
int SetUnit(igtl::Unit *unit)
Sets the unit for the sensor values Returns 1 if success.
SmartPointer< Self > Pointer
int SetValue(igtlFloat64 *data)
Sets sensor values from an array of 64-bit floating data. Returns 1 if success.
igtlFloat64 GetValue(unsigned int i)
Gets the value of the i-th sensor.
virtual int GetBodyPackSize()
Gets the size of the serialized body.
igtlUnit m_Unit
Unit (generated by igtl::Unit::Pack()).
virtual int UnpackBody()
Unpacks (deserialize) the body. Must be implemented in a child class.
SmartPointer< const Self > ConstPointer
int SetUnit(igtlUnit unit)
Sets the unit for the sensor values. Returns 1 if success.
igtlTypeMacro(igtl::SensorMessage, igtl::MessageBase)
igtlUint8 m_Status
Sensor status (Reserved).
virtual int PackBody()
Packs (serialize) the body. Must be implemented in a child class.
unsigned int GetLength()
Gets the length of the array.
igtlUnit GetUnit()
Gets the unit as 64-bit unit field defined in igtlUnit.h.
std::vector< igtlFloat64 > m_Array
The array of sensor values.
int SetValue(unsigned int i, igtlFloat64 value)
Sets the value for the i-th sensor. Returns 1 if success.
igtlUint8 m_Length
Length of sensor array.
igtlNewMacro(igtl::SensorMessage)
int GetUnit(igtl::Unit *unit)
Gets the unit as igtl::Unit class.
int SetLength(unsigned int n)
Sets the length of the array. Returns the resulted length.
Implements transparent reference counting.
#define IGTLCommon_EXPORT
The "igtl" namespace contains all OpenIGTLink classes. There are several nested namespaces within the...
igtlUint64 igtlUnit
Definition igtlUnit.h:28

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