1 /* Dia -- an diagram creation/manipulation program
2 * Copyright (C) 1999 Alexander Larsson
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 #include "boundingbox.h"
24 #define HANDLE_CORNER (HANDLE_CUSTOM1)
26 typedef struct _PolyConn PolyConn
;
28 /* This is a subclass of Object used to help implementing objects
29 * that connect points with polygonal line-segments.
32 /* Object must be first because this is a 'subclass' of it. */
35 int numpoints
; /* >= 2 */
38 PolyBBExtras extra_spacing
;
42 void polyconn_update_data(PolyConn
*poly
);
43 void polyconn_update_boundingbox(PolyConn
*poly
);
44 void polyconn_simple_draw(PolyConn
*poly
, Renderer
*renderer
, real width
);
45 void polyconn_init(PolyConn
*poly
, int num_points
);
46 void polyconn_set_points(PolyConn
*poly
, int num_points
, Point
*points
);
47 void polyconn_destroy(PolyConn
*poly
);
48 void polyconn_copy(PolyConn
*from
, PolyConn
*to
);
49 void polyconn_save(PolyConn
*poly
, ObjectNode obj_node
);
50 void polyconn_load(PolyConn
*poly
, ObjectNode obj_node
); /* NOTE: Does object_init() */
51 ObjectChange
*polyconn_add_point(PolyConn
*poly
, int segment
, Point
*point
);
52 ObjectChange
*polyconn_remove_point(PolyConn
*poly
, int point
);
53 void polyconn_move_handle(PolyConn
*poly
, Handle
*id
,
54 Point
*to
, HandleMoveReason reason
);
55 void polyconn_move(PolyConn
*poly
, Point
*to
);
56 real
polyconn_distance_from(PolyConn
*poly
, Point
*point
,
58 Handle
*polyconn_closest_handle(PolyConn
*poly
, Point
*point
);
59 int polyconn_closest_segment(PolyConn
*poly
, Point
*point
,
61 #endif /* POLY_CONN_H */