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.
00001 /*=========================================================================
00002 
00003   Program:   Open IGT Link Library
00004   Module:    $HeadURL: http://svn.na-mic.org/NAMICSandBox/trunk/OpenIGTLink/Source/igtlPositionMessage.h $
00005   Language:  C++
00006   Date:      $Date: 2008-12-22 19:05:42 -0500 (Mon, 22 Dec 2008) $
00007   Version:   $Revision: 3460 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010 
00011   This software is distributed WITHOUT ANY WARRANTY; without even
00012   the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00013   PURPOSE.  See the above copyright notices for more information.
00014 
00015 =========================================================================*/
00016 
00017 #ifndef __igtlPositionMessage_h
00018 #define __igtlPositionMessage_h
00019 
00020 #include "igtlObject.h"
00021 //#include "igtlMacros.h"
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); /* POSITION_ONLY / WITH_QUATERNION3 / ALL */
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 } // namespace igtl
00088 
00089 #endif // _igtlPositionMessage_h
00090 
00091 
00092 
00093 

Generated at Wed Apr 27 2011 00:08:07 for OpenIGTLink by doxygen 1.7.4 written by Dimitri van Heesch, © 1997-2000