15#ifndef __igtlPolyDataMessage_h
16#define __igtlPolyDataMessage_h
46 virtual int PackBody() { AllocatePack();
return 1; };
57 typedef std::vector<igtlFloat32>
Point;
85 int SetPoint(
unsigned int id, igtlFloat32 * point);
88 int SetPoint(
unsigned int id, igtlFloat32 x, igtlFloat32 y, igtlFloat32 z);
95 int AddPoint(igtlFloat32 x, igtlFloat32 y, igtlFloat32 z);
98 int GetPoint(
unsigned int id, igtlFloat32 & x, igtlFloat32 & y, igtlFloat32 & z);
101 int GetPoint(
unsigned int id, igtlFloat32 * point);
105 std::vector< Point > m_Data;
114 NULL_POINT = 0xFFFFFFFF,
160 int GetCell(
unsigned int id, igtlUint32 * cell);
163 int GetCell(
unsigned int id, std::list<igtlUint32>& cell);
167 std::vector< std::list<igtlUint32> > m_Data;
233 const char*
GetName() {
return this->m_Name.c_str(); };
253 igtlUint8 m_NComponents;
262 std::vector<igtlFloat32> m_Data;
A class for the GET_POLYDATA message type.
igtlNewMacro(igtl::GetPolyDataMessage)
SmartPointer< const Self > ConstPointer
igtlTypeMacro(igtl::GetPolyDataMessage, igtl::MessageBase)
virtual int GetBodyPackSize()
Gets the size of the serialized body.
virtual int PackBody()
Packs (serialize) the body. Must be implemented in a child class.
SmartPointer< Self > Pointer
virtual int UnpackBody()
Unpacks (deserialize) the body. Must be implemented in a child class.
Base class for most igtl classes.
Attribute class used for passing attribute data.
int GetNthData(unsigned int n, igtlFloat32 *data)
Gets the Nth data.
void Clear()
Clears the attributes.
SmartPointer< Self > Pointer
SmartPointer< const Self > ConstPointer
int SetData(igtlFloat32 *data)
Sets the attribute by byte array.
const char * GetName()
Gets the name of the attribute.
int SetNthData(unsigned int n, igtlFloat32 *data)
Sets the Nth data.
igtlNewMacro(igtl::PolyDataAttribute)
igtlUint32 GetSize()
Gets the size of the attribute.
int GetData(igtlFloat32 *data)
Gets the attribute as a byte array.
void SetName(const char *name)
Sets the name of the attribute.
igtlUint32 GetNumberOfComponents()
igtlTypeMacro(igtl::PolyDataAttribute, igtl::Object)
igtlUint8 GetType()
Gets the attribute type.
igtlUint32 SetSize(igtlUint32 size)
Sets the size of the attribute.
int SetType(int t, int n=1)
SmartPointer< const Self > ConstPointer
void AddCell(std::list< igtlUint32 > cell)
Adds an array of cells stored in 'cell'.
void AddCell(int n, igtlUint32 *cell)
Adds an array of cells stored in 'cell'. The number of cells is specified by 'n'.
int GetCell(unsigned int id, std::list< igtlUint32 > &cell)
Gets the cell specified by the 'id'. A list of points in the cell will be stored in the 'cell'.
igtlUint32 GetTotalSize()
SmartPointer< Self > Pointer
igtlUint32 GetCellSize(unsigned int id)
Gets the size of the cell specified by 'id'.
igtlTypeMacro(igtl::PolyDataCellArray, igtl::Object)
void Clear()
Clears the cell array.
igtlUint32 GetNumberOfCells()
Gets the number of cells in the array.
int GetCell(unsigned int id, igtlUint32 *cell)
igtlNewMacro(igtl::PolyDataCellArray)
A class for the POLYDATA message type.
SmartPointer< Self > Pointer
igtlSetObjectMacro(Points, PolyDataPointArray)
Sets an array of points.
PolyDataCellArray::Pointer m_TriangleStrips
A pointer to the array of triangle strips.
igtlTypeMacro(igtl::PolyDataMessage, igtl::MessageBase)
igtlGetObjectMacro(Points, PolyDataPointArray)
Gets an array of points.
igtlSetObjectMacro(Vertices, PolyDataCellArray)
Sets an array of vertices.
igtlSetObjectMacro(Lines, PolyDataCellArray)
Sets an array of lines.
igtlGetObjectMacro(Polygons, PolyDataCellArray)
Gets an array of polygons.
PolyDataAttribute * GetAttribute(unsigned int id)
Gets an attribute specified by 'id'.
void AddAttribute(PolyDataAttribute *att)
Adds an attribute.
virtual int GetBodyPackSize()
Gets the size of the serialized body.
SmartPointer< const Self > ConstPointer
PolyDataCellArray::Pointer m_Polygons
A pointer to the array of polygons.
void ClearAttributes()
Clears the attributes.
std::vector< PolyDataAttribute::Pointer > m_Attributes
A list of pointers to the attributes.
PolyDataPointArray::Pointer m_Points
A pointer to the array of points.
PolyDataCellArray::Pointer m_Vertices
A pointer to the array of vertices.
igtlGetObjectMacro(Lines, PolyDataCellArray)
Gets an array of lines.
igtlGetObjectMacro(Vertices, PolyDataCellArray)
Gets an array of vertices.
virtual int UnpackBody()
Unpacks (deserialize) the body. Must be implemented in a child class.
PolyDataCellArray::Pointer m_Lines
A pointer to the array of lines.
igtlSetObjectMacro(TriangleStrips, PolyDataCellArray)
Sets an array of triangle strips.
void Clear()
Clears the poly data.
igtlNewMacro(igtl::PolyDataMessage)
igtlSetObjectMacro(Polygons, PolyDataCellArray)
Sets an array of polygons.
int GetNumberOfAttributes()
Gets the number of attributes.
igtlGetObjectMacro(TriangleStrips, PolyDataCellArray)
Gets an array of triangle strips.
virtual int PackBody()
Packs (serialize) the body. Must be implemented in a child class.
int GetPoint(unsigned int id, igtlFloat32 &x, igtlFloat32 &y, igtlFloat32 &z)
Gets the coordinates of the point specified by 'id'.
void Clear()
Clears the all points in the list.
std::vector< igtlFloat32 > Point
A vector to represent coordinates of a point.
igtlTypeMacro(igtl::PolyDataPointArray, igtl::Object)
void SetNumberOfPoints(int n)
Sets the number of points. This function will change the size of the list.
int SetPoint(unsigned int id, igtlFloat32 x, igtlFloat32 y, igtlFloat32 z)
Substitutes the point specified by 'id' with a point specified by 'x', 'y' and 'z'.
SmartPointer< Self > Pointer
int AddPoint(igtlFloat32 x, igtlFloat32 y, igtlFloat32 z)
Adds a point 'point' specified by 'x', 'y' and 'z'.
SmartPointer< const Self > ConstPointer
igtlNewMacro(igtl::PolyDataPointArray)
int GetNumberOfPoints()
Gets the number of points in the list.
int GetPoint(unsigned int id, igtlFloat32 *point)
Gets the coordinates of the point specified by 'id'.
int SetPoint(unsigned int id, igtlFloat32 *point)
int AddPoint(igtlFloat32 *point)
Implements transparent reference counting.
The "igtl" namespace contains all OpenIGTLink classes. There are several nested namespaces within the...