2 Copyright (C) 2005,2006,2007,2008 Eugene K. Ressler, Jr.
4 This file is part of Sketch, a small, simple system for making
5 3d drawings with LaTeX and the PSTricks or TikZ package.
7 Sketch is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
12 Sketch is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with Sketch; see the file COPYING.txt. If not, see
19 http://www.gnu.org/copyleft */
32 typedef struct point_list_3d_t
34 DYNAMIC_2D_ARRAY_FIELDS (POINT_3D
, v
, n_pts
);
38 DECLARE_DYNAMIC_2D_ARRAY_PROTOS (POINT_LIST_3D
, POINT_3D
, FLOAT
,
39 point_list_3d
, v
, n_pts
)
40 typedef struct transform_list_t
42 DYNAMIC_2D_ARRAY_FIELDS (TRANSFORM
, xf
, n_xfs
);
46 DECLARE_DYNAMIC_2D_ARRAY_PROTOS (TRANSFORM_LIST
, TRANSFORM
, FLOAT
,
47 transform_list
, xf
, n_xfs
)
48 // object_type_str[] definition in scene.c must match!
49 typedef enum object_type_t
69 #define is_drawable(P) ((P)->tag >= O_DOTS)
71 extern char *object_type_str
[];
73 #define BASE_OBJECT_FIELDS \
74 struct object_t *sibling; \
77 typedef struct object_t
83 typedef OBJECT TAG_DEF
;
84 OBJECT
*new_tag_def (void);
86 typedef struct opts_def_t
93 OBJECT
*new_opts_def (char *opts_str
, SRC_LINE line
);
95 typedef struct scalar_def_t
102 OBJECT
*new_scalar_def (FLOAT val
);
104 typedef struct point_def_t
111 OBJECT
*new_point_def (POINT_3D p
);
113 typedef struct vector_def_t
120 OBJECT
*new_vector_def (VECTOR_3D v
);
122 typedef struct transform_def_t
129 OBJECT
*new_transform_def (TRANSFORM xf
);
131 typedef struct dots_t
135 POINT_LIST_3D pts
[1];
139 OBJECT
*new_dots (OPTS
* opts
, OBJECT
* pts
);
141 typedef struct line_object_t
145 POINT_LIST_3D pts
[1];
149 OBJECT
*new_line (OPTS
* opts
, OBJECT
* pts
);
151 typedef struct curve_t
155 POINT_LIST_3D pts
[1];
159 OBJECT
*new_curve (OPTS
* opts
, OBJECT
* pts
);
161 typedef struct polygon_t
166 POINT_LIST_3D pts
[1];
170 OBJECT
*new_polygon (OPTS
* opts
, OBJECT
* pts
);
172 typedef struct special_t
177 POINT_LIST_3D pts
[1];
181 OBJECT
*new_special (char *code
, OPTS
* opts
, OBJECT
* pts
,
184 typedef struct sweep_t
190 TRANSFORM_LIST xforms
[1];
195 OBJECT
*new_sweep (OPTS
* opts
, int n_slices
, int closed_p
, OBJECT
* xfs
,
198 typedef struct repeat_t
202 TRANSFORM_LIST xforms
[1];
207 OBJECT
*new_repeat (int n
, OBJECT
* xfs
, OBJECT
* repeated
);
209 typedef struct compound_t
217 OBJECT
*new_compound (TRANSFORM xform
, OBJECT
* child
);
219 OBJECT
*copy_drawable (OBJECT
* obj
);
220 OBJECT
*cat_objects (OBJECT
* lft
, OBJECT
* rgt
);
221 OBJECT
*sibling_reverse (OBJECT
* obj
);
222 OBJECT
*object_from_expr (EXPR_VAL
* val
);
224 OBJECT
*flat_scene (OBJECT
* obj
, GLOBAL_ENV
* env
);
225 OBJECT
*hsr_scene_with_bsp (OBJECT
* scene
);
226 OBJECT
*hsr_scene_with_depth_sort (OBJECT
* scene
);
227 void get_extent (OBJECT
* obj
, BOX_3D
* e
, int *n_obj
);
228 int xy_overlap_p (OBJECT
* obj
, BOX_3D
* e
);