1 /*
2  * Fig2dev: Translate Fig code to various Devices
3  * Copyright (c) 1985 Supoj Sutanthavibul
4  * Copyright (c) 1991 Micah Beck
5  * Parts Copyright (c) 1989-2015 by Brian V. Smith
6  * Parts Copyright (c) 2015-2019 by Thomas Loimer
7  *
8  * Any party obtaining a copy of these files is granted, free of charge, a
9  * full and unrestricted irrevocable, world-wide, paid up, royalty-free,
10  * nonexclusive right and license to deal in this software and documentation
11  * files (the "Software"), including without limitation the rights to use,
12  * copy, modify, merge, publish, distribute, sublicense and/or sell copies
13  * of the Software, and to permit persons who receive copies from any such
14  * party to do so, with the only requirement being that the above copyright
15  * and this permission notice remain intact.
16  *
17  */
18 
19 /*
20  * Changes:
21  *
22  * 2016-12-09	Thomas Loimer <thomas.loimer@tuwien.ac.at>
23  *	- Add int startclip, remove bool clip in struct _arrow_shape.
24  *
25  */
26 
27 #ifndef BOUND_H
28 #define BOUND_H
29 
30 extern void arc_bound(F_arc *arc, int *xmin, int *ymin, int *xmax, int *ymax);
31 extern void compound_bound(F_compound *compound, int *xmin, int *ymin,
32 			int *xmax, int *ymax, int include);
33 extern void ellipse_bound(F_ellipse *e, int *xmin, int *ymin,
34 			int *xmax, int *ymax);
35 extern void line_bound(F_line *l, int *xmin, int *ymin, int *xmax, int *ymax);
36 extern void spline_bound(F_spline *s, int *xmin,int *ymin,int *xmax,int *ymax);
37 extern void text_bound(F_text *t, int *xmin, int *ymin, int *xmax, int *ymax,
38 			int inc_text);
39 extern void compute_arcarrow_angle(double x1, double y1, double x2, double y2,
40 			int direction, F_arrow *arrow, int *x, int *y);
41 extern void calc_arrow(int x1, int y1, int x2, int y2, int linethick,
42 			F_arrow *arrow, F_pos points[], int *npoints,
43 			F_pos fillpoints[], int *nfillpoints, F_pos clippts[],
44 			int *nclippts);
45 
46 struct d_pos {
47 	double x, y;
48 };
49 
50 extern struct _arrow_shape {
51 	int	numpts;		/* number of points in arrowhead */
52 	int	tipno;		/* which point contains the tip */
53 	int	numfillpts;	/* number of points to fill */
54 	int	startclip;	/* point at which clip region starts */
55 	bool	simplefill;	/* if true, use points array to fill otherwise
56 				   use fill_points array */
57 	bool	half;		/* if true, arrowhead is half-wide and must be
58 				   shifted to cover the line */
59 	double	tipmv;		/* acuteness of tip (smaller angle, larger tipmv) */
60 	struct	d_pos points[6]; /* points in arrowhead */
61 	struct	d_pos fillpoints[6]; /* points to fill if not "simple" */
62 } arrow_shapes[];
63 
64 #endif /* BOUND_H */
65