Commit Graph

51 Commits

Author SHA1 Message Date
Seth Hillbrand cecfeea947 pcbnew: Remove snapping to hidden items
Items and layers that are hidden in the view should not be used as snap
points.  This happens in multiple locations:
1) Grid Helper for normal tools
2) TOOL_BASE::snapToItem for router

Resolves KiPro Issue #116

Fixes: lp:1833128
* https://bugs.launchpad.net/kicad/+bug/1833128
2019-10-10 09:37:25 -07:00
Seth Hillbrand 8576668eba pcbnew: Snap items to grouped layers
When moving a group of items, the allowed snapping layers should be each
layer in the group, not just the first item's LSET.

Fixes: lp:1830164
* https://bugs.launchpad.net/kicad/+bug/1830164
2019-08-21 12:32:13 -07:00
Jeff Young e816a0c29d Push Eeschema & PLEditor PICKER_TOOLs down into common.
Also implements a more robust push/pop tool strategy for pickers.
2019-07-16 00:44:01 +01:00
Jeff Young e785c140b9 Eradicate globals for PCB_GENERAL_SETTINGS.
Fixes: lp:1832896
* https://bugs.launchpad.net/kicad/+bug/1832896
2019-06-26 21:54:03 +01:00
Jeff Young 8f84c3ec4f Grid rid of GetCanvas/GetGalCanvas distinction now that there's only gal. 2019-06-13 19:58:37 +01:00
Jeff Young c1298570cb Remove legacy routing options. 2019-06-01 16:29:12 +01:00
Seth Hillbrand b461fc44ef pcbnew: Ensure source snapping
Choosing the drag origin should not be dependent on the snap settings in
pcbnew.  Snap settings are sensible when you are designating a target
only.  Additionally, when dragging a module, we do not want the
footprint's pads to be used as targets for snapping.

Fixes: lp:1814402
* https://bugs.launchpad.net/kicad/+bug/1814402
2019-02-03 04:23:24 +01:00
Seth Hillbrand 05483a06c6 pcbnew: Re-attach snap options
Snapping to item options were partially disconnected when unifying
framework.  This re-attaches the options and adds the additional option
for graphical items.

Fixes: lp:1801377
* https://bugs.launchpad.net/kicad/+bug/1801377
2019-01-29 13:36:17 -08:00
Seth Hillbrand 184711beb4 pcbnew: Fix via snapping to multiple tracks
Rather than selecting an arbitrary track to snap, we select the closest
track to our point, allowing the via to be placed along the full track
length.

Fixes: lp:1813324
* https://bugs.launchpad.net/kicad/+bug/1813324
2019-01-25 09:13:18 -08:00
Seth Hillbrand 908c2a37e5 GRID_HELPER: Finish drawing closed path
When we draw a path, we usually want to close the path when clicking on
the end of another line.  This uses grid helper to ensure this
progression happens as expected.
2018-11-24 08:00:11 -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
Seth Hillbrand c24f70ba1e GRID_HELPER: Filter targets based on dragging
Filtering based on selection ignores the use case where we are measuring
to a selected item.  This utilizes the dragged flag to prevent snapping
based on the current state of the item drag.

Fixes: lp:1801089
* https://bugs.launchpad.net/kicad/+bug/1801089
2018-11-11 11:30:36 -08:00
Seth Hillbrand cf20b39ddc GRID HELPER: Consider all snappable items
When snapping, we should allow any point identified as a snappable
point.  The additional consideration for corners might be used for
alignment in the future.

Fixes: lp:1802741
* https://bugs.launchpad.net/kicad/+bug/1802741
2018-11-11 11:30:36 -08:00
Seth Hillbrand 70e660dfe8 GRID_HELPER: Update target geometry when moving
Setting a previously visible item visible is a nop.  If the target was
visible, make sure to update the geometry

Fixes: lp:1802405
* https://bugs.launchpad.net/kicad/+bug/1802405
2018-11-09 06:12:31 -08:00
Seth Hillbrand e1fe3c7ed4 GRID_HELPER: Remove double-check condition
We only need to check nearest once.
2018-10-09 05:37:48 -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 3b27049f6e GRID_HELPER: filter selected items from snap target
When considering potential targets for snap points, we need to exclude
the currently selected item as this will mean that we always snap to
ourselves when editing an existing item.

Fixes: lp:1796507
* https://bugs.launchpad.net/kicad/+bug/1796507
2018-10-06 19:38:26 -07:00
Seth Hillbrand da3afd4abd GRID_HELPER: Avoid inactive layers when snapping 2018-10-06 09:52:21 -07:00
Seth Hillbrand 776d12c529 GRID_HELPER: Measurement snapping points
Measurements should snap to the points that are used for controlling the
measurement.
2018-10-06 09:29:19 -07:00
Seth Hillbrand 2db3f859f7 GRID_HELPER: Show snap indicator when would snap
This shows the snap indicator even when the item we are snapping to
occurs on a grid point, giving the user an indication that the point is
correctly connected.
2018-10-05 14:33:48 -07:00
Seth Hillbrand 28c19cb613 GRID_HELPER: Allow grid disable
Many items require precise, non-grid movement.  Adding the ability to
flag a non-grid option will permit this behavior.

This is a required precursor commit to fixing lp:1738818 and lp:1771683
2018-10-04 21:23:50 -07:00
Seth Hillbrand f56b5cf7bd GRID_HELPER: Match layer set when snapping
This allows items to snap to multi-layer target anchors such as vias and
through hole pads.
2018-10-04 21:23:49 -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 853b9d06ad pcbnew: Fix snapping while moving on pads
When requesting to move a footprint based on the pad, the pad layers
should determine the snapping.  This extracts layers from the selected
pad before allowing the filtering for locked pads

Fixes: lp:1787627
* https://bugs.launchpad.net/kicad/+bug/1787627
2018-10-04 15:53:41 -07:00
Seth Hillbrand 1ff9931333 pcbnew: Remove legacy Magnetize() from GAL picker
Magnetic items handled by GRID_HELPER in GAL.  Also includes the
standard keyboard modifier shift to change magnetic items on/off
2018-10-04 15:48:15 -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
jean-pierre charras 8552f3fedf fix code after renaming files 2018-01-29 22:00:44 +01:00
jean-pierre charras 270a63daac DRAWSEGMENT, S_POLYGON shape: remove useless copies or conversion to std::vector<wxPoint> of SHPE_POLY_SET polygon shape.
Rename GetPolyPoint() to BuildPolyPointsList(), because GetPolyPoint() looks like an accessor, but it is not an accessor.
(Using it as accessor can creates a *very long calculation time* for very basic access to polygon vertices)

Fixes: lp:1745050
https://bugs.launchpad.net/kicad/+bug/1745050
2018-01-24 14:22:43 +01:00
Tomasz Włostowski a4528988ca pcbnew: fix graphical polygon movement, rotation, flipping and edit points synchronization.
Fixes: lp:1738449
* https://bugs.launchpad.net/kicad/+bug/1738449

Fixes: lp:1738032
* https://bugs.launchpad.net/kicad/+bug/1738032
2017-12-18 18:25:45 +01:00
Tomasz Włostowski 9932ff32ae refactoring: wrapped boost::optional in OPT<> class for the purpose of easier transition to C++17 in the future 2017-11-03 23:59:02 +01:00
Tomasz Włostowski d9bfbb4fec pcbnew: added graphical polygon drawing & editing tools 2017-10-19 23:14:01 +02:00
Tomasz Włostowski 931a1ccaff Improved copy/paste functionality by Kristoffer:
- added selection of reference point
- added snapping when pasting
- some minor code refactoring
- disabled pasting between footprint and pcb editors due to model incompatibility
2017-09-30 14:28:54 +02:00
Maciej Suminski e8345dce51 Display GRID_HELPER auxiliary axes and snap points 2017-08-07 08:59:32 +02:00
Maciej Suminski 3ee2f80188 Drag footprints by pads only if one is under the cursor 2017-07-27 11:13:25 +02:00
Tomasz Włostowski 3b16d3cffe further DLIST/Iterators cleanup, some code formatting 2017-06-23 11:12:37 +02:00
Maciej Suminski 0e14cdf6da Code formatting 2017-04-20 16:37:36 +02:00
Jon Evans 3ec28e2acf Refactor layer enumerations to all live in the same place 2017-03-30 16:01:48 -04:00
Alejandro García Montoro f68ce306bd CPolyLine -> SHAPE_POLY_SET refactor.
Removes the need of using the legacy code in polygon/PolyLine.{h,cpp},
refactoring all CPolyLine instances with SHAPE_POLY_SET instances.

The remaining legacy methods have been ported to SHAPE_POLY_SET;
mainly: Chamfer, Fillet, {,Un}Hatch.

The iteration over the polygon vertices have been simplified using the
family of ITERATOR classes.
2017-03-24 10:43:47 +01:00
Maciej Suminski 89055c4425 Code formatting 2016-12-12 16:45:52 +01:00
Tomasz Włostowski 1c1f4e9a50 Refactoring of VIEW/VIEW_ITEM classes:
- Remove dependency of EDA_ITEM on VIEW
- VIEW_ITEM is now a pure virtual interface
2016-12-12 16:45:52 +01:00
Simon Richter 1b2fd6a382 Replace BOOST_FOREACH with C++11 range based for. 2016-06-29 16:07:55 -04:00
Michael Steinberg fde12ebd25 Replace boost::function and boost::bind with their std:: counterparts 2016-06-29 12:23:11 +02:00
Simon Wells dbb7b38bae Delete unused variables in GRID_HELPER::AlignToSegment 2016-01-11 17:06:11 -05:00
Thomasz Wlostowski 6e470ece1d Pcbnew: fix push and shove router segfault bug. 2015-11-03 11:19:42 -05:00
unknown 40ccc0bedf replace round() with KiROUND(), our function that is used almost everywhere for rounding, and detects int overflows in debug mode. 2015-07-17 10:26:48 +02:00
Maciej Suminski 1b4daade82 GRID_HELPER anchors for vias (GAL). 2015-07-07 18:36:32 +02:00
Maciej Suminski b5ef511063 Fixed alignment to grid when there is a grid offset (GAL). 2015-06-30 14:08:03 +02:00
jean-pierre charras f743b98844 Try to fix Bug #1431391 (Unable to edit pins in Schematic library editor). It happens on XFCE, but also on Unity. This fix works on Unity. (it is due to the fact the dialog is not raised, for an unknown reason, and this bug depend on the way Eeschema and Libedit are run).
Add Ctrl+E hotkey in eeschema to edit a component with Libedit (similar to pcbnew Ctrl+E hotkey)
As usual, fix a few minor coverity warnings
2015-03-14 12:50:39 +01:00
Tomasz Wlostowski e9bc7b58cc Snap cursor to pad center when moving (GAL footprint editor). 2015-03-11 18:06:44 +01:00
Maciej Suminski 4fb9bce354 Code formatting. 2015-02-18 17:53:46 +01:00