Line -... |
Line 1... |
- |
|
1 |
/**
|
- |
|
2 |
* @file rply.h
|
- |
|
3 |
* @brief RPly library, read/write PLY files by Diego Nehab, Princeton University
|
- |
|
4 |
*/
|
1 |
#ifndef __GEOMETRY_PLY_H
|
5 |
#ifndef __GEOMETRY_PLY_H
|
2 |
#define __GEOMETRY_PLY_H
|
6 |
#define __GEOMETRY_PLY_H
|
3 |
/* ----------------------------------------------------------------------
|
7 |
/* ----------------------------------------------------------------------
|
4 |
* RPly library, read/write PLY files
|
8 |
* RPly library, read/write PLY files
|
5 |
* Diego Nehab, Princeton University
|
9 |
* Diego Nehab, Princeton University
|
Line 88... |
Line 92... |
88 |
* pdata/idata: user data that will be passed to callback
|
92 |
* pdata/idata: user data that will be passed to callback
|
89 |
*
|
93 |
*
|
90 |
* Returns 0 if no element or no property in element, returns the
|
94 |
* Returns 0 if no element or no property in element, returns the
|
91 |
* number of element instances otherwise.
|
95 |
* number of element instances otherwise.
|
92 |
* ---------------------------------------------------------------------- */
|
96 |
* ---------------------------------------------------------------------- */
|
93 |
long ply_set_read_cb(p_ply ply, const char *element_name,
|
97 |
int ply_set_read_cb(p_ply ply, const char *element_name,
|
94 |
const char *property_name, p_ply_read_cb read_cb,
|
98 |
const char *property_name, p_ply_read_cb read_cb,
|
95 |
void *pdata, long idata);
|
99 |
void *pdata, int idata);
|
96 |
|
100 |
|
97 |
/* ----------------------------------------------------------------------
|
101 |
/* ----------------------------------------------------------------------
|
98 |
* Returns information about the element originating a callback
|
102 |
* Returns information about the element originating a callback
|
99 |
*
|
103 |
*
|
100 |
* argument: handle to argument
|
104 |
* argument: handle to argument
|
Line 103... |
Line 107... |
103 |
* (if non-null)
|
107 |
* (if non-null)
|
104 |
*
|
108 |
*
|
105 |
* Returns 1 if successfull, 0 otherwise
|
109 |
* Returns 1 if successfull, 0 otherwise
|
106 |
* ---------------------------------------------------------------------- */
|
110 |
* ---------------------------------------------------------------------- */
|
107 |
int ply_get_argument_element(p_ply_argument argument,
|
111 |
int ply_get_argument_element(p_ply_argument argument,
|
108 |
p_ply_element *element, long *instance_index);
|
112 |
p_ply_element *element, int *instance_index);
|
109 |
|
113 |
|
110 |
/* ----------------------------------------------------------------------
|
114 |
/* ----------------------------------------------------------------------
|
111 |
* Returns information about the property originating a callback
|
115 |
* Returns information about the property originating a callback
|
112 |
*
|
116 |
*
|
113 |
* argument: handle to argument
|
117 |
* argument: handle to argument
|
Line 116... |
Line 120... |
116 |
* value_index: receives the index of current property value (if non-null)
|
120 |
* value_index: receives the index of current property value (if non-null)
|
117 |
*
|
121 |
*
|
118 |
* Returns 1 if successfull, 0 otherwise
|
122 |
* Returns 1 if successfull, 0 otherwise
|
119 |
* ---------------------------------------------------------------------- */
|
123 |
* ---------------------------------------------------------------------- */
|
120 |
int ply_get_argument_property(p_ply_argument argument,
|
124 |
int ply_get_argument_property(p_ply_argument argument,
|
121 |
p_ply_property *property, long *length, long *value_index);
|
125 |
p_ply_property *property, int *length, int *value_index);
|
122 |
|
126 |
|
123 |
/* ----------------------------------------------------------------------
|
127 |
/* ----------------------------------------------------------------------
|
124 |
* Returns user data associated with callback
|
128 |
* Returns user data associated with callback
|
125 |
*
|
129 |
*
|
126 |
* pdata: receives a copy of user custom data pointer (if non-null)
|
130 |
* pdata: receives a copy of user custom data pointer (if non-null)
|
127 |
* idata: receives a copy of user custom data integer (if non-null)
|
131 |
* idata: receives a copy of user custom data integer (if non-null)
|
128 |
*
|
132 |
*
|
129 |
* Returns 1 if successfull, 0 otherwise
|
133 |
* Returns 1 if successfull, 0 otherwise
|
130 |
* ---------------------------------------------------------------------- */
|
134 |
* ---------------------------------------------------------------------- */
|
131 |
int ply_get_argument_user_data(p_ply_argument argument, void **pdata,
|
135 |
int ply_get_argument_user_data(p_ply_argument argument, void **pdata,
|
132 |
long *idata);
|
136 |
int *idata);
|
133 |
|
137 |
|
134 |
/* ----------------------------------------------------------------------
|
138 |
/* ----------------------------------------------------------------------
|
135 |
* Returns the value associated with a callback
|
139 |
* Returns the value associated with a callback
|
136 |
*
|
140 |
*
|
137 |
* argument: handle to argument
|
141 |
* argument: handle to argument
|
Line 191... |
Line 195... |
191 |
* ninstances: receives the number of instances of this element (if non-null)
|
195 |
* ninstances: receives the number of instances of this element (if non-null)
|
192 |
*
|
196 |
*
|
193 |
* Returns 1 if successfull or 0 otherwise
|
197 |
* Returns 1 if successfull or 0 otherwise
|
194 |
* ---------------------------------------------------------------------- */
|
198 |
* ---------------------------------------------------------------------- */
|
195 |
int ply_get_element_info(p_ply_element element, const char** name,
|
199 |
int ply_get_element_info(p_ply_element element, const char** name,
|
196 |
long *ninstances);
|
200 |
int *ninstances);
|
197 |
|
201 |
|
198 |
/* ----------------------------------------------------------------------
|
202 |
/* ----------------------------------------------------------------------
|
199 |
* Iterates over all properties by returning the next property.
|
203 |
* Iterates over all properties by returning the next property.
|
200 |
* Call with NULL to return handle to first property.
|
204 |
* Call with NULL to return handle to first property.
|
201 |
*
|
205 |
*
|
Line 241... |
Line 245... |
241 |
* name: name of new element
|
245 |
* name: name of new element
|
242 |
* ninstances: number of element of this time in file
|
246 |
* ninstances: number of element of this time in file
|
243 |
*
|
247 |
*
|
244 |
* Returns 1 if successfull, 0 otherwise
|
248 |
* Returns 1 if successfull, 0 otherwise
|
245 |
* ---------------------------------------------------------------------- */
|
249 |
* ---------------------------------------------------------------------- */
|
246 |
int ply_add_element(p_ply ply, const char *name, long ninstances);
|
250 |
int ply_add_element(p_ply ply, const char *name, int ninstances);
|
247 |
|
251 |
|
248 |
/* ----------------------------------------------------------------------
|
252 |
/* ----------------------------------------------------------------------
|
249 |
* Adds a new property to the last element added by ply_add_element
|
253 |
* Adds a new property to the last element added by ply_add_element
|
250 |
*
|
254 |
*
|
251 |
* ply: handle returned by ply_create
|
255 |
* ply: handle returned by ply_create
|