Skip to content

Commit b14367f

Browse files
committed
Include generated ctlgeom-types.h and geom-ctl-io.c
These files are normally auto-generated from geom.scm via gen-ctl-io (requires Guile). Including them allows building libctlgeom without Guile, which is the common case for meep's Python-only builds.
1 parent 27d23f0 commit b14367f

2 files changed

Lines changed: 865 additions & 0 deletions

File tree

utils/ctlgeom-types.h

Lines changed: 209 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
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, MESH
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+
struct mesh_struct *mesh_data;
28+
} subclass;
29+
} geometric_object;
30+
31+
typedef struct {
32+
int num_items;
33+
geometric_object *items;
34+
} geometric_object_list;
35+
36+
typedef struct compound_geometric_object_struct {
37+
geometric_object_list component_objects;
38+
} compound_geometric_object;
39+
40+
typedef struct cylinder_struct {
41+
vector3 axis;
42+
number radius;
43+
number height;
44+
enum {
45+
CYLINDER_SELF, WEDGE, CONE
46+
} which_subclass;
47+
union {
48+
struct wedge_struct *wedge_data;
49+
struct cone_struct *cone_data;
50+
} subclass;
51+
} cylinder;
52+
53+
typedef struct cone_struct {
54+
number radius2;
55+
} cone;
56+
57+
typedef struct wedge_struct {
58+
number wedge_angle;
59+
vector3 wedge_start;
60+
vector3 e1;
61+
vector3 e2;
62+
} wedge;
63+
64+
typedef struct sphere_struct {
65+
number radius;
66+
} sphere;
67+
68+
typedef struct block_struct {
69+
vector3 e1;
70+
vector3 e2;
71+
vector3 e3;
72+
vector3 size;
73+
matrix3x3 projection_matrix;
74+
enum {
75+
BLOCK_SELF, ELLIPSOID
76+
} which_subclass;
77+
union {
78+
struct ellipsoid_struct *ellipsoid_data;
79+
} subclass;
80+
} block;
81+
82+
typedef struct {
83+
int num_items;
84+
vector3 *items;
85+
} vector3_list;
86+
87+
typedef struct {
88+
int num_items;
89+
number *items;
90+
} number_list;
91+
92+
typedef struct prism_struct {
93+
vector3_list vertices;
94+
number height;
95+
vector3 axis;
96+
number sidewall_angle;
97+
vector3_list vertices_p;
98+
vector3_list top_polygon_diff_vectors_p;
99+
vector3_list top_polygon_diff_vectors_scaled_p;
100+
vector3_list vertices_top_p;
101+
vector3_list vertices_top;
102+
vector3 centroid;
103+
number_list workspace;
104+
matrix3x3 m_c2p;
105+
matrix3x3 m_p2c;
106+
} prism;
107+
108+
typedef struct mesh_bvh_node {
109+
vector3 bbox_low;
110+
vector3 bbox_high;
111+
int left_child;
112+
int right_child;
113+
int face_start;
114+
int face_count;
115+
} mesh_bvh_node;
116+
117+
typedef struct mesh_struct {
118+
vector3_list vertices;
119+
int num_faces;
120+
int *face_indices;
121+
vector3 *face_normals;
122+
number *face_areas;
123+
int num_bvh_nodes;
124+
mesh_bvh_node *bvh;
125+
int *bvh_face_ids;
126+
boolean is_closed;
127+
vector3 centroid;
128+
} mesh;
129+
130+
typedef struct ellipsoid_struct {
131+
vector3 inverse_semi_axes;
132+
} ellipsoid;
133+
134+
typedef struct lattice_struct {
135+
vector3 basis1;
136+
vector3 basis2;
137+
vector3 basis3;
138+
vector3 size;
139+
vector3 basis_size;
140+
vector3 b1;
141+
vector3 b2;
142+
vector3 b3;
143+
matrix3x3 basis;
144+
matrix3x3 metric;
145+
} lattice;
146+
147+
/******* Input variables *******/
148+
extern integer dimensions;
149+
extern void* default_material;
150+
extern vector3 geometry_center;
151+
extern lattice geometry_lattice;
152+
extern geometric_object_list geometry;
153+
extern boolean ensure_periodicity;
154+
155+
/******* Output variables *******/
156+
157+
/******* class copy function prototypes *******/
158+
159+
extern void lattice_copy(const lattice * o0, lattice * o);
160+
extern void ellipsoid_copy(const ellipsoid * o0, ellipsoid * o);
161+
extern void mesh_copy(const mesh * o0, mesh * o);
162+
extern void prism_copy(const prism * o0, prism * o);
163+
extern void block_copy(const block * o0, block * o);
164+
extern void sphere_copy(const sphere * o0, sphere * o);
165+
extern void wedge_copy(const wedge * o0, wedge * o);
166+
extern void cone_copy(const cone * o0, cone * o);
167+
extern void cylinder_copy(const cylinder * o0, cylinder * o);
168+
extern void compound_geometric_object_copy(const compound_geometric_object * o0, compound_geometric_object * o);
169+
extern void geometric_object_copy(const geometric_object * o0, geometric_object * o);
170+
171+
/******* class equal function prototypes *******/
172+
173+
extern boolean lattice_equal(const lattice * o0, const lattice * o);
174+
extern boolean ellipsoid_equal(const ellipsoid * o0, const ellipsoid * o);
175+
extern boolean mesh_equal(const mesh * o0, const mesh * o);
176+
extern boolean prism_equal(const prism * o0, const prism * o);
177+
extern boolean block_equal(const block * o0, const block * o);
178+
extern boolean sphere_equal(const sphere * o0, const sphere * o);
179+
extern boolean wedge_equal(const wedge * o0, const wedge * o);
180+
extern boolean cone_equal(const cone * o0, const cone * o);
181+
extern boolean cylinder_equal(const cylinder * o0, const cylinder * o);
182+
extern boolean compound_geometric_object_equal(const compound_geometric_object * o0, const compound_geometric_object * o);
183+
extern boolean geometric_object_equal(const geometric_object * o0, const geometric_object * o);
184+
185+
/******* class destruction function prototypes *******/
186+
187+
extern void lattice_destroy(lattice o);
188+
extern void ellipsoid_destroy(ellipsoid o);
189+
extern void mesh_destroy(mesh o);
190+
extern void prism_destroy(prism o);
191+
extern void block_destroy(block o);
192+
extern void sphere_destroy(sphere o);
193+
extern void wedge_destroy(wedge o);
194+
extern void cone_destroy(cone o);
195+
extern void cylinder_destroy(cylinder o);
196+
extern void compound_geometric_object_destroy(compound_geometric_object o);
197+
extern void geometric_object_destroy(geometric_object o);
198+
199+
200+
#ifdef __cplusplus
201+
} /* extern "C" */
202+
#endif /* __cplusplus */
203+
204+
#endif /* CTL_IO_H */
205+
#ifndef LIBCTL_MAJOR_VERSION
206+
# define LIBCTL_MAJOR_VERSION 4
207+
# define LIBCTL_MINOR_VERSION 5
208+
# define LIBCTL_BUGFIX_VERSION 1
209+
#endif

0 commit comments

Comments
 (0)