Commit Graph

259 Commits

Author SHA1 Message Date
John Beard abe83b54ae Add zone cutout tool to GAL
When activated, the zone interactive editor is launched with a flag. The
drawn zone is then used to modify the existing zone at the end of the
action.
2017-02-10 23:23:55 +01:00
John Beard d37586aeaf Refactor GAL dialog prompt for new zone settings
Break a chunk of the new zone tool out into a separate function to keep
the code clear. When zone cutouts and similar zone tools are added,
they'll get the settings from existing zones.

This commit now used std::unique_ptr for the temporary zone item, which
simplifies handling of the ownership of that item.
2017-02-10 23:23:55 +01:00
John Beard 7045ed92fb Add CCW rotation to GAL canvas
This makes "rotate" into two separate TOOL_EVENTs, which each have a
"multiplier" parameter.

Also added is a namespace for 'free functions' that use TOOL_EVENT
public interfaces (perhaps with other inputs too) to centralise some
decision-making and calculations.

Fixes: lp:1660731
* https://bugs.launchpad.net/kicad/+bug/1660731
2017-02-09 12:50:47 +01:00
Maciej Suminski a3e16988be Remove shadow of drawn arcs after undoing them (GAL) 2017-02-09 12:19:16 +01:00
Maciej Suminski 2a9c6a6283 Minor DRAWING_TOOL refactor
Automatically switch to a drawing layer, if a copper layer was
preselected. No annoying message boxes.
  Do not deactivate the tool on layer switch.
  Replaced setting updatePreview with direct calls to VIEW::update
  Line width is kept in m_lineWidth for all shapes.
2017-02-09 12:03:28 +01:00
John Beard 019b949646 Pre-select highlighted net in zone create dialog
Applies in GAL mode (legacy mode already did this).

Fixes: lp:1482866
* https://bugs.launchpad.net/kicad/+bug/1482866
2017-01-29 23:46:41 +01:00
Dick Hollenbeck 0c459ced97 EDA_TEXT object refactor.
Make all EDA_TEXT data private and rename accessors to avoid function
name collisions in derived classes.

Overload EDA_TEXT's SetTextAngle() and SetEffects() in TEXTE_PCB.

Add support for preserving Reference text position, size, orientation
during a netlist import into a BOARD, as well as the one off footprint
update dialog.
2017-01-25 08:03:32 -05:00
Maciej Suminski e5fbd0c442 Fixed crash upon finished zone drawing in GAL.
In principle, this patch reverts 2eefa117. The difference is removal of
one unused method (SELECTION::clear) and fixing hidden overloaded
virtual methods warnings.

Fixes: lp:1657569
* https://bugs.launchpad.net/kicad/+bug/1657569
2017-01-18 22:06:23 +01:00
Maciej Suminski 2eefa11732 SELECTION has-a VIEW_GROUP instead of being-a VIEW_GROUP
Fixed numerous warnings caused by hidden overloaded methods
provided in both classes (Add(), Remove(), etc.)
2017-01-18 13:22:41 +01:00
Maciej Suminski c758f434c0 Removed unused fields in VIEW & ANTIALIASING_SMAA classes 2017-01-18 13:22:18 +01:00
John Beard d7db84e282 Break out tools' common menu functions and ownership
Add a class TOOL_MENU, which provides a management class for a
CONDITIONAL_MENU and a set of CONTEXT_MENUs. The aim of this is to
provide a central place where all TOOL_INTERACTIVEs can get a "basic"
context menu that either they or other tools can register new items and
sub-menus against.

This means that "top-level" tools no longer need to manage the lifetimes
of any CONTEXT_MENUs that they add, and can also delegate simple menu
display functions.
2017-01-12 14:33:57 +01:00
John Beard f1c5b9a9ae Add context menu to GAL DRAWING_TOOL, including the zone menu
Includes a tiny class for scoped set-reset of a variable, which is used
here to store the current drawing mode.

Fixes: lp:1218629
 * https://bugs.launchpad.net/kicad/+bug/1518629
2017-01-11 10:41:08 +01:00
John Beard 6baf0edc08 Line segments obey 45 degree preference in GAL
The GAL line segment tool now listens to the global line segment 45
degree locking preference, with Ctrl used to invert the behaviour. The
behaviour therefore follows the setting normally, and the user can
override when needed with Ctrl.

Fixes: lp:1635718
* https://bugs.launchpad.net/kicad/+bug/1635718
2017-01-11 09:57:55 +01:00
Maciej Suminski f94c10b453 Fixed a warning in release builds 2016-12-12 16:45:52 +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
Tomasz Włostowski 27a10e8597 Multiple simplifications to GAL tools in PCBNew:
- Finalize transition to BOARD_COMMIT (removed all remaining uses of PICKED_ITEMS_LIST) and implicit view/ratsnest updates
- Simplified SELECTION class, it now can be directly added to a VIEW
- Removed unnecesary casts and templates
- Introduced C++11 features (range based for, lambdas) where they improve code readability
- Added non-undoable COMMITs, which can be used to propagate change notifications to interested listeners (e.g. ratsnest/view)
2016-12-12 16:45:52 +01:00
jean-pierre charras 502d0a38be Fix a missing parameter initialization (arc angle) in footprint DXF import 2016-09-30 11:11:52 +02:00
Chris Pavlina 2b7e6e73ec Fix uninitialized variable in drawing_tool.cpp 2016-09-30 09:04:18 +02:00
Maciej Suminski 18695751e8 Fixed a footprint editor crash on DXF import
Fixes: lp:1627422
* https://bugs.launchpad.net/kicad/+bug/1627422
2016-09-27 13:36:52 +02:00
decimad ee3d75f273 Add coroutine call invocation context to identify the main stack frame.
Run the text draw-tool on the main stack frame.

Fixes: lp:1547282
* https://bugs.launchpad.net/kicad/+bug/1547282
2016-09-21 11:56:40 +02:00
Maciej Suminski 4bb16afc9e Fixed text placement tool in FP editor
Fixes: lp:1625304
* https://bugs.launchpad.net/kicad/+bug/1625304
2016-09-20 10:19:33 +02:00
Maciej Suminski 5a1f52bf30 Modified tools to use BOARD_COMMIT. 2016-09-12 13:45:57 +02:00
Tomasz Wlostowski 1924507001 Added a PCB_TOOL subclass. 2016-09-12 11:50:06 +02:00
Maciej Suminski ff6bdeee4b Removed a number 'if(m_editModules)' sections from pcbnew tools. 2016-09-12 11:50:06 +02:00
Maciej Suminski 1dd43d1d98 Unified undo buffer handling code for PCB & module editor.
Replaced UR_MODEDIT with UR_CHANGED.
2016-09-12 11:50:06 +02:00
jean-pierre charras a4658ab6be Fix a few compil warnings (not used vars, shadowed local vars) 2016-06-01 14:22:05 +02:00
Tomasz Wlostowski ee3418e90b One-click PCB update improvements
- Fix repetitive undo/redo segfaults & assertions.
- Add Update menu entry on PCB side.
- Fix Python build error
- Add spread footprints after updating
2016-01-29 15:43:40 +01:00
Simon Richter da9ca2def2 Avoid cast from const_iterator to iterator
The standard library requires iterators passed to functions that modify the
container to be mutable iterators, but GCC's implementation accepts
const_iterator in some places where these are only used to mark a place,
but the actual modification happens through a different parameter.

As this breaks implementations that use the passed iterator to modify the
container (e.g. because they use a different data organization), this is
not portable; because we already have a non-const reference to the
container anyway, this is trivially fixed as well.
2016-01-17 12:31:00 -05:00
Chris Pavlina c44c076bdb Fix coding style error in 6429 2016-01-07 17:33:31 -05:00
Johannes Agricola 07b73b9677 Properly set keepout flag for new zones in GAL 2016-01-07 14:39:21 -05:00
Tomasz Wlostowski 72b0593fdb Pcbnew: push and shove router fixes.
* Fix segfault caused by invalidation of the end item by
  PNS_LINE_PLACER::UpdateSizes().
* GAL zone drawing tool updates the ratsnest after zone drawing is complete.
* Fixed performance issue in zones processing using strict simplification
  only for the final filled area.
2015-11-18 09:35:17 -05:00
Maciej Suminski db8560f055 Fixed crash when placing 45-degree lines in the footprint editor (GAL). 2015-10-01 15:52:45 +02:00
jean-pierre charras 00cffb080e Make call to DXF importer not possible if a footprint does not exist, also in GAL mode. 2015-09-13 18:44:07 +02:00
Maciej Suminski 5caa1523bd Handling Coverity reports. 2015-08-07 17:07:06 +02:00
Maciej Suminski 2a93d083ee More DXF import fixes. 2015-08-03 21:11:59 +02:00
Maciej Suminski cb629e0ad4 Fixed DXF placing problem (GAL). 2015-07-30 13:49:36 +02:00
Maciej Suminski 5402bf0960 Allow zone drawing tool to start a new zone in the previous zone last point. 2015-07-28 17:33:18 +02:00
Tomasz Wlostowski 591f54f540 DRAWING_TOOL: show cursor when placing text 2015-07-22 13:51:59 +02:00
Andrew Zonenberg 561a962977 Fixed bug where "add text" tool in module editor did not update the toolbar radio buttons correctly 2015-07-11 17:03:50 -07:00
Andrew Zonenberg 6775cf392a Removed leading space 2015-07-11 16:50:31 -07:00
Andrew Zonenberg 1ea566b59d Fixed bug where GAL text tool was overzealously capturing the cursor when not necessary 2015-07-11 16:03:07 -07:00
Andrew Zonenberg a3a0db9be9 Fixed bug where GAL module editor does not release mouse capture after exiting text tool 2015-07-11 15:31:01 -07:00
Maciej Suminski 0cc6992d88 Double click finishes drawing (GAL). 2015-07-03 20:58:13 +02:00
Maciej Suminski 5ca8e0b9d6 Fixed incorrect polygon finishing in 45-degree mode (GAL). 2015-06-30 13:55:30 +02:00
Chris Pavlina 064e8a82e1 Fixed an assertion in arc drawing tool (GAL). 2015-06-02 20:16:55 +02:00
Maciej Suminski 946b9d1933 setTransitions() are called automatically for tools. 2015-04-30 10:46:03 +02:00
Maciej Suminski 26f20fbb00 Moved "Place Target" and "Place Module" tools from DRAWING_TOOL to PCB_EDITOR_CONTROL (to avoid placing modules in the footprint editor). 2015-03-10 16:58:26 +01:00
Maciej Suminski c160a7de17 Capturing cursor in drawing tools (GAL). 2015-03-10 14:43:14 +01:00
Maciej Suminski cc72e585f0 Fixed segfault in arc drawing tool (GAL footprint editor). 2015-03-10 14:32:40 +01:00
Maciej Suminski b0ad779ee4 Calming down the Coverity report. 2015-02-15 23:21:52 +01:00
Maciej Suminski 902d0e3f1f Tools are processing const TOOL_EVENT& (Tool Framework). 2015-02-14 21:28:47 +01:00
jean-pierre charras 6bae852cb9 Minor fixes: specctra export: skip malformed circles (having a radius = 0) in board outline creation, which can crash 3d-viewer or vrml export.
dialog_fp_lib_table: remember during a session the last open table (global or local).
drawing_tool: fix compil warning
Update demos.
2014-09-22 09:51:06 +02:00
Maciej Suminski c13cdb0964 Fixed line width settings in the module editor (GAL). 2014-09-01 13:48:51 +02:00
Maciej Suminski 242d42cf1d Changed 'line width change' & 'change arc posture' to TOOL_ACTIONs. 2014-08-04 14:23:19 +02:00
Maciej Suminski a1e08ae568 Drawing tools reset its state on layer change. 2014-07-15 11:41:55 +02:00
Maciej Suminski c1eda6b88c Some of the Tool Actions need to be run in immediate mode - fixed. 2014-07-09 16:50:31 +02:00
Maciej Suminski db0d708300 Simplified code for switching layers in GAL view. Tools are notified of layer change event. 2014-07-09 16:25:50 +02:00
Maciej Suminski b2d0737329 Fixed continous line drawing.
Outline mode can be set up on any layer.
2014-07-09 15:10:32 +02:00
Maciej Suminski ed88c40be5 Moved module editor-specific tools to a separate class (MODULE_TOOLS). 2014-07-09 15:02:56 +02:00
Maciej Suminski a6484f1acb Drawing tools used to crash when the drawing tool was interrupted - fixed. 2014-07-09 15:02:56 +02:00
Maciej Suminski b42091bc06 Fixed anchor placement tool in module editor (GAL). 2014-07-09 15:02:56 +02:00
Maciej Suminski 47f1fec31d DXF drawing placement tool for GAL. 2014-07-09 15:02:56 +02:00
Maciej Suminski d73ab976df Added support for placing the footprint anchor. 2014-07-09 14:01:06 +02:00
Maciej Suminski 5dc1f92608 Added pad placement tool for module editor (GAL). 2014-07-09 14:01:06 +02:00
Maciej Suminski 67136d21b1 MInor fixes. 2014-07-09 14:01:06 +02:00
Maciej Suminski 99043b777d Adapted graphics tools to cooperate with module editor. 2014-07-09 14:01:06 +02:00
Maciej Suminski ba320ac7c3 Added "edit modules" mode for DRAWING_TOOL. 2014-07-09 14:01:06 +02:00
Maciej Suminski fc44f34ade Fixed DRAWING_TOOL::PlaceTextModule() method. 2014-07-09 14:01:06 +02:00
Maciej Suminski b05885c2f1 Refactored drawing tools: lines, circles and arcs. 2014-07-09 14:01:06 +02:00
Maciej Suminski 94cc845b3f Added AF_ACTIVATE flag for TOOL_ACTIONs.
Reworked the way of processing events in TOOL_MANAGER class.
Added GetCommandStr() for TOOL_EVENT class.
2014-07-09 13:50:27 +02:00
Maciej Suminski 5d1ec2b204 Restored invocation of SELECTION_TOOL commands with TOOL_ACTIONs. 2014-07-09 13:50:27 +02:00
Maciej Suminski 6e0bd1eedc Adapted tools to PCB_BASE{_EDIT}_FRAME. 2014-07-09 13:50:27 +02:00
Maciej Suminski a6dac245c0 Removed TOOL_ACTIONs: selectionSingle, selectionClear. SELECTION_TOOL methods are called directly instead. 2014-07-09 11:59:24 +02:00
Maciej Suminski 9a47f4c645 Created a specialization of EDA_DRAW_PANEL_GAL: PCB_DRAW_PANEL_GAL.
Moved View related routines & fields from PCB_{BASE,EDIT}_FRAME & BOARD to PCB_DRAW_PANEL_GAL.
2014-07-09 10:57:32 +02:00
Dick Hollenbeck 4578ea8b9e 1) Add 32 Cu Layers.
2) Change from legacy Cu stack to counting down from top=(F_Cu or 0).
   The old Cu stack required knowing the count of Cu layers to make
   sense of the layer number when converting to many exported file types.
   The new Cu stack is more commonly used, although ours still gives
   B_Cu a fixed number.
3) Introduce class LSET and enum LAYER_ID.
4) Change *.kicad_pcb file format version to 4 from 3.
5) Change fixed names Inner1_Cu-Inner14_Cu to In1_Cu-In30_Cu and their
   meanings are typically flipped.
6) Moved the #define LAYER_N_* stuff into legacy_plugin.cpp where they
   can die a quiet death, and switch to enum LAYER_ID symbols throughout.
7) Removed the LEGACY_PLUGIN::Save() and FootprintSave() functions.
   You will need to convert to the format immediately, *.kicad_pcb and
   *.kicad_mod (=pretty) since legacy format was never going to know
   about 32 Cu layers and additional technical layers and the reversed Cu
   stack.
2014-06-24 11:17:18 -05:00
Maciej Suminski f5de166a7e Removed an unused parameter from TOOL_BASE::getModel<T>() method. 2014-06-06 14:59:25 +02:00
Maciej Suminski 2ed804b8ef Upstream merge. 2014-05-12 17:17:51 +02:00
Maciej Suminski 3f8d9da31f Key events are handled by wxEVT_CHAR instead of wxEVT_KEY_[UP|DOWN]. Fixed issue of chars that require modifiers (e.g. ? is Shift+/ on US keyboard layout). 2014-04-09 17:33:22 +02:00
Maciej Suminski 4c5afc46af Added possibility of switching tools by the right toolbar buttons, without deactivating the current tool first (previously tools did not switch if there was one active). 2014-04-04 11:50:15 +02:00
Maciej Suminski b6aa832f83 Converted std::bind1st to boost::bind. 2014-04-02 16:30:48 +02:00
Maciej Suminski 23392ce8c9 Upstream merge. 2014-04-02 15:38:59 +02:00
Maciej Suminski a55d25803e Activation of any drawing/placement tool clears current selection. 2014-04-01 14:06:19 +02:00
Maciej Suminski dbcc18ab31 Enabled autopanning while drawing zones. 2014-03-18 14:01:09 +01:00
Maciej Suminski 4d6f628a1f Minor fixes to zone drawing tool. 2014-03-18 11:33:49 +01:00
Maciej Suminski 1ff99b47c8 Fixed triple click bug while drawing zones with DRAWING_TOOL. 2014-03-18 11:09:43 +01:00
Maciej Suminski 54bf21768c Added a few settings to make the layer settings more similar to KiCad defaults (moved vias to VIA_THROUGH_VISIBLE, added a few rules for required layers). 2014-03-11 10:58:58 +01:00
Maciej Suminski 1c253bfba0 Some variables initialized to NULL. 2014-02-24 11:17:49 +01:00
Maciej Suminski 87785441bc Removed some excessive variables. 2014-02-19 15:20:42 +01:00
Maciej Suminski 57c69b41db Continous mode for drawing tools (i.e. they do not finish after adding a single object). 2014-02-19 13:51:32 +01:00
Maciej Suminski e14d9aaf8f Fixed wrongly formulated assert. 2014-02-17 17:20:44 +01:00
Maciej Suminski 05de84d542 Undo/redo support. 2014-02-17 14:53:01 +01:00
Maciej Suminski f82e07849b Improved way of drawing 45-degree lines. 2014-02-17 11:33:03 +01:00
Maciej Suminski c1c8f54e8b Added a few asserts. Made some steps idiotproof. 2014-02-14 15:52:13 +01:00
Maciej Suminski 9d3f7230ee New items are created using pointers (instead of copying automatic variables when drawing is finished). 2014-02-14 15:13:42 +01:00
Maciej Suminski b1fb59ad13 Refactorization: moved drawing 45 degree multiple line to a function. 2014-02-14 14:24:12 +01:00
Maciej Suminski a7cb90deb8 Some more minor refactorization. 2014-02-14 11:35:48 +01:00
Maciej Suminski b7d4377621 Refactoring: zones and keepout areas are drawn using the same function. 2014-02-14 10:47:43 +01:00
Maciej Suminski 2b62a85263 Refactoring: made VIEW, VIEW_CONTROLS, BOARD and PCB_EDIT_FRAME fields in DRAWING_TOOL. 2014-02-14 09:49:49 +01:00
Maciej Suminski 597e98dbf4 Cursor is in world coordinates. 2014-02-13 20:23:28 +01:00
Maciej Suminski 3106d25361 Added keepout areas drawing tool. 2014-02-13 16:24:33 +01:00
Maciej Suminski fce753ba24 Added zone drawing tool. 2014-02-13 16:10:32 +01:00
Maciej Suminski 45c5a3de7f Placing modules with a minor bug. 2014-02-13 12:46:39 +01:00
Maciej Suminski 87d3458ea9 Added PCB_TARGET placing tool. 2014-02-11 17:15:33 +01:00
Maciej Suminski ae5fa23285 Added DIMENSION drawing tool. 2014-02-11 14:38:44 +01:00
Maciej Suminski 2aef11a5fc Made rotate & flip tool actions generic.
Drawing tool reacts to rotate & flip events while placing a text.
2014-02-10 17:08:55 +01:00
Maciej Suminski 4b27778451 Basic text placing tool. 2014-02-10 15:40:25 +01:00
Maciej Suminski 02316e02c3 Drawing arcs - version 1 2014-02-10 10:58:58 +01:00
Maciej Suminski 45f55fb8c5 Actually added files for drawing tools. Added possibility of drawing circles. 2014-02-06 17:12:37 +01:00