Commit Graph

30 Commits

Author SHA1 Message Date
Jeff Young a3c74051c2 Allow edits to self-intersecting polygons.
1) Intermediate states might be self-intersecting, and we shouldn't
be policing our users on what order to do things in
2) The polygon might already be self-intersecting, at which point we're
preventing the user from fixing it.

Also includes better const management for SHAPE_POLY_SET API.

Fixes: lp:1833831
* https://bugs.launchpad.net/kicad/+bug/1833831
2019-07-14 18:18:48 +01:00
Jeff Young 981072598b Overhaul cursor code for new tool/action framework.
Includes the addition of an onSetCursor() handler which must be called
from both the GAL canvas AND the GAL backend (at least on OSX) to prevent
cursor flickering between (for instance) pencil and arrow.

Also includes new architecture for point editors which allows them to
coordiate cursors with the editing tools (so we can switch to an arrow
when over a point).
2019-06-27 22:37:11 +01:00
Jeff Young 69afa27a5f Implement ACTION_TOOLBAR and update some of the menus to ACTION_MENU.
This gives us better separation of MVC in line with the design of
the modern toolset.  It also reduces a whole bunch of duplicated
data.
2019-05-15 17:50:52 +01:00
Jeff Young f602ccd814 Insert EE_TOOL_BASE under SchEdit and LibEdit tools, and fix errant rename scope which clobbered PCBNew's PICKER_TOOL. 2019-05-12 13:47:08 +01:00
Jeff Young c1539ae014 Naming changes to reflect sharing between SchEdit and LibEdit. 2019-05-10 19:56:20 +01:00
Jeff Young ea0941cab3 Implement modern tools for LibEdit. 2019-05-10 16:11:57 +01:00
John Beard a1e0735853 Add hotkey (Insert) for zone create corner
Adds a hotkey to the TOOL_ACTION, and also checks for
action validity prior to running the actions (previously
implicitly gated by  the enablement of the menu item).
2018-08-07 09:19:18 -07:00
Maciej Suminski 7943372e8b Refill zones only when required
Previous implementation refilled zones every time they have been
unselected. This patch adds a flag that tracks whether the
zone has been actually modified, so it will be refilled only when
necessary.

Fixes: lp:1760903
* https://bugs.launchpad.net/kicad/+bug/1760903
2018-04-03 22:28:05 +02:00
Maciej Suminski dd97718a50 Point Editor: prevent creation of self-intersecting polygons 2018-02-22 16:28:09 +01:00
Tomasz Włostowski 56336fdafe POINT_EDITOR: migrate to ZONE_FILLER class 2017-12-05 14:54:57 +01:00
Maciej Suminski 76bd05a69b Prevent creating too many transitions by TOOL_MANAGER
- added TOOL_INTERACTIVE::resetTransitions()
- made protected and moved TOOL_BASE::setTransitions() to TOOL_INTERACTIVE
- TOOL_MANAGER calls TOOL_INTERACTIVE::resetTransitions() instead of
setTransitions()
2017-07-31 15:09:19 +02:00
Maciej Suminski 75fb04d650 TOOL_ACTIONs are handled with transitions, no handlers needed in the event loops
There used to be a number of TOOL_ACTIONs that had entries both in
SetTransitions() and the event loop, which seemed redundant and
troublesome.
Now it is not necessary anymore, transitions setup is enough to execute
associated actions.
2017-01-18 14:20:39 +01:00
Simon Richter 59c81976dc Explicitly mark overriding functions. 2016-09-24 14:53:15 -04:00
Simon Richter da5699de0a Replace boost::shared_ptr with std::shared_ptr. 2016-06-29 11:09:55 -04:00
Henrik Nyberg a6c94e26f6 Improved code for handling zone corner dragging (GAL). 2015-08-12 10:15:45 +02:00
Maciej Suminski 09febe745d Remove a corner from zone outline function (GAL). 2015-06-19 17:32:33 +02:00
Maciej Suminski 946b9d1933 setTransitions() are called automatically for tools. 2015-04-30 10:46:03 +02:00
Maciej Suminski 902d0e3f1f Tools are processing const TOOL_EVENT& (Tool Framework). 2015-02-14 21:28:47 +01:00
Maciej Suminski e6c1254dc8 "Create corner" context menu entry for draw segments and zone outlines (GAL). 2014-07-09 16:50:31 +02:00
Maciej Suminski 0379247fd4 Refactoring EDIT_POINTS, part 2: replaced index numbers with constants. 2014-04-01 17:41:24 +02:00
Maciej Suminski 17ec7ace4c Breaking outlines for zones using POINT_EDITOR. 2014-03-18 14:52:22 +01:00
Maciej Suminski 19a87ac780 Added EC_CONVERGING for zone areas modification. 2014-03-14 15:37:55 +01:00
Maciej Suminski 85e8b8bd87 Yet another approach to 45 degree constraints. 2014-03-13 11:48:19 +01:00
Maciej Suminski 5ac6579a87 Cursor snaps to EDIT_POINTs.
Added POINT_EDITOR::isModified().
2014-03-10 16:25:40 +01:00
Maciej Suminski 3927c667cc Added documentation. Moved some functions from .h to .cpp files. 2014-03-07 10:26:33 +01:00
Maciej Suminski 88a0311afe Added EDIT_LINEs for dragging zone outlines. 2014-03-06 17:34:04 +01:00
Maciej Suminski f72aec25c0 Auto zone refilling after using the POINT_EDITOR.
Minor code cleaning.
2014-03-06 11:49:08 +01:00
Maciej Suminski 3c656691cf Fixed POINT_EDITOR crash on GAL change / board reload. 2014-02-28 17:20:10 +01:00
Maciej Suminski f87f12e222 Added TOOL_ACTION for updating EDIT_POINTS.
EDIT_POINTs show up when there is only one item selected (now after deselection as well).
2014-02-28 16:53:28 +01:00
Maciej Suminski 94cfed4b9e Initial version of POINT_EDITOR. 2014-02-27 17:29:08 +01:00