aboutsummaryrefslogtreecommitdiff
path: root/generic/Geo.c
diff options
context:
space:
mode:
authorlecoanet2000-02-02 14:01:15 +0000
committerlecoanet2000-02-02 14:01:15 +0000
commit64089dca388f5a9a8235a94b4372763875132219 (patch)
tree0455fa06d471a568cbece8fc27cde0216d4def23 /generic/Geo.c
parent2b91521b4c124546e59638f2e990dcbc75903d85 (diff)
downloadtkzinc-64089dca388f5a9a8235a94b4372763875132219.zip
tkzinc-64089dca388f5a9a8235a94b4372763875132219.tar.gz
tkzinc-64089dca388f5a9a8235a94b4372763875132219.tar.bz2
tkzinc-64089dca388f5a9a8235a94b4372763875132219.tar.xz
Passage en Zinc
Diffstat (limited to 'generic/Geo.c')
-rw-r--r--generic/Geo.c432
1 files changed, 216 insertions, 216 deletions
diff --git a/generic/Geo.c b/generic/Geo.c
index c2d569d..16cee3e 100644
--- a/generic/Geo.c
+++ b/generic/Geo.c
@@ -46,45 +46,45 @@ static const char compile_id[]="$Compile: " __FILE__ " " __DATE__ " " __TIME__ "
* by position, anchor, width and height.
*/
void
-Anchor2Origin(RadarPoint *position,
- RadarDim width,
- RadarDim height,
- RadarAnchor anchor,
- RadarPoint *origin)
+Anchor2Origin(ZnPoint *position,
+ ZnDim width,
+ ZnDim height,
+ ZnAnchor anchor,
+ ZnPoint *origin)
{
switch (anchor) {
- case RadarAnchorCenter:
+ case ZnAnchorCenter:
origin->x = position->x - width/2;
origin->y = position->y - height/2;
break;
- case RadarAnchorNW:
+ case ZnAnchorNW:
*origin = *position;
break;
- case RadarAnchorN:
+ case ZnAnchorN:
origin->x = position->x - width/2;
origin->y = position->y;
break;
- case RadarAnchorNE:
+ case ZnAnchorNE:
origin->x = position->x - width;
origin->y = position->y;
break;
- case RadarAnchorE:
+ case ZnAnchorE:
origin->x = position->x - width;
origin->y = position->y - height/2;
break;
- case RadarAnchorSE:
+ case ZnAnchorSE:
origin->x = position->x - width;
origin->y = position->y - height;
break;
- case RadarAnchorS:
+ case ZnAnchorS:
origin->x = position->x - width/2;
origin->y = position->y - height;
break;
- case RadarAnchorSW:
+ case ZnAnchorSW:
origin->x = position->x;
origin->y = position->y - height;
break;
- case RadarAnchorW:
+ case ZnAnchorW:
origin->x = position->x;
origin->y = position->y - height/2;
break;
@@ -97,45 +97,45 @@ Anchor2Origin(RadarPoint *position,
* height and the anchor.
*/
void
-Origin2Anchor(RadarPoint *origin,
- RadarDim width,
- RadarDim height,
- RadarAnchor anchor,
- RadarPoint *position)
+Origin2Anchor(ZnPoint *origin,
+ ZnDim width,
+ ZnDim height,
+ ZnAnchor anchor,
+ ZnPoint *position)
{
switch (anchor) {
- case RadarAnchorCenter:
+ case ZnAnchorCenter:
position->x = origin->x + width/2;
position->y = origin->y + height/2;
break;
- case RadarAnchorNW:
+ case ZnAnchorNW:
*position = *origin;
break;
- case RadarAnchorN:
+ case ZnAnchorN:
position->x = origin->x + width/2;
position->y = origin->y;
break;
- case RadarAnchorNE:
+ case ZnAnchorNE:
position->x = origin->x + width;
position->y = origin->y;
break;
- case RadarAnchorE:
+ case ZnAnchorE:
position->x = origin->x + width;
position->y = origin->y + height/2;
break;
- case RadarAnchorSE:
+ case ZnAnchorSE:
position->x = origin->x + width;
position->y = origin->y + height;
break;
- case RadarAnchorS:
+ case ZnAnchorS:
position->x = origin->x + width/2;
position->y = origin->y + height;
break;
- case RadarAnchorSW:
+ case ZnAnchorSW:
position->x = origin->x;
position->y = origin->y + height;
break;
- case RadarAnchorW:
+ case ZnAnchorW:
position->x = origin->x;
position->y = origin->y + height/2;
break;
@@ -144,7 +144,7 @@ Origin2Anchor(RadarPoint *origin,
void
-BBox2XRect(RadarBBox *bbox,
+BBox2XRect(ZnBBox *bbox,
XRectangle *r)
{
r->x = REAL_TO_INT(bbox->orig.x);
@@ -156,15 +156,15 @@ BBox2XRect(RadarBBox *bbox,
void
GetStringBBox(char *str,
- RadarFont font,
- RadarPos x,
- RadarPos y,
- RadarBBox *str_bbox)
+ ZnFont font,
+ ZnPos x,
+ ZnPos y,
+ ZnBBox *str_bbox)
{
Tk_FontMetrics fm;
str_bbox->orig.x = x;
- str_bbox->corner.x = x + RadarTextWidth(font, str, strlen(str));
+ str_bbox->corner.x = x + ZnTextWidth(font, str, strlen(str));
Tk_GetFontMetrics(font, &fm);
str_bbox->orig.y = y - fm.ascent;
str_bbox->corner.y = str_bbox->orig.y + fm.ascent + fm.descent;
@@ -172,7 +172,7 @@ GetStringBBox(char *str,
void
-ResetBBox(RadarBBox *bbox)
+ResetBBox(ZnBBox *bbox)
{
bbox->orig.x = bbox->orig.y = 0;
bbox->corner = bbox->orig;
@@ -180,8 +180,8 @@ ResetBBox(RadarBBox *bbox)
void
-CopyBBox(RadarBBox *bbox_from,
- RadarBBox *bbox_to)
+CopyBBox(ZnBBox *bbox_from,
+ ZnBBox *bbox_to)
{
bbox_to->orig = bbox_from->orig;
bbox_to->corner = bbox_from->corner;
@@ -189,9 +189,9 @@ CopyBBox(RadarBBox *bbox_from,
void
-IntersectBBox(RadarBBox *bbox1,
- RadarBBox *bbox2,
- RadarBBox *bbox_inter)
+IntersectBBox(ZnBBox *bbox1,
+ ZnBBox *bbox2,
+ ZnBBox *bbox_inter)
{
if ((bbox1->corner.x < bbox2->orig.x) ||
(bbox1->corner.y < bbox2->orig.y) ||
@@ -208,16 +208,16 @@ IntersectBBox(RadarBBox *bbox1,
}
-RadarBool
-IsEmptyBBox(RadarBBox *bbox)
+ZnBool
+IsEmptyBBox(ZnBBox *bbox)
{
return (bbox->orig.x >= bbox->corner.x) || (bbox->orig.y >= bbox->corner.y);
}
void
-AddBBoxToBBox(RadarBBox *bbox,
- RadarBBox *bbox2)
+AddBBoxToBBox(ZnBBox *bbox,
+ ZnBBox *bbox2)
{
if (IsEmptyBBox(bbox2)) {
return;
@@ -235,9 +235,9 @@ AddBBoxToBBox(RadarBBox *bbox,
void
-AddPointToBBox(RadarBBox *bbox,
- RadarPos px,
- RadarPos py)
+AddPointToBBox(ZnBBox *bbox,
+ ZnPos px,
+ ZnPos py)
{
if (IsEmptyBBox(bbox)) {
bbox->orig.x = px;
@@ -255,9 +255,9 @@ AddPointToBBox(RadarBBox *bbox,
void
-AddPointsToBBox(RadarBBox *bbox,
- RadarPoint *points,
- int num_points)
+AddPointsToBBox(ZnBBox *bbox,
+ ZnPoint *points,
+ int num_points)
{
int x1, y1, x2, y2, cur;
@@ -308,22 +308,22 @@ AddPointsToBBox(RadarBBox *bbox,
void
-AddStringToBBox(RadarBBox *bbox,
- char *str,
- RadarFont font,
- RadarPos cx,
- RadarPos cy)
+AddStringToBBox(ZnBBox *bbox,
+ char *str,
+ ZnFont font,
+ ZnPos cx,
+ ZnPos cy)
{
- RadarBBox str_bbox;
+ ZnBBox str_bbox;
GetStringBBox(str, font, cx, cy, &str_bbox);
AddBBoxToBBox(bbox, &str_bbox);
}
-RadarBool
-PointInBBox(RadarBBox *bbox,
- RadarPos x,
- RadarPos y)
+ZnBool
+PointInBBox(ZnBBox *bbox,
+ ZnPos x,
+ ZnPos y)
{
return ((x >= bbox->orig.x) && (x < bbox->corner.x) &&
(y >= bbox->orig.y) && (y < bbox->corner.y));
@@ -336,8 +336,8 @@ PointInBBox(RadarBBox *bbox,
* 1 if it is entirely inside and 0 otherwise.
*/
int
-BBoxInBBox(RadarBBox *bbox1,
- RadarBBox *bbox2)
+BBoxInBBox(ZnBBox *bbox1,
+ ZnBBox *bbox2)
{
if ((bbox1->corner.x <= bbox2->orig.x) ||
(bbox1->orig.x >= bbox2->corner.x) ||
@@ -360,12 +360,12 @@ BBoxInBBox(RadarBBox *bbox1,
* if it is entirely inside and 0 otherwise.
*/
int
-LineInBBox(RadarPoint *p1,
- RadarPoint *p2,
- RadarBBox *bbox)
+LineInBBox(ZnPoint *p1,
+ ZnPoint *p2,
+ ZnBBox *bbox)
{
- RadarBool p1_inside = PointInBBox(bbox, p1->x, p1->y);
- RadarBool p2_inside = PointInBBox(bbox, p2->x, p2->y);
+ ZnBool p1_inside = PointInBBox(bbox, p1->x, p1->y);
+ ZnBool p2_inside = PointInBBox(bbox, p2->x, p2->y);
if (p1_inside != p2_inside) {
return 0;
@@ -457,14 +457,14 @@ LineInBBox(RadarPoint *p1,
* on the right.
*/
void
-ShiftLine(RadarPoint *p1,
- RadarPoint *p2,
- RadarReal dist,
- RadarPoint *p3,
- RadarPoint *p4)
+ShiftLine(ZnPoint *p1,
+ ZnPoint *p2,
+ ZnReal dist,
+ ZnPoint *p3,
+ ZnPoint *p4)
{
static int shift_table[129];
- RadarBool dx_neg, dy_neg;
+ ZnBool dx_neg, dy_neg;
int dx, dy;
/*
@@ -524,12 +524,12 @@ ShiftLine(RadarPoint *p1,
* The function returns True if the lines are not parallel and False
* otherwise.
*/
-RadarBool
-IntersectLines(RadarPoint *a1,
- RadarPoint *a2,
- RadarPoint *b1,
- RadarPoint *b2,
- RadarPoint *pi)
+ZnBool
+IntersectLines(ZnPoint *a1,
+ ZnPoint *a2,
+ ZnPoint *b1,
+ ZnPoint *b2,
+ ZnPoint *pi)
{
int dxadyb, dxbdya, dxadxb, dyadyb, p, q;
@@ -580,13 +580,13 @@ IntersectLines(RadarPoint *a1,
*/
/**** A FINIR ****/
void
-InsetPolygon(RadarPoint *p,
+InsetPolygon(ZnPoint *p,
int num_points,
- RadarDim inset)
+ ZnDim inset)
{
- RadarPoint *p1, *p2;
- RadarPoint new_p1, new_p2;
- RadarPoint shift1, shift2;
+ ZnPoint *p1, *p2;
+ ZnPoint new_p1, new_p2;
+ ZnPoint shift1, shift2;
int i, processed_points;
processed_points = 0;
@@ -624,12 +624,12 @@ InsetPolygon(RadarPoint *p,
* end is located around p2.
*/
void
-GetButtPoints(RadarPoint *p1,
- RadarPoint *p2,
- int width,
- RadarBool projecting,
- RadarPoint *c1,
- RadarPoint *c2)
+GetButtPoints(ZnPoint *p1,
+ ZnPoint *p2,
+ int width,
+ ZnBool projecting,
+ ZnPoint *c1,
+ ZnPoint *c2)
{
double w_2 = width/2.0;
double length = hypot(p2->x - p1->x, p2->y - p1->y);
@@ -668,13 +668,13 @@ GetButtPoints(RadarPoint *p1,
*
* Hmmm, the switch has been done but not the rounding ;-)
*/
-RadarBool
-GetMiterPoints(RadarPoint *p1,
- RadarPoint *p2,
- RadarPoint *p3,
- int width,
- RadarPoint *c1,
- RadarPoint *c2)
+ZnBool
+GetMiterPoints(ZnPoint *p1,
+ ZnPoint *p2,
+ ZnPoint *p3,
+ int width,
+ ZnPoint *c1,
+ ZnPoint *c2)
{
static double deg11 = (11.0*2.0*M_PI)/360.0;
double theta1; /* angle of p2-p1 segment. */
@@ -752,16 +752,16 @@ GetMiterPoints(RadarPoint *p1,
* can be: CapRound, CapButt, CapProjecting.
*/
int
-PolylineInBBox(RadarPoint *points,
- int num_points,
- int width,
- int cap_style,
- int join_style,
- RadarBBox *bbox)
+PolylineInBBox(ZnPoint *points,
+ int num_points,
+ int width,
+ int cap_style,
+ int join_style,
+ ZnBBox *bbox)
{
int count, inside = -1;
- RadarBool do_miter_as_bevel;
- RadarPoint poly[4];
+ ZnBool do_miter_as_bevel;
+ ZnPoint poly[4];
/*
* If the first point is inside the area, change inside
@@ -872,13 +872,13 @@ PolylineInBBox(RadarPoint *points,
* if it is entirely inside and 0 otherwise.
*/
int
-PolygonInBBox(RadarPoint *points,
- int num_points,
- RadarBBox *bbox)
+PolygonInBBox(ZnPoint *points,
+ int num_points,
+ ZnBBox *bbox)
{
int inside, count;
- RadarPoint *p, *head, *first, *second;
- RadarBool closed;
+ ZnPoint *p, *head, *first, *second;
+ ZnBool closed;
p = head = points;
closed = True;
@@ -945,12 +945,12 @@ PolygonInBBox(RadarPoint *points,
* if it is entirely inside and 0 otherwise.
*/
int
-OvalInBBox(RadarPoint *center,
+OvalInBBox(ZnPoint *center,
int width,
int height,
- RadarBBox *bbox)
+ ZnBBox *bbox)
{
- RadarPoint origin, corner;
+ ZnPoint origin, corner;
int w_2, h_2;
double delta_x, delta_y;
@@ -1050,10 +1050,10 @@ OvalInBBox(RadarPoint *center,
* case we need to normalize a figure to take care of its shape and
* the result needs precision.
*/
-RadarBool
+ZnBool
PointInAngle(int start_angle,
int angle_extent,
- RadarPoint *p)
+ ZnPoint *p)
{
double point_angle;
int angle_diff;
@@ -1081,17 +1081,17 @@ PointInAngle(int start_angle,
* the arc described by (r1, r2, start_angle and angle_extent).
* This arc is origin centered.
*/
-RadarBool
-HorizLineToArc(RadarReal x1,
- RadarReal x2,
- RadarReal y,
- RadarReal rx,
- RadarReal ry,
- RadarReal start_angle,
- RadarReal angle_extent)
+ZnBool
+HorizLineToArc(ZnReal x1,
+ ZnReal x2,
+ ZnReal y,
+ ZnReal rx,
+ ZnReal ry,
+ ZnReal start_angle,
+ ZnReal angle_extent)
{
- RadarReal tmp, x;
- RadarPoint t;
+ ZnReal tmp, x;
+ ZnPoint t;
/*
* Compute the x-coordinate of one possible intersection point
@@ -1129,17 +1129,17 @@ HorizLineToArc(RadarReal x1,
* the arc described by (r1, r2, start_angle and angle_extent).
* This arc is origin centered.
*/
-RadarBool
-VertLineToArc(RadarReal x,
- RadarReal y1,
- RadarReal y2,
- RadarReal rx,
- RadarReal ry,
- RadarReal start_angle,
- RadarReal angle_extent)
+ZnBool
+VertLineToArc(ZnReal x,
+ ZnReal y1,
+ ZnReal y2,
+ ZnReal rx,
+ ZnReal ry,
+ ZnReal start_angle,
+ ZnReal angle_extent)
{
- RadarReal tmp, y;
- RadarPoint t;
+ ZnReal tmp, y;
+ ZnPoint t;
/*
* Compute the y-coordinate of one possible intersection point
@@ -1175,11 +1175,11 @@ VertLineToArc(RadarReal x,
* the rectangle.
*/
double
-RectangleToPointDist(RadarBBox *bbox,
- RadarPoint *p)
+RectangleToPointDist(ZnBBox *bbox,
+ ZnPoint *p)
{
double new_dist, dist;
- RadarPoint p1, p2;
+ ZnPoint p1, p2;
p1.x = bbox->orig.x;
p1.y = p2.y = bbox->orig.y;
@@ -1224,9 +1224,9 @@ RectangleToPointDist(RadarBBox *bbox,
* described by <xl1,yl1>, <xl2,yl2>..
*/
double
-LineToPointDist(RadarPoint *p1,
- RadarPoint *p2,
- RadarPoint *p)
+LineToPointDist(ZnPoint *p1,
+ ZnPoint *p2,
+ ZnPoint *p)
{
double x, y;
int x_int, y_int;
@@ -1315,16 +1315,16 @@ LineToPointDist(RadarPoint *p1,
* inside return values are negative.
*/
double
-PolygonToPointDist(RadarPoint *points,
+PolygonToPointDist(ZnPoint *points,
int num_points,
- RadarPoint *p)
+ ZnPoint *p)
{
double best_distance;
int intersections;
int x_int, y_int;
- RadarPoint *first_point;
+ ZnPoint *first_point;
double x, y, dist;
- RadarPoint p1, p2;
+ ZnPoint p1, p2;
/*
* The algorithm iterates through all the edges of the polygon
@@ -1472,17 +1472,17 @@ PolygonToPointDist(RadarPoint *points,
* in the process.
*/
double
-PolylineToPointDist(RadarPoint *points,
+PolylineToPointDist(ZnPoint *points,
int num_points,
int width,
int cap_style,
int join_style,
- RadarPoint *p)
+ ZnPoint *p)
{
- RadarBool miter2bevel = False;
+ ZnBool miter2bevel = False;
int count;
- RadarPoint *ptr;
- RadarPoint outline[5];
+ ZnPoint *ptr;
+ ZnPoint outline[5];
double dist, best_dist, h_width;
best_dist = 1.0e36;
@@ -1587,11 +1587,11 @@ PolylineToPointDist(RadarPoint *points,
* if the point is inside.
*/
double
-OvalToPointDist(RadarPoint *center,
+OvalToPointDist(ZnPoint *center,
int width,
int height,
unsigned int line_width,
- RadarPoint *p)
+ ZnPoint *p)
{
double x_delta, y_delta;
/* double x_diameter, y_diameter;*/
@@ -1667,12 +1667,12 @@ static int bezier_basis[][4] =
**********************************************************************************
*/
#define EVAL(coeff, t) (((coeff[0]*t + coeff[1])*t + coeff[2]) * t + coeff[3])
-static RadarReal
-Arc2Param(RadarPoint *controls,
- RadarReal angle)
+static ZnReal
+Arc2Param(ZnPoint *controls,
+ ZnReal angle)
{
- RadarReal coeff_x[4], coeff_y[4];
- RadarReal min_angle, min_t, max_angle, max_t, cur_angle, cur_t;
+ ZnReal coeff_x[4], coeff_y[4];
+ ZnReal min_angle, min_t, max_angle, max_t, cur_angle, cur_t;
int i, j, depth = 0;
/* assume angle >= 0 */
@@ -1733,13 +1733,13 @@ Arc2Param(RadarPoint *controls,
**********************************************************************************
*/
void
-BezierSubdivide(RadarPoint *controls,
- RadarReal t,
- RadarBool first)
+BezierSubdivide(ZnPoint *controls,
+ ZnReal t,
+ ZnBool first)
{
- RadarReal s = 1.0 - t;
- RadarPoint r[7];
- RadarPoint a;
+ ZnReal s = 1.0 - t;
+ ZnPoint r[7];
+ ZnPoint a;
r[0] = controls[0];
r[6] = controls[3];
@@ -1757,10 +1757,10 @@ BezierSubdivide(RadarPoint *controls,
r[3].y = s*r[2].y + t*r[4].y;
if (first) {
- memcpy(controls, r, 4*sizeof(RadarPoint));
+ memcpy(controls, r, 4*sizeof(ZnPoint));
}
else {
- memcpy(controls, &r[3], 4*sizeof(RadarPoint));
+ memcpy(controls, &r[3], 4*sizeof(ZnPoint));
}
}
@@ -1777,12 +1777,12 @@ BezierSubdivide(RadarPoint *controls,
**********************************************************************************
*/
static void
-GetBezierPoints(RadarPoint *controls,
- RadarList to_points,
- double eps)
+GetBezierPoints(ZnPoint *controls,
+ ZnList to_points,
+ double eps)
{
- RadarReal dist2;
- RadarPoint mid_segm, mid_cord, delta;
+ ZnReal dist2;
+ ZnPoint mid_segm, mid_cord, delta;
/*
* Compute distance between cord center and curve at t = 0.5
@@ -1796,7 +1796,7 @@ GetBezierPoints(RadarPoint *controls,
dist2 = delta.x*delta.x + delta.y*delta.y;
if (dist2 > eps) {
- RadarPoint new_controls[4];
+ ZnPoint new_controls[4];
/*
* Subdivide the curve at t = 0.5
* and compute each new curve.
@@ -1822,7 +1822,7 @@ GetBezierPoints(RadarPoint *controls,
* Flat enough add the end to the current path.
* The start should already be there.
*/
- RadarListAdd(to_points, &controls[3], RadarListTail);
+ ZnListAdd(to_points, &controls[3], ZnListTail);
}
}
@@ -1842,21 +1842,21 @@ GetBezierPoints(RadarPoint *controls,
**********************************************************************************
*/
void
-GetBezierPath(RadarList from_points,
- RadarList to_points)
+GetBezierPath(ZnList from_points,
+ ZnList to_points)
{
- RadarPoint *fp;
+ ZnPoint *fp;
int num_fp, i;
- RadarPoint s[4];
+ ZnPoint s[4];
- fp = (RadarPoint *) RadarListArray(from_points);
- num_fp = RadarListSize(from_points);
+ fp = (ZnPoint *) ZnListArray(from_points);
+ num_fp = ZnListSize(from_points);
/*
* make sure the output vector is empty, then add the first point.
*/
- RadarListEmpty(to_points);
- RadarListAdd(to_points, &fp[0], RadarListTail);
+ ZnListEmpty(to_points);
+ ZnListAdd(to_points, &fp[0], ZnListTail);
for (i = 0; i < num_fp; ) {
if (i < (num_fp-3)) {
@@ -1877,7 +1877,7 @@ GetBezierPath(RadarList from_points,
break;
}
else if (i == (num_fp-2)) {
- RadarListAdd(to_points, &fp[1], RadarListTail);
+ ZnListAdd(to_points, &fp[1], ZnListTail);
break;
}
}
@@ -1901,19 +1901,19 @@ static double arc_nodes_y[4] = { 0.0, 1.0, 0.0, -1.0 };
static double arc_controls_x[8] = { 1.0, 0.55197, -0.55197, -1.0, -1.0, -0.55197, 0.55197, 1.0 };
static double arc_controls_y[8] = { 0.55197, 1.0, 1.0, 0.55197, -0.55197, -1.0, -1.0, -0.55197 };
void
-GetArcPath(RadarReal start_angle,
- RadarReal end_angle,
+GetArcPath(ZnReal start_angle,
+ ZnReal end_angle,
int type,
- RadarList to_points)
+ ZnList to_points)
{
int start_quad, end_quad, quadrant;
- RadarPoint center_p = { 0.0, 0.0 };
- RadarPoint start_p = center_p;
+ ZnPoint center_p = { 0.0, 0.0 };
+ ZnPoint start_p = center_p;
/*
* make sure the output vector is empty.
*/
- RadarListEmpty(to_points);
+ ZnListEmpty(to_points);
/*
* normalize start_angle and end_angle.
@@ -1941,8 +1941,8 @@ GetArcPath(RadarReal start_angle,
end_quad = end_angle / (M_PI / 2.0);
for (quadrant = start_quad; quadrant <= end_quad; quadrant++) {
- RadarPoint controls[4];
- RadarReal t;
+ ZnPoint controls[4];
+ ZnReal t;
controls[0].x = arc_nodes_x[quadrant % 4];
controls[0].y = arc_nodes_y[quadrant % 4];
@@ -1961,7 +1961,7 @@ GetArcPath(RadarReal start_angle,
* vertex.
*/
start_p = controls[0];
- RadarListAdd(to_points, &controls[0], RadarListTail);
+ ZnListAdd(to_points, &controls[0], ZnListTail);
}
if (quadrant == end_quad) {
t = Arc2Param(controls, end_angle);
@@ -1970,23 +1970,23 @@ GetArcPath(RadarReal start_angle,
}
BezierSubdivide(controls, t, True);
}
- RadarListAdd(to_points, &controls[1], RadarListTail);
- RadarListAdd(to_points, &controls[2], RadarListTail);
- RadarListAdd(to_points, &controls[3], RadarListTail);
+ ZnListAdd(to_points, &controls[1], ZnListTail);
+ ZnListAdd(to_points, &controls[2], ZnListTail);
+ ZnListAdd(to_points, &controls[3], ZnListTail);
}
if (type == 2) {
- RadarListAdd(to_points, &center_p, RadarListTail);
+ ZnListAdd(to_points, &center_p, ZnListTail);
/*
* Can't add this one, it would be interpreted by GetBezierPath
* as an off-curve control. The path should be closed by the client
* after expansion by GetBezierPath.
*
- RadarListAdd(to_points, &start_p, RadarListTail);
+ ZnListAdd(to_points, &start_p, ZnListTail);
*/
}
else if (type == 1) {
- RadarListAdd(to_points, &start_p, RadarListTail);
+ ZnListAdd(to_points, &start_p, ZnListTail);
}
}
@@ -2001,22 +2001,22 @@ GetArcPath(RadarReal start_angle,
**********************************************************************************
*/
void
-SmoothPathWithBezier(RadarList from_points,
- RadarList to_points)
+SmoothPathWithBezier(ZnList from_points,
+ ZnList to_points)
{
- RadarPoint *fp;
- int num_fp;
- RadarBool closed;
- RadarPoint s[4];
- int i;
+ ZnPoint *fp;
+ int num_fp;
+ ZnBool closed;
+ ZnPoint s[4];
+ int i;
- fp = (RadarPoint *) RadarListArray(from_points);
- num_fp = RadarListSize(from_points);
+ fp = (ZnPoint *) ZnListArray(from_points);
+ num_fp = ZnListSize(from_points);
/*
* make sure the output vector is empty
*/
- RadarListEmpty(to_points);
+ ZnListEmpty(to_points);
/*
* If the curve is closed, generates a Bezier curve that
@@ -2033,12 +2033,12 @@ SmoothPathWithBezier(RadarList from_points,
s[2].y = REAL_TO_INT(0.833*fp[0].y + 0.167*fp[1].y);
s[3].x = REAL_TO_INT(0.5*fp[0].x + 0.5*fp[1].x);
s[3].y = REAL_TO_INT(0.5*fp[0].y + 0.5*fp[1].y);
- RadarListAdd(to_points, s, RadarListTail);
+ ZnListAdd(to_points, s, ZnListTail);
GetBezierPoints(s, to_points, 1.0);
}
else {
closed = False;
- RadarListAdd(to_points, &fp[0], RadarListTail);
+ ZnListAdd(to_points, &fp[0], ZnListTail);
}
for (i = 2; i < num_fp; i++, fp++) {
@@ -2081,7 +2081,7 @@ SmoothPathWithBezier(RadarList from_points,
*/
if (((fp[0].x == fp[1].x) && (fp[0].y == fp[1].y)) ||
((fp[1].x == fp[2].x) && (fp[1].y == fp[2].y))) {
- RadarListAdd(to_points, &s[3], RadarListTail);
+ ZnListAdd(to_points, &s[3], ZnListTail);
}
else {
GetBezierPoints(s, to_points, 1.0);
@@ -2119,17 +2119,17 @@ SmoothPathWithBezier(RadarList from_points,
**********************************************************************************
*/
void
-GetLineEnd(RadarPoint *p1,
- RadarPoint *p2,
+GetLineEnd(ZnPoint *p1,
+ ZnPoint *p2,
unsigned int line_width,
int cap_style,
LineEnd end_style,
- RadarPoint *points)
+ ZnPoint *points)
{
- RadarReal dx, dy, length, temp, backup;
- RadarReal frac_height, sin_theta, cos_theta;
- RadarReal vert_x, vert_y;
- RadarReal shape_a, shape_b, shape_c;
+ ZnReal dx, dy, length, temp, backup;
+ ZnReal frac_height, sin_theta, cos_theta;
+ ZnReal vert_x, vert_y;
+ ZnReal shape_a, shape_b, shape_c;
if (end_style != NULL) {
shape_a = end_style->shape_a + 0.001;