source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/vrippack-0.31/src/libply/ply_docs @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 6.8 KB
Line 
1/*************/
2/*  Writing  */
3/*************/
4
5
6/******************************************************************************
7Open a polygon file for writing.
8
9Entry:
10  filename   - name of file to read from
11  nelems     - number of elements in object
12  elem_names - list of element names
13  file_type  - file type, either ascii or binary
14
15Exit:
16  version - version number of PLY file
17  returns a file identifier, used to refer to this file, or NULL if error
18******************************************************************************/
19
20PlyFile *ply_open_for_writing(
21  char *filename,
22  int nelems,
23  char **elem_names,
24  int file_type,
25  float *version
26)
27
28/******************************************************************************
29Describe an element, including its properties and how many will be written
30to the file.
31
32Entry:
33  plyfile   - file identifier
34  elem_name - name of element that information is being specified about
35  nelems    - number of elements of this type to be written
36  nprops    - number of properties contained in the element
37  prop_list - list of properties
38******************************************************************************/
39
40void ply_describe_element(
41  PlyFile *plyfile,
42  char *elem_name,
43  int nelems,
44  int nprops,
45  PlyProperty *prop_list
46)
47
48/******************************************************************************
49Signal that we've described everything a PLY file's header and that the
50header should be written to the file.
51
52Entry:
53  plyfile - file identifier
54******************************************************************************/
55
56void ply_header_complete(PlyFile *plyfile)
57
58/******************************************************************************
59Specify which elements are going to be written.  This should be called
60before a call to the routine ply_put_elements().
61
62Entry:
63  plyfile   - file identifier
64  elem_name - name of element we're talking about
65******************************************************************************/
66
67void ply_put_elements_setup(PlyFile *plyfile, char *elem_name)
68
69/******************************************************************************
70Write an element to the file.  This routine assumes that we're
71writing the type of element specified in the last call to the routine
72ply_put_element_setup().
73
74Entry:
75  plyfile  - file identifier
76  elem_ptr - pointer to the element
77******************************************************************************/
78
79void ply_put_element(PlyFile *plyfile, void *elem_ptr)
80
81/******************************************************************************
82Specify a comment that will be written in the header.
83
84Entry:
85  plyfile - file identifier
86  comment - the comment to be written
87******************************************************************************/
88
89void ply_put_comment(PlyFile *plyfile, char *comment)
90
91/******************************************************************************
92Specify a piece of object information (arbitrary text) that will be written
93in the header.
94
95Entry:
96  plyfile  - file identifier
97  obj_info - the text information to be written
98******************************************************************************/
99
100void ply_put_obj_info(PlyFile *plyfile, char *obj_info)
101
102
103
104
105/*************/
106/*  Reading  */
107/*************/
108
109
110
111/******************************************************************************
112Open a polygon file for reading.
113
114Entry:
115  filename - name of file to read from
116
117Exit:
118  nelems     - number of elements in object
119  elem_names - list of element names
120  file_type  - file type, either ascii or binary
121  version    - version number of PLY file
122  returns a file identifier, used to refer to this file, or NULL if error
123******************************************************************************/
124
125PlyFile *ply_open_for_reading(
126  char *filename,
127  int *nelems,
128  char ***elem_names,
129  int *file_type,
130  float *version
131)
132
133/******************************************************************************
134Get information about a particular element.
135
136Entry:
137  plyfile   - file identifier
138  elem_name - name of element to get information about
139
140Exit:
141  nelems   - number of elements of this type in the file
142  nprops   - number of properties
143  returns a list of properties
144******************************************************************************/
145
146PlyProperty **ply_get_element_description(
147  PlyFile *plyfile,
148  char *elem_name,
149  int *nelems,
150  int *nprops
151)
152
153/******************************************************************************
154Specify which properties of an element are to be returned.  This should be
155called before a call to the routine ply_get_elements().
156
157Entry:
158  plyfile   - file identifier
159  elem_name - which element we're talking about
160  nprops    - number of properties
161  prop_list - list of properties
162******************************************************************************/
163
164void ply_get_element_setup(
165  PlyFile *plyfile,
166  char *elem_name,
167  int nprops,
168  PlyProperty *prop_list
169)
170
171/******************************************************************************
172Read one element from the file.  This routine assumes that we're reading
173the type of element specified in the last call to the routine
174ply_get_element_setup().
175
176Entry:
177  plyfile  - file identifier
178  elem_ptr - pointer to location where the element information should be put
179******************************************************************************/
180
181ply_get_element(PlyFile *plyfile, void *elem_ptr)
182
183/******************************************************************************
184Extract the comments from the header information of a PLY file.
185
186Entry:
187  plyfile - file identifier
188
189Exit:
190  num_comments - number of comments returned
191  returns a pointer to a list of comments
192******************************************************************************/
193
194char **ply_get_comments(PlyFile *plyfile, int *num_comments)
195
196/******************************************************************************
197Extract the object information (arbitrary text) from the header information
198of a PLY file.
199
200Entry:
201  plyfile - file identifier
202
203Exit:
204  num_obj_info - number of lines of text information returned
205  returns a pointer to a list of object info lines
206******************************************************************************/
207
208char **ply_get_obj_info(PlyFile *plyfile, int *num_obj_info)
209
210
211
212/*******************/
213/*  Miscellaneous  */
214/*******************/
215
216
217
218/******************************************************************************
219Close a PLY file.
220
221Entry:
222  plyfile - identifier of file to close
223******************************************************************************/
224
225void ply_close(PlyFile *plyfile)
226
227/******************************************************************************
228Compare two strings.  Returns 1 if they are the same, 0 if not.
229******************************************************************************/
230
231int equal_strings(char *s1, char *s2)
232
Note: See TracBrowser for help on using the repository browser.