Difference between revisions of "OpenIGTLink/ProtocolV2/Type/PolyData"
From NAMIC Wiki
Line 60: | Line 60: | ||
| align="left" | uint32 | | align="left" | uint32 | ||
| align="left" | Number of dataset attributes | | align="left" | Number of dataset attributes | ||
+ | |- | ||
+ | | align="left" | POINTS | ||
+ | | align="left" | PTYPE * NPOINTS * 3 | ||
+ | | align="left" | Coordinates of points (P0x, P0y, P0z, P1x, P1y, P1z, ... P(n-1)x, P(n-1)y, P(n-1)z | ||
+ | |- | ||
+ | | align="left" | VERTICES | ||
+ | | align="left" | uint32 * ((NPOINTS_0+1) + (NPOINTS_1+1) + (NPOINTS_(N-1)+1)) | ||
+ | | align="left" | array of vertices ((NPOINTS_0, index_0_0, index_0_1, ....), (NPOINTS_1, index_1_0, index_1_1, ....), ..., (NPOINTS_(N-1), index_(N-1)_0, index_(N-1)_1, ....)) | ||
+ | |- | ||
+ | | align="left" | LINES | ||
+ | | align="left" | uint32 * ((NPOINTS_0+1) + (NPOINTS_1+1) + (NPOINTS_(N-1)+1)) | ||
+ | | align="left" | array of vertices ((NPOINTS_0, index_0_0, index_0_1, ....), (NPOINTS_1, index_1_0, index_1_1, ....), ..., (NPOINTS_(N-1), index_(N-1)_0, index_(N-1)_1, ....)) | ||
+ | |- | ||
+ | | align="left" | POLYGONS | ||
+ | | align="left" | uint32 * ((NPOINTS_0+1) + (NPOINTS_1+1) + (NPOINTS_(N-1)+1)) | ||
+ | | align="left" | array of vertices ((NPOINTS_0, index_0_0, index_0_1, ....), (NPOINTS_1, index_1_0, index_1_1, ....), ..., (NPOINTS_(N-1), index_(N-1)_0, index_(N-1)_1, ....)) | ||
+ | |- | ||
+ | | align="left" | TRIANGLE_STRIPS | ||
+ | | align="left" | uint32 * ((NPOINTS_0+1) + (NPOINTS_1+1) + (NPOINTS_(N-1)+1)) | ||
+ | | align="left" | array of vertices ((NPOINTS_0, index_0_0, index_0_1, ....), (NPOINTS_1, index_1_0, index_1_1, ....), ..., (NPOINTS_(N-1), index_(N-1)_0, index_(N-1)_1, ....)) | ||
+ | |- | ||
+ | | align="left" | NAME_ATTRIBUTE0 | ||
+ | | align="left" | char * NAMESIZE_ATTRIBUTE0 | ||
+ | | align="left" | Name of attribute 0 | ||
+ | |- | ||
+ | | align="left" | NAME_ATTRIBUTE1 | ||
+ | | align="left" | char * NAMESIZE_ATTRIBUTE1 | ||
+ | | align="left" | Name of attribute 1 | ||
+ | |- | ||
+ | | align="left" | ... | ||
+ | | align="left" | ... | ||
+ | | align="left" | ... | ||
+ | |- | ||
+ | | align="left" | NAME_ATTRIBUTE(NATTRIBUTES-1) | ||
+ | | align="left" | char * NAMESIZE_ATTRIBUTE(NATTRIBUTES-1) | ||
+ | | align="left" | Name of attribute (NATTRIBUTES-1) | ||
+ | |- | ||
+ | | align="left" | (Padding) | ||
+ | | align="left" | char or 0 | ||
+ | | align="left" | Padding (inserted if NAMESIZE_ATTRIBUTE0+NAMESIZE_ATTRIBUTE1+...NAMESIZE_ATTRIBUTE(NATTRIBUTES-1) % 2 == 1) | ||
+ | |- | ||
|- | |- | ||
| align="left" | TYPE_ATTRIBUTE0 | | align="left" | TYPE_ATTRIBUTE0 | ||
Line 100: | Line 141: | ||
| align="left" | uint32 | | align="left" | uint32 | ||
| align="left" | Number of data for attribute2 | | align="left" | Number of data for attribute2 | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| align="left" | ATTRIBUTE0 | | align="left" | ATTRIBUTE0 |
Revision as of 01:21, 3 August 2011
Home < OpenIGTLink < ProtocolV2 < Type < PolyDataContents
Summary
POLYDATA is used to transfer 3D polygonal data. The message format is designed based on the POLY DATA format defined in VTK file format and equivalent to VTK's vtkPolyData class. The message also supports dataset attribute field in VTK, including scalars, calar_scalars, vectors, vectors, normals, texture coordinates and tensor, but not lookup table.
Message Types
POLYDATA
Data | Type | Description |
NPOINTS | uint32 | Number of points |
PTYPE | uint8 | Data type (see image) |
(Reserved) | uint8 | -- |
NVERTICES | uint32 | Number of vertices |
SIZE_VERTICES | uint32 | Number of vertices |
NLINES | uint32 | Number of lines |
SIZE_LINES | uint32 | Number of lines |
NPOLYGONS | uint32 | Number of polygons |
SIZE_POLYGONS | uint32 | Number of polygons |
NTRIANGLE_STRIPS | uint32 | Number of triangle strips |
SIZE_TRIANGLE_STRIPS | uint32 | Number of triangle strips |
NATTRIBUTES | uint32 | Number of dataset attributes |
POINTS | PTYPE * NPOINTS * 3 | Coordinates of points (P0x, P0y, P0z, P1x, P1y, P1z, ... P(n-1)x, P(n-1)y, P(n-1)z |
VERTICES | uint32 * ((NPOINTS_0+1) + (NPOINTS_1+1) + (NPOINTS_(N-1)+1)) | array of vertices ((NPOINTS_0, index_0_0, index_0_1, ....), (NPOINTS_1, index_1_0, index_1_1, ....), ..., (NPOINTS_(N-1), index_(N-1)_0, index_(N-1)_1, ....)) |
LINES | uint32 * ((NPOINTS_0+1) + (NPOINTS_1+1) + (NPOINTS_(N-1)+1)) | array of vertices ((NPOINTS_0, index_0_0, index_0_1, ....), (NPOINTS_1, index_1_0, index_1_1, ....), ..., (NPOINTS_(N-1), index_(N-1)_0, index_(N-1)_1, ....)) |
POLYGONS | uint32 * ((NPOINTS_0+1) + (NPOINTS_1+1) + (NPOINTS_(N-1)+1)) | array of vertices ((NPOINTS_0, index_0_0, index_0_1, ....), (NPOINTS_1, index_1_0, index_1_1, ....), ..., (NPOINTS_(N-1), index_(N-1)_0, index_(N-1)_1, ....)) |
TRIANGLE_STRIPS | uint32 * ((NPOINTS_0+1) + (NPOINTS_1+1) + (NPOINTS_(N-1)+1)) | array of vertices ((NPOINTS_0, index_0_0, index_0_1, ....), (NPOINTS_1, index_1_0, index_1_1, ....), ..., (NPOINTS_(N-1), index_(N-1)_0, index_(N-1)_1, ....)) |
NAME_ATTRIBUTE0 | char * NAMESIZE_ATTRIBUTE0 | Name of attribute 0 |
NAME_ATTRIBUTE1 | char * NAMESIZE_ATTRIBUTE1 | Name of attribute 1 |
... | ... | ... |
NAME_ATTRIBUTE(NATTRIBUTES-1) | char * NAMESIZE_ATTRIBUTE(NATTRIBUTES-1) | Name of attribute (NATTRIBUTES-1) |
(Padding) | char or 0 | Padding (inserted if NAMESIZE_ATTRIBUTE0+NAMESIZE_ATTRIBUTE1+...NAMESIZE_ATTRIBUTE(NATTRIBUTES-1) % 2 == 1) |
TYPE_ATTRIBUTE0 | uint16 | Type of dataset attribute 0 (including number of components for scalar type) |
NAMESIZE_ATTRIBUTE0 | uint16 | Length of name for attribute 0 |
SIZE_ATTRIBUTE1 | uint32 | Number of data for attribute 0 |
TYPE_ATTRIBUTE1 | uint16 | Type of dataset attribute 1 (including number of components for scalar type) |
NAMESIZE_ATTRIBUTE1 | uint16 | Length of name for attribute 1 |
SIZE_ATTRIBUTE1 | uint32 | Number of data for attribute1 |
... | ... | ... |
TYPE_ATTRIBUTE(NATTRIBUTES-1) | uint16 | Type of dataset attribute 1 (including number of components for scalar type) |
NAMESIZE_ATTRIBUTE(NATTRIBUTES-1) | uint16 | Length of name for attribute 2 |
SIZE_ATTRIBUTE(NATTRIBUTES-1) | uint32 | Number of data for attribute2 |
ATTRIBUTE0 | SIZE_ATTRIBUTE0 * (number of components) * (data size) | Actual attribute data |
ATTRIBUTE1 | SIZE_ATTRIBUTE0 * (number of components) * (data size) | Actual attribute data |
... | ... | ... |
ATTRIBUTE(NATTRIBUTES-1) | SIZE_ATTRIBUTE(NATTRIBUTES-1) * (number of components) * (data size) | Actual attribute data |
2/17 change the order of the field to make implementation easier
GET_POLYDATA
Data | Type | Description |
STT_POLYDATA
Data | Type | Description |
Data | Type | Description |
RESOL | uint64 | Minimum interval between message (ns). Same format as TimeStamp |
STP_POLYDATA
Data | Type | Description |
RTS_POLYDATA
Data | Type | Description |
Status | 8 bit unsigned | 0: Success 1: Error |
Implementations
The NDARRAY message type is implemented in the following source code.
Contributors
Junichi Tokuda