15 #ifndef __igtlPolyDataMessage_h
16 #define __igtlPolyDataMessage_h
46 virtual int PackBody() { AllocatePack();
return 1; };
57 typedef std::vector<igtlFloat32>
Point;
78 void SetNumberOfPoints(
int n);
81 int GetNumberOfPoints();
85 int SetPoint(
unsigned int id, igtlFloat32 * point);
88 int SetPoint(
unsigned int id, igtlFloat32 x, igtlFloat32 y, igtlFloat32 z);
92 int AddPoint(igtlFloat32 * point);
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,
136 igtlUint32 GetNumberOfCells();
139 void AddCell(
int n, igtlUint32 * cell);
142 void AddCell(std::list<igtlUint32> cell);
152 igtlUint32 GetTotalSize();
155 igtlUint32 GetCellSize(
unsigned int id);
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;
214 int SetType(
int t,
int n=1);
221 igtlUint32 GetNumberOfComponents();
224 igtlUint32 SetSize(igtlUint32 size);
227 igtlUint32 GetSize();
230 void SetName(
const char * name);
233 const char*
GetName() {
return this->m_Name.c_str(); };
236 int SetData(igtlFloat32 * data);
239 int GetData(igtlFloat32 * data);
242 int SetNthData(
unsigned int n, igtlFloat32 * data);
245 int GetNthData(
unsigned int n, igtlFloat32 * data);
253 igtlUint8 m_NComponents;
262 std::vector<igtlFloat32> m_Data;
315 void ClearAttributes();
321 int GetNumberOfAttributes();
332 virtual int GetBodyPackSize();
333 virtual int PackBody();
334 virtual int UnpackBody();
358 #endif // _igtlPolyDataMessage_h
PolyDataCellArray::Pointer m_Polygons
A pointer to the array of polygons.
SmartPointer< Self > Pointer
std::vector< PolyDataAttribute::Pointer > m_Attributes
A list of pointers to the attributes.
igtlUint8 GetType()
Gets the attribute type.
#define igtlTypeMacro(thisClass, superclass)
PolyDataCellArray::Pointer m_Lines
A pointer to the array of lines.
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
A class for the POLYDATA message type.
The "igtl" namespace contains all OpenIGTLink classes. There are several nested namespaces within the...
const char * GetName()
Gets the name of the attribute.
#define igtlGetObjectMacro(name, type)
std::vector< igtlFloat32 > Point
A vector to represent coordinates of a point.
virtual int GetBodyPackSize()
Gets the size of the serialized body.
SmartPointer< Self > Pointer
Attribute class used for passing attribute data.
PolyDataPointArray::Pointer m_Points
A pointer to the array of points.
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.
SmartPointer< Self > Pointer
PolyDataCellArray::Pointer m_Vertices
A pointer to the array of vertices.
A class for the GET_POLYDATA message type.
SmartPointer< const Self > ConstPointer
#define igtlSetObjectMacro(name, type)
SmartPointer< const Self > ConstPointer
Base class for most igtl classes.
PolyDataCellArray::Pointer m_TriangleStrips
A pointer to the array of triangle strips.
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer