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: Open IGT Link Library
4  Module: $HeadURL: http://svn.na-mic.org/NAMICSandBox/trunk/OpenIGTLink/Source/igtlPositionMessage.h $
5  Language: C++
6  Date: $Date: 2008-12-22 19:05:42 -0500 (Mon, 22 Dec 2008) $
7  Version: $Revision: 3460 $
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 __igtlPositionMessage_h
18 #define __igtlPositionMessage_h
19 
20 #include "igtlObject.h"
21 //#include "igtlMacros.h"
22 #include "igtlMath.h"
23 #include "igtlMessageBase.h"
24 #include "igtlTypes.h"
25 
26 namespace igtl
27 {
28 
30 {
31 public:
32  enum {
33  POSITION_ONLY = 1,
35  ALL,
36  };
37 
38 
39 public:
44 
47 
48 public:
49 
50  void Init();
51 
52  void SetPackType(int t); /* POSITION_ONLY / WITH_QUATERNION3 / ALL */
53 
55  int SetPackTypeByBodySize(int s);
56 
57  void SetPosition(const float* pos);
58  void SetPosition(float x, float y, float z);
59  void SetQuaternion(const float* quat);
60  void SetQuaternion(float ox, float oy, float oz, float w);
61 
62  void GetPosition(float* pos);
63  void GetPosition(float* x, float* y, float* z);
64  void GetQuaternion(float* quat);
65  void GetQuaternion(float* ox, float* oy, float* oz, float* w);
66 
67  virtual int SetMessageHeader(const MessageHeader* mb);
68 
69 protected:
71  ~PositionMessage();
72 
73 protected:
74 
75  virtual int GetBodyPackSize();
76  virtual int PackBody();
77  virtual int UnpackBody();
78 
79  igtlInt32 m_PackType;
80 
81  igtlFloat32 m_Position[3];
82  igtlFloat32 m_Quaternion[4];
83 
84 };
85 
86 
87 } // namespace igtl
88 
89 #endif // _igtlPositionMessage_h
90 
91 
92 
93 

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