Introduce POLYGONHOLE_MODE for creating holes in polygonsmaster
commitea13d896dbead7151e9d86819c51f4d34d52c8d6
authorPeter Clifton <pcjc2@cam.ac.uk>
Sun, 6 Jun 2010 22:24:19 +0000 (6 23:24 +0100)
committerPeter Clifton <pcjc2@cam.ac.uk>
Sun, 6 Jun 2010 22:35:45 +0000 (6 23:35 +0100)
tree2eb7e1defb3686d48a461fc6223f01a49d3d3381
parent0400962a289e36dacdcc99fb36b938bb69c0a1e5
Introduce POLYGONHOLE_MODE for creating holes in polygons

Having selected polygon hole mode, the first click selects which
polygon to cut a hole in. A second click defines the start point of
the hole contour. The tool then behaves in a similar way to the
polygon drawing tool, with the hole ending when the start point is
re-clicked.

To avoid creating illegal polygons, the hole drawn is subtracted from
a representation of the original polygon with the poly_Boolean_free().
This consolidates any contours it intersects with and prevents the user
defining contours which intersect each other. (Although we don't
currently prevent the the user drawing self-intersecting contours).

The resulting POLYAREA is re-processed into PolygonType objects,
potentially more than one - if the hole drawn bisects the original
polygon. To keep undo operations simple, these are added as completely
new objects and the original polygon is deleted - along with its ID.
12 files changed:
src/action.c
src/const.h
src/crosshair.c
src/flags.c
src/gpcb-menu.res
src/hid/gtk/gui-icons-mode-buttons.data
src/hid/gtk/gui-misc.c
src/hid/gtk/gui-output-events.c
src/hid/gtk/gui-top-window.c
src/hid/lesstif/main.c
src/pcb-menu.res
src/set.c