Commit Graph

66 Commits

Author SHA1 Message Date
Alex Shvartzkop 10e2e4a12d Another try at fixing arcs.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15471
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15469
2023-08-22 16:10:58 +03:00
jean-pierre charras 54b4f0e673 Gerbview: Aperture Macro: handle overwriting of variables
Gerbview did not handle redefinition of variable like $3 = $3 / 2
This redefinition is sometimes found in Gerber files.
This is a long standing issue now fixed.
Fixes #7222
https://gitlab.com/kicad/code/kicad/issues/7222
2023-02-11 18:22:29 +01:00
jean-pierre charras efe49ecfd2 Gerbview: replace ARC_HIGH_DEF (defined for Pcbnew) to a suitable value
ARC_HIGH_DEF is set to 5 microns in Pcbnew units, but Gerbview do not use
Pcbnew units, so ARC_HIGH_DEF was a too large value, creating rough arcs.
2023-02-11 10:20:30 +01:00
jean-pierre charras 00374f0a75 Gerbview: code refactor: change name of a member:
GERBER_DRAW_ITEM::m_Polygon -> m_ShapeAsPolygon
No actual code change.
2023-02-10 11:50:20 +01:00
jean-pierre charras fa1591d021 Gerbview: code refactor: change name of a D_CODE member:
D_CODE::m_Shape -> m_ApertType (it is not a shape, it is a aperture type)
Fix also an outdated/incorrect comment
No actual code change.
2023-02-10 11:20:16 +01:00
jean-pierre charras 0d0c9aee3a Gerbview: code refactor: change name and type of a member:
GERBER_DRAW_ITEM::m_Shape -> m_ShapeType of type GBR_BASIC_SHAPES
Minor coding style fix.
2023-02-10 10:09:35 +01:00
Jeff Young b09a106880 Split gerbview diff and xor into two separate view modes.
Fixes https://gitlab.com/kicad/code/kicad/issues/10122
2022-11-18 15:29:16 +00:00
Marek Roszko 3d5913c825 Remove convert_to_biu.h, merge contents to base_units.h 2022-09-16 21:09:28 -04:00
Marek Roszko a8613ee80f Combine Iu2Millimeter & remove PcbMm2iu 2022-09-16 21:09:26 -04:00
Jeff Young b95d9d660d Move gerbview colors to preferences dialog. 2022-09-10 16:11:24 +01:00
jean-pierre charras 9626f0b66c Gerbview: fix a minor but annoying issue about the drawing sheet color.
The color was not always the selected color but sometimes the default color.
2022-09-08 20:34:32 +02:00
jean-pierre charras 0b233d593a Gerbview: fix missing pad shapes when exporting to Pcbnew. 2022-09-08 18:43:07 +02:00
Jeff Young ebe9617e77 More EDA_RECT expungification, and an attempt to fix the python test. 2022-08-31 17:19:48 +01:00
jean-pierre charras 9108404efe Gerbview: seriously speed up the calculation time to draw polygons on OpenGL.
Mainly CacheTriangulation() was creating triangles using partition mode.
But this mode is optimized for Pcbnew and Gerbview and different internal units.
Now CacheTriangulation() is used in no partition, much faster in GERBVIEW_PAINTER.
Fixes #11549
https://gitlab.com/kicad/code/kicad/issues/11549
2022-05-13 18:20:35 +02:00
Jeff Young 92a229eec7 ADDED separate user-defined color for page limits.
Fixes https://gitlab.com/kicad/code/kicad/issues/5271
2022-03-24 14:11:41 +00:00
Jeff Young 4e3109a633 Wide string decls for gerbview. 2022-02-05 22:34:45 +00:00
Jeff Young e84c574830 Some more EDA_ANGLE cleanup. 2022-01-16 19:16:18 +00:00
Jeff Young 8f7d2dd06a More VECTOR2D -> VECTOR2I and wxPoint cleanup. 2022-01-11 14:20:14 +00:00
Marek Roszko c4c56de708 Neurotically update position wxPoint usages 2022-01-01 11:55:51 -05:00
Jeff Young 86cb57f4a7 Cherry-pick TEXT_ATTRIBUTES and EDA_ANGLE from rockola/kicad-strokefont 2021-12-28 22:15:20 +00:00
Jeff Young 9ee28ea8f5 Flatten out some more preferences. 2021-12-24 15:43:20 +00:00
jean-pierre charras 36048fa436 OPENGL_GAL::DrawArcSegment(): use a better number of segm to approximate the arc.
Previously, the count of segments used a magic number optimized for Pcbnew.
This is not good, and does not work well on Gerbview.
The count uses now a max error acceptable is approximation (5 microns in Gerbview and Pcbnew).
Fixes #9101
https://gitlab.com/kicad/code/kicad/issues/9101
2021-09-06 16:36:47 +02:00
Mike Williams 30987cebfe Gerbview: fix cairo negative items and implement real differential mode
Layers with negative objects need to be drawn in a subsurface before
copying so they don't _CLEAR the draw items below them when a negative
object is drawn.

Differential layers are basically the same thing only they use a
different copying operation onto the layers below.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/1863
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4495
2021-08-31 12:43:53 +00:00
jean-pierre charras 928225e467 Gerbview, Cairo engine: slightly better handling of negative objects.
However, OpenGL engine is much better.
2021-08-19 10:01:31 +02:00
jean-pierre charras a9aae9b3f7 Gerbview: Polygon shape: store its drawing coordinates to avoid rebuild them.
Previously, draw coordinates (and especially cache triangulation) were rebuild
each time the polygon was redraw. They are now cached. This is a significant
speed up, especially when a polygon is highlighted.
2021-08-18 10:01:29 +02:00
jean-pierre charras 1dbd4fcb7d Gerbview: clear all previous highlight selections, after clearing all layers.
Fixes #8893
https://gitlab.com/kicad/code/kicad/issues/8893
2021-07-30 15:52:28 +02:00
jean-pierre charras c1197903e4 Gerbview: fix regression: missing DCode highlight commands.
DCode selected by context menu or from toolbar is now highlighted.
2021-03-13 18:45:33 +01:00
Jeff Young cad5198ab7 Worksheet -> (industry standard) Drawing Sheet. 2021-02-22 17:35:46 +00:00
Marek Roszko 12d21e34e2 Remove trigo.h from eda_text.h 2020-10-13 23:37:48 -04:00
Jeff Young bb753aaadf Clean up terminology around active & high contrast layers. 2020-10-03 22:55:34 +01:00
Jeff Young cc617b715f Implement hypertext links for intersheet references. 2020-10-02 21:18:34 +01:00
Ian McInerney 61cdf3436b Ensure PAINTER::Draw routines properly handle EDA_ITEM casting
EDA_ITEM is a child of VIEW_ITEM, so a static_cast is not appropriate,
since in some cases it could be called with a non-EDA_ITEM argument.
This was triggering an ASAN heap-buffer-overflow in GerbView.
2020-08-16 12:37:51 +01:00
Jon Evans bd14f8a82a ADDED: New appearance control widget for PcbNew
Featuring:
- Layer view presets
- Per-type opacity for tracks, vias, pads, zones
- Net and netclass color and visibility controls

CHANGED: Simplified object visibilty controls

Fixes https://gitlab.com/kicad/code/kicad/-/issues/1951
Fixes https://gitlab.com/kicad/code/kicad/-/issues/1981
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2003
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2173
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2254
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4325
2020-08-15 15:24:28 -04:00
jean-pierre charras 8c15ecf8e4 Gerbview: fix issues when setting the grid color and the worksheet color.
The issue for the grid color was due to the fact there are 2 places to
store the color: the color settings and the m_gridColor GERBVIEW_FRAME member.
The worksheet color (color set to RED after a color change in layer render)
is a bit strange: looks like LAYER_GERBVIEW_WORKSHEET and LAYER_WORKSHEET
are both used to draw the worksheet.
2020-07-08 18:49:12 +02:00
Jon Evans e59a3d981e Implement a new settings framework across all of KiCad
CHANGED: Settings are now stored in versioned sub-directories
ADDED: First-run dialog for migrating settings from a previous version
CHANGED: Settings are now stored as JSON files instead of wxConfig-style INI files
CHANGED: Color settings are now all stored in a separate settings file
CHANGED: The symbol editor and footprint editor now have their own settings files
CHANGED: Color settings are no longer exposed through BOARD object
CHANGED: Page layout editor now uses Eeschema's color scheme

Settings are now managed through a central SETTINGS_MANAGER held by PGM_BASE.
Existing settings will be migrated from the wxConfig format on first run of each application.
Per-application settings are now stored in one class for each application.
2020-02-19 23:44:56 -05:00
jean-pierre charras baa1db031e Fix incorrect arc bounding box calculation.
add comments to SHAPE_ARC ctor.
2020-01-03 14:27:00 +01:00
jean-pierre charras 962baf8b6c Gerbview: fix crash or incorrect drawings after code change in shape_line_chain 2019-12-14 10:14:50 +01:00
Seth Hillbrand c4d853c1e8 SHAPE_LINE_CHAIN: Remove element access
This is the first step to allowing non-segments in the line chain.
External routines cannot be allowed to change the line chain without
going through the internal routines.  To accomplish this, we remove the
Vertex() and Point() access routines and only leave the const versions.
Transformations are given for both points as well as the chain itself.
2019-12-12 13:54:48 +00:00
Seth Hillbrand 6625d0721e Implement Get/Set display options
The pointer passing for display options is deprecated.  This removes the
excess casting as the EDA_FRAME didn't need the base call with no value.
All requests for display options are now returned const and are updated
with a Set() routine after modification.

In Gerbview, this resolves an issue where the display options were not
stored because it was receiving the NULL from EDA_FRAME.
2019-11-07 08:26:44 -08:00
Seth Hillbrand 4a52062a54 GAL: Make high-contrast meld into background
This mixes the de-emphasized layers into the background color rather
than merely a black color.  This also keeps some of the original layer
color.

Fixes: lp:1831316
* https://bugs.launchpad.net/kicad/+bug/1831316
2019-06-09 08:16:58 -07:00
jean-pierre charras 63eb552e0a Fix issue in cairo_gal when drawing a 360 deg arc (in fact a circle).
It was due to a angle normalization between -360 and 360 degrees.
So, in arcs, if the start angle and end angle diff is n*360 deg,
this normalization gives start angle = end angle.
The fix forces end angle = start angle+360deg in this case.

Fixes: lp:1832096
https://bugs.launchpad.net/kicad/+bug/1832096
2019-06-09 11:06:00 +02:00
Seth Hillbrand c4fe6785ad gerbview: Fix arc filling
Arcs in gerbview should not be filled.

Fixes: lp:1817246
* https://bugs.launchpad.net/kicad/+bug/1817246
2019-02-21 21:26:10 -08:00
Tomasz Włostowski bbee30671a gal: pixel alignment hacks, works for Retina display too now.
gal: pixel alignment for Cairo.
gal: pixel alignment for OpenGL

Cleanup of pixel alignment patches

gal/opengl: more pixel alignment patches:
- works on Retina displays now
- pixel alignment for circles
- correct 1-pixel strokes
- fixed unfinished 1-pixel line ends

GAL: Restore antialiasing options in Cairo
GAL: Fix arc drawing

Removes DrawArcSegment, which drew arcs whose edge was optionally
stroked (a feature that we did not use).  Fixes Cairo arc drawing issue
where arcs were not visible in pcbnew.

gal: further cleanup
gal: removed unused shader parameter
2019-02-16 20:03:13 +01:00
jean-pierre charras 388397f97d Protect TesselatePolygon() against degenerated polygons (less than 3 corners) to avoid crashes.
Use TesselatePolygon() to draw polygons in Gerbview instead of GLU tesselation, much slower.
Add helper methods in GAL to know if the current GAL engine is Cairo, OpenGL or something else,
useful to optimize drawing code.
2018-12-18 12:49:14 +01:00
jean-pierre charras 2cb4187f52 Gerbview: small fix to speed up switching to opengl canvas.
* workaround to speed up switching canvas from legacy or Cairo to opengl (this is a workaround, not a fix)
2018-12-03 18:31:36 +01:00
jean-pierre charras 73b52f2e23 Gerbview: fix incorrect initialization of WorldUnitLength.
Fix incorrect min zoom level to show D Code texts.
2018-11-20 10:27:59 +01:00
jean-pierre charras ffe4b745dd Opengl gal: Fix bug: segments with 0 length are not drawn. However the are equivalent to circles.
Using 0 length segments happen with oval pads having the same X and Y size, and in some other cases.

Fixes: lp:1801923
https://bugs.launchpad.net/kicad/+bug/1801923
2018-11-15 13:10:42 +01:00
Jeff Young 9dfcc839a4 Fix color issues with cursor and sheet pins. 2018-10-09 11:08:56 +01:00
Maciej Suminski 40a3b4a533 GERBVIEW_RENDER_SETTINGS: verify item type
Not all items displayed by Gerbview are GERBER_DRAW_ITEMs (e.g. WORKSHEET_VIEWITEM),
so appropriate checks have been added.
2018-09-18 15:18:55 +02:00
Jeff Young a747d074c4 Add Worksheet to Render Items for GerbView.
Also added PCB Background Color.

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

(cherry picked from commit f789ef1)
2018-07-17 15:13:43 +01:00