1 /* THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT MODIFY! */ 2 /* generated from the file: ./geom.scm */ 3 4 #ifndef CTL_IO_H 5 #define CTL_IO_H 6 7 #include <ctl-math.h> 8 9 #ifdef __cplusplus 10 extern "C" { 11 #endif /* __cplusplus */ 12 13 /******* Type declarations *******/ 14 15 typedef struct geometric_object_struct { 16 void* material; 17 vector3 center; 18 enum { 19 GEOMETRIC_OBJECT_SELF, PRISM, BLOCK, SPHERE, CYLINDER, COMPOUND_GEOMETRIC_OBJECT 20 } which_subclass; 21 union { 22 struct prism_struct *prism_data; 23 struct block_struct *block_data; 24 struct sphere_struct *sphere_data; 25 struct cylinder_struct *cylinder_data; 26 struct compound_geometric_object_struct *compound_geometric_object_data; 27 } subclass; 28 } geometric_object; 29 30 typedef struct { 31 int num_items; 32 geometric_object *items; 33 } geometric_object_list; 34 35 typedef struct compound_geometric_object_struct { 36 geometric_object_list component_objects; 37 } compound_geometric_object; 38 39 typedef struct cylinder_struct { 40 vector3 axis; 41 number radius; 42 number height; 43 enum { 44 CYLINDER_SELF, WEDGE, CONE 45 } which_subclass; 46 union { 47 struct wedge_struct *wedge_data; 48 struct cone_struct *cone_data; 49 } subclass; 50 } cylinder; 51 52 typedef struct cone_struct { 53 number radius2; 54 } cone; 55 56 typedef struct wedge_struct { 57 number wedge_angle; 58 vector3 wedge_start; 59 vector3 e1; 60 vector3 e2; 61 } wedge; 62 63 typedef struct sphere_struct { 64 number radius; 65 } sphere; 66 67 typedef struct block_struct { 68 vector3 e1; 69 vector3 e2; 70 vector3 e3; 71 vector3 size; 72 matrix3x3 projection_matrix; 73 enum { 74 BLOCK_SELF, ELLIPSOID 75 } which_subclass; 76 union { 77 struct ellipsoid_struct *ellipsoid_data; 78 } subclass; 79 } block; 80 81 typedef struct { 82 int num_items; 83 vector3 *items; 84 } vector3_list; 85 86 typedef struct { 87 int num_items; 88 number *items; 89 } number_list; 90 91 typedef struct prism_struct { 92 vector3_list vertices; 93 number height; 94 vector3 axis; 95 number sidewall_angle; 96 vector3_list vertices_p; 97 vector3_list top_polygon_diff_vectors_p; 98 vector3_list top_polygon_diff_vectors_scaled_p; 99 vector3_list vertices_top_p; 100 vector3_list vertices_top; 101 vector3 centroid; 102 number_list workspace; 103 matrix3x3 m_c2p; 104 matrix3x3 m_p2c; 105 } prism; 106 107 typedef struct ellipsoid_struct { 108 vector3 inverse_semi_axes; 109 } ellipsoid; 110 111 typedef struct lattice_struct { 112 vector3 basis1; 113 vector3 basis2; 114 vector3 basis3; 115 vector3 size; 116 vector3 basis_size; 117 vector3 b1; 118 vector3 b2; 119 vector3 b3; 120 matrix3x3 basis; 121 matrix3x3 metric; 122 } lattice; 123 124 /******* Input variables *******/ 125 extern integer dimensions; 126 extern void* default_material; 127 extern vector3 geometry_center; 128 extern lattice geometry_lattice; 129 extern geometric_object_list geometry; 130 extern boolean ensure_periodicity; 131 132 /******* Output variables *******/ 133 134 /******* class copy function prototypes *******/ 135 136 extern void lattice_copy(const lattice * o0, lattice * o); 137 extern void ellipsoid_copy(const ellipsoid * o0, ellipsoid * o); 138 extern void prism_copy(const prism * o0, prism * o); 139 extern void block_copy(const block * o0, block * o); 140 extern void sphere_copy(const sphere * o0, sphere * o); 141 extern void wedge_copy(const wedge * o0, wedge * o); 142 extern void cone_copy(const cone * o0, cone * o); 143 extern void cylinder_copy(const cylinder * o0, cylinder * o); 144 extern void compound_geometric_object_copy(const compound_geometric_object * o0, compound_geometric_object * o); 145 extern void geometric_object_copy(const geometric_object * o0, geometric_object * o); 146 147 /******* class equal function prototypes *******/ 148 149 extern boolean lattice_equal(const lattice * o0, const lattice * o); 150 extern boolean ellipsoid_equal(const ellipsoid * o0, const ellipsoid * o); 151 extern boolean prism_equal(const prism * o0, const prism * o); 152 extern boolean block_equal(const block * o0, const block * o); 153 extern boolean sphere_equal(const sphere * o0, const sphere * o); 154 extern boolean wedge_equal(const wedge * o0, const wedge * o); 155 extern boolean cone_equal(const cone * o0, const cone * o); 156 extern boolean cylinder_equal(const cylinder * o0, const cylinder * o); 157 extern boolean compound_geometric_object_equal(const compound_geometric_object * o0, const compound_geometric_object * o); 158 extern boolean geometric_object_equal(const geometric_object * o0, const geometric_object * o); 159 160 /******* class destruction function prototypes *******/ 161 162 extern void lattice_destroy(lattice o); 163 extern void ellipsoid_destroy(ellipsoid o); 164 extern void prism_destroy(prism o); 165 extern void block_destroy(block o); 166 extern void sphere_destroy(sphere o); 167 extern void wedge_destroy(wedge o); 168 extern void cone_destroy(cone o); 169 extern void cylinder_destroy(cylinder o); 170 extern void compound_geometric_object_destroy(compound_geometric_object o); 171 extern void geometric_object_destroy(geometric_object o); 172 173 174 #ifdef __cplusplus 175 } /* extern "C" */ 176 #endif /* __cplusplus */ 177 178 #endif /* CTL_IO_H */ 179 #ifndef LIBCTL_MAJOR_VERSION 180 # define LIBCTL_MAJOR_VERSION 4 181 # define LIBCTL_MINOR_VERSION 5 182 # define LIBCTL_BUGFIX_VERSION 0 183 #endif 184