Commit Graph

164 Commits

Author SHA1 Message Date
John Beard b1a2c5d7c5 Zones: wxPoint/VECTOR2I warnings no longer needed
In the past, the ZONE_CONTAINER::GetPosition() member
returned a reference to a wxPoint, in accordance with the
BOARD_ITEM interface. This meant that ZONE_CONTAINER had
to reinterpret_cast a VECTOR2I (its internal position data) to wxPoint,
which was possible only due to fortunate memory layout.

This interface was changed to return wxPoints by value in
commit a4528988ca, and the normal (wxPoint) cast was used instead.

Thus, we can now also remove the dire warnings and static_asserts
used to ensure the now-unused old method was correct.
2019-01-23 10:39:03 -08:00
Seth Hillbrand 847f6ab4b3 Spelling fix HIGHT->HIGH 2019-01-03 17:10:27 -08:00
Seth Hillbrand 8f7c073514 pcbnew: Check for valid pointer before deref
In legacy toolkit, we do not keep the corner pointers, so dereferencing
causes crashes.

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

(cherry picked from commit 4aeef1e09e)
2018-12-19 16:54:34 -08:00
jean-pierre charras 04aeec1223 Remove useless includes 2018-12-12 15:28:59 +01:00
jean-pierre charras 0bceb69fe9 Pcbnew: DRAWSEGMENT polygonal shape: use triangulation (CacheTriangulation) to draw the shape (similar to zones).
On opengl, creating triangles by CacheTriangulation instead of GLU tesselator is much faster (one order of magnitude)
2018-12-02 18:05:25 +01:00
Jeff Young 208622699f Scale zone hit area by zoom.
Fixes: lp:1803362
* https://bugs.launchpad.net/kicad/+bug/1803362
2018-11-17 00:35:07 +00: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 b3a5e08c2f pcbnew: Rename PCB_ZONE_T and remove from connectivity
SEGZONE types were confusingly named PCB_ZONE_T.  Zones in pcbnew are
now _only_ PCB_ZONE_AREA_T, so we name segzone types PCB_SEGZONE_T to be
clear.

This also removes processing of the SEGZONEs from connectivity
calculations.
2018-09-29 15:09:15 -07:00
Seth Hillbrand e160eb0677 pcbnew: Adding some missing TypeOf() functions
Missing types were handled by the superclass (in the case of zones)
PCB_CONNECTED_ITEM, which incorrectly returned "true" when testing lines
against zones.

Fixes: lp:1789195
* https://bugs.launchpad.net/kicad/+bug/1789195
2018-08-28 13:19:29 -07: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
Maciej Suminski 1751e4631c Code formatting 2018-06-23 01:59:49 +02:00
Jeff Young cd81254262 Respect 45-degree mode when set from zone dialog.
Fixes: lp:1655073
* https://bugs.launchpad.net/kicad/+bug/1655073
2018-02-20 17:38:20 +01:00
jean-pierre charras 1858852f57 rename files 2018-02-02 21:57:12 +01:00
jean-pierre charras b43dc7954c fix code after renaming files 2018-01-30 15:34:09 +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 000f810161 pcbnew: fixed build error with python-enabled builds 2017-12-05 16:47:44 +01:00
Tomasz Włostowski f34b86d39e pcbnew: made zone filling algorithm thread-safe.
- moved zone filling algo outside ZONE_CONTAINER class
- const'ified methods that don't need to modify zone's properties
- cleanup: m_FillMode -> enum
2017-12-05 14:54:57 +01:00
Tomasz Włostowski 8df299a6bc pcbnew: Optimized zone filling algorithm: code cleanup 2017-12-05 14:54:57 +01:00
Tomasz Włostowski 58ce865352 pcbnew: made TransformShapeWithClearanceToPolygon virtual 2017-12-05 14:54:57 +01:00
Tomasz Włostowski 316ddadec1 pcbnew: Optimized zone filling algorithm. 2017-12-05 14:54:57 +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
Oliver Walters c977c88a10 Zone keepout exclusion now works on multiple layers!
Bug fixes for keepout layers

- Changed LSET::size() -> LSET::count()
- Save/load functions no longer depend on zone being a keepout
2017-09-27 10:35:00 +02:00
Oliver Walters 7e0fa329d0 DRC checks for keepout zones work on all layers 2017-09-27 10:35:00 +02:00
Oliver Walters 2895030cfa Add multi-layer zone rendering for GAL
Enable multi-layer selection for keepout zones in GAL
2017-09-27 10:34:59 +02:00
Oliver Walters 0f6ec7632b Enable multi-layer for keepout zones
- Load / save from PCB file correctly
- Doesn't display properly yet
- Keepout only actually applies to one layer (for now)
2017-09-27 10:34:59 +02:00
jean-pierre charras c311e63f0d fix minor issues, and change ZONE_CONTAINER::GetDefaultHatchPitchMils() to ZONE_CONTAINER::GetDefaultHatchPitch()
as using mil in a value has no meaning now in pcbnew
2017-07-01 15:17:30 +02:00
Tomasz Włostowski 3b16d3cffe further DLIST/Iterators cleanup, some code formatting 2017-06-23 11:12:37 +02:00
Tomasz Włostowski 9ad886344b New connectivity algorithm. 2017-06-23 11:12:36 +02:00
jean-pierre charras 6a63d4fbff pcbnew crash while opening old .brd file
Fixes: lp:1698697
https://bugs.launchpad.net/kicad/+bug/1698697

The incorrect method ZONE_CONTAINER::AppendCorner() is also fixed:
It was expecting the corner must be added to the main outline, but this is a false expectation:
it can be added to a hole inside the zone outline.
2017-06-19 13:29:57 +02:00
jean-pierre charras cf5bae7fbf Fix a few doxygen warnings 2017-06-17 10:40:38 +02:00
jean-pierre charras 70c961fe6a Pcbnew: fix serious issues (broken files) when saving and loading .kicad_pcb files when zones have holes in outlines. 2017-04-07 08:02:26 +02: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
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
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
Mrio Luzeiro d8eab321f7 3D Viewer: complete refactor of the 3D viewer.
* Split and rewrite the preview window and canvas.
* Create a new class for handling the board information.
* Adds new render targets: openGL, legacy, and ray tracing.
* Render targets take full advantage of the new 3D plugins system and 3D cache
  for a fast 3D model loading.
* Faster board loading.
* New OpenGL render is faster than the old one.
* New ray tracing render target with a post processing shader.
* Use of new 3D plugins (WRL, X3D, STEP and IGES) and 3D model caching.
* Preview of 3D model while browsing the file name.
* 3D preview of the footprint while adding / align 3D shapes.
* Render of 3D models according to attributes: Normal, Normal+Insert, Virtual.
* Pivot rotation centered in one point over the PCB board.
* Shortcuts keys improved for XYZ orientation..
* Animated camera.
2016-07-19 13:35:25 -04:00
jean-pierre charras b7955001c1 zone_filling_algorithm.cpp: a small code cleanup, fix incorrect return type in a few methods, and add better comments. 2016-07-14 09:27:32 +02:00
Tomasz Wlostowski 63b35f40a7 Removed all dependencies on boost::polygon except for bitmap2component. Replaced almost all instances of CPOLYGONS_LIST with SHAPE_POLY_SET. 2015-07-27 21:45:57 +02:00
Maciej Suminski d2ebf688f9 Reverted commits that remove boost::polygon dependency (need more testing). 2015-07-14 22:23:13 +02:00
Tomasz Wlostowski 41c753b05d Removed all dependencies on boost::polygon except for bitmap2component. Replaced almost all instances of CPOLYGONS_LIST with SHAPE_POLY_SET. 2015-07-14 13:36:24 +02:00
jean-pierre charras fc15404947 Fix a build issue in scripting mode (due to a no more existing method still declared in class_zone.h header) 2015-06-12 18:32:24 +02:00
Tomasz wlostowski eba3a55bb2 pcbnew: new zone filling algorithm using ClipperLib. Possibility to fall back to the old one 2015-06-12 17:13:18 +02:00
jean-pierre charras 77249d9b2d Minor fixes: remove a few useless includes and move a few others to the right file. Remove a few coverity warnings about not initialized members.
Minor bug fix: Zone duplicate zone in legacy mode: duplicate a zone to the same layer (and therefore  the same location) is no more allowed.
2015-05-15 14:49:11 +02:00
jean-pierre charras ebb967c46f Pcbnew: fix issues and potential issues when reading board files and mainly old board files, and enhance the DRC tests and Delete Single Pad Net option when reading a netlist:
* Delete Single Pad Net option does not delete the net if a zone use this net (i.e. is attached to this pad).
* pcb_parser accept now negative netcodes in zones (can happen with old files, which previously could crash Pcbnew)
* pcb_parser accept now files with incorrect or missing net count  (can happen with old files, which previously could crash Pcbnew)
* if a zone has a non-existent net name it now keep this net name, and DRC detect it (previously, the net name was lost, and the DRC did not tected this issue).
* Drc test: now detect a "dead" net, i.e. a net with 0 pads, but still used by a zone. It happens easily after a schematic modification, when a net disappears or is renamed.
2015-01-22 13:06:34 +01:00
jean-pierre charras bb7a74f58f Pcbnew: fix Bug #1404191 (Zone filling fails when a zone inside having the same net and a highter priority exists, which is allowed to manage different fill parameters ) 2014-12-19 20:09:53 +01:00
jean-pierre charras 479af2a7a8 Pcbnew, export Solder masks in Gerber Format: fix not working export when the solder mask minimal width is not 0 (the exported shapes were the same as if the vule = 0) with boost version >= 1.56
This is due to the fact the boost::pylygon function resize ( a inflate/deflate function) used for calculations does not work with boost version >= 1.56.
Use Clipper  inflate/deflate function instead. It is faster and works fine.
2014-12-01 15:54:33 +01:00
jean-pierre charras 25a801ed8a Modify usage of Inflate/deflate polygon in zone calculations, in order to be compatible with boost::polygon >= 1.56
Some code cleanup.
2014-11-30 18:07:02 +01:00
jean-pierre charras 24f516f6ae Fix many doxygen warnings (due to missing info, old comments, typo ...) when building the doxygen doc. 2014-11-02 17:25:04 +01:00
Dick Hollenbeck ab51a49c5a fix zones 2014-06-24 13:30:39 -05: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