15#ifndef __igtlPolyDataMessage_h
16#define __igtlPolyDataMessage_h
96 virtual int PackBody() { AllocatePack();
return 1; };
117 virtual int PackBody() { AllocatePack();
return 1; };
129 typedef std::vector<igtlFloat32>
Point;
157 int SetPoint(
unsigned int id, igtlFloat32 * point);
160 int SetPoint(
unsigned int id, igtlFloat32 x, igtlFloat32 y, igtlFloat32 z);
167 int AddPoint(igtlFloat32 x, igtlFloat32 y, igtlFloat32 z);
170 int GetPoint(
unsigned int id, igtlFloat32 & x, igtlFloat32 & y, igtlFloat32 & z);
173 int GetPoint(
unsigned int id, igtlFloat32 * point);
177 std::vector< Point > m_Data;
186 NULL_POINT = 0xFFFFFFFF,
232 int GetCell(
unsigned int id, igtlUint32 * cell);
235 int GetCell(
unsigned int id, std::list<igtlUint32>& cell);
239 std::vector< std::list<igtlUint32> > m_Data;
305 const char*
GetName() {
return this->m_Name.c_str(); };
325 igtlUint8 m_NComponents;
334 std::vector<igtlFloat32> m_Data;
A class for the GET_POLYDATA message type.
igtlNewMacro(igtl::GetPolyDataMessage)
virtual int UnpackContent()
Unpacks (deserialize) the content. Must be implemented in all child classes.
SmartPointer< const Self > ConstPointer
igtlTypeMacro(igtl::GetPolyDataMessage, igtl::MessageBase)
SmartPointer< Self > Pointer
virtual int PackContent()
Packs (serialize) the content. Must be implemented in all child classes.
virtual int CalculateContentBufferSize()
Gets the size of the serialized content.
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.
virtual int CalculateContentBufferSize()
Gets the size of the serialized content.
igtlSetObjectMacro(Vertices, PolyDataCellArray)
Sets an array of vertices.
virtual int UnpackContent()
Unpacks (deserialize) the content. Must be implemented in all child classes.
igtlSetObjectMacro(Lines, PolyDataCellArray)
Sets an array of lines.
virtual int PackContent()
Packs (serialize) the content. Must be implemented in all child classes.
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.
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.
PolyDataCellArray::Pointer m_Lines
A pointer to the array of lines.
igtlSetObjectMacro(TriangleStrips, PolyDataCellArray)
Sets an array of triangle strips.
void Clear()
Clears the polydata.
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.
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)
A class for the RTS_POLYDATA message type.
virtual int UnpackContent()
Unpacks (deserialize) the content. Must be implemented in all child classes.
SmartPointer< Self > Pointer
igtlNewMacro(igtl::RTSPolyDataMessage)
igtlTypeMacro(igtl::RTSPolyDataMessage, igtl::MessageBase)
void SetStatus(bool status)
virtual int PackContent()
Packs (serialize) the content. Must be implemented in all child classes.
igtl_uint8 m_Status
Result of the previous GET_POLYDATA/POLYDATA message.
virtual int CalculateContentBufferSize()
Gets the size of the serialized content.
SmartPointer< const Self > ConstPointer
Implements transparent reference counting.
A class for the STT_POLYDATA message type.
StartPolyDataMessage Self
igtlTypeMacro(igtl::StartPolyDataMessage, igtl::MessageBase)
virtual int GetBodyPackSize()
SmartPointer< Self > Pointer
igtlNewMacro(igtl::StartPolyDataMessage)
SmartPointer< const Self > ConstPointer
A class for the STP_POLYDATA message type.
SmartPointer< const Self > ConstPointer
igtlNewMacro(igtl::StopPolyDataMessage)
igtlTypeMacro(igtl::StopPolyDataMessage, igtl::MessageBase)
SmartPointer< Self > Pointer
virtual int GetBodyPackSize()
The "igtl" namespace contains all OpenIGTLink classes. There are several nested namespaces within the...