Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  
igtlPositionMessage.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 __igtlPositionMessage_h
16 #define __igtlPositionMessage_h
17 
18 #include "igtlObject.h"
19 #include "igtlMath.h"
20 #include "igtlMessageBase.h"
21 #include "igtlTypes.h"
22 
23 namespace igtl
24 {
25 
33 {
34 public:
35 
40  enum {
41  POSITION_ONLY = 1,
43  ALL,
44  };
45 
46 public:
51 
54 
55 public:
56 
58  void Init();
59 
61  void SetPackType(int t); /* POSITION_ONLY / WITH_QUATERNION3 / ALL */
62 
64  int GetPackType() { return m_PackType; };
65 
67  int SetPackTypeByBodySize(int s);
68 
70  void SetPosition(const float* pos);
71 
73  void SetPosition(float x, float y, float z);
74 
76  void SetQuaternion(const float* quat);
77 
79  void SetQuaternion(float ox, float oy, float oz, float w);
80 
82  void GetPosition(float* pos);
83 
85  void GetPosition(float* x, float* y, float* z);
86 
88  void GetQuaternion(float* quat);
89 
91  void GetQuaternion(float* ox, float* oy, float* oz, float* w);
92 
94  // TODO: Is this needed or integrated in igtlMessageBase?
95  virtual int SetMessageHeader(const MessageHeader* mb);
96 
97 protected:
99  ~PositionMessage();
100 
101 protected:
102 
103  virtual int GetBodyPackSize();
104  virtual int PackBody();
105  virtual int UnpackBody();
106 
108  igtlInt32 m_PackType;
109 
111  igtlFloat32 m_Position[3];
112 
114  igtlFloat32 m_Quaternion[4];
115 
116 };
117 
118 
119 } // namespace igtl
120 
121 #endif // _igtlPositionMessage_h
122 
123 
124 
SmartPointer< Self > Pointer
int GetPackType()
Gets the type of the pack. The returned value must be either POSITION_ONLY, WITH_QUATERNION3, or ALL.
#define igtlTypeMacro(thisClass, superclass)
Definition: igtlMacro.h:486
The "igtl" namespace contains all OpenIGTLink classes. There are several nested namespaces within the...
#define IGTLCommon_EXPORT
SmartPointer< const Self > ConstPointer
igtlInt32 m_PackType
The type of message formats (either POSITION_ONLY, WITH_QUATERNION3, or ALL).
class MessageBase MessageHeader
#define igtlNewMacro(x)
Definition: igtlMacro.h:431

Generated at Tue Aug 4 2015 16:20:53 for OpenIGTLink by doxygen 1.8.9.1 written by Dimitri van Heesch, © 1997-2012