Commit Graph

196 Commits

Author SHA1 Message Date
Jeff Young ce1f35a1be Cleanup some left-over vestiages of the legacy canvas architecture. 2019-06-13 15:51:32 +01:00
Seth Hillbrand 9163ac543a pcbnew: Move pads to std::deque 2019-06-01 16:23:54 -07:00
Jeff Young c2662b0e11 Retire EDA_DRAW_PANEL and legacy_wx/EDA_DRAW_FRAME. 2019-05-31 21:55:30 +01:00
Jeff Young d6e9bdf07b Convert remaining legacy drawing code to print code. 2019-05-31 21:54:22 +01:00
Seth Hillbrand ddc6079ceb Move remaining hard-coded segment counts
This removes the remaining hard-coded segments counts and replaces them
with the relative error calculation where the segments per arc is
determined by the maximum error we allow (smaller arcs = fewer segments)
2019-05-16 08:49:55 -07:00
Seth Hillbrand 44e111b37e pcbnew: Add remaining Eagle pad types
This adds octagon and offset pad types to the Eagle pcb importer.

Fixes: lp:1814498
* https://bugs.launchpad.net/kicad/+bug/1814498
2019-05-15 11:12:16 -07:00
Seth Hillbrand f7c042a357 pcbnew: Allow curves in custom pads
Updates custom pad functions to permit adding arbitrary curves to the
primitives
2019-05-08 15:54:26 -07:00
Jeff Young fd546da640 Homogenize hit testing and selection return types.
Prep work for sharing SCH_SELECTION_TOOL with LibEdit.
2019-05-05 17:14:30 +01:00
jean-pierre charras d259459a14 Pcbnew: add a new primitive pad shape: chamfered round rect pad.
Allows 0 to 4 chamfered corners, not only one.

A custom shape allow this kind of shape. However because it is a primitive,
it is easier to edit and it support thermal reliefs.
2019-03-11 10:26:15 +01:00
Seth Hillbrand e270b5d266 modedit: Mirror custom pads
Fixes mirror command to correctly handle custom pads.

Fixes: lp:1808135
* https://bugs.launchpad.net/kicad/+bug/1808135
2019-01-17 08:55:59 -08:00
Seth Hillbrand 5433423377 pcbnew: Don't update coords on add
When adding an element to a module, we don't need to update the relative
coordinates.  Doing so can cause changes when writing to file depending
on rotation and position.

Fixes: lp:1810870
* https://bugs.launchpad.net/kicad/+bug/1810870
2019-01-15 12:14:02 -08:00
Seth Hillbrand c92424898c pcbnew: Replace magic number segment counts
Where we set 32 segments per circle, the magic number is replaced by the
same value as the common define ARC_APPROX_SEGMENTS_COUNT_HIGH_DEF
2019-01-03 17:21:10 -08:00
jean-pierre charras 04aeec1223 Remove useless includes 2018-12-12 15:28:59 +01:00
Jeff Young bcc8c64256 Consider edge cuts items to have zero width when filling zones.
Fixes: lp:1797787
* https://bugs.launchpad.net/kicad/+bug/1797787
2018-11-14 23:45:32 +00:00
Seth Hillbrand 9cafe65e84 pcbnew: Allow user-setting rounded rectangle radius
When designing pads, it can be helpful to not only see the resulting
rounded rectangle radius from a given percentage but also to set it,
constraining the related percentage.  This adjusts the dialog to allow
editing the rounded rectangle corner radius.  It does not change the
file format as the resulting ratio is saved.  Further updates of the pad
size or ratio will modify the radius.

Fixes: lp:1668020
* https://bugs.launchpad.net/kicad/+bug/1668020
2018-09-17 15:59:53 -07:00
Jeff Young 2d4ba56ac0 Promote aperture pads to first-class citizens.
Well, almost anyway.  We can't use a pad attribute for them as
that would change the file format.  So they're currently
defined as a CONN pad with no copper layers.

However, when figuring out of existing pads should be *treated*
as aperture pads, we just check for no copper layers.

Fixes: lp:1781760
* https://bugs.launchpad.net/kicad/+bug/1781760
2018-07-24 14:57:45 +01:00
Jeff Young 4618c64213 Don't number aperture pads.
Fixes: lp:1781760
* https://bugs.launchpad.net/kicad/+bug/1781760
2018-07-24 10:39:30 +01:00
Jeff Young 49ea6e1670 Fix occurrences of "edition" which should be "editing"
Fixes: lp:1778168
* https://bugs.launchpad.net/kicad/+bug/1778168

(cherry picked from commit bcb1220)
2018-07-17 15:12:39 +01:00
Jeff Young eacaa39aa2 Remove global units usage from GetSelectionText...
... and GetMsgPanelInfo.

Step 4 in the g_UserUnit eradication effort.

Also removes a couple of conversion routines that were close
enough to extinction.

(cherry picked from commit c75da51)
2018-07-17 15:11:09 +01:00
jean-pierre charras 93c7f65d96 mask clearance parameters: use clearances only for pads on copper layers, and never for pads on technical layers only. 2018-05-04 14:55:38 +02:00
Tomasz Włostowski f2bb398ae6 pcbnew: fixes in primitives->custom pad tool
Fixes: lp:1753712
* https://bugs.launchpad.net/kicad/+bug/1753712

Fixes: lp:1753711
* https://bugs.launchpad.net/kicad/+bug/1753711
2018-03-06 14:59:15 +01:00
Jeff Young 60a4ce6623 Don't let pads that *should* be NPTHs get lost.
Borrow the hidden text colour so that they can be distinguished
from PTHs and correctly-marked NPTHs.

Fixes: lp:1494738
* https://bugs.launchpad.net/kicad/+bug/1494738
2018-02-08 15:04:23 -05:00
jean-pierre charras 1858852f57 rename files 2018-02-02 21:57:12 +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 58ce865352 pcbnew: made TransformShapeWithClearanceToPolygon virtual 2017-12-05 14:54:57 +01:00
Marvin Schmidt 69974b73db Remove some extra semicolons 2017-11-09 19:52:18 +01:00
Tomasz Włostowski 0245912c34 refactoring: split BOARD_ITEM::SwapData to use polymorphic per-item methods 2017-11-03 20:02:06 +01:00
jean-pierre charras 8ba11dbd68 Minor fixes and enhancements 2017-10-21 11:00:59 +02:00
jean-pierre charras 87821c1490 Explode pad to shapes command: Fix incorrect conversion of primitive to EDGE_MODULE (missing initialization) 2017-10-21 08:48:26 +02:00
Tomasz Włostowski ac095b6724 pcbnew: tools for converting between custom-shaped pads and graphical shapes 2017-10-19 23:35:18 +02:00
jean-pierre charras 1164eaab72 Make the "No Net" mark color editable (mark for pads having no net name)
Note: this mark is currently drawn only in legacy canvas.
2017-10-05 20:11:55 +02:00
jean-pierre charras a43f3ab1fe replace "BasicShape" by "Primitive" in code, a better name 2017-09-20 12:51:10 +02:00
Maciej Suminski cca63801bf Renamed D_PAD::{Set,Get}PadName() to D_PAD::{Set,Get}Name() 2017-09-19 18:23:50 +02:00
Maciej Suminski 85be485c34 Enable long names for pin numbers and pads
- pad names are stored as wxString instead of a char[4] & integer union
- removed pad name to string conversion functions
- fixed pad & pin properties dialog restrictions regarding the name
length
2017-09-19 18:19:49 +02:00
jean-pierre charras e2d3fcec02 Add support for custom pad shape. Full support in DRC and PnS.
add option to use shape or convex hull as clearance area in zones.
simplify code to handle clearance area
2017-09-19 09:02:53 +02:00
Wayne Stambaugh 66e97fa905 Doxygen comment improvements.
Fix lots of Doxygen warnings.

Fix Doxygen comment for IO_MGR::FootprintEnumerate() which was recently
changed.
2017-06-13 19:47:46 -04:00
Oliver Walters a0afcd5a62 HitTest for pads
- Circular pads
2017-05-10 10:57:28 +02:00
Jon Evans 3ec28e2acf Refactor layer enumerations to all live in the same place 2017-03-30 16:01:48 -04:00
jean-pierre charras b365f17e9f First draft of courtyard overlap detection. 2017-03-19 20:27:44 +01:00
Jon Evans a52250a91e Change from EDA_COLOR_T to COLOR4D globally; arbitrary color support
eeschema now supports arbitrary colors for all object types, and
pcbnew does in GAL canvas.  When switching from GAL to legacy canvas,
pcbnew will convert colors to the nearest legacy color.
2017-02-22 17:35:00 +01:00
John Beard a8eea6155a Move bitmaps.h out of base_struct.h
bitmaps.h was included in nearly every file in the project due to it
being included by base_struct.h

Only about 130 files actually use the XPM definitions defined there, and
many of those already included bitmaps.h themselves, or via
menu_helpers.h. However, touching bitmaps.h would result in over 400
rebuilt files for pcbnew alone.

This commit moves the bitmap-related types like BITMAT_DEF out to a new
header, which is still included by base_struct.h, which is less
avoidable for now, it's it's used in the interface.

The icon list is still in bitmaps.h. This has the side effect that's
it's now easier to automatically generate this file.

Many classes in pcbnew and eeschema needed some functions moved
to the implementaitons from the headers too.
2017-02-21 09:50:15 -05:00
jean-pierre charras dd5b024903 Pad export/import settings functions: remove duplicate code. 2017-02-10 20:44:35 +01:00
John Beard 5cc2abaa2b Tidy consts for class D_PAD
Some accessors should be const:

* IsFlipped
* GetRoundRectRadiusRatio

Returning a objects by value as const in these cases is not helpful, as
all it does is prevent the caller moving from the return value, it just
forces a copy.

Some of thse functions come from base class overrides, those haven't
been changed.

* ShapePos
* GetPadName
* GetPackedPadName
2017-01-22 10:42:45 -05: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 59c81976dc Explicitly mark overriding functions. 2016-09-24 14:53:15 -04:00
Maciej Suminski 09e0311d4e Replaced Copy() method with operator=. Removed Copy() where default copy ctor was enough. 2016-09-12 11:50:06 +02:00
Dick Hollenbeck e24990146d Pcbnew: major swig fix.
* Switched hashtables.h over to std::undordered_map from boost version.

* Added new macros DECL_VEC_FOR_SWIG() and DECL_MAP_FOR_SWIG() in macros.h.
  These along with future DECL_HASH_FOR_SWIG() unify the declaration to swig
  and C++ so that the resultant type name is common in both languages, and
  the types AGREE.

* Fixed swigging of NETINFO_ITEM and NETINFO_LIST via magic.

* Newly exposed (python wrapped) are: D_PADS, TRACKS (was TRACK_PTRS),
  NETNAME_MAP, NETCODE_MAP, wxString (without constructor purposely, read
  comment in wx.i), MARKERS, ZONE_CONTAINERS, NETCLASSPTR, KICAD_T types.

* std::vector<SOMETHING*> tends to end up named SOMETHINGS in C++ and python.
  Having the name consistent between like types is helpful, and between
  languages.  std::map<> ends up as SOMETHING_MAP.

* NETINFO_LIST::m_netNames and NETINFO_LIST::m_netCodes are now std::map
  instead of hashtables, because swig does not yet support std::unordered_map.

* You can now get to any netclass or net info.   NETNAMES_MAP and NETCODES_MAP
  are traversable basically the same as a python dictionary using a python
  string (not wsString) as the key!  The wxString typemap converts python
  string to wxString before the lookup happens.  Iteration also works.
2016-07-18 13:23:09 -04:00
jean-pierre charras e2cc78b2b5 Code cleanup: remove dead code (some removed methods were broken), and update or add comments. 2016-06-01 11:28:07 +02:00
jean-pierre charras e46f706d4b Add Set/GetOrientationDegrees and GetOrientationRadians for texts, pads and footprints to avoid internal units to usual angle units conversion in code (and avoid mistakes).
It should help if (or when) the internal angle unit used in kicad will be changed from 0.1 degree (a relic of code written for PCs without fpu) to degree ( a more natural unit).
2016-05-02 12:49:14 +02:00
jean-pierre charras 4a838fb8c3 Pcbnew: Add rounded rect pad shape. 2016-04-06 20:15:49 +02:00