igtlPositionMessage.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __igtlPositionMessage_h
00018 #define __igtlPositionMessage_h
00019
00020 #include "igtlObject.h"
00021
00022 #include "igtlMath.h"
00023 #include "igtlMessageBase.h"
00024 #include "igtlTypes.h"
00025
00026 namespace igtl
00027 {
00028
00029 class IGTLCommon_EXPORT PositionMessage: public MessageBase
00030 {
00031 public:
00032 enum {
00033 POSITION_ONLY = 1,
00034 WITH_QUATERNION3,
00035 ALL,
00036 };
00037
00038
00039 public:
00040 typedef PositionMessage Self;
00041 typedef MessageBase Superclass;
00042 typedef SmartPointer<Self> Pointer;
00043 typedef SmartPointer<const Self> ConstPointer;
00044
00045 igtlTypeMacro(igtl::PositionMessage, igtl::MessageBase);
00046 igtlNewMacro(igtl::PositionMessage);
00047
00048 public:
00049
00050 void Init();
00051
00052 void SetPackType(int t);
00053
00055 int SetPackTypeByBodySize(int s);
00056
00057 void SetPosition(const float* pos);
00058 void SetPosition(float x, float y, float z);
00059 void SetQuaternion(const float* quat);
00060 void SetQuaternion(float ox, float oy, float oz, float w);
00061
00062 void GetPosition(float* pos);
00063 void GetPosition(float* x, float* y, float* z);
00064 void GetQuaternion(float* quat);
00065 void GetQuaternion(float* ox, float* oy, float* oz, float* w);
00066
00067 virtual int SetMessageHeader(const MessageHeader* mb);
00068
00069 protected:
00070 PositionMessage();
00071 ~PositionMessage();
00072
00073 protected:
00074
00075 virtual int GetBodyPackSize();
00076 virtual int PackBody();
00077 virtual int UnpackBody();
00078
00079 igtlInt32 m_PackType;
00080
00081 igtlFloat32 m_Position[3];
00082 igtlFloat32 m_Quaternion[4];
00083
00084 };
00085
00086
00087 }
00088
00089 #endif // _igtlPositionMessage_h
00090
00091
00092
00093