Commit Graph

247 Commits

Author SHA1 Message Date
jean-pierre charras 230980fc9d Compile specctra file with pcbnew files, not with pcbcommon files (they are now used only by pcbnew) 2017-03-20 19:49:10 +01:00
John Beard ce731f8b62 Add GAL microwave tools
This adds the microwave tools to GAL in Pcbnew as a new tool:
MICROWAVE_TOOL.

Some new preview items are introduced to support this:

* TWO_POINT_GEOM_MANAGER for managing construction of two-point
  geometries, such as that used to construct the inductor.
* CENTRELINE_RECT_ITEM a preview item to draw ractangle with a given
  aspect ratio along a line (specified using a TWO_POINT_GEOM_MANAGER)

PCB_TOOL gets a generic event loops which should be useful for more
than just microwave tools:

* doInteractiveItemPlacement() - handles event loops that wait for a
  click, create an item on click and then allow moving it
  around/flipping, etc.

Fixes: lp:1531323
* https://bugs.launchpad.net/kicad/+bug/1531323
2017-03-20 16:10:51 +01:00
jean-pierre charras 2637835a1e First version of courtyard overlap detection 2017-03-19 20:27:45 +01:00
John Beard 5f303f7b25 Enhance Pcbnew arc construction
This adds a richer overlay to the arc-by-three-points tool in Pcbnew,
including more guide-lines and a live display of radius and angle.

Also included is ability to go back to the previous step (if setting end
angle, you can go back to setting start point, etc) using Backspace, and
Ctrl snaps the start/end angles to 45 degree multiples.

This adds new classes

* MULTISTEP_GEOM_MANAGER: represents a generic "geometry manager" that
  builds up some geometrical construction based on a sequence of points.
  Used by:
* ARC_GEOM_MANAGER: handles the logical flow of constructing an
  arc by centre-point, set radius, set angle. This moves the logic out
  of the Pcbnew DRAWING_TOOL event loop in drawArc().
* ARC_ASSISTANT: graphical overlay to communicate current arc shape to
  the user during the drawing process
2017-03-17 20:56:54 +01:00
John Beard f2aa4d2911 Make GAL options panel a reusable panel
The primary motivation here is to allow other GAL canvas users (eg
Modedit, and soon Gerbview) to be able to easily modify GAL canvas
options.

For now, this doesn't change the display properties dialog in
appearance, but if more GAL options are added, it might need a bit of
tweak and maybe tabs or similar, like Eeschema preferences.
2017-03-16 08:01:26 -04:00
Jon Evans 082b8dd2a9 Refactor BRIGHT_BOX to common so it can be used by other programs 2017-03-11 21:38:01 +01:00
Chris Pavlina bbaa29fbc4 Refactor FOOTPRINT_PREVIEW_PANEL
- Pull out compound widget bits into FOOTPRINT_PREVIEW_WIDGET
- Move all pcbnew-specific bits *inside* pcbnew; implementation should
  be private for users
- Make a few class members and inner types private
2017-03-10 23:26:45 -05:00
John Beard 8c3b8ee693 Add a ruler tool to pcbnew GAL
This allows to measure between features on a PCB. It uses a preview
EDA_ITEM in common, but due to the use of the IDs, it's currently
Pcbnew/Modedit only.

This also adds several "utils" for graphical functons useful when
drawing preview items on GAL canvases.

Fixes: lp:1467313
* https://bugs.launchpad.net/kicad/+bug/1467313
2017-03-10 16:21:44 +01:00
John Beard 9c08873210 Make SELECTION_AREA a generic overlay item
This simplifies the (already simple) SELECTION_AREA class. It is also
moved into KIGFX::PREVIEW and put in the common library, where it can be
reused by other GAL-aware tools (not just in Pcbnew) in future.
2017-03-10 16:21:44 +01:00
John Beard 5e84e953f3 Add a simple item class for graphical overlays
This introduces SIMPLE_OVERLAT_ITEM, which is an abstract EDA_ITEM,
designed for use as an overlay for assisting interactive tools.

The item is drawn only on the GP_OVERLAY layer, and sets the fill,
stroke and line properties before calling a virtual function to draw the
shape, which will depend on the implementaiton of the derived class.

The motivation here is to simplify and unify basic overlays used when
in interactive tools. It is not designed to be the base class of all
possible overlays - more complex ones would be more clearly represented
as their own derivative of EDA_ITEM.

Applications of this class can include: zoom/select rectangles, zone
polygon previews, geometric shape helpers, and so on.
2017-03-10 16:21:44 +01:00
Tomasz Włostowski eedf7cb243 Switched coroutine library from Boost libcotext to custom libcontext.
Fixes lp:1658249

https://bugs.launchpad.net/kicad/+bug/1658249
2017-03-07 11:45:29 -05:00
John Beard 1d039cb4c1 Break row indicators out to own class
The introduces INDICATOR_ICON, which is a very simple class holding a
bitmap that can toggle on or off.

The ICON_PROVIDER class then provides icons to INDICATOR_ICONS, which
means the class can be used for more than just row indicators.

A default row icon provider is also provided for use in the standard row
selector.
2017-03-01 09:44:41 +01:00
John Beard b8d0b0d7be Move layer/render swatches to own class
This introduces COLOR_SWATCH, which is a reusable
widget that shows a color swatch and can invoke the colour picker
when duble/middle clicked.

It uses it's own wxCommandEvent to signal the change.

This makes the layer widget simpler internally, and also allows other
code to show identical swatches if needed.
2017-03-01 09:44:41 +01:00
Jon Evans fd4e2b042c Refactor SELECTION, SELECTION_CONDITIONS, and context menus to common
SELECTION now holds EDA_ITEMs not BOARD_ITEMs so various places had to
change to casting the selected items to BOARD_ITEMs.

Fixed compilation warnings on clang (Tom)
2017-02-28 14:47:20 +01:00
jean-pierre charras 11dcb76fc9 Add -Wshadow compil option, if exists to warn about shadowed variables.
Swig auto generated .cxx file has a lot of shadowed variables, so this option cannot be used to compil all files.
2017-02-23 13:17:23 +01:00
Chris Pavlina d1a2ed63c0 Add gal as dependency of common
This is required due to the use of COLOR4D in common
2017-02-22 19:45:52 -05:00
Jon Evans 4c83b0a94d Move TOOL_ACTIONs to their corresponding tools; create COMMON_TOOLS
Some grid/zoom tools are left in PCBNEW_CONTROL because they currently
depend on Pcbnew-specific class members.  Once refactoring is done to
make it possible to use all zoom and grid controls outside of pcbnew,
these last tools can be moved to common to match their ACTIONs.
2017-02-22 10:32:48 +01:00
John Beard 061d659bb1 Add a class to govern an "incrementing" text control
This class, INCREMENTAL_TEXT_CTRL, is used to provide a frameworks for
classes that want to control a text control that can be incremented
according to some scheme.

Also provided is a wxWidgets implementation with spin buttons for
control, as well as mousewheel support.
2017-02-20 10:52:34 +01:00
Chris Pavlina 2632b1d1a0 Revamp component chooser and add footprint preview
This commit brings several changes:

- Add a footprint preview pane to the eeschema component selector
- Upgrade component list to wxTreeListCtrl
- Factor out wxTreeListCtrl subclass TWO_COLUMN_TREE_LIST which
  patches a column size bug
- Linkify datasheet URL in info pane
2017-02-18 21:39:55 -05:00
jean-pierre charras 1338ff02f9 Fix a build issue, broken by commit 78a5f450ce 2017-02-04 10:08:54 +01:00
decimad 77138e3702 Add UI control to set up gal opengl antialiasing and load/store the settings 2017-01-11 16:20:37 +01:00
decimad bbaeeceeac A model/subscribe helper-class OBSERVABLE to common 2017-01-11 16:20:37 +01:00
decimad 02bb410cdb Refactor COMPOSITOR/OPENGL_COMPOSITOR to enable customization of scene rendering and presentation 2017-01-11 16:20:35 +01:00
decimad 77f9cd0cb0 remove custom shader header generation build-step in favor of c++11 raw string literals
rework shader loading code to handle an arbitrary amount of to-be-concatenated strings
2017-01-11 16:20:34 +01:00
decimad 047f52e7cb Move builtin font resources out of opengl_gal translation unit 2017-01-11 16:20:33 +01:00
jean-pierre charras b8b08dafd6 Code cleaning: remove pcbcommon.* which contains nothing really useful. The very few lines of code are moved to a better place. 2016-12-31 12:56:21 +01:00
Tomasz Włostowski da28e163d2 Optimizations/fixes to the VIEW/GAL classes:
- much faster Cairo rendering (outperforms legacy)
- improvements in VIEW update handling
- fixed issue with grid rendering in flip view mode
2016-12-12 16:45:52 +01:00
Wayne Stambaugh fd54d394bd Version string improvements.
Define empty string variable KICAD_BRANCH_NAME that can be used as an
optional version string element.  When git is used to build the version
string, this variable is set to the git branch name.  It can also be
defined at configuration time as an optional string appended to the
$KICAD_VERSION variable.

Define empty string variable KICAD_VERSION_EXTRA that can be set by
the user at configuration.

The variables KICAD_BRANCH_NAME and KICAD_VERSION_EXTRA are only
appended to KICAD_VERSION if they are set.  Otherwise, only KICAD_VERSION
is uses as the version string.

Update the developer building from source document to reflect the changes.
2016-11-25 09:09:10 -05:00
Simon Richter f7cc0a9334 Add missing build dependency.
The generated lib_table_lexer.h file is required to build the pcbcommon
static library.
2016-11-21 07:38:15 -05:00
Wayne Stambaugh 64c892ee23 Make footprint ID into a generic library ID.
Rename FPID to LIB_ID as is now used as a generic library identifier and
is no longer specific to footprints.

Remove all mention of footprint from the new LIB_ID doxygen comments and
code.

Rename files fpid.h and fpid.cpp to lib_id.h and lib_id.cpp.

Rename fp_lib_table.keywords file to lib_table.keywords and adjust CMake
build dependencies accordingly.

Update all source files effected by the code and file name changes.

Update .gitignore for file name changes.
2016-11-20 18:35:08 -05:00
Wayne Stambaugh 4d018039aa Eeschema: lay the groundwork for symbol library tables.
Create SYM_LIB_TABLE and SYMBOL_LIB_TABLE_ROW objects derived from LIB_TABLE
and LIB_TABLE_ROW respectively for supporting symbol library tables.

Add FPID member to LIB_PART for associating a symbol to a specific library
nickname.  Please note, this is not used in any way at this time and will be
implemented when the symbol library table is actually implemented.

Add sym_lib_table keyword to keywords file.  This is a temporary measure
until a more elegant method for parsing and formatting library tables can
be implemented.

Build FPID support in the common library instead of the pcbcommon library
for use in Eeschema.
2016-11-20 13:38:20 -05:00
Wayne Stambaugh 40e93d263d Split out library table common code into separate source files. 2016-11-20 13:34:03 -05:00
Chris Pavlina b9c62b658e Bring back KICAD_REPO_NAME 2016-11-12 16:16:35 -05:00
Dick Hollenbeck d957670034 Add more HANDLE_EXCEPTIONS(), board.i refactoring. 2016-09-20 12:00:17 -04:00
Dick Hollenbeck 64232ce10c Comment out kiway from python preliminary work. 2016-09-20 12:00:09 -04:00
Dick Hollenbeck 7311f07eaf SWIG Improvements
*) Extend SWIG support deeper into the BOARD class.
*) Move swig *.i files into a directory identified for SWIG, in preparation
   for a parallel universe involving Phoenix's SIP.
*) Move swig files which will be common to both eeschema and pcbnew into
   common/swig.
*) Sketch out a "common" python module, and plan on dovetailing that into a
   libkicad_shared.{dll,so}
*) Add common/swig/ki_exceptions.i and define a macro HANDLE_EXCEPTIONS()
   which is to be applied to any function which needs C++ to python
   exception translation.
*) Move the test for SWIG tool into top level CMakeLists.txt file for use
   in all python modules beyond pcbnew, i.e. eeschema and common.
*) Add SWIG_MODULE_pcbnew_EXTRA_DEPS which generates a better Makefile, one
   which rebuilds the swig generated *.cxx file when one of its dependencies
   change.
*) Re-architect the board.i file so that it can be split into multiple *.i
   files easily.
*) Make some KIWAY from python progress, in preparation for Modular KiCad
   phase III.
2016-09-20 11:59:43 -04:00
jean-pierre charras 6edee2ae1d Prepare Plot Gerber file to include advanced aperture and net attributes.
This option is not yet activated because the net attributes are not yet fully fixed by Ucamco, in Gerber file format specifications.
(To activate it, see dialog_plot.cpp, line 43)
2016-09-19 13:01:36 +02:00
Tomasz Wlostowski 9588a7974c Added classes COMMIT & BOARD_COMMIT. 2016-09-12 11:50:06 +02:00
Wayne Stambaugh 9287b42648 Revert commit 67230ac8e7. 2016-08-30 09:04:25 -04:00
Niki Guldbrand 67230ac8e7 Keep Source tree clean
* Move all generated files to the build tree during build so the source
  tree is kept clean.

Signed-off-by: Niki Guldbrand <niki.guldbrand@gmail.com>
2016-08-26 17:25:12 -04:00
Maciej Suminski 51906625ee Replaced sim plotting widget with wxMathPlot 2016-08-11 14:41:21 +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
Wayne Stambaugh 4ed346ea64 Eeschema: initial schematic I/O plugin.
* Factor out PROPERTIES object from the PCB plugin code and move it into
  common so it can be used by both the Pcbnew and Eeschema plugins.

* Add schematic I/O plugin manager for loading and saving schematic and
  component library files.

* Add initial attempt at a parser for current schematic file format.  This
  parser will be infinitely more strict than the current parser which is very
  forgiving in what it parses.

* Make minor changes to the base bitmap class to support the new parser.

* Add find root sheet support to sheet object to allow fetching the root
  sheet from any sheet in the stack.
2016-07-06 05:22:56 -04:00
Maciej Suminski 01f32dd52c GL_CONTEXT_MANAGER class to avoid unexpected GL context switches. 2016-06-03 15:46:12 +02:00
Maciej Suminski 1927f3a787 Unified way of checking OpenGL errors. 2016-05-02 15:56:14 +02:00
jean-pierre charras 4a838fb8c3 Pcbnew: Add rounded rect pad shape. 2016-04-06 20:15:49 +02:00
jean-pierre charras 92ce9c1193 Rework on class EDA_TEXT and related classes and draw text functions. More work: remove useless or duplicate code (from legacy graphic text plot functions). Move basic_gal code to separate files. 2016-03-25 09:26:11 +01:00
jean-pierre charras 30d72045e7 Rework on class EDA_TEXT and related classes and draw functions (Note: this is a work in progress):
* remove duplicate code between  draw functions and STROKE_FONT used in GAL. Use only  STROKE_FONT methods in draw, plot and test DRC function for texts. It remove slightly different shapes between GAL and other calculations.
* fix incorrect bounding box for texts with overbar. Especially noticeable for texts with overbar inside a copper zone in Pcbnew.
* fix a few minor other bugs related to graphic texts.
2016-03-23 08:41:47 +01:00
Chris Pavlina af042628ff Refactor WIDGET_HOTKEY_LIST out of DIALOG_HOTKEYS_EDITOR 2016-01-15 20:56:57 -05:00
Dick Hollenbeck f527b29e68 GitHub plugin: fix threading issues when libcurl is build against openssl.
* Dick Hollenbeck also contributed commit r6440.  I inadvertently forgot to set
  the Bazaar author tag before I committed it.  My apologies.
* Switch to static linking of libcurl and on linux and windows and also
  statically link in only required portions of openssl.
* Add the required thread locks which openssl needs.
* Remove the get curl version call from BASEFRAME since it pulls in curl and
  openssl into every derived wxFrame class link image.
* Remove curl function from PGM_BASE, switch to atexit() instead.  Anything in
  PGM_BASE made the singletops bigger.
* Tested on Linux, Windows, and OSX.
2016-01-14 10:17:13 -05:00