Swap syncs can limit the redraw rate as the screen waits for previously
issued syncs. Setting this to -1 allows for adaptive swapping
(resorting to unsynced if it falls behind) if it is supported by the
card but will fall back to unsynced (0) if the adaptive is not
supported.
Fixes https://gitlab.com/kicad/code/kicad/issues/4226
Various architecture upgrades to support this.
Creating a BOARD now requires a valid PROJECT, which caused
some (mostly transparent) changes to the Python API internals.
ADDED: Project local settings file
CHANGED: Board design settings are no longer stored in PCB file
CHANGED: Net classes are no longer stored in PCB file
CHANGED: Importing board settings now reads boards, not just projects
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2578
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4070
There were a lot of plotters, exporters, etc. that were rolling their
own implementations.
This also introduces a lazily-built set of SHAPE objects for doing
collision detection and some forms of rendering (and later DRC).
Dragging filled zones in OpenGL was extremely slow due to the
invalidated triangulation cache. Moving the zone should also move the
triangles and keep the cache valid.
It's currently only supported in the Footprint Editor. It could be
easily added to the board editor (all the code is there), but the board
editor is a little short on room in the drawing tools toolbar.
A note to developers, please do not set the minimum and/or size of bitmap
buttons. It causes bitmaps to get clipped using GTK on Linux. If the
bitmap button size is not acceptable, then supply an appropriately sized
bitmap rather than attempt to force the wxWidgets sizing mechanism to do
what you want. This almost always causes platform differences that do
not work well.
You can now choose the behavior of dragging with the
middle and right mouse buttons.
You can also choose which modifier keys to use for
panning and zooming with the scroll wheel or trackpad.
You can also customize the zoom speed, which makes
it possible to have a good zoom experience on a wider
range of input devices.
You can also now zoom by dragging with the right or
middle button if desired.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/3885
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4348
* Push all sizing operations into EDA_BASE_FRAME
* Save the unmaximized window size when maximizing
so that we can then save it in the config if the
window is maximized. Otherwise the config ends up
with the maximized size saved, and weird behavior
occurs when unmaximizing on the next opening.
* Use GL vertex buffers and index buffers for 3D model rendering
* Use material or average vertex color for bounding boxes instead of red
* Reinstate bounding box rendering with GL vertex/index buffers
* Use compact vertex/index data representation
- 8-bit normals
- 8-bit colors
- 16-bit or 32-bit indices, depending on model size
This should improve performance a bit on lower end GPUs with less memory
and bandwidth.
Fixes#4112
Move the camera out to its own so that everything else is board-
related, and then rename BOARD_ADAPTER.
At some point the flags should probably be moved out too, and they
can have the EDA_3D_SETTINGS name.
Replace SEVERITY_ERROR by RPT_SEVERITY_ERROR to avoid collision with a system definition.
Replace other SEVERITY_XXX by RPT_SEVERITY_XX for consistency.
Fix compil warnings and some other compil issues.
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.
Previously, OnModify() was called for a lot of items, even when not modified.
For large schematics, the calculation time was unreasonable ( several minutes)
It is now called only a few times.
Remove holes on Silk layer by default so the behaviour is the same
on OpenGL and Raytracing.
Fixes#1836
Fix raytracing shadow offset issue.
Some codestyle fix.
Remove the CACHE_WRAPPER whose sole purpose was to allow the
cache to be stored in the project, and instead just have the cache
inherit the proper class.
Rotating to 0 when above pi would result in the board spinning back
through pi to get there. This led to jarring motion.
Also fix an issue added in b6f64815 where the board would rotate
2pi when crossing over the 0-2pi boundary.
* Split up the thirdparty code into the thirdparty folder (#3637)
* Create a new kimath static library containing all the math functions
This is part of cleaning the build system for #1906.
The 3d viewer is the last component to not use the action framework, so
we descope the common defines to its canvas. Once the 3d viewer is
converted, we can remove these entirely.
The floor render in raytracing creates interesting shadow effects but
significantly increasing the processing time for renders and has the
side effect of making the bottom of the board very dark if you simply
flip it over. Making this option off by default, we allow power users
to turn it on if needed for their renders while speeding up the default
raytrace and preventing new user confusion.
Given that we compare the dot product (square of length) to s_min_dot,
it means that s_min_dot also needs to be square, or we wind up
converting line segments into circles that are visually distinct from
circles, leading to gaps in polylines.
* Push a function into CONDITIONAL_MENU that adds the item
* Modify the tooltip for close and exit items to have the
program name
Fixes: lp:1835454
* https://bugs.launchpad.net/kicad/+bug/1835454
In singletop mode, all frames show the "Quit" option in the file menu
and will quit on Ctrl-Q. When launched from the main KiCad interface,
sub-programs show the "Close" option instead and will close with Ctrl-W.
In this mode, Ctrl-Q will instruct the main program to exit.
Fixes: lp:1779938
* https://bugs.launchpad.net/kicad/+bug/1779938
This allows a setting where the path is not one of the options. This
permits the user to select once to go to any path option (rather than
off the current and then back to currect) when the filetree doesn't
match the dropdown. This also selects the drop down item if it matches
the tree.
(cherry picked from commit f5284ced54)
A few files snuck in with CRLF for the line endings. These make it hard
to look at diffs as every line appears to have changed. This commit
makes only line ending changes, so can be ignored
It's a bit of a hack because they're statically initialized and
so we can't make use of the _() macro. We do still want it in the
code, however, because the string harvesting is based off of it.
Fixes: lp:1833000
* https://bugs.launchpad.net/kicad/+bug/1833000
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
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)
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.
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
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.
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
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
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.
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.
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
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.
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.
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
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.
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
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
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.
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
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
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
Previous commit mistakenly included the full clearance for the rounded
rectangle circle. The CFILLEDCIRCLE2d takes the radius rather than the
diameter.
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
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
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.
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.
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.
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
* 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.
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