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