Commit Graph

1324 Commits

Author SHA1 Message Date
Maciej Suminski 806dd7d8ec Items are not recached until GAL is changed (earlier it was done on every rendering backend switch). 2013-05-15 09:17:42 +02:00
Maciej Suminski e1ecd301a7 Added some debug informations. 2013-05-15 09:17:36 +02:00
Maciej Suminski 135149e2d3 Fixed build for eeschema. 2013-05-14 10:46:43 +02:00
Maciej Suminski c55e063745 Removed double freeing of some of Cairo paths. 2013-05-14 10:42:56 +02:00
Maciej Suminski 1b1216e53d Modified SetOffset (VBO_ITEM/OpenGL GAL) function. 2013-05-14 10:41:05 +02:00
Maciej Suminski a6c8beb73b Drawing tracks using PushVertices, added some comments, fixed formatting. 2013-05-14 10:38:25 +02:00
Maciej Suminski 32784ea191 Added possibility of adding multiple vertices to VBO_ITEM at once 2013-05-13 11:14:35 +02:00
Maciej Suminski bce9f685ea Fixed Cairo issues and some possible memory leaks 2013-05-13 10:55:35 +02:00
Wayne Stambaugh f78497bf4f Decouple PLOT_CONTROLLER from UI dependencies. 2013-05-10 15:22:29 -04:00
Maciej Suminski e8f33ac903 Fixed memleak, removed excessive recaching, still there is a problem with Cairo caching 2013-05-10 16:05:40 +02:00
Wayne Stambaugh b5bb56426a Fix footprint library search path bug. (fixes lp:1178427 2013-05-09 21:51:55 -04:00
jean-pierre charras 2554575656 More work on CPOLYGONS_LIST class.
Pcbnew: fix minor bug about  plot line width.
2013-05-09 21:08:12 +02:00
Wayne Stambaugh cf86e18f5c Footprint library table work, minor fixes, and code cleaning.
* Fix a bug when full file name and path are passed to FOOTPRINT_INFO::
  ReadFootprintFiles() which I created in bug fix lp:593989.
* Fix a wxString debug assertion in EDA_APP::InitEDA_Appl() when the KICAD
  environment variable is defined as an empty string.
* Add error dialog when libraries cannot be found in system search path
  when loading footprint using the select footprint dialog.
* Add footprint library name column to the EDA_LIST_DIALOG when selecting
  footprints from the list.
* Allow reading all columns from the selected row in EDA_LIST_DIALOG.
* Remove redundant sort from EDA_LIST_DIALOG constructor
* Add library name member variable and accessors to FOOTPRINT_INFO.
* Make headers translatable for Eeschema select component from list dialog.
* Add some helper methods to FPID for identifying the FPID type and validity.
* Remove a bunch of trailing whitespace and add missing license comments.
2013-05-08 16:47:23 -04:00
jean-pierre charras 2e6969fe96 More work on CPOLYGONS_LIST class. 2013-05-08 20:20:58 +02:00
jean-pierre charras 6fcd9eb8a6 Eechema: fix bug : when saving the schematic project, the lib cache was saved under the current sheet opened, not the root sheet.
Pcbnew: clamp default plot line width between 0.02 and 2 mm. the other bug (saving this parameter in internal units instead of mm is not fixed)
2013-05-07 20:32:06 +02:00
Lorenzo Marcantonio 69b7c2a1b6 Removed some spurious float casts
(explanation: float is implicitly promoted to double anyway, it's only useful
for storage; also a fp variable forces conversion of other int in the expression
without needing a cast)
Typo fixes in some comments 'floatting' -> 'floating' :D
2013-05-07 19:31:52 +02:00
Wayne Stambaugh 2be09ba9e2 Fix bug when footprint library file names contain dots. (fixes lp:593989) 2013-05-06 13:57:18 -04:00
Lorenzo Marcantonio 8430508272 Closes bug 1176915
Mass parameters in gerbers can't use scientific notation (altough some software 
allow it), so the %g format was not correct.
2013-05-06 19:47:01 +02:00
jean-pierre charras 7e2779784b Eeschema: fix incorrect move command for bitmap items. 2013-05-06 15:38:14 +02:00
Lorenzo Marcantonio d00c83cde9 Migrated the interfaces accepting angles to the double type
The plan goes like this:
- eeschema still uses int in decidegrees
- all the other things internally use double in decidegrees (or radians
  in temporaries)
- in pcbnew UI the unit is *still* int in decidegrees

The idea is to have better precision everywhere while keeping the user with int i
angles. Hopefully, if a fractional angle doesn't come in from the outside, everything
should *look* like an integer angle (unless I forgot something and it broke)

When the time comes, simply updating the UI for allowing doubles from the user should
be enough to get arbitrary angles in pcbnew.
2013-05-05 09:17:48 +02:00
Lorenzo Marcantonio cb49ca5ae2 More int casts to rounding conversions 2013-05-04 13:57:09 +02:00
jean-pierre charras b2a76062c7 All: use CPOLYGONS_LIST, a typedef of std::vector<CPolyPt> to handle a Corners Polygons List.
This is a starting point of some code enhancements relative to polygons in Pcbew and 3D viewer.
2013-05-03 19:51:10 +02:00
Lorenzo Marcantonio 78e41187b3 Moved utilities for angles in trigo.h
New conversion routines and sin/cos implementation for angles in decidegrees
2013-05-02 20:06:58 +02:00
jean-pierre charras 4ac7dd5845 3D viewer: Modify yhe way board items shapes are built:
* All items shapes  are converted to polygons.
* Polygons are merged layer by layer (for calculation time reasons,zones are not merged)
* for copper layers, vias and pads holes are substracted from polygons (but, for calculation time reasons,  not inside zones areas).
* the look is better, mainly when displaying the copper thickness
* solder and paste layers are now shown in 3D viewer.
* the code was seriously cleaned (but still needs to be enhanced).
* Note this is a work in progress which needs refinements.
2013-05-01 21:01:14 +02:00
Lorenzo Marcantonio 0e903dba5b Angle and distances cleanup (preparing for angles in doubles)
- Removed spurious int casts (these are truncated anyway and will break
  doubles)

- Applied the Distance, GetLineLength, EuclideanNorm, DEG2RAD, RAD2DEG
  ArcTangente and NORMALIZE* functions where possible

- ArcTangente now returns double and handles the 0,0 case like atan2, so
  it's no longer necessary to check for it before calling

- Small functions in trigo moved as inline
2013-05-01 19:32:36 +02:00
Dick Hollenbeck 000ec33af2 remove temporary debug printf()s I no longer need. 2013-05-01 10:49:34 -05:00
Dick Hollenbeck 9634fa5c07 fix 2 corner case bugs in specctra import 2013-05-01 10:48:00 -05:00
Maciej Suminski e9e4ed4230 Improved recaching (all items when a board is loaded), still needs some fixing (mem leak). 2013-04-30 17:55:24 +02:00
Maciej Suminski 191cb40e79 Introduction of VBO. Now only tracks are rendered in a very simple way. 2013-04-30 15:59:32 +02:00
Lorenzo Marcantonio 3b1ddd952f Removed the SAFE_DELETE macro.
In most case the assignment to null was not necessary since it was easily provable that the (local) variable wouldn't have referenced after that anyway.
2013-04-28 16:28:13 +02:00
Dick Hollenbeck ec497d5d9a Fix SVG plot with filename containing & character. 2013-04-26 21:12:57 -05:00
Wayne Stambaugh 81271ad41a Post Pcbnew NETLIST_READER change clean up.
* Tweak the NETLIST_READER code to allow for component footprint names that
  are not found in any library to generate a warning instead of an error and
  update the board accordingly.
* Don't display undo warning in netlist dialog when dry run option selected.
* Rename netlist_reader_common.cpp to netlist_reader.cpp
* Rename netlist_reader_firstformat.cpp to legacy_netlist_reader.cpp
* Rename netlist_reader_kicad.cpp to kicad_netlist_reader.cpp
* Remove cvpcb/read_write_cmpfile.cpp and move the single function it
  contained into cvframe.cpp
* Remove cvpcb/loadcmp.cpp and move the single function it contained into
  class_DisplayFootprintsFrame.cpp.
* Remove cvpcb/readschematicnetlist.cpp and move the single function it
  contained into cvframe.cpp.
* Remove cvpcb/setvisu.cpp and move the few functions it contained into
  the appropriate source file.
2013-04-26 11:11:52 -04:00
Maciej Suminski 0cd108b55d Upstream merge. 2013-04-25 18:42:27 +02:00
Maciej Suminski 3ff70deab0 Changed non-shader primitives to GL_TRIANGLES. 2013-04-25 18:30:53 +02:00
Wayne Stambaugh 61b4f8a9eb Pcbnew NETLIST_READER improvements.
* Create separate NETLIST object to hold contents of netlist files.
* Read entire netlist and footprint link files before making applying
  changes to board.
* Add BOARD::ReplaceNetlist() function to eliminate the calls between the
  NETLIST_READER, PCB_EDIT_FRAME, and BOARD objects.
* Change placement of new components below the center of the current board
  or in the center of the page if the BOARD is empty.
* Add dry run option to netlist dialog to print changes to message control
  without making changes.
* Add button to netlist dialog to allow saving contents of message control
  to a file.
* Eliminate the need to compile netlist_reader_*.cpp in both CvPcb and Pcbnew.
* Add netlist_reader_*.cpp to the pcbcommon library.
* Remove redundant load component link file code from CvPcb.
* Modify CvPcb new to work with the new NETLIST_READER object.
* Add compare() function and < and == operators to FPID object.
* Add REPORTER class to hide an underlying string writing implementation for
  use in low level objects.  Thank you Dick for the idea.
* Lots of minor coding policy, Doxygen comment, and missing license fixes.
2013-04-25 12:29:35 -04:00
Maciej Suminski 790e4c6af7 Fixed tracks drawing using Cairo backend with caching turned on. 2013-04-25 10:26:32 +02:00
Maciej Suminski b70adc5f99 Fixed color issue for stroked fonts with OpenGL backend and caching turned on. 2013-04-25 10:00:25 +02:00
Maciej Suminski dd8601cbf8 Added caching of multilayer items (storing multiple group ids for items). 2013-04-24 11:28:11 +02:00
Maciej Suminski 10dd5023e2 Removed BeginLayer and EndLayer functions. Resolved Cairo layers drawing problem in a different way. 2013-04-24 09:48:34 +02:00
Maciej Suminski bb3f3d063f wxWidgets 2.8 compatibility fix. 2013-04-23 18:20:45 +02:00
Maciej Suminski 4868af8b62 Changed view control settings to KiCad default (panning, zooming, etc.) 2013-04-23 12:07:14 +02:00
Maciej Suminski ced0d8add9 Modified shaders' source path. 2013-04-23 09:52:51 +02:00
Maciej Suminski 0a55a2b672 Fixed wheel scroll event on Windows 2013-04-22 11:08:02 +02:00
Maciej Suminski 1944fea398 Modified way of switching canvas 2013-04-22 11:07:38 +02:00
Maciej Suminski ad4a72ff11 Cairo now renders layers properly (colors are not saturated after layer composition), but slower. 2013-04-19 18:19:50 +02:00
Maciej Suminski 062fc2d200 Some cleanup. 2013-04-19 18:19:20 +02:00
Dick Hollenbeck a20c89288f hide pageFmts[] since it is no longer NULL terminated and not global 2013-04-18 13:54:03 -05:00
Dick Hollenbeck fb57b54be8 fix Lorenzo's bug introduced in rev. 4082 2013-04-18 12:03:25 -05:00
Maciej Suminski 5d704c9692 Turned on group recaching on GAL change. 2013-04-18 17:10:02 +02:00
Maciej Suminski a96c5379b3 Fixed non-GAL build. 2013-04-18 11:46:23 +02:00
Maciej Suminski e4bac0d91a Fixed resize issue (moved GAL panel into pane).
Tidied up event handlers.
2013-04-18 11:20:19 +02:00
Maciej Suminski fde71bdf33 Removed unnecessary calls to cairo drawing functions. 2013-04-17 12:50:38 +02:00
Maciej Suminski 16a28348b4 Added const(..)& in GAL methods' parameters and change iterators to constant iterators. 2013-04-17 12:48:37 +02:00
Maciej Suminski 520be6f67b Added GAL::DrawSegment for drawing rounded segments (used for drawing tracks). 2013-04-17 12:38:00 +02:00
Maciej Suminski 6cf04e6820 Fixed drawing arcs in Cairo GAL. 2013-04-17 12:33:11 +02:00
Maciej Suminski 71a1ad6ff5 Fixed drawing polygons using Cairo-based GAL. 2013-04-16 14:55:21 +02:00
Maciej Suminski 4eadf2ef47 Removed flickering in Cairo-based rendering backend. 2013-04-16 11:43:13 +02:00
Maciej Suminski bee0d69289 Cleanup 2013-04-16 11:16:27 +02:00
Maciej Suminski 01ebf03110 Inverted Y display axis while using Cairo-based rendering backend. 2013-04-15 17:59:38 +02:00
Maciej Suminski 820e6e5e16 Introduced Cairo-based rendering backend using GAL.
Moved switching canvas routines to pcbnew, as they are used only there right now (otherwise libgal would have to be linked to every Kicad application).
2013-04-15 17:57:03 +02:00
Maciej Suminski 5b9057823a Introduced SetGAL() functions that will allow changing GAL backend for rendering on the fly. 2013-04-15 16:03:05 +02:00
Matthew Beckler 088832b8f6 Match 'new char[]' with proper delete[] char* rather than delete char*. 2013-04-13 23:07:04 -05:00
Maciej Suminski e1fcd31381 Fixed text display using Cairo. 2013-04-12 16:41:31 +02:00
Maciej Suminski e3cb0aa36f Tesselation error fix.
Added missing callback function (combine callback).
2013-04-12 10:37:06 +02:00
Wayne Stambaugh b1144a864f wxWidgets 2.8.12 build fix 2013-04-12 09:30:18 +02:00
Lorenzo Marcantonio 65b7f23d46 Set grid color for module editor and viewer (closes #1167884)
Also removed EDA_DRAW_FRAME::OnGrid which was totally dead (empty and unused)
2013-04-11 20:29:56 +02:00
jean-pierre charras e07590f930 All: fix a minor issue in drawtext.cpp
Pcbnew: load footprint from modview: Because modview allows user to choose the footprint library, the selected library is forced when the footprint is loaded.
I am not sure this is 100% better, but this new behavior has some advantages, mainly in the footprint editor (you can load a footprint outside the selected library)
2013-04-11 19:40:20 +02:00
Maciej Suminski 877dd3f79a Added multiline strings and text overbars rendering using GAL. 2013-04-11 14:21:59 +02:00
Lorenzo Marcantonio b1c710a214 Made overbar position independant of pen size for text, to fix graphics glitches with halo text.
Slightly retuned for compensating the new position.
2013-04-10 21:09:59 +02:00
Maciej Suminski 07cd3bcb56 Upstream merged 2013-04-10 15:03:35 +02:00
Maciej Suminski 0d85444062 Fix for compatibility with wxWidgets 2.8 & 2.9 at the same time. 2013-04-10 10:09:23 +02:00
jean-pierre charras 0d41a7a523 All: fix some issues in messages to translate. Remove fully outdated files 2013-04-10 09:23:20 +02:00
Lorenzo Marcantonio 42709330e0 Better strings for the translators (converted concatenations to formats) 2013-04-09 19:49:01 +02:00
Lorenzo Marcantonio 20eaf66d5b Hunted down hardcoded pixel size thresholds for drawing
Dynamic contrast for netname and pin numbers ('halo' text)
Handle netname drawing even on diagonal tracks
2013-04-09 19:16:53 +02:00
Lorenzo Marcantonio b525e3be55 Factored out text anchor drawing
More layer classification cleanup
2013-04-09 18:00:46 +02:00
Maciej Suminski d400a25075 Modified CMakeLists.txt in order to compile Kicad with KICAD_GAL=ON for Windows
Added settings that allow to use M cross environment (http://mxe.cc) to crosscompile Kicad for Windows.
2013-04-09 16:12:18 +02:00
Maciej Suminski ef5693080f Fixed line style used for displaying texts. 2013-04-09 16:12:17 +02:00
Maciej Suminski 70769d5d46 Fixed drawing of circles in certain circumstances using OpenGL. 2013-04-09 16:12:16 +02:00
Wayne Stambaugh 477069c063 Fix compile bug in ptree.cpp with wxWidgets 2.9.x and MinGW. 2013-04-08 20:16:53 -04:00
Dick Hollenbeck 6bf3d7cdc3 Implement "KiCad s-epression" support for boost::property_tree's ptree, the 8
bit string version of property_tree. The ram resident structure of the ptree is
mostly compatible with one created using the xml_parser from
boost::property_tree, with slight differences in the way atoms are stored. The
result is you can use Format() to convert from xml to s-expression, but not the
other way around. You can write a simple s-expression beautifier in just a few
lines of code.

The main value however is the s-expression parser, i.e. Scan(), which is an
alternative to crafting a custom recursive descent parser for a particular
grammar. The tipping point depends on whether you want to read only a small
portion of a much larger document. If so, then using the ptree will likely be a
"faster to code" route. Documentation on how to navigate a ptree can be found on
the boost website and there are a number of examples in the
pcbnew/eagle_plugin.cpp file in this project. Powerful path navigation support
makes it easy to extract a subset of a ptree.
2013-04-08 16:04:45 -05:00
Maciej Suminski 664692b2e6 Added outline display mode for pads, vias & tracks 2013-04-08 10:54:31 +02:00
Maciej Suminski 850c0a8473 Added high contrast display mode using GAL rendering.
New methods in VIEW class: SetTopLayer(), EnableTopLayer() for managing the top layer display.
New method in PCB_RENDER_SETTINGS class: LoadDisplayOptions() for applying display settings like high-contrast, outline display of items, etc.
2013-04-08 10:50:47 +02:00
Lorenzo Marcantonio b739b2b075 Support for a visibility flag and color selection to NPTH holes
(when disabled they are shown as standard holes, a lot less distracting
than the previous fixed yellow color)
2013-04-07 18:20:46 +02:00
Lorenzo Marcantonio 204d085b64 More cleanup on layer code usage
Better description for entities on right click menu and panel
Typo fixes and some comment reformats
2013-04-07 13:55:18 +02:00
Lorenzo Marcantonio 150cfebb59 Fixed some tab-induced disalignments
Charras beat me on fixing the include/sch_item_struct.h include issue from 4069
2013-04-06 14:28:02 +02:00
jean-pierre charras ca4a3651c0 Gerbview, layer manager: add option (popup menu) to always keep layers not visible but the active layer, even when the active layer is changed.
Pcbnew: fix swig warning for operator EDA_COLOR_T::++  (changed to function EDA_COLOR_T:: NextColor)
2013-04-06 14:01:53 +02:00
Lorenzo Marcantonio 74a57d4ea8 Cleanup of the eeschema 'layers' i.e. entitity colours. This also fixes
the spurious warning about stuff that couldn't be seen when changing
colours.
NOTE that the 'net name' layer is present and configurable but non used 
anywhere!
2013-04-06 07:01:48 +02:00
Lorenzo Marcantonio 00f0e27851 Factored layer utility functions: classification, layer flip and mask flip 2013-04-05 21:04:58 +02:00
Lorenzo Marcantonio db09deedf7 New color palette 2013-04-05 19:23:56 +02:00
Lorenzo Marcantonio 90f2e67ed8 Typo fix 2013-04-05 17:09:04 +02:00
Maciej Suminski 52ec277592 Fixed bug of displaying stroked rectangles on wrong layer depth. 2013-04-05 15:10:58 +02:00
jean-pierre charras 752e4a4a58 All: change some texts and messages hard to translate, or not translatable (and some incorrect messages).
Pcbnew, layer manager: add option (popup menu) to always keep copper layers not visible but the active layer, even when the active layer is changed.
Usefull for multilayer ( more than 4 layers) PCBs.
2013-04-05 09:38:00 +02:00
Lorenzo Marcantonio d12a45923b More work on EDA_COLOR_T and layers.
In particular the new mechanism for handling extended color palettes is in place,
included renaming the ini keys and saving the color name instead of its index; this means better forward compatibility with palette changes.

Since ini keys are changed, colors will be reset
2013-04-04 23:35:01 +02:00
Maciej Suminski 18374e53a0 common/painter.cpp: Removed unnecessary header inclusion, added variable initialization
common/view/view.cpp: Added line to comply with coding style
2013-04-04 11:18:47 +02:00
jean-pierre charras a47d36e399 Pcbnew: fix Bug #1163201. Fix Bug #1162779. Fix incorrect comment in CMakeLists.txt. 2013-04-03 18:16:26 +02:00
Maciej Suminski a97c9a1b96 Added possibility to show/hide layers using right sidebar (PCB layer widget) in the GAL rendered view. 2013-04-02 11:02:35 +02:00
Maciej Suminski e262b32198 Introduction of Graphics Abstraction Layer based rendering for pcbnew.
New classes:
    - VIEW - represents view that is seen by user, takes care of layer ordering & visibility and how it is displayed (which location, how much zoomed, etc.)
    - VIEW_ITEM - Base class for every item that can be displayed on VIEW (the biggest change is that now it may be necessary to override ViewBBox & ViewGetLayers method for derived classes).
    - EDA_DRAW_PANEL_GAL - Inherits after EDA_DRAW_PANEL, displays VIEW output, right now it is not editable (in opposite to usual EDA_DRAW_PANEL).
    - GAL/OPENGL_GAL/CAIRO_GAL - Base Graphics Abstraction Layer class + two different flavours (Cairo is not fully supported yet), that offers methods to draw primitives using different libraries.
    - WX_VIEW_CONTROLS - Controller for VIEW, handles user events, allows zooming, panning, etc.
    - PAINTER/PCB_PAINTER - Classes that uses GAL interface to draw items (as you may have already guessed - PCB_PAINTER is a class for drawing PCB specific object, PAINTER is an abstract class). Its methods are invoked by VIEW, when an item has to be drawn. To display a new type of item - you need to implement draw(ITEM_TYPE*) method that draws it using GAL methods.
    - STROKE_FONT - Implements stroke font drawing using GAL methods.
                          
Most important changes to Kicad original code:
    * EDA_ITEM now inherits from VIEW_ITEM, which is a base class for all drawable objects.
    * EDA_DRAW_FRAME contains both usual EDA_DRAW_PANEL and new EDA_DRAW_PANEL_GAL, that can be switched anytime.
    * There are some new layers for displaying multilayer pads, vias & pads holes (these are not shown yet on the right sidebar in pcbnew)
    * Display order of layers is different than in previous versions (if you are curious - you may check m_galLayerOrder@pcbnew/basepcbframe.cpp). Preserving usual order would result in not very natural display, such as showing silkscreen texts on the bottom.
    * Introduced new hotkey (Alt+F12) and new menu option (View->Switch canvas) for switching canvas during runtime.
    * Some of classes (mostly derived from BOARD_ITEM) now includes ViewBBox & ViewGetLayers methods.
    * Removed tools/class_painter.h, as now it is extended and included in source code.
                         
Build changes:
    * GAL-based rendering option is turned on by a new compilation CMake option KICAD_GAL.
    * When compiling with CMake option KICAD_GAL=ON, GLEW and Cairo libraries are required.
    * GAL-related code is compiled into a static library (common/libgal).
    * Build with KICAD_GAL=OFF should not need any new libraries and should come out as a standard version of Kicad
                            
Currently most of items in pcbnew can be displayed using OpenGL (to be done are DIMENSIONS and MARKERS).
More details about GAL can be found in: http://www.ohwr.org/attachments/1884/view-spec.pdf
2013-04-02 08:54:03 +02:00
Lorenzo Marcantonio 9fd79dfa91 Implemented the LAYER_NUM typedef (LAYER was already taken as a class name...) to represent a layer number. 2013-03-31 15:27:46 +02:00
Lorenzo Marcantonio 27ee815742 Minor flags and layer mask cleanup 2013-03-30 20:55:26 +01:00
Lorenzo Marcantonio e0303a4558 - New typedef LAYER_MSK to encapsulate a layer bitmap
- Renamed ReturnMaskLayer to GetLayerMask (since it's a plain getter)
2013-03-30 18:24:04 +01:00