Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
ply.h File Reference
#include <stdlib.h>
#include <stdio.h>
#include <stddef.h>
#include <string.h>
#include <math.h>
+ Include dependency graph for ply.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  igl::ply::PlyProperty
 
struct  igl::ply::PlyElement
 
struct  igl::ply::PlyOtherProp
 
struct  igl::ply::OtherData
 
struct  igl::ply::OtherElem
 
struct  igl::ply::PlyOtherElems
 
struct  igl::ply::PlyFile
 

Namespaces

namespace  igl
 
namespace  igl::ply
 

Macros

#define __PLY_H__
 
#define PLY_ASCII   1 /* ascii PLY file */
 
#define PLY_BINARY_BE   2 /* binary PLY file, big endian */
 
#define PLY_BINARY_LE   3 /* binary PLY file, little endian */
 
#define PLY_BINARY_NATIVE
 
#define PLY_OKAY   0 /* ply routine worked okay */
 
#define PLY_ERROR   -1 /* error in ply routine */
 
#define PLY_START_TYPE   0
 
#define PLY_CHAR   1
 
#define PLY_SHORT   2
 
#define PLY_INT   3
 
#define PLY_UCHAR   4
 
#define PLY_USHORT   5
 
#define PLY_UINT   6
 
#define PLY_FLOAT   7
 
#define PLY_DOUBLE   8
 
#define PLY_END_TYPE   9
 
#define PLY_SCALAR   0
 
#define PLY_LIST   1
 
#define myalloc(mem_size)   my_alloc((mem_size), __LINE__, __FILE__)
 
#define REALLOCN(PTR, TYPE, OLD_N, NEW_N)
 
#define ALLOCN(PTR, TYPE, N)
 
#define FREE(PTR)   { free((PTR)); (PTR) = NULL; }
 
#define NO_OTHER_PROPS   -1
 
#define DONT_STORE_PROP   0
 
#define STORE_PROP   1
 
#define OTHER_PROP   0
 
#define NAMED_PROP   1
 
#define BIG_STRING   4096
 

Typedefs

typedef struct igl::ply::PlyProperty igl::ply::PlyProperty
 
typedef struct igl::ply::PlyElement igl::ply::PlyElement
 
typedef struct igl::ply::PlyOtherProp igl::ply::PlyOtherProp
 
typedef struct igl::ply::OtherData igl::ply::OtherData
 
typedef struct igl::ply::OtherElem igl::ply::OtherElem
 
typedef struct igl::ply::PlyOtherElems igl::ply::PlyOtherElems
 
typedef struct igl::ply::PlyFile igl::ply::PlyFile
 

Functions

char * igl::ply::my_alloc ()
 
int igl::ply::get_native_binary_type2 ()
 
PlyFileigl::ply::ply_write (FILE *, int, const char **, int)
 
PlyFileigl::ply::ply_open_for_writing (char *, int, const char **, int, float *)
 
void igl::ply::ply_describe_element (PlyFile *, const char *, int, int, PlyProperty *)
 
void igl::ply::ply_describe_property (PlyFile *, const char *, PlyProperty *)
 
void igl::ply::ply_element_count (PlyFile *, const char *, int)
 
void igl::ply::ply_header_complete (PlyFile *)
 
void igl::ply::ply_put_element_setup (PlyFile *, const char *)
 
void igl::ply::ply_put_element (PlyFile *, void *, int *)
 
void igl::ply::ply_put_comment (PlyFile *, char *)
 
void igl::ply::ply_put_obj_info (PlyFile *, char *)
 
PlyFileigl::ply::ply_read (FILE *, int *, char ***)
 
PlyFileigl::ply::ply_open_for_reading (const char *, int *, char ***, int *, float *)
 
PlyProperty ** igl::ply::ply_get_element_description (PlyFile *, const char *, int *, int *)
 
void igl::ply::ply_get_element_setup (PlyFile *, const char *, int, PlyProperty *)
 
void igl::ply::ply_get_property (PlyFile *, const char *, PlyProperty *)
 
PlyOtherPropigl::ply::ply_get_other_properties (PlyFile *, const char *, int)
 
void igl::ply::ply_get_element (PlyFile *, void *, int *)
 
char ** igl::ply::ply_get_comments (PlyFile *, int *)
 
char ** igl::ply::ply_get_obj_info (PlyFile *, int *)
 
void igl::ply::ply_close (PlyFile *)
 
void igl::ply::ply_get_info (PlyFile *, float *, int *)
 
PlyOtherElemsigl::ply::ply_get_other_element (PlyFile *, const char *, int)
 
void igl::ply::ply_describe_other_elements (PlyFile *, PlyOtherElems *)
 
void igl::ply::ply_put_other_elements (PlyFile *)
 
void igl::ply::ply_free_other_elements (PlyOtherElems *)
 
void igl::ply::ply_describe_other_properties (PlyFile *, PlyOtherProp *, int)
 
int igl::ply::equal_strings (const char *, const char *)
 
PlyElementigl::ply::find_element (PlyFile *, const char *)
 
PlyPropertyigl::ply::find_property (PlyElement *, const char *, int *)
 
void igl::ply::write_scalar_type (FILE *, int)
 
char ** igl::ply::get_words (FILE *, int *, char **)
 
char ** igl::ply::old_get_words (FILE *, int *)
 
void igl::ply::write_binary_item (FILE *, int, int, unsigned int, double, int, int *)
 
void igl::ply::write_ascii_item (FILE *, int, unsigned int, double, int)
 
double igl::ply::old_write_ascii_item (FILE *, char *, int)
 
void igl::ply::add_element (PlyFile *, char **)
 
void igl::ply::add_property (PlyFile *, char **)
 
void igl::ply::add_comment (PlyFile *, char *)
 
void igl::ply::add_obj_info (PlyFile *, char *)
 
void igl::ply::copy_property (PlyProperty *, PlyProperty *)
 
void igl::ply::store_item (char *, int, int, unsigned int, double)
 
void igl::ply::get_stored_item (void *, int, int *, unsigned int *, double *)
 
double igl::ply::get_item_value (char *, int)
 
void igl::ply::get_ascii_item (char *, int, int *, unsigned int *, double *)
 
void igl::ply::get_binary_item (FILE *, int, int, int *, unsigned int *, double *, int *)
 
void igl::ply::ascii_get_element (PlyFile *, char *)
 
void igl::ply::binary_get_element (PlyFile *, char *, int *)
 
char * igl::ply::my_alloc (int, int, const char *)
 
void igl::ply::get_native_binary_type (int *)
 
void igl::ply::swap_bytes (char *, int)
 
int igl::ply::check_types ()
 
PlyFileigl::ply::ply_open_for_writing (const char *filename, int nelems, const char **elem_names, int file_type, float *version)
 
PlyFileigl::ply::ply_open_for_reading (char *filename, int *nelems, char ***elem_names, int *file_type, float *version)
 
void igl::ply::setup_other_props (PlyElement *elem)
 
PlyOtherElemsigl::ply::ply_get_other_element (PlyFile *plyfile, char *elem_name, int elem_count)
 
void igl::ply::ply_put_other_elements (PlyFile *plyfile, int *native_binary_type)
 
int igl::ply::get_prop_type (char *type_name)
 

Class Documentation

◆ igl::ply::PlyProperty

struct igl::ply::PlyProperty
Class Members
int count_external
int count_internal
int count_offset
int external_type
int internal_type
int is_list
const char * name
int offset

◆ igl::ply::PlyElement

struct igl::ply::PlyElement
+ Collaboration diagram for igl::ply::PlyElement:
Class Members
const char * name
int nprops
int num
int other_offset
int other_size
PlyProperty ** props
int size
char * store_prop

◆ igl::ply::PlyOtherProp

struct igl::ply::PlyOtherProp
+ Collaboration diagram for igl::ply::PlyOtherProp:
Class Members
const char * name
int nprops
PlyProperty ** props
int size

◆ igl::ply::OtherData

struct igl::ply::OtherData
Class Members
void * other_props

◆ igl::ply::OtherElem

struct igl::ply::OtherElem
+ Collaboration diagram for igl::ply::OtherElem:
Class Members
int elem_count
char * elem_name
OtherData ** other_data
PlyOtherProp * other_props

◆ igl::ply::PlyOtherElems

struct igl::ply::PlyOtherElems
+ Collaboration diagram for igl::ply::PlyOtherElems:
Class Members
int num_elems
OtherElem * other_list

◆ igl::ply::PlyFile

struct igl::ply::PlyFile
+ Collaboration diagram for igl::ply::PlyFile:
Class Members
char ** comments
PlyElement ** elems
int file_type
FILE * fp
int nelems
int num_comments
int num_obj_info
char ** obj_info
PlyOtherElems * other_elems
float version
PlyElement * which_elem

Macro Definition Documentation

◆ __PLY_H__

#define __PLY_H__

◆ ALLOCN

#define ALLOCN (   PTR,
  TYPE,
 
)
Value:
{ (PTR) = (TYPE *) calloc(((unsigned)(N)),sizeof(TYPE));\
if ((PTR) == NULL) { \
fprintf(stderr, "Memory allocation failed on line %d in %s\n", \
__LINE__, __FILE__); \
exit(-1); \
} \
}

◆ BIG_STRING

#define BIG_STRING   4096

◆ DONT_STORE_PROP

#define DONT_STORE_PROP   0

◆ FREE

#define FREE (   PTR)    { free((PTR)); (PTR) = NULL; }

◆ myalloc

#define myalloc (   mem_size)    my_alloc((mem_size), __LINE__, __FILE__)

◆ NAMED_PROP

#define NAMED_PROP   1

◆ NO_OTHER_PROPS

#define NO_OTHER_PROPS   -1

◆ OTHER_PROP

#define OTHER_PROP   0

◆ PLY_ASCII

#define PLY_ASCII   1 /* ascii PLY file */

◆ PLY_BINARY_BE

#define PLY_BINARY_BE   2 /* binary PLY file, big endian */

◆ PLY_BINARY_LE

#define PLY_BINARY_LE   3 /* binary PLY file, little endian */

◆ PLY_BINARY_NATIVE

#define PLY_BINARY_NATIVE
Value:
4 /* binary PLY file, same endianness as
current architecture */

◆ PLY_CHAR

#define PLY_CHAR   1

◆ PLY_DOUBLE

#define PLY_DOUBLE   8

◆ PLY_END_TYPE

#define PLY_END_TYPE   9

◆ PLY_ERROR

#define PLY_ERROR   -1 /* error in ply routine */

◆ PLY_FLOAT

#define PLY_FLOAT   7

◆ PLY_INT

#define PLY_INT   3

◆ PLY_LIST

#define PLY_LIST   1

◆ PLY_OKAY

#define PLY_OKAY   0 /* ply routine worked okay */

◆ PLY_SCALAR

#define PLY_SCALAR   0

◆ PLY_SHORT

#define PLY_SHORT   2

◆ PLY_START_TYPE

#define PLY_START_TYPE   0

◆ PLY_UCHAR

#define PLY_UCHAR   4

◆ PLY_UINT

#define PLY_UINT   6

◆ PLY_USHORT

#define PLY_USHORT   5

◆ REALLOCN

#define REALLOCN (   PTR,
  TYPE,
  OLD_N,
  NEW_N 
)
Value:
{ \
if ((OLD_N) == 0) \
{ ALLOCN((PTR),TYPE,(NEW_N));} \
else \
{ \
(PTR) = (TYPE *)realloc((PTR),(NEW_N)*sizeof(TYPE)); \
if (((PTR) == NULL) && ((NEW_N) != 0)) \
{ \
fprintf(stderr, "Memory reallocation failed on line %d in %s\n", \
__LINE__, __FILE__); \
fprintf(stderr, " tried to reallocate %d->%d\n", \
(OLD_N), (NEW_N)); \
exit(-1); \
} \
if ((NEW_N)>(OLD_N)) \
memset((char *)(PTR)+(OLD_N)*sizeof(TYPE), 0, \
((NEW_N)-(OLD_N))*sizeof(TYPE)); \
} \
}
#define ALLOCN(PTR, TYPE, N)
Definition ply.h:200

◆ STORE_PROP

#define STORE_PROP   1