Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  
igtlTrajectoryMessage.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/OpenIGTLink2_beta/Source/igtlImgmetaMessage.h $
5  Language: C++
6  Date: $Date: 2009-12-16 23:58:02 -0500 (Wed, 16 Dec 2009) $
7  Version: $Revision: 5466 $
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 __igtlTrajectoryMessage_h
18 #define __igtlTrajectoryMessage_h
19 
20 #include <vector>
21 #include <string>
22 
23 #include "igtlObject.h"
24 //#include "igtlMacros.h"
25 #include "igtlMath.h"
26 #include "igtlMessageBase.h"
27 #include "igtlTypes.h"
28 
29 #include "igtlImageMessage.h"
30 
31 namespace igtl
32 {
33 
35 {
36 public:
38  typedef Object Superclass;
41 
44 
45  enum {
46  TYPE_ENTRY_ONLY = 1,
47  TYPE_TARGET_ONLY = 2,
48  TYPE_ENTRY_TARGET = 3,
49  };
50 
51 public:
52  int SetName(const char* name);
53  const char* GetName() { return this->m_Name.c_str(); };
54 
55  int SetGroupName(const char* grpname);
56  const char* GetGroupName() { return this->m_GroupName.c_str(); };
57 
58  int SetType(igtlUint8 type);
59  igtlUint8 GetType() { return this->m_Type; };
60 
61  void SetRGBA(igtlUint8 rgba[4]);
62  void SetRGBA(igtlUint8 r, igtlUint8 g, igtlUint8 b, igtlUint8 a);
63  void GetRGBA(igtlUint8* rgba);
64  void GetRGBA(igtlUint8& r, igtlUint8& g, igtlUint8& b, igtlUint8& a);
65 
66  void SetEntryPosition(igtlFloat32 position[3]);
67  void SetEntryPosition(igtlFloat32 x, igtlFloat32 y, igtlFloat32 z);
68  void GetEntryPosition(igtlFloat32* position);
69  void GetEntryPosition(igtlFloat32& x, igtlFloat32& y, igtlFloat32& z);
70 
71  void SetTargetPosition(igtlFloat32 position[3]);
72  void SetTargetPosition(igtlFloat32 x, igtlFloat32 y, igtlFloat32 z);
73  void GetTargetPosition(igtlFloat32* position);
74  void GetTargetPosition(igtlFloat32& x, igtlFloat32& y, igtlFloat32& z);
75 
76  void SetRadius(igtlFloat32 radius) { this->m_Radius = radius; };
77  igtlFloat32 GetRadius() { return this->m_Radius; };
78 
79  int SetOwner(const char* owner);
80  const char* GetOwner() { return this->m_Owner.c_str(); };
81 
82 protected:
85 
86 protected:
87 
88  std::string m_Name; /* name / description (< 64 bytes)*/
89  std::string m_GroupName; /* Can be "Labeled Trajectory", "Landmark", Fiducial", ... */
90  igtlUint8 m_Type; /* Trajectory type (see TYPE_* constants) */
91  igtlUint8 m_RGBA[4]; /* Color in R/G/B/A */
92  igtlFloat32 m_EntryPosition[3]; /* Coordinate of the entry point */
93  igtlFloat32 m_TargetPosition[3]; /* Coordinate of the target point */
94  igtlFloat32 m_Radius; /* Radius of the trajectory. Can be 0. */
95  std::string m_Owner; /* Device name of the ower image */
96 };
97 
98 
100 {
101 public:
106 
109 
110 protected:
111  GetTrajectoryMessage() : MessageBase() { this->m_DefaultBodyType = "GET_TRAJ"; };
113 protected:
114  virtual int GetBodyPackSize() { return 0; };
115  virtual int PackBody() { AllocatePack(); return 1; };
116  virtual int UnpackBody() { return 1; };
117 };
118 
119 
121 {
122 public:
127 
130 
131 public:
132  int AddTrajectoryElement(TrajectoryElement::Pointer& elem);
133  void ClearTrajectoryElement(TrajectoryElement::Pointer& elem);
134 
135  int GetNumberOfTrajectoryElement();
136  void GetTrajectoryElement(int index, TrajectoryElement::Pointer& elem);
137 
138 
139 protected:
142 
143 protected:
144 
145  virtual int GetBodyPackSize();
146  virtual int PackBody();
147  virtual int UnpackBody();
148 
149  std::vector<TrajectoryElement::Pointer> m_TrajectoryList;
150 
151 };
152 
153 
154 } // namespace igtl
155 
156 #endif // _igtlTrajectoryMessage_h
157 
158 
159 
160 

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