00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef __PLY_H__
00034 #define __PLY_H__
00035
00036 #ifdef __cplusplus
00037 extern "C" {
00038 #endif
00039
00040 #include <stdio.h>
00041 #include <stddef.h>
00042
00043 #define PLY_ASCII 1
00044 #define PLY_BINARY_BE 2
00045 #define PLY_BINARY_LE 3
00046
00047 #define PLY_OKAY 0
00048 #define PLY_ERROR -1
00049
00050
00051
00052 #define PLY_START_TYPE 0
00053 #define PLY_CHAR 1
00054 #define PLY_SHORT 2
00055 #define PLY_INT 3
00056 #define PLY_UCHAR 4
00057 #define PLY_USHORT 5
00058 #define PLY_UINT 6
00059 #define PLY_FLOAT 7
00060 #define PLY_DOUBLE 8
00061 #define PLY_END_TYPE 9
00062
00063 #define PLY_SCALAR 0
00064 #define PLY_LIST 1
00065
00066 typedef struct PlyProperty {
00067
00068 char *name;
00069 int external_type;
00070 int internal_type;
00071 int offset;
00072
00073 int is_list;
00074 int count_external;
00075 int count_internal;
00076 int count_offset;
00077
00078 } PlyProperty;
00079
00080 typedef struct PlyElement {
00081 char *name;
00082 int num;
00083 int size;
00084 int nprops;
00085 PlyProperty **props;
00086 char *store_prop;
00087 int other_offset;
00088 int other_size;
00089 } PlyElement;
00090
00091 typedef struct PlyOtherProp {
00092 char *name;
00093 int size;
00094 int nprops;
00095 PlyProperty **props;
00096 } PlyOtherProp;
00097
00098 typedef struct OtherData {
00099 void *other_props;
00100 } OtherData;
00101
00102 typedef struct OtherElem {
00103 char *elem_name;
00104 int elem_count;
00105 OtherData **other_data;
00106 PlyOtherProp *other_props;
00107 } OtherElem;
00108
00109 typedef struct PlyOtherElems {
00110 int num_elems;
00111 OtherElem *other_list;
00112 } PlyOtherElems;
00113
00114 typedef struct PlyFile {
00115 FILE *fp;
00116 int file_type;
00117 float version;
00118 int nelems;
00119 PlyElement **elems;
00120 int num_comments;
00121 char **comments;
00122 int num_obj_info;
00123 char **obj_info;
00124 PlyElement *which_elem;
00125 PlyOtherElems *other_elems;
00126 } PlyFile;
00127
00128
00129 extern char *my_alloc();
00130 #define myalloc(mem_size) my_alloc((mem_size), __LINE__, __FILE__)
00131
00132
00133
00134
00135 extern PlyFile *ply_write(FILE *, int, char **, int);
00136 extern PlyFile *ply_open_for_writing(char *, int, char **, int, float *);
00137 extern void ply_describe_element(PlyFile *, char *, int, int, PlyProperty *);
00138 extern void ply_describe_property(PlyFile *, char *, PlyProperty *);
00139 extern void ply_element_count(PlyFile *, char *, int);
00140 extern void ply_header_complete(PlyFile *);
00141 extern void ply_put_element_setup(PlyFile *, char *);
00142 extern void ply_put_element(PlyFile *, void *);
00143 extern void ply_put_comment(PlyFile *, char *);
00144 extern void ply_put_obj_info(PlyFile *, char *);
00145 extern PlyFile *ply_read(FILE *, int *, char ***);
00146 extern PlyFile *ply_open_for_reading(const char *, int *, char ***, int *, float *);
00147 extern PlyProperty **ply_get_element_description(PlyFile *, char *, int*, int*);
00148 extern void ply_get_element_setup( PlyFile *, char *, int, PlyProperty *);
00149 extern void ply_get_property(PlyFile *, char *, PlyProperty *);
00150 extern PlyOtherProp *ply_get_other_properties(PlyFile *, char *, int);
00151 extern void ply_get_element(PlyFile *, void *);
00152 extern char **ply_get_comments(PlyFile *, int *);
00153 extern char **ply_get_obj_info(PlyFile *, int *);
00154 extern void ply_close(PlyFile *);
00155 extern void ply_get_info(PlyFile *, float *, int *);
00156 extern PlyOtherElems *ply_get_other_element (PlyFile *, char *, int);
00157 extern void ply_describe_other_elements ( PlyFile *, PlyOtherElems *);
00158 extern void ply_put_other_elements (PlyFile *);
00159 extern void ply_free_other_elements (PlyOtherElems *);
00160
00161 extern int equal_strings(char *, char *);
00162
00163 #ifdef __cplusplus
00164 }
00165 #endif
00166
00167
00168
00169 #endif
00170