Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  
igtl_polydata.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: The OpenIGTLink Library
4  Language: C
5  Web page: http://openigtlink.org/
6 
7  Copyright (c) Insight Software Consortium. All rights reserved.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notices for more information.
12 
13 =========================================================================*/
14 
15 #ifndef __IGTL_POLYDATA_H
16 #define __IGTL_POLYDATA_H
17 
18 #include "igtl_win32header.h"
19 #include "igtl_header.h"
20 #include "igtl_util.h"
21 #include "igtl_types.h"
22 #include "igtl_win32header.h"
23 
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 
30 #define IGTL_POLY_MAX_ATTR_NAME_LEN 255
31 
32 #define IGTL_POLY_ATTR_TYPE_SCALAR 0x00
33 #define IGTL_POLY_ATTR_TYPE_VECTOR 0x01
34 #define IGTL_POLY_ATTR_TYPE_NORMAL 0x02
35 #define IGTL_POLY_ATTR_TYPE_TENSOR 0x03
36 #define IGTL_POLY_ATTR_TYPE_RGBA 0x04
37 
38 #pragma pack(1) /* For 1-byte boundary in memroy */
39 
41 typedef struct {
42  igtl_uint32 npoints; /* Number of points */
43 
44  igtl_uint32 nvertices; /* Number of vertices */
45  igtl_uint32 size_vertices; /* Size of vertice data (bytes) */
46 
47  igtl_uint32 nlines; /* Number of lines */
48  igtl_uint32 size_lines; /* Size of line data (bytes) */
49 
50  igtl_uint32 npolygons; /* Number of polygons */
51  igtl_uint32 size_polygons; /* Size of polygon data (bytes) */
52 
53  igtl_uint32 ntriangle_strips; /* Number of triangle strips */
54  igtl_uint32 size_triangle_strips; /* Size of triangle strips data (bytes) */
55 
56  igtl_uint32 nattributes; /* Number of attributes */
58 
59 
60 typedef struct {
61  igtl_uint8 type; /* attribute type */
62  /* Values for TYPE_ATTRIBUTE (16-bit)
63  0x00: POINT_DATA / Scalars
64  0x01: POINT_DATA / Vectors
65  0x02: POINT_DATA / Normals
66  0x03: POINT_DATA / Tensors
67  0x10: CELL_DATA / Scalars
68  0x11: CELL_DATA / Vectors
69  0x12: CELL_DATA / Normals
70  0x13: CELL_DATA Tensors */
71  igtl_uint8 ncomponents; /* number of components */
72  /* must be 3 for Vectors and Normal, 9 for Tensor.*/
73  igtl_uint32 n;
75 
76 #pragma pack()
77 
79 typedef struct {
80  igtl_uint8 type;
81  igtl_uint8 ncomponents;
82  igtl_uint32 n;
83  char * name;
84  igtl_float32 * data;
86 
88 typedef struct {
90  igtl_float32* points; /* Points */
91  igtl_uint32 * vertices; /* Vertices -- array of (N, i1, i2, i3 ...iN) */
92  igtl_uint32 * lines; /* Lines -- array of (N, i1, i2, i3 ...iN) */
93  igtl_uint32 * polygons; /* Polygons -- array of (N, i1, i2, i3 ...iN) */
94  igtl_uint32 * triangle_strips; /* Triangle strips -- array of (N, i1, i2, i3 ...iN) */
95  igtl_polydata_attribute * attributes; /* Array of attributes */
98 
99 
102 
114 
119 int igtl_export igtl_polydata_unpack(int type, void * byte_array, igtl_polydata_info * info, igtl_uint64 size);
120 
126 int igtl_export igtl_polydata_pack(igtl_polydata_info * info, void * byte_array, int type);
127 
134 igtl_uint64 igtl_export igtl_polydata_get_size(igtl_polydata_info * info, int type);
135 
138 igtl_uint64 igtl_export igtl_polydata_get_crc(igtl_polydata_info * info, int type, void* polydata_message);
139 
140 #ifdef __cplusplus
141 }
142 #endif
143 
144 #endif /* __IGTL_POLYDATA_H */
145 
146 
igtl_uint32 * lines
Definition: igtl_polydata.h:92
igtl_uint32 size_lines
Definition: igtl_polydata.h:48
int igtl_export igtl_polydata_pack(igtl_polydata_info *info, void *byte_array, int type)
igtl_uint64 igtl_export igtl_polydata_get_size(igtl_polydata_info *info, int type)
int igtl_export igtl_polydata_alloc_info(igtl_polydata_info *info)
igtl_uint32 * vertices
Definition: igtl_polydata.h:91
#define igtl_export
igtl_uint32 npolygons
Definition: igtl_polydata.h:50
igtl_polydata_attribute * attributes
Definition: igtl_polydata.h:95
igtl_uint64 igtl_export igtl_polydata_get_crc(igtl_polydata_info *info, int type, void *polydata_message)
int igtl_export igtl_polydata_free_info(igtl_polydata_info *info)
igtl_uint32 nattributes
Definition: igtl_polydata.h:56
igtl_uint32 nvertices
Definition: igtl_polydata.h:44
igtl_uint32 size_polygons
Definition: igtl_polydata.h:51
igtl_uint32 size_triangle_strips
Definition: igtl_polydata.h:54
igtl_uint32 size_vertices
Definition: igtl_polydata.h:45
igtl_float32 * points
Definition: igtl_polydata.h:90
igtl_polydata_header header
Definition: igtl_polydata.h:89
int igtl_export igtl_polydata_unpack(int type, void *byte_array, igtl_polydata_info *info, igtl_uint64 size)
igtl_uint32 * polygons
Definition: igtl_polydata.h:93
igtl_uint32 ntriangle_strips
Definition: igtl_polydata.h:53
igtl_uint32 * triangle_strips
Definition: igtl_polydata.h:94
void igtl_export igtl_polydata_init_info(igtl_polydata_info *info)

Generated at Sat Apr 15 2017 02:30:07 for OpenIGTLink by doxygen 1.8.13 written by Dimitri van Heesch, © 1997-2012