Commit Graph

130 Commits

Author SHA1 Message Date
Jeff Young 765606012f Convert separate-compilation of selection.cpp to polymorphism. 2019-06-10 23:46:00 +01:00
Jon Evans d0926cce58 PcbNew: prevent crash in point editor if selection gets invalidated 2019-05-29 21:27:59 -04:00
Jeff Young 85f984ccd9 Add point-editor activation for immediate-mode drawing. 2019-05-24 19:49:09 +01:00
Jeff Young 67cc2aac2e Rework Eeschema find/replace for modern toolset.
Fixes: lp:1827274
* https://bugs.launchpad.net/kicad/+bug/1827274

Fixes: lp:1827240
* https://bugs.launchpad.net/kicad/+bug/1827240
2019-05-22 21:48:04 +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
Jeff Young 1a007c3e4b Implement SCH_SELECTION_TOOL (but still with legacy semantics). 2019-04-22 22:08:18 +01:00
Seth Hillbrand 24bf838392 pcbnew: Allow arc editing via midpoint
This permits changing the radius of the arc by adjusting the center
point of the arc.  The arc end points are fixed in this operation.
2019-04-07 06:50:25 -07:00
Seth Hillbrand 7ee12d674e pcbnew: Clear items before deleting vertex
Reverting changes causes the item to become invalid.  This can cause
issues when we have dangling pointers for the VIEW routines left over.
Until we implement a method of passing the reverted element back up to
the calling routine, we need to remove the selection for each Revert()
call.

Fixes: lp:1821909
* https://bugs.launchpad.net/kicad/+bug/1821909
2019-04-02 13:15:10 -07:00
Seth Hillbrand 940aef77af pcbnew: Update points before refresh
When removing a point from the polygon, the vertex is removed before it
is tested for validity.  If it fails validation, the edit is reverted
and the point count doesn't change, so the view update only modifies the
existing points.  But the revert may also have changed the shared
pointer to the point array, invalidating the view's copy.

Fixes: lp:1821909
* https://bugs.launchpad.net/kicad/+bug/1821909
2019-04-02 09:55:28 -07:00
jean-pierre charras b558366a4e Pcbnew: disable commit 3692c511 on non Windows platforms
A zone refill display progress bar is shown when deselecting the zone after geometry changes.
However, on Linux, there are some artifact between the progress bar refresh and the board view refresh:
the filled areas are incorrectly shown: the insulated islands remain displayed,
although they are removed from the actual filled areas list
So it is disabled until a fix is found.
2019-03-17 08:31:00 +01:00
jean-pierre charras 353d9d7c9e Pcbnew, Zone refill: avoid useless refilling, when zone parameters are not modified.
Previously, in many cases the selected zone was refilled on exit selection, even if the zone was not modified.
This is annoying, because the zone fill can be really time consuming, and cannot be called without a good reason.
Now the refilling is made only if a zone parameter is actually modified.
2019-03-14 17:33:25 +01:00
jean-pierre charras 3692c511d0 Zone fill: display progress bar when refilling a zone after edition.
Previously, refilling a zone after edition was made silently,
thus creating not understandable but very noticeable freeze time for complex zones.
2019-03-14 10:18:50 +01:00
Seth Hillbrand aeedb3543b pcbnew: Update strings
Moving pcbnew error strings that may be seen by the user to translated
strings.  Strings that denote unexpected cases are moved to debug logs
as they are essentially asserts that should never be shown.  The
exceptions are the messages shown when files are loaded.  All unknown
items should show an error here.
2019-01-02 14:43:55 -08:00
Seth Hillbrand 7ed1968f60 pcbnew: Remove corners from graphical polygons
Cherry-picked item from 5.0 allowed this action for modedit but missed
pcbnew.  This allows the same action in pcbnew as well.
2018-12-09 08:14:45 -08:00
Seth Hillbrand 940353afde GRID_HELPER: Keep edited items out of snap
Distinguish between the snap-from and snap-to items.  Previously, we
used the SELECTED or DRAGGED flags but the flagging arcitecture was
inherently fragile.  This specifies items directly that should not be
used as snap targets.

Fixes: lp:1802795
* https://bugs.launchpad.net/kicad/+bug/1802795
2018-11-16 10:05:31 -08:00
Jeff Young 74118a2e9d Don't display all the footprint info when an edge is selected.
Fixes: lp:1800556
* https://bugs.launchpad.net/kicad/+bug/1800556
2018-10-30 11:33:49 +00:00
Seth Hillbrand 4460313104 pcbnew: Separating connectivity to subdir 2018-10-12 16:31:09 -07:00
Seth Hillbrand 3ee72031a4 pcbnew: Follow cursor when editing polygon
Fixes: lp:1796721
* https://bugs.launchpad.net/kicad/+bug/1796721
2018-10-08 10:32:30 -07:00
Seth Hillbrand 9505df5997 GRID_HELPER: Fix ALT issue with snapping
Disabling the grid should leave the snapping in place.  But our disabler
returned the current point as closest, effectively always ensuring the
cursor position was the closest snap.  This only uses grid when
requested.
2018-10-07 08:23:45 -07:00
Seth Hillbrand ae7f04a20c pcbnew: snap after constraint and grid
This is temporary until we figure out a way to do multiple constraint
handling in GRID_HELPER or the EC_* class.  This will work as long as
the EC constraint helper places the endpoint on either the primary or
aux grid.

    Fixes: lp:1796540
    * https://bugs.launchpad.net/kicad/+bug/1796540
2018-10-07 08:23:45 -07:00
Seth Hillbrand 821b10a37e pcbnew: Drawing tool's crosshairs follow the element
When drawing the crosshair should track the element while the mouse
provides the position to calculate the next snap.

Fixes: lp:1796524
* https://bugs.launchpad.net/kicad/+bug/1796524
2018-10-06 20:27:18 -07:00
Seth Hillbrand 85194989b2 pcbnew: Ensure that dimension tool snaps to anything
The dimension tool is used to measure physical dimensions on the board
therefore it should be able to snap to any other object, not just those
on its own layer set as is the case for other items.

This also deals with a corner snap case for constraints by first
snapping, then constraining, then aligning to grid.  This ensures OoO
for alignment from least to most constraining.
2018-10-06 19:55:20 -07:00
Seth Hillbrand 4c6b84bfdb GRID_HELPER: enable/disable grid in editor with ALT
Apply optional grid while editing
2018-10-04 21:31:28 -07:00
Seth Hillbrand f8f2af774c GRID_HELPER: Fill out remaining anchor calculations
The computeAnchors function is used to find best drag locations for
items being moved.  All movable PCB items should be handled.

Fixes: lp:1794304
* https://bugs.launchpad.net/kicad/+bug/1794304
2018-10-04 20:25:13 -07:00
Seth Hillbrand 03e642a8db pcbnew: Implement consistent graphical snapping
This creates a standard snapping framework in the GRID_HELPER class that
allows snapping to items on the same layer as the object being
created/moved as well as consistent toggling of this using the Shift key
modifier.

Fixes: lp:806260
* https://bugs.launchpad.net/kicad/+bug/806260

Fixes: lp:1604616
* https://bugs.launchpad.net/kicad/+bug/1604616
2018-10-03 17:23:56 -07:00
Seth Hillbrand 6c693f80a7 pcbnew: Fix polygon corner adding in board editor
Polygon corners were enabled in the footprint editor but the logic
didn't extend to the board editor.  This revises the logic to look for
DRAWSEGMENTs and only reference the PCB_MODULE_EDGE_T where needed to
create a new segment in the footprint.

Fixes: lp:1782966
* https://bugs.launchpad.net/kicad/+bug/1782966
2018-10-03 11:29:02 -07:00
Seth Hillbrand ee465fb23c pcbnew: Fixup for edde02481 to enable aux axis
Correcting edde02481 which had side effects to
efdbc91e42 while dragging a line but not a
zone.
2018-09-24 14:29:23 -07:00
Seth Hillbrand edde02481e pcbnew: Fix alignment with off-grid drag
Commit efdbc91e42 broken the primary
alignment mechanism for maintaining the current point as an auxilliary
grid reference.  This reverts that commit and fixes both the initial
issue and the associated bug by applying the primary constraint after
the secondary.  In this way, we consider the secondary constraint as an
additive rather than alternative constraint.

Fixes: lp:1793888
* https://bugs.launchpad.net/kicad/+bug/1793888
2018-09-24 14:07:30 -07:00
Jeff Young 99cb1471c3 Added safety for POINT_EDITOR.
Fixes: lp:1786349
* https://bugs.launchpad.net/kicad/+bug/1786349
2018-09-17 18:01:08 +01:00
Seth Hillbrand dd228b60a7 pcbnew: Allow removing corners from graphical polygons
( cherry-picked from 22df4e301 )

Fixes: lp:1792712
* https://bugs.launchpad.net/kicad/+bug/1792712
2018-09-16 10:27:07 -07:00
Seth Hillbrand cf2980e1b2 pcbnew: Add corners in polygons
Allow corner adding to polygons in both module editor and board editor.
The board editor was already allowed but only through special types.
The module editor is now sychronized to the same process and both
recognize standard context menus

Fixes: lp:1782966
* https://bugs.launchpad.net/kicad/+bug/1782966

( cherry-picked from 06ac172c2 )
2018-09-15 10:02:58 -07:00
Seth Hillbrand efdbc91e42 pcbnew: snap final points to grid
When constraining moves, the cursor snaps to grid but does not
represent the position of the final edited point.  The point is rotated
to the nearest snap angle, while the vector length remains unchanged
resulting in a line longer than intended and off-grid.

This adds a grid-snap after the constraint is applied.

Fixes: lp:1792655
* https://bugs.launchpad.net/kicad/+bug/1792655

( cherry-picked from e7c51a6a6 )
2018-09-15 09:53:52 -07: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
jean-pierre charras 4cac974420 Add Bezier curve (S_CURVE shape) support in DIALOG_GRAPHIC_ITEM_PROPERTIES.
Fix some issues related to S_CURVE shape support.
2018-07-22 18:39:48 +02:00
Carsten Schoenert 9f7109826d fix misspelled 'allows to' -> 'allows one to'
Fixup small grammar issues around used 'allows to ...' almost in
code comments.
2018-07-11 10:35:03 -04:00
Seth Hillbrand 0a91f0bc9c Add 45º constraints to lines when moving with CTRL
Fixes: lp:1774750
* https://bugs.launchpad.net/kicad/+bug/1774750
2018-06-02 15:52:18 -07:00
Seth Hillbrand da061718e5 Remove constraint on circle
Allows circle radius to snap to arbitrary points while editing

Fixes: lp:1773436
* https://bugs.launchpad.net/kicad/+bug/1773436
2018-05-25 12:30:47 -07:00
Seth Hillbrand 0c2f9b1827 Keep circles controlled by radius
Circles are defined by center and a point on their edge.  This requires
the user to do extra math to figure out the size of the circle.  The
patch allows the user to edit and draw circles using radial coordinates.
2018-05-20 17:16:44 -07:00
Maciej Suminski 684f085ac5 Coverity fixes
CIDs:
dereference before null check:
175439 @ drc.cpp

uninitalized field:
175435 @ point_editor.cpp
174162 @ zone_filler.cpp
163188 @ footprint_info_impl.cpp

logically dead code:
155146 @ pcb_editor_control.cpp
2018-05-04 14:06:08 +02:00
Seth Hillbrand 1663627135 Update msg panel on create/modify graphic items
This clears the msg panel when not editing an item and updates the
position information when moving
2018-04-12 10:07:24 -07:00
Tomasz Włostowski 4e99b0d0e7 pcbnew: refresh message panel while drawing & editing graphical lines, arcs, circles and texts
Fixes: lp:1763052
* https://bugs.launchpad.net/kicad/+bug/1763052
2018-04-12 18:23:33 +02: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 886dc48cc4 Point Editor: reset the pointer to the modified point as it becomes invalid
Fixes: lp:1759024
* https://bugs.launchpad.net/kicad/+bug/1759024
2018-03-27 00:03:48 +02:00
Maciej Suminski 52fcddf4f4 Allow drawing self-intersecting polygons, just display a warning
Fixes: lp:1751654
* https://bugs.launchpad.net/kicad/+bug/1751654
2018-03-02 10:58:43 +01:00
Maciej Suminski dd97718a50 Point Editor: prevent creation of self-intersecting polygons 2018-02-22 16:28:09 +01:00
Maciej Suminski 104b606ca9 Disable autopanning when starting certain tools
Tools preserve their state between runs, so it could happen that
activating a tool restores the state when autopanning is enabled, even
though it should not be.
2018-02-14 15:40:20 +01:00
Maciej Suminski 95864780e2 Fix cursor freezes in GAL
Launching right click context menu overrides the cursor position, so all
actions executed by the tools will be performed in the right click
position. It created an issue, as the overridden cursor settings were
saved into wrong context if there was another tool activated in the
meantime.

Current implementation saves cursor settings for all tools and restores
them once the right click context menu disappears.

Fixes: lp:1745981
* https://bugs.launchpad.net/kicad/+bug/1745981

Fixes: lp:1746507
* https://bugs.launchpad.net/kicad/+bug/1746507
2018-02-02 19:08:05 +01:00