15#ifndef __igtlPointMessage_h
16#define __igtlPointMessage_h
50 const char*
GetName() {
return this->m_Name.c_str(); };
62 void SetRGBA(igtlUint8 r, igtlUint8 g, igtlUint8 b, igtlUint8 a);
68 void GetRGBA(igtlUint8& r, igtlUint8& g, igtlUint8& b, igtlUint8& a);
74 void SetPosition(igtlFloat32 x, igtlFloat32 y, igtlFloat32 z);
80 void GetPosition(igtlFloat32& x, igtlFloat32& y, igtlFloat32& z);
83 void SetRadius(igtlFloat32 radius) { this->m_Radius = radius; };
92 const char*
GetOwner() {
return this->m_Owner.c_str(); };
110 igtlFloat32 m_Position[3];
137 virtual int PackBody() { AllocatePack();
return 1; };
A class for the GET_POINT message type.
SmartPointer< const Self > ConstPointer
virtual int GetBodyPackSize()
Gets the size of the serialized body.
SmartPointer< Self > Pointer
virtual int PackBody()
Packs (serialize) the body. Must be implemented in a child class.
igtlTypeMacro(igtl::GetPointMessage, igtl::MessageBase)
igtlNewMacro(igtl::GetPointMessage)
virtual int UnpackBody()
Unpacks (deserialize) the body. Must be implemented in a child class.
Base class for most igtl classes.
A class to manage point information.
void GetPosition(igtlFloat32 &x, igtlFloat32 &y, igtlFloat32 &z)
Gets the position of the point using x, y and z coordinates.
int SetName(const char *name)
Sets the name/description of the point. The string 'name' must not exceed 64 characters.
int SetGroupName(const char *grpname)
Sets the group name e.g. "Labeled Point", "Landmark", "Fiducial", etc.
igtlFloat32 m_Radius
Radius of the point. Can be 0.
igtlFloat32 GetRadius()
Gets the radius of the point.
void SetPosition(igtlFloat32 x, igtlFloat32 y, igtlFloat32 z)
Sets the position of the point by x, y and z coordinates.
igtlTypeMacro(igtl::PointElement, igtl::Object)
void SetRGBA(igtlUint8 r, igtlUint8 g, igtlUint8 b, igtlUint8 a)
Sets the color of the point specified by values of R, G, B and A.
void GetPosition(igtlFloat32 *position)
Gets the position of the point using an array of x, y and z coordinates.
std::string m_Owner
Device name of the ower image.
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
std::string m_GroupName
Can be "Labeled Point", "Landmark", Fiducial", ...
void GetRGBA(igtlUint8 &r, igtlUint8 &g, igtlUint8 &b, igtlUint8 &a)
Gets the color of the point using values of R, G, B and A.
void SetPosition(igtlFloat32 position[3])
Sets the position of the point by an array of x, y and z coordinates.
int SetOwner(const char *owner)
Sets the name of the image that owns this label map.
const char * GetGroupName()
Gets the group name.
void SetRGBA(igtlUint8 rgba[4])
Sets the color of the point specified by an array of R, G, B and A.
const char * GetOwner()
Gets the name of the image that owns this label map.
const char * GetName()
Gets the name/description of the point.
void GetRGBA(igtlUint8 *rgba)
Gets the color of the point using an array of R, G, B and A.
std::string m_Name
name / description (< 64 bytes)
void SetRadius(igtlFloat32 radius)
Sets the radius of the point.
igtlNewMacro(igtl::PointElement)
igtlTypeMacro(igtl::PointMessage, igtl::MessageBase)
std::vector< PointElement::Pointer > m_PointList
A list of pointers to the points.
int AddPointElement(PointElement::Pointer &elem)
void GetPointElement(int index, PointElement::Pointer &elem)
Gets a pointer to the point specified by 'index'.
void ClearPointElement()
Clears the points in the list.
virtual int GetBodyPackSize()
Gets the size of the serialized body.
igtlNewMacro(igtl::PointMessage)
virtual int PackBody()
Packs (serialize) the body. Must be implemented in a child class.
SmartPointer< const Self > ConstPointer
virtual int UnpackBody()
Unpacks (deserialize) the body. Must be implemented in a child class.
int GetNumberOfPointElement()
Gets the number of points in the list.
SmartPointer< Self > Pointer
Implements transparent reference counting.
The "igtl" namespace contains all OpenIGTLink classes. There are several nested namespaces within the...