Commit Graph

916 Commits

Author SHA1 Message Date
jean-pierre charras 34ccd0f004 Pcbnew: prepare the new zone filling algo (filled polygons with no thickness). Work in progress. 2019-06-04 09:39:17 +02:00
Jeff Young e517199794 Move ConfigurePaths and LibTable management to common ACTIONs. 2019-06-03 21:08:30 +01:00
Jeff Young 6ac273264d Move Show3DViewer to common action. 2019-06-02 16:21:44 +01:00
Seth Hillbrand 6a45446496 pcbnew: Remove the last dlist from modules/pcbnew 2019-06-01 20:55:32 -07:00
Seth Hillbrand 9163ac543a pcbnew: Move pads to std::deque 2019-06-01 16:23:54 -07:00
Seth Hillbrand 888c01d11b pcbnew: Move tracks to std::deque 2019-06-01 09:53:23 -07:00
Seth Hillbrand d1877d7c1b Moving modules from DLIST to std::deque 2019-06-01 09:53:23 -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
Jeff Young a1b3e5d9bb Move PLEditor title updating to somewhere it will get called.
Also cleans up some uncalled stuff.
2019-05-24 21:23:26 +01:00
Seth Hillbrand ac435ecd68 Moving further arc approximations down
This corrects an issue with fill segments-per-circle and moves the error
to segmetns calculation down in a number of functions to expose the
single value for approximation
2019-05-22 14:35:17 -07:00
Jon Evans 20800d03b7 Ensure 3D viewer toolbar is properly created 2019-05-20 20:34:24 -04:00
Jeff Young 7d9a0b06e0 Push help menu down into EDA_BASE_FRAME. 2019-05-18 13:14:08 +01:00
Seth Hillbrand f347815150 3d-viewer: Fix a couple missing arc counts 2019-05-17 09:34:27 -07: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
Jeff Young 69afa27a5f Implement ACTION_TOOLBAR and update some of the menus to ACTION_MENU.
This gives us better separation of MVC in line with the design of
the modern toolset.  It also reduces a whole bunch of duplicated
data.
2019-05-15 17:50:52 +01:00
Henner Zeller 2aea26de1e Raytracing - a more pleasing way sequencing blocks to render. 2019-05-14 09:27:16 -04:00
Mario Luzeiro b9a17b928a Fixes lp Bug #1828747 - Add some epsilon value to ray dir on orthographic mode
so they will not be zero when viewing the board com the top/bot.
This was causing problems with BBox intersect function that was using
invDir values.
2019-05-14 10:15:59 +02:00
Seth Hillbrand f37ee5c2b3 Remove unused LRU cache 2019-05-13 09:18:26 -07:00
John Beard 18593d2dbb 3D viewer: decouple renderers from wxCursors
Provide a toolkit-agnostic interface for "busy indicators", which
allows the 3D viewer to show a busy cursor, without the canvases
having to to know how a wxCursore works.

The motivation here is to decouple the 3D renderers from the WX
GUI system, as they can then be used when when there is not an
active window (e.g. for offscreen rendering).

Otherwise, attempting to use a wxBusyCursor without a GUI
available is an instant segfault.
2019-05-12 14:19:39 +01:00
Seth Hillbrand 89d2e67e45 3d-viewer: Refresh raytracing on rotate 2019-04-09 15:01:06 -07:00
Seth Hillbrand 707e7b4b65 3d-viewer: Force canvas refresh before screenshot
In some linux configurations, the canvas refresh must be posted before
being handled.  Simply requesting the refresh can queue the event,
preventing an up to date GL canvas from being saved.

Fixes: lp:1819536
* https://bugs.launchpad.net/kicad/+bug/1819536
2019-04-09 14:47:11 -07:00
John Beard 8548e69382 3D viewer: update icons from common settings
Use the icon scaling logic and call a toolbar rebuild when the
common settings change (echos the handling in Pcbnew and friends).

Remove an unused function.
2019-04-08 14:29:15 +01:00
John Beard 124dd5e59a 3D viewer: use hi-DPI settings for canvases
The 3D viewer also uses OpenGL, so it also needs to
adjust based on DPI scale factors.

This patch moves the 3D viewer common config code solely
within the 3D viewer, and adds handling of the DPI scale. This
also avoids duplicated logic in PCB_BASE_FRAME::CommonSettingsChanged.

For now, as EDA_3D_VIEWER is not included in the Kiway settings
dispatch, still manually invoke the settings update from
PCB_BASE_FRAME.

The PANEL_3D_PREV gets a similar function to read the config, but
it doesn't have a listener for the update, so it's set just once
at dialog init, just like the existing pan settings.

Fixes: lp:1823681
* https://bugs.launchpad.net/kicad/+bug/1823681
2019-04-08 14:29:15 +01:00
Jeff Young 1ae47b6069 Implement a copper-to-edge-clearance setting.
For legacy boards, the setting is picked up from the board outline
thickness.  If the board outline has mixed thicknesses, then the
max is used and a warning is displayed.

Fixes: lp:1797787
* https://bugs.launchpad.net/kicad/+bug/1797787
2019-04-05 22:18:44 +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
Jeff Young e71b215963 Restore 3D canvas to full size on Retina displays. 2019-02-19 16:18:11 -07:00
John Beard e6a6266f3d Build: libpolygon provides its own includes
Libpolygon can provide its own includes via target_include_dirs PUBLIC.
This means any linking targets do not need to specifiy them manually.

As common requires polygon, the polygon dep is also now no longer
required downstream of libcommon, as it's transisitvely implied
by libcommon's target_link_libraries.

This resolves a circular dependency previously detected and also
simplifies CMakeLists.
2019-02-04 19:29:31 -08:00
Seth Hillbrand 4a641ec5ea 3d-viewer: Center the about window
Fixes: lp:1814412
* https://bugs.launchpad.net/kicad/+bug/1814412
2019-02-04 07:18:52 +01:00
jean-pierre charras 098d9bf056 3D viewer: Fix: board outlines ignored in 3D for triangular board shapes
Fix also a few minor coding style issues.

Fixes: lp:1814324
https://bugs.launchpad.net/kicad/+bug/1814324
2019-02-02 17:59:53 +01:00
jean-pierre charras 4543bde56b Minor enhancements in 3D viewer hotkey code 2019-01-31 21:03:38 +01:00
Wayne Stambaugh 75f18cfe62 3D Viewer: disable ray tracing for OpenGL less than 2.1.
Add code to parse OpenGL version string and determine if ray tracing is
supported.

Rationalize ray tracing menu and toolbar to have the same behavior so
a single command ID can be used for setting states.

Fixes lp:1797500

https://bugs.launchpad.net/kicad/+bug/1797500
2019-01-19 08:03:09 -05:00
Wayne Stambaugh 4f0749b0b4 3D viewer: fix update UI event infinite loop.
Lay groundwork to fetch OpenGL version for disabling ray tracing when the
current OpenGL version lacks proper support.
2019-01-13 14:05:21 -05:00
Seth Hillbrand 6f5a7b3ab7 3d-viewer: Clear memset warnings
C++11 can clear by empty copy-constructor
2019-01-09 21:43:23 -08:00
jean-pierre charras 3dd5a912b6 remove dead code. 2019-01-07 19:42:18 +01:00
Seth Hillbrand 1e5ba6f1b1 Replace DIM() macro
The standard DIM() macro was not typesafe as it happily deferred errors
to runtime that can be caught at compile time.  Replacing it with a
generic C++11 constexpr allows for typecasting, comparison and compile
time error checking.
2019-01-06 08:43:12 -08:00
Seth Hillbrand 3b54a44540 wildcard strings update
Replace a few other cases where we used Windows-only or *nix specific
wildcard strings
2019-01-05 20:26:45 -08:00
Seth Hillbrand a46f5c3af5 3d-viewer: Clamp inner radius of rings
Thick segments can cause radius to be set negative.  Effective radius of
these segments should be 0.

Fixes: lp:1803797
* https://bugs.launchpad.net/kicad/+bug/1803797
2019-01-04 16:49:21 -08:00
Seth Hillbrand 25f8b1ce72 pcbnew: Update multiple zone segments
Where we can get away with lower segment counts (localizing an anchor),
we keep the low-def 16 segment count.  Intermediate values and values
that are visible to the user are set to high definition.  Most are
simply hints to the inflation correction but where they show, the user
show see smooth lines.
2019-01-03 17:34:59 -08:00
Seth Hillbrand 6662891f34 string update: Help->List hotkeys
The hotkey name "Help (this window)" does not describe what the hotkey
and associated action does.  It displays the current hotkey list, so the
action name should reflect that behavior
2019-01-02 15:44:13 -08:00
Stefan Brüns 9490fd9d30 Use absolute path CMAKE_INSTALL_FULL_LIBDIR for 3d viewer PLUGINDIR
Currently, the plugindir in the plugin manager is constructed as
{CMAKE_INSTALL_PREFIX}/bin/../{CMAKE_INSTALL_LIBDIR}/kicad/..., while
CMakes install uses {CMAKE_INSTALL_LIBDIR}/kicad/...

In case CMAKE_INSTALL_LIBDIR is a relative path "install" prefixes it
with CMAKE_INSTALL_PREFIX and both paths happen to match, otherwise
the constructed path ends up as e.g. "/usr/bin/../usr/lib/kicad/...".

For these cases where an absolute path is wanted CMake provides the
CMAKE_INSTALL_FULL_<dir> variants which works the same as
CMAKE_INSTALL_<dir> when used as DIRECTORY for install.
2018-12-11 14:28:01 -05:00
Seth Hillbrand 0769b0409f 3d-viewer: Remove threading on middle layer
The middle layer of the 3d contours does not need threading as it does
not have substantial calculations.  It also contains has a few
wx*Asserts that may not be called from other than the main thread.
Rather than remove useful error checking, we remove excess threading.

Fixes: lp:1802940
* https://bugs.launchpad.net/kicad/+bug/1802940
2018-12-10 19:51:32 -08:00
Seth Hillbrand 47fe01f793 3d-viewer: Remove duplicate call
Simplify is called by GetBoardPolygonOutlines(), it does not need to be
called a second time.
2018-12-09 07:52:58 -08:00
Wayne Stambaugh c7998cfc23 3D Viewer: fix screenshot file extension bug with GTK+
Append the appropriate file extension to the file name if the file name
does not have a file extension.  This is a know issue with the GTK+ file
dialog.

Make the last 3D viewer screenshot last file used code more coherent.

Add the 3D viewer main frame trace string to the trace environment
variables doxygen group.

Doxygen comment and other minor code cleaning.

Fixes lp:1804980

https://bugs.launchpad.net/bugs/1804980
2018-12-08 08:20:32 -05:00
jean-pierre charras 90139d540c 3D viewer: Fix hanging when a board is displayed in non realistic mode and the body is not shown. 2018-11-26 15:58:54 +01:00
jean-pierre charras a3b82d770e dialog_3D_view_option_base.cpp: fix a minor wxWidgets alert. 2018-11-26 14:49:06 +01:00
jean-pierre charras 65a967dca1 Fix minor I10n issues. 2018-11-18 14:40:36 +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
Mario Luzeiro 350a6052c0 Fixes 3D Viewer: Raytracing line artifact, lp:1680530 2018-11-14 09:46:03 -05:00
John Beard e52688586a Don't use memset to initialise aggregate of floats.
In C3D_RENDER_OGL_LEGACY::setupMaterial(), the struct
m_materials (which is made up of floats and glm::vec3f's)
is initialised with a memset to 0. This is unsafe, as
floating point value representations in C++ are implementation-
defined (so 0 in memory is not 0-valued for sure).

Use empty-brace aggregate-initialisation, which does the right thing.
2018-11-13 13:37:59 -05:00
jean-pierre charras 830c5e7db7 3D viewer: ensure 0 sized circles (that crash the viewer) are skipped. 2018-11-05 08:30:54 +01:00
Seth Hillbrand df562b7ec0 pcbnew: Prevent degenerate values in Eagle import
Importing Eagle files allowed for invalid zone values for clearance and
minimum width that triggered asserts in the 3d-viewer.

Fixes: lp:1801188
* https://bugs.launchpad.net/kicad/+bug/1801188
2018-11-04 11:01:08 -08:00
Simon Richter abe1ffabda Replace WIN32 preprocessor symbol by the official symbol _WIN32, used almost everywhere 2018-10-20 09:22:24 +02:00
jean-pierre charras 7df4ddc74d Use our DIALOG_COLOR_PICKER in 3D viewer to set a color.
the wxWidgets color picker is not the best for the 3D viewer that does not use transparency color.
2018-10-13 08:23:14 +02:00
jean-pierre charras dbc9130da9 Fix: 3D footprint preview does not zoom using mouse wheel (Windows specific)
This was due to clicking on the preview canvas does dot give the focus to the canvas on Windows.
Now the focus is set when clicking on this canvas.

Fixes: lp:1794090
https://bugs.launchpad.net/kicad/+bug/1794090
2018-10-12 13:41:44 +02:00
Seth Hillbrand ddea4e11d1 3d-viewer: Fix intersection bug
Bounding box check always returned false, leading to incorrect BBox
checks when one bbox is interior to the other
2018-10-11 14:47:06 -07:00
Tomasz Wlostowski e439b17fa1 eeschema-gal: make sure all other Kicad apps compile after eeschema gal hacks 2018-10-09 11:08:52 +01:00
Jeff Young 86b654e493 Hook up 3D viewer to common preferences.
Also removes nanny limits on text sizes.

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

Fixes: lp:1794345
* https://bugs.launchpad.net/kicad/+bug/1794345
2018-09-25 20:47:03 +01:00
Seth Hillbrand f8784f30a8 Removing OpenMP
This commit finishes the removal of OpenMP from the KiCad codebase.
Removed in this commit are the OpenMP calls in 3d-viewer and
qa/polygon_triangulation as well as all references in CMakeLists.txt

std::thread is used instead for multithreaded computation
2018-09-21 12:44:20 -07:00
Seth Hillbrand d139a49690 3d-viewer: corrected rrect zero-length radius
Previous commit mistakenly included the full clearance for the rounded
rectangle circle.  The CFILLEDCIRCLE2d takes the radius rather than the
diameter.
2018-09-20 08:52:41 -07:00
Seth Hillbrand 8efcf81cf5 3d-viewer: Approximate 0-length element is rrect
Apply same logic of using a filled circle to represent a zero-length
element as a filled circle with radius of the line.

Fixes: lp:1785823
* https://bugs.launchpad.net/kicad/+bug/1785823
2018-09-19 20:19:37 -07:00
Seth Hillbrand 8999f4604f 3d-viewer: Require simplified polygons
3d viewer requires simplified polygons not just for triangulation but
also for its own internal routines.

Fixes: lp:1793085
* https://bugs.launchpad.net/kicad/+bug/1793085
2018-09-18 09:35:30 -07:00
Jeff Young 02a3f83040 Implement poor-man's RTTI for use over KiWAY.
Fixes: lp:1777883
* https://bugs.launchpad.net/kicad/+bug/1777883
2018-09-15 20:06:42 +01:00
jean-pierre charras df5aafc481 3D viewer: Better axis rotation when selecting "Bottom view"
It allows keeping texts on bottom side readable (rotation similar to the Flip board view in board editor)
2018-09-13 09:03:58 +02:00
Seth Hillbrand c1c89d13ff 3d-viewer: Check for at least 3 segments in circle
Fixes: lp:1792173
* https://bugs.launchpad.net/kicad/+bug/1792173
2018-09-12 19:34:55 +01:00
Maciej Suminski 18c38bd60e Fixed a shadowed variable warning 2018-09-10 10:06:17 +02:00
Seth Hillbrand a6325aab29 Replacing Tesselation
Replaces Poly2Tri with updated code to process polygons faster and more
robustly.  Notably, we can now handle overlapping holes in the polygons,
allowing us to cache the triangulation of complex boards
2018-09-01 19:30:50 -07:00
Wayne Stambaugh 825f57d912 Fix build error with Boost 1.68.
The Boost folks kindly decided to move the sha1.hpp header file location
so check the Boost version to include the proper header path.

Clean up debug trace code.
2018-08-24 08:34:45 -04:00
Jeff Young d81faa72c9 Overhaul border drawing in all the Kicad frames.
Primary change is to replace most control/window borders with
AUI pane borders.  We implement our own AUI border drawing
routine which avoids the ugly one-pixel white frames around
dark canvasses.

Also increases the signal-to-noise ratio of all the pane
creation code in the various frames.
2018-08-11 17:25:38 +01:00
Wayne Stambaugh 8e7d6063fd Minor dialog and frame window improvements.
Drop all uses of wxRAISED_BORDER and wxSUNKEN_BORDER from dialogs and
panels used in main frame windows.

Drop use of wxSP_3DSASH options on all wxSplitterWindow definitions.

Minor dialog alignment and spacing fixes.
2018-08-02 13:00:41 -04:00
jean-pierre charras ce3760438c Fix a few wxWidgets minor asserts. Fix also a missing bitmap button initialization.
Fixes: lp:1783703
https://bugs.launchpad.net/kicad/+bug/1783703
2018-08-02 13:22:11 +02:00
jean-pierre charras 3c6e8c4a40 More support of DRW_SEGMENT Bezier curve (support in 3D viewer, and PnS router). 2018-07-22 18:39:48 +02:00
Jeff Young 3a9e98c8c7 Don't put artificial limit on rotation string length.
Fixes: lp:1782753
* https://bugs.launchpad.net/kicad/+bug/1782753

(cherry picked from commit 4b67fec)
2018-07-21 21:28:11 +01:00
Jeff Young ea3ef1eb87 Don't lose model filepath when writing spin boxes back.
Also renames a bunch of stuff to be clearer.

Fixes: lp:1782753
* https://bugs.launchpad.net/kicad/+bug/1782753
2018-07-20 21:59:12 +01:00
Jeff Young a4c5e2c82f Fix focus issues with dialog previews.
Use SetStealsFocus() to fix the Pad Properties dialog, and remove
mouse-enter-kill-focus to fix 3D preview in Footprint Properties
dialog.

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

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

(cherry picked from commit e0c1fc9)
2018-07-17 15:13:47 +01:00
Jeff Young 0010ad37d1 In-place editing for footprint TEXTE_MODULEs.
Fixes: lp:1102168
* https://bugs.launchpad.net/kicad/+bug/1102168

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

(cherry picked from commit 83781ab)
2018-07-17 15:11:04 +01:00
Jeff Young 8f0aa68ab8 Fold 3D Search Paths dialog into Configure Paths.
Use in-place editing for both.

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

(cherry picked from commit 33622cd)
2018-07-17 15:11:01 +01:00
Jeff Young a39fb03822 Remove some references to g_UserUnit
(cherry picked from commit 614d832)
2018-07-17 15:09:56 +01:00
Carsten Schoenert 9f7109826d fix misspelled 'allows to' -> 'allows one to'
Fixup small grammar issues around used 'allows to ...' almost in
code comments.
2018-07-11 10:35:03 -04:00
Seth Hillbrand f6bd6b1360 3d: Replace glFinish with glFlush
glFinish is meant to ensure every aspect of the screen is fully-drawn
before continuing.  This causes issues with certain chipsets (Intel
4-8k)

glFlush is more of a suggestion that CPU work is complete and the GPU
should complete its work in a "timely" fashion.

We add an additional glFinish call before getting a screenshot as this
will copy the actual data from the card buffer.

Fixes: lp:1775976
* https://bugs.launchpad.net/kicad/+bug/1775976
2018-06-13 15:32:18 -07:00
Jeff Young a300006956 Fix dialog layout of Add 3D Shape.
Fixes: lp:1747652
* https://bugs.launchpad.net/kicad/+bug/1747652
2018-06-06 00:01:47 +01:00
Jeff Young 10ec39a107 Move 3D file error messages to tracePathsAndFiles key.
Fixes: lp:1772255
* https://bugs.launchpad.net/kicad/+bug/1772255
2018-05-21 13:18:41 +01:00
Jeff Young 3a8a718e43 A pesky bug, this one is. (Said in best Yoda impression.)
There were two examples of the somewhat annoying error message.
This gets the second one.

Fixes: lp:1772255
* https://bugs.launchpad.net/kicad/+bug/1772255
2018-05-21 00:19:55 +01:00
jean-pierre charras 6e5131be5a Minor fix in fp editor and fp viewer: display the fp info instead of the useless board info.
board info makes sense only in board editor, not in fp editor and fp viewer.
2018-05-12 10:44:31 +02:00
jean-pierre charras e339007d22 3D viewer: fix some issues when opened from a frame and changes are made in a other frame:
* Refresh the view only when changes are made in the caller frame.
* Allows recreate a new instances when try to open the 3D view from a frame taht is not the initial caller
* Remove duplicate code in kicad frames.
2018-05-10 12:49:20 +02:00
jean-pierre charras 4cc62ce038 3D viewer: minor enhancement: display the name of the 3D shape being loaded. 2018-05-08 16:07:09 +02:00
Jeff Young aa7da5dfcd Treat ${...} and $(...) envvar references uniformly.
Fixes: lp:1769282
* https://bugs.launchpad.net/kicad/+bug/1769282
2018-05-05 23:40:40 +01:00
Thomas Pointhuber cad2d0656c Remove Items from Menubar of 3D Viewer which are available over dialog 2018-05-05 12:33:04 -04:00
Thomas Pointhuber 32af04c6a6 Adjust Menubar of 3D Viewer to common style 2018-05-05 12:28:09 -04:00
jean-pierre charras ccb668c105 3D viewer: fix polygon contours of pads solder paste when solder paste ratio was not null.
(the oval and round rect pads 3D contours were incorrect)

Fixes: lp:1767209
https://bugs.launchpad.net/kicad/+bug/1767209
2018-04-28 20:31:50 +02:00
jean-pierre charras 458f9f5c97 3D viewer: fix incorrect calculation of pad shapes with clearance (i.e. pad shapes on solder paste and solder mask layers)
Fixes: lp:1767209
https://bugs.launchpad.net/kicad/+bug/1767209
2018-04-28 12:41:43 +02:00
Jeff Young 09a6bada03 Delegation of keyEvents from 3D toolbar to 3D canvas.
Fixes: lp:1759803
* https://bugs.launchpad.net/kicad/+bug/1759803
2018-04-25 14:19:32 +01:00
Wayne Stambaugh fc8b852c41 Derive 3D model selection dialog from DIALOG_SHIM. 2018-04-20 10:15:05 -04:00
jean-pierre charras 9865fcd929 3D viewer: fix hotkeys in 3D preview panel, and incorrect icons in context menu. 2018-04-17 09:59:21 +02:00
jean-pierre charras 8fcdc4f6c3 3D viewer: fixes about hotkeys and menubar.
Move code to specific files 3d_menubar.cpp and hotkeys.cpp like in other tools.
2018-04-15 14:07:33 +02:00
Seth Hillbrand 86f744a1fd Adding initialization to GLM vectors 2018-04-11 10:59:28 -07:00
Ievgenii Meshcheriakov 18b0b78397 Correctly initialize module matrices in raytracer
Initialize module matrices to identity matrices instead of default zero
matrices while creating scenes for raytracer. This fixes disappearing
modules in raytracer view.

Fixes: lp:1763026
* https://bugs.launchpad.net/kicad/+bug/1763026
2018-04-11 10:06:36 -07:00
jean-pierre charras 20c30a4425 3D viewer: Cosmetic enhancement in DIALOG_3D_VIEW_OPTIONS. 2018-04-09 19:37:17 +02:00
Carsten Schoenert a11714b1a4 fix misspelled 'an other' -> 'another' 2018-04-08 13:24:37 -04:00
jean-pierre charras 7f6e26e55a DrawGraphicText: remove a static variable, and replace it (when needed) by a new parameter in argument list.
It make this function thread-safe (as far as wxString is thread-safe)
2018-04-07 19:57:26 +02:00
Jeff Young 0dc719ca1a Update 3D view immediately when user changes parameters.
The ray-tracer runs in the background so you can still change
other settings while it's redrawing.

Fixes: lp:1612419
* https://bugs.launchpad.net/kicad/+bug/1612419
2018-04-06 17:03:00 +01:00
Jeff Young cd0cd242d1 Move 3D polygon approximation to absolute-error algorithm.
Also inflates via and pad hole polygons to bisect their circles.

Fixes: lp:1758137
* https://bugs.launchpad.net/kicad/+bug/1758137
2018-03-23 12:46:17 +00:00
Jeff Young b335ef0531 Don't involve user in implementation details.
Fixes: lp:1756299
* https://bugs.launchpad.net/kicad/+bug/1756299
2018-03-16 16:57:38 +00:00
Wayne Stambaugh 3f52e87224 Standardize terminology for automatic zoom to "Zoom to Fit".
Fixes lp:1753336

https://bugs.launchpad.net/kicad/+bug/1753336
2018-03-16 08:38:36 -04:00
Seth Hillbrand 7fbf7bbf42 Spelling improoved -> improved 2018-03-09 09:43:54 -08:00
Seth Hillbrand 5fea89ebd5 Standardize plural menu items 2018-03-08 12:33:32 -08:00
Maciej Suminski 5bbb4489b3 Fixed out of bounds access to m_shaderBuffer array in 3D viewer raytracer 2018-03-05 17:49:34 +01:00
Bernhard Stegmaier a786078747 Fix clang-mp build error (don't declare const variables as being firstprivate) 2018-03-04 12:22:12 -05:00
Jeff Young b3884669cf Proper error reporting for Annotate dialog.
Also fixes:
- forcing the annotation scope to "full schematic" when run
  as a prerequisite to Generate Netlist.

- a long-standing bug where displaying extra items in a dialog
  would mess up the height of the HTML_REPORT_PANEL (becasue
  we were setting the html window's height rather than its
  parent flexgrid.

- initializing the annotation radio buttons to safe values
  (full schematic and keep existing)

Fixes: lp:1750062
* https://bugs.launchpad.net/kicad/+bug/1750062
2018-02-18 15:08:24 -05:00
Jeff Young 1afbfad44a Use "..." uniformly in menus.
See the bug report for some wording changes and a couple of
menu restructurings that were also cleaned up.

Fixes: lp:1597827
* https://bugs.launchpad.net/kicad/+bug/1597827
2018-02-10 17:32:28 -05:00
Jean Philippe EIMER e0f7958dbd Compatibility fixes for GLM 0.9.9
Fixes: lp:1746546
* https://bugs.launchpad.net/kicad/+bug/1746546
2018-02-06 13:30:13 +01:00
jean-pierre charras 5d72aebd22 Fix code after renaming files 2018-01-29 16:40:22 +01:00
jean-pierre charras 4c5bd01887 Rename a few files 2018-01-28 22:02:31 +01:00
jean-pierre charras 5d08f1a0d9 Breaks the large create_layer_items.cpp file into 2 smaller specialized files, to make changes in 3D shapes calculations more easy. 2018-01-28 14:05:17 +01:00
Wayne Stambaugh 650207a6e1 Pcbnew: fix 3D viewer panel default size issue.
The 3D viewer panel had a default size that was causing sizing issue
with the footprint properties dialog.  Set the default size to -1;-1
and set the proportion setting to 1 when adding the panel to the sizer
which allows the panel to file in the correct size.

Fixed some minor control spacing issues in the footprint properties
dialog properties tab.

Please note that is only a partial fix for this issue.  There is still
too much vertical space which is partially due to the use of wxSpinCtrl
instead of wxDoubleSpinCtrl.

Fixes lp:1742701

https://bugs.launchpad.net/kicad/+bug/1742701
2018-01-12 20:58:44 -05:00
jean-pierre charras 6f2beebf2c PANEL_PREV_3D: replace wxStaticBoxSizers by a wxBoxSiser and a static text.
On KDE, wxStaticBoxSizers do not work very well (incorrect sizes).
2018-01-11 18:14:50 +01:00
Camille f5f7ba4746 Fix loop variable copy in for-range loop, use const reference instead 2018-01-09 19:18:44 -05:00
Camille 5c4f8abd24 Fix type promotion in math function 2018-01-09 19:11:27 -05:00
Camille 9ff66a5274 Fix unnecessary value parameter detected by clang-tidy. - Replace value parameter by const reference parameter or move-assignement in some cases 2018-01-09 18:55:51 -05:00
Mark Roszko b98cc0b937 Some coverity fixes 2018-01-05 22:51:03 -07:00
Thomas Pointhuber 786ac8143e Request refresh of 3d canvas on resize event
This is a partial fix for https://bugs.launchpad.net/kicad/+bug/1695897
2018-01-05 07:25:13 -07:00
jean-pierre charras 5ca5783448 3D viewer, view options dialog: add missing option. 2017-12-28 14:14:46 +01:00
jean-pierre charras 00c2257b26 3D viewer: Remove outdated option "show holes in zones" that was no longer used in opengl mode, and useless in ray tracing
(it was only used to reduce the calculation time)
Also add a wxBusyCursor when rebuilding the 3D scene.
2017-12-28 11:01:10 +01:00
jean-pierre charras 27171e1a88 3D viewer: re-enable 3D viewer display options, and update this dialog. 2017-12-28 09:30:18 +01:00
Wayne Stambaugh 4d64a2f53f Set reasonable 3D model select dialog default path.
Passing an empty path to the 3D model select dialog results in the file
select control displaying the root path which requires the user to drill
down to get to the 3D models.  Use the KISYS3DMOD path as the default
and fall back to the project path as required for the initial file
select control path.

Clean up some coding policy violations.

Fixes lp:1737094

https://bugs.launchpad.net/kicad/+bug/1737094
2017-12-27 12:43:26 -05:00
Wayne Stambaugh 71ea6dc2b9 Common, 3D viewer, CvPcb, and Eeschema dialog tweaks.
Improve dialog layout and fix UI policy issues with all of the dialog
boxes in the common, 3D viewer, CvPcb, and Eeschema code paths.

Updated the use of component to symbol.
2017-12-26 09:38:45 -05:00
jean-pierre charras d9a2b5161c Fix issues due to internal code change in DRAWSEGMENT class, for S_POLYGON shape.
Remove also duplicate code in 3D viewer, for this DRAWSEGMENT shape.
2017-12-21 15:07:03 +01:00
Bernhard Stegmaier 0135d11412 Fix macOS pinch-to-zoom for 3d-viewer. 2017-12-18 16:26:01 +01:00
Bernhard Stegmaier 909d95b5be Create HIDPI_GL_CANVAS wrapper for transparent wxGLCanvas HiDPI/Retina support. Enable HiDPI/Retina for 3d-viewer. 2017-12-18 16:26:01 +01:00
Jon Evans 48388695ae Use explicit shift in hotkeys instead of mixed-case characters
Because of how wxMenuItem decodes the label text, the case of
alphabetic hotkeys is not preserved when displaying the menu.  So,
alphabetic hotkeys that use the Shift key must be defined this way.

Fixes: lp:1737303
* https://bugs.launchpad.net/kicad/+bug/1737303
2017-12-09 19:59:55 +01:00
jean-pierre charras 68268973b7 To avoid mistakes between graphic layers for pads, holes and not plated holes, rename 3 GAL_LAYER_ID names:
LAYER_NON_PLATED to LAYER_NON_PLATEDHOLES
LAYER_PADS_HOLES to LAYER_PADS_PLATEDHOLES
LAYER_PADS to LAYER_PADS_TH
and add comments and fix a render issue in gal mode for non plated holes.
2017-11-29 09:48:41 +01:00
Oliver b80449b069 Fixes for 3D model offset
- Display offset units in 3D preview window (inches or mm)
- Fix offset in 3D renderer
- Fix offset in Raytracing renderer
- Fix offset in STEP export
- Fix offset in VRML export
2017-11-20 17:46:03 -05:00
jean-pierre charras 10de79260d Fix an assert when starting the 3D viewer in Debug mode (Linux only)
Fixes: lp:1731344
https://bugs.launchpad.net/kicad/+bug/1731344
2017-11-17 10:20:55 +01:00
Wayne Stambaugh f3908bd87c Revert premature commit of 17ab319b, "Fixes for 3D model offset".
This reverts commit 17ab319b99.
2017-11-11 20:04:46 -05:00
Oliver 17ab319b99 Fixes for 3D model offset
- Display offset units in 3D preview window (inches or mm)
- Fix offset in 3D renderer
- Fix offset in Raytracing renderer
- Fix offset in STEP export
- Fix offset in VRML export
2017-11-11 15:08:08 -05:00
Marvin Schmidt 69974b73db Remove some extra semicolons 2017-11-09 19:52:18 +01:00
jean-pierre charras 1c356899ab Fix wxWidget warning in panel_prev_3d_base.cpp dialog 2017-11-07 09:43:27 +01:00
Tomasz Włostowski 81d1e17f02 refactoring: renamed pcbstruct.h to pcb_display_options.h, DISPLAY_OPTIONS->PCB_DISPLAY_OPTIONS 2017-11-03 20:02:06 +01:00
Tomasz Włostowski 90ab5860dc refactoring: removed dependency of libpcbcommon on 3d-viewer. 2017-11-03 20:01:42 +01:00
jean-pierre charras e0b9a21417 Modify a few messages to make translations more easy. 2017-10-12 10:39:32 +02:00
Baranovskiy Konstantin 4612a52b50 3D Viewer: fixed entry labels in popup menu. 2017-09-29 15:31:36 +02:00
Maciej Suminski 068a29952c Changed AUI toolbars background from gradient to solid
Based on patches from Windsor Schmidt <windsor.schmidt@gmail.com>
2017-09-27 23:23:06 +02:00
jean-pierre charras a43f3ab1fe replace "BasicShape" by "Primitive" in code, a better name 2017-09-20 12:51:10 +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
jean-pierre charras e15acbb00d Fp editor and board editor have now a separate color setup.
fp viewer uses the default colors, because it has no color setup dialog.
class_colors_design_settings: remove not used members.
Fix issue in modedit: the color config was never read.
2017-09-11 18:51:48 +02:00
Maciej Suminski 55c7d9816e Traverse 3D viewer plugin subdirectories in debug build directory
Before the change, the plugins had to be installed to one of the default
search paths, but it should not be necessary for developers working on
3D viewer plugins.
2017-08-21 14:17:01 +02:00
jean-pierre charras 2e96a5bc9f Pcbnew: fix a crash when editing footprint properties and trying to open the footprint 3D properties.
This was due to a missing initialization of the dummy board color settings (used to draw the footprint in the 3D view).

Fixes: lp:1708712
https://bugs.launchpad.net/kicad/+bug/1708712
2017-08-05 16:37:51 +02:00
Tomasz Włostowski 32185ddcd3 Multiple improvements concerning colors, configuration handling and legacy features in pcbnew:
- support for background color setting
    - removed several global config settings (such as g_Drc_On)
    - wrapped most of global config settings in PCB_GENERAL_SETTINGS class
    - reorganized PCB general options dialog to clearly mark which options concern only the legacy canvas
    - new GAL feature for legacy users: double-click (or E) to change track width available as an option.

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

Fixes: lp:1707145
* https://bugs.launchpad.net/kicad/+bug/1707145
2017-08-04 16:06:57 +02:00
jean-pierre charras 43084daa40 Fix a few doxygen warnings 2017-07-03 10:45:56 +02:00
Maciej Suminski 1e87ae6c50 Fixed a memleak in raytracer 2017-06-27 10:58:43 +02:00
jean-pierre charras 6a3c1720b2 Fix a few doxygen warnings 2017-06-25 11:26:04 +02:00
Tomasz Włostowski 3b16d3cffe further DLIST/Iterators cleanup, some code formatting 2017-06-23 11:12:37 +02:00
Tomasz Włostowski 94a80acb36 DLIST_ITERATOR improvements 2017-06-23 11:12:36 +02:00
jean-pierre charras 70226ecdeb Fix a few doxygen warnings 2017-06-20 10:47:30 +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
Kristoffer Ödmark 19d5cc7548 Removed all exception specifiers since deprecated.
Exception specifiers are deprecated in cpp11, so went through them all
and removed them from the code.
2017-06-12 13:54:55 -04:00
Simon Richter d5e85726ea Doxygen improvements 2017-06-11 18:09:14 -04:00
Simon Richter a9ca1e9930 Remove unreferenced local variables 2017-06-11 17:52:49 -04:00
Fabrizio Tappero ac9a64a173 general UI fix. Fixed a lot of icons and a lot of menu.
Also a few no longer used .cpp icon files are removed.
2017-06-02 11:51:11 +02:00
jean-pierre charras 200df95f00 fix bug (incorrect validation, on Windows only) in S3D_FILENAME_RESOLVER::ValidateFileName(). 2017-05-28 18:56:49 +02:00
jean-pierre charras 1fda668f24 3D viewer: cosmetic enhancements: fix an incorrect icon, and add shortcut keys in right popup menu.
Also fix an incorrect legend in hotkey list.
2017-05-26 13:28:51 +02:00
jean-pierre charras 305a166e95 Pcbnew: update immediately the 3D viewer opened from the footprint editor/viewer/wizard after a change. 2017-05-13 08:17:06 +02:00
Cirilo Bernardo 68a7a5235e Fix 3D plugins mutiarch support.
Use CMAKE_INSTALL_LIBDIR instead of wxStandardPaths::GetPluginsDir() to
determine plugin directory.

Fixes lp:1682812

https://bugs.launchpad.net/kicad/+bug/1682812
2017-04-18 09:11:53 -04:00
jean-pierre charras 6eb2000b69 fix Coverity warning (CID 151565) (CID 155147) 2017-04-01 20:05:33 +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 68b141dcb8 Make polygon built by BOARD::GetBoardPolygonOutlines strictly simple.
It fixes issues in 3d viewer (crashes and incorrect 3D board outline in some cases)

Fixes: lp:167484
https://bugs.launchpad.net/kicad/+bug/1674844
2017-03-23 08:56:52 +01:00
jean-pierre charras 05220a86f1 BOARD::GetBoardPolygonOutlines(): do not generate a separate SHAPE_POLY_SET for holes.
They are already managed by SHAPE_POLY_SET board outline.
2017-03-22 11:47:03 +01:00
Kristoffer Ödmark d6dd176aca Changed default increment values and added shift+scroll for fine tuning
Fixes: lp:1669550
* https://bugs.launchpad.net/kicad/+bug/1669550
2017-03-13 11:25:40 -04:00
jean-pierre charras bbedad3456 Fix a Coverity warning, which looks like a (minor) bug in ccontainer2d.cpp. 2017-03-13 12:53:01 +01:00
Maciej Suminski 14cbdcec1f Fixed mismatched new[]/delete in 3D viewer 2017-03-08 09:12:16 +01:00
Cirilo Bernardo 68bcdec87e Workaround for non-ASCII filenames in Windows 2017-03-03 14:30:47 -05:00
Kristoffer Ödmark 49c7400ca9 Reallow large scaling of 3D models
Fixes: lp:1669510
* https://bugs.launchpad.net/kicad/+bug/1669510
2017-03-03 10:30:09 -05:00
Maciej Suminski 1dfd74bec9 Display S3DSG in single line during CMake configuration step 2017-03-03 13:38:12 +01:00
Kevin Cozens 458b0e75e0 Prevent raytracing render engine option from crashing the 3D viewer
Fix for lp bug #1667722 using a change made by Mario Luzeiro.

Fixes lp:1667722

https://bugs.launchpad.net/kicad/+bug/1667722
2017-03-01 18:34:19 -05:00
Simon Richter 70b3edd06f Drop unnecessary and possibly harmful optimization setting
Using -O3 is default for release builds with gcc/clang anyway, so this
doesn't gain anything, but overwriting the existing flags might remove some
that might be needed.
2017-02-23 14:44:15 -05:00
Maciej Suminski 0dc88bb4cf Changed COLOR4D defines to static consts 2017-02-22 17:35:00 +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
Cirilo Bernardo 2b2b73ee4b Fix bug: Footprint add 3D shape recognizes only files with lower case ext on Windows
Fixes: lp:1659027
https://bugs.launchpad.net/kicad/+bug/1659027
2017-02-22 10:22:33 +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 1e242f3710 Remove a #define used in a debug session, and now useless in panel_prev_model.* 2017-02-19 08:30:34 +01:00
Mario Luzeiro 2a793cc22c Remove mm_malloc from raytracer
There is no need to use mm_malloc at this moment. Explanation:
1) It was planned that there was advantadge to use aligned memory but it
was not measured the performance. 2) aligned memory is needed for use
with SIMD (i.e: SSE) but that is not used at moment.

Fixes: lp:1626278
https://bugs.launchpad.net/kicad/+bug/1626278
2017-02-13 10:08:20 -05:00
jean-pierre charras 9074c57a28 panel_prev_model.cpp: try a better way to fix issue with wxSpinButtons on Linux. 2017-02-07 11:05:08 +01:00
jean-pierre charras fec02f6161 panel_prev_model.cpp: Fix a minor issue on Linux with wxSpinButtons.
The min and max values must be set, and the curr value forced to 0, to avoid disabling up or down arrows.
2017-02-07 10:26:03 +01:00
jean-pierre charras 42c9e4d602 panel_prev_model.*: fix minor issues. 2017-02-07 09:06:43 +01:00
jean-pierre charras cca0ffed60 panel_prev_3d: Add spin buttons and inc/dec by mouse wheel for 3D parameters 2017-02-07 09:06:43 +01:00
jean-pierre charras 43cb4560bf Rewrite code for PANEL_PREV_3D because the way events were previously managed are not compatible with a good mouse event management.
To avoid a lot of tedious code, wxFormbuilder is used to create the PANEL_PREV_3D_BASE class.
2017-02-07 09:06:42 +01:00
Forrest Voight bce04c930d 3d-viewer: draw dimension graphics
Fixes: lp:1406754
* https://bugs.launchpad.net/kicad/+bug/1406754
2017-02-01 09:45:32 -05:00
Mario Luzeiro 840bcb5189 3D-Viewer: improvements on reflections and on plastic normal texture
+ make the number of samples for reflection and refraction
parameterizable.
+ add some fuziness to reflection.
+ improvements on plastic normal texture
2017-01-26 07:22:46 -05: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
Mario Luzeiro 33449216b5 3D-Viewer: Improvements on reflection and refraction
- crete an option for absorvance (works better to make the epoxy
different for regular transparent materials).
- visual fix an issue related with the epoxy render (square bands on the
render).
- fix a reflection issue (it was not take in account the reflection
material color).
2017-01-21 09:21:44 -05:00
Mario Luzeiro 2eb840b2ed 3D-Viewer: Fix precision issues (experienced on isometric mode) in frustum tests 2017-01-18 18:09:27 -05:00
Baranovskiy Konstantin 3dc2050498 Improved MousewheelPAN mode. 2017-01-17 16:34:11 -05:00
Simon Wells 19512b46a3 Fix unlimited zoom with "Use touchpad to pan"
Additionally, fix an unreported bug allowing zoom level to get stuck at
MAX_ZOOM.

Fixes: lp:1625754 (3dviewer zoom not limited with Use touchpad to pan)
https://bugs.launchpad.net/kicad/+bug/1625754
2017-01-14 09:17:56 -05:00
jean-pierre charras d56a49d218 Performance counter rework: More comments, code cleaning, and move GetRunningMicroSecs() prototype from common.h to profile.h.
profile.h should now contain all info for profiling.
2017-01-02 13:49:36 +01:00
Chris Pavlina 6078ca85e5 Improve broken edge outline error message 2016-12-29 12:31:12 -05:00
Mario Luzeiro d365dc590e Soft plastic textures even more 2016-12-22 16:18:38 -05:00
Mario Luzeiro b33e42ef2c Soft plastic textures 2016-12-22 16:18:30 -05:00
Mario Luzeiro ad2458056a Improvements on 3DViewer raytracing render
+ Implement sRGB to Linear and Linear to sRGB conversions.
+ Fix an issue in the AntiAliasing adaptive logic.
+ Improves the ambient color use on the shader.
+ Improves post-shader calculation. Fixes the saturated dark regions.
+ Improves the transparency of soldermak material.
2016-12-22 16:18:20 -05:00
Chris Pavlina 4c340cefee Also rename footprint attributes in 3D viewer
Follow-up to commit: 809e71a
2016-12-15 14:48:14 -05:00
Mario Luzeiro 86dcfeb69d improve anti-aliasing
+re-implement anti-aliasing, making it more acurate, not blured, better
and much faster (unsing much less lines of code)
+rewrite some function on camera and raypacket.
+small improvements on raytracing realtime, remove useless ifs
comparisons.
2016-10-27 10:22:21 -04:00