Difference between revisions of "OpenIGTLink/ProtocolV2/Type/PolyData"
From NAMIC Wiki
| Line 20: | Line 20: | ||
| align="left" | uint16 | | align="left" | uint16 | ||
| align="left" | Data type (see image) | | align="left" | Data type (see image) | ||
| + | |- | ||
| + | | align="left" | NVERTICES | ||
| + | | align="left" | uint32 | ||
| + | | align="left" | Number of vertices | ||
| + | |- | ||
| + | | align="left" | NLINES | ||
| + | | align="left" | uint32 | ||
| + | | align="left" | Number of lines | ||
| + | |- | ||
| + | | align="left" | NPOLYGONS | ||
| + | | align="left" | uint32 | ||
| + | | align="left" | Number of lines | ||
| + | |- | ||
| + | | align="left" | NTRIANGLE_STRIPS | ||
| + | | align="left" | uint32 | ||
| + | | align="left" | Number of lines | ||
|- | |- | ||
| align="left" | POINTS | | align="left" | POINTS | ||
| align="left" | PTYPE * NPOINTS * 3 | | 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" | 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" | VERTICES | ||
| align="left" | uint32 * ((NPOINTS_0+1) + (NPOINTS_1+1) + (NPOINTS_(N-1)+1)) | | 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" | 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" | LINES | ||
| align="left" | uint32 * ((NPOINTS_0+1) + (NPOINTS_1+1) + (NPOINTS_(N-1)+1)) | | 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" | 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" | POLYGONS | ||
| align="left" | uint32 * ((NPOINTS_0+1) + (NPOINTS_1+1) + (NPOINTS_(N-1)+1)) | | 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" | 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" | TRIANGLE_STRIPS | ||
| Line 58: | Line 58: | ||
|- | |- | ||
|} | |} | ||
| + | <font color="red">2/17 change the order of the field to make implementation easier</font> | ||
==GET_POLYDATA== | ==GET_POLYDATA== | ||
Revision as of 22:00, 17 February 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.
Message Types
POLYDATA
| Data | Type | Description |
| NPOINTS | uint32 | Number of points |
| PTYPE | uint16 | Data type (see image) |
| NVERTICES | uint32 | Number of vertices |
| NLINES | uint32 | Number of lines |
| NPOLYGONS | uint32 | Number of lines |
| NTRIANGLE_STRIPS | uint32 | Number of lines |
| 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, ....)) |
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