15#ifndef __igtlTrajectoryMessage_h
16#define __igtlTrajectoryMessage_h
47 TYPE_ENTRY_TARGET = 3,
56 const char*
GetName() {
return this->m_Name.c_str(); };
67 igtlUint8
GetType() {
return this->m_Type; };
73 void SetRGBA(igtlUint8 r, igtlUint8 g, igtlUint8 b, igtlUint8 a);
79 void GetRGBA(igtlUint8& r, igtlUint8& g, igtlUint8& b, igtlUint8& a);
106 void SetRadius(igtlFloat32 radius) { this->m_Radius = radius; };
115 const char*
GetOwner() {
return this->m_Owner.c_str(); };
136 igtlFloat32 m_EntryPosition[3];
139 igtlFloat32 m_TargetPosition[3];
166 virtual int PackBody() { AllocatePack();
return 1; };
A class for the GET_TRAJ message type.
SmartPointer< const Self > ConstPointer
virtual int PackBody()
Packs (serialize) the body. Must be implemented in a child class.
GetTrajectoryMessage Self
virtual int UnpackBody()
Unpacks (deserialize) the body. Must be implemented in a child class.
SmartPointer< Self > Pointer
igtlTypeMacro(igtl::GetTrajectoryMessage, igtl::MessageBase)
virtual int GetBodyPackSize()
Gets the size of the serialized body.
igtlNewMacro(igtl::GetTrajectoryMessage)
Base class for most igtl classes.
Implements transparent reference counting.
TrajectoryElement class is used to manage a trajectory in TrajectoryMessage class.
const char * GetGroupName()
Gets the group name.
std::string m_GroupName
Can be "Labeled Trajectory", "Landmark", Fiducial", ...
int SetType(igtlUint8 type)
Sets the trajectory type. 'type' must be either TYPE_ENTRY_ONLY, TYPE_TARGET_ONLY,...
void GetEntryPosition(igtlFloat32 *position)
Sets the entry position using an array of x, y, and z coordinates.
void GetRGBA(igtlUint8 &r, igtlUint8 &g, igtlUint8 &b, igtlUint8 &a)
Gets the color of the trajectory.
void GetRGBA(igtlUint8 *rgba)
Gets the color of the trajectory. An array of r, g, b and alpha is stored in 'rgba'.
const char * GetOwner()
Gets the owner of the trajectory.
void SetRadius(igtlFloat32 radius)
Sets the radius.
void SetRGBA(igtlUint8 rgba[4])
Sets the color of the trajectory using an array of r, g, b and alpha.
void SetRGBA(igtlUint8 r, igtlUint8 g, igtlUint8 b, igtlUint8 a)
Sets the color of the trajectory by r, g, b and alpha.
std::string m_Owner
Device name of the ower image.
void GetTargetPosition(igtlFloat32 *position)
Gets the target position. Stores an array of x, y, and z coordinates in 'position'.
igtlNewMacro(igtl::TrajectoryElement)
const char * GetName()
Gets the name of the trajectory.
void SetTargetPosition(igtlFloat32 x, igtlFloat32 y, igtlFloat32 z)
Sets the target position.
void SetTargetPosition(igtlFloat32 position[3])
Sets the target position using an array of x, y, and z coordinates.
void SetEntryPosition(igtlFloat32 x, igtlFloat32 y, igtlFloat32 z)
Sets the entry position.
void GetEntryPosition(igtlFloat32 &x, igtlFloat32 &y, igtlFloat32 &z)
Gets the entry position.
SmartPointer< const Self > ConstPointer
std::string m_Name
name / description (< 64 bytes)
igtlTypeMacro(igtl::TrajectoryElement, igtl::Object)
int SetName(const char *name)
Sets the name of the trajectory.
void GetTargetPosition(igtlFloat32 &x, igtlFloat32 &y, igtlFloat32 &z)
Gets the target position.
void SetEntryPosition(igtlFloat32 position[3])
Sets the entry position using an array.
igtlFloat32 m_Radius
Radius of the trajectory. Can be 0.
igtlUint8 m_Type
Trajectory type (see TYPE_* constants)
int SetGroupName(const char *grpname)
Sets the group name e.g. "Trajectory".
SmartPointer< Self > Pointer
int SetOwner(const char *owner)
Sets the owner of the trajectory. 'owner' must be a name of image.
igtlUint8 GetType()
Gets the trajectory type. The returned value is either TYPE_ENTRY_ONLY, TYPE_TARGET_ONLY,...
igtlFloat32 GetRadius()
Gets the radius.
int AddTrajectoryElement(TrajectoryElement::Pointer &elem)
Adds a trajectory to the list.
igtlTypeMacro(igtl::TrajectoryMessage, igtl::MessageBase)
igtlNewMacro(igtl::TrajectoryMessage)
SmartPointer< const Self > ConstPointer
virtual int UnpackBody()
Unpacks (deserialize) the body. Must be implemented in a child class.
void ClearTrajectoryElement(TrajectoryElement::Pointer &elem)
Clears the all trajectory from the list.
int GetNumberOfTrajectoryElement()
Gets the number of trajectory in the list.
virtual int PackBody()
Packs (serialize) the body. Must be implemented in a child class.
void GetTrajectoryElement(int index, TrajectoryElement::Pointer &elem)
Gets the trajectory specified by 'index'.
std::vector< TrajectoryElement::Pointer > m_TrajectoryList
A list of pointers to the trajectories.
SmartPointer< Self > Pointer
virtual int GetBodyPackSize()
Gets the size of the serialized body.
The "igtl" namespace contains all OpenIGTLink classes. There are several nested namespaces within the...