Compare commits

..

2855 Commits

Author SHA1 Message Date
Dick Hollenbeck 6675ae64cf refinements 2014-06-11 00:57:26 -05:00
Dick Hollenbeck a015fa53e6 Save the footprint editor's last footprint in the PROJECT RString facility. 2014-06-11 00:18:41 -05:00
Dick Hollenbeck e2360155a6 *) Remove more wxString static constructors which were crashing in PAGE_INFO assignment
to a new BOARD in the footprint editor.  This is PAGE_INFO::A4 and company.
   
*) Remove static storage of the BOARD in the module editor.
2014-06-11 00:00:30 -05:00
jean-pierre charras 869792f88d Plot SVG: fix issue with arcs (bug #1328155 ) both in Pcbnew and Eeschema. 2014-06-10 18:21:38 +02:00
Dick Hollenbeck c22ccaffc4 Remove class RETAINED_PATH, put is main member function into SEARCH_STACK.
Change class PROJECT to use a generalized wxString in place of the
RETAINED_PATH items, so that new session and project specific strings
of any purpose can be saved there, for the life of a session.
2014-06-10 10:56:43 -05:00
unknown 583fe1d524 VRML export rewritten 2014-06-08 12:35:42 +02:00
jean-pierre charras c4a0bf2b2d Page layout editor: fix bad initialization on startup, which can crash pl_editor when trying to edit an item.
Minor other fixes.
2014-06-07 18:20:23 +02:00
Maciej Suminski d3206d6883 Fixed layers switching in GAL. 2014-06-06 14:59:55 +02:00
Maciej Suminski a7c13a61c3 Removed an unused parameter from TOOL_BASE::getModel<T>() method. 2014-06-06 14:59:25 +02:00
jean-pierre charras 52b503c99c Pcbnew: fix an issue (crash) with very old .brd files. 2014-06-06 12:32:01 +02:00
jean-pierre charras 7d65b1e5e1 Pcbnew: fix an issue with very old .brd files. 2014-06-06 12:30:07 +02:00
Tomasz Wlostowski 5e4f412fd0 Clang-alike lightweight RTTI for pcbnew + type casting cleanup. 2014-06-06 11:44:21 +02:00
unknown 8f949caeb9 IDF tools: code cleanup and debugging 2014-06-05 20:37:04 +02:00
Bernhard Stegmaier 2bd17a5c8b Removed a few warnings. 2014-06-05 12:40:26 +02:00
Maciej Suminski c6a2eb6c9d Single items are dragged by their origin in GAL canvas. 2014-06-05 09:55:53 +02:00
Maciej Suminski eb449879b8 bugfix #1326155: pcbnew shows strange ratsnest lines in OpenGL mode. 2014-06-05 09:55:35 +02:00
Maciej Suminski 49b45b8ac5 Fixed: Modules become invisible after reloading a netlist, until GAL view is refreshed. 2014-06-05 09:54:47 +02:00
Maciej Suminski 35bc2efb61 Minor code cleaning. 2014-06-04 18:01:01 +02:00
Maciej Suminski 9989145fb1 Grid in GAL takes into account grid offset. 2014-06-04 17:56:44 +02:00
Maciej Suminski 554c474cf0 Placing the grid origin is possible with GAL. 2014-06-04 17:46:43 +02:00
Dick Hollenbeck eded969ca1 Fix off by one error in libpart editor when displaying duplicate pins, unit numbers.
Fix segfault when deleting last user path from eeschema libpaths and then pressing cancel.
2014-06-04 20:06:52 -05:00
jean-pierre charras a28f93ff3b Fix some compil warnings and Debug assertions. 2014-06-04 20:48:49 +02:00
jean-pierre charras 13345822bc Fix some compil warnings and Debug assertions 2014-06-04 19:34:23 +02:00
Dick Hollenbeck 9e6eba96fd remove global g_UserLibDirBuffer which was a project specific global, and no longer used with FP_LIB_TABLE support. 2014-06-03 10:59:52 -05:00
Dick Hollenbeck b3777d5317 wxFrame GetParent() strategy is obsolete, use Kiway().Player() 2014-06-03 10:31:58 -05:00
Maciej Suminski c48435407e PNS router handles net class settings (dependent on the selected start item). 2014-06-03 16:09:27 +02:00
Maciej Suminski 3f577bd16c Improved ratsnest updating in GAL. 2014-06-03 16:08:23 +02:00
Maciej Suminski dc9e175ac0 bugfix #1325743: cvpcb crashes when opening any netlist. 2014-06-03 09:32:57 +02:00
jean-pierre charras 66b7e82b75 Minor fixes ( including Bug #1325561 ) 2014-06-02 18:35:49 +02:00
jean-pierre charras 23398f9651 Minor fixes. 2014-06-02 18:16:06 +02:00
jean-pierre charras 5bb7f5c8d2 .kicad_mod files: always save the "last edited date" because only the footprint editor changes this parameter. Usefull to know if/when a footprint was actually modified.
Also fix a minor issue in footprint editor which always set the "modified" flag even when no change was made.
2014-06-02 12:46:29 +02:00
Maciej Suminski d2cca45511 bugfix 1325375: pcbnew crash while append a board 2014-06-02 11:41:54 +02:00
jean-pierre charras f503f99704 Suppress compil warnings 2014-06-01 20:22:51 +02:00
unknown 170f0a5021 idf tools: code cleanup and debugging 2014-06-01 18:55:53 +02:00
Tomasz Wlostowski e12654ac3d router: fix segfault on route-undo-route 2014-06-01 18:44:38 +02:00
jean-pierre charras 274b7ee845 Pcbnew: fix Bug #1325311 ("New Board" warning refusal broken) 2014-06-01 16:58:17 +02:00
jean-pierre charras 558a5a4948 Cosmetic enhancements: fix incorrect icons. 2014-05-31 17:49:15 +02:00
Maciej Suminski 27ebcf3325 PNS formatting code. 2014-05-31 16:04:25 +02:00
Maciej Suminski bc766093a3 Setting proper tool for submenus of CONTEXT_MENU class. 2014-05-31 16:04:10 +02:00
Maciej Suminski 3b54bb1614 Brighter colors for pad net labels. 2014-05-31 11:50:01 +02:00
Maciej Suminski 648d81b2f7 Fix for vertical/horizontal (using Ctrl/Shift + mousewheel) panning in GAL canvas. 2014-05-31 11:48:27 +02:00
Maciej Suminski f9d964b790 Fixed invisible buttons in PNS settings dialog (at least for some GTK themes). 2014-05-30 15:31:30 +02:00
unknown 16baa1f7f1 OSX install script fixes. 2014-05-29 20:35:49 +02:00
jean-pierre charras 49553e867a Idf tools: Minor change for OSX compatibility (some from a patch from stegmaier@sw-systems.de) 2014-05-29 18:17:08 +02:00
unknown 5723ac469b Idf tools: Minor change for OSX compatibility 2014-05-29 18:04:54 +02:00
jean-pierre charras 2c7da91b39 Pcbnew: fix a minor bug: in zones with no net, only the zone clerance was used to created clearence, regardless the pad or footprint local clerance.
Very minor other fixes.
2014-05-29 13:48:14 +02:00
Maciej Suminski bc8fe1cea1 bugfix 1324144: broken PNS dragging 2014-05-28 19:21:12 +02:00
unknown e8d7e55640 Add patch about idf export (from cirilo_bernardo), with a fix for Windows. 2014-05-28 14:24:44 +02:00
Maciej Suminski 021474ab2a bugfix #1323135: PNS creates vias with giant holes. 2014-05-28 13:16:15 +02:00
unknown ea7dd5ae58 Add patch about idf export (from cirilo_bernardo) 2014-05-28 08:26:46 +02:00
Dick Hollenbeck 9219155104 A hopeful fix for bug lp:1322354 2014-05-27 23:33:00 -05:00
Dick Hollenbeck 5e7c4d47aa remove unused single_top.c function. 2014-05-27 23:30:38 -05:00
Dick Hollenbeck a67a342bdf change to fatal error in kicad/kicad.cpp Kiface() stub. 2014-05-27 00:05:41 -05:00
jean-pierre charras 13431345cf Apply a workaround in 3D_draw.cpp to avoid crash in boost::polygon (try to fix Bug #1322804)
This workaround was already used (bzr 4301, in file plot_board_layers.cpp) also to avoid similar crashes (uses 18 segments instead of 16 to approximate a circle by segments).
Minor code cleanup in dialog_plot.
2014-05-26 08:54:04 +02:00
unknown 78801bfcb5 Fix kicad_plugin.cpp coding style fully broken by commit 4887 (patch from Orson, AKA maciej suminski). 2014-05-26 08:21:25 +02:00
Bernhard Stegmaier 1c0f4a4e30 mac fixes 2014-05-25 11:02:52 -05:00
Maciej Suminski 7f90e34e38 Bugfix #1322914: pcbnew crashes when opening a file 2014-05-25 17:36:24 +02:00
Tomasz Wlostowski 38ab6a8dc0 router: fix segfault when trying to shove a line that forms a closed loop. 2014-05-23 11:57:43 +02:00
Wayne Stambaugh 48562916c3 Add gerber file attributes to road map. 2014-05-22 16:10:49 -04:00
Wayne Stambaugh 67ed6cc430 Add DRC and website improvements to road map. 2014-05-22 15:50:49 -04:00
Maciej Suminski 35fd6c9458 Ratsnest is computed for legacy boards in GAL view. 2014-05-22 19:34:28 +02:00
Maciej Suminski 68ada9e169 Fix for context menu hanging up in GAL. 2014-05-22 17:59:36 +02:00
Tomasz Wlostowski 2e939bb9be math_util: speed up rescaling on 64-bit platforms by using native 128-bit types 2014-05-22 15:07:28 +02:00
Maciej Suminski 55b20ea70d Added missing changes required for updating footprints with the module editor. 2014-05-22 15:01:58 +02:00
Maciej Suminski 4d80e42219 Fixed bug 1321936: changing a footprint for a set of modules relocates them in GAL canvas.
Changes introduced by the module editor are updated in GAL canvas.
2014-05-22 12:06:45 +02:00
Maciej Suminski 4474896713 The GAL view uses colors settings from the legacy canvas.
Minor refactoring of PAINTER & RENDER_SETTINGS classes.
2014-05-21 23:13:30 +02:00
Lorenzo Marcantonio 3604fae918 Replaced the display line clipper with the way simpler (and faster) Cohen-Sutherland one.
A couple of trivial accessors made inline
2014-05-21 19:02:32 +02:00
Dick Hollenbeck 35d49085ae set( wxWidgets_CONFIG_OPTIONS --static=no ) for platforms using wx-config 2014-05-21 08:36:59 -05:00
Dick Hollenbeck 943d1b7db8 fix bug lp:1319839 2014-05-21 01:06:52 -05:00
Maciej Suminski 3a41f8ed03 Fixes the bug that causes pcbnew crash, when there are multiple net classes and the plot dialog was opened.
Changed NETCLASS* to boost::shared_ptr<NETCLASS>.
2014-05-20 11:29:37 +02:00
Dick Hollenbeck d8ad00673b fix compiler warnings 2014-05-19 17:27:09 -05:00
jean-pierre charras 08843f5845 Pcbnew: plot dialog: remove obscure and useless option about texts which are not value or reference.
cosmetic enhancement in dialog.
page layout: fix bug Bug #1320839 (canvas refresh countinously called when moving an item)
2014-05-19 20:24:07 +02:00
Wayne Stambaugh 20304ccc30 Add road map to developer's documentation.
- Create KiCad road map document.
- Add road map to developer's documentation.
- A separate road map build command to CMake so the road map can be built
  separately for use in websites.
- Update .bzrignore to ignore road map files generated by Doxygen.
2014-05-18 19:37:45 -04:00
Maciej Sumiński 522f18d847 Upstream merge. 2014-05-18 17:32:35 +02:00
Maciej Sumiński 467e9cb170 Merged the new Interactive Push and Shove router.
Do not pay attention to add/remove files - it seems there may be a bug in git-bzr-ng plugin. I have checked them, they stayed exactly the same as before.
2014-05-18 17:16:59 +02:00
jean-pierre charras 9b505817b7 Rework on DXF export. 2014-05-17 21:29:15 +02:00
Lorenzo Marcantonio 0c119ebab9 TRACK::GetTrack can now be told to confine search to the netlist and/or force the sequential (restartable) algorithm
Reworked the collinear track routines. Cleanup should be faster given the above modification.
2014-05-17 19:36:02 +02:00
jean-pierre charras ea9931bd05 Plot DXF: better generation of filled zone polygons. 2014-05-16 21:03:45 +02:00
Lorenzo Marcantonio 0c29fb6595 Pull unfilled polygon drawing thru the line clipper; GTK mess up even in this case and the sheet border lines glitch on the screen at high zoom otherwise in pcbnew. 2014-05-16 19:43:27 +02:00
Maciej Suminski c8311132da Removed header files from CMakeLists.txt. 2014-05-16 16:01:03 +02:00
Lorenzo Marcantonio 657a87697e Made the project default text size apply to all text things in eeschema, instead of the hardcoded value 2014-05-16 15:57:53 +02:00
Maciej Suminski c60698c24b Reformatted PNS code to conform the coding policy. 2014-05-16 13:37:31 +02:00
Maciej Suminski 58becbeb59 Workaround for Mac OS, fixes focus after a mouse click. 2014-05-15 17:08:15 +02:00
Maciej Suminski 319cb3e15c Minor BOARD_DESIGN_SETTINGS refactoring.
Removed SetCurrentClassName() (it was not used anywhere and less safe than SetCurrentClass()).
Added BOARD_DESIGN_SETTIGNS::GetDefault() to make some pieces of shorter and clearer.
2014-05-15 10:51:08 +02:00
Maciej Suminski b4df1618ed Scripting fix. 2014-05-15 10:11:17 +02:00
jean-pierre charras e23f2b7b7b DXF export: fix incorrect export of polygons having thick outline (like zones): Thick segments of outline were drawn like lines with no thickness.
Fix ( workaround only) crash (Windows only) when a quasi modal frame (like footprint viewer) was called from a dialog (like the component properties dialog in schematic editor).
Very minor other fixes.
2014-05-15 08:32:24 +02:00
Maciej Suminski 1a0054ea48 PNS router deselects all items when started. 2014-05-14 19:15:25 +02:00
Maciej Suminski fa5ddc068d Fixed freezing of GAL canvas if user chooses Cancel in the on close dialog.. 2014-05-14 19:04:21 +02:00
Maciej Suminski 6279f8b33d Undo/report support for track dragging (PNS). 2014-05-14 18:45:59 +02:00
Maciej Suminski 6f9ef9c20e PNS routing settings are stored between router invocations. 2014-05-14 16:53:49 +02:00
Maciej Suminski 84e4b8f04f PNS debug output is enabled with PNS_DEBUG define. 2014-05-14 16:40:56 +02:00
Maciej Suminski b59770e8ca TOOL_MANAGER is no longer static. Reworked autoregistration of TOOL_ACTIONs. 2014-05-14 16:29:53 +02:00
Maciej Suminski 01cde02ea2 Added missing dialog files for pcbnew. 2014-05-14 16:28:39 +02:00
Tomasz Włostowski 541222752a Long-awaited new version of the P&S router 2014-05-14 15:53:54 +02:00
Tomasz Włostowski fa9a2796be Switching top layer should update the layer widget 2014-05-14 13:54:59 +02:00
Tomasz Włostowski 072c980c7d geometry: GetShape()->Shape() in indexed shape containers 2014-05-14 13:53:02 +02:00
Tomasz Włostowski 9a572e1993 geometry: get rid of useless vertex references in SEG class 2014-05-14 13:52:29 +02:00
Tomasz Włostowski 6cb0d0cbfc VIEW: added CalculateExtents() method 2014-05-14 13:48:29 +02:00
Maciej Suminski 7b120f21be Fixed freezing of GAL canvas if user chooses Cancel in the on close dialog. 2014-05-14 12:08:29 +02:00
Maciej Suminski fa6ada69a6 Added a missing file. 2014-05-14 11:47:17 +02:00
Maciej Suminski 5ec247663e Various fixes to geometry & math library. 2014-05-14 11:45:01 +02:00
Maciej Suminski d85256bfa9 Moved background color settings from GAL to RENDER_SETTINGS. Added RENDER_SETTINGS::TranslateColor() to convert between EDA_COLOR_T and COLOR4D. 2014-05-14 10:35:12 +02:00
Maciej Suminski ccb956b7d3 Holding shift always activates extend current selection mode (in GAL canvas). 2014-05-14 09:56:35 +02:00
Maciej Suminski 1aa6d7f0f0 Via holes were always visible in GAL canvas - fixed. 2014-05-14 09:48:29 +02:00
Maciej Suminski a4805cc99d Disable autopanning when GAL panel does not have focus. 2014-05-14 09:42:16 +02:00
Lorenzo Marcantonio 9849f41b03 Various fixes to pin drawing code
- Better shape to the 60617 pin markers
- Made the markers' size proportional to the pin text
- Added the missing implementation in the pin plot routines
2014-05-13 21:24:12 +02:00
Maciej Suminski 3bcb728c84 Fixed modification point for EDIT_TOOL when the tool is not active. 2014-05-13 11:22:51 +02:00
Maciej Suminski 9d61f82f68 Moved NETCLASSES to BOARD_DESIGN_SETTINGS.
Most of the changes are just adding GetDesignSettings() before every occurence of m_NetClasses.
More complex changes:
class_netclass.cpp - NETCLASS does not store the pointer to the parent BOARD anymore. Added function SetParams( BOARD_DESIGN_SETTINGS& ).
class_netclass.h - Removed GetTrackMinWidth(), GetViaMinDiameter(), GetViaMinDrill(), GetuViaMinDiameter(), GetuViaMinDrill() as they were refering to BOARD_DESIGN_SETTINGS anyway (they are not net class specific).
kicad_plugin.cpp - filters out empty nets (that are anyway not saved) when storing net class information. Previously it was done in NETCLASS::Format() function.
2014-05-13 11:22:51 +02:00
Maciej Suminski 3b735771d8 Fixed namecase for private fields in BOARD_DESIGN_SETTINGS class.
Moved a few one-liners of BOARD_DESIGN_SETTINGS class to the header file.
2014-05-13 11:22:51 +02:00
Maciej Suminski d8af04a5e3 Moved most of the board design rules related fields & methods to BOARD_DESIGN_SETTINGS class. 2014-05-13 11:22:51 +02:00
Maciej Suminski 39587ee1b7 Custom width settings taken into account in wxUpdateUIEvent handlers. 2014-05-13 11:22:51 +02:00
Maciej Suminski a48377bcee Custom track/via size settings nicely cooperate with other options. 2014-05-13 11:22:51 +02:00
Maciej Suminski 82303217af Initial support for custom track width & via size. 2014-05-13 11:22:51 +02:00
Maciej Suminski f3e771ac1f Minor reorganization of handling custom events with CONTEXT_MENU. 2014-05-13 11:22:51 +02:00
Maciej Suminski b813799334 WX_UNIT_TEXT can handle default value. 2014-05-13 11:22:51 +02:00
Maciej Suminski bc372564cf Fixed custom event handlers for CONTEXT_MENU.
Moved menuCopy to CONTEXT_MENU copy constructor.
2014-05-13 11:22:51 +02:00
Maciej Suminski 7155e3a9db Recursive copy constructor for CONTEXT_MENU. 2014-05-13 11:22:51 +02:00
Maciej Suminski 5abb625ef5 Fixing memory leaks. 2014-05-13 11:22:51 +02:00
Maciej Suminski ff0ca7ee95 Fixed rotation/flip point. 2014-05-13 11:22:51 +02:00
Maciej Suminski cdcb10d8bc Pad properties are back. 2014-05-13 11:22:51 +02:00
Maciej Suminski 2c594c9b18 SELECTION_TOOL updates dragging offset after rotating/flipping.
Cursor position is saved as a field in order to avoid drifting of items while they are being dragged and rotated/flipped.
2014-05-13 11:22:51 +02:00
Maciej Suminski d08f8ed62d More compatibility fixes. 2014-05-13 11:22:51 +02:00
Maciej Suminski 20fc4a81b8 Added WX_UNIT_TEXT - wxWidget control for inputing sizes using different units (mm, inch, internal units). 2014-05-13 11:22:51 +02:00
Maciej Suminski ef7e71e93a Fixed jumpy zoom when hotkeys and scroll wheel were used alternatively. 2014-05-13 11:22:51 +02:00
Maciej Suminski f092fac22e Resolved HOME hot key conflict between menu entry (Zoom Page) and event assigned to the hot key in the ACTION_MANAGER.
Conflicts:
	pcbnew/menubar_pcbframe.cpp
2014-05-13 11:22:51 +02:00
Maciej Suminski eefeb7c0cf Added preference for selecting tracks/vias/graphics if there is a module present in the selection point. 2014-05-13 11:22:51 +02:00
Maciej Suminski 76c61e92f7 Ratsnest lines are highlighted together with all items in the same net. 2014-05-13 11:22:51 +02:00
Maciej Suminski a86387eec6 Better way of adding CONTEXT_MENU entries. 2014-05-13 11:22:50 +02:00
Maciej Suminski 641e6398fd Ratsnest was not refreshed on board reload - fixed. 2014-05-13 11:22:50 +02:00
Maciej Suminski 04c73b0ceb Merged lp:~cern-kicad/kicad/drawing_tool branch. 2014-05-13 10:19:37 +02:00
Maciej Suminski d3afc86040 Fixed ifdefs in rtree.h. 2014-05-13 10:01:06 +02:00
Lorenzo Marcantonio 96131f64b4 Added eeschema option for the default pin length 2014-05-12 18:57:46 +02:00
Maciej Suminski fcfc4210e8 Upstream merge. 2014-05-12 17:17:51 +02:00
Lorenzo Marcantonio b5ae5f3f4d More refactoring of the track cleanup code
Algorithm is still the same... now need to know what it really meant to do
2014-05-10 14:48:17 +02:00
Dick Hollenbeck 9cea792545 Modular-Kicad milestone B), minor portion:
*)  Implement a framework for "Data Load On Demand".

*)  Implement FP_LIB_TABLE* PROJECT::PcbFootprintLibs(), which is the first
    prototype.

This allows the project specific footprint tables to be part of the Module Editor
when invoked from Eeschema.
2014-05-09 13:35:48 -05:00
jean-pierre charras 7d85ad55fb Fix an annoying behavior of new quasi modal frames on Windows (when closing them, the caller frame was no more on top ) 2014-05-09 20:06:18 +02:00
Dick Hollenbeck 6961f9bca0 Try some new Mac support ideas. 2014-05-09 09:27:21 -05:00
unknown d63547c7dd OSX: fix incorrect path to launch pl_editor.
fix also a bug in python script round_value_robin.py.
2014-05-09 08:32:05 +02:00
Dick Hollenbeck 3605ab617c peggable checkout version in scripts/kicad-install.sh 2014-05-08 17:29:22 -05:00
Lorenzo Marcantonio 005708f30d Missing const caused unpickability of tracks 2014-05-06 17:14:47 +02:00
Dick Hollenbeck 5a3bf6c3d6 Allow building of a STABLE or TESTING version using kicad-install.sh. 2014-05-06 00:23:57 -05:00
Dick Hollenbeck bb9c11492c Fix new bug which crashed pcbnew running under kicad.exe while adding a new module in mod editor 2014-05-05 23:58:33 -05:00
Dick Hollenbeck 3d9d0247e7 Modular-Kicad milestone B), glamorous portions:
*) Eeschema can now show the footprint editor.

*) Eeschema can now invoke the footprint picker from the library part field editor.

*) KIWAY_PLAYER::ShowModal() takes aResultantFocusWindow that tells what window
   to give the focus to.  Required since frames are often near the top of the
   hierarchy and they are invoked by a peer, not a parent.
2014-05-05 12:28:40 -05:00
jean-pierre charras 50645cf465 Kicad: fix crash on exit, when Libedit was called during a session. It fixes also a crash if Libedit was called, closed and reopened.
Happens only if eeschema was called from the Kicad manager.
2014-05-05 17:15:54 +02:00
Maciej Suminski 6a58dc67e9 Upstream merge. 2014-05-05 10:51:31 +02:00
jean-pierre charras 65d02e479a footprint editor: fix crashes. In this fix, I removed the assumption the parent frame is the board editor.
However, this assumption is still present here and there  in the moduleframe code.
2014-05-05 09:46:07 +02:00
Dick Hollenbeck e3ebd725cd Quasimodo is not a monster, he is your friend. 2014-05-04 19:19:16 -05:00
Dick Hollenbeck 288e89e0da typeinfo.h missing in Debug build for wx2.8 2014-05-04 15:27:29 -05:00
Dick Hollenbeck 4d955fda7e wx 2.8 now builds, but the quasi-modal support seems broken on 2.8. Wanted others to be able to build at least. 2014-05-04 14:57:44 -05:00
Dick Hollenbeck ea06a99874 Modular-Kicad milestone B), minor portions:
*) KIWAY_PLAYER::IsModal() is now a retained state, controlled by SetModal()

*) Fully re-work the KIWAY_PLAYER::ShowModal() to use a nested event loop.

*) Add support to DIALOG_SHIM for a "quasi-modal" dialog presentation and mode.
   See top of dialog_shim.cpp about that for benefits and need.

*) You can now pick footprint from the schematic component field dialog, although
   if you do this before you open the BOARD, you will only get the global footprint
   libraries, not also the project specific ones.  Opening the BOARD first avoids this
   problem.

This is the first example of cross KIFACE invocation, it is also the first
instance of using a TOP_FRAME other than FRAME_PCB as the first thing. It works,
but it's missing support for opening the project specific table because
historically the FRAME_PCB did that. This is now starting to expose all the near
term needs for KIWAY_PLAYER <-> PROJECT interaction, independence and out of
sequence usage.

A fix for this will be coming in a few days.

However it mostly starts to show why the KIWAY is terribly useful and important.
2014-05-04 13:22:27 -05:00
Maciej Suminski f292a1db89 Clearing m_hiddentItems to avoid PNS crashes. 2014-05-04 20:20:49 +02:00
Lorenzo Marcantonio 467d8b41f8 Constification of HitTest and GetParent
In particular HitTest for zones *do not* select the nearest vertex/edge as a side effect
2014-05-04 19:08:36 +02:00
Dick Hollenbeck 9f834561c3 Change order of headers for wx 2.8, use wxWindowDisabler not ENABLE_DISABLE. 2014-05-03 19:44:57 -05:00
Dick Hollenbeck 1ab4fca573 Modular-Kicad milestone B), major portions:
*) Rework the set language support, simplify it by using KIWAY.  Now any major
   frame with a "change language" menu can change the language for all KIWAY_PLAYERs
   in the whole KIWAY.  Multiple KIWAYs are not supported yet.

*) Simplify "modal wxFrame" support, and add that support exclusively to
   KIWAY_PLAYER where it is inherited by all derivatives.  The function
   KIWAY_PLAYER::ShowModal() is in the vtable and so is cross module capable.

*) Remove the requirements and assumptions that the wxFrame hierarchy always
   had PCB_EDIT_FRAME and SCH_EDIT_FRAME as immediate parents of their viewers
   and editors. This is no longer the case, nor required.

*) Use KIWAY::Player() everywhere to make KIWAY_PLAYERs, this registers the
   KIWAY_PLAYER within the KIWAY and makes it very easy to find an open frame
   quickly.  It also gives control to the KIWAY as to frame hierarchical
   relationships.

*) Change single_top to use the KIWAY for loading a KIFACE and instantiating
   the single KIWAY_PLAYER, see bullet immediately above.

*) Add KIWAY::OnKiwayEnd() and call it from PGM_BASE at program termination, this
   gives the KIFACEs a chance to save their final configuration dope to disk.

*) Add dedicated FRAME_T's for the modal frames, so m_Ident can be tested and
   these modal frames are distinctly different than their non-modal equivalents.
   KIWAY_PLAYER::IsModal() is !not! a valid test during the wxFrame's constructor,
   so this is another important reason for having a dedicated FRAME_T for each
   modal wxFrame.

On balance, more lines were deleted than were added to achieve all this.
2014-05-03 12:40:19 -05:00
jean-pierre charras cd341cc301 Eeschema: fix unwanted creation of noname.pro (or other useless config file), when opening eeschema. Fix also an issue when saving the config (from save config menu) which saved the config file in an unknow folder. 2014-05-02 19:56:24 +02:00
unknown dfad6b79e6 Fix issue in bga footprint wizard. 2014-05-02 08:28:40 +02:00
Maciej Suminski 4f83504d7b Upstream merge. 2014-05-01 15:55:50 +02:00
Lorenzo Marcantonio 149e3cb2a3 Virtual split of TRACK/VIA::HitTest 2014-05-01 08:50:11 +02:00
Lorenzo Marcantonio 5e266fc0bf - Better way to iterate on vias in the track list (GetFirstVia)
- Converted the Next/Prev C casts to static casts and removed the type
  unsafe ones
- Splitted as virtual the VIA::Flip member instead of using RTTI
- Heavily refactored the 'unconnected track' cleanup routine
- Misc constification
2014-04-30 21:16:22 +02:00
jean-pierre charras e3d7af1833 Plots function: fix a bug about virtual PLOTTER::Text, which was not virtual for derived classes due to a missing parameter in ::Text in these classes. Noticeable only in SVG plot.
SVG plot, fix a missing reinitialization in plot lines, which could define a filled polyline, instead of a simple polyline
(these fixes solve Bug #1313084 )
2014-04-28 18:13:18 +02:00
Dick Hollenbeck 9f4da3732e Reverse Marco's patch, pending a proper review of my last patch from an English speaking Mac developer. 2014-04-28 04:23:39 -05:00
Marco Serantoni 8f45e1703c [MacOSX] Fixing issue with kiface libs, now are symbolic linked to the owner bundle 2014-04-27 16:30:49 +02:00
Marco Serantoni ec6b251ef4 [MacOSX] Fix for name collision with OSX headers, Maciej, Tomasz or others feel free to rework if you want/like 2014-04-27 16:28:37 +02:00
unknown 557311aad7 3D viewer: Commit patch to enable the rendering of wrl files generated with Meshlab. See https://bugs.launchpad.net/kicad/+bug/804778 2014-04-27 15:49:41 +02:00
jean-pierre charras b8d833a450 Pcbnew: fix bug #1313076 (Filled Zones on technical layers) does not show up on 3D rendering 2014-04-27 13:30:45 +02:00
Lorenzo Marcantonio 852f21a7dc Fixed bug in via cleanup control flow 2014-04-26 13:23:00 +02:00
Lorenzo Marcantonio f1069929df Reworked the endpoint designator constants FLG_BEGIN and FLG_END in a
ENDPOINT_T enum type
2014-04-25 19:13:33 +02:00
jean-pierre charras ead32f6885 eeschema: fix the very minor bug #1298094. But it was due to a bad bounding box calculation, which is now fixed. 2014-04-25 18:49:32 +02:00
Lorenzo Marcantonio 249003e594 Removed the ugly bit stuffing for the bottom via layer number
(just replaced it with a member)
2014-04-25 10:03:50 +02:00
Dick Hollenbeck 28497f10dd SEGVIA -> VIA for swig 2014-04-25 01:43:14 -05:00
Lorenzo Marcantonio 37adb11be5 TRACK/SEGVIA cleanup
- SEGVIA becomes VIA
- Drill size moved from TRACK to VIA
- Removed shape from TRACK, becomes ViaType in VIA
- GetTrace becomes GetTrack, for uniformity
- Some minor constification and typo fixes
2014-04-25 08:00:04 +02:00
jean-pierre charras 63d4051059 Pcbnew: fix Bug #1304418 . Fix also a related issue which crashes Pcbnew in some corner cases.
(for instance, when a footprint from the currently edited board is loaded in the footprint editor, and when the board is cleared or reloaded)
In footprint editor, the net names are no more shown od modifiable (becuase the footprint editor does not know anything about net names.
This change should allow the changes planned in pcbnew.
2014-04-24 20:54:49 +02:00
Dick Hollenbeck 7f27b30ac9 single_top w/o kiface whines and exits gracefully. 2014-04-24 13:31:11 -05:00
Dick Hollenbeck 2bc0a44764 comment fix, simplified unhandled IO_ERROR exception report in single_top.cpp. 2014-04-24 12:25:57 -05:00
Dick Hollenbeck fd480f6437 Add custom target on linux to make build-dir symlinks. 2014-04-24 12:21:34 -05:00
Dick Hollenbeck 0011fd5166 Add diagnostic message for missing *.kiface, which is now a fatal installation bug. 2014-04-24 06:30:14 -05:00
Andrey Fedorushkov 88ec4fe02f fix not correct build if BUILD_GITHUB_PLUGIN=ON in linux rpm-based distro 2014-04-24 09:44:27 +04:00
John Beard c5a14f28f1 Add John Beard's patch: new and useful footprint wizards (SIP/SIP, SOIC/SSOP/TSSOP/MSOP and BGA).
Add Python utility tools to make wizard scripts more easy to write.
2014-04-23 18:36:31 +02:00
Dick Hollenbeck 056e3aede2 the boost site is getting slower, somebody might need supply a better host and offer bandwidth there for downloading the boost tar. 2014-04-23 08:53:07 -05:00
Dick Hollenbeck 6a39ea5b43 KIWAY::Player() wxASSERT 2014-04-22 11:16:34 -05:00
Dick Hollenbeck 05b91bcbfb KIWAY::Player() wxASSERT 2014-04-22 11:10:07 -05:00
Dick Hollenbeck 4402c686d8 remove KIWAY_EXPRESS::kiway_express() typo, add comments. 2014-04-22 10:26:59 -05:00
Dick Hollenbeck 43ee7b1dc1 Teach cvpcb about new KIWAY based cross-probing, factor out MAIL_T into mail_type.h 2014-04-22 10:16:19 -05:00
Dick Hollenbeck 115124c528 Functional
*) void KIWAY::ExpressMail( FRAME_T aDestination, MAIL_T aCommand, const std::string& aPayload, wxWindow* aSource=NULL );
*) virtual void KiwayMailIn( KIWAY_EXPRESS& aEvent );
*) enum MAIL_T expansion into the brave new world if cross KIWAY_PLAYER communications.

Let the KIWAY_PLAYING begin.....
through well conceived mail from one KIWAY_PLAYER to another.
Get thinking now.  Add a new MAIL_T value, then send ExpressMail(), 
and receive it in KiwayMailIn(), it's that easy.
2014-04-21 09:49:33 -05:00
Dick Hollenbeck 470b7eddb3 Get cross-probing working under the Kiway. 2014-04-21 01:51:33 -05:00
Dick Hollenbeck 0c65353c17 happy Easter 2014-04-21 01:28:17 -05:00
Dick Hollenbeck c32443fe35 add back missing pcbnew cross probing event handlers. eeschema launches kiface versions of pcbnew & cvpcb if not single. 2014-04-19 23:35:34 -05:00
Dick Hollenbeck 03c4145fa8 hook top frame with KIWAY::playerDestroyHandler() 2014-04-19 14:44:59 -05:00
Dick Hollenbeck 2459ed7320 KIWAY::dso_full_path() was more incomplete. 2014-04-19 13:58:32 -05:00
Dick Hollenbeck 23d150e618 *) Switch kicad.exe to using KIFACE modules for all major top level windows.
Eeschema, Pcbnew, and Cvpcb all run under the same process now,
    FOR THE VERY FIRST TIME!

*)  Added KIWAY::PlayerCreate(), PlayerClose(), and PlayersClose().

*)  Factored FRAME_T into <frame_type.h> from ID_DRAWFRAME_TYPE.

*)  Found that the following command line is helpful for collecting all the *.kiface
    files into the <build>/kicad/ directory so that kicad can find them.

      $ cp `find . -name '*.kiface'` kicad/

    Maybe somebody will want to rework how the CMake files are organized so all
    the binaries can go into the same place.  See python-a-mingw-us.

*)  This might fix the problem on the Mac where child process windows were not
    coming to the front.  See ->Raise() in kicad/mainframe.cpp.

*)  You can set USE_KIFACE to 0 in kicad/mainframe.cpp to chain load child exes
    instead of using the KIFACE modules directly, i.e. revert.
2014-04-19 13:47:20 -05:00
Nick Østergaard d7082b39bb Fix vertical offset for multiline text in VRML exporter. 2014-04-19 18:05:58 +02:00
Dick Hollenbeck ed25a1593e *) Add KIFACE_I::StartFlags() and IsSingle() so a KIFACE implementation can know
if it is running under single_top.cpp or under a project manager.

*)  Test Kiface().IsSingle() when adding menus, some operations are not permitted
    when running under a project manager and the KIWAY_PLAYER is pegged to a
    specific project.

*)  Implemented KIWAY::KiFACE() so it loads *.kiface files.  They still have to be
    in the same directory as the main *.exe launcher, so this presents some difficulty
    when the binaries are not yet installed but rather the *.kiface files are still
    in their original build directories.  For today, I simply copied _pcbnew.kiface
    to build/kicad/.

*)  Add a test case to kicad/mainframe.cpp just to get an early peek at loading
    _pcbnew.kiface under the C++ project manager.  Got that working for one
    specific invocation just for proof of concept.  Surprise, it works.
2014-04-17 21:05:40 -05:00
Maciej Suminski ca7d56cefd The kicad.exe project manager was not finding the kicad.pro file because it did
not know where the template directory was.
2014-04-17 17:02:36 -05:00
Maciej Suminski 1bba172393 Upstream merge. 2014-04-16 11:26:41 +02:00
Maciej Suminski 7e43e8e4dd wxWidgets 2.8 compatibility fixes. 2014-04-15 16:36:23 +02:00
Dick Hollenbeck b5a8c2a2a0 Don't know how it ever worked before, supporting project template kicad.pro 2014-04-15 00:55:15 -05:00
Dick Hollenbeck ac353fc037 PROJECT::configCreate() logic changes. 2014-04-15 00:34:28 -05:00
Dick Hollenbeck a340308dc1 improve help file finding after kiway breakage. 2014-04-14 13:49:52 -05:00
Lorenzo Marcantonio feaab95087 - Began rework/cleanup of the board cleanup routine
- Set the modified flag even for null segment removal
2014-04-13 20:24:44 +02:00
Dick Hollenbeck 14c2469a3f remove a static wxString constructor which was out of sequence with another dependent one, at least with one toolchain. 2014-04-13 07:48:58 -05:00
Dick Hollenbeck 14ed75b0a7 kicad-install.sh: only install global fp-lib-table if non-existent 2014-04-11 08:36:20 -05:00
Nick Østergaard 4e38c73586 bzr email happiness 2014-04-11 08:30:30 -05:00
Dick Hollenbeck 3c4cb06644 oops, wx2.8 compatibility fixes 2014-04-10 16:31:55 -05:00
Dick Hollenbeck b7937c5c79 oops, wx2.8 compatibility fixes 2014-04-10 16:24:15 -05:00
Dick Hollenbeck aa56df75bd catch some IO_ERRORs 2014-04-10 16:20:01 -05:00
Maciej Suminski 0f78123d69 Fix MinGW OpenMP link error. 2014-04-09 20:55:34 -04:00
Maciej Suminski e4a4578b40 Key events are handled by wxEVT_CHAR instead of wxEVT_KEY_[UP|DOWN]. Fixed issue of chars that require modifiers (e.g. ? is Shift+/ on US keyboard layout). 2014-04-09 17:33:22 +02:00
Maciej Suminski 1c35e7d6f6 Hot keys specific to a tool have priority over global hot keys (TOOL_ACTION scope: AS_GLOBAL/AS_CONTEXT is finally handled properly). 2014-04-09 17:05:05 +02:00
Maciej Suminski 24b8d96709 Fixed vias layer order. 2014-04-09 17:01:22 +02:00
Maciej Suminski 1a3f7989df Fixed ratsnest update after removing items. 2014-04-09 16:57:22 +02:00
Dick Hollenbeck 2249b3be12 Jettison FP_LIB_TABLE::ConvertFromLegacy() into a static function, where it
was used locally.  Then comment it out in favor of a newer strategy for
filling in nicknames in cvpcb. 

Add MODULE* FootprintLoadWithOptionalNickname( const FPID& aFootprintId )
        throw( IO_ERROR, PARSE_ERROR );
from code found elsewhere.
2014-04-09 08:33:04 -05:00
Dick Hollenbeck 289c4c2f9d More migration towards single process, extend PROJECT::Config*() in proper direction, cleanups. 2014-04-07 23:55:53 -05:00
Maciej Suminski c5e84fe49a Upstream merge. 2014-04-07 18:00:13 +02:00
Maciej Suminski 3d9d94c18a GAL defaults to Cairo, so KiCad does not fail on completely OpenGL incapable systems.
Board is cached in GAL only when the canvas is activated.
2014-04-07 16:04:54 +02:00
Maciej Suminski 19f1adabea Fixed refreshing issues (DRC, new items after reloading netlist and probably many other places). 2014-04-07 15:35:50 +02:00
Maciej Suminski c225dbbba2 Fixed outline breaking for zones (points were not always created in the double click point). 2014-04-07 14:30:38 +02:00
Dick Hollenbeck f599033a1a Enhance scripts/library-repos-install.sh to create library-repos-install.bat and add that. 2014-04-07 07:28:44 -05:00
Maciej Suminski 877928a57a Items that may be modified using EDIT_POINTs used to stay selected after pressing ESC (only EDIT_POINTs got away) - fixed. 2014-04-07 13:59:27 +02:00
Maciej Suminski 8461a62c3a Fixed switching back to selection tool using the right toolbar buttons in pcbnew (GAL). 2014-04-07 13:50:18 +02:00
Maciej Suminski 2b328721d4 Formatted ttl library to comply with KiCad coding policy. 2014-04-07 13:32:09 +02:00
Dick Hollenbeck 31d231ed36 make kicad-install.sh executable 2014-04-06 14:21:10 -05:00
Dick Hollenbeck cd4feed7de use proper schematic parts library 2014-04-06 14:12:37 -05:00
Dick Hollenbeck ff4887b46c kicad-install.sh uses https protocol. 2014-04-06 13:50:59 -05:00
Dick Hollenbeck 4c780e7074 remove a warning message 2014-04-04 13:43:12 -05:00
jean-pierre charras 34dc6da5ad Pcbnew: commit forgotten change. 2014-04-04 20:35:07 +02:00
jean-pierre charras 030cee7ddf Footprint Editor: minor cosmetic enhancement (which could avoid a report like bug #1302255) 2014-04-04 20:28:35 +02:00
Maciej Suminski 5bd06278d3 Bruteforce module update after a netlist reload. 2014-04-04 17:42:35 +02:00
Maciej Suminski dfb461307a Added net highlighting. 2014-04-04 17:40:00 +02:00
Maciej Suminski e179d215a7 Corrected zone display settings for GAL. 2014-04-04 16:58:44 +02:00
Dick Hollenbeck b1e4eeb2b5 Rework FOOTPRINT_VIEWER_FRAME::GetActiveFootprintViewer(), fix up comments and warnings. 2014-04-04 09:57:26 -05:00
Maciej Suminski ed43e47115 Elements visibility are updated in the GAL. 2014-04-04 16:48:45 +02:00
Maciej Suminski 1adc04caf6 High contrast color got blueish by accident - fixed. 2014-04-04 15:49:37 +02:00
Maciej Suminski 6e5c404f94 Edit->Global Deletions & Edit->Cleanup Tracks and Vias work in GAL, without toggling between canvases. 2014-04-04 15:43:30 +02:00
Maciej Suminski 7ae0fba8f1 Fixed crashes related to ratsnest on canvas change. 2014-04-04 13:03:41 +02:00
Maciej Suminski 52640fd5fd Fixed occasional crashes on undo/redo while dragging. 2014-04-04 12:56:50 +02:00
Maciej Suminski 9a6ab4e64f Fixed GAL canvas freeze when ordered twice to change to the same GAL canvas (e.g. double F11). 2014-04-04 12:01:30 +02:00
Maciej Suminski d5d4ae3305 Renamed [class_]drawpanel_gal.[cpp|h] to [class_]draw_panel_gal.[cpp|h] to follow current naming scheme. 2014-04-04 11:56:04 +02:00
Maciej Suminski d5b2a3b007 Added possibility of switching tools by the right toolbar buttons, without deactivating the current tool first (previously tools did not switch if there was one active). 2014-04-04 11:50:15 +02:00
Maciej Suminski b588456d6a TEXTE_MODULE relative position is updated when absolute position is changed (and viceversa). 2014-04-04 09:01:17 +02:00
jean-pierre charras f28484179d Cmakefiles: do not create map files on Windows, because creating map file generates hundred of useless warnings.
In PATCH_COMMAND, use patch instead of bzr patch if patch or patch.exe is found (mandatory to build Kicad on msys2 because 'bzr patch' does not work when using msys2)
2014-04-04 07:55:28 +02:00
jean-pierre charras c1804da8a2 Cmakefiles: do not create map file on Windows, because creating map file generates hundred of useless wranings.
In PATCH_COMMAND, use patch instead of bzr patch if patch or patch.exe is found (mandatory to use msys2 because bzr patch does not work when using msys2)
2014-04-03 13:55:02 +02:00
Maciej Suminski 0304286c2c Fix Clang build error when OpenMP is not found. 2014-04-03 06:54:08 -04:00
Maciej Suminski 33bad83ea7 Fixed missing transitions for EDIT_TOOLs. 2014-04-03 10:24:27 +02:00
Maciej Suminski 0e35ad6329 Fixed cancelling dialogs in DRAWING_TOOL. 2014-04-03 09:48:06 +02:00
jean-pierre charras 1cbcc8dc25 All: add 2 hotkeys to simulate a mouse left click (key return) and left dclick (key end) 2014-04-03 09:40:55 +02:00
Maciej Suminski bf92b0103a Converted std::bind1st to boost::bind. 2014-04-02 16:30:48 +02:00
Maciej Suminski 9ad3180f6c Added EC_SNAPLINE to make possible snapping EDIT_LINES by their ends rather than by its center. 2014-04-02 15:57:21 +02:00
Maciej Suminski 0e270eec05 Upstream merge. 2014-04-02 15:38:59 +02:00
Maciej Suminski 6e72301bd7 Refactoring EDIT_POINTS, part 3: constraints split to EDIT_POINTs and EDIT_LINEs. 2014-04-02 09:31:35 +02:00
Maciej Suminski a59d0f113b Refactoring EDIT_POINTS, part 2: replaced index numbers with constants. 2014-04-01 17:41:24 +02:00
Maciej Suminski 827fd67191 Refactoring EDIT_POINTS, part 1: separated functions that operate on EDIT_POINTS and EDIT_LINES. 2014-04-01 17:18:43 +02:00
Maciej Suminski 9b67ee04e6 If tool was previously active and it is called again, it is brought to the top of the active tool stack.
It fixes issue of dragging of items that have EDIT_POINTs, when dragging was activated by hovering over an item and using hot key.
2014-04-01 14:35:09 +02:00
Maciej Suminski 5127237b40 Fixed autopanning for POINT_EDITOR. 2014-04-01 14:13:00 +02:00
Maciej Suminski 2af184034b Activation of any drawing/placement tool clears current selection. 2014-04-01 14:06:19 +02:00
Maciej Suminski 96e9942a9b Fixed drifting for items dragged using EDIT_TOOL. 2014-04-01 13:30:31 +02:00
Wayne Stambaugh 603121f753 Fix OpenMP link error on MinGW. 2014-03-31 22:38:19 -04:00
jean-pierre charras b0020a904b Pcbnew: bug fix: sometimes (depending on a previous command) pcbnew could create an usual zone instead of a keepout zone when the" create keepout zone" tool is activated 2014-03-31 20:14:01 +02:00
jean-pierre charras be2238411d Finishing dialog_freeroute_exchange.cpp changes to run freeroute.jar if found in kicad binaries.
Very minor other fix
2014-03-29 21:00:14 +01:00
Lorenzo Marcantonio 939e3d589b Removed relic empty if 2014-03-29 18:34:13 +01:00
Lorenzo Marcantonio 6475d4496d Indentation was completely broken (editor tabbing issue, maybe?) 2014-03-29 12:22:20 +01:00
jean-pierre charras ef938bdf1f Eeschema: fix Bug #1298868 (Can't create new schematic from main toolbar icon) - Fix a bug I created in rev 4773 2014-03-28 14:23:26 +01:00
jean-pierre charras 285ef4dab6 Eeschema: fix Bug #1298868 (Can't create new schematic from main toolbar icon) 2014-03-28 14:08:48 +01:00
cdelbegu bc2cb06a0e Pcbnew - GAL: fix bug #1296811 (The grid can't be enable/disable via the layer manager) 2014-03-28 14:06:30 +01:00
Jean-Samuel Reynaud 8715df4ab0 Fix a mismatch between method signature in scripting/python_scripting.cpp and scripting/python_scripting.h 2014-03-28 07:27:58 -05:00
jean-pierre charras 4d02c43189 Fix (temporary fix) a bug I created in dialog_freeroute_exchange.cpp in bzr rev 4769 2014-03-27 19:28:10 +01:00
jean-pierre charras e962b9f4f6 Pcbnew: Fix bug #1296649 (Text on flipped modules incorrectly placed).
Dialog Freeroute: if freeroute.jar is find in kicad binaries, it is run as a standard java application, not as web applcation
Very minor other fixes
FPC_(SMD_type)_footprintwizard.py wizard finished.
2014-03-27 18:45:05 +01:00
Maciej Suminski 93065de210 >Added handled hotkeys:
- resetting relative coordinates
- switching units
- not official: changing transparency for layers (works only for main layers, does not work on vias/pads/etc.)
2014-03-24 18:28:21 +01:00
Maciej Suminski 3b05177a3a PCB_EDIT_FRAME::SetHighContrastLayer() went public.
Refactored code that handled zooming events.
Added PCB_RENDER_SETTINGS::Get/SetSketchMode().
PCBNEW_CONTROL reacts to hot keys changing display modes (sketch via/tracks, high contrast).
2014-03-24 17:20:23 +01:00
Maciej Suminski 6181ee494b Added PCBNEW_CONTROLS for handling miscellaneous hot keys (trying to be compatible with the default hot key settings). Currently there are a lot of stubs to be filled out (in pcbnew_controls.cpp).
Handled actions:
- switching layers
- switching grids
- changing track width & via size
2014-03-24 08:45:05 +01:00
jean-pierre charras 8faf3f740f Eeschema: does not close when the schematic file given in command line to run Eeschema is not found (i.e. when starting a new project). Otherwise one cannot start a new schematic project. 2014-03-23 07:44:15 +01:00
Marco Serantoni 8ef7b23c04 [MacOSX] forgot pl_editor, thanks Jean-Paul for pointing it 2014-03-23 02:50:33 +01:00
Marco Serantoni 36ea1e0b0f [MacOSX] Support for kiface in bundles, workaround for some cairo issues 2014-03-22 12:35:33 +01:00
jean-pierre charras edb2b3008c Minor fixes for Windows: move resources from dso to .exe, to have the application icon in executable, and therefore shown in shortcuts.
pcb_calculator: minor coding style fix.
2014-03-22 09:28:39 +01:00
Maciej Suminski 9330924636 Changed void BASE_SCREEN::GetGrids( GRIDS& aList ) to const GRIDS& BASE_SCREEN::GetGrids().
Refactored:
- EDA_DRAW_FRAME::SetNextGrid() & SetPrevGrid()
- PCB_BASE_FRAME::SetFastGrid1() & SetFastGrid2()
Removed a warning from RN_DATA::updateNet(int).
2014-03-21 18:00:11 +01:00
Dick Hollenbeck 2b6305ba48 single_top.c logic, improved OpenProjectFiles() documentation. 2014-03-21 11:59:19 -05:00
Maciej Suminski 1f38879fef FIxed too late deletion of TOOLs. 2014-03-21 17:55:46 +01:00
Dick Hollenbeck 630df1812f Enable GITHUB as default, include typeinfo into kiway_holder.cpp 2014-03-21 07:20:54 -05:00
jean-pierre charras 8137358e8e CvPcb: Fix crashes when starting cvPcb (could be Windows Specific) and after closing the footprint viewer. 2014-03-21 12:50:04 +01:00
Maciej Suminski 18f51a4dbe PCB_EDIT_FRAME::SetActiveLayer() & GetActiveLayer() made public. 2014-03-21 11:17:47 +01:00
Maciej Suminski 5eb4ecbf1c TOOL_EVENTs autoregister themselves in ACTION_MANAGER.
ROUTER_TOOL events have temporarily changed their hotkeys assignment.
2014-03-21 10:40:50 +01:00
Dick Hollenbeck e454408772 simplify and fix the technique used to get the project fp-lib-table 2014-03-20 20:24:35 -05:00
Wayne Stambaugh eb36fb9280 Fix windows build error for missing path separator definitions.
* Use wxFileName::GetPathSeparator() instead of redefining them.
2014-03-20 14:07:19 -04:00
Dick Hollenbeck 3b48abba6d documentation clarity 2014-03-20 11:32:34 -05:00
Dick Hollenbeck 2b39b1e7ea some doxygen fixes, comment fixes 2014-03-20 09:18:32 -05:00
Maciej Suminski 84161768fa Minor fixes (check for net codes size for ratsnest, cursor coordinates are not always shown as if the cursor was snapped). 2014-03-20 11:31:32 +01:00
Maciej Suminski b1a1b12e42 GAL zooms in and out using the default hot keys (F1/F2).
Screen size is saved in VECTOR2I instead of VECTOR2D.
2014-03-20 08:47:31 +01:00
Dick Hollenbeck 8b35a0a36f * KIWAY Milestone A): Make major modules into DLL/DSOs.
!   The initial testing of this commit should be done using a Debug build so that
    all the wxASSERT()s are enabled.  Also, be sure and keep enabled the
    USE_KIWAY_DLLs option.  The tree won't likely build without it.  Turning it
    off is senseless anyways.  If you want stable code, go back to a prior version,
    the one tagged with "stable".

*   Relocate all functionality out of the wxApp derivative into more finely
    targeted purposes:
    a) DLL/DSO specific
    b) PROJECT specific
    c) EXE or process specific
    d) configuration file specific data
    e) configuration file manipulations functions.

    All of this functionality was blended into an extremely large wxApp derivative
    and that was incompatible with the desire to support multiple concurrently
    loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
    An amazing amount of organization come from simply sorting each bit of
    functionality into the proper box.

*   Switch to wxConfigBase from wxConfig everywhere except instantiation.
*   Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
    PGM_SINGLE_TOP,
*   Remove "Return" prefix on many function names.
*   Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
*   Fix building boost for use in a DSO on linux.
*   Remove some of the assumptions in the CMakeLists.txt files that windows had
    to be the host platform when building windows binaries.
*   Reduce the number of wxStrings being constructed at program load time via
    static construction.
*   Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
    these functions are useful even when the wxConfigBase comes from another
    source, as is the case in the KICAD_MANAGER_FRAME.
*   Move the setting of the KIPRJMOD environment variable into class PROJECT,
    so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
*   Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
    its child wxFrames and wxDialogs now have a Kiway() member function which
    returns a KIWAY& that that window tree branch is in support of.  This is like
    wxWindows DNA in that child windows get this member with proper value at time
    of construction.
*   Anticipate some of the needs for milestones B) and C) and make code
    adjustments now in an effort to reduce work in those milestones.
*   No testing has been done for python scripting, since milestone C) has that
    being largely reworked and re-thought-out.
2014-03-20 01:47:30 -05:00
Dick Hollenbeck ca969f0884 merge tip in, resolve. 2014-03-20 01:24:33 -05:00
Dick Hollenbeck 88489e4af6 * KIWAY Milestone A): Make major modules into DLL/DSOs.
!   The initial testing of this commit should be done using a Debug build so that
    all the wxASSERT()s are enabled.  Also, be sure and keep enabled the
    USE_KIWAY_DLLs option.  The tree won't likely build without it.  Turning it
    off is senseless anyways.  If you want stable code, go back to a prior version,
    the one tagged with "stable".

*   Relocate all functionality out of the wxApp derivative into more finely
    targeted purposes:
    a) DLL/DSO specific
    b) PROJECT specific
    c) EXE or process specific
    d) configuration file specific data
    e) configuration file manipulations functions.

    All of this functionality was blended into an extremely large wxApp derivative
    and that was incompatible with the desire to support multiple concurrently
    loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
    An amazing amount of organization come from simply sorting each bit of
    functionality into the proper box.

*   Switch to wxConfigBase from wxConfig everywhere except instantiation.
*   Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
    PGM_SINGLE_TOP,
*   Remove "Return" prefix on many function names.
*   Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
*   Fix building boost for use in a DSO on linux.
*   Remove some of the assumptions in the CMakeLists.txt files that windows had
    to be the host platform when building windows binaries.
*   Reduce the number of wxStrings being constructed at program load time via
    static construction.
*   Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
    these functions are useful even when the wxConfigBase comes from another
    source, as is the case in the KICAD_MANAGER_FRAME.
*   Move the setting of the KIPRJMOD environment variable into class PROJECT,
    so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
*   Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
    its child wxFrames and wxDialogs now have a Kiway() member function which
    returns a KIWAY& that that window tree branch is in support of.  This is like
    wxWindows DNA in that child windows get this member with proper value at time
    of construction.
*   Anticipate some of the needs for milestones B) and C) and make code
    adjustments now in an effort to reduce work in those milestones.
*   No testing has been done for python scripting, since milestone C) has that
    being largely reworked and re-thought-out.
2014-03-19 19:42:08 -05:00
unknown 884219fd90 GAL: fix zooming using mouse wheel with wxWidgets 3.0. 2014-03-19 21:07:49 +01:00
jean-pierre charras 60c0b8de0d Pad editor dialog: Better tests and error messages about issues in pad settings. Fis also an other hard to translate error messge. 2014-03-19 21:06:09 +01:00
Maciej Suminski 25538205c9 Fixed a few ratsnest glitches in GAL. 2014-03-19 15:33:13 +01:00
Maciej Suminski b34f6bcd0b Cursor coordinates are updated in GAL canvases. 2014-03-19 14:26:02 +01:00
Maciej Suminski f0dfd89d26 Fixed undo for MARKER_PCBs. 2014-03-19 13:46:52 +01:00
Maciej Suminski 46efeb0a46 DRC markers are drawn in GAL canvases. 2014-03-19 13:42:46 +01:00
Maciej Suminski 1d804eba61 Fixed mouse wheel handling for GAL canvases with wx3.0. 2014-03-19 11:57:59 +01:00
Maciej Suminski 391d7df0b5 Changed cast from float to double in RN_POLY::HitTest. 2014-03-19 11:16:01 +01:00
jean-pierre charras 9020146df5 kicad-install.sh: fix bad url for legacy libraries. Add the same script hich does not need a bazaar account to download Kicad (using https instead of ssh to create branches) 2014-03-18 19:52:29 +01:00
Maciej Suminski 77f2287acc Break points for zones are not added in the same place as existing points. 2014-03-18 17:02:10 +01:00
Maciej Suminski e1ca953c40 Isolated EDIT_CONSTRAINTs to different .cpp/.h files. 2014-03-18 16:55:06 +01:00
Maciej Suminski b857ba58ca Instant dragging (without prior selection). 2014-03-18 16:25:46 +01:00
Maciej Suminski 140361e2c8 Splitting DRAWSEGMENTs with POINT_EDITOR. 2014-03-18 15:46:38 +01:00
Maciej Suminski 3aae81b307 Breaking outlines for zones using POINT_EDITOR. 2014-03-18 14:52:22 +01:00
Maciej Suminski b361baae42 Enabled autopanning while drawing zones. 2014-03-18 14:01:09 +01:00
Maciej Suminski d52568908f EC_CONVERGING handles colinear lines properly. 2014-03-18 13:57:10 +01:00
Maciej Suminski 6b99cbe9a5 Minor fixes to zone drawing tool. 2014-03-18 11:33:49 +01:00
jean-pierre charras df9c611f09 3D viewer: fix 3D grid artifact ( bug 1293873 ) 2014-03-18 11:31:13 +01:00
Maciej Suminski 5dd03b4ecd Fixed triple click bug while drawing zones with DRAWING_TOOL. 2014-03-18 11:09:43 +01:00
Maciej Suminski a3cd531e9e Yet another approach to EC_LINE and EC_CONVERGING edit constraints. 2014-03-18 11:05:24 +01:00
Maciej Suminski 86f84b9ed0 Comments. 2014-03-18 11:04:52 +01:00
unknown fc961993d5 Warning removal, patches from Camille 019 2014-03-16 18:40:23 +01:00
jean-pierre charras 8d7bcf4995 bitmap2component: add management of image resolution: Is read from file, when exists, and can be modified in bitmap2component.
It also fix issue #747631
2014-03-16 15:10:42 +01:00
Orson 2a1bb84cf7 Corrected the error message about required OpenGL version for GAL. Fixed pcb_calculator .desktop file. 2014-03-14 21:32:25 +01:00
Maciej Suminski 9134289303 ZONE_CONTAINERs are drawn as outlines while being edited using the POINT_EDITOR. 2014-03-14 16:05:30 +01:00
Maciej Suminski d19f57b0d5 Added EC_CONVERGING for zone areas modification. 2014-03-14 15:37:55 +01:00
Maciej Suminski f8a0869314 Templated EDIT_POINT_CONSTRAINT.
Removed EDIT_CONSTRAINT::Update() - replaced with resetting constraints.
EDIT_CONSTRAINT is stored in EDIT_POIN using boost::shared_ptr instead of pointer.
Added EDIT_LINE::GetEnd() & GetOrigin(). Overridden ApplyConstraint() for EDIT_LINE.
Side EDIT_POINTS for zones are drawn as circles.
2014-03-14 15:15:38 +01:00
jean-pierre charras 85e2613f0b Doc update 2014-03-14 08:37:04 +01:00
Marco Serantoni 55c3fce790 [MacOSX] Pcbnew crash on editing dimension's line width 2014-03-14 02:10:27 +01:00
Marco Serantoni 42c0340880 [MacOSX] New OSX build enviroment now supported 2014-03-14 02:07:44 +01:00
Marco Serantoni b5faf71be4 [MacOSX] New OSX enviroment seems to be more picky about options, this fixes the linker part 2014-03-14 00:44:46 +01:00
Maciej Suminski 657ac76bbf Fixes build error with the choosy CLANG (Thanks to Maciej Suminski) 2014-03-13 18:50:52 +01:00
Maciej Suminski 3700ab0555 Yet another approach to 45 degree constraints. 2014-03-13 11:48:19 +01:00
jean-pierre charras c16837d3b6 Footprint Editor: fix a crash when the dialog to set pad properties is called from the main toolbar (i.e. to define the default setting for new pads, and not to edit an existing pad) 2014-03-13 08:15:19 +01:00
Maciej Suminski 0cb0a451a4 Pcbnew: GAL canvas selection tool bug fixes.
* Fix Python scripting error causing pcbnew_wrap.cxx to fail to build.
* Fix OpenGL canvas ratsnest missing connections in copper zones.
2014-03-12 20:55:59 -04:00
Maciej Suminski d7efbd5044 Changed cast from float to double in RN_POLY::HitTest. 2014-03-12 22:42:08 +01:00
Maciej Suminski 1770e40aec Fixed 45 degree mode toggle. 2014-03-12 17:50:24 +01:00
Maciej Suminski af7454b767 Fixed erroneous hit testing for polygons in ratsnest for GAL. 2014-03-12 17:11:52 +01:00
Maciej Suminski 3e50e00f89 Moved panning boundaries and scale limits from VIEW to VIEW_CONTROL. 2014-03-12 17:09:53 +01:00
Maciej Suminski e35647b25b Changed the way of handling BOX2 traits (used std::numeric_limits). 2014-03-12 17:09:37 +01:00
Maciej Suminski 70c62508a5 Removed excessive variable (m_Corners) from MARKER_BASE. 2014-03-12 15:53:20 +01:00
Maciej Suminski f4f78722a7 Fixed erroneous hit testing for polygons in ratsnest for GAL. 2014-03-12 15:00:14 +01:00
Maciej Suminski 9b1b505731 Workarounded SWIG problems (does not support nested C++ classes, more on the subject: http://www.swig.org/Doc1.3/SWIGPlus.html#SWIGPlus_nested_classes). 2014-03-12 14:58:49 +01:00
Maciej Suminski babeea0c45 Switched order of EDIT_POINTs for DIMENSION, so in case when feature lines are of 0 length, then still can be stretched. 2014-03-12 10:53:42 +01:00
Maciej Suminski fac1cab1d9 Added new constraint for EDIT_POINTs (EPC_LINE).
Dimensions have EDIT_POINTs.
Different handling of 45 degree mode in POINT_EDITOR.
2014-03-12 10:46:11 +01:00
Maciej Suminski 3f4ba31188 Minor fix to SEG class. 2014-03-12 10:05:09 +01:00
Maciej Suminski 187f9ff0f4 Merge selection tool branch. 2014-03-11 20:45:01 -04:00
Maciej Suminski ba7cfecd5d Workarounded SWIG problems (does not support nested C++ classes, more on the subject: http://www.swig.org/Doc1.3/SWIGPlus.html#SWIGPlus_nested_classes). 2014-03-11 14:50:53 +01:00
Maciej Suminski 7b706ee873 Added a few settings to make the layer settings more similar to KiCad defaults (moved vias to VIA_THROUGH_VISIBLE, added a few rules for required layers). 2014-03-11 10:58:58 +01:00
Marco Serantoni 8809d5580e [MacOSX] fixes some interations with KicadOSXBuilder 2014-03-10 23:37:59 +01:00
Maciej Suminski e9aec03ce0 Cursor snaps to EDIT_POINTs.
Added POINT_EDITOR::isModified().
2014-03-10 16:25:40 +01:00
Maciej Suminski bf9a7511f3 Fixed a bug caused by removed VIEW_ITEMs that were marked for updating. 2014-03-10 16:01:15 +01:00
Maciej Suminski 517c555d6a Removed unnecessary casting. 2014-03-10 10:18:48 +01:00
jean-pierre charras edcf84a2a1 Finishing work on a better 3D viewer. this also fix bugs like Bug #1129630 . 2014-03-09 19:43:53 +01:00
jean-pierre charras 0fa01812eb Pcbnew: fix Bug #1289416 (Broken setting of layer list in D_PAD:: ViewGetLayers() for GAL). 2014-03-08 20:07:35 +01:00
jean-pierre charras f610294d27 Rework on 3D viewer (work in progress): Disable or enable layers, grid or 3D footprint shapes should be now faster. 2014-03-08 20:04:23 +01:00
Wayne Stambaugh 2ebd47c331 Pcbnew: make block rotate honor the rotation angle setting. (fixes lp:1281605)
* Make block rotate command honor the rotation angle setting.  Thank you
  Umesh Mohan <mohan.umesh@gmail.com> for the patch.
* Change block rotate undo command from UR_ROTATE to UR_CHANGED so consecutive
  rotations do not lead to round errors and for proper undo in case the user
  changes the rotation angle setting between block rotations.
2014-03-07 17:34:54 -05:00
Maciej Suminski 9d0b3649a1 Added documentation. Moved some functions from .h to .cpp files. 2014-03-07 10:26:33 +01:00
Cirilo Bernardo 699dbbf53f KiCad: improve gerber file extension wildcard so gerbers show up correctly in the file tree pane. 2014-03-06 16:44:48 -05:00
Wayne Stambaugh b2ce20783e Coding policy fixes. 2014-03-06 13:38:39 -05:00
Maciej Suminski 099f58a100 Added EDIT_LINEs for dragging zone outlines. 2014-03-06 17:34:04 +01:00
Maciej Suminski 3029f762bf 45 degrees mode for POINT_EDITOR. 2014-03-06 14:41:25 +01:00
Maciej Suminski 2bce2f96d8 Undo/redo support for POINT_EDITOR. 2014-03-06 12:36:20 +01:00
Maciej Suminski 8d38938da1 Auto zone refilling after using the POINT_EDITOR.
Minor code cleaning.
2014-03-06 11:49:08 +01:00
Maciej Suminski 21d2c19333 Merged selection_tool branch. 2014-03-06 10:43:40 +01:00
Maciej Suminski 4419ef42bb Merged upstream. 2014-03-06 09:42:16 +01:00
Maciej Suminski 8461fc2f3b Removed warnings. 2014-03-06 09:14:06 +01:00
jean-pierre charras eb8d78ea21 Fix a minor bug I created in commit 4733 2014-03-05 18:57:13 +01:00
jean-pierre charras f944c79269 Minor code cleanup in 3d viewer (remove dead or useless code). Some minor other fixes. 2014-03-05 18:40:23 +01:00
Maciej Suminski aa54a3e5a1 Fixed undo while PNS is active. 2014-03-05 16:44:08 +01:00
Maciej Suminski 1d6357a76a Squashed memory leaks. 2014-03-05 14:57:14 +01:00
Maciej Suminski c66a3232ac Removed a few memory leaks. 2014-03-03 17:15:41 +01:00
Martin Janitschke 7adb74699b Pcbnew: add option to merge non-plated through holes to drill file. (fixes lp:1133330) 2014-03-03 09:28:05 -05:00
Maciej Suminski b31fede98e Pcbnew: fixed SIGFPE arithetic exception. (fixes lp:128339, 1285969, and 1286426) 2014-03-02 20:18:26 -05:00
Martin Janitschke cef8e05eb0 Pcbnew: fix global deletion bug and minor dialog changes. (fixes lp:1263795)
* Handle different item global deletions correctly.  No more removing of text
  if graphics is selected.
* Layer settings are always obeyed for modules, zones, text, and graphics.
* Text will be removed from copper layers if all layers are selected or
  according to the current layer.
* Added check boxes for "normal" and "locked" footprints to be consistent
  with the naming for the track deletion options.
2014-03-01 12:20:22 -05:00
jean-pierre charras e28ead71b6 3D viewer: fix mirroring issue for texts in flipped footprints. 2014-02-28 18:46:18 +01:00
Fabrizio Tappero ccc11c8ed8 Commit patch about cvpcb, pcbnew and layout editor menu items, with 3 menu labels modified in Eeschema. 2014-02-28 18:31:00 +01:00
Maciej Suminski c5f04753f9 Zones are supported by POINT_EDITOR. 2014-02-28 18:24:29 +01:00
Maciej Suminski 9f4d338a02 Circles are supported by POINT_EDITOR. 2014-02-28 18:24:13 +01:00
Maciej Suminski 96ca762543 Fixed POINT_EDITOR crash on GAL change / board reload. 2014-02-28 17:20:10 +01:00
Maciej Suminski a1f80f20a7 Added TOOL_ACTION for updating EDIT_POINTS.
EDIT_POINTs show up when there is only one item selected (now after deselection as well).
2014-02-28 16:53:28 +01:00
Maciej Suminski 8d8c72856d Added TOOL_MANAGER & ACTION_MANAGER::RunAction( const TOOL_ACTION aAction ).
Selection clearing is invoked using TOOL_ACTION object rather than its name.
2014-02-28 15:46:05 +01:00
jean-pierre charras 7d1c0ec4db 3D viewer: shows now the texts of footprints (ref, value and others) when visible.
Fix also other very minor issues.
Realistic mode shows or not the copper thickness (depending on selected option in preferences) to speed up the screen redraw.
2014-02-28 11:51:47 +01:00
Maciej Suminski 16a68d8528 Fixes ratsnest crashing on zones with negative net codes. 2014-02-28 11:12:55 +01:00
Marco Serantoni 9c1f4efb6e Fix for bug #1285878, build fails with clean repository and high parallelism due missing dependance between router and pcbcommon 2014-02-27 23:56:16 +01:00
jean-pierre charras 41c4388d5c Fix Bug #1275544 (Page size dialog: page size drop-down doesn't handle mouse-click event) 2014-02-27 20:53:04 +01:00
Martin Janitschke f503ee945f make microwave toolbar accessible from menu (Bug #1285425 ) 2014-02-27 19:48:18 +01:00
Maciej Suminski 125ef0a679 Initial version of POINT_EDITOR. 2014-02-27 17:29:08 +01:00
Maciej Suminski 075283d9a8 SELECTION_TOOL emits event notifying about selecting/deselecting/clearing selection. 2014-02-27 17:27:58 +01:00
Maciej Suminski dbe19fc5f9 Added VIEW::ToWorld( double ).
TOOL_EVENT message is supposed to contain string as parameter.
Added missing header for class_drawsegment.h (KiROUND).
Renamed SELECTION_TOOL::containsSelected() to SELECTION_TOOL::selectionContains().
2014-02-27 16:13:27 +01:00
jean-pierre charras 7fa70d1885 Fix wx28 compatibility issue. 2014-02-27 09:05:28 +01:00
Marco Serantoni d39cc2d65f [MacOSX] Fixing some refresh issues when changing component on cvpcb 2014-02-27 01:57:18 +01:00
Marco Serantoni 9bdb0086b4 [MacOSX] Avoid race between cmake -E copy_directory, which triggers a build error when using an high parallelism 2014-02-26 21:46:25 +01:00
jean-pierre charras eb25a2d42b * fp_lib_table.cpp: fix an issue on Windows in ConvertFromLegacy: sometimes, because the comparison was case sensitive, lib nicknames were not found, although libs exist ( for instance if a path was given like f:\mypath instead of F:\mypath)
* getpart.cpp: fix a potential bug on a translatable string with has requirements in spelling.
* fix bug  #1066179
* kicad: fix erroneous labels in sub menus.
2014-02-26 15:06:24 +01:00
Maciej Suminski 476ec04b13 Minor changes to BRIGHT_BOX class. 2014-02-25 18:08:33 +01:00
Maciej Suminski 62a76f1ed2 Removed a few RecacheAllItems() calls, some of them changed to specific type recaching (using TYPE_COLLECTOR & VIEW_ITEM::ViewUpdate() ).
Removed OPENGL_GAL::SetStrokeColor().
2014-02-25 14:28:09 +01:00
Maciej Suminski e063962ce7 Renamed BOARD_CONNECTED_ITEM::GetNet() -> GetNetCode()
Renamed BOARD_CONNECTED_ITEM::SetNet() -> SetNetCode()
Added BOARD_CONNECTED_ITEM::GetNet() for accessing NETINFO_ITEM* of a given item.
Fixed module editor crash when launched to edit a module from a PCB.
Replaced some BOARD::FindNet( item->GetNet() ) calls with BOARD_CONNECTED_ITEM::GetNet().
2014-02-25 11:47:27 +01:00
Maciej Suminski c1b7ced4e7 Renamed BOARD_CONNECTED_ITEM::GetNet() -> GetNetCode()
Renamed BOARD_CONNECTED_ITEM::SetNet() -> SetNetCode()
Added BOARD_CONNECTED_ITEM::GetNet() for accessing NETINFO_ITEM* of a given item.
Fixed module editor crash when launched to edit a module from a PCB.
Replaced some BOARD::FindNet( item->GetNet() ) calls with BOARD_CONNECTED_ITEM::GetNet().
2014-02-25 11:40:34 +01:00
jean-pierre charras 250b558878 Viewlib: ensure in wxListBoxes the lib and the component are always shown as selected when a lib and component are specified (when called by the get component dialog for instance) 2014-02-24 20:07:24 +01:00
Maciej Suminski 374b15ff9e Minor code cleaning and optimizations. 2014-02-24 14:31:55 +01:00
Maciej Suminski de0e8bd519 Fixed a missing group clearing and update for restored VIEW_ITEMs.Fixed a missing group clearing and update for restored VIEW_ITEMs. 2014-02-24 12:56:47 +01:00
HennerZeller dd628646f2 Eeschema: * Preselect the currently chosen component in the browser when pressing the thumbnail view.
* Various smallish documentation updates in the component chooser area.
2014-02-24 11:52:08 +01:00
Maciej Suminski 0383f93aac Some variables initialized to NULL. 2014-02-24 11:17:49 +01:00
Henner Zeller 7ae0d3960f Eeschema: component selection dialog improvements.
* Pressing 'Enter' while the focus is in the tree did not work due to the
  double-click wxWidgets workaround.  Make it work.
* More clearly document what is happening and how it can be tested.
2014-02-23 20:27:07 -05:00
Nick Ostergaard c0e8c155bd Remove duplicate comments from CMakeList.txt. 2014-02-23 20:02:41 -05:00
Martin Janitschke 714fde2418 Fix 3D viewer crash bug. (fixes lp:673603 and lp:804778) 2014-02-23 19:53:55 -05:00
Henner Zeller 8479640252 Eeschema: fix build error when using wxWidgets 2.8 and other minor fixes.
* Fix string concatenation for _( "Unit" ) + wxT( " " ). This failed
  compiling against wxWidgets 2.8 (thanks Cirilo Bernardo ).
* Base the indentation on a measured observation with explanation
  (98%-ile of name-length found in library). The previously chosen 24
  character indentation was too wide for most.
* Don't use a #define spilling into the global namespace, but use
  a locally defined constant for COLUMN_DESCR_POS.
2014-02-23 09:15:01 -05:00
Blair Bonnett 649f8c2f7c Build documentation updates and comment spelling fixes. 2014-02-22 18:17:36 -05:00
jean-pierre charras eee9670f82 Eeschema: Remove usage of tabs in dialog_choose_component.cpp strings, because it does not work very well on Linux, and does not work on Windows.
This is replaced by the right number of space, using a fixed font (like in CvPcb)
Fix mismatch between icons and the actual rotation of components (CW instead of CCW) (bug 1022154 )
2014-02-22 18:50:20 +01:00
jean-pierre charras 07db739906 Eeschema: Remove usage of tabs in dialog_choose_component.cpp strings, because they do not work very well on Linux, and do not work on Windows.
Fix incorrect rotation of components (CCW instaed of CW)
2014-02-22 13:39:59 +01:00
Marco Serantoni 090eca72bc [MacOSX] Fixing resize issue in layer setup dialog 2014-02-21 17:38:29 +01:00
Maciej Suminski be6dc9d0af Revisiting GAL:
- VIEW_ITEM::ViewUpdate() does not update items immediately. Now it marks them to be updated and the real update occurs on the next rendering frame.
- VIEW::InvalidateItem() made private.
- VIEW_LAYER::enabled -> visible
- Some functions moved to header files.
2014-02-21 16:57:18 +01:00
Maciej Suminski 81b610df16 Upstream merge. 2014-02-21 11:05:28 +01:00
Maciej Suminski ee0b425538 Quick fix for unsupported pad types in PNS router. 2014-02-21 09:53:10 +01:00
Fabrizio Tappero f4c1bac7a8 Patch from Fabrizio Tappero: better kicad and eeschema menu entries and labels, which minor fixes. 2014-02-21 08:54:13 +01:00
Wayne Stambaugh f6fd93b67e Eeschema: minor component selection dialog improvements.
* Manually change fbp file minor version number so dialog could be edited
  with latest release version of wxFormBuilder.
* Give component view panel more weight for improved component view size.
* Add padding around dialog button sizer.
2014-02-20 19:29:31 -05:00
Wayne Stambaugh bad1183955 Minor coding policy fixes. 2014-02-20 19:06:37 -05:00
Marco Serantoni 8590d7dbb8 [MacOSX] New reorg for building system, typos and path refines 2014-02-19 22:39:21 +01:00
Henner Zeller 808cc9195d Eeschema: component selection dialog improvements.
* Improve component chooser redraw to fit in wxWidgets redraw strategies.
* Use LIB_COMPONENT::Draw and LIB_COMPONENT::GetBoundingBox for drawing the
  component
* Make resize redrawing work properly.
2014-02-19 11:44:48 -05:00
Maciej Suminski e4b2deed51 Removed some excessive variables. 2014-02-19 15:20:42 +01:00
Maciej Suminski 3dbb864e5e Continous mode for drawing tools (i.e. they do not finish after adding a single object). 2014-02-19 13:51:32 +01:00
unknown a3e7b856b1 GLM (tool for opengl) update to 0.9.4.6 2014-02-19 11:51:33 +01:00
Henner Zeller 4cdd8e754a Eeschema component selection dialog improvements.
* Allow to select units in components that have more than one right in the
  component chooser dialog.
* Keep chosen unit in history.
* Show preview of current component unit as thumbnail image next to the
  description box.
* Fixes lp:1280567
2014-02-18 16:41:27 -05:00
Marco Serantoni 0d68df1d93 [MacOSX] Fix for bugs #1258081 and #1267772 2014-02-18 21:30:17 +01:00
jean-pierre charras 26fd1960e6 Remove some fully outdated code (#pragma, from Henner Zeller's report, and some other things) 2014-02-18 12:41:53 +01:00
Marco Serantoni af075c1cb2 [MacOSX] Fix some small issues, this should be the least for scripting 2014-02-17 19:58:03 +01:00
unknown 19d3864a5d GLM (tool for opengl) update to 0.9.4.6 2014-02-17 19:42:52 +01:00
Maciej Suminski f01b2502c8 Added TOOL_ACTION for PNS router activation.
Most of the GAL tools are activated by corresponding buttons on the right toolbar.
Removed menu entry for PNS router (as it is activated as the usual "Add track" tool).
2014-02-17 18:21:00 +01:00
Maciej Suminski 0161fab1a3 Fixed wrongly formulated assert. 2014-02-17 17:20:44 +01:00
Maciej Suminski 364d0e0f02 Undo/redo support. 2014-02-17 14:53:01 +01:00
Maciej Suminski 7278716c65 Small leak fix. 2014-02-17 14:36:51 +01:00
Maciej Suminski e79d47fed2 Improved way of drawing 45-degree lines. 2014-02-17 11:33:03 +01:00
Maciej Suminski 6348c77788 Pcbnew: fix OpenGL PNS router track not shown bug. (fixes lp:1275319) 2014-02-15 18:54:51 -05:00
Marco Serantoni ea87d8247e [MacOSX] wxPython patch revised for http://trac.wxwidgets.org/ticket/15957 2014-02-15 19:09:14 +01:00
Marco Serantoni af54a74a24 [MacOSX] support for plugins in the bundle 2014-02-15 11:01:27 +01:00
Cirilo Bernardo 8123415163 Export VRML and IDF maintenance.
Fix minor bug in eeschema (opening a relative path does not work) (patch from HennerZeller).
2014-02-15 08:39:06 +01:00
Marco Serantoni 45f64652ef [MacOSX] Reorg and preparation to include scripts into Bundles 2014-02-14 22:09:48 +01:00
Henner Zeller 79807dd948 Eeschema: Better naming for private struct: public fields uppercase.
* make some more fields 'const' that can.
* Instead of previous/next _visible_ element, Go through
      previous and next element. Otherwise the cursor stops moving
      if the item is only partially visible.
2014-02-14 18:16:59 +01:00
Maciej Suminski 6d3e691dd9 Added a few asserts. Made some steps idiotproof. 2014-02-14 15:52:13 +01:00
Maciej Suminski 834dce571e New items are created using pointers (instead of copying automatic variables when drawing is finished). 2014-02-14 15:13:42 +01:00
Maciej Suminski 8aef3b30fa Refactorization: moved drawing 45 degree multiple line to a function. 2014-02-14 14:24:12 +01:00
Maciej Suminski 4c9e2acb02 GAL::GetGridPoint() returns point in world coordinates. 2014-02-14 14:16:08 +01:00
Maciej Suminski 1c7cc3229c Some more minor refactorization. 2014-02-14 11:35:48 +01:00
Maciej Suminski 881b24c6e4 Refactoring: zones and keepout areas are drawn using the same function. 2014-02-14 10:47:43 +01:00
Maciej Suminski b0aa561719 Refactoring: made VIEW, VIEW_CONTROLS, BOARD and PCB_EDIT_FRAME fields in DRAWING_TOOL. 2014-02-14 09:49:49 +01:00
Henner Zeller 4abc6ea0cb PATCH: making component choosing (much!) more usable 2014-02-14 09:07:20 +01:00
Henner Zeller 33c07934b6 PATCH: making component choosing (much!) more usable 2014-02-14 09:05:04 +01:00
Maciej Suminski 249de46078 Cursor is in world coordinates. 2014-02-13 20:23:28 +01:00
Maciej Suminski d19280aeb9 Small GAL refactorization, mostly correcting constness. 2014-02-13 19:31:27 +01:00
jean-pierre charras 9a56467e13 Fix a minor error in class D_PAD: void D_PAD::Flip( int Y ) changed to virtual void D_PAD::Flip( const wxPoint& aCentre ) (as defined in BOARD_ITEM)
Scripting: fix compatibility current pcbnew version in 2 examples and the default extension of board files  in board.i (was .kicad_brd, now is .kicad_pcb)
2014-02-13 18:27:48 +01:00
Maciej Suminski 1492f71d6c Added keepout areas drawing tool. 2014-02-13 16:24:33 +01:00
Maciej Suminski 88bc292a37 Added zone drawing tool. 2014-02-13 16:10:32 +01:00
Maciej Suminski ff12d3d2e5 Changed PCB_EDIT_FRAME::setTopLayer() to PCB_EDIT_FRAME::SetTopLayer() and changed to public (as it had exactly the same functionality). 2014-02-13 15:57:57 +01:00
Maciej Suminski 39de31f7b2 Placing modules with a minor bug. 2014-02-13 12:46:39 +01:00
Miguel Angel Ajo 750cf6a26e switching to the new python scripting console icon 2014-02-12 22:19:12 +01:00
Miguel Angel Ajo 7b754b723c Enforces python2.6 / 2.7, thanks to orsonmmz 2014-02-12 22:17:19 +01:00
Maciej Suminski 7cddc08e1f Merged fix from the selection_tool branch. 2014-02-12 18:04:27 +01:00
Maciej Suminski ddfdbb6ff0 NETINFO_ITEM for orphaned items now have empty netname and net code = 0 (to avoid problems).
Fixed case for the footprint legacy plugin when added module's do not have set parent (BOARD).
Added copyright notice for pcbnew/class_netinfolist.cpp (feel free to correct, it is just copied from corresponding header file).
2014-02-12 18:01:03 +01:00
Fabrizio Tappero 3f05c57f61 Some icons update 2014-02-12 14:56:52 +01:00
jean-pierre charras ddd39027e7 Fix issues in print mirror. (include some changes coming from Cirilo Berdarno's patch)
gr_basic.cpp: rewrite the function which draws the outlines of a thick segment.
2014-02-12 11:03:34 +01:00
Nick Østergaard 5a9d750f7d Fix wrong numbering in the QFP footprint wizard python script 2014-02-12 08:59:56 +01:00
Fabrizio Tappero b46b5352c4 Update icon_bitmap2component. 2014-02-12 08:53:55 +01:00
Marco Serantoni d6fcc48ed0 [MacOSX] Refines in building system, now bundles lib migration supports symbolic links 2014-02-12 00:13:14 +01:00
Henner Zeller a66758406e * Apply Henner Zeller's patch to add connecting line from reference and labels to component position whilst moving to help identify which component the reference or label belongs too 2014-02-11 21:54:30 +00:00
Fabrizio Tappero 6c8b0ea59c Icon update, and an other very minor fix. 2014-02-11 19:32:09 +01:00
Maciej Suminski 59a56fc820 Added PCB_TARGET placing tool. 2014-02-11 17:15:33 +01:00
Maciej Suminski 0eed6c360c Small fix for crippled polylines containing 0 points. 2014-02-11 15:01:49 +01:00
Maciej Suminski 46f3c2210d Fixed ratsnest related segfaults on BOARD destruction. 2014-02-11 14:39:14 +01:00
Maciej Suminski 962a0e16c5 Added DIMENSION drawing tool. 2014-02-11 14:38:44 +01:00
Maciej Suminski 8feab0ad66 Fixed ratsnest related segfaults on BOARD destruction. 2014-02-11 14:26:33 +01:00
Maciej Suminski 4eee9e18d5 Removed redundant fields DIMENSION::m_arrowD1O, m_arrowD2O, m_arrowG1O, m_arrowG2O (==m_crossBarO/F).
Added DIMENSION::SetOrigin(), DIMENSION::SetEnd(), DIMENSION::GetOrigin(), DIMENSION::GetEnd(), DIMENSION::GetHeight().
Fixed flipping for DIMENSION class.
Added an information that helps to understand roles of the points in the DIMENSION class.
Some minor changes to PCB_PAINTER (mainly using const COLOR4D& for taking the result of GetColor() function).
2014-02-11 13:22:30 +01:00
Lorenzo Marcantonio ae93328c21 - Do not autonumber NPTH pads on add in module editor (keep the number blank)
Factored out the next-pad-number function
2014-02-10 18:19:15 +01:00
Maciej Suminski 0dac3077bd Made rotate & flip tool actions generic.
Drawing tool reacts to rotate & flip events while placing a text.
2014-02-10 17:08:55 +01:00
Maciej Suminski 5491a468ba Basic text placing tool. 2014-02-10 15:40:25 +01:00
jean-pierre charras b704410dd2 Use environment KISYS3DMOD to know the default path for 3D shapes in footprint editors dialogs, and build short 3D file names.
This value is now shown in these dialogs.
2014-02-10 11:01:11 +01:00
Maciej Suminski aaf0c13838 Drawing arcs - version 1 2014-02-10 10:58:58 +01:00
jean-pierre charras c795d04614 fix linux compil. 2014-02-10 10:58:17 +01:00
jean-pierre charras b7d5bd5ab8 Use environment KISYS3DMOD to know defaut path for 3D shapes in footprint editors dialogs. 2014-02-10 10:30:08 +01:00
Miguel Angel Ajo b84ada1ab6 Fix py26 testing for OSX, assertIsNotNone unavailable for py26 2014-02-10 10:15:48 +01:00
jean-pierre charras 2451de0e1b Cosmetic enhancement: better icon for bitmap2component. 2014-02-09 21:06:05 +01:00
Miguel Angel Ajo 373a5b5bb7 BOARD saving test 2014-02-09 00:21:47 +01:00
Marco Serantoni a4fe76d2a7 [MacOSX] Setting Set3DShapesPath 2014-02-08 18:33:21 +01:00
Marco Serantoni 1cacfffd5f [MacOSX] Fixing build system, sorry guys, refining build system and make building smoother. 2014-02-08 16:15:06 +01:00
jean-pierre charras e88e8b1ed3 Add the environment variable KYSYS3DMOD to define a default path for 3D models.
If it is not defined by user, it is set to a legacy 3D files path.
The default value needs to be fixed on MACOSX.
This change could be better, but it is compatible with environment variables and the old way ( defined search paths) to find 3D shape files.
3D shapes files names can  also include an environment variable definition, like libraries names.
However using KYSYS3DMOD in these names is not required.
If the 3D filename is a legacy name, KYSYS3DMOD is automatically used as default path.
2014-02-08 12:54:24 +01:00
jean-pierre charras 0c615f78a1 Add the environment variable KYSYS3DMOD to define a default path for 3D models. 2014-02-08 11:44:55 +01:00
jean-pierre charras 42aeed5421 main CMakeLists: build lib-wxpython only if KICAD_SCRIPTING_WXPYTHON is ON 2014-02-08 08:42:41 +01:00
Miguel Angel Ajo 669912ea9b More BOARD unit tests 2014-02-08 01:02:29 +01:00
Marco Serantoni 6f6a79407b [MacOSX] Fixing qa, thanks Miguel Angel for the feedback 2014-02-08 00:40:11 +01:00
Marco Serantoni b93146ab87 [MacOSX] Adding patches for wxPython && http://trac.wxwidgets.org/ticket/15957 2014-02-07 23:00:19 +01:00
Maciej Suminski 9583c522dd Moved PCB_VISIBLE size check to .cpp. 2014-02-07 20:54:58 +01:00
Maciej Suminski 90c0e2e8f4 Right click on an item when there is nothing selected - enables the context menu. 2014-02-07 20:44:34 +01:00
jean-pierre charras aff1bdc853 Remove duplicate icon apply.svg (use ckecked_ok.svg instead which is the same icon).
Add a workaround to fix a new bug in wxWidgets 3.0 ( Windows specific ) which shows icons only with a size = 16x16 in menus which have attribute wxITEM_CHECK
2014-02-07 20:32:08 +01:00
Marco Serantoni c0b0918c45 [MacOSX] Fixing minor issue for wxPython 2014-02-07 20:19:53 +01:00
Maciej Suminski 68a1b06674 Corrected bounding box for arcs (DRAWSEGMENT). 2014-02-07 19:55:40 +01:00
Marco Serantoni 09636c1a88 [MacOSX] Automating building for OSX with KICAD_SCRIPTING, see Documentation/compiling/mac-osx.txt 2014-02-07 19:53:54 +01:00
Maciej Suminski 52e5d11d0a Corrected bounding box for arcs (DRAWSEGMENT). 2014-02-07 19:51:04 +01:00
Henner Zeller 110507449c * Bring CvPcb footprint window to the front when it has been obscured by another window 2014-02-07 18:38:41 +00:00
Brian Sidebotham da0e9c5299 * Add Henner's patch (with minimal changes) to ensure CVpcb footprint view window is always brought into view, even after being hidden by another window 2014-02-07 18:36:12 +00:00
Brian Sidebotham 109e628903 * Fix Project templates location under Linux, preserve Windows location 2014-02-07 18:19:53 +00:00
Brian Sidebotham d973165737 * Fix linux location for system project templates 2014-02-07 18:17:58 +00:00
jean-pierre charras 8ddba7a836 Minor fixes. 2014-02-07 17:09:15 +01:00
Cirilo Bbernardo 56c237410b IDF export: fix incorrect rotation of flipped items. 2014-02-07 17:01:46 +01:00
Maciej Suminski 5959e7c2ef Upstream merged. 2014-02-07 09:52:47 +01:00
Maciej Suminski 9f18e6f152 Reverted changes introduced by the revision 4655. 2014-02-06 21:34:03 +01:00
Maciej Suminski 171d3e1c88 Merged fix for wrong snapping. 2014-02-06 17:31:24 +01:00
Maciej Suminski 9f5d968476 Fixed snapping item in a wrong spot bug. 2014-02-06 17:29:13 +01:00
Maciej Suminski 93483241ed Actually added files for drawing tools. Added possibility of drawing circles. 2014-02-06 17:12:37 +01:00
jean-pierre charras 34724c8d99 add missing svg file 2014-02-06 16:54:55 +01:00
Fabrizio Tappero 00ee7cd462 Fix issues in icons with texts, from Fabrizio Tappero. 2014-02-06 16:49:37 +01:00
jean-pierre charras 11fcf7ab6e Fix some incorrect icons (which were using a not supported font for texts). Add ps_router icon from Konstantin Baranovskiy. 2014-02-06 15:13:31 +01:00
Maciej Suminski 3a25e108f5 Initial version of the drawing tool. 2014-02-06 15:09:38 +01:00
Maciej Suminski 5299e41ac4 Added TOOL_INTERACTIVE::Activate().
Removed an unnecessary header from class_board_item.h.
2014-02-06 14:45:33 +01:00
Maciej Suminski 37dc675b7a Merged the lp:~cern-kicad/kicad/selection_tool branch. 2014-02-06 12:48:18 +01:00
Maciej Suminski 8718c57d41 Fixed included headers. 2014-02-06 12:38:47 +01:00
Maciej Suminski 6732726f13 GAL::GetGridPoint() takes a const reference. 2014-02-06 12:38:06 +01:00
Maciej Suminski 9e4e5ddd03 Modifiers (Shift/Ctrl/Alt) are set also while moving the mouse cursor. 2014-02-06 10:43:19 +01:00
Fabrizio Tappero 96db0f38f7 New other icons from Fabrizio Tappero, and some svg file fixes 2014-02-06 09:29:45 +01:00
Fabrizio Tappero 793b144e3b New other icons from Fabrizio Tappero, and some svg file fixes. 2014-02-06 09:28:29 +01:00
Fabrizio Tappero 9427ce29d1 New icons from Fabrizio Tappero 2014-02-05 15:36:57 +01:00
Maciej Suminski 6d6181cdfa Minor optimizations. 2014-02-05 14:51:19 +01:00
Maciej Suminski b3c5980e61 Merged ratsnest_threadsafe branch. 2014-02-05 11:55:04 +01:00
Maciej Suminski c8c98753b5 Initialized value to suppress Valgrind warnings. 2014-02-05 11:33:45 +01:00
Maciej Suminski de0c476042 Fixed removal of items in the KiCad-default style. 2014-02-05 11:08:34 +01:00
Maciej Suminski cff1ea84ee Fixed bug introduced in the last commit. 2014-02-05 10:47:55 +01:00
Maciej Suminski aff5e66ab8 Some items were still marked as selected after undoing an operation. 2014-02-05 10:30:50 +01:00
Cirilo Bernardo 4010a5709c Apply IDF tools patch from Cirilo Bernardo 2014-02-05 10:29:01 +01:00
Cirilo Bernardo 82bfe0dbdf Apply IDF tools patch from Cirilo Bernardo 2014-02-05 10:27:21 +01:00
Maciej Suminski 7e8b1906b2 Grip margin is relative to the world's zoom. 2014-02-05 10:17:14 +01:00
Maciej Suminski cf9e5417d0 Added possibility for editing pads properties. 2014-02-05 09:05:27 +01:00
Miguel Angel Ajo 3d849fd87c Adding a first BOARD class tester, very basic 2014-02-04 22:16:32 +01:00
Maciej Suminski 244be39ffa Added KiCad-style modification methods (hover over an item and press a hot key, without selecting first).
Modification point is selected basing on the number of selected items.
Rotation angle setting (Preferences->General) is taken into account while rotating.
2014-02-04 17:27:00 +01:00
Maciej Suminski 9ee9c93ef8 Added 2 tool actions:
- pcbnew.InteractiveSelection.Single for selecting a single item
- pcbnew.InteractiveSelection.Clear for clearing the selection
Made SELECTION_TOOL::clearSelection private.
2014-02-04 16:03:56 +01:00
Maciej Suminski 980e325ba1 Edit tool may still be activated if it was invoked with no selected items. 2014-02-04 14:21:29 +01:00
Maciej Suminski e954736b5d Protection against non consecutive net codes. 2014-02-04 13:40:39 +01:00
Maciej Suminski 6e666b5d62 Modifiers (Alt/Shift/Control) are properly set for events when autopanning is active. 2014-02-04 13:38:18 +01:00
Maciej Suminski 0833cd4b61 SELECTION_TOOL::SELECTION::Clear made private, as there was no chance to call it outside the SELECTION_TOOL class. 2014-02-04 11:37:54 +01:00
Maciej Suminski 221b68d0b8 Snapping settings are valid while autopanning. 2014-02-04 09:44:16 +01:00
Dick Hollenbeck 3a0f1c4126 Windows name export tweak 2014-02-03 23:05:07 -06:00
Dick Hollenbeck a792a0e7ea remove wxApp()::FindLibraryPath() usages from Pcbnew. Use environment variable substitution. 2014-02-03 15:39:42 -06:00
Dick Hollenbeck cad85c8a7a KIWAY in progress... 2014-02-03 13:26:18 -06:00
Maciej Suminski 51bf04932b Enabled PNS for selected items. 2014-02-03 18:09:17 +01:00
Maciej Suminski 8cfc8b0157 Ratsnest lines for zones are removed when a zone is dragged. 2014-02-03 17:40:39 +01:00
Dick Hollenbeck c40d25df29 Initial KIWAY (modular-kicad) work. Various tweeks. 2014-02-03 09:21:04 -06:00
Dick Hollenbeck 5d4eab87f8 Initial KIWAY (modular-kicad) work. Various tweeks. 2014-02-03 09:10:37 -06:00
Maciej Suminski 7dc9eefc83 Minor changes (fix cvpcb build issue, wx2.8 compatibility, some other stuff). 2014-02-03 16:02:54 +01:00
Maciej Suminski d3ee4b1eda Takes into account hidden module text settings. 2014-02-03 07:22:31 -06:00
Maciej Suminski 82838e6770 Moved netnames (GAL specific layers) to a separate enum, to avoid saving/reading their settings from files.
Added a check for the number of PCB_VISIBLE elements.
Worksheet & general purpose overlay layers are visible by default.
2014-02-03 14:14:53 +01:00
Maciej Suminski f35e6412bd Minor changes. 2014-02-03 13:26:25 +01:00
Maciej Suminski 90e8aba660 Changed ROUTER_PREVIEW_ITEM layer. 2014-02-03 13:09:10 +01:00
Maciej Suminski eb053cac2b Changed BOARD_DESIGN_SETTINGS::m_VisibleElements from int to long, to assure at least 32 bits length (without depending on the platfrom int size). 2014-02-03 13:08:01 +01:00
Maciej Suminski 5a6f259f2c Fixed tracks of 0 width causing division by 0 error. 2014-02-03 13:05:27 +01:00
Miguel Angel Ajo b331a3b3fd Moved QA to root. 2014-02-02 22:50:45 +01:00
Dick Hollenbeck 0ec0b63ad2 Another attempt at wxFrame::SaveSettings() standard infrastructure. 2014-02-02 14:18:10 -06:00
jean-pierre charras 659c2184b3 Eeschema: Fix bug #1271155 relative to Grid selection in Eeschema. 2014-02-02 20:51:50 +01:00
Cirilo Bernardo 6bbd4defaf Dxf import fix (patch from Cirilo Bernardo, with a minor change) 2014-02-02 10:07:02 +01:00
jean-pierre charras ea4867d5b1 Kicad manager: code cleaning (better use of wxaui manager). Fix a very minor bug. 2014-02-02 10:02:29 +01:00
jean-pierre charras 8d14b4798e Kicad manager: code cleaning. Fix a very minor bug. 2014-02-01 19:27:18 +01:00
Carl Poirier 911ee57de6 Parallelized the RN_DATA::Recalculate() function. 2014-01-31 18:27:06 +01:00
Maciej Suminski 2536bae624 Added the dynamic ratsnest for the tracks that are currently routed with the PNS router. 2014-01-31 18:05:11 +01:00
Maciej Suminski 27ecb2c930 Undo/redo buffer fixed once again.. 2014-01-31 16:08:20 +01:00
Maciej Suminski 9ba5058e66 Minor change to clearing selection handling. 2014-01-31 14:52:01 +01:00
Maciej Suminski 7faf9fb9a4 Safer RN_NET::GetNodes() 2014-01-31 14:41:15 +01:00
Maciej Suminski 63196b5a8a Added missing operators==/!= for RN_NODE_PTR.
Moved ClearSimple() functions back to the header file.
2014-01-31 13:19:59 +01:00
Maciej Suminski 8d37c9122f Ratsnest is updated after backend switch. 2014-01-31 13:14:18 +01:00
Maciej Suminski 7caeff6af9 Ratsnest color is saved in RENDER_SETTINGS. Temporary ratsnest is drawn using a brightened color. 2014-01-31 11:16:01 +01:00
Maciej Suminski ecf6698d4f Fixed undo/redo while routing with the PNS error. 2014-01-30 17:11:40 +01:00
Maciej Suminski 48c10f9e5b Another way of handling items for the ratsnest (clearer and now finally supports undo/redo of the PNS created tracks). 2014-01-30 15:46:39 +01:00
Maciej Suminski 89463b0d2d Undo buffer for the PNS router. Still, it has a bug - it crashes when an undo/redo operation is performed while routing a track. 2014-01-30 11:32:08 +01:00
Maciej Suminski d2e865146b Added a new tool event: TA_UNDO_REDO, sent after undo/redo operation is issued. 2014-01-30 11:18:58 +01:00
jean-pierre charras 1283747b59 3d-frame: is now derived from EDA_BASE_FRAME. Remove duplicate code and some useless includes 2014-01-30 09:18:47 +01:00
jean-pierre charras a2df815ba6 Add specific bitmaps in export IDF and export DSN menus.
Add missing calls to Show( false ) to some main frames (Kicad, eeschema, gerbview), to force config saving when closing these windows.
Code cleanup and minor coding style fixes in footprint_wizard_frame.
2014-01-29 19:39:16 +01:00
Dick Hollenbeck cd7d6d470b Make option KICAD_KEEPCASE actually functional for Eeschema, and make the setting default ON.
The desire is to migrate designs *away from* case independence, and to create
designs which use literally (case specific) interpreted component names. But for
backwards compatibility, you may turn OFF this option if you really must.
(Remember that with KiCad using text data files, typically you would be better
off simply doctoring those files into a case literal state with a text editor
and move forward into the brave new world of case specificity. Also, BOM
generators may not work properly when you have this option turned OFF, the xml
export's referential integrity is broken on library part name. Hence the default
is ON now, as of 29-Jan-2014.
2014-01-29 12:02:02 -06:00
jean-pierre charras e8ef3c14d4 Add specific bitmaps in export IDF and export DSN menus.
Add missing calls to Show( false ) to some main frames (Kicad, eeschema, gerbview), to force config saving when closing these windows.
Code cleanup and minor coding style fixes  in footprint_wizard_frame
2014-01-29 18:01:42 +01:00
unknown 3a8ca47fce Pcbnew: export IDF fixes 2014-01-29 17:42:21 +01:00
Maciej Suminski 4566d8717a PNS_ITEM::m_parent: BOARD_ITEM->BOARD_CONNECTED_ITEM 2014-01-29 15:35:25 +01:00
Maciej Suminski c2a12d903f RN_DATA::GetNets() -> RN_DATA::GetNet() with an assert to check if someone calls it for the unconnected net.
Only items that belong to a net are removed from ratsnest.
2014-01-29 15:24:19 +01:00
Maciej Suminski 2171fd0b18 Ratsnest lines are drawn using a more transparent color.
BOARD::chainMarkedSegments() uses a safer method for gettings pads.
2014-01-29 14:51:50 +01:00
Maciej Suminski a051887971 Ratsnest is updated after rotation, flip, undo/redo operations.
Fixed crashes of ratsnest when a pointer for an item has changed after undo/redo operations.
Vias are properly removed from ratsnest (pcbnew/class_board.cpp).
2014-01-29 10:17:14 +01:00
Maciej Suminski 6e28e5bdf0 Added RN_DATA::Add()/Remove() methods.
RN_DATA::Update()/AddSimple() take BOARD_ITEM* as the parameter (instead of being split to versions with BOARD_CONNECTED_ITEM* and MODULE*), to make the code look clearer.
2014-01-28 16:30:58 +01:00
Maciej Suminski cd0d91a611 Added BOARD_[CONNECTED_]ITEM::IsConnected() for checking if a BOARD_ITEM is BOARD_CONNECTED_ITEM as well. 2014-01-28 16:23:08 +01:00
Dick Hollenbeck 176607db25 Add option --remove-orphaned-libraries to scripts/library-repos-install.sh 2014-01-28 08:23:01 -06:00
Maciej Suminski ea943ce605 Merged the netnames branch. 2014-01-28 11:59:04 +01:00
Maciej Suminski b114526b12 Upstream merge. 2014-01-28 10:43:55 +01:00
Maciej Suminski 58f813b6e8 Added NETINFO_MAPPING, to ease saving nets with consecutive net codes (without modifying the net codes during the run time).
Now, nets are saved with consecutive net codes (both modern & legacy plugins).
Zones are saved together with their nets, without depending on the fact if there are any pads with such net. Therefore validation of zone net names was removed (pcbnew/class_board.cpp).

Performed tests:
- Changed a pad's net name from empty to existent - ok, name was changed.
- Changed a pad's net name from empty to nonexistent - ok, error message is displayed, net name stays empty.
- Changed a pad's net name from existent to empty - ok, net name became empty
- Changed a pad's net name from existent to nonexistent - ok, error message is displayed, net name is not changed.

- Drawn a zone that belongs to a net, then modified schematics so the net does not exist anymore. After reloading the net list, all pads/tracks are updated. Zones still belongs to the net that does not exist in the schematic (but still exists in .kicad_pcb file). After running DRC, the zone becomes not filled.
- Undo & redo affects assignment of a polygon to a specific net (you may change net of a polygon, refill it and undo/redo the changes).

- KiCad s-expr & legacy, Eagle, P-CAD boards seem to load without any problem (they also contain correct net names assigned to the appropriate pads). All types of board file formats were loaded, then saved in sexpr format and reopened with a KiCad built from the master branch (without my modifications).
- A few boards were also saved using the legacy format and were opened with the master KiCad without any issues.

- Change a net name for a pad, restore with undo/redo - ok
- Remove everything, restore with undo - ok
- Remove everything, reload netlist - ok

Differences observed between files saved by the master branch KiCad and this one:
- list of nets are not saved in any particular order, so net codes may differ
- the default net class does not contain the unconnected net
2014-01-28 10:19:51 +01:00
Dick Hollenbeck c389c2f6e4 Add EDA_BASE_FRAME::Show() and call SaveSettings() only from there for all derived wxFrames. Remove calls to SaveSettings() elsewhere. 2014-01-27 19:29:26 -06:00
Marco Serantoni 144de5dd78 [MacOSX] KICAD_BUILD_DYNAMIC stabilized and almost working 2014-01-27 23:24:04 +01:00
jean-pierre charras 139ca8f6ef Bitmap2component: fix Bug #1273082 (patch from Wesley Dungan) 2014-01-27 18:22:49 +01:00
Dick Hollenbeck 741602c9cc Report findings of possible github zipfile caching in a comment, improve a Sprintf() setup. 2014-01-27 09:51:14 -06:00
Maciej Suminski 04ff538d11 Thread-safe version of Delaunay triangulation. 2014-01-27 11:42:47 +01:00
jean-pierre charras 825561d6f4 github_plugin.cpp: in error message relative to"cannot get zip archive...", line 496, make the sentence relative to http GET command not translatable
inside the full translated message.
2014-01-27 09:48:17 +01:00
Dick Hollenbeck d932043905 Remove g_LibraryNames and all supporting infrastructure from pcbnew. FP_LIB_TABLE is now local to major wxFrames. 2014-01-27 01:23:02 -06:00
Dick Hollenbeck 68d613ef0d Use factored SelectLibrary() from base class. Spelling and comments. 2014-01-27 00:41:40 -06:00
Maciej Suminski 6ffcddcb87 GAL takes into account hidden module text settings. 2014-01-26 22:02:48 +01:00
Maciej Suminski e9ece451af Fixes crash when there are no edges for a given net in the ratsnest. 2014-01-26 22:01:42 +01:00
jean-pierre charras 5d8db7fa96 Pcbnew: fix Bug #1272926 (Texts are now not accepted on edge cuts layer) 2014-01-26 18:30:20 +01:00
jean-pierre charras 608de9970b Pcbnew: fix bug #1272714 . Code cleanup: use 2 different enums for pad shapes and pad drill shapes. Remove never used pad shape. 2014-01-26 15:20:58 +01:00
Marco Serantoni 97de56756f [MacOSX] adding multiprocess building and initial support for KICAD_BUILD_DYNAMIC 2014-01-26 14:09:36 +01:00
Cirilo Bernardo 854f882090 add patch from Cirilo Bernardo (about IDF export) , and minor fixes. 2014-01-25 15:36:56 +01:00
jean-pierre charras 1119c1e68f add patch from Cirilo Bernardo, and minor fixes. 2014-01-25 13:23:29 +01:00
Marco Serantoni c5bc58ee46 [MacOSX] Adding wx-widgets building with patches for OSX preparing for dynamic.. 2014-01-24 22:09:31 +01:00
Marco Serantoni 0cd99fc3b3 [MacOSX] Fixing in the case -arch are not set with cairo 2014-01-22 19:01:36 +01:00
Dick Hollenbeck dadec3bd25 Increase boost download TIMEOUT to 10 minutes, offer a LOG_DOWNLOAD option for capturing download problems. 2014-01-22 07:44:02 -06:00
Dick Hollenbeck 6ac1bae539 fix 2014-01-21 09:25:43 -06:00
Dick Hollenbeck 068076a2c2 tugs and bugs 2014-01-21 00:59:32 -06:00
Dick Hollenbeck 51fe856360 freerouter does not understand "mixed" layers, export mixed as signal 2014-01-20 13:11:42 -06:00
Dick Hollenbeck c719b4f3c3 use changed URL to library repo. 2014-01-20 13:10:45 -06:00
Dick Hollenbeck f7f45dc4c8 Add EDA_APP::setLanguageId() accessor and fix FindwxWidgets.cmake for windows cross on linux. 2014-01-20 03:33:17 -06:00
jean-pierre charras dfbafdc3fb Code cleanup and minor fix in viewlib. 2014-01-19 17:36:12 +01:00
jean-pierre charras 2d62eab4b4 Fix some issues in modview, relative to few incorrect use of some wxAuiManager functions.
Fix not working + and - keys in layers manager.
Fix typo errors and modify some messages to make translator's life more easy.
2014-01-19 14:12:57 +01:00
unknown 4478c09544 Fix compile errors when wx3.x is built with --enable-stl 2014-01-18 03:07:05 -06:00
Dick Hollenbeck 438cdafd60 disable deprecation warnings in Debug build, change message in fp_lib_table.cpp 2014-01-18 03:04:12 -06:00
Wayne Stambaugh 53b6c1f39a CvPcb: fix no footprints shown in list when no legacy libraries are defined in project file. 2014-01-17 15:26:27 -05:00
Maciej Suminski d8ee9b8bca Added iterators for NETINFO_LIST (as net codes for existing net codes may be not consecutive). 2014-01-16 16:47:31 +01:00
Maciej Suminski 17027286bd wxWidgets 2.8 fix 2014-01-16 14:36:09 +01:00
Maciej Suminski babd441b7e NETINFO_ITEMs are not stored in a vector anymore, instead they are held in a unordered_map. Now, the net codes may be not consecutive. There is another way for assigning net codes (using a static int that holds a possible empty net code and a function that makes sure it is not used [getFreeNetCode()]).
Removed some unused fields (NETINFO_ITEM::m_NbNodes, m_NbLink, m_NbNoconn, m_Flag).
2014-01-16 14:20:51 +01:00
Maciej Suminski 41e4379924 BOARD_CONNECTED_ITEMs do not store net code anymore (m_NetCode field), instead net info is stored using a pointer to NETINFO_ITEM.
GetNet() refers to the net code stored in the NETINFO_ITEM. SetNet() finds an appropriate NETINFO_ITEM and uses it.
Removing GetNet() & SetNet() (and the whole net code idea) requires too many changes in the code (~250 references to the mentioned functions).
BOARD_CONNECTED_ITEMs by default get a pointer to NETINFO_ITEM that stores unconnected items. This requires for all BOARD_CONNECTED_ITEMs to have a parent (so BOARD* is accessible). The only orphaned item is BOARD_DESIGN_SETTINGS::m_Pad_Master, but it does not cause any issues so far.
Items that do not have access to a BOARD (do not have set parents) and therefore cannot get net assigned, by default get const static NETINFO_LIST::ORPHANED.

Performed tests:
- loaded .kicad_pcb, KiCad legacy board, Eagle 6.0 board, P-CAD board - all ok
- load a simple project, reload netlist after changing connections in eeschema - ok
- save & reload a board - ok, but still contain empty nets
- remove everything, restore with undo - ok
- remove everything, reload netlist - ok
- changing net names (all possibilites: empty->existing, empty->not existing, existing->empty, existing->not existing) - all ok
- zones: when net is changed to a net that does not have any nodes besides the zone itself, it does not get filled
2014-01-15 18:03:06 +01:00
Maciej Suminski d191e5038c Added NETINFO_LIST::UNCONNECTED constant. 2014-01-15 09:34:16 +01:00
Maciej Suminski 8571e3608c Removed:
- ZONE_CONTAINER::m_Netname field
- ZONE_CONTAINER::SetNetName()
- ZONE_CONTAINER::SetNet() [it uses the one in BOARD_CONNECTED_ITEM]
- ZONE_CONTAINER::GetNetName() [instead BOARD_CONNECTED_ITEM::GetNetname is used]
- ZONE_CONTAINER::SetNetNameFromNetCode()

Performed tests:
- Drawn a zone that belongs to a net, then modified schematics so the net does not exist anymore. After reloading the net list, all pads/tracks are updated. Zones still belongs to the net that does not exist in the schematic (but still exists in .kicad_pcb file). After running DRC, the zone becomes not filled.
- Undo & redo affects assignment of a polygon to a specific net (you may change net of a polygon, refill it and undo/redo the changes).
2014-01-14 11:41:06 +01:00
Maciej Suminski 08367867b9 Removed D_PAD::SetNetname() function and D_PAD::m_Netname, D_PAD::m_ShortNetname fields.
D_PAD::GetNetname() and D_PAD::GetShortNetname() were moved to BOARD_CONNECTED_ITEM. Now they use the net name stored in NETINFO_ITEM.
Moved some one-line functions from class_board_connected_item.cpp to class_board_connected_item.h.
Added a copyright notice, moved Doxygen comments from class_board_connected_item.cpp to class_board_connected_item.h.

I have some doubts if changes introduced pcbnew/dialogs/dialog_pad_properties.cpp do not break anything, but I could not find a test case that breaks the pcbnew.

Performed tests:
- changed pad's net name from empty to existent - ok, name was changed
- changed pad's net name from empty to nonexistent - ok, error message is displayed, net name stays empty
- changed pad's net name from existent to empty - ok, net name became empty
- changed pad's net name from existent to nonexistent - ok, error message is displayed, net name is not changed
- (re)reading netlists, including net changes - fine, changes are applied, but empty nets are still kept
- loaded pcbnew/pcad2kicadpcb_plugin/examples/CK1202_V1.pcb to test P-CAD import plugin - ok, net names are correct
- imported an Eagle 6.0 board (Arduino Uno; http://arduino.cc/en/uploads/Main/arduino_Uno_Rev3-02-TH.zip) then saved in .kicad_pcb format and reloaded - ok, net names are correct
- saved demos/video/video.kicad_pcb in legacy format and then loaded it again - ok, net names are correct
2014-01-14 10:41:52 +01:00
jean-pierre charras 0c540ebea6 Fix some issues in modview, relative to some a bad use of some wxAuiManager functions. 2014-01-13 16:09:52 +01:00
jean-pierre charras 269e88b18d Update demo files. A minor code cleaning. 2014-01-10 21:12:36 +01:00
Maciej Suminski c39b56891e Changed the way of looking up NETINFO_ITEM using net names (using boost::unordered_map). Added a hash function (wxString) for that. Introduced NETINFO_ITEM::GetNetItem( wxString ). BOARD::FindNet() uses the map.
Net codes are updated upon net list update. (BOARD::ReplaceNetlist())
Added in some places (mostly class_board.cpp) pad->SetNet() calls to synchronize net codes.
On creation of NETINFO_LIST, the first NETINFO_ITEM is added (the unconnected items net).
Removed COMPONENT_NET::m_netNumber, as it was not used anywhere.
Added an assert to D_PAD::GetNetname(), checking if net code and net name is consistent for unconnected pads. Added an assert for NETINFO_LIST::AppendNet() to assure that appended nets are unique.

It seems that at this point:
- Updating net lists works fine. The only difference between the file ouput is that after changes it contains empty nets as well.
- Nets are not saved in the lexical order. Still, net names and net codes are properly assigned to all items in the .kicad_pcb file. It is going to be addressed in the next commit. I believe it should not create any problems, as pads are sorted by their net names anyway (NETINFO_LIST::buildPadsFullList())

Performed tests:
- Created a blank PCB, saved as pic_programmer.kicad_pcb (from demos folder). Updated net lists. .kicad_pcb file (comparing to the results from master branch) differ with net order (as mentioned before), net codes and timestamps.
- Removed some of components from the above .kicad_pcb file and updated net lists. Modules reappeared. .kicad_pcb file differs in the same way as described above.
- Trying to change a pad net name (via properties dialog) results in assert being fired. It is done on purpose (as there is a call to GetNetname() and net name and net code do not match). This will not happen after the next commit.
- Prepared a simple project (starting with schematics). Imported net list, changed schematic, reimported net list - changes are applied.
- Eagle & KiCad legacy boards seem to load without any problem.
2014-01-10 18:04:07 +01:00
Maciej Suminski 3c79ed375c Made two functions immune to empty containers. 2014-01-10 17:19:33 +01:00
Brian Sidebotham 9a86def109 * Fix FindwxWidgets.cmake for V3.0 wxWidgets using 'win32' style find. i.e. for MinGW native build without msys or cygwin 2014-01-09 23:13:22 +00:00
Dick Hollenbeck faa6582adc file maintenance, update some scripts 2014-01-09 09:01:59 -06:00
Maciej Suminski f075166a21 Removed NETINFO_ITEM::SetNet() and NETINFO_ITEM::SetNetname() methods.
NETINFO_ITEM::m_Net and NETINFO_ITEM::m_Netname are const.

Changes to be verified:
- pcbnew/minimun_spanning_tree.cpp: It segfaults is m_Size == 0
- pcbnew/exporters/export_gencad.cpp: I removed the SetNetname() call, as it changes only the unconnected net and in the next line it returns if the net is unconnected. Still, I wonder if name for the unconnected net matters. What about tests that check if a net name is empty to decide if it is unconnected net or not.
2014-01-09 15:51:47 +01:00
jean-pierre charras 77bba5e9f9 Code cleanup: Pcbnew: move files relative to export functions to the new folder exporters
Pcbnew, Eeschema: remove include file <protos.h> from a lot of files which do not need it.
2014-01-08 20:29:46 +01:00
Dick Hollenbeck bbfd2fb66c Add KICAD_REPO_NAME to the about dialog and build_version.cpp 2014-01-08 08:47:39 -06:00
jean-pierre charras ec37f295c7 Code cleanup: Pcbnew: move files relative to exort functions to the new folder exporters
all: remove include <protos.h>  from a lot of  files which do not need it.
2014-01-08 15:18:51 +01:00
Maciej Sumiński af44f2c720 merge Orson's patch with changes 2014-01-07 20:02:03 -06:00
Dick Hollenbeck 913a9dcdc3 Fix option description, add mark_as_advanced(), and add a comment to KICAD_SKIP_BOOST 2014-01-07 20:00:47 -06:00
Maciej Sumiński 62b264f770 Remove assembly language files, and make building Boost optional.
https://lists.launchpad.net/kicad-developers/msg11965.html
2014-01-07 19:52:19 -06:00
Dick Hollenbeck edc2938fb8 Make KiCad compile with minimal warnings against SVN HEAD of wxWidgets as of today. 2014-01-07 19:34:04 -06:00
jean-pierre charras 2498414e91 Move files relative to export code to subdir exporters. 2014-01-07 21:41:32 +01:00
jean-pierre charras 3c5929258b Update demos. Fix pspice netlist issues when using ( and ) in net names ( parenthesis are replaced by underscore) . 2014-01-07 20:42:34 +01:00
Cirilo Bernardo 810a01b779 Commit patch about new better vrml export. patch to fix mirrored page layout when print mirrored is enabled ( page layout should not be mirrored) 2014-01-07 20:27:51 +01:00
Maciej Suminski a49015a317 Fixed snapping and ratsnest update for EDIT_TOOL. 2014-01-07 17:23:17 +01:00
Maciej Suminski 92816e4689 Delaunau triangulation algorithm was bailing out if run on an emprty container. 2014-01-07 15:52:10 +01:00
Maciej Suminski 56cd826400 Safer way for syncing pads in Push and Shover router. 2014-01-07 14:23:46 +01:00
Maciej Suminski aee4f33c09 Fixed Push and Shove and ratsnest cooperation (tracks added by PNS are taken into account while calculating ratsnest). 2014-01-07 14:22:37 +01:00
Maciej Suminski 3177f74540 Fixed snapping for Push and Shove router. 2014-01-07 14:21:37 +01:00
Maciej Suminski e8b7c6df54 Tools have possibility to react to GAL switching or model (board) reload. 2014-01-07 14:16:47 +01:00
Maciej Suminski a22364f545 Items removed from board are removed from ratsnest as well. Corrected the way of items removal from ratsnest. 2014-01-07 14:15:40 +01:00
Maciej Suminski 8626e906cb Removed TOOL_STATE.idle field, as it was redundant. 2014-01-07 14:11:53 +01:00
Maciej Suminski 980dec08cf Fixed bounding box for module texts. 2014-01-07 14:09:27 +01:00
Marco Serantoni ad2957d534 [MacOSX] Fixing STL && single processor building in pixman 2014-01-07 00:20:52 +01:00
jean-pierre charras 6742f54243 Better vrml export, from Cirilo Bernardo. 2014-01-06 21:14:24 +01:00
Maciej Suminski e2e68aea74 Upstream merge. 2014-01-06 10:29:31 +01:00
Marco Serantoni 5437f43790 [MacOSX] fixes some corner case compiling on x86 in boost 2014-01-04 14:40:22 +01:00
Marco Serantoni fc14556d43 [MacOSX] Added support in boost context for PPC processors, now is possible again compile kicad testing for PPC ( https://svn.boost.org/trac/boost/ticket/8266 ) 2014-01-04 03:13:18 +01:00
Dick Hollenbeck 4bd4c43d1a This is why we cannot have nice things. This is why we test our changes before committing.
Pray for angus johnson who is support too many languages, and needs to find a text editor that removes trailing whitespace.
2014-01-03 18:46:06 -06:00
Dick Hollenbeck f27e85eeb0 fix some compiler warnings 2014-01-03 18:07:20 -06:00
Dick Hollenbeck 16a70dd267 comment out broken tool_modview.cpp's useless footprint select button. somebody needs to fix this. 2014-01-03 17:19:54 -06:00
Dick Hollenbeck a53caab12b force switch to boost::context, add --force option to bzr clean-tree 2014-01-03 17:17:50 -06:00
Dick Hollenbeck 2cead53fc9 fix compiler warnings 2014-01-03 17:16:40 -06:00
jean-pierre charras 77defa69c6 Pcbnew: very minor fixes and update: update clipper version. uncrustify polytri/* and fix some warning compil. 2014-01-03 18:39:28 +01:00
Cirilo Bernardo 8c540c8b83 IDF3 wxDateTime patch to fix MinGW builds for missing localtime_r(). 2014-01-03 08:31:50 -05:00
Cirilo Bernado 0a415fad36 Adds basic IDF3 export (board and cutouts / holes only) 2014-01-02 10:28:10 +01:00
Cirilo Bernardo 95bb3d6bb1 Adds basic IDF3 export (board and cutouts / holes only) 2014-01-02 10:26:03 +01:00
Dick Hollenbeck 3142172cff 8 bit string relief via class UTF8 2014-01-01 20:17:07 -06:00
Dick Hollenbeck 074a265166 FIX: only invoke fp-lib-table options editor when table not empty. 2013-12-31 10:59:33 -06:00
Dick Hollenbeck ce3943446c Add bzr clean-tree to download_boost.cmake 2013-12-31 10:58:05 -06:00
Marco Serantoni 6c0c2b4365 [MacOSX] Reorganize OSX Library PATH, first the USER's one then the SYSTEM's one 2013-12-31 15:28:34 +01:00
Marco Serantoni 2fc8a05aec [MacOSX] Adding better support for Retina Display (NSHighResolutionCapable) 2013-12-31 12:03:02 +01:00
Marco Serantoni 3eab6c5af2 [MacOSX] Manage older OpenSSL API (needed for OSX 10.6) and probably older linuxes 2013-12-31 11:48:16 +01:00
Marco Serantoni d1bd519e7c [MacOSX] Manage older OpenSSL API (needed for OSX 10.6) and probably older linuxes 2013-12-31 11:45:17 +01:00
Marco Serantoni 0b62184c51 [MacOSX] Removing freetype dependecy for Cairo (uses cocoa font management) 2013-12-31 11:44:16 +01:00
Marco Serantoni 7ae4bc208a [MacOSX] disable -fvisibility due compiler blames.. 2013-12-31 11:42:25 +01:00
Dick Hollenbeck c28fbe566d minor tidying 2013-12-31 00:25:53 -06:00
Dick Hollenbeck 5ae8d9b220 Add -fvisibility options to significantly reduce binary sizes.
Switch to boost::context for all platforms, almost.
Please try your platform by commenting out fcontext.s in common/CMakeLists.txt.
2013-12-30 11:53:12 -06:00
Marco Serantoni 4d3ac11467 [MacOSX] fixes issues with previous OSX compilers gcc-4.2 and makes a better general beaviour of KICAD_BUILD_STATIC 2013-12-30 16:53:09 +01:00
Marco Serantoni 5777523b35 Fixing typo 2013-12-30 01:36:57 +01:00
Marco Serantoni e0eb666f6c [MacOSX]/All purpose - Support for static linking 2013-12-30 01:27:03 +01:00
jean-pierre charras 19ebe3feb8 eeschema: fix compil issue. Boost build: boost lib context built only on OSX (does not build on mingw, and not needed) 2013-12-29 23:05:06 +01:00
Marco Serantoni b9e9480e5c [MacOSX]/All purpose - Starting support to static linking 2013-12-29 20:38:12 +01:00
Marco Serantoni 70b7131ae7 [MacOSX] fixes a missing feature in boost and fixes static build with x86/i386 involved
(https://svn.boost.org/trac/boost/ticket/8266)
2013-12-29 20:36:30 +01:00
jean-pierre charras 7ec2c004a2 fix bugs 1264240, 1264247, 1264239, 1264233 (clang report errors) 2013-12-29 16:12:27 +01:00
jean-pierre charras 7e884e1eb1 Fix bugs 1264236, 1264238, 1264254 2013-12-29 12:01:54 +01:00
jean-pierre charras 7689d48632 Move HitTestForCorner and HitTestForEdge code from class_zone to polygon/PolyLine.cpp, to avoid redundant code.
Fix bug 1264248.
Fix a very minor issue in RemoveTrailingZeros, for countries where the separator in floating numbers is a comma.
2013-12-29 11:15:06 +01:00
Marco Serantoni 514c6c11ae Shows the current BZR version in version.h, not the last in the repository (Nick Østergaard) 2013-12-28 12:29:20 +01:00
jean-pierre charras e18828bed7 Dialog fp plugin option: Fix compil issue under gcc 4.4 (does not happen with 4.6 and later) about an overloaded function. 2013-12-27 12:44:40 +01:00
jean-pierre charras 0d52d9aa52 Pcbnew, 3D viewer: fix incorrect position of multiline texts. 2013-12-27 08:24:36 +01:00
Dick Hollenbeck bf9db2148c Hide m_galCanvas and m_galCanvasActive behind accessors. Fix DLIST concatonation API corner case. 2013-12-26 16:36:43 -06:00
unknown 768f7c0e45 Update freedesktop files according to http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html 2013-12-24 13:11:18 -06:00
Dick Hollenbeck d160459f4a FIX: avoid use of wxFileName::GetModificationTime() when it can fail. 2013-12-24 13:09:41 -06:00
Dick Hollenbeck 69b16484ec add mime type application/x-pcbnew-pcb, extend Desktop Exec to support a file to open on command line 2013-12-24 13:07:17 -06:00
Dick Hollenbeck 5f023e1e25 Update resources/linux/mime with zip from Fabrizio 2013-12-24 12:46:56 -06:00
Marco Serantoni b7996a4ad4 [MacOSX] Thanks for the hint, nullset@freenode, Merry Xmas ! 2013-12-24 19:16:56 +01:00
Baranovskiy Konstantin 447bb98480 Fix worksheet multiple line text plotting bug. (fixes lp:1261906) 2013-12-23 11:25:13 -05:00
Dick Hollenbeck 68d43a49df kicad-install.sh: abort on first failure. 2013-12-23 09:39:40 -06:00
Marco Serantoni 3353297858 [MacOSX] Fixing Zone visualization and removing not working code 2013-12-23 16:14:22 +01:00
jean-pierre charras f56e4fe1a4 specctra_export.cpp: Fix a conversion error from mils to mm I made i n may last commit, which set min dist to find a segment end for internal outlines holes to 1 mil instead of 10 mils. 2013-12-23 09:07:08 +01:00
Marco Serantoni 5a6e6b2733 [MacOSX] Cleanup 2013-12-22 20:52:52 +01:00
jean-pierre charras 58b96efe06 Fix broken download_boost.cmake. Fix minor other issues:
dialog fp lib table display not updated (Windows specific) when an option is changed from the lib table option editor
overloaded function in dialog_fp_lib_table.cpp not compiled with gcc 4.4.7 (try to fix Bug #1262002).
specctra_export.cpp: set min dist to find segment ends when building the board outline to 2 microns (should break anything, but should be enough to fix rounding issues when creating/importing board outlines with arcs)
2013-12-22 20:02:04 +01:00
Marco Serantoni 0328cfe83e [MacOSX] Fixing crash/missing refresh in pcb text 2013-12-22 18:39:37 +01:00
Marco Serantoni 4270fece64 [MacOSX] Fixing crash when changing module text properties - bug #1230090 2013-12-22 18:29:57 +01:00
Maciej Suminski 9cba0c0b02 Merge zone outline drawing fix request. 2013-12-22 11:30:46 -05:00
Maciej Suminski 64201d49f0 Merge aligned text fix request. 2013-12-22 11:07:47 -05:00
Marco Serantoni c801fcd835 [MacOSX] Treats LLVM as GCC + adds support for boost multiple processor(ppc/intel) and address(32/64 bit) 2013-12-22 15:55:05 +01:00
Maciej Suminski aac9946aef OpenGL canvas rats nest merge request. 2013-12-20 15:58:18 -05:00
Maciej Suminski 292a50f8c0 Fixed cursor force position option. 2013-12-20 16:07:58 +01:00
Maciej Suminski ebdddf0bc0 Ratsnest is updated, when there are tracks added using the P&S router. 2013-12-20 15:18:41 +01:00
Maciej Suminski a8ac725564 Fixed broken search filters. 2013-12-20 11:54:48 +01:00
Maciej Suminski 342684587a Upstream merge. 2013-12-20 10:15:00 +01:00
jean-pierre charras 9a532f2cda Undo the change in specctra_export I erroneously committed, which is not fully tested. 2013-12-19 12:43:16 +01:00
jean-pierre charras 909b7fb425 Dxf export: fix an issue in exported arcs. Update libdfx.
Pcbnew:, libedit, Save lib as...: the new .pretty lib format is the default, instead of legacy .mod format. The legacy format is still selectable in the file selection dialog.
2013-12-19 12:33:57 +01:00
Maciej Suminski 2027222074 Upstream merge 2013-12-19 11:15:27 +01:00
Maciej Suminski 93c3a64839 Module texts are undo/redoable. 2013-12-19 10:10:42 +01:00
Baranovskiy Konstantin 0913c5e167 Fix border and title block line thickness plotting bug. (fixes lp:1261899) 2013-12-18 13:11:15 -05:00
Wayne Stambaugh 9abad0063e CvPcb: reload footprint list when footprint library table is changed. (fixes lp:1261911) 2013-12-18 11:36:07 -05:00
Maciej Suminski 85aa4057f8 Fixed zone area removal (& undoing) using the EDIT_TOOL. 2013-12-18 17:16:15 +01:00
Maciej Suminski 9cd30339e1 Made pads & module texts unselectable 2013-12-18 16:26:21 +01:00
Wayne Stambaugh 4b851f9b98 Pcbnew: rotate footprint hot key fixes (fixes lp:1066182).
* Change general properties dialog to allow for entry of arbitrary rotation
  angles for greater than 0 to 90.
* Move global rotation angle variable into PCB_EDIT_FRAME object where it is
  used and add accessors.
* Change rotate footprint undo operation from UR_ROTATE_XXXX to UR_CHANGE.
* Create function to remove trailing zeros from floating point wxString
  objects.
2013-12-18 09:48:59 -05:00
Maciej Suminski 64c093109d Added possibility of removing selected items while dragging. 2013-12-18 15:38:38 +01:00
Maciej Suminski 667dd177ce More elegant way of handling interruption of current modifications. 2013-12-18 15:11:12 +01:00
Maciej Suminski b67c568545 Speed optimization during selection of multiple items.
Removed debug output.
2013-12-18 15:09:09 +01:00
Maciej Suminski 2fb36a9144 SELECTION_TOOL uses ITEMS_PICKED_LIST to store selected items.
Modifications done using the EDIT_TOOL are saved using the default KiCad's undo buffer.
If there is only one item selected, info about the item is displayed in the bottom status bar.
2013-12-18 14:33:34 +01:00
Maciej Suminski f06c0dc463 Added MODULE::RunOnChildren(). 2013-12-18 13:39:11 +01:00
Maciej Suminski ce1541e915 Added const modifiers where applicable (PICKED_ITEMS_LIST).
Added PICKED_ITEMS_LIST::FindItem().
2013-12-18 13:27:18 +01:00
Maciej Suminski 212f004cad Removed some debug logs. 2013-12-18 12:46:18 +01:00
Wayne Stambaugh a8339496e5 Pcbnew: change general properties dialog rotation angle to text edit control. 2013-12-17 16:38:20 -05:00
Wayne Stambaugh 9a183196a2 Merge changes from testing head. 2013-12-16 16:41:32 -05:00
Wayne Stambaugh 5a12aa9e1b Pcbnew: fix 45 degree rotation angle undo and global variable elimination. 2013-12-16 16:40:03 -05:00
Maciej Suminski 5c0d62ac2e Fixed drawing of rotated texts that are not horizontally center aligned. 2013-12-16 10:36:33 +01:00
jean-pierre charras 3d511efbb9 Pcbnew: remove broken patch for" Bug #1255059".
Minor change: Eeschema+Pcbnew: display timestamp in edit dialogs (for footprints, sheets, components)
2013-12-14 20:03:38 +01:00
Wayne Stambaugh 05a159d648 Pcbnew: minor Geda and KiCad plugin improvements.
* Make GPCB_PLUGIN::EnumerateFootprints() read the directory contents
  instead of loading the entire cache.
* Make KICAD_PLUGIN::EnumerateFootprints() read the directory contents
  instead of loading the entire cache.
2013-12-13 18:16:40 -05:00
Wayne Stambaugh 5a9aa812e2 Make old behavior the default in EnumerateFootprint() changes. 2013-12-13 18:14:30 -05:00
Wayne Stambaugh 35a9deb301 Pcbnew: minor Geda and KiCad plugin improvements.
* Make GPCB_PLUGIN::EnumerateFootprints() read the directory contents
  instead of loading the entire cache.
* Make KICAD_PLUGIN::EnumerateFootprints() read the directory contents
  instead of loading the entire cache.
2013-12-13 18:01:42 -05:00
Dick Hollenbeck c0ed445918 github_plugin.cpp was erroneously affected by rev 4552 patching. 2013-12-13 10:39:46 -06:00
Povilas Kanapickas f954ace66b Remove some uses of using namespace std. 2013-12-13 10:27:30 -06:00
Dick Hollenbeck 6776f8a79f kicad-install.sh and library-repos-install.sh utilize /etc/profile.d/kicad.sh for setting environment variables globally 2013-12-13 09:35:05 -06:00
Wayne Stambaugh ba345cb823 Pcbnew: Geda plugin fixes.
* Prevent cache from being reloaded on every footprint file read.
* Fix a bug forming wxFileName in GPCB_FP_CACHE::Load().
* Fix invalid file name time stamp debug assertion.
* Use FPID to set loaded footprint name.
* Remove file name <> from exception strings per UIPolicy.
2013-12-12 12:42:38 -05:00
Dick Hollenbeck 39abd88a54 remove USE_FP_LIB_TABLE code, make it the norm. Add lazy loading support to FOOTPRINT_INFO. 2013-12-12 10:01:03 -06:00
Wayne Stambaugh ecccdf0279 Fix footprint viewer perspective save bug. 2013-12-11 15:08:13 -05:00
Dick Hollenbeck 095e4a8799 Add strtok_r.c 2013-12-10 17:52:51 -06:00
Dick Hollenbeck a66ae2f51b FIX: make LEGACY_PLUGIN re-entrant. extern "C" strtok_r() put conditionally into libcommon. 2013-12-10 17:41:34 -06:00
Marco Mattila 781c6449d3 Fix wxWidgets 2.8 validator bug in footprint name entry dialog. (fixes lp:1259204) 2013-12-10 14:24:10 -05:00
Maciej Suminski eca952b8c5 Commit merge request lp:197913. 2013-12-10 12:14:30 -05:00
Maciej Suminski 13d4ee03b3 Commit merge request lp:197858 (fixes lp:1249736). 2013-12-10 08:43:04 -05:00
Dick Hollenbeck 22f9af6bf3 dialog perfection does not come easily. 2013-12-09 16:48:09 -06:00
Dick Hollenbeck d01c071d25 spinners initial values and limits. 2013-12-09 16:39:12 -06:00
Wayne Stambaugh 3f4bf9062c Fix frame perspective configuration entry name in basicframe.cpp. 2013-12-09 15:27:49 -05:00
Dick Hollenbeck 92e0d7bab2 molding mercury. 2013-12-09 13:06:47 -06:00
Dick Hollenbeck d9174a110b move ${Boost_LIBRARIES} into cvpcb, pcbnew, _pcbnew and out of github, because worker threads used regardless of github 2013-12-09 12:48:42 -06:00
Dick Hollenbeck f9c92b7c78 *) Change FOOTPRINT_LIST::ReadFootprintFiles( FP_LIB_TABLE*, const wxString*)
To use multiple working threads.  This entailed adding KiCad typedefs:
*) Add typedefs for MUTEX and MUTLOCK which mask the actual choices for the project.
*) Add FOOTPRINT_LIST::DisplayErrors( wxWindow* ) which is a single strategy for
   showing aggregated load errors.  Although what's there is only scaffolding
   and needs a volunteer who knows HTML pretty well.
*) Ensure all callers of ReadFootprintFiles() use the new DisplayErrors() function.   
*) Push utf8.cpp and utf8.h into common library for open use.
2013-12-09 12:09:58 -06:00
Maciej Suminski b73dc849a5 Comments. 2013-12-09 11:07:30 +01:00
Maciej Suminski 283788d91c Added removal of BOARD_ITEMs for the TOOL_FRAMEWORK. 2013-12-09 11:01:05 +01:00
Maciej Suminski 9b4b5c931e Moved Init() & Reset() from TOOL_INTERACTIVE to TOOL_BASE.
Added REASON enum for Reset() function, so tools will know why a reset occured.
Fixed SELECTION_TOOL (it was bailing out, when a new board was loaded and some items were still selected).
Added removal of VIEW_ITEM groups after changing layers and removing items.
2013-12-09 10:42:38 +01:00
Dick Hollenbeck bb87cd5fba fixes, a couple more unit tests. 2013-12-08 09:25:11 -06:00
Wayne Stambaugh 5d21c2d300 Enable building the footprint library table as the default. 2013-12-08 09:06:55 -05:00
scrizt da08a4129e Allow spoke width to equal minimum zone width in pcbnew (fix bug #1255059) 2013-12-08 12:00:20 +02:00
Dick Hollenbeck bff99dcf73 complete class UTF8.cpp 2013-12-08 00:48:25 -06:00
Dick Hollenbeck 1d7538a557 Documentation/guidelines/UIpolicies.txt should not speak of the unspeakable use of <> in quoted strings. 2013-12-07 22:49:44 -06:00
Dick Hollenbeck e483be7726 common/gal/stroke_font.cpp was segfaulting in wx 2.8 when drawing multi-line string. 2013-12-07 22:47:37 -06:00
Dick Hollenbeck 3b8a34bf25 eeschema/dialogs/dialog_lib_new_component.cpp was not expanding part name field nor setting initial focus. 2013-12-07 22:46:25 -06:00
Wayne Stambaugh 0f6dfb782e Pcbnew: footprint viewer wxAUI improvements.
* Make the tool bar dockable.
* Enable the overflow control in the tool bar in case the it does not fit in
  it's parent window.
* Fix some wxAuiPaneInfo usage issues.
* Remove unused wxAuiPaneInfo objects.
* Move perspective saving and loading into EDA_BASE_FRAME object in preparation
  for extending this to all frame windows.
2013-12-06 19:33:16 -05:00
Dick Hollenbeck c8aada9941 Move "code costly" functions in experimental class UTF8 to be not "inlined", prefering compactness. 2013-12-06 14:22:10 -06:00
jean-pierre charras 3d4fa72b51 Plot functions: some enhancements in mirror mode (Pcbnew specific): boards are mirrored horizontally, and the page layout is no more mirrored, and therefore is always readable. 2013-12-06 19:31:15 +01:00
unknown 936ffcaabc Bug fix: pcbnew hangs up on polygon movement 2013-12-06 15:34:39 +01:00
Maciej Suminski 84721d045e Removed unnecessary parts. 2013-12-06 15:01:36 +01:00
Dick Hollenbeck 0443c73aab UTF8::uni_iter made leaner. 2013-12-06 07:32:33 -06:00
Maciej Suminski d72ec51ccf Fixed an infinite loop in the destructor of ACTION_MANAGER; 2013-12-06 13:57:56 +01:00
Dick Hollenbeck 5778d74fbb sketch out class UTF8::uni_iter, add tools/make-UTF8.sh 2013-12-06 06:51:39 -06:00
Maciej Suminski b67faf780e Corrected drawing of zone outlines. 2013-12-06 11:25:23 +01:00
Maciej Suminski 3afbd8f2e1 Corrected polygon outline width. 2013-12-06 10:00:51 +01:00
Dick Hollenbeck fb771bf797 add a concept of an 8 bit string class for testing and experimentation. 2013-12-05 14:36:18 -06:00
Orson 46f42ba9c8 merge lp:~cern-kicad/kicad/bugfix_1256302 from Orson 2013-12-05 13:04:06 -06:00
Dick Hollenbeck bee41d9491 Switch STROKE_FONT::Draw() to take "const wxString&" rather than "wxString" by value. 2013-12-05 12:59:27 -06:00
Dick Hollenbeck f37fb67e5a merge lp:~cern-kicad/kicad/bugfix_1256302 from Orson 2013-12-05 12:55:07 -06:00
Maciej Suminski 940fc985e7 DIfferent handling of italic texts, depending on the mirroring setting. 2013-12-05 17:00:29 +01:00
Maciej Suminski 384abca49e Tilda handling for STROKE_FONT class. 2013-12-05 16:58:32 +01:00
Maciej Suminski c04eb822b7 Glyphs and their bounding boxes are held in vectors instead of deque.
Moved scaling of font glyphs to the moment when they are created (eliminated a few multiplications unnecessary variables).
Changed some magic numbers into constants.
2013-12-05 16:29:54 +01:00
Maciej Suminski 0a51662c0b Changed std::wstring to wxString. 2013-12-05 16:00:24 +01:00
Maciej Suminski 84af2eb8e1 Fixed SetCurrentContext() assert, that was firing on closure of pcbnew, when the OpenGL backend was active. 2013-12-05 14:54:30 +01:00
Maciej Suminski df5b9a1df0 Changed selection rules (pads&modules can be selected depending on the 'modules front/back' visibility instead of corresponding copper layers).
Fixed comments.
2013-12-05 14:52:08 +01:00
Maciej Suminski 0ac6e0614f ClearHotKey() function. 2013-12-05 14:48:44 +01:00
Maciej Suminski f3ef0fcf57 Removed warning. 2013-12-05 13:46:13 +01:00
Maciej Suminski 59f450bcfd Merged upstream 2013-12-05 13:24:27 +01:00
Dick Hollenbeck 53db1d2c9b From kicad-install.sh, issue instructional aid on setting KIGITHUB if not already set. 2013-12-04 16:19:55 -06:00
Maciej Suminski 45291ef571 The Selection Tool displays information about selected items. ClearSelection() made public. 2013-12-04 10:58:51 +01:00
Dick Hollenbeck 8cc9b69017 Add a test script for plugin testing, and some asserts, no bugs fixed. 2013-12-03 12:37:21 -06:00
Maciej Suminski 304d17dd32 The Selection Tool is always active. Removed entries for toolbar menu and hotkeys for the tool. 2013-12-03 17:11:22 +01:00
Maciej Suminski dc8997b1ac Merged upstream 2013-12-03 16:43:53 +01:00
Maciej Suminski e1bfcb1816 Renamed MOVE_TOOL to EDIT_TOOL. 2013-12-03 16:09:03 +01:00
Maciej Suminski af981b37fe Split rotate and flip operations into separate functions.
Added Properties action (display properties windows)
2013-12-03 15:57:09 +01:00
Maciej Suminski 4a4c0914bc Added TOOL_MANAGER::RunAction() function. 2013-12-03 15:41:41 +01:00
Maciej Suminski bc41f8298b Added some comments & asserts. 2013-12-03 15:17:43 +01:00
Maciej Suminski 12098fe113 Fixed non ASCII characters drawing using GAL. 2013-12-03 11:00:52 +01:00
jean-pierre charras 53053d0693 Pcbnew: fix issue in modedit, undo command: moved fields were not drawn afetr undo (due to incorrect flags state)
Fix incorrect initialization of lib names column in EDA_LIST_DIALOG. (Only the row 0 was initialized)
2013-12-03 09:50:58 +01:00
Dick Hollenbeck 829629d05f Fix important informational comment in library-repos-install.sh 2013-12-02 14:08:13 -06:00
Dick Hollenbeck 49233429e4 *) update scripts/kicad-install.sh to use Github plugin for system footprints.
*) Add scripts/library-repos-install.sh for downloading *.pretty libraries and possibly using them.
*) Remove template/fp-* files, they are now at https://github.com/KiCad/kicad-library/template/*
   so they can be maintained by the library team.  However note that it is possible to break
   kicad-install.sh with uncoordinated changes to that github repo.

It is best to delete your ~/kicad_sources/kicad-lib.bzr directory before running kicad-install.sh
at this or any newer version relative to an older library repo.
2013-12-02 12:21:06 -06:00
Maciej Suminski 47b6dd34af Pcbnew: fixed disappearance of selected items after GAL switching. 2013-12-02 13:04:26 -05:00
Robert Yates 4bd71d676f Boost::Context support for ARM platform. 2013-12-02 10:59:09 -05:00
Maciej Suminski a8bdd44cd1 Overridden ViewUpdate() for MODULE class, so it handles its pads, drawings and texts. 2013-12-02 14:35:05 +01:00
Maciej Suminski 9a860c355a Fixed disappearance of selected items after GAL switching. 2013-12-02 11:34:07 +01:00
Dick Hollenbeck c42a473521 library repo name has changed at launchpad, and will soon be switched to github. 2013-12-02 00:59:06 -06:00
Wayne Stambaugh 43eb124964 Pcbnew: footprint library table fixes.
* Replace illegal file system characters when reading legacy libraries to
  prevent FPID parsing errors and allow saving to PRETTY file format.
* Create validator to filter illegal file system characters from footprint
  name text edit controls to prevent issues when saving to PRETTY file format.
* Add missing source file licenses and some minor coding policy fixes.
2013-11-29 13:29:41 -05:00
Maciej Suminski a078fa6779 Storing the selected item position from a context menu. 2013-11-29 16:45:39 +01:00
Maciej Suminski 86a8bbee9a Added a missing file 2013-11-29 16:13:09 +01:00
Maciej Suminski 947a846d2e Moved the SELECTION_TOOL out of the KIGFX namespace. 2013-11-29 09:37:23 +01:00
jean-pierre charras 4897ea8c35 eeschema, Pcbnew: fix Bug #1255822 (incorrect position of multiline texts when plotting them) 2013-11-29 09:13:43 +01:00
Dick Hollenbeck fa2edf8547 *.kicad_mod omits (at 0 0) for brevity. 2013-11-28 10:40:23 -06:00
Dick Hollenbeck dcefaf675c API Documentation improvements, especially noticable when viewing doxygen output. 2013-11-28 09:41:10 -06:00
Maciej Suminski 4343c6a24f Automatic unregistration of tool actions during ACTION_MANAGER destruction. 2013-11-28 15:24:19 +01:00
Maciej Suminski fc7798b7d7 Double click support for the Tool Framework. 2013-11-28 15:19:50 +01:00
Dick Hollenbeck 82b2558d96 Even more clarification on "Github" plugin usage 2013-11-27 14:15:11 -06:00
Dick Hollenbeck 466ecca932 Better GITHUB class header documentation, better eeschema library field dialog stretching and title. 2013-11-27 14:06:41 -06:00
jean-pierre charras 96adde2d52 Pcbnew: fix Bug #1255568 (relative to .pos file creation). Minor compil warnings fixes 2013-11-27 20:38:59 +01:00
Jon Neal b2a71b505b FIX: Red Hat (and derivatives such as Fedora) support in kicad-install.sh 2013-11-27 08:13:06 -06:00
jean-pierre charras ecafc030ef Pcbnew: Autoplace functions: renamed spread footprint functions. Rewritten.
Now footprints, after loaded by reading a netlist are grouped by sheets by the footprints spread function, and the grouping is better.
Rename 2 files. Fix minor issues. Clean code
2013-11-27 14:20:42 +01:00
Robert Yates 6007dca4d1 Boost::Context support for ARM platform. 2013-11-27 09:48:31 +01:00
Maciej Suminski 08ecc5005f Profile counter simplified, so it should be more portable. 2013-11-27 09:46:59 +01:00
Dick Hollenbeck 7b70f2835c Ensure a unique FootprintEnumerate() return list in GITHUB_PLUGIN when using COW. 2013-11-27 00:51:49 -06:00
Dick Hollenbeck d8b046a361 *) Implement "Copy On Write" (COW) support in GITHUB_PLUGIN. See class header
comment for GITHUB_PLUGIN which should flow into Doxygen output.
*) Rewrote: 
        PCB_BASE_FRAME::Save_Module_In_Library(): now uses fp-lib-table and PROPERTIES.  
        PCB_EDIT_FRAME::ArchiveModulesOnBoard(): now can archive to any writable library type.
        PCB_BASE_FRAME::SelectLibrary(): is now generic for selecting a library, not just the active library.
2013-11-27 00:04:04 -06:00
Dick Hollenbeck 9ee683e971 FIX: work around for wx 2.8 bug affecting wxListCtrl column resizing. 2013-11-26 11:08:07 -06:00
Dick Hollenbeck 0b01c898f0 PLUGINs which implement FootprintLibOptions() should call base class's implementation too. 2013-11-26 11:06:54 -06:00
Andrey Fedorushkov 08e6ef95ab eeschema: fix parts range 1 to 26 in component 2013-11-26 13:15:20 +04:00
Maciej Suminski dd89260db3 Added ratsnest for GAL 2013-11-25 16:50:03 +01:00
jean-pierre charras 534a04206b Fix bugs in autoplac.cpp 2013-11-25 12:29:16 +01:00
Andrey Fedorushkov 25eaf50586 pcbnew: fix error build autoplace.cpp in linux gcc-4.8.2
template: add file fp-lib-table.for-eagle
2013-11-25 10:10:24 +04:00
jean-pierre charras e259a150fb All: GetBoundingBox returns now a const EDA_RECT.
Pcbnew: Code cleaning and bug fix in autoplace functions
Dialog exchange footprints has now a separate button to update the .cmp file, only on request.
2013-11-24 18:48:14 +01:00
jean-pierre charras 6bc8d6a231 Pcbnew: Fix a crash on exit when an item was previously deleted. Fix not working footprint exchange functions 2013-11-22 20:47:10 +01:00
jean-pierre charras 8122846078 Pcbnew: Code cleaning and some minor fixes. 2013-11-20 18:26:47 +01:00
Dick Hollenbeck 8fbdc6a50d Add template fp-lib-table for eagle-6.4.0 2013-11-20 10:38:06 -06:00
Dick Hollenbeck 2be3ebd401 FIX: regression loading of SMD pads within EAGLE_PLUGIN::FootprintLoad().
FIX: unique renaming of eagle footprints by substituting illegal : and / with URL encoding technique.
ADD: window resize border to DisplayError() windows.
2013-11-20 10:35:03 -06:00
Wayne Stambaugh f114bed0d2 Pcbnew: minor target properties dialog improvements.
* Make spacing between controls and dialog frame consistent.
* Use default size to allow wxWigdets to determine optimal dialog size.
* Set OK button as default so return key works properly.
2013-11-20 11:03:09 -05:00
Wayne Stambaugh 31deb4d25d Pcbnew: fix assertion when deleting BOARD_ITEM not linked to list. (fixes lp:1252696) 2013-11-19 16:51:33 -05:00
Dick Hollenbeck 413b776194 FIX: wx 2.8 convert to UTF8 differently than 2.9 caused problems in DIALOG_FP_PLUGIN_OPTIONS. 2013-11-19 14:38:29 -06:00
Wayne Stambaugh af18baba7b Pcbnew: fix graphic item undo/redo bug. (--fixes lp:1252264)
* Use std::swap for PCB_LINE_T items in SwapData().
* Use std::swap for PCB_MODULE_EDGE_T items in SwapData().
* Add assignment operator to EDGE_MODULE object.
* Move code from copy method to assignment operator.
* Minor coding policy fixes.
2013-11-19 13:58:12 -05:00
Dick Hollenbeck 527695bf53 Add a place-holder Description to fp-lib-table rows 2013-11-19 12:08:24 -06:00
Dick Hollenbeck bcd3470b20 *) Switch to later environment variable expansion in fp-lib-table.
*) Save library nickname in APP so upon module editor re-entry last is re-used.
*) Fix bug editing fp-lib-table Description field.
2013-11-19 11:24:45 -06:00
Carl Poirier fd86b347e6 update fp-lib-table to footprint library renaming efforts. 2013-11-19 11:24:19 -06:00
jean-pierre charras 801d72c55a Eeszchema: Minor fixes.
Code cleanup: remove m_Son member in EDA_ITEM which was never used.
2013-11-19 17:27:13 +01:00
Dick Hollenbeck 6ea28cb69d more useable, in the face of wx 2.8 vs. 3.0 differences. 2013-11-18 16:42:01 -06:00
Dick Hollenbeck 19196bede7 Work around wx 2.8 bug in wxListControl not honoring omissing of wxHSCROLL. 2013-11-18 16:03:34 -06:00
Dick Hollenbeck eed87fc699 more EDA_LIST_DIALOG usability enhancements, compiler warning, coding standards 2013-11-18 13:27:27 -06:00
jean-pierre charras 6c1a67684e Fix some minor issues 2013-11-18 18:52:18 +01:00
Dick Hollenbeck e5b6055e7d Show the "Description" field from fp-lib-table in pcbnew's module editor 'set current library' dialog. 2013-11-18 10:04:23 -06:00
jean-pierre charras 3ea78d07b1 Fix a compatibility issue for wxWidgets 3.0, when moving cursor by arrow keys.
Fix a very minor bug (2 duplicate lines when copying version informations to the clipboard)
2013-11-17 17:48:47 +01:00
Dick Hollenbeck c8c06ff230 EDA_LIST_DIALOG_BASE is used multiple times for different numbers of
columns.  DIALOG_SHIM would resize each separate usage to the same
size.  DIALOG_SHIM now supports and alternate m_hash_key in lieu
of the class name, optionally.
2013-11-17 00:04:20 -06:00
Baranovskiy Konstantin bbc596ad6c Fix justification of vertically aligned multi-line text. 2013-11-16 20:31:07 -05:00
Wayne Stambaugh 0930828a81 Eeschema: update component editor new component dialog with revise unit nomenclature. 2013-11-16 20:13:26 -05:00
Dick Hollenbeck 8c71406615 fix link error with multiply used edaapl.cpp 2013-11-15 09:12:07 -06:00
Dick Hollenbeck 1b01dba827 Show KISYSMOD in DIALOG_FP_LIB_TABLE even if it has not been referenced by a URI. 2013-11-15 08:36:11 -06:00
Dick Hollenbeck 4aa52ddd60 Show KIPRJMOD in DIALOG_FP_LIB_TABLE even if it has not been referenced by a URI. 2013-11-15 08:11:46 -06:00
Dick Hollenbeck b80de21136 Allowing pre-setting CMAKE_CXX_FLAGS on first CMake invocation 2013-11-15 08:10:29 -06:00
jean-pierre charras ca927e4227 Minor code cleaning: Remove unused file, remove obsolete or useless defines 2013-11-15 10:28:31 +01:00
jean-pierre charras f2c17a64fb Minor fix about version information when BUILD_GITHUB_PLUGIN is on 2013-11-15 08:24:10 +01:00
Dick Hollenbeck c793624195 TODO.txt 2013-11-14 16:52:28 -06:00
Maciej Sumiński 42d54163c5 add boost dependency on BZip2 by adding find_package( BZip2 REQUIRED ) 2013-11-14 16:51:11 -06:00
jean-pierre charras 5f2f80f480 rtree.h: suppress compil warnings about not initialized vars.
Pcbnew: add WIN32_LEAN_AND_MEAN define in github_plugin.cpp. Note: this define is already in use in avhttp build (Windows specific)
2013-11-14 19:00:57 +01:00
Wayne Stambaugh 88be1fee15 Minor copy version information improvements.
* Add build type (debug/release) for wxWidgets library  versions greater
  than 2.8.
* Add build type (debug/release) for KiCad.
* Add missing build options.
2013-11-14 09:21:32 -05:00
Wayne Stambaugh 0a6a44522a Update TODO.txt to reflect completed FP_LIB_TABLE items. 2013-11-13 15:57:51 -05:00
Dick Hollenbeck 0ba54b4b7c format string concatenation bug 2013-11-13 13:59:47 -06:00
Dick Hollenbeck 56b35ef6fb half way point for Carl's *.mod file renaming work 2013-11-13 13:58:50 -06:00
Maciej Suminski 03855be6f9 Merged rtree.h, to avoid code duplication.
Fixes the case, when waste is never greater then the worst case and seeds assignment does not occur.
2013-11-13 17:03:22 +01:00
Maciej Suminski 39b55e20c0 Fix wx2.8 strings compatibility. (fixes lp:1250876) 2013-11-13 10:27:14 -05:00
Maciej Suminski 24ab8e0b52 Fixed wx2.8 strings compatibility. 2013-11-13 15:52:06 +01:00
Dick Hollenbeck a961938716 change 2013-11-12 14:58:33 -06:00
Dick Hollenbeck 5c2b9d6011 Completion of DIALOG_FP_PLUGIN_OPTIONS 2013-11-12 14:49:17 -06:00
Maciej Suminski 66def25eab Commit Launchpad merge request 194664.
* Modify error handling for OpenGL backend.
* Correct Doxygen comments notation.
2013-11-12 14:29:01 -05:00
Brian Sidebotham 16b7338a59 Although CMake keeps time stamps to remember how far it got in an ExternalProject_Add()
build, it throws the time stamps away when there are edits to the CMakeLists.txt portion
pertaining to the external project.  Only a 'make clean' would remove the untarred tree.
This patch removes the need to do a make clean when changing the ExternalProject_Add()
text pertinent to patching.

Fixes bug 1250222 in KiCad-Winbuilder
2013-11-12 12:44:30 +00:00
Dick Hollenbeck 5b89f42738 wxString PCB_BASE_FRAME::SelectFootprintFromLibBrowser() now returns empty string on abort.
GITHUB_PLUGIN uses redirected URL to remove one HTTP hit time.
2013-11-11 19:14:17 -06:00
Wayne Stambaugh 882a0bcb7d Footprint library table fixes.
* Pcbnew: catch exceptions when saving changes to footprint library table.
* Pcbnew: update footprint viewer library list if open when footprint library
  table changes.
* CvPcb: update library list when footprint library table changes.
* Minor coding policy fixes.
2013-11-11 20:05:23 -05:00
Dick Hollenbeck 629d397508 *) Add PLUGIN::FootprintLibOptions( PROPERTIES* ), and extend DIALOG_FP_PLUGIN_OPTIONS to use it.
*) Move button handlers to LEFT MOUSE CLICK from COMMAND events, so wxGrid focus is not lost.
*) Sketch out the concept of COW support for the GITHUB_PLUGIN in its @todo.
2013-11-11 18:17:27 -06:00
Wayne Stambaugh 346384f8fc Escape " character to fix warning in TokenList2DsnLexer.cmake 2013-11-11 16:39:02 -05:00
Dick Hollenbeck fe4af49759 error: 'uintptr_t' was not declared in this scope.
https://svn.boost.org/trac/boost/ticket/8973
https://svn.boost.org/trac/boost/changeset/84950#file0
2013-11-11 08:50:45 -06:00
Maciej Suminski 5370236743 Corrected Doxygen comments notation. 2013-11-11 13:47:08 +01:00
Maciej Suminski ee289e4a30 Modified error handling for OpenGL backend, now error messages should be visible. 2013-11-11 10:48:49 +01:00
jean-pierre charras 83ccbc7add Pcbnew: fix a build issue when BUILD_GITHUB_PLUGIN is enabled. 2013-11-11 09:01:04 +01:00
Dick Hollenbeck aa633bf2c7 Support only one boost build subset, regardless of BUILD_GITHUB_PLUGIN.
This is so builders with multiple out of source build trees can all use
the same common boost install directory.  And the build system will not
vascillate between the fuller and lesser subsets of boost.
2013-11-10 18:47:54 -06:00
jean-pierre charras 621b92cd5e All: under mingw32+msys: fix an issue when using Cmake version >= 2.8.5 which uses by default a response file.
This response file is not expanded under mingw3 2 (mingw/gcc bug?), and the list of include paths, found in this file, is not taken in account.
Now, under mingw32+msys, when not cross-compiling, the response file is disabled.
Cvpcb, Pcbnew: fix a list of libs  which should be added only when cross-compiling:
Previously, they were always added, which creates an issue with mingw/msy/ gcc  2.8.
Now they are added only when cross-compiling (this issue was noticeable only with msys+mingw version  2.8)
2013-11-10 20:15:09 +01:00
Dick Hollenbeck 0d549ae203 python in kicad-install.sh, if user enables it 2013-11-10 00:31:13 -06:00
Wayne Stambaugh d944e67a69 Eeschema multiple unit component nomenclature improvements (fixes 1226874).
* Replace all occurrences of the word "part" with "unit" when referring to
  multiple unit components for improved consistency.
* Replace "shared by" with "common to" when referring to objects (lines, arcs,
  pins, etc.) that are common to all units.
* Improve wording in library component properties dialog.
2013-11-09 11:30:49 -05:00
Brian Sidebotham e2b13be7a0 * Remove erroneous comment about requiring perl for OpenSSL build 2013-11-08 17:54:00 +00:00
Brian Sidebotham 8750485c6d * Build OpenSSL from source using the OpenSSL-CMake project on Windows with MinGW when no specifying OPENSSL_ROOT_DIR 2013-11-08 07:06:14 +00:00
Colin Cooper 1f9c1e6627 kicad-install.h checks if bzr id set 2013-11-07 12:15:58 -06:00
Dick Hollenbeck 050e782df5 switch to static linking of libstdc++ on windows 2013-11-07 08:26:32 -06:00
jean-pierre charras 732f4856c6 Eeschema: Disable a debug option I enabled and forgot to remove. 2013-11-06 20:36:46 +01:00
Maciej Sumiński 27863c0bc9 Patches one by Lorenzo, one by Orson 2013-11-06 11:17:42 -06:00
Dick Hollenbeck f0215a7009 add fix_eagle_package_name() and apply it in two places to re-spell eagle package names 2013-11-06 10:53:44 -06:00
Wayne Stambaugh 3a06962045 Set project footprint library table path environment variable before loading table. 2013-11-06 11:10:44 -05:00
Dick Hollenbeck 6fffba5bb2 kicad-install.sh needed libcairo2-dev prerequisite 2013-11-06 08:37:39 -06:00
jean-pierre charras 2ace8e0a5e page layout editor: Add missing Info.plist for OSX.
Mingw, all: remove static link of libgcc, which can create issues when using dll version of wxWidgets.
Therefore libgcc_s_dw2-1.dll should be in the paths for executables.
2013-11-06 08:33:49 +01:00
Dick Hollenbeck 99e99e5b60 add libglew-dev prerequisite for debian systems, it pulls in libgl1-mesa-dev and libglu1-mesa-dev on its own 2013-11-06 00:14:15 -06:00
Edwin van den Oetelaar fc19e7dfdb Running a very common Ubuntu 12.4.3 building from repo could not find the GLEW library. 2013-11-06 00:11:58 -06:00
Wayne Stambaugh 2398fa4044 Eeschema: fix bug loading grid size from previous session. (fixes lp:1239445) 2013-11-05 16:14:09 -05:00
Maciej Suminski aedfb6e6fa Fixes missing worksheet layout when there is no PCB loaded and all random brightness changes for the Cairo rendering backend. 2013-11-05 15:22:49 -05:00
jean-pierre charras c760a1c545 Pcbnew: Fix incorrect bounding box calculation of texts. Only noticeable with boards conveted from Eagle, which are using other text justification than center.
Eagle plugin: filter and replace not allowed chars in FPID(-':' and '/')  by _ or -, if they are used in Eagle footprint names (otherwise, boards converted and saved under kicad_pcb format are not readable by Pcbnew).
2013-11-05 18:12:27 +01:00
jean-pierre charras bcb30ce933 Disable patch from Baranovskiy Konstantin about vertical justification of multiline texts, because it does not work for rotated/mirrored texts 2013-11-04 18:20:54 +01:00
jean-pierre charras a4c3485440 painter: better size of pad nums and pad netnames in opengl mode 2013-11-04 18:18:19 +01:00
Dick Hollenbeck e8e223630a filter better the unsupported layers coming into EAGLE_PLUGIN::Load() 2013-11-03 20:09:28 -06:00
Wayne Stambaugh 7b68bdce5f Fix debug builds on wxWidgets 2.8. 2013-11-03 13:15:46 -05:00
jean-pierre charras 8884e47051 Opengl display: fix incorrect text size of pad num and pad netname. 2013-11-03 15:06:16 +01:00
Dick Hollenbeck 7c352e2038 Orson's changes 2013-11-02 15:06:13 -05:00
Dick Hollenbeck 2b20d3ef64 make PROPERTIES::Value() not inline 2013-11-02 14:49:46 -05:00
Dick Hollenbeck 0d5a7f3224 *) Start removing some of the problematic "<%s>.." format strings, which won't
pass into an HTML rendering panel and otherwise look goofey.
*) Implement BOARD::Move() can call it from EAGLE_PLUGIN::Load().
*) When USE_FP_LIB_TABLE, tolerate blank nicknames in FPIDs coming from eeschema.
   See the switch for this in pcbnew/netlist.cpp as ALLOW_PARTIAL_FPID.
*) Add an assert and a try catch block to figure out that View does not
   like some eagle pcb board.  bitset::set() is getting a -1 value and firing
   an exception.
2013-11-01 19:24:38 -05:00
jean-pierre charras 4bc0cdd8b3 Footprint wizards: fix issues. 2013-11-01 21:51:37 +01:00
jean-pierre charras 3511c95836 Make footprint wizards compatible with FPID changes (MODULE::SetLibRef changed to MODULE::SetFPID) 2013-11-01 16:29:50 +01:00
jean-pierre charras 5456ada1bd Pcbnew, compiled with python support: Under windows, force python environment, if the folder python27_us is found in Kicad bin folder (<kicad>/bin, and if python27_us environment is not fully set (i.e. if python27_us is not in the path, or if PYTHONPATH id not defined.) 2013-11-01 14:02:10 +01:00
Orson 1fa3ef37c3 Fix redraw issue in modedit a modview, with GAL 2013-11-01 13:56:20 +01:00
Maciej Suminski a5d8c49d75 Added some comments and missing parameter names for pcb_painter.h. 2013-11-01 10:06:50 +01:00
Dick Hollenbeck 0e69125217 cvpcb was not filtering on the current library when USE_FP_LIB_TABLE.
<%s> being replaced with '%s' because the former in invisible in html panels.
Cure some compiler warnings.
2013-10-31 16:30:57 -05:00
Dick Hollenbeck 046ecb794d add --uninstall-libraries to kicad-install.sh 2013-10-31 14:12:14 -05:00
Wayne Stambaugh d61ebcf446 Shorten footprint library table environment variable KICAD_PRJ_PATH to KIPRJMOD. 2013-10-31 09:08:36 -04:00
jean-pierre charras cfb3c942d7 Pcbnew: fix a crash when a non ascii char (i.e. a char having a code > 127) is found in a text (see Bug #1246340).
Could be only a temporary fix (tested only with French non ascii chars).
2013-10-30 21:07:52 +01:00
Dick Hollenbeck e49a3275e2 more fp_lib_table dialog work 2013-10-30 10:33:51 -05:00
Dick Hollenbeck 30964aec70 merge lp:~cern-kicad/kicad/pcbnew_segfix from Orson 2013-10-30 07:46:36 -05:00
jean-pierre charras 4e39d09d1d Add undo command to dxf file import. Change improper use of __WXDEBUG__ to DEBUG in class_board_connected_item.cpp. 2013-10-30 13:14:45 +01:00
Maciej Suminski 162b70ce5d Fixed segfault occurring on rendering backend switch when pcbnew is run from the main KiCad dialog. 2013-10-30 11:50:09 +01:00
Dick Hollenbeck 4b49d5d355 memory leak, comments 2013-10-30 00:14:11 -05:00
Dick Hollenbeck 3e18a46758 merge in a year's worth of CERN work 2013-10-29 19:10:24 -05:00
Maciej Suminski d6edc898c5 Fix colorized framebuffer output on some GPUs. 2013-10-29 17:53:47 +01:00
Maciej Suminski 1dcaf135e5 Changed the used framebuffer object extension from ARB_framebuffer_object to EXT_framebuffer_object (compatibility reasons). 2013-10-29 17:28:29 +01:00
Maciej Suminski 25919e8393 Merged upstream. 2013-10-28 21:34:06 +01:00
Maciej Suminski 1080a4e6f9 GAL is not activated by default. Late OpenGL backend initializatization. 2013-10-28 16:51:56 +01:00
jean-pierre charras b97769bf5c dxf import: minor enhancements in dialog. Update libdfxw from git, and uncrustify it. add a test dfx file 2013-10-28 09:06:38 +01:00
Wayne Stambaugh d17c1c57be Eeschema find/replace bug fixes and improvements (fixes 1208616).
* Fix replace bug to handle case sensitivity properly.
* Fix replace bug where the item index was getting updated incorrectly.
* Fix replace infinite loop bug on replace all.
* Make find/replace view update code a separate function.
* Rearrange find/replace trace string to add tracing to EDA_ITEM::Replace().
* Add IsComplexHierarchy method to SCH_SHEET_LIST for future find/replace
  improvements.
2013-10-27 14:21:53 -04:00
jean-pierre charras fd1fc0f1d1 Fix typo 2013-10-26 20:17:44 +02:00
jean-pierre charras eeddfcbec2 Pcbnew, dxf import: Add dialog to choose the board import layer, and the position of dxf coordinates origin 2013-10-26 09:03:06 +02:00
jean-pierre charras fe2b9bd444 Add patch from Baranovskiy Konstantin about vertical justification of multiline texts.
Fix issues created by this patch.
Note, this fix slightly changes the vertical position of these texts.
This is not really a  problem in eeschema, but in pcbnew this is perhaps  more annoying, if the verical multiline text is critical.
Fix a very minor issue  for vertical justification of single line texts in dxf import.
2013-10-25 14:16:18 +02:00
jean-pierre charras 5ebb4b54d9 Pcbnew: First work to add a DXF file import to create board outlines. The DXF import is based on DXF lib import/export from LibreCad. 2013-10-24 20:47:07 +02:00
jean-pierre charras cdd2967087 Add a DXF file import to create board outlines 2013-10-24 18:44:38 +02:00
Dick Hollenbeck e61505149a more DIALOG_FP_PLUGIN_OPTIONS work, make PROPERTIES a map instead of a hashtable for alphabetical iteration. 2013-10-24 08:58:05 -05:00
Dick Hollenbeck 8dbe249bf9 script improvements 2013-10-24 08:57:01 -05:00
Dick Hollenbeck 38a0857a69 *) Factor out Cut, Copy, and Paste for wxGrid into class common/GRID_TRICKS.
*) Use it on 3 grids total in DIALOG_FP_PLUGIN_OPTIONS and DIALOG_FP_LIB_TABLE.
*) Fix bug when pasting "(fp_lib_table" text into FP_LIB_TABLE.
2013-10-23 13:56:03 -05:00
Dick Hollenbeck 2b1b586251 fixes 2013-10-23 06:40:17 -05:00
Dick Hollenbeck f36cdde500 Grab pending (unsaved) wxGridCellEditor cell text and stuff into fp_lib_table. 2013-10-22 14:29:37 -05:00
Dick Hollenbeck 6de1bfb64c When pasting into a fp_lib_table with no initial rows, start at column zero, not -1. 2013-10-22 09:29:48 -05:00
Dick Hollenbeck a5e82117cb Distro specific architecture in scripts/kicad-install.sh. 2013-10-22 09:28:30 -05:00
Camille 019 2b7d04368a Tidy up the gcc 4.7.0 - 2 optimization setting methodology. 2013-10-22 09:26:26 -05:00
jean-pierre charras a9dbdbc822 Pcbnew: fix bug 1199340 2013-10-20 17:39:15 +02:00
jean-pierre charras 6528829796 All: fix bug making IsOK dialog always returns false, regardless the button clicked. 2013-10-19 15:22:24 +02:00
jean-pierre charras 3ad682a898 pl_editor: add a PPI (pixel per inch) setup option for bitmaps. 2013-10-19 12:29:54 +02:00
jean-pierre charras 7aca2ee5be Remove duplicate files.
Page layout editor: Add bitmap items to the page layout existing items.
Now a bitmap image can be added to a page layout description. Currently the bitmap is expected having a 300 ppi definition.
Note: not all plotters can plot a bitmap, and in this case the bounding box is plotted instead of the bitmap
2013-10-18 19:38:03 +02:00
Wayne Stambaugh 1c99f118ff Fix bug due to change in the default global footprint library table file name. 2013-10-18 12:06:18 -04:00
jean-pierre charras b49be74501 page layout editor: now one can add a bitmap to the page layout 2013-10-18 17:42:48 +02:00
Wayne Stambaugh 55f69da613 Minor message box improvements
* Create a generic yes/no/cancel dialog from DIALOG_EXIT.
* Make DIALOG_EXIT return wxID_YES instead of wxID_OK so it is consistent
  with the standard message dialogs.
* Add missing license to confirm.h and confirm.cpp.
* Change Eeschema message dialog when loading a schematic if the current
  schematic is modified to be more consistent with the exit dialog.
* Change Pcbnew message dialog when loading a board if the current board
  is modified to be more consistent with the exit dialog.
* Remove some Eeschema block debug logging code left over from my last
  commit.
2013-10-18 09:32:22 -04:00
Dick Hollenbeck ae7966a20c fix template files installation 2013-10-18 08:18:45 -05:00
jean-pierre charras 2e92fdf272 Remove duplicate files 2013-10-18 12:33:50 +02:00
Andrey Fedorushkov cf9a3cdc38 fix auto install template files 2013-10-18 10:01:59 +04:00
Dick Hollenbeck 70951375c9 Add support for building *.deb file using CPack, install ~/fp-lib-table either from kicad-install.sh or from make install_user_configuration_files 2013-10-17 14:03:36 -05:00
Dick Hollenbeck 6329a0070d .bzrignore was ignored. 2013-10-17 14:02:11 -05:00
Dick Hollenbeck 29fae88610 add {Get,Set}ModuleLibraryNickname to EDA_APP, reformatting 2013-10-17 14:01:35 -05:00
Dick Hollenbeck ee0c0fa6ba fix expansion of dialog on stretching and initial view 2013-10-17 13:59:54 -05:00
Dick Hollenbeck 33822213e6 fix formatting goofs 2013-10-17 13:47:46 -05:00
Dick Hollenbeck cb05bedf08 Throw exception if accessing a GITHUB library from build not supporting GITHUB. 2013-10-17 13:46:20 -05:00
Dick Hollenbeck 4cf328c50b add script to build KiCad on Ubuntu/Debian/Mint linux 2013-10-17 10:33:46 -05:00
Wayne Stambaugh f44eb0f8ba Add PDF output to Pcbnew plot dialog. (fixes 1p:1188972) 2013-10-15 14:22:35 -04:00
Wayne Stambaugh 76c9029ec3 Eeschema block end handler code improvements.
* Merge HandleBlockEnd() and HandleBlockEndByPopUp() into as single block
  end function HandleBlockEnd().
* Replace all instances of HandleBlockEndByPopUp() with HandleBlockEnd().
* Change block hot keys to send command events instead of directly calling
  end block handler.
2013-10-15 12:18:30 -04:00
Maciej Suminski 68e3516075 Hides the GAL subwindow in cvpcb module view frame. 2013-10-15 15:15:29 +02:00
Brian Sidebotham 19ff8e95e5 Temporarily disable Boost.Context library build as it breaks MinGW builds by bringing in a dependency on MASM (The Microsoft Assembler) 2013-10-15 11:42:26 +01:00
Maciej Suminski 4bf49bf6a6 Renamed TOOL_MOUSE_BUTTONS constants to avoid name conflict with Windows MB_RIGHT constant. 2013-10-15 10:41:00 +02:00
Maciej Suminski 0e377e43cc Merge 2013-10-14 20:41:56 +02:00
Maciej Suminski f9f23806ed Mainly case changes. 2013-10-14 20:40:36 +02:00
Dick Hollenbeck 3569e16519 Planning for PCB_BASE_FRAME::Save_Module_In_Library and PCB_EDIT_FRAME::ArchiveModulesOnBoard rewrites 2013-10-14 11:54:00 -05:00
jean-pierre charras 2a40ddd5f9 Pcbnew: Fix issue when displaying net names and/or pad numbers including the "<" char in drc dialog, because drc dialog uses an wxHtmlWindow to display drc messages, and the "<" char has a special meaning and is not allowed in texts (now replaced by the" &lt;" sequence in messages displayed in html)
Eeschema: replace "<" and ">" by "(" and ")" in autogenerated net names, to avoid other issues in html messages.
Very minor other fixes.
2013-10-14 18:03:38 +02:00
Wayne Stambaugh efcd8987d9 Fix Pcbnew block rotate hot key and minor code cleaning. 2013-10-14 11:29:16 -04:00
Maciej Suminski e66a4ce337 Namespace KiGfx->KIGFX.
template<> -> template <>
Some more reformatting according to uncrustify results.
2013-10-14 16:13:35 +02:00
Maciej Suminski 6d19d7c257 Fixed unnecessary comment 2013-10-14 14:45:01 +02:00
Maciej Suminski 988aee863c Fixed unnecessary comment 2013-10-14 14:42:35 +02:00
Maciej Suminski 8253899a70 Converted tabs to spaces. Removed trailing whitespaces. 2013-10-14 13:43:57 +02:00
Maciej Suminski 4edca43531 Merged 'development' 2013-10-14 11:41:43 +02:00
Maciej Suminski a876fc788d Merged 'testing' 2013-10-14 11:40:14 +02:00
Maciej Suminski cc79e5ca83 Added error messages for OpenGL framebuffer errors. This should eliminate quiet segfaults in case of drivers that cannot handle multiple attachment points for framebuffers. 2013-10-14 11:39:21 +02:00
Maciej Suminski 8aeb204c8a Marked pnsrouter as dependent on boost 2013-10-14 08:37:58 +02:00
Wayne Stambaugh db73939504 Fix bug when creating initial global footprint library table on Windows. 2013-10-13 20:14:52 -04:00
Dick Hollenbeck de90187eb0 *) Switch over to FP_LIB_TABLE::Footprint*() functions.
*) Set environment variable KISYSMOD before loading FP_LIB_TABLE so that
   FP_LIB_TABLE::ROW::SetFullURI() can do substitution up front.
*) De-emphasize the lib path in some of the footprint frames but keep it
   so the footprint editor can export a current library to another.
   You can even export a GITHUB library to a pretty library for local 
   installation.
*) Start the PLUGIN options editor.
*) Enhance cursor positioning in DIALOG_FP_LIB_TABLE.
2013-10-13 16:33:58 -05:00
jean-pierre charras 8aa809d2bc specctra_export.cpp: fix a bug in my export function to 3D viewer which generates bad shapes for holes generated by outlines
inside the main board outlines.
specctra_export.cpp: always approximate arcs in outlines by 36 segm for 360 degrees,
even for arc angle which differs from 90 degrees.
90 degrees is the default when creating an arc, but the arc value can be edited and have any value between 0 and 360 degrees.
Previously, 9 segments were used regardless the arc angle.
2013-10-13 18:47:11 +02:00
Wayne Stambaugh 9e28d91879 Footprint library table improvements.
* Add save table and set project path environment variable code to
  FP_LIB_TABLE object.
* Add code to Pcbnew and CvPcb to set project path environment variable.
* Create empty footprint table in Pcbnew when new board created.
* Save current project specific footprint library table to path on file save
  as or empty project path.
* Fix a bug in Pcbnew in file save function that would silently overwrite
  an existing board file.
* Disable selecting the current library in the module editor when there are
  no libraries defined.
* Catch exceptions and report errors when writing footprint library tables.
* Fix Boost build CMakeFile to fix bug when bootstrapping a Boost build in
  MSys.
2013-10-13 12:29:20 -04:00
jean-pierre charras 2e89516b6e Remove wxUSE_UNICODE definition from CMakeLists.txt, because this define comes from wxWidgets and should not be made inside kicad
Remove KICAD_GOST option because it is  now useless: the 2 GOST options are now selectable at run time and are:
* specific page layouts (now user definable, and the GOST page layouts are available in template folder)
* notation for multiple parts per package (made in eeschema, preference menu)
2013-10-11 18:24:43 +02:00
Maciej Suminski f690b8e505 Fixed IDs for the push and shove router menu 2013-10-11 14:26:09 +02:00
Maciej Suminski 5964e4c332 Removed unused variable. 2013-10-08 10:17:49 +02:00
Brian Sidebotham 6033b200e6 * Fix building of Github plugin support for Windows using Mingw-w64
* Pre-built binaries for OpenSSL can be used from the LuaDist project: https://github.com/LuaDist/openssl/releases
* Building of Boost libraries fixed for Mingw-w64 for github plugin
2013-10-07 20:49:44 +01:00
jean-pierre charras 0ee33d34f2 3D-viewer: minor fixes and enhancements 2013-10-07 18:39:39 +02:00
jean-pierre charras 44cb99f663 3D-viewer: minor fixes and enhancements 2013-10-07 16:50:23 +02:00
jean-pierre charras 99170bc25b Pcbnew: 3D view: Better 3D rendering (fix some artifact issues). Add a realistic rendering mode. 2013-10-07 13:51:08 +02:00
Wayne Stambaugh 07640b1961 Fix footprint library editor bug.
* Don't convert footprint library path to wxFileName.  This removes a '/'
  from the GIT_HUB_PLUGIN uri which causes wxUri to choke and the incorrect
  plug in is selected.
2013-10-05 19:41:40 -04:00
Dick Hollenbeck e5cb41601e FP_LIB_TABLE::ROW::SetFullURI() does environment variable substitution up front.
We can now remove a few calls to FP_LIB_TABLE::ExpandSubstitutions( const wxString& aString )
since its being done in above function.

DIALOG_FP_LIB_TABLE now handles table to copy cut copy paste from global to
project and reverse.  Fixed a problem with cursor position management when
switching between tables.
2013-10-05 05:34:55 -05:00
Dick Hollenbeck f9d8e64a31 Put FP_LIB_TABLE::Footprint*() functions on stage, but comment out lazy plugin lookup trick in FindRow() until these new API functions are used. 2013-10-04 23:53:15 -05:00
Dick Hollenbeck 7bfdb82225 DIALOG_FP_LIB_TABLE: disable row resizing, get rid of tooltips on grids 2013-10-04 23:41:15 -05:00
Dick Hollenbeck 04aefeae55 AutoSizeColumns(), and search for "(fp_lib_table" not "(fp_lib_table " 2013-10-04 23:21:58 -05:00
Dick Hollenbeck d6cad30c9f FP_LIB_TABLE::ROW::SetType() ensures sensible value of "KiCad" if nothing good comes in. 2013-10-04 17:40:25 -05:00
Dick Hollenbeck 28358306e1 Add keyboard support to DIALOG_FP_LIB_TABLE grid interface:
CTL+X, CTL+V, CTL+A, CTL+C
2013-10-04 17:23:53 -05:00
Dick Hollenbeck 5539a982b5 CTL_OMIT_PATH patch 2013-10-04 17:23:04 -05:00
Dick Hollenbeck ed22433178 Rebase a subset of Footprint*() PLUGIN API onto FP_LIB_TABLE 2013-10-04 14:09:10 -05:00
Dick Hollenbeck 127876bd1b Fix FP_LIB_TABLE::ROW operator=(), was not copying "description" field.
Remove tooltips from fp_lib_table wxGrid, were annoying and munging wxGrid's grid.
Change initial size of DIALOG_FP_LIB_TABLE.
2013-10-04 10:58:32 -05:00
jean-pierre charras c5cae05683 3D viewer: Preference menu: fix a bug which displays incorrectly the actual display options state (always shown off) when starting the 3D viewer 2013-10-04 16:52:09 +02:00
jean-pierre charras 2f3cbdd7c5 3D board display: better rendering of the board: the board polygon outlines (generated by the specctra function which calclaltes outlines) is now used to create the 3D body of the board,
in pcbnew and cvpcb.
2013-10-04 16:32:59 +02:00
jean-pierre charras 9c682e2cc0 Fix Cmakelists issues 2013-10-04 14:48:50 +02:00
jean-pierre charras f31dfd49d9 Move specctra.cpp, specctra_import.cpp and specctra_keywords.cpp compilation to pcbcommon lib because they containt functions used by the 3D viewer in Cvpcb and Pcbnew. 2013-10-04 14:22:33 +02:00
jean-pierre charras 731b356c95 3D board display: better rendering of the board: the board polygon outlines (generated by the specctra function) is now used to create the 3D body of the board. 2013-10-04 10:42:09 +02:00
Brian Sidebotham 6d48a01801 Removed some Microsoft Visual C centric definitions in CMakeModules/config.h.cmake which were tripping up the mingw-w64 build 2013-10-03 23:53:42 +01:00
Dick Hollenbeck 3ec06fa3cc DIALOG_FP_LIB_TABLE does not use wxSplitterWindow, it would not obey.
Paste popup menu in this dialog now allows pasting a (fp_lib_table)
s-expression element holding (lib) elements.  This provides an 
opportunity for GITHUB library publishers to put the table description
into their README.md file as a (fp_lib_table) element where it can
be quickly copied to clipboard and pasted into the fp lib table dialog.
This is a paste operation, and overwrites from the initial cursor position.
2013-10-03 17:12:56 -05:00
Dick Hollenbeck 5a1d4ad491 if https:// GET fails, report the URL 2013-10-03 10:12:25 -05:00
Dick Hollenbeck 581d67177d throw better IO_ERROR message on bad GITHUB URL, improved formatting and comments. 2013-10-03 08:40:00 -05:00
Dick Hollenbeck ac6347fece fix: https://answers.launchpad.net/kicad/+question/233824 2013-10-02 15:25:44 -05:00
Maciej Suminski ebb42aa419 Renamed WORKSHEET_ITEM to WORKSHEET_VIEWITEM. 2013-10-02 14:26:14 +02:00
Maciej Suminski 8223f9742e Fixed memory leak caused by ViewUpdate() with VIEW_ITEM::GEOMETRY/LAYER parameters. 2013-10-02 13:57:21 +02:00
Maciej Suminski dfdacba649 Worksheet is not selectable anymore. 2013-10-02 12:02:25 +02:00
Maciej Suminski eeeffd1ad1 Removed SELECTION layer. 2013-10-02 11:39:08 +02:00
Maciej Suminski 93fc797b2e Added missing ViewUpdate flag 2013-10-02 11:25:04 +02:00
Maciej Suminski 094d6de8e0 Fixed reset for the selection tool. 2013-10-02 11:21:17 +02:00
Maciej Suminski 3d9fc4c40f Moved VIEW_GROUP creation to the selection tool. In this way selected items are always drawn on overlay, not only when dragged. 2013-10-02 10:21:05 +02:00
Maciej Suminski 3cdc207b50 Added typedefs for VIEW_GROUP iterators. Fixed improper order of layer drawing for VIEW_GROUP items. 2013-10-02 10:19:48 +02:00
Maciej Suminski 5acd895e0d VIEW_GROUP now does not change depth during drawing. Introduced functions for manipulating stored items.
FIxed problem of overlay being covered by other layers while panning.
Few minor fixes.
2013-10-01 16:55:33 +02:00
Maciej Suminski 3715af2172 Comments, refactoring 2013-10-01 10:21:32 +02:00
Dick Hollenbeck be4d7a6249 Make environment variable wxGrid/table read-only in the fp lib table dialog.
Fix throwing of IO_ERROR in plugin.cpp by converting function name to wxString.GetData().
Switch to const PROPERTIES* in GITHUB PLUGIN functions.
2013-09-30 16:26:49 -05:00
Maciej Suminski 04db1ff7cb Added missing file 2013-09-30 16:28:21 +02:00
Maciej Suminski 5f1a04cfa0 Fixed Mac OS build & removed one warning. 2013-09-30 09:45:42 +02:00
jean-pierre charras 4783e22fdc Gerbview: fix incorrect printing of negative objects, when using black and white option
Enhancement in Excellon file reader: accept Feed Rate and Spindle Speed definitions in Tool information line (but does not use them)
Eeschema: better name for m_SheetList (changed to m_SheetPath) member of class NETLIST_OBJECT.
2013-09-30 08:36:40 +02:00
Maciej Sumiński db4903cdc4 Restored previous version of math_utils.h. WARNING: Mac OS build is probably broken now. 2013-09-29 21:29:28 +02:00
Maciej Sumiński 248e37c292 Fixed selection disambiguation menu for wx2.8 2013-09-29 21:23:45 +02:00
jean-pierre charras 8a8ba43bde Gerbview: fix incorrect printing of negative objects, when using black and white option.
Eeschema: better name for m_SheetList (changed to m_SheetPath) member of  class NETLIST_OBJECT.
2013-09-29 20:24:38 +02:00
Maciej Sumiński 5c0bc4913e wxWidgets 2.8 compatibility fix (removed wx/kbdstate.h) 2013-09-29 14:25:04 +02:00
Maciej Sumiński ca84ed7e63 Fixed menu entry ids for the p&s router context menu. 2013-09-29 13:56:32 +02:00
Maciej Sumiński a64fb40d7e Fixed strings for wxWidgets 2.8 2013-09-29 12:57:20 +02:00
Wayne Stambaugh d11102c643 Fix wxWidgets 2.8 compile error. 2013-09-28 18:53:55 -04:00
Maciej Suminski 745b5328eb Moved common actions to a separate file. 2013-09-27 20:52:34 +02:00
jean-pierre charras 5fefc74da4 Eeschema: fix isssues in net names selection for not named nets (i.e. nets without labels) 2013-09-27 19:58:58 +02:00
Maciej Suminski a3a73426bf Even more code comments and reformatting. 2013-09-27 18:51:21 +02:00
Maciej Suminski 276d867ab2 Some more comments and code formatting. 2013-09-27 16:23:43 +02:00
jean-pierre charras 49b6a1725f Eeschema: netlist generation: fix bad choice for the "best net name" when selecting a net name between labels connected to the same net.
Code cleanup and remove unused file.
2013-09-27 14:30:35 +02:00
Maciej Suminski 4c67f4cc26 Added missing header 2013-09-27 14:29:07 +02:00
Maciej Suminski b369cc4afc Merge kicad-pns-mac 2013-09-27 12:06:59 +02:00
Maciej Suminski 52a7f3e2dc Uncrustified the push&shove source, fixed some warnings. 2013-09-27 10:00:26 +02:00
Maciej Sumiński 85d1048762 Uncrustifying push&shove router 2013-09-26 23:53:54 +02:00
Wayne Stambaugh 8b80c79feb Footprint viewer improvements and code cleaning.
* Use wxAuiManager perspective to save and load window settings which should
  allow us to start using more advanced wxAui features like detachable tool
  bars and windows.
* Remove sash size change events, event handler, and sash width clamping code
  since it didn't work all that well anyway.
* Disable the close button on the footprint view pane.
* Update the footprint list box selection when iterating the list using the
  tool bar arrow buttons.
* Merge code from modview.cpp into modview_frame.cpp and remove modview.cpp.
2013-09-26 13:22:35 -04:00
Maciej Suminski 9bef4cb797 Added Init() to TOOL_INTERACTIVE, allowing to set up things that are needed to be initialized only once.
TOOL_ACTIONs can be run from CONTEXT_MENU after adding them.
Move tool actions are available to be run from CONTEXT_MENU displayed after right mouse button click on selected items.
Added some asserts to check the code.
2013-09-26 18:38:58 +02:00
Dick Hollenbeck 39edd3bdcd comment/doc cleanups 2013-09-26 10:02:46 -05:00
Maciej Suminski b4585ce13a Fixed premature highlighting of options in CONTEXT_MENU. 2013-09-26 14:29:47 +02:00
Maciej Suminski e47790c3f8 Different way of handling CONTEXT_MENU in the selection tool. Removed some unnecessary lines. 2013-09-26 14:09:56 +02:00
Maciej Suminski 5098088237 Added functions for handling hotkeys, interface for adding TOOL_ACTIONs to CONTEXT_MENU.
Less objects are allocated dynamically.
CONTEXT_MENU is being run using its copy (it saves a hassle of following the lifetime of object).
2013-09-26 14:09:18 +02:00
Maciej Suminski b1c0d614a3 Added some const modifiers. 2013-09-26 11:22:59 +02:00
Dick Hollenbeck 66c9d29539 Make pretty prettier by striving for single line module pads. Add slick std::string based strprintf(), twice. 2013-09-26 00:29:54 -05:00
jean-pierre charras 655c8e609d Eeschema: Rework on netlist generator: code cleaning and enhancement.
Mainly, fix an annoying issue about not named nets:
now, these nets are named from the component references and pin names which are connected.
therefore, unless the net or the footprint references are modified, the net name is not modified between 2 netlist calculations.

Netlist generation code still needs some code enhancement (mainly removing the global g_NetObjectslist variable).
2013-09-25 21:37:28 +02:00
Dick Hollenbeck 948a0713d5 Make PLUGIN::Footprint*() API functions take 'const' PROPERTIES*.
Add const PROPERTIES* to FootprintDelete().
Add {Get,Set}Properties() to FP_LIB_TABLE::ROW.
Touch up fp table dialog.
2013-09-25 14:17:06 -05:00
jean-pierre charras b43d883db6 Eeschema: Rework on netlist generator: code clenenig and enhancement.
Fix an annoying issue about not named nets:
now, these nets are named from the component references and pin names which are connected.
therefore, unless the net or the footprint references are modified, the net name is not modified between 2 netlist calculations.
2013-09-25 21:09:57 +02:00
Wayne Stambaugh 73367a10ea Fix debug build error in pcbnew/dialogs_fp_lib_table.cpp. 2013-09-25 09:51:54 -04:00
Dick Hollenbeck b9eba042c0 turn off new linker map generation in pcbnew 2013-09-24 16:26:23 -05:00
Dick Hollenbeck 17a33166a4 Set PROPERTIES* into FP_LIB_TABLE::ROW, which is a parsed (binary) form of the 'options'.
Write parser and formatter for options.  Write dialog verification used before saving
FP_LIB_TABLEs, triggered from OK button in table editor.
Switch PROPERTY's value column to std::string from wxString.
Add event handler to fp lib table dialog for upcoming options dialog.
2013-09-24 16:23:13 -05:00
Wayne Stambaugh ffbaf87dc9 Pcbnew footprint library plug in fixes and minor code cleaning.
* When loading footprint do not retest every footprint in cache.  Only test
  the footprint being loaded.  Fixes long load times on libraries with a lot
  of parts.
* Fix footprint name bug where file extension was added to the end of the
  footprint name.
* Fix bug in path equivalence test due to Posix path separators in footprint
  library table.  Convert paths to native separator before comparison.
* Fix a bug in FOOTPRINT_VIEWER_FRAME::OnActivate() which cause the footprint
  list to always get reloaded when using footprint library tables.
* Remove some unnecessary debugging messages.
* Add a few Doxygen comments to FP_CACHE in kicad_plugin.cpp.
2013-09-24 14:45:57 -04:00
Maciej Suminski 8ea74c38c3 Fixed cvpcb build. 2013-09-24 16:12:02 +02:00
Maciej Suminski 5789f20794 Added protection from redrawing while GAL backend is being switched. 2013-09-24 16:00:21 +02:00
Maciej Suminski 133e60410c Added rotate & flip to the pcbnew.InteractiveMove tool, hotkeys for them and undoing all the operations on cancelling the tool. 2013-09-24 15:49:43 +02:00
Maciej Suminski 57a8622e9a Added functions for refreshing the layer set occupied by a VIEW_ITEM. 2013-09-24 15:48:04 +02:00
Maciej Suminski 634039d81a Added possibility to cancel a tool that is not on the top of the tool stack. 2013-09-24 15:47:07 +02:00
Dick Hollenbeck b9c9990bdb Set FPID on GITHUB_PLUGIN::FootprintLoad() 2013-09-23 10:57:15 -05:00
Dick Hollenbeck 1e31e737f5 GITHUB_PLUGIN now builds under the scripting DSO on linux.
Enhance IO_MGR::GuessPluginTypeFromLibPath() to support the GITHUB plugin.
Build boost with -fPIC on Linux unconditionally, in preparation for
DLL/DSO build of kicad.
Add python script to test back to back reads of GITHUB plugin.
2013-09-23 10:19:39 -05:00
Maciej Suminski 5e3f579431 Fixed build for Mac OS 2013-09-23 17:02:25 +02:00
Maciej Suminski e9e4df8d01 FIxed TOOL_EVENT::Modifier() (now it returns value for current modifier, not only if there is one active or not). 2013-09-23 10:02:01 +02:00
Wayne Stambaugh a3cdc4fb83 Pcbnew footprint library table fixes.
* Make footprint editor work properly with library table.
* Fix bug in Eagle plugin when comparing file timestamps.
* Fix bug in footprint viewer when error occur loading footprints from
  the selected library.
* Fix error message display by in footprint viewer on library load error.
2013-09-22 13:20:46 -04:00
Dick Hollenbeck c034e5922f unique FPL_CACHE class names 2013-09-21 23:38:22 -05:00
Dick Hollenbeck 3d8d726a52 GITHUB_PLUGIN now works and can be used under Linux immediately.
Other platforms to follow as volunteers test support and get openssl in 
place.
2013-09-21 22:57:40 -05:00
Dick Hollenbeck 1b09ac4757 OOPS, add missing file for Windows GITHUB_PLUGIN 2013-09-21 22:24:11 -05:00
Wayne Stambaugh f7012d8275 Pcbnew footprint library table fixes.
* Make footprint viewer work properly with library table.
* Fix bug in Eagle plugin when enumerating footprints.
* Add missing P-CAD plugin from footprint library table editing dialog.
* Fix bug in FOOTPRINT_INFO::LoadLibraries when error occur loading footprints
  from libraries.
2013-09-21 20:28:02 -04:00
Build System e61950267b Fixes typo in doxygen-python, and fixes unitest TestCase().discover on python < 2.7 2013-09-22 02:34:15 +04:00
Miguel Angel Ajo 4c9ff08f4f missing QA tests for the python scripting QA 2013-09-22 00:27:41 +02:00
Miguel Angel Ajo 8668488a20 scripting QA tests, initial implementation 2013-09-22 00:04:59 +02:00
Miguel Angel Ajo 31f8dc5cbf Scripting build tools moved and renamed 2013-09-22 00:03:02 +02:00
Dick Hollenbeck a477129bc1 BUILD_GITHUB_PLUGIN will build GITHUB_PLUGIN on Linux now. Don't know if the parser works yet, but the FootprintEnumerate() function worked in testing. 2013-09-21 14:20:31 -05:00
jean-pierre charras c46b8aecbc Pcbnew: Block selection enhancement, from Bug #593997 (whishlist)
1. block created from-left-to-right selects only 100%inside selection objects (as it now does)
2.block created from-right-to-left selects all overlapping objects inside selection
From the patch sent by mathieulj (mathieulj), and some fixes and code cleaning.
2013-09-21 20:09:41 +02:00
jean-pierre charras a010b6177c Fix some minor issues in hotkey dialogs 2013-09-21 19:09:08 +02:00
Dick Hollenbeck d38b7012e9 temporarily disable GITHUB_PLUGIN 2013-09-21 11:07:26 -05:00
Dick Hollenbeck 6a6152eb0a temporarily disable GITHUB_PLUGIN 2013-09-21 11:06:15 -05:00
Dick Hollenbeck 15121e6d4e BUILD_GITHUB_PLUGIN issues. 2013-09-21 09:48:37 -05:00
Dick Hollenbeck a8e44d0093 remove some headers, no good for my head 2013-09-21 02:45:25 -05:00
Dick Hollenbeck fd8f74cf43 Early GITHUB_PLUGIN hopefull-ness 2013-09-21 02:30:23 -05:00
Build System 472e4da100 Adds target to build doxygen-python documentation, that take
pcbnew.py + doxygen-xml files, and build .i files with docstrings,
those .i files are included back again to build a pcbnew.py with
extended documentation from C++, finally we take the final pcbnew.py
to build the doxygen-python documentation
2013-09-20 21:01:21 +04:00
Maciej Suminski 607fe8ed4b Added missing files 2013-09-20 18:21:01 +02:00
Maciej Suminski a0a479eb53 Merged upstream. 2013-09-20 17:54:35 +02:00
Maciej Suminski 04cdb15ceb Changed the way of refreshing canvases (both standard & GAL). 2013-09-20 17:29:32 +02:00
Dick Hollenbeck 180e0a3645 BOM generators now report count of "interesting" components, rather than total components 2013-09-20 10:11:45 -05:00
Maciej Suminski c931800642 Restored previous function names. 2013-09-20 16:32:11 +02:00
Maciej Suminski e839d1a129 Merged kicad-gal 2013-09-20 15:48:27 +02:00
Maciej Suminski 1efec52b33 Added cursor for the move tool 2013-09-20 15:01:08 +02:00
jean-pierre charras 3799481c35 Pcbnew: better dialogs to select the active layer or a layer pair. Add an option (hotkey+popup menu) to place a via and select the new active layer
(useful for boards having more than 2 layers)
Eeschema:fix compatibility with old schematic files, when they  contain ERC markers.
Pcbnew: better test for allowed layers when creating/editing Dimensions and some other Graphic items
Drc:  fix comments and messages for some drc tests.
Fix minor bugs in cleanup dialog options and plot solder mask function (thanks to Lorenzo to locate these bugs)
2013-09-20 12:52:33 +02:00
Dick Hollenbeck c1025612d1 Lorenzo's help enabled a fix to UTF8 support in csv.writer in python bom generators. 2013-09-19 18:50:30 -05:00
Maciej Suminski e07a8fbe31 Removed TA_ActivateTool (now tools are invoked by sending TA_Action event, with the tool name as string parameter).
Developed TOOL_Action class & added ActionManager. Hot keys registered by tools are processed.
Selection & move tool can be invoked by a hot key.
2013-09-19 17:02:57 +02:00
Maciej Suminski 2d52cb1d55 Moved GalLayersOrder from layers_id_colors_and_visibility.h to PCB_BASE_FRAME. 2013-09-19 09:55:37 +02:00
Maciej Suminski a1cdbe5762 Merged kicad-pns-tom. 2013-09-19 09:33:07 +02:00
jean-pierre charras 2f3bbf1f59 Fix minor bugs in cleanup dialog options and plot solder mask function (thanks to Lorenzo to locate these bugs) 2013-09-18 21:22:25 +02:00
jean-pierre charras 7ceb13d041 Fix minor bugs in cleanup dialog options and plot solder mask function (thanks to Lorenzo to locate these bugs) 2013-09-18 21:21:11 +02:00
tomasz.wlostowski@cern.ch d04d93eb9b A very short insturction for the P&S Router. 2013-09-18 20:11:21 +02:00
tomasz.wlostowski@cern.ch f6a3bc9168 Merged Orson's latest changes. 2013-09-18 20:10:55 +02:00
tomasz.wlostowski@cern.ch dca79490da P&S router: some missing files 2013-09-18 19:56:37 +02:00
tomasz.wlostowski@cern.ch abf37168de Initial version of the P&S router. Buggy and crappy. 2013-09-18 19:55:16 +02:00
Maciej Suminski 67fadf0c94 Added missing files 2013-09-18 19:51:57 +02:00
tomasz.wlostowski@cern.ch 1b29805fc9 geometry/rtree.h: fix compiler warnings 2013-09-18 19:37:56 +02:00
Maciej Suminski fcd3bbecdf Added limits for VIEW scale values & panning area. 2013-09-18 17:36:54 +02:00
Maciej Suminski 3d767ffcc7 Moved Type() method from EDA_ITEM to VIEW_ITEM. 2013-09-18 17:04:07 +02:00
Maciej Suminski f88711ebf9 Merged Tom's branch 2013-09-18 16:59:08 +02:00
tomasz.wlostowski@cern.ch 17cd564ba6 PCB_EDIT_FRAME: public SetTopLayer() method 2013-09-18 13:37:20 +02:00
tomasz.wlostowski@cern.ch 8bb3bba7e8 PCB_PAINTER: fix segfault when item has no net assigned 2013-09-18 13:16:57 +02:00
tomasz.wlostowski@cern.ch 5d3dda7a9d VIEW_CONTROLS: added ForceCursorPosition() and ShowCursor() methods 2013-09-18 13:15:42 +02:00
Wayne Stambaugh 5761c182ee Fix std::string to wxString conversion bug in Pcbnew. (fixes lp:1226670) 2013-09-18 07:15:17 -04:00
tomasz.wlostowski@cern.ch 0e23e23a7c VIEW: added GetTopLayer() method 2013-09-18 13:14:57 +02:00
tomasz.wlostowski@cern.ch e2736f4db1 geometry: killed compiler warnings 2013-09-18 13:14:13 +02:00
tomasz.wlostowski@cern.ch 1ea78293d0 gal: make the cursor a bit bigger and hidden by default 2013-09-18 13:13:03 +02:00
Wayne Stambaugh df0a195f38 Fix two more FPID empty string parsing bugs. 2013-09-17 11:51:05 -04:00
Wayne Stambaugh b00d23c46c Fix board parsing error when module name is empty. (fixes lp:1226546) 2013-09-17 10:03:16 -04:00
Maciej Suminski ed4966a3ff Fixed random color of worksheet border. 2013-09-17 14:46:48 +02:00
Maciej Suminski b03359a3db The last fix to selection rules. 2013-09-17 13:47:33 +02:00
Maciej Suminski d4e07e981a Selection in high contrast mode selects only items that are shown as active. 2013-09-17 11:32:47 +02:00
Maciej Suminski 2d097d0fd7 Selection box color is put into render settings. Selection layer is removed from active layers. 2013-09-17 11:23:00 +02:00
Maciej Suminski 278b4547f4 Modules are marked to be on copper layer too. 2013-09-17 11:21:42 +02:00
Maciej Suminski ee84127892 Added get functions for high contrast mode fields. 2013-09-17 11:19:15 +02:00
Wayne Stambaugh 3724c40afd Fix but reading empty footprints in netlist. (fixes lp:1226283)
* Remove fp_lib token from board and s-expr netlist file format.
* Fix a bunch of Doxygen warnings.
* Remove some extra debug log messages.
2013-09-16 20:52:08 -04:00
Wayne Stambaugh eaada4cf1f Fix broken CvPcb footprint preview. (fixes lp:1226272) 2013-09-16 19:56:45 -04:00
Maciej Suminski 033b25de32 Reenabled snapping for tools. 2013-09-16 16:46:02 +02:00
Maciej Suminski 32a12d1d6f Unified marking of selected items. 2013-09-16 16:18:43 +02:00
Maciej Suminski fe27b0e2ba Changed to worksheet border color to match the rest of the worksheet layout. 2013-09-16 15:19:48 +02:00
Maciej Suminski 66fcd4c5a2 Fixed bounding box for dimension. 2013-09-16 14:44:03 +02:00
Maciej Suminski ccdeb6dc0a More careful check on the net number while drawing net labels for tracks. 2013-09-16 11:08:31 +02:00
Maciej Suminski b579262869 Better way of marking 'brightened' mode for items. 2013-09-16 11:00:59 +02:00
Maciej Suminski 11f1dd1623 Sorted out headers. 2013-09-16 09:52:47 +02:00
Maciej Suminski 6a9a25fc54 Fixed drawing outlined track segments. 2013-09-16 09:51:53 +02:00
Maciej Suminski ef47f6cfd2 Changed alignment. 2013-09-16 09:51:24 +02:00
Wayne Stambaugh cecd75063e CvPcb footprint library table implementation.
* Add code to CvPcb to handle assigning component footprints from the
  footprint library table instead of the search path method.
* Add code to CvPcb to allow editing of the footprint library table.
* CvPcb footprint and component panes display fully qualified FPID names.
* Make CvPcb library pane display footprint library table nicknames instead
  of library file names.
* Add code to FP_LIB_TABLE object to test the paths in the table against the
  list of libraries loaded from the project file.
* Add code to FP_LIB_TABLE to convert assigned footprints in a NETLIST from
  legacy format to footprint library table format.
* Split out COMPONENT_NET, COMPONENT, and NETLIST objects from netlist_reader
  files and create new pcb_netlist files.
* Fix minor wxListView scroll bar sizing issues.
* Add new token and code to save and load FPID nickname in board file.
* Add new token and code to save and load FPID nickname in s-expression net
  list file.
* Add WX_STRING_REPORT object to dump strings to a wxString object.
2013-09-14 16:33:22 -04:00
Maciej Suminski 6dad482efa Added more required layers for pads (adhesive, solder paste & solder mask) 2013-09-13 17:45:40 +02:00
tomasz.wlostowski@cern.ch 4aae4489b9 Merged Orson's branch 2013-09-13 15:45:03 +02:00
tomasz.wlostowski@cern.ch 1b00dede02 geometry: r-tree based shape index 2013-09-13 15:43:33 +02:00
Maciej Suminski 5700075b7a Added missing functions for checking type of keyboard event 2013-09-13 15:31:19 +02:00
Maciej Suminski 5a461f5bb3 Caps for lines are drawn only when segments are wider than 1.0 2013-09-13 15:30:45 +02:00
tomasz.wlostowski@cern.ch a6cbdccadc common/profile.h: fix incorrect #endif 2013-09-13 15:28:51 +02:00
tomasz.wlostowski@cern.ch b662a577ea polygon: added poly2tri library.
Requied for constrained Delaunay triangulation (P&S/ratsnest) and zone tesselation (GAL).
2013-09-13 15:28:20 +02:00
tomasz.wlostowski@cern.ch 128b1a423f SEG: added SquaredLength() method 2013-09-13 15:25:03 +02:00
Maciej Suminski 5e41599d13 Removed unnecessary debug message 2013-09-13 15:05:57 +02:00
Lorenzo Marcantonio 2cab94f56c Add missing file 2013-09-13 12:59:47 +02:00
jean-pierre charras eedd673d4c Pcbnew: Fix Bug #1224656 2013-09-13 11:58:51 +02:00
jean-pierre charras 25ffde5a42 Add export netlist IPC-D-356 from Lorenzo Marcantonio, with very minor fixes. 2013-09-13 11:57:31 +02:00
Lorenzo Marcantonio l.marcantonio@logossrl.com a06134cd6c Add export netlist IPC-D-356 from Lorenzo Marcantonio, with very minor fixes. 2013-09-13 11:49:55 +02:00
Maciej Suminski fa57fee9bb Removed VIEW_LAYER.isDirty flag. 2013-09-13 11:38:16 +02:00
Maciej Suminski 404bfdcf30 Changed VIEW::PrepareTargets() to more appropriate name VIEW::ClearTargets(). Added SELECTION layer to always-on-top list. 2013-09-13 11:28:47 +02:00
Maciej Suminski 87d81a6d92 Mouse movement events are sent during autopanning, as the cursor position changes in the world coordinates (even if it stays still in the screen coordinates). It allows tools to update their state, as if the mouse was moved. 2013-09-13 10:26:08 +02:00
Maciej Suminski 7d41dc1616 Currently selected layer is displayed on the top. 2013-09-12 18:24:53 +02:00
Maciej Suminski c1e1502d35 Merged Tom's branch 2013-09-12 17:42:28 +02:00
tomasz.wlostowski@cern.ch 73949712f6 added note why there's no P&S sources yet... 2013-09-12 11:49:24 +02:00
tomasz.wlostowski@cern.ch 61778974a4 EDA_DRAW_PANEL_GAL: redraw stuff in a single place, with "coalescing"
Redraws can be requested way too often than it is required. This commit adds redraw timeout:
- if the view became dirty and there has been no redraw for longer than certain time, it is redrawed immediately
- otherwise, we wait for the next frame

This in general improves smoothness of rendering.
2013-09-12 11:40:16 +02:00
tomasz.wlostowski@cern.ch c817deb652 CONTEXT_MENU: null pointer check bugfix. 2013-09-12 11:36:19 +02:00
tomasz.wlostowski@cern.ch 802a0117a7 COLOR4D: added Saturate(), FromHSV(), ToHSV() methods.
Used in highlighting/routing code.
2013-09-12 11:35:42 +02:00
Maciej Suminski 9b2a450133 Fixed rollback of traces movement. 2013-09-12 10:54:11 +02:00
Maciej Suminski fcfbe920d5 Removed selection disambiguation in case when there is a choice between a footprint and a smaller component (smaller components have priority). 2013-09-12 10:46:22 +02:00
Maciej Suminski b57331f450 Move tool is activated when drag event starts nearby selected items. 2013-09-12 10:24:23 +02:00
Maciej Suminski 944a61100b Fixed memory leaks in containers. 2013-09-12 09:44:57 +02:00
Maciej Suminski f8ae1a9997 Removed some potential memory leaks. 2013-09-11 19:37:52 +02:00
jean-pierre charras 8ea015aaab Eeschema: fix compatibility with old schematic files, which can contain markers.
Pcbnew: better test for allowed layers when creating/editing Dimensions and some other Graphic items
Drc: fix comments and messages for some drc tests.
To do: fix issues in active layer selection when creating a track and layer pair selection dialog
2013-09-11 17:30:21 +02:00
Maciej Suminski e38019d74e Removed some dead code. 2013-09-11 16:38:40 +02:00
Maciej Suminski 7da892b49a Added drawing of worksheet layout. 2013-09-11 14:42:12 +02:00
Maciej Suminski 60c84abfe4 Changed lifetime of RENDER_SETTINGS (now they are accessible right after PAINTER object is created). 2013-09-11 12:09:22 +02:00
Maciej Suminski efa1ac3807 Moved GetColor() from PAINTER to RENDER_SETTINGS. Fixed recaching of custom items. 2013-09-11 11:39:46 +02:00
Maciej Suminski f6b7ab7994 Changed some 'magic numbers' into constants. Added const modifier in appropriate spots. 2013-09-11 11:34:10 +02:00
Maciej Suminski c0b6d159fc Added one more function to convert colors. 2013-09-11 11:11:27 +02:00
Maciej Suminski fa85685baa Fixed COLOR4D( EDA_COLOR_T aColor ) and added asserts. 2013-09-11 10:30:39 +02:00
tomasz.wlostowski@cern.ch d1883bdd9d Merged kicad-gal-orson 2013-09-10 19:32:19 +02:00
tomasz.wlostowski@cern.ch b4ff4df808 pcbnew: start integrating P&S router 2013-09-10 19:26:44 +02:00
tomasz.wlostowski@cern.ch 3254bfa619 VIEW_GROUP: added FreeItems() method 2013-09-10 19:25:02 +02:00
tomasz.wlostowski@cern.ch bf26cf175f TOOL_MANAGER: open menu on right mouse button when requested 2013-09-10 19:23:15 +02:00
tomasz.wlostowski@cern.ch 2c287965fc TOOL_DISPATCHER: improve mouse handling 2013-09-10 19:22:38 +02:00
Maciej Suminski 4551ded37e Some more missing D()->DBG() changes. 2013-09-10 17:07:46 +02:00
Maciej Suminski b4d05af28f Modified default grid/origin settings. 2013-09-10 14:35:10 +02:00
Maciej Suminski eac742e3db Added const modifiers where applicable. 2013-09-10 14:31:52 +02:00
Maciej Suminski 57a1201b11 PCB items are refreshed on GAL switching (changes made using default renderer are displayed by GAL). 2013-09-10 13:57:28 +02:00
tomasz.wlostowski@cern.ch 85a8a71fc5 common: minimum version of the shape library 2013-09-10 13:43:09 +02:00
Maciej Suminski bd6bb510f8 Changed D() macro to DBG() because of conflict with glm::D().
Added const to GetColor() and GetType() functions in WS_DRAW_ITEM.
2013-09-10 10:47:42 +02:00
Maciej Suminski 0cf8221e62 Fixed hanging up of menu loop when user never moves mouse cursor into popup menu area. 2013-09-09 17:12:03 +02:00
tomasz.wlostowski@cern.ch 36d4e8fa62 PCB_PAINTER: added public GetLayerColor() method 2013-09-09 17:08:52 +02:00
tomasz.wlostowski@cern.ch a384290356 EDA_DRAWPANEL_GAL: set focus on mouse enter to catch all key events 2013-09-09 17:07:03 +02:00
tomasz.wlostowski@cern.ch 8b9226d820 math/vector2d.h: removed unused code, correct rounding in Resize() 2013-09-09 16:56:18 +02:00
tomasz.wlostowski@cern.ch 35e639c599 math/math_util.h: fixed signedness bug in rescale() 2013-09-09 16:55:01 +02:00
tomasz.wlostowski@cern.ch 3a7f5fcf03 math/box2.h: normalize on construction, minor compilation warning fix 2013-09-09 16:53:33 +02:00
Maciej Suminski 881cbd6d2f Small refactoring. 2013-09-09 14:31:27 +02:00
Maciej Suminski b319b710df Fixed color for drawing polygons on overlay. 2013-09-09 14:31:13 +02:00
Maciej Suminski dd1ad34cea Stops autopanning on left mouse button release. 2013-09-09 13:57:56 +02:00
Maciej Suminski 9406893722 Enabled snapping for the move tool. 2013-09-09 11:45:20 +02:00
Maciej Suminski cea4d89697 Tools are enabled to switch snapping cursor to grid. 2013-09-09 10:54:11 +02:00
Maciej Suminski 7bbd31fa2a Modified interfaces for [WX_]VIEW_CONTROLS. 2013-09-09 10:53:46 +02:00
Maciej Suminski c6d9a04dba Parts of MODULEs are not selectable in multiple selection mode. 2013-09-09 10:10:02 +02:00
Maciej Suminski 77fc1aecb2 First version of the move tool. 2013-09-09 09:34:52 +02:00
Wayne Stambaugh 24da541747 Convert footprint definitions from wxString to FPID.
* Use FPID instead of wxString in MODULE object.
* Use FPID instead of wxString when loading and saving files.
* Use FPID in COMPONENT object.
* Add wxString helper functions and comparison operators to FPID.
* Add fp_lib token to pcb and netlist file formats.
* Add code to load and save FPIDs to pcb file format.
* Fix segfault when deleting invalid footprint library tables in Pcbnew
  in non footprint library table build.
* Fix bug when counting the number of mod files in
  EDA_APP::SetFootprintLibTablePath();
2013-09-08 14:31:21 -04:00
Maciej Suminski 02f7e9c800 Changed focus owner of LayerWidget to EDA_DRAW_PANEL_GAL to make keyboard events work (apparently everything works fine, to be tested more extensively).
Removed unnecessary event hook from EDA_DRAW_PANEL_GAL.
2013-09-06 17:53:01 +02:00
Maciej Suminski cbbc2f42e8 Starts the GAL by default. 2013-09-06 17:06:33 +02:00
Maciej Suminski 7e73dad7b0 Some more spots where the GAL refresh was required. 2013-09-06 17:06:02 +02:00
Maciej Suminski bc67fc338e Smarter selection algorithm (does not allow to select both whole MODULE and its parts at the same time).
Cancel event works better (selection box does not appear after cancelling the selection tool).
Removed blinking selection box effect.
Model is accessed in more appropriate way (getModel() method).
2013-09-06 16:04:12 +02:00
Maciej Suminski 6054e7be0a Added a few comments. 2013-09-06 16:01:46 +02:00
Wayne Stambaugh a7f31c59a8 Footprint library table ground work.
* Remove defined CMAKE_INSTALL_PREFIX for Windows from main CMakeList.txt.
* Move footprint library path detection code from pcbnew.cpp to EDA_APP
  object.
* Add CMAKE_INSTALL_PREFIX to config.h.cmake.
* Simplify and fix search path list code.
* Add CMAKE_INSTALL_PREFIX to the list of search paths in case KiCad was
  installed using `make install`.
* Add default global footprint library table to CMake install.
* Add method to set footprint library table to PCB_BASE_FRAME object.
* Remove unused function EDA_APP::GetLibraryFile().
* Minor FP_LIB_TABLE object improvements.
2013-09-06 08:17:33 -04:00
Maciej Suminski 345e97f296 Solved refreshing issues. 2013-09-06 11:31:16 +02:00
Maciej Suminski 7716d4592d Fixed hotkeys for switching rendering backends. 2013-09-06 10:19:53 +02:00
Maciej Suminski 7e4eba9eed Some comments. 2013-09-04 16:25:57 +02:00
Maciej Suminski a1089c9dd6 More effective way of updating bounding boxes. IsCached() method made public. Removed some of unused fields from the layer description structure. 2013-09-04 16:23:26 +02:00
Maciej Suminski 9a032e7422 Moved selection marking boxes to a different layer. 2013-09-04 16:18:37 +02:00
Maciej Suminski 55dddb69f7 Improved selection rules. Added some comments to the selection tool. 2013-09-04 10:56:06 +02:00
jean-pierre charras 580d42a63e pcbnew: fix wxWidgets 2.8 compatibility issue (temporary fix, still have a minor cosmetic issue), and add missing file. 2013-09-03 21:37:52 +02:00
Maciej Suminski 1a1416aaa4 Fixed Cairo's render target setting. 2013-09-03 17:46:05 +02:00
jean-pierre charras 1d74450216 Pcbnew: use pcb layer box selector in dialog graphic item properties and pcb text properties. 2013-09-03 14:48:38 +02:00
Maciej Suminski 446a0a174e Module texts are now moveable, rotatable and flippable. 2013-09-03 14:15:37 +02:00
Maciej Suminski 6405273059 Support for trapezoidal pads. 2013-09-03 13:51:53 +02:00
jean-pierre charras bbd0a41191 Rework on layer box selector, to use it in dialogs (currently the active layer selector, the layer pair selector and the dimension editor dialog.
This rework solves Bug #1214545.
Work in progress: many dialogs do not yet use the layer box selector.
2013-09-02 17:49:29 +02:00
jean-pierre charras 7bc9003fb8 pcb layer box selector: ajust size when modifying the layer names, to show the full name. 2013-09-02 17:26:52 +02:00
Maciej Suminski 7c745cd9c6 Allow invoking GAL tools, only if GAL is active. 2013-09-02 16:44:13 +02:00
Maciej Suminski 202f7f9107 Added autopanning to the selection tool. 2013-09-02 16:29:10 +02:00
Maciej Suminski 1e1fbb4ccf Corrected behaviour of drag panning while autopanning is enabled. 2013-09-02 16:26:42 +02:00
Maciej Suminski 0b17e5d288 Added some comments and changed names of classes to match the coding rules. 2013-09-02 14:21:12 +02:00
Maciej Suminski 3b046c409b Changed way of naming VIEW_ITEM update flags to be more explicit.
VIEW_ITEMs save the layer numbers they use, it allowed to speed up removal of items.
2013-09-02 11:49:46 +02:00
jean-pierre charras 9eeb56fe3e minor changes and refinement in class pcb layer box 2013-09-02 11:06:17 +02:00
jean-pierre charras 3124f8133a Cleaning code for PCB_LAYER_BOX_SELECTOR class, and use it in edit dimension dialog. 2013-09-01 20:38:11 +02:00
Dick Hollenbeck f99ca77461 Use via layers which are determined in only one place, this is a cheap trick to support blind vias in the export. 2013-09-01 12:59:28 -05:00
Dick Hollenbeck 0bc1c08d4f Add <aliases> and <alias> to generic netlist XML format, required by new bom_csv_grouped_by_value.py support. 2013-09-01 12:52:46 -05:00
Dick Hollenbeck 3fcf44ae32 Clarify, extend, and rename ky*.py to kicad_netlist_reader.py.
Significantly enhance the bom_csv_grouped_by_value.py BOM generator.
IMO it at this moment, the best BOM production tool for KiCad.
2013-09-01 12:49:01 -05:00
Brian Sidebotham 4d1dc14b45 * Fix Bug 1219239 - EESCHEMA crashes when editing a template field in libedit through the context menu 2013-08-31 16:53:46 +01:00
jean-pierre charras e4710f54f8 add missing files 2013-08-30 21:37:56 +02:00
jean-pierre charras ce983ec34a Pcbnew: Redesign layer selection and layer pair selection (give them a look near the Layer selector in toolbarr) 2013-08-30 21:28:31 +02:00
Maciej Suminski bf9b535f66 Fixed warning. 2013-08-30 14:43:18 +02:00
Maciej Suminski a2f0110f3d Added selection box for DIMENSION. 2013-08-30 14:02:57 +02:00
Maciej Suminski 367924e669 Added stacking for tools. 2013-08-30 10:37:26 +02:00
Maciej Suminski 9c6998c6bc Added SELECTION_TOOL::GetSelection() 2013-08-30 10:23:18 +02:00
Maciej Suminski 1bf848e418 Unified Set/GetPosition() for BOARD_ITEMs. 2013-08-29 12:06:06 +02:00
Maciej Suminski d62e474850 Reduced displayed events information. 2013-08-29 12:03:57 +02:00
jean-pierre charras 7546333fbc Pl_Editor: fix some minor issues. 2013-08-29 09:20:09 +02:00
jean-pierre charras 405bb0ad90 Pcbnew: enhancements for blind/buried vias placement ( separate keys to add a buried via or a through via), and save" blind/buried vias allowed" option in .kicad_pcb file
Minor code cleaning.
Allows compiling under wxMSW-2.8.12, only for test purposes, because there are serious bugs for Kicad under wxWidgets version < 2.9.3.  (compil warning generated for these versions)
2013-08-28 19:32:49 +02:00
jean-pierre charras b7e9f8ce1e Pcbnew: enhancements for blind/buried vias palcement, and save blind/buried vias allowed option in .kicad_pcb file 2013-08-28 18:14:39 +02:00
Maciej Suminski 00a2da7d18 Fixed cursor drawing for OpenGL. 2013-08-28 17:06:07 +02:00
Maciej Suminski 86c29e23df Added cursor snapping. 2013-08-28 16:25:42 +02:00
jean-pierre charras 8765d96c4b Add missing file 2013-08-28 09:29:48 +02:00
jean-pierre charras ee6233b893 Add pl_editor_doc.icns, from Orson. Fix Bug #1217504 (bad look of Module Properties Dialog, 3D fields).
Add Dick's workaround in plot_board_layers.cpp to try to avoid crash in solder mask calculations, due to a bug in boost::polygon, in resize function.
2013-08-28 09:23:14 +02:00
Maciej Suminski cebdb43234 Added mouse cursor drawing.
Added flipping mode.
2013-08-27 18:08:32 +02:00
Maciej Suminski f65da3d98f Merged upstream and Mac OS X build fixes. 2013-08-27 11:03:06 +02:00
Maciej Suminski e6e13b2609 Fixed GLEW library detection for Mac OS X. 2013-08-27 10:32:39 +02:00
Maciej Suminski 96774bb98c Added missing Mac OS X icons for the pagelayout_editor. 2013-08-27 10:14:26 +02:00
Dick Hollenbeck 681301ab9b switch to newer boost version. 2013-08-26 15:19:04 -05:00
Dick Hollenbeck 0d68dfcbc1 enhanced beautification, better formatting, upgrade to 0.60 uncrustify.cfg 2013-08-26 15:15:00 -05:00
Maciej Suminski 0a17e9a236 Fix for wxWidgets 2.9.5 2013-08-26 14:23:17 +02:00
Maciej Suminski 8597d2c681 Fixed the 64 bit build. 2013-08-26 14:08:32 +02:00
Maciej Suminski eca53baf6f Fixed linking errors for apps other than pcbnew. 2013-08-26 10:43:22 +02:00
jean-pierre charras b7bc4ea43e Pcbnew: speedup netlist read, when some footprints are not found, by caching the non-existent footprint names, which are searched only once in libs.
When a non existent footprint is used by many components, this footprint was previoulsy searched in libs for each component, which is very time consumming.
2013-08-24 15:03:59 +02:00
jean-pierre charras 6ab2f35f74 Pcbnew: read netlist enhancements: add option to remove single pads nets, add enforce tests to report non existing netnames in zones.
Fix also some very minor errors in comments.
2013-08-24 10:08:55 +02:00
jean-pierre charras c015153e21 Pcbnew: add more test when reading a netlist file: verify if all pads found in netlist are found in corresponding footprints (no missing pads). 2013-08-23 11:22:19 +02:00
Maciej Suminski 7a74418c39 Removed some unnecessary stuff and added some comments to WX_VIEW_CONTROLS. 2013-08-23 10:56:52 +02:00
jean-pierre charras 6033b3599e Pcbnew: Fix a bug when reading a netlist which forces pcbnew to read lib files to find a footprint even if the right footprint is already loaded (which explains the long time to load netlists)
Netlist dialog: add option to report only most important messages. Useful for large boards.
class REPORTER: add features to allow a basic message filtering (flags to report all/warning/error messages)
Fix Bug #1214599 ( tools are deselected on Move command )
2013-08-23 08:38:57 +02:00
Maciej Suminski 37d98063f0 Added autopanning functionality to WX_VIEW_CONTROLS. 2013-08-22 18:42:53 +02:00
Maciej Suminski 7fe85b44f9 Modified InvokeTool(), so besides resetting the tool, it also send an ActivateTool event.
Added generation of CancelTool event upon ESC key press.
Minor bugfix.
2013-08-22 15:07:34 +02:00
Maciej Suminski 68125a7f50 Changed reaction of SELECTION_TOOL to ToolCancel event (first event clears selection, second one deactivates the tool). 2013-08-22 15:05:37 +02:00
Maciej Suminski 166879a1c8 Mark layers as dirty on VIEW_ITEM removal. 2013-08-22 15:04:14 +02:00
Maciej Suminski b518569674 Added handling keyboard events for the Tool framework. 2013-08-21 17:37:27 +02:00
Dick Hollenbeck 6a25e05e3c Lay basis for a more full featured usage of boost, including compiled libraries such as unit_test_framework, system, etc. Move headers now into boost_root/include/boost/. 2013-08-20 13:03:21 -05:00
Lorenzo Marcantonio 179862b10a Fixed issues when opening a pagelayout from the command line 2013-08-20 15:44:42 +02:00
Maciej Suminski 339cf51c0c Added VIEW_GROUP for grouping items to be displayed on a single layer. 2013-08-20 15:07:38 +02:00
Maciej Suminski c8d06997f5 Added InvokeTool() and FindTool() functions. 2013-08-20 14:49:08 +02:00
Maciej Suminski 57979f3c9b Smarter way of the overlay rendering (overlay is always refreshed, while cached&noncached targets only if the viewport or items have changed). 2013-08-19 11:02:38 +02:00
Maciej Suminski e70a0e4e0e Reformatting. 2013-08-19 09:47:36 +02:00
Maciej Suminski 6268fe957a Functions for direct item drawing. 2013-08-19 09:44:50 +02:00
jean-pierre charras 49ce5eecdf Pl_Editor: fix crash on Linux when closing Pl_Editor 2013-08-19 09:08:13 +02:00
jean-pierre charras 4e1da2b6d0 Pl_Editor: fix minor issues in multi-lines texts
Others: fix very minor issues.
2013-08-18 17:49:04 +02:00
Brian Sidebotham 3f7d24bccf * Fix the last parts of Bug 1204712 by removing DateAndTime from library file and documentation file formats. They weren't being loaded anyway. 2013-08-16 23:31:37 +01:00
Wayne Stambaugh de0c051e51 Fix layer alignment target default size. 2013-08-16 14:41:09 -04:00
Wayne Stambaugh 1ef99e657f Fix MinGW build issue for missing isinf() in PolyLine.cpp. 2013-08-16 10:25:34 -04:00
Marco Mattila 7cbe1c0a44 Pcbnew: fix filleting of zones with parallel adjacent edges 2013-08-16 14:51:35 +03:00
Lorenzo Marcantonio 8c45f18409 - Rogue int as LAYER_MSK (will break with more than 32 layers)
- Comment fix
2013-08-15 17:20:25 +02:00
Maciej Suminski ae3c02abae Build fix. 2013-08-15 16:23:54 +02:00
Maciej Suminski 543d4af682 Added resetting of tools after loading a new board. 2013-08-15 10:20:49 +02:00
Wayne Stambaugh 19c49fa82b Eeschema bus label test bug fixes. (fixes lp:1209424)
* Use a regular expression to enforce more stringent bus label testing.
* Add validator to edit label dialog to prevent space character from being
  used in labels.
2013-08-13 19:04:41 -04:00
jean-pierre charras a723b8de7a Pcbnew: fix Bug #1211468
Pl_Editor: fix copyright in files. Enhancement when creating new items.
2013-08-13 19:51:22 +02:00
Maciej Suminski 21c3926714 Fixed win32 builds. 2013-08-10 11:14:16 +02:00
Dick Hollenbeck 3d79bf82f4 REMOVE: vias from specctra DSN export which are not in a netclass. Use only netclass based via sizes in freerouter.
Some of the vias in the class-less list were setting the drill hole size to zero and this made no sense to freerouter.
2013-08-09 14:05:04 -05:00
Dick Hollenbeck 6338f88db1 User longer, more dis-ambiguating text for Show button 2013-08-09 14:03:26 -05:00
jean-pierre charras fdfe60dd09 Replace the wxFilePickedCtrl in Option Page dialog by an usual wxButton + wxTextCtrl, because under wxWdgets 2.8.12 the look and the behavior is very different between Windows and Linux. 2013-08-09 19:36:45 +02:00
jean-pierre charras cdff2d0d41 Replace the wxFilePickedCtrl in Option Page dialog by an usual wxButton + wxTextCtrl, because under wxWdgets 2.8.12 the look and the behavior is very different between Windows and Linux. 2013-08-09 18:19:52 +02:00
Maciej Suminski eb290bf362 Added some comments. 2013-08-09 15:21:31 +02:00
Maciej Suminski 18618deea3 Added selection boxes for texts. 2013-08-09 15:04:10 +02:00
Maciej Suminski 67b64f5ec6 Added the additive mode for the selection area. 2013-08-09 10:18:48 +02:00
jean-pierre charras f394f2c57f Eeschema: fix Bug #1210120 2013-08-09 08:51:14 +02:00
Maciej Suminski 46670c7eeb Multiple items selection tool. 2013-08-08 19:42:19 +02:00
Maciej Suminski eefc79b5b2 Reformatting. 2013-08-08 19:41:20 +02:00
Dick Hollenbeck 744dd4893d EHNANCE: add a "Show" button to the two text field properties
dialogs which allow editing of component properties.  The button
is active when the table row cursor is on the DATASHEET field only.
When active, and your datasheet is a URI, then your default
browser will be launced to show that datasheet if it can find it.
This incentivizes use of http:// links for datasheets.
2013-08-08 11:12:41 -05:00
Dick Hollenbeck 7eed86de38 ENHANCE: specctra export Edge.Cuts "endpoint mismatch error message" was not showing exact coordinates with sufficient resolution 2013-08-08 11:11:50 -05:00
Dick Hollenbeck 1c04f5a03c FIX: removed unwanted indent in *.kicad_pcb files ahead of "placed" and "locked" 2013-08-08 11:09:49 -05:00
Maciej Suminski 9d9d74faad Reformatting. 2013-08-08 14:59:59 +02:00
Maciej Suminski c2342776e1 Fixed disambiguation menu issue. 2013-08-08 14:50:32 +02:00
Maciej Suminski 09aa89f3f9 Added brightened mode for selecting items using disambiguation menu. 2013-08-08 12:30:00 +02:00
Maciej Suminski a8430e09f5 Added selection box for modules. 2013-08-08 11:53:29 +02:00
Maciej Suminski 768b039cde Added general purpose overlay layer and moved selection box to it. 2013-08-08 11:43:56 +02:00
Maciej Suminski 3f1b9a6b4a Different approach to item recaching. 2013-08-07 17:20:01 +02:00
jean-pierre charras 638e29b5d6 Eeschema: fix a crash when plotting a schematic.
Pcbnew: footprint wizard dialogs: minor fixes, and fixes a not working parameters dialog under Windows, due to an incorrect Printf format.
remove scripts/packagesrc.sh, fully outdated (still refers svn repo)  and not commented.
2013-08-07 15:22:59 +02:00
jean-pierre charras 5abc48269b merge with trunk 2013-08-07 12:13:54 +02:00
Maciej Suminski c81b17c1cb Some more reformatting and adding copyright notices. 2013-08-07 11:20:12 +02:00
Maciej Suminski c928bc8ce3 Fixed layers caching settings. Added some comments. 2013-08-07 10:52:50 +02:00
Maciej Suminski f33a4975ef Simplified color computation. 2013-08-07 09:51:39 +02:00
Maciej Suminski 5920137968 Removed frame limiter. 2013-08-07 09:37:28 +02:00
Dick Hollenbeck f636e1d45f REMOVE: check for repeat_item->Flags() == 0 in eeschema/hotkeys.cpp 2013-08-06 18:23:50 -05:00
Carl Poirier 7e6a243df9 REMOVE: USE_PCBNEW_NANOMETERS by making it the only way to go in pcbnew, effectively removing the deci-mils build. 2013-08-06 18:21:40 -05:00
Dick Hollenbeck ad7ba8f029 FIX: insert key must repeat text labels 2013-08-06 17:59:07 -05:00
Maciej Suminski 3096a26b59 Added GetTarget() for GALs. 2013-08-06 14:57:48 +02:00
Maciej Suminski ff2a719bf7 Code reformatting. 2013-08-06 10:30:09 +02:00
Maciej Suminski b6c4aaac8e Moved highlighted flag from VIEW_ITEM to EDA_ITEM. Added brightened and selected flag to EDA_ITEM. 2013-08-06 09:31:08 +02:00
Dick Hollenbeck f7ad4ca025 BUG FIX: eeschema as segfaulting on the 'Insert' key because the m_itemToRepeat
was simply a pointer to an object on the display list.  At times this object
would disappear from the display list, in the test case because of a concatonation
of two wires, and if you then tried to clone the non-existent object you'd get a 
crash.  This was not merely a bug, but a naive design choice. IMO.
Now the item to repeat is cloned, so will never also be on the display list.
2013-08-05 16:02:41 -05:00
Dick Hollenbeck 4666b7fb69 formatting and fix selection clarification bug in pcbnew, could not move reference text when hidden under another footprint 2013-08-05 15:47:34 -05:00
Dick Hollenbeck 125ce48525 add Brian to about dialog, scoot Wayne up, alphabetize the rest 2013-08-05 15:45:22 -05:00
Camille Delbegue 114d12b060 Remove a Clang warning and add a missing dependency to boost in cmake file. 2013-08-05 17:53:13 +02:00
Dick Hollenbeck bf1566884c 1) Remove requirement to define KICAD_TESTING_BRANCH. Instead the KICAD_STABLE_BRANCH
must be defined if that is the build type wanted. This only affects a text string
anyways, is not particularly important other than telling user from which code
branch  the source came.  

2) Change name of "testing" to "product" in that same description within
common/build_version.cpp.  "testing" made it sound frightenly unusable.
2013-08-05 10:38:50 -05:00
Maciej Suminski fa7b6a8cec Moved VIEW_ITEM::ViewGetRequiredLayers() functionality to the VIEW class. Now required layers are set per layer basis instead of per item. 2013-08-05 16:28:58 +02:00
jean-pierre charras 9855104120 Pcbnew: footprint wizard dialogs: minor fixes, and fixes a not working parmeters dialog under Windows, due to an incorrect Printf format. 2013-08-05 15:43:15 +02:00
Maciej Suminski 36f7125513 Upstream merge. 2013-08-05 14:46:05 +02:00
Maciej Suminski 6ebd5ddc53 Fixed bounding box for TEXTE_PCB class. 2013-08-05 14:06:01 +02:00
Brian Sidebotham 2bc4103ea9 * Added modified CMake FindPython... modules to support using Python-a-mingw-us distribution when building Windows scripting support using MinGW 2013-08-04 21:31:14 +01:00
Dick Hollenbeck 01eab7dccb ReturnStringFromValue() refinements 2013-08-03 15:20:55 -05:00
Dick Hollenbeck a95dee3d09 fix interface mapping slip-up in wxPoint EDA_DRAW_FRAME::GetCrossHairPosition( bool aInvertY ) const 2013-08-03 13:57:15 -05:00
jean-pierre charras 891c85a2c1 Pcbnew: add hotkey Z to reset grid origin.
Save grid origin in .kicad_pcb files only if not 0,0 (to keep compatibility with previous versions of pcbnew, mainly the stable version)
Very minor other fixes (set modify flag when grid origin is moved from the dialog grid)
2013-08-03 18:16:57 +02:00
Dick Hollenbeck 386f9b2074 split expression into two lines for verification while using debugger that GetScreen() is a virtualized call. 2013-08-03 01:36:51 -05:00
Dick Hollenbeck 325d5a6bcd *) retain grid origin in the BOARD and save it in legacy and kicad board files.
*) add hotkey for setting the grid origin as 'S', in board editor, module editor.
*) re-position the function interface for cursor movement from BASE_SCREEN into
   class EDA_DRAW_FRAME.  This is a prelude to getting rid of BASE_SCREEN or
   splitting it up.
2013-08-03 00:15:23 -05:00
Maciej Suminski f05d7f4176 Merge. 2013-08-02 19:23:35 +02:00
Maciej Suminski a8ea2e05a4 Windows build fix. 2013-08-02 19:21:22 +02:00
tomasz.wlostowski@cern.ch 8bcb88d6fd pcbnew: fixed missing Select Tool icon warning 2013-08-02 19:18:58 +02:00
unknown f9bd431d56 pcbnew: removed printf() causing a bug 2013-08-02 17:57:28 +02:00
unknown 0c6e180937 Merged Orson's changes 2013-08-02 17:28:09 +02:00
unknown 2c5fcd7d2c pcbnew: tool initialization should belong to PCB_EDIT_FRAME to avoid linking errors on cvpcb. 2013-08-02 17:25:53 +02:00
unknown 1a19c761ae pcbnew: hooked Tool Framework into the edit panel. Added a sample selection tool (not fully functional). 2013-08-02 16:53:50 +02:00
unknown 71b8823625 PCB painter: improve label highlighting 2013-08-02 16:53:04 +02:00
unknown 24cab0eabd View: various fixes, added VIEW::IsDirty() 2013-08-02 16:51:38 +02:00
unknown 3e5c236942 Added COROUTINE and DELEGATE class examples. 2013-08-02 16:50:29 +02:00
unknown a3f74b2f68 Increased number of layers in the view (for overlay objects) 2013-08-02 16:49:07 +02:00
unknown 2d09237bd7 Added core tool framework files + boost::context assembly stuff (initial, very buggy and unfinished work). 2013-08-02 16:46:53 +02:00
Maciej Suminski d26b94db61 Added missing header. 2013-08-02 16:45:30 +02:00
Maciej Suminski 017c41bc5f Upstream merge. 2013-08-02 15:57:24 +02:00
Maciej Suminski d7857dd026 Fixed the tesselator, so now it works with Windows. 2013-08-02 10:55:40 +02:00
Maciej Suminski 7ac5a172fa Modified usage of wxStandardPaths to make it compatible with newer versions of wxWidgets. 2013-08-02 10:35:58 +02:00
Maciej Suminski f44a64a705 Modified way of handling OpenGL framebuffer errors.
Now it is more verbose and the status is checked at the right moment (previously it was fine with Linux, but on Windows it showed errors).
2013-08-02 10:34:23 +02:00
jean-pierre charras 490b630e2d Minor fixes. Minor code cleaning. Pcbnew: better iniatilization of members in DRAWSEGMENT, TRACK, EDGE_MOD (not bugs: just useful when using python scripting). 2013-07-31 18:41:32 +02:00
Maciej Suminski 1265dc6334 Added drawing of solderpaste layer for pads. 2013-07-31 14:51:20 +02:00
Maciej Suminski 69f994e1b2 Added missing outline for polygon segments. 2013-07-31 13:35:02 +02:00
Maciej Suminski 0f841f194f Fixed drawing of polygon segments (eg. microwave extension traces). 2013-07-31 11:36:46 +02:00
Maciej Suminski db6aecda47 New display style for grid (dotted). 2013-07-31 10:28:23 +02:00
Maciej Suminski 83ca78a5fb Fixed grid line drawing in OpenGL backend for some drivers. 2013-07-31 09:01:25 +02:00
Maciej Suminski 2f0ae47c8e Code refactoring. 2013-07-30 18:29:54 +02:00
Maciej Suminski 11a2d81738 Made GAL backends settings more consistent. Fixed grid line width in the OpenGL backend. 2013-07-30 17:09:06 +02:00
Maciej Suminski bb4ea2db67 Merge removal of the shaderless OpenGL backend. 2013-07-30 14:05:32 +02:00
Maciej Sumiński 70a2321cc1 Fixed smudging in the Cairo backend. 2013-07-30 13:58:03 +02:00
Maciej Suminski 2331742384 Removed shaderless OpenGL backend. 2013-07-29 16:38:07 +02:00
Maciej Suminski d41ea73765 Fixed top layer pads netnames issue. 2013-07-29 14:20:40 +02:00
Maciej Suminski 5a5616f258 Added initialization of variable, preventing unconditional jumps. Fixed typos in comments. 2013-07-29 14:12:27 +02:00
jean-pierre charras bd3108a40c Minor code cleaning. Pcbnew: better iniatilization of members in DRAWSEGMENT, TRACK, EDGE_MOD (useful when using python scripting). 2013-07-29 09:33:56 +02:00
Dick Hollenbeck 8c9a12e3a1 minor tweaks to debug statements and cmake 2013-07-28 11:30:39 -05:00
Ben Harris fe45fa81fc fix FP_CACHE::Load() 2013-07-28 11:30:02 -05:00
Dick Hollenbeck 3e30600f70 add script which converts footprint libraries from one format to another 2013-07-28 11:28:17 -05:00
Dick Hollenbeck 5c05ec5b98 $ iconv -f LATIN1 -t UTF-8 pic_sockets.sch -o /tmp/pic_sockets.sch
convert to UTF-8, eeschema cannot load LATIN1 strings anymore.
2013-07-28 10:21:43 -05:00
Dick Hollenbeck 7024117709 AUTHORS.txt LATIN1 to UTF-8 via: $ iconv -f LATIN1 -t UTF-8 AUTHORS.txt > /new/AUTHORS.txt
All source files are supposed to be UTF-8 now.  Although not a source file, my editor
was tripping on this file when grepping.
2013-07-28 09:47:13 -05:00
matheiulj fd38b708fb Fix pad bounding box calculation bug. (fixes lp:1202828) 2013-07-26 17:29:16 -04:00
Wayne Stambaugh 153020283c Fix minor debug build error. 2013-07-26 16:25:21 -04:00
Maciej Suminski b41d1e0eaf Added display of soldermask for pads. 2013-07-26 18:15:11 +02:00
Maciej Suminski fcbfd00b98 Added scalar addition and subtraction operators. 2013-07-26 18:12:22 +02:00
jean-pierre charras 51edb08796 Commit missing file 2013-07-26 15:20:08 +02:00
jean-pierre charras bb087fdc45 Pl_Editor: add undo/redo commands. 2013-07-26 14:50:29 +02:00
Maciej Suminski a4a2196cc2 Fixed profiling timers for compilation under Win32 (and hopefully Mac OS too). 2013-07-26 14:35:31 +02:00
Maciej Suminski 8ab96afd5b Moved multilayer pad netnames to the top. 2013-07-26 12:15:28 +02:00
Maciej Suminski f5b230a2ef Fixed recaching after changing display properties. 2013-07-26 10:05:57 +02:00
jean-pierre charras 076defb0a5 Pl_Editor: title block texts can be multiline (use" \n" : a '\' followed by a 'n' to create a new line inside a text)
Very minor code cleaning.
2013-07-25 20:58:46 +02:00
Maciej Suminski 76660ff15b Fixed high contrast mode in OpenGL. Split display settings loading into more appropriate places. 2013-07-25 18:04:15 +02:00
Maciej Suminski 60471ecc1e Added a layer compositor for the Cairo backend. 2013-07-25 14:40:04 +02:00
jean-pierre charras 9e68ba1ea3 Very minor code cleaning 2013-07-24 20:34:28 +02:00
Baranovskiy Konstantin 414dddbf59 Add GOST page layout description files in template 2013-07-24 17:57:38 +02:00
jean-pierre charras a0c61484d2 Pl_Editor: fix a very minor issue when displaying the page size in status bar. 2013-07-24 17:19:37 +02:00
jean-pierre charras 7f6787c8b8 Pl_Editor: add some hot keys. Fix some rounding issues. 2013-07-24 17:11:35 +02:00
Maciej Suminski 8c74dcde28 Fixed blending function for OpenGL compositing. Corrected documentation, removed unnecessary functions. 2013-07-24 15:06:59 +02:00
Maciej Suminski 27332a8a17 Header containing GLSL source code is generated only after change of any of shader source files. 2013-07-24 14:22:00 +02:00
jean-pierre charras 8733da346b Pl_Editor: bug fixes (default values not saved, and duplicate item names, when adding items) 2013-07-23 18:45:23 +02:00
Maciej Suminski e644f5be05 OpenGL multitarget rendering (compositing). 2013-07-23 18:39:07 +02:00
jean-pierre charras 7007601655 Fix an issue in Debug mode 2013-07-23 12:35:58 +02:00
Camille Delbegue b1fc1cd11e Pl_Editor: Fix wx28 compatibility 2013-07-23 08:18:59 +02:00
jean-pierre charras 919edcf1e1 Bug #1202761 (Off centre zoom ) 2013-07-22 20:38:04 +02:00
jean-pierre charras d99260c614 Initial release of pl_editor, the page layout and title block editor. 2013-07-22 18:46:44 +02:00
jean-pierre charras cf9d1ba541 Fix GOST compatibility. 2013-07-22 18:45:22 +02:00
Maciej Suminski d6628419c9 Changed rendering order of cached & noncached layers. 2013-07-22 13:14:53 +02:00
Maciej Suminski 75eb5491d5 Code refactorization. VBO_CONTAINER is split to [NON]CACHED_MANAGER, GPU_MANAGER and VERTEX_MANAGER. 2013-07-22 10:41:12 +02:00
jean-pierre charras c32d8f38ed pl_editor: add config options 2013-07-21 16:15:07 +02:00
jean-pierre charras 9f22c35519 Add margin values control in pl_editor, and remove margin definition from class PAGE_INFO. 2013-07-20 21:36:19 +02:00
Thiadmer Riemersma f775500932 Eeschema: fix subtle find bug when at the end of the search list. (fixes lp 1199689) 2013-07-20 13:13:40 -04:00
jean-pierre charras fdbdb76c39 Initial release of pl_editor, the page layout and title block editor. 2013-07-19 20:27:22 +02:00
Maciej Suminski af26e17fa7 Fixed comments. 2013-07-19 09:35:25 +02:00
Maciej Sumiński 769bf51359 Headers containing shader program sources are generated using CMake. 2013-07-17 23:55:59 +02:00
Maciej Suminski c81c316a46 Refactorization of VBO_CONTAINER. 2013-07-17 18:49:38 +02:00
Maciej Suminski e5192ceddd Fixed wrong memory freeing. 2013-07-17 14:16:37 +02:00
Maciej Suminski 89ddf97fa0 Different approach to coloring netname labels. 2013-07-17 14:02:08 +02:00
Maciej Suminski 79b2eb0ff7 Display preferences for showing netnames applies to the GAL backend. 2013-07-17 13:38:56 +02:00
Maciej Suminski 0ab0c7b8ed Restored missing Refresh() on switching the high contrast mode. 2013-07-17 10:26:29 +02:00
Maciej Suminski 1d582a515c Added an interface for highlighting. 2013-07-17 10:21:46 +02:00
Maciej Suminski a4a6064316 Fixed stroked circles width issue with OpenGL shaders. 2013-07-17 10:21:29 +02:00
Maciej Suminski 910d95a7b6 Moved bottom netnames layer over bottom tracks & pads. Changed int to LAYER_NUM where applicable. 2013-07-16 15:45:21 +02:00
Maciej Suminski 3cedadd738 Fixed OpenGL tracks transparency & netnames issue. 2013-07-16 15:44:08 +02:00
Maciej Suminski 3ba2d4428b Added support for multiple active layers (colored ones in the high contrast mode).
Added separate layers for pad netnames (now these are divided into multilayer/top/bottom pads).
More appropriate layers are selecting a copper layer in the high contrast mode (now it shows the copper layer itself, vias & multilayer pads and netnames).
2013-07-16 13:40:53 +02:00
Maciej Suminski 7a545df299 Moved rendering order settings to a more appropriate place. 2013-07-16 10:49:56 +02:00
Maciej Suminski 2b3d6075e2 1 pixel wide outlines for the Cairo and the OpenGL with shaders backends, but it breaks displaying outline in the shaderless OpenGL backend. 2013-07-16 09:27:28 +02:00
Maciej Suminski 1073a524b9 Refactored code responsible for high contrast mode. Now it allows to have more than one layer on the top.
Selecting layer using the dropdown list on the toolbar influences the layer displayed in high contrast mode.
2013-07-16 09:26:29 +02:00
Maciej Suminski 6dd9cb6fb8 1 pixel wide lines using OpenGL shaders. 2013-07-16 08:49:12 +02:00
Maciej Suminski 6789755b06 Stroked lines in Cairo GAL are always drawn at least 1 pixel wide. 2013-07-16 08:48:21 +02:00
Maciej Suminski e7dae3a9c1 Fixind GLM headers problem. 2013-07-16 08:42:44 +02:00
Wayne Stambaugh 1f78a15db2 Eeschema find bug fixes. (fixes lp:1199689)
* Force search when wrap past end of list option changes state.
* Fix SCH_FIELD::Matches() for bug in user defined fields which have an ID
  of -1.
* Minor improvements to the find data names to improve source code readability.
2013-07-14 14:08:20 -04:00
Maciej Suminski 79a4f42ef9 Fixed multiline vertical strings drawing bug. 2013-07-09 10:00:23 +02:00
Dick Hollenbeck 8fdf3799a2 dialog information hiding, initial Fit() 2013-07-09 00:48:26 -05:00
Dick Hollenbeck 4b095ab61f comment improvements 2013-07-09 00:22:08 -05:00
Dick Hollenbeck 757d617ef3 wxStandardPaths().GetExecutablePath(); is not wx 2.9.5 compatible, formatting improvements 2013-07-09 00:20:07 -05:00
Dick Hollenbeck 17923c0d9e treat chars as unsigned when hashing 2013-07-09 00:18:03 -05:00
Maciej Suminski c9f9db9069 Dynamic color setting for netnames. 2013-07-08 20:42:46 +02:00
Maciej Suminski 90d03c784c Dynamic font scaling for pads netnames. 2013-07-08 20:04:43 +02:00
Maciej Suminski ea436444f2 wxWidgets 2.8 compatibility fix.
Scripting engine build fix.
2013-07-08 17:14:16 +02:00
Maciej Suminski 209bb4290f Separate layers for each copper layer netnames. 2013-07-08 16:46:04 +02:00
Maciej Suminski 7d9d2e508d Remove updating of non-cached layers. 2013-07-08 15:24:44 +02:00
Maciej Suminski 5bd8e7d4e8 Upstream merge. 2013-07-08 15:05:12 +02:00
Maciej Suminski 30f19be555 Fixed 'disappearing via' issue. 2013-07-08 14:06:45 +02:00
Maciej Suminski 3e140ddcfe Lighter pads & tracks net names color. Proper rotation of text on symmetrical pads. 2013-07-08 13:57:09 +02:00
Maciej Suminski 81143324a5 Showing net names on pads. 2013-07-08 11:30:50 +02:00
Maciej Suminski fabb646a0b Showing net names on tracks. 2013-07-08 09:57:23 +02:00
Maciej Suminski 85131e359e Added 'required layers' option for drawn items. 2013-07-08 09:28:58 +02:00
Maciej Sumiński 5a0f8019c7 Removed some more KICAD_GAL ifdefs. 2013-07-07 20:02:06 +02:00
Maciej Sumiński f067dc8b32 Added possibility to change zoom using toolbar in GAL. 2013-07-07 19:30:44 +02:00
Maciej Sumiński 14110cdea8 Removed drawing hatch lines for polygons. 2013-07-07 18:55:23 +02:00
Maciej Sumiński f885296fb2 Removed KICAD_GAL CMake option. 2013-07-07 02:30:28 +02:00
jean-pierre charras a6c5f46f2d Eeschema: fix a *very subtle* bug noticeable only in complex hierachies, for multiple parts per package:
sometimes, the modified flag was set for these components just when switching from a sheet to an other sheet.
Pcbnew: fix Bug #1197414 (dragged track segments does not show clearance area)
2013-07-05 19:48:01 +02:00
Maciej Suminski 145ea35ac3 Fixed segmentation fault when there was no board loaded. 2013-07-05 15:48:45 +02:00
Maciej Suminski 1399ed198c Removed most of deprecated OpenGL calls. Items used to be drawn in immediate mode now are drawn using vertex arrays. 2013-07-05 14:01:33 +02:00
Maciej Suminski c2fb99ce49 Removed pointers where they were not necessary. 2013-07-05 09:31:04 +02:00
Maciej Suminski 53542a9d37 Added implementation of level of details per layer and item type pairs basis (items on every layer have a possibility to define the minimum VIEW scale to be shown). 2013-07-04 18:45:00 +02:00
Maciej Suminski e77690c268 Added the 'cached' parameter for VIEW_LAYER. The parameter decides if items drawn on the layer should be cached or drawn in immediate mode.
Removed m_useGroups from VIEW, as now groups are enabled per layer.
2013-07-04 17:02:20 +02:00
Maciej Suminski d8e45ef866 Fixed drawing circles and semicircles using display lists. 2013-07-04 16:27:27 +02:00
Maciej Suminski ffc24ad518 Added functions for changing settings of used font in GAL. 2013-07-04 14:24:41 +02:00
Maciej Suminski b79c17b43c Reduced frame limit. 2013-07-04 14:21:40 +02:00
Maciej Suminski be415dab1d Moved STROKE_FONT from PAINTER to GAL. 2013-07-04 11:37:43 +02:00
Maciej Suminski d0278dad15 Shaders can handle integer parameters (uniforms). 2013-07-03 13:08:43 +02:00
jean-pierre charras 927ff2bca7 Eeschema: fix bug Bug #1197103 and an other very minor bug. 2013-07-03 09:27:52 +02:00
Maciej Suminski fc7b9029c9 Fixed stroked semicircles Z coordinate in shaderless OpenGL backend. 2013-07-02 18:11:57 +02:00
Maciej Suminski 187b529dbb Added possibility to change display modes of zones. 2013-07-02 14:02:42 +02:00
Maciej Suminski 2061947138 Fixed stroke semicircles drawing using shaderless OpenGL backend. 2013-07-02 09:27:12 +02:00
Dick Hollenbeck 04c24cb686 dsnlexer.cpp's isNumber() was recently stupid-ized, un-stupid-ize it. 2013-07-01 09:37:03 -05:00
Maciej Suminski f38935459b Headers are regenerated only if shaders' source code was modified. 2013-07-01 15:47:44 +02:00
Maciej Suminski a6ce907a4f Faster polylines drawing using OpenGL backend.
Fixed drawing of lines' caps.
2013-07-01 15:23:43 +02:00
unknown f1dbfffd82 Removed different styles of line caps and line joins, leaving only round caps & joins.
Fixed drawing stroked semicircles using OpenGL backend.
2013-07-01 14:39:27 +02:00
Maciej Suminski a46d344db2 Mirrored text display bugfix. 2013-07-01 14:06:38 +02:00
Maciej Suminski 5476a03799 Changed std::map to boost::unordered_map for storing memory chunks and groups information. 2013-07-01 13:20:48 +02:00
Dick Hollenbeck d4569d66ac DSNLEXER::NextTok() organizes the specctraMode code better, into one if block mostly.
This keeps it out of the KiCad mode path, making that leaner and less confusing about
what is supported in KiCad mode.  Within KiCad mode, treat quoted vs. non-quoted tokens
as the two general categories, with non-quoted having sub-categories.  Eliminate  
an unimplemented, unused function declaration in DSNLEXER.
 
Improve the output formatting of THROW_PARSE_ERROR().
2013-07-01 01:47:36 -05:00
Dick Hollenbeck c4ce6d9ab1 Speed up DSNLEXER::findToken() to such an extent that it resulted in an approximate 13% reduction
in *.kicad_pcb file loading times.
2013-06-30 20:05:40 -05:00
Maciej Sumiński fa083142a7 Colors are stored as unsigned bytes instead of floats. 2013-06-30 22:45:31 +02:00
Karl Thorén 8aa8451434 All: Fix bug #1196277 (pcbnew does not save all parts of the title block to the kicad_pcb file) 2013-06-30 19:40:33 +02:00
Maciej Sumiński a1f81bbe97 Shaders are built-in instead of being loaded from external files. 2013-06-30 19:31:16 +02:00
Maciej Sumiński e9669c6594 More debug information in case of failure compilation of shaders. 2013-06-30 15:37:46 +02:00
Maciej Sumiński 690e7144c1 Made shaders compatible with Intel GPUs. 2013-06-30 15:37:35 +02:00
jean-pierre charras a53b3d496c Replace in EDA_TEXT::Draw the parameter EDA_DRAW_PANEL* aPanel by EDA_RECT* aClipBox, which is the actual parameter used by Draw.
This change make more easy to  use this function when a EDA_DRAW_PANEL canvas is not used to draw texts.
Remove dead code in worksheet.cpp.
2013-06-29 11:52:22 +02:00
Wayne Stambaugh be7f436951 Prevent GTK printing build error on Linux
* Do not fail to build when wxWidgets is built with either --with-gnomeprint
  or --with-gtkprint are not configured.  Only display warning.
* Move warning code from include/common.h to common/common.cpp so it only
  shows the warning once instead of every source file that includes common.h
2013-06-28 12:29:39 -04:00
jean-pierre charras 7708753ed3 Gerbview: remove fully outdated code (about reading DCode files) and fix erroneous comments. 2013-06-28 12:49:43 +02:00
Maciej Suminski 95d5ab706a VBO_CONTAINER: Changed new[]/delete[] pairs to realloc(), possibly reducing memory fragmentation and the container shrinking time. 2013-06-28 10:47:41 +02:00
jean-pierre charras 7afb4e68f1 Pcbnew: fix bug Bug #1194219 (Solder mask clearance ignored for oval pads )
When KISYSMOD is not defined , in GetAllFiles, skip hidden directories
Gerbview: fix a collision name for GetLayout method.
Eeschema: fix potential crash when editing a pin electrical type (The user was able to enter a non existing type)
2013-06-28 08:31:24 +02:00
Dick Hollenbeck 4caad33c9a fix legacy board file footprint name setting in MODULE 2013-06-27 16:34:01 -05:00
Dick Hollenbeck 1ece12b907 remove dialog_netlist.h 2013-06-27 15:34:30 -05:00
Dick Hollenbeck 88c2f8504e WTF 2013-06-27 15:33:28 -05:00
Wayne Stambaugh 9137a9ec80 Pcbnew: fix bug reading legacy board format. (fixes lp:1195368) 2013-06-27 16:27:29 -04:00
jean-pierre charras fad35e7e00 Minor fixes. Gerbview: fix a collision name for GetLayout method. 2013-06-27 21:12:01 +02:00
Maciej Suminski 009925724e Minor code cleaning. 2013-06-27 17:31:10 +02:00
Maciej Suminski 8504f30594 Proper handling of toggling outline display of items. 2013-06-27 17:23:54 +02:00
Maciej Suminski 96116659be Faster circles & semicircles drawing for the shaderless OpenGL backend. Removed unnecessary variables and computations. 2013-06-27 16:05:15 +02:00
Maciej Suminski 1e7df3606a Groups are stored in map instead of deque, so it allows easier adding & removing. 2013-06-27 11:54:49 +02:00
Maciej Suminski 603029b106 High contrast mode with showing the selected layer on the top. 2013-06-26 16:31:52 +02:00
Maciej Suminski 4ca54b2f1d Small speed up for the color change function (OpenGL_GAL). 2013-06-26 10:43:58 +02:00
Alexander Lunev 555e24dc59 pcad2kicadpcb: check for file format 2013-06-25 11:05:51 -05:00
Dick Hollenbeck a651aaea00 Add script to make a footprint library table from the KiCad Bazaar library repository, either in s-expr or CSV format. Add also the generation of such tables as of today. 2013-06-25 10:56:12 -05:00
Maciej Suminski 258b804941 Added possibility to change cached layer color (for the purpose of high contrast display). 2013-06-25 17:12:54 +02:00
Maciej Suminski dbb4e67737 Fixed warning about a not initialized variable. 2013-06-25 16:54:30 +02:00
Maciej Suminski ec1a5d1318 Added zoom in, zoom out & fit on screen view commands handling in GAL. 2013-06-25 09:15:57 +02:00
Maciej Suminski cdab6cfdbe Draw the origin marker in OpenGL with shaders GAL. 2013-06-24 16:02:18 +02:00
Maciej Suminski 33b3d5edfb Small improvements to SHADER class. 2013-06-24 15:40:31 +02:00
Maciej Suminski e1aa6f7e84 Grid settings apply to GAL based rendering. 2013-06-24 14:33:02 +02:00
Maciej Suminski bfc1665d87 Fixed hotkeys for switching GAL backends. 2013-06-24 13:46:24 +02:00
Maciej Suminski 9e937f8113 Added convertsion from wxColour to COLOR4D. 2013-06-24 10:32:08 +02:00
Maciej Suminski d114d9e386 Passing COLOR4D parameter using constant reference. 2013-06-24 10:21:34 +02:00
Maciej Suminski 4e8d1366b6 Added conversion from EDA_COLOR_T to COLOR4D. 2013-06-24 10:12:36 +02:00
Dick Hollenbeck 8afb0255f0 add CTL_OMIT_INITIAL_COMMENTS and CTL_FOR_BOARD PCB_IO::Format()ing flags 2013-06-24 00:30:22 -05:00
Dick Hollenbeck dac6c662c5 fix copy constructor with new MODULE::m_initial_comments member handling 2013-06-23 17:41:35 -05:00
Dick Hollenbeck 577229bb6e Support for 'initial single line comments' in the pretty footprint format.
This is limited to round tripping the lines of commented text in the
loading and saving to disk through PCBIO::Format() and PCBIO::Parse().
No editing of the comments is given.
2013-06-23 14:18:33 -05:00
Maciej Suminski b5fdf4f1da Shows single layer pads with proper colors. 2013-06-21 12:02:17 +02:00
Maciej Suminski bf7d383066 Changed atan2() to VECTOR2D::Angle() 2013-06-21 09:01:40 +02:00
Alexander Lunev 6e977b668c Fix an issue with setting the Reference and Value of a module.
The bug was revealed on re-opening the saved version of a file imported by pcad2kicadpcb.
2013-06-20 15:53:23 -05:00
Maciej Suminski fdc52d933a Fixed some minor rendering issues, mostyl for shaderless OpenGL GAL. 2013-06-20 16:37:21 +02:00
Maciej Suminski 316f7309a1 Bug fixes:
- VBO_CONTAINER::allocate() was returning wrong value in case of error
- framelimiter had wrong formula for computing destined period between frames
- removed _padding field from VBO_VERTEX, as it was not speeding up, but wasting memory
2013-06-20 13:16:12 +02:00
Maciej Suminski ff75a28080 Added a framerate limiter.
Now it does not use all the CPU power while panning even on simple boards.
2013-06-20 09:58:18 +02:00
jean-pierre charras e7b5e816d0 Pcbnew: netlist dialog: add silent mode option, and tool tip to the 2 options (dry run and silent mode)
dialog_display_info_HTML_base: derived now from dialog_shim.
2013-06-19 18:11:12 +02:00
Maciej Suminski db41bc2870 Changed order of used headers, so there is no need to include again 'wx/wx.h' needed by layers_id_color_and_visibility.h 2013-06-19 12:07:25 +02:00
Maciej Suminski 585aeb7f91 Moved fields containing information about currently used color, shader and transformation for vertices from VBO_ITEM to VBO_CONTAINER (OPENGL_GAL). 2013-06-19 10:50:46 +02:00
jean-pierre charras 1b644a164e Pcbnew fix Bug #1192203 (I hope ...)
Bitmap2component: add export for .kicad_mod new footprint file format, and export polygon descr for page layout description (.kicad_wks file)
2013-06-18 19:27:47 +02:00
Maciej Suminski c4e42f46a9 Removed unnecessary functions from VBO_VERTEX. 2013-06-18 17:53:12 +02:00
Maciej Suminski bff4d1239c Removed unnecessary casting from VIEW_ITEM to EDA_ITEM. Added Type() function to VIEW_ITEM. 2013-06-18 17:01:23 +02:00
Maciej Suminski 8a89e160ed Added VBO_CONTAINER as a faster storage for vertices (OPENGL_GAL), tuned for exchanging data with GPU.
Removed a few unnecessary variables and fields from OPENGL_GAL.
Added function GAL::ClearCache() for freeing memory used by cached items.
Fixed a few memory leaks (tesselator, PAINTER's settings & VIEW_ITEM's groups).
Changed a few functions into inlines.
2013-06-18 16:20:29 +02:00
Maciej Suminski 198052358e Added GAL_TYPE_NONE as an indicator of GAL uninitialized state. 2013-06-18 16:19:30 +02:00
jean-pierre charras 6730b7d656 Eeschema: Fix wx28 compatibility issue. 2013-06-17 21:01:47 +02:00
jean-pierre charras f917efd430 Eeschema: Add dialog and utilities (help files ...) to create BOMs from generic netlist, using python scripts or xsltproc+style sheet.
Remove dead code relative to old BOM generation.
Rename witha  more explicit name bom-example?.py , fix some issues and move them from script/bom-in-python/ky to script/bom-in-python
Rename ki.py utility to more explicit  ky_generic_netlist_reader.py
2013-06-15 20:02:52 +02:00
Wayne Stambaugh 7d51fc7dfb Pcbnew netlist read performance improvements.
* Do not search for footprint when no footprint is defined for a component
  in the netlist.
2013-06-15 12:55:51 -04:00
jean-pierre charras b192495bbc Eeschema: add dialog and utilities to create BOMs from generic netlist 2013-06-14 16:59:52 +02:00
Dick Hollenbeck 34a697fc37 fix error message in legacy_plugin 2013-06-13 11:17:25 -05:00
Dick Hollenbeck 2dda514cb0 better error reporting and parsing of bad legacy footprint libs 2013-06-13 11:09:35 -05:00
Dick Hollenbeck 82d667e30c various 2013-06-13 06:43:29 -05:00
Alexander Lunev 29b0b9cfcd Fix pcad2kicad issue, from A. Lunev, and a minor code cleaning in component_references_lister.cpp. 2013-06-12 21:43:22 +02:00
jean-pierre charras ed7f92ebc7 Eeschema: fix Bug #1189893 (ps plot file opened twice) 2013-06-11 16:27:07 +02:00
jean-pierre charras 93ae8f4066 Fix issue in auto panning while moving in EDA_DRAW_PANEL::OnMouseLeaving() 2013-06-10 15:23:58 +02:00
Dick Hollenbeck 6b030ac9be Rename invoke_a_dialog.h. Code an alternate implementation for std::string BOARD_ITEM::FormatInternalUnits( int aValue ), for verification. 2013-06-10 07:24:01 -05:00
Dick Hollenbeck 8470c44bb0 fix autopan non-response problem when dragging block to right or bottom 2013-06-09 13:14:01 -05:00
jean-pierre charras 4c75540ca2 Remove a useless message shown only in debug mode, about page layout file not found 2013-06-09 18:50:57 +02:00
jean-pierre charras 70f43b0003 Cvpcb: Bug fix: Select previous free component crashes Cvpcb when no previous free component found, and both Select next and previous free component where not working very well. 2013-06-09 18:36:54 +02:00
jean-pierre charras 91452f3b58 Custom page layout: add support for poly-polygons (useful for logos) 2013-06-08 20:19:09 +02:00
Wayne Stambaugh daeb396fd8 CvPcb focus and status bar improvements.
* Fixed status bar update bug that caused the selected footprint information
  to be overwritten.
* Remove unnecessary SetFocus() calls in list control OnChar() handlers.
2013-06-08 12:06:26 -04:00
Dick Hollenbeck ad649d9670 *) Introduce "invoke_a_dialog.h" to information hide between top frame
and various DIALOG classes called from top frames.  See comments in
   {eeschema,pcbnew}/invoke_a_dialog.h.
*) Move some dialog classes into *.cpp files from *.h files.
*) void SCH_EDIT_FRAME::OnErc( wxCommandEvent& event ) was opening the modeless
   ERC dialog more than once if icon was clicked more than once.
*) Remove BOM stuff.
2013-06-07 15:56:55 -05:00
jean-pierre charras 0038722d0f Fix compil issue on wxWidgets 2.8.12, created by my last commit. 2013-06-07 19:35:09 +02:00
jean-pierre charras 6a00664b2a Plot files : fix Bug #1188664 (full filename instead of short file name, and swapping between sheet path and file name) 2013-06-07 18:37:44 +02:00
Wayne Stambaugh 2956543d27 CvPcb pin count filtering improvement. (fixes lp:1188325)
* Add option to MODULE::GetPadCount() to exclude non-plated through holes.
2013-06-07 09:17:52 -04:00
Wayne Stambaugh 0fcf722af4 Fix CvPcb library filtering bug. (fixes lp:1188321) 2013-06-07 08:15:32 -04:00
jean-pierre charras ceebdbfdd3 Mainly for testing purposes: page layout: if the environment variable KICAD_WKSFILE points a S expr page layout descr, this descr is used instead of internal descr.
Therefore one can use a custom page layout and title block.
Eeschema, dialog edit component: minor enhancement (the last selected notebook page is remembered during a session)
2013-06-07 13:09:18 +02:00
jean-pierre charras 1b05af7f8e page layout: if the environment variable KICAD_WKSFILE points a S expr page layout descr, this descr is used instead of internal descr. Mainly for testing purposes.
Eeschema, dialog edit component: minor enhancement (the last selected notebook page is remembered during a session)
2013-06-07 11:49:36 +02:00
jean-pierre charras 123b7b5537 Page layout: add comments, and fix a very minor issue.
Eeschema, dialog netlist: fix a bug when removing a plugin panel, when is is not the last.
dialog netlist:Add a predefined command string for python scripts, when creating a new netlist plugin entry.
2013-06-06 20:03:29 +02:00
Wayne Stambaugh 5fa1257e2c CvPcb filtering and other minor improvements.
* Change filtering from single selection to logically and each filter type.
* Remove clear filtering button and logic.
* Filter buttons now behave as true toggle buttons.
* Improve list control pane focus following when using arrow keys to change
  list pane.
* Remove unused parameters from list box constructors.
* Make tab key behave like right arrow key when moving focus to next list
  pane.
* Make list pane focus wrap around to next or previous control.
* Simplify component list filtering code.
* Improve status bar updating.
* Tell Bazaar to ignore .downloads-by-cmake instead of downloads-by-cmake.
2013-06-06 11:37:48 -04:00
Maciej Suminski 5c405a6f40 Removed some debug messages. 2013-06-06 11:54:37 +02:00
Maciej Suminski 03b5d6125b Removed indices storing from VBO_ITEM as they are always consecutive numbers. Removed storing pointers to VBO_ITEMs that have to be drawn - instead they are memcpied to mapped GPU memory.
Some functions of VBO_ITEM became inline.
2013-06-06 11:52:39 +02:00
Dick Hollenbeck 2376811df8 fix libeditframe.cpp, which in release build would not show multipart text in listbox. dialog uses DIALOG_SHIM. 2013-06-05 14:23:55 -05:00
jean-pierre charras c48997608d Fix a minor issue in page layout default descr. 2013-06-05 17:32:24 +02:00
Dick Hollenbeck 8a5285db41 downloads-by-cmake now configurable, fix wx2.8 compiler errors 2013-06-05 09:24:03 -05:00
jean-pierre charras c4d6fc943a Add info and comments about page layout description using S expressions 2013-06-05 15:21:14 +02:00
jean-pierre charras 3655df08ea All: use a S expression to describe the page layout (title block and grid references). Work in progress.
This should  allow users to define their own page layout.
2013-06-05 14:03:16 +02:00
Maciej Suminski 7858e6aa7c Changed data structure in VBO_ITEM. 2013-06-05 10:48:30 +02:00
Maciej Suminski c909988aa5 Upstream merge. 2013-06-05 10:01:53 +02:00
Dick Hollenbeck 5deaba9669 Fix wierd ConfigBaseWriteDouble's Printf( wxT("%12f"), aValue ); format string
which was creating silly strings like 

  PcbTextThickness="    0.300000"

in kicad.pro files.
2013-06-04 09:44:21 -05:00
Dick Hollenbeck f162b6662b comment 2013-06-04 09:44:08 -05:00
Maciej Suminski 2d5f342ee8 Switching to OpenGL using shaders backend on the fly (changed keyboard shortcuts: different backends are available using Alt+F9..F12). 2013-06-04 16:18:33 +02:00
Maciej Suminski 85a2aee79c Introducing shaders.
Shader's parameters are stored in VBO_ITEM. Changed VBO_ITEM data structure. Added UseShader() function for selecting shader for a given VBO_ITEM.
Added one main vertex & fragment shader program to be used for with all kinds of items (type of shader is selected using attributes that are stored in VBO). Currently available shaders are: at-least-1px-width line, filled circle and stroked circle.
Removed unnecessary param (aDepthOffset) from a few functions (OPENGL_GAL::drawSemiCircle(), OPENGL_GAL::drawLineCap()). Removed function OPENGL_GAL::DrawRoundedSegment(). Changed some asserts to debug info or error log.
2013-06-04 15:58:53 +02:00
Dick Hollenbeck a4cc671c22 speedups 2013-06-03 08:09:37 -05:00
Maciej Suminski 2912138ef2 Display linking errors in debug mode for shaders. Added SHADER::GetAttribute() function for getting shaders attribute location. 2013-06-03 10:54:24 +02:00
Dick Hollenbeck cdae489afa include only the boost headers in the scratch repo 2013-05-31 23:04:56 -05:00
Dick Hollenbeck 51ad0c18ff *) Refinements to ExternalProject_Add( boost )
*) Enhancements to make_lexer().
*) Support multi-threaded build.
*) Switch to "bzr patch" from patch.exe for Windows users.
2013-05-31 16:36:40 -05:00
Dick Hollenbeck 998255fb1b add copyright message to download_boost.cmake 2013-05-31 16:26:08 -05:00
Dick Hollenbeck edfb5811cf *) Refinements to ExternalProject_Add( boost )
*) Enhancements to make_lexer().
*) Support multi-threaded build.
*) Switch to "bzr patch" from patch.exe for Windows users.
2013-05-31 16:22:34 -05:00
Michal Jahelka c733b32672 Add filtering footprint list by library to CvPcb
* Add third list control with library names.
* Add button to toolbar to select filter by library name.
* Add bitmap for filter by library name toolbar button.
* Remove custom UI colors from list controls.
2013-05-31 13:33:46 -04:00
Dick Hollenbeck 38862c1a09 add support for exponents in dsnlexer.cpp's DSN_NUMBER token 2013-05-31 09:24:56 -05:00
Dick Hollenbeck 03161c81df remove boost and make it an external project, so the procedure for upgrading is better documented 2013-05-30 23:46:02 -05:00
Dick Hollenbeck 264c73747a factor out isNumber() in dsnlexer.cpp, add support for numbers with exponents, leave commented out for further testing 2013-05-30 20:20:37 -05:00
Dick Hollenbeck 5e53e410ce factor out isNumber() in dsnlexer.cpp, add support for numbers with exponents, leave commented out for further testing 2013-05-30 19:49:22 -05:00
Dick Hollenbeck b42ec57f6f fix buggy double2str() 2013-05-30 16:46:14 -05:00
jean-pierre charras 4d0f664f50 Pcbnew: Fix Bug #1185556. fix issue about Solder Paste Ratio value which was accepting only one digit in mantissa in 3 dialogs (now 6 digits in all dialogs).
fix potential issue in .kicad_pcb file creation, in some places where a %g or %.16g format was used:
al least under Mingw/gcc4.7.2, the floating number was written using scientific notation, not accepted by the S-expr reader.
2013-05-30 21:32:00 +02:00
jean-pierre charras 2ea3b8b068 Kicad template selector dialog: add an info line showing the template path in use. Fix very minor bug #1185462 2013-05-29 20:37:22 +02:00
jean-pierre charras 0810492a2c Fix issue created by the template selector change, on Linux. 2013-05-29 20:00:40 +02:00
jean-pierre charras c5178979ce Kicad template selector dialog: add info line showing the template path in use. 2013-05-29 14:03:03 +02:00
Wayne Stambaugh 08bdaf07be More Pcbnew footprint library table work in progress.
* Add footprint library table loading to footprint editor.
* Overload FOOTPRINT_INFO::ReadFootprintFiles() to read footprints from the
  footprint library tables.
* Fix a bug in FP_LIB_TABLE::IsEmpty() when the table has a fallback table.
* Add code to FOOTPRINT_EDIT_FRAME to use footprint library tables.
* Add an optional build time version of PCB_EDIT_FRAME::loadFootprints() to
  populate netlist footprints from footprint library table.
* Remove adding footprints to board whenever GetModuleLibrary() is called and
  move loading locally as required.
* Add missing source file license comments and coding policy fixes.
2013-05-28 12:54:59 -04:00
jean-pierre charras 832764aa3a Dialog page setting: replace wxStaticBoxSizer by wxBoxSizer + static text,
because under Linux and wxWidgets 2.9, wxStaticBoxSizer are very ugly (text not readable in this dialog)
(Does not happen with wxWidgets 2.8)
Eeschema hotkeys: remove duplicate keys in key editor.
2013-05-28 11:49:53 +02:00
jean-pierre charras 43c87d0cb6 eeschema: fix Bug #1184318 (Eeschema-Libedit: Reference moving+zooming issue)
and fix a minor issue in netlist dialog.
2013-05-28 10:05:10 +02:00
jean-pierre charras 6a6b944c00 eeschema: netlist dialog: fix a very minor issue. 2013-05-27 15:59:10 +02:00
jean-pierre charras 90eb83dcb2 Pcbnew: fix bug Bug #1184362 (Pcbnew losing user (custom) sheet size )
Fix minor issues in print/plot: filename not printed, sheetname incorrect in eeschema
2013-05-27 11:17:37 +02:00
Maciej Suminski 31b722f9d3 Added tesselation of polygons for VBO based rendering (OpenGL GAL). 2013-05-27 09:37:49 +02:00
Dick Hollenbeck e3351a9686 1) Add "rules" to base of tree for copying into BZR_HOME/rules.
File "rules" has instructional text as comments near top.

2) Convert all text files in repo to LF line ending form.
   Any checkout done with "rules" in play will convert the working
   tree to native line ending, while keeping repo as LF line ending.
2013-05-25 23:36:44 -05:00
jean-pierre charras 19dea9095e Pcbnew! fix Bug #1184030
very minor other chnages.
2013-05-25 18:10:19 +02:00
jean-pierre charras 3b023da602 Cvpcb fix bug #1183796 and fix bug when a fp lib is not found : the name of the missing file was not displayed in message window. 2013-05-25 17:02:16 +02:00
jean-pierre charras 33d0a72fce Netlist reader: fix issue when reading an ORCADPCB2 netlist (which fixes also bug 1184023) and fix a Cvpcb crash when trying to read an unknown netlist format. 2013-05-25 12:41:24 +02:00
jean-pierre charras 5136fc535f 3D viewer: fix Bug #1183581 (pcbnew 3D viewer: recent UI inconsistency )
Pcbnew: fix bug in drag module: connected tracks were not dragged.
worksheet: code cleaning.
2013-05-25 11:01:44 +02:00
Dick Hollenbeck 16a21ade8f remove "~" from empty *.lib component fields, replace with "", doctor old *.lib fields to blank if that was the intention 2013-05-24 18:58:29 -05:00
Dick Hollenbeck ec2b2dc291 copyright and formatting 2013-05-24 16:30:27 -05:00
jean-pierre charras 2703a5aebd Fix bug #1183802 : incorrect sheet Id (company name displayed instead of Id) 2013-05-24 16:06:58 +02:00
jean-pierre charras 4bdd21b281 More about worksheet code. 2013-05-24 10:59:40 +02:00
Lorenzo Marcantonio 499d41206e Make title block date field modifiable by hand. 2013-05-23 14:45:23 -04:00
jean-pierre charras ece008e790 Worksheet code: more cleanup, and fix compil issue with wxWidgets 2.8 2013-05-23 18:38:17 +02:00
Dick Hollenbeck d1cfa88bc0 fix license text in COPYRIGHT.txt, remove duplicate Documentation/copyright.txt 2013-05-23 08:43:42 -05:00
jean-pierre charras 0e28b55184 worksheet code cleaning and fix plot sheet filenames bug (mainly under Linux) (Bug #1182891 ) 2013-05-22 17:43:22 +02:00
jean-pierre charras afccbbe04d worksheetcode cleaning and fix plot sheet filename bug under Linux. 2013-05-22 17:08:57 +02:00
jean-pierre charras a4cec09781 Worksheet code: cleanup and remove useless parameters. 2013-05-22 10:45:25 +02:00
jean-pierre charras 54d70ec738 Remove duplicate code to draw and to plot title blocks (more than 1500 duplicate lines). Note: this is a work in progress.
Code cleanup
2013-05-21 09:44:46 +02:00
jean-pierre charras 39c3a38e2d Remove duplicate code to draw and to plot title blocks. 2013-05-21 09:18:25 +02:00
Wayne Stambaugh 699897ddf8 Pcbnew footprint library table work in progress.
* Add code for loading, modifying, and saving the global and project
  footprint library tables.
* Add code to load MODULE objects using the footprint library table to
  the footprint viewer.
* Add static methods to FP_LIB_TABLE to support loading footprint library
  tables.
2013-05-20 10:49:20 -04:00
jean-pierre charras 00d3af4816 Code cleaning and move worksheet code specific to title block and frame references shape in title_block_shapes.h and title_block_shapes_gost.h 2013-05-19 21:35:49 +02:00
jean-pierre charras ceadbbcdc1 Gerbview: fix bug #1176538 (incorrect flashed items size, when defined by aperture macros) 2013-05-18 18:56:03 +02:00
jean-pierre charras e703b53b3a Eeschema: fix Bug #1180902 (Libedit creates empty svg images) 2013-05-18 11:38:23 +02:00
jean-pierre charras f037cc3c74 3D viewer: Add more options, to show/hide technical layers. 2013-05-16 21:04:21 +02:00
Maciej Suminski 7dec942ef7 Different way of rendering groups (with a single DrawElements call) in OpenGL GAL. 2013-05-16 18:43:25 +02:00
Maciej Suminski 1d0ca22572 Different way of measuring render time. 2013-05-16 17:17:35 +02:00
Dick Hollenbeck a6decc3cc7 compiler warning from mailing list 2013-05-16 09:40:46 -05:00
Maciej Suminski b58cc107e6 Changed functions for adding vertices in VBO mode to make code easier to read and understand. 2013-05-16 14:47:34 +02:00
Maciej Suminski a593306a06 Fixed time measuring functions (only for profiling in debug) 2013-05-16 13:46:00 +02:00
Maciej Suminski 0177590699 Faster way of caching items for OPENGL GAL. 2013-05-16 10:35:16 +02:00
Maciej Suminski 787fe28fd0 Added functionality for transformation of VBO vertices, extended functions like translate, rotate, scale using glm library. Removed D() macro, as it was not used, but in conflict with glm library. Added VBO_ITEMs for circles, semicircles. Now almost everything is drawn using VBO (besides polygons and grid). 2013-05-15 16:48:10 +02:00
Maciej Suminski 541568e09f Layer depth is set during items caching (so now they are rendered on proper layers). 2013-05-15 16:47:17 +02:00
Maciej Suminski 5dd7ef6895 Assured that there are no excessive initializations 2013-05-15 16:47:01 +02:00
Dick Hollenbeck 153df79699 replace BOM dialog with a pointer to FAQ https://answers.launchpad.net/kicad/+faq/2265 2013-05-15 05:32:41 -05:00
Maciej Suminski 4ad9af71f5 All kind of items are loaded on SetBoard() again. 2013-05-15 09:17:48 +02:00
Maciej Suminski d76671a601 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 ea094a4fbc Added some debug informations. 2013-05-15 09:17:36 +02:00
jean-pierre charras cb11dad4de Pcbnew: fix bug 1179877, due a bad default copy constructor, after my changes about CPOLYGONS_LIST class.
More about CPOLYGONS_LIST work.
2013-05-14 20:47:01 +02:00
Maciej Suminski 817cf192c8 Fixed build for eeschema. 2013-05-14 10:46:43 +02:00
Maciej Suminski aec00ab96f Removed double freeing of some of Cairo paths. 2013-05-14 10:42:56 +02:00
Maciej Suminski 48b288cdc2 Modified SetOffset (VBO_ITEM/OpenGL GAL) function. 2013-05-14 10:41:05 +02:00
Maciej Suminski 66d257f620 Drawing tracks using PushVertices, added some comments, fixed formatting. 2013-05-14 10:38:25 +02:00
Dick Hollenbeck dd14218c34 remove non-UTF8 encoded characters from source tree & format fix 2013-05-13 12:30:27 -05:00
Maciej Suminski 918231795b Added possibility of adding multiple vertices to VBO_ITEM at once 2013-05-13 11:14:35 +02:00
Maciej Suminski 9f71172437 Fixed Cairo issues and some possible memory leaks 2013-05-13 10:55:35 +02:00
Wayne Stambaugh 69e3b23960 Decouple PLOT_CONTROLLER from UI dependencies. 2013-05-10 15:22:29 -04:00
Maciej Suminski 7b426e8103 Fixed memleak, removed excessive recaching, still there is a problem with Cairo caching 2013-05-10 16:05:40 +02:00
Wayne Stambaugh 27e1043fc4 Fix footprint library search path bug. (fixes lp:1178427 2013-05-09 21:51:55 -04:00
jean-pierre charras 76518712c4 More work on CPOLYGONS_LIST class.
Pcbnew: fix minor bug about  plot line width.
2013-05-09 21:08:12 +02:00
Wayne Stambaugh 64843d6b0a 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 87fa661591 More work on CPOLYGONS_LIST class. 2013-05-08 20:20:58 +02:00
jean-pierre charras 2ec6d22131 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 f6ac92dc39 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 be69f7ad20 Fix bug when footprint library file names contain dots. (fixes lp:593989) 2013-05-06 13:57:18 -04:00
Lorenzo Marcantonio 9a7cc494f7 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 8c3d4d4eda Eeschema: fix incorrect move command for bitmap items. 2013-05-06 15:38:14 +02:00
Lorenzo Marcantonio 636ca7a74b Removed Show code from BOARD_ITEM derived classes (as requested by Dick) 2013-05-05 12:23:18 +02:00
Lorenzo Marcantonio c57c1e94d1 Fixed LAYER_NUM usage in the specctra code.
A specctra layer is not a LAYER_NUM, so that's probably why it was difficult to use.
2013-05-05 12:11:30 +02:00
Lorenzo Marcantonio 1e1c2cbb7d 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 5399b6f438 More int casts to rounding conversions 2013-05-04 13:57:09 +02:00
jean-pierre charras 41b6c8434a 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
Felix Morgner 3031b9e6a5 Fixes implementation of MacOpenFile( const wxString& ) in KiCad.
Adds "kicad_pcb" to the list of file-extensions for PCBnew in its Info.plist 
to make Launch Services recognize the file associations.

Change 8 bit string to UTF8 so fancy mew in "um" can be shown.
2013-05-02 23:04:30 -05:00
Lorenzo Marcantonio 0d5331df59 Fixed bad computation in eeschema/transform (my fault)
Note: ArcTangente gives a double but *takes* ints, so it's not good to
use for nontrivial things
2013-05-02 22:53:12 +02:00
jean-pierre charras bca75d4930 Fix compil issue in Debug mode. 2013-05-02 20:42:08 +02:00
Lorenzo Marcantonio a70965eb6d 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
Dick Hollenbeck ad21bfda4d fix compiler warnings 2013-05-02 09:12:55 -05:00
jean-pierre charras fef46ffacf 3D viewer: Modify the 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-02 07:56:22 +02:00
jean-pierre charras f803745fc6 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 c36ab1c6ed 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 28f9d7f28f remove temporary debug printf()s I no longer need. 2013-05-01 10:49:34 -05:00
Dick Hollenbeck 5b225186c4 fix 2 corner case bugs in specctra import 2013-05-01 10:48:00 -05:00
Dick Hollenbeck 09bb2a6054 pass round boards to freerouter via specctra_export 2013-05-01 08:36:26 -05:00
Dick Hollenbeck e1ea1237b7 fix goofy text messages, period after newline 2013-04-30 14:51:33 -05:00
Maciej Suminski fb65f5d1ae Improved recaching (all items when a board is loaded), still needs some fixing (mem leak). 2013-04-30 17:55:24 +02:00
Dick Hollenbeck ff439ecd7f wxString::Format() fix 2013-04-30 10:52:18 -05:00
Dr. Thomas Spindler 4cc4df87ff specctra_export supports interior polygons and circles on the Edge.Cuts layer.
Interior regions on Edge.Cuts are out as keepouts for specctra DSN file
and downstream routers.  Point to point matching during polygon assembly
can have individual thresholds, one for board edge and another for interior polygons.
This is more forgiving for sloppy graphical mousers, or those that work without
grid snap on.  Currently the threshold for board edge is at zero, meaning the
board edge has to be precisely defined as a polygon, just as before.  But it
is easily tunable for experimentation.
2013-04-30 10:25:41 -05:00
Maciej Suminski 56aabe20bc Introduction of VBO. Now only tracks are rendered in a very simple way. 2013-04-30 15:59:32 +02:00
Lorenzo Marcantonio 4b624381e0 Added include guard to math_for_graphics.h 2013-04-30 15:27:08 +02:00
Wayne Stambaugh c5508f34b3 Pcbnew bug and warning fixes.
* Fixed a bug in PCB_EDIT_FRAME::loadFootprints when no footprint libraries
  are found when attempting to load footprints.
* Add a warning to PCB_EDIT_FRAME::loadFootprints to inform the user when
  a footprint library file cannot be found in any of the standard library
  search paths.
* Changed FOOTPRINT_INFO::m_padCount to unsigned to prevent signed/unsigned
  comparison compiler warnings.
* Put NestedSpace() function in netlist_reader.cpp inside conditional debug
  build statement to prevent warning in release builds.
2013-04-29 17:00:24 -04:00
Felix Morgner 3c667d7652 merge with upstream 2013-04-29 12:56:12 -04:00
Felix Morgner 4664427784 * Set "Ctrl+Shift+S" as shortcut for "Save as..." in CvPcb and PCBnew.
This seems to me like the defacto standard for this menu command.
* Added a default filename for save as. Currently it's set to
  "Unnamed file" using _() so its translatable.
* Changed the save dialog in PCBnew to use the path of the "original"
  file as a base for the new file.
2013-04-29 12:50:10 -04:00
Dick Hollenbeck c747ffef95 fix compiler warnings, comments, debug crash, and conceptual issues in specctra 2013-04-29 11:35:07 -05:00
Felix Morgner b5b1777304 merge with upstream 2013-04-28 18:47:58 -04:00
Wayne Stambaugh 228004b472 More post Pcbnew NETLIST_READER change clean up.
* Fix both legacy and s-expression netlist readers when footprints are
  assigned in the netlist.
* Add some helper functions to NETLIST for detecting when footprints are set
  or not set and when they have been changed while loading the .cmp file.
* Rename a few functions to improve their readability.
2013-04-28 16:20:40 -04:00
Lorenzo Marcantonio a1f91c08ad Converted macros to inline template function 2013-04-28 17:43:26 +02:00
Lorenzo Marcantonio 96dc27d9e6 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
Lorenzo Marcantonio 11f9f15199 Message fix: SMD is an acronym, should be upper case 2013-04-28 15:34:59 +02:00
jean-pierre charras 991a92429e Pcbbnew: fix bug Bug #1172892 (bad drill map file names, when a point is used inside a board file name) 2013-04-28 11:10:54 +02:00
Felix Morgner 4f17dc0716 merge with upstream 2013-04-27 17:58:38 -04:00
Dick Hollenbeck 37c7fa9fb4 Fix SVG plot with filename containing & character. 2013-04-26 21:12:57 -05:00
Felix Morgner fd2f700390 merge with upstream 2013-04-26 11:24:44 -04:00
Wayne Stambaugh 97255b2b7f 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
Felix Morgner 8d32141b8f resaved some files as UTF-8 to silence clangs warnings about illegal character encodings. 2013-04-25 18:31:14 -04:00
Felix Morgner 7700779e2c made changes compliant to style guide. 2013-04-25 13:27:43 -04:00
Felix Morgner 1cc9d2ce5a merge with upstream 2013-04-25 13:22:52 -04:00
Maciej Suminski b9980df1b7 Upstream merge. 2013-04-25 18:42:27 +02:00
Maciej Suminski af8b256a00 Changed non-shader primitives to GL_TRIANGLES. 2013-04-25 18:30:53 +02:00
Wayne Stambaugh 324c39931c 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
Dick Hollenbeck 113325673f pcb_parser failed on (fill yes (arc_segments 16) (thermal_gap 1.99898) (thermal_bridge_width 1.99898))
See http://tech.groups.yahoo.com/group/kicad-users/message/15105
2013-04-25 07:25:47 -05:00
Maciej Suminski 857b02706e Fixed tracks drawing using Cairo backend with caching turned on. 2013-04-25 10:26:32 +02:00
Maciej Suminski 1e0f1b39b0 Fixed color issue for stroked fonts with OpenGL backend and caching turned on. 2013-04-25 10:00:25 +02:00
jean-pierre charras 6a429facb6 Pcbnew, dialog SVG export: Fix Pcbnew crash when opening the dialog. 2013-04-25 09:05:33 +02:00
Maciej Suminski 8663a6c7a0 Added caching of multilayer items (storing multiple group ids for items). 2013-04-24 11:28:11 +02:00
Maciej Suminski b6ec124ceb Removed BeginLayer and EndLayer functions. Resolved Cairo layers drawing problem in a different way. 2013-04-24 09:48:34 +02:00
Maciej Suminski 85a3b72c71 wxWidgets 2.8 compatibility fix. 2013-04-23 18:20:45 +02:00
Maciej Suminski d9b489d471 Changed view control settings to KiCad default (panning, zooming, etc.) 2013-04-23 12:07:14 +02:00
Maciej Suminski 3289c6c305 Modified shaders' source path. 2013-04-23 09:52:51 +02:00
Felix Morgner ec83adde3f Updated the pcbnew Info.plist to associate .kicad_pcb files with pcbnew. 2013-04-22 12:20:34 -04:00
Maciej Suminski 206c8e1189 Drawing SMD pads with colors defined by "Pads Front"/"Pads Back" color settings. 2013-04-22 12:13:48 +02:00
Maciej Suminski 07545ba49c Fixed wheel scroll event on Windows 2013-04-22 11:08:02 +02:00
Maciej Suminski 8312497d6c Modified way of switching canvas 2013-04-22 11:07:38 +02:00
Felix Morgner eed2bed0bd changed implementation of MacOpenFile to make it open files when they are double clicked in Finder. 2013-04-21 20:31:09 -04:00
Wayne Stambaugh 49045cf08c Fix KiCad crash when no template is selected on new project from template. (fixes lp:1170973) 2013-04-21 15:44:57 -04:00
Maciej Suminski 55f7a99d1b Cairo now renders layers properly (colors are not saturated after layer composition), but slower. 2013-04-19 18:19:50 +02:00
Maciej Suminski 98addf78b4 Some cleanup. 2013-04-19 18:19:20 +02:00
jean-pierre charras 4b42ec3218 Pcbnew: fix bug in pcb_parser: incorrect pad local solder paste margin ratio value read when not 0. ( This also fixes bug 1170535 ) 2013-04-19 09:14:27 +02:00
Matthew Beckler e469d9d1f9 Fixes to scripting after refactoring & interface cleanups, 2013-04-18 23:23:11 +02:00
Miguel Angel Ajo d53d9d88fb Support to enable color from PLOT_CONTROLLER into plotters that start in B/W 2013-04-18 23:21:26 +02:00
Dick Hollenbeck ed484deec6 hide pageFmts[] since it is no longer NULL terminated and not global 2013-04-18 13:54:03 -05:00
Dick Hollenbeck df9502dd06 fix some compiler warnings 2013-04-18 12:03:47 -05:00
Dick Hollenbeck 6001254160 fix Lorenzo's bug introduced in rev. 4082 2013-04-18 12:03:25 -05:00
Maciej Suminski 2b0c4ba215 Turned on group recaching on GAL change. 2013-04-18 17:10:02 +02:00
Maciej Suminski 1e9088f7d2 Fixed non-GAL build. 2013-04-18 11:46:23 +02:00
Maciej Suminski ec9e283d34 Fixed resize issue (moved GAL panel into pane).
Tidied up event handlers.
2013-04-18 11:20:19 +02:00
Stefan Helmert 20e7d431a6 The internal BOM generator has bugs. I designed an XSL script, which converts the generated XML Partlist into
a CSV file for Libre Office or Open Office.  It is very easy to use. You can specify it as a plugin for 
Eeshema netlist generator.

It searches for all field names, generates the table headings accounting for all fields found in any part.
Then stuffs all the parts rows according to proper fields.
2013-04-17 09:57:47 -05:00
Maciej Suminski 6c745e6e9b Fix for drawing polygons. 2013-04-17 13:59:46 +02:00
Maciej Suminski d1635e17f6 Fixed drawing of PCB_TARGET items. 2013-04-17 13:12:54 +02:00
Maciej Suminski f9e5881b45 Removed unnecessary calls to cairo drawing functions. 2013-04-17 12:50:38 +02:00
Maciej Suminski 869505a659 Added const(..)& in GAL methods' parameters and change iterators to constant iterators. 2013-04-17 12:48:37 +02:00
Maciej Suminski 895d265603 Added GAL::DrawSegment for drawing rounded segments (used for drawing tracks). 2013-04-17 12:38:00 +02:00
Maciej Suminski e5e60c6bed Fixed drawing arcs in Cairo GAL. 2013-04-17 12:33:11 +02:00
Maciej Suminski 568e6c8093 More accurate rendering display of ZONE_CONTAINERs. 2013-04-17 12:30:21 +02:00
Maciej Suminski cf01f1a264 Fixed drawing polygons using Cairo-based GAL. 2013-04-16 14:55:21 +02:00
jean-pierre charras be7de02a1d Eeschema: fix bug #1168116. Netlist generation: remove dead code and fully outdated option pspice "use net number"
Pcbnew: layer manager: display tooltips using translated form (where internationalized, but always shown in English).
2013-04-16 12:53:23 +02:00
Maciej Suminski b8d88f0dc5 Removed flickering in Cairo-based rendering backend. 2013-04-16 11:43:13 +02:00
Maciej Suminski 698bc0cdac Cleanup 2013-04-16 11:16:27 +02:00
Maciej Suminski 48a7a863ae Inverted Y display axis while using Cairo-based rendering backend. 2013-04-15 17:59:38 +02:00
Maciej Suminski f2c4fa2b46 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 f996d6cc7a Introduced SetGAL() functions that will allow changing GAL backend for rendering on the fly. 2013-04-15 16:03:05 +02:00
Lorenzo Marcantonio 0dbf3ef30a Changed format specifiers of some printf involved with size_t values to %zu to avoid runtime assertions. 2013-04-14 13:02:19 +02:00
Lorenzo Marcantonio 76b558c831 Closes bug 1168753.
Depending on build options seems that wx uses different types for size() so the Format string was not always correct. Put a fat warning in a comment too.
2013-04-14 10:26:42 +02:00
Matthew Beckler c10bb66b12 Match 'new char[]' with proper delete[] char* rather than delete char*. 2013-04-13 23:07:04 -05:00
Dick Hollenbeck 89a391d001 move project templates from source tree to library tree 2013-04-13 16:30:21 -05:00
Maciej Suminski 0fef63956f Fixed text display using Cairo. 2013-04-12 16:41:31 +02:00
Maciej Suminski 63c2af4fa4 Tesselation error fix.
Added missing callback function (combine callback).
2013-04-12 10:37:06 +02:00
Wayne Stambaugh 3ff7ddbea7 wxWidgets 2.8.12 build fix 2013-04-12 09:30:18 +02:00
Maciej Suminski 21733e7bda Copyright change 2013-04-12 09:16:52 +02:00
Dick Hollenbeck 3fa60aaed8 use lower case library names in *.pro & *.sch files, to match actual filenames in the template file set. Noticed on linux. 2013-04-11 14:04:30 -05:00
Lorenzo Marcantonio 9422e37c45 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
Dick Hollenbeck c074c8c9d4 revert text strings for clarity 2013-04-11 13:00:36 -05:00
jean-pierre charras 27c4956046 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 ebbd7c48d3 Added multiline strings and text overbars rendering using GAL. 2013-04-11 14:21:59 +02:00
Maciej Suminski 079edee146 Copyright notices fix. 2013-04-11 10:04:38 +02:00
Dick Hollenbeck 87f9452bbe 2.9 wx rat race 2013-04-10 16:06:49 -05:00
Dick Hollenbeck 9c0c64e87b Make project templates work with KICAD_PTEMPLATES env var. 2013-04-10 15:31:40 -05:00
jean-pierre charras 3b65c120e8 Pcbnew: fix Bug #1167364
pcb_calculator: fix bug Bug #1167345
2013-04-10 21:20:35 +02:00
Lorenzo Marcantonio 3289835b53 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
Dick Hollenbeck 7745d37d6c revert to using quotes around variable text which may be blank 2013-04-10 10:08:01 -05:00
Maciej Suminski 37e440b093 Upstream merged 2013-04-10 15:03:35 +02:00
Maciej Suminski 7792364e8c Temporarily disabled display of netlabels on pads due to performance drop. 2013-04-10 13:47:19 +02:00
Maciej Suminski 3a4ad03492 Fix for compatibility with wxWidgets 2.8 & 2.9 at the same time. 2013-04-10 10:09:23 +02:00
jean-pierre charras cac7dbc607 All: fix some issues in messages to translate. Remove fully outdated files 2013-04-10 09:23:20 +02:00
Maciej Suminski 7326c9cb73 Removed OpenGL different drawing modes, as they were not used.
Removed DRAW_MODE_NORMAL, DRAW_MODE_PREPARE_EDGES, DRAW_MODE_DRAW_EDGES modes.
2013-04-10 09:09:48 +02:00
Lorenzo Marcantonio beb8e76bb4 Removed ugly usage of an extra layer slot for the layer count in gerbview
Fixed layer picker for exporting to pcbnew
Realigned pcb layer name with class BOARD
2013-04-10 09:03:19 +02:00
Lorenzo Marcantonio 43e37caf46 Fixed pad preview color 2013-04-09 21:20:21 +02:00
Lorenzo Marcantonio a985798a86 Better strings for the translators (converted concatenations to formats) 2013-04-09 19:49:01 +02:00
Lorenzo Marcantonio d09cca948f 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 3f52031b86 Factored out text anchor drawing
More layer classification cleanup
2013-04-09 18:00:46 +02:00
Maciej Suminski 7448116f37 Netnames and pad numbers are displayed on pads (using GAL) 2013-04-09 16:12:20 +02:00
Maciej Suminski 4e0d54fe21 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 10d8275962 Fixed line style used for displaying texts. 2013-04-09 16:12:17 +02:00
Maciej Suminski 157cbc2f68 Fixed drawing of circles in certain circumstances using OpenGL. 2013-04-09 16:12:16 +02:00
Lorenzo Marcantonio 7d64d2e92a Printf was missing a GetChars 2013-04-09 04:31:36 +02:00
Wayne Stambaugh f86261c812 Fix compile bug in ptree.cpp with wxWidgets 2.9.x and MinGW. 2013-04-08 20:16:53 -04:00
Dick Hollenbeck e1eb33a320 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 cadcc20ea6 Fixed distorted polygons' corner display 2013-04-08 11:01:49 +02:00
Maciej Suminski 56ad7642c9 Added outline display mode for pads, vias & tracks 2013-04-08 10:54:31 +02:00
Maciej Suminski d1695d3408 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
jean-pierre charras b51fbe5c50 Make some messages translatable.
Make dialog footprint wizard list resizable.
2013-04-08 09:13:26 +02:00
Marco Mattila 04c0ba65d2 Use the boundary of the object and not just the boundary of the text in SCH_TEXT hit testing. 2013-04-07 21:49:13 +03:00
Lorenzo Marcantonio c2f5e7d88c 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 f456a92f08 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 48419d8fd9 Removed arbitrary MAX_LAYER_ROWS limit (only used in one assertion, anyway) 2013-04-06 18:46:03 +02:00
Lorenzo Marcantonio 0ef5dbac4a 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 8014e0d993 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 739238659e 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 6de593c771 Factored layer utility functions: classification, layer flip and mask flip 2013-04-05 21:04:58 +02:00
Lorenzo Marcantonio 4e9fd3ee9d New color palette 2013-04-05 19:23:56 +02:00
Lorenzo Marcantonio 900056be44 Typo fix 2013-04-05 17:09:04 +02:00
Maciej Suminski 221cb6d5b2 Fixed bug of displaying stroked rectangles on wrong layer depth. 2013-04-05 15:10:58 +02:00
Maciej Suminski 83e693c78a Fixed code formatting. 2013-04-05 15:10:31 +02:00
Lorenzo Marcantonio 8db5848e91 Removed the default generation of phantom text by the postscript plot driver.
It crashes Adobe's own implementation of postscript!
2013-04-05 10:55:46 +02:00
jean-pierre charras 27807f02c5 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 30e31ff164 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 ee0fe85cd0 Added setting active layer in PAINTER's render settings according to the PCB layer widget. 2013-04-04 14:17:40 +02:00
Maciej Suminski b2270b2f4f Added missing CMakeModules (Cairo & GLEW). 2013-04-04 11:52:16 +02:00
Maciej Suminski 141252b73f Added GetSettings() method for obtaining current rendering settings used by PAINTER class. 2013-04-04 11:23:23 +02:00
Maciej Suminski 7c4ac2e3a4 Added GetMinDepth()/GetMaxDepth() methods (useful for displaying things on the top or on the bottom). 2013-04-04 11:21:35 +02:00
Maciej Suminski 46b731b2d3 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 bd76e47976 Pcbnew: fix Bug #1163201. Fix Bug #1162779. Fix incorrect comment in CMakeLists.txt. 2013-04-03 18:16:26 +02:00
Maciej Suminski bd2c878b35 Added painting of DIMENSION & PCB_TARGET items. Removed unnecessary header inclusion. 2013-04-03 11:19:13 +02:00
Maciej Suminski 84ee9591d1 Added loading layer visibility settings when loading a board. Minor code cleaning. 2013-04-03 11:19:08 +02:00
Lorenzo Marcantonio 15b27fa35f Meaningful tooltip for ECO layers 2013-04-02 19:11:42 +02:00
Lorenzo Marcantonio e41536484b Fixed idiotic merge error in busentry handling 2013-04-02 18:04:12 +02:00
Maciej Suminski d3004fc833 Showing module's value and reference text on proper layers. 2013-04-02 11:03:15 +02:00
Maciej Suminski 395c5fc922 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 c20de314cc 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
jean-pierre charras 4881e6477f Eeschema: Minor changes in dialogs to ensure a better likeness between dialogs on Linux and Windows (mainly, remove some useless wxStaticBoxSizer in dialogs)
Update Clipper version.
2013-04-01 14:41:46 +02:00
Lorenzo Marcantonio 93609837dd Removed unused width attribute from schematic line 2013-04-01 13:59:19 +02:00
jean-pierre charras a8b3c20e66 Minor changes in dialogs to ensure a better likeness between dialogs on Linux and Windows (mainly, remove some wxStaticBoxSizer in dialogs) 2013-04-01 13:42:09 +02:00
jean-pierre charras db2fba1faa Minor changes in dialogs to ensure a better likeness between dialogs on Linux and Windows (mainly, remove some wxStaticBoxSizer in dialogs) 2013-04-01 12:50:01 +02:00
Lorenzo Marcantonio bf9cbb4491 Refactoring: split in two the SCH_BUS_ENTRY class 2013-04-01 12:35:20 +02:00
Lorenzo Marcantonio 18f32cfbd6 Removed unused defines 2013-04-01 07:53:38 +02:00
Lorenzo Marcantonio a5a3ef17b8 Converted the IS_BUS/IS_WIRE define to an enum 2013-04-01 07:47:44 +02:00
Lorenzo Marcantonio 326b827cc6 Better type safety to DANGLING_END_ITEM (SCH_ITEM* instead of void*) 2013-04-01 07:26:53 +02:00
Lorenzo Marcantonio 961efac8e2 Removed the long time dead SCH_POLYLINE class (schematic level polyline) 2013-03-31 22:40:22 +02:00
Lorenzo Marcantonio 418d26d250 Hide the anchor for hidden text (suggested by Sergey Borshch) 2013-03-31 20:57:31 +02:00
Lorenzo Marcantonio 07fb2a3e93 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
jean-pierre charras 5006cca67b Minor cosmetic fixes (mainly on Linux) in dialogs. 2013-03-31 14:44:23 +02:00
Wayne Stambaugh 735e3b71d6 Fix build errors in layer mask changes. 2013-03-30 19:41:08 -04:00
Lorenzo Marcantonio d9da8228d4 Minor flags and layer mask cleanup 2013-03-30 20:55:26 +01:00
Lorenzo Marcantonio b5a7e66134 Fixed the logic for "do you want to make the footprint visible" requester
(meaning was inverted)
2013-03-30 18:49:58 +01:00
Lorenzo Marcantonio 00bc96a2b7 - 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
jean-pierre charras 5dd66771fb pcbnew: fix some cosmetic issues mainly on Linux ( these issues could be very dependant on wxWidgets/Gtk versions) 2013-03-30 15:06:05 +01:00
jean-pierre charras 6f19a7deac pcbnew: fix some cosmetic issues (could be very dependant on wxWidgets/Gtk versions) 2013-03-30 14:36:19 +01:00
jean-pierre charras 811585b00f Fix many issues in config functions, mainly a rounding issue when a double is stored in wxConfig file (was stored only using 4 digits in mantissa)
Remove dead or obsolete code.
2013-03-30 10:28:59 +01:00
Wayne Stambaugh f610377363 Fix field position bug in edit component dialog when OK button cancelled due to empty field. 2013-03-29 20:06:08 -04:00
jean-pierre charras 8c549a28df Fix rounding issue when a double is stored in a wxConfig file (wxWidgets 2.9.4 store only 4 digits in mantissa).
A new inline function ConfigBaseWriteDouble( config, key,  double_value )  is used instead of config->Write(  key, double_value ) which store 12 digits
2013-03-29 11:14:32 +01:00
Wayne Stambaugh cab22ffeac Fix a GOST compile error. 2013-03-28 16:49:17 -04:00
Lorenzo Marcantonio 60c9f576f6 Typedef STATUS_FLAGS to encapsulate EDA_ITEM bitmapped flags 2013-03-28 20:12:46 +01:00
Wayne Stambaugh b619c2069f Fix X3D patch commit coding policy issues. 2013-03-28 12:51:22 -04:00
Maciej Suminski 3efdcb95cd Added template RTREE and class VIEW_RTREE (R-tree for fast spatial indexing of VIEW items; for future usage in GAL) 2013-03-28 17:48:29 +01:00
Maciej Suminski 4b11862ecc Added class COLOR4D that contains color representation with 4 components (RGBA) (for future usage in GAL) 2013-03-28 17:42:15 +01:00
Maciej Suminski c5e9b187ae Added template MATRIX3x3 for handling general 3x3 matrices (for future usage in GAL) 2013-03-28 17:38:33 +01:00
Maciej Suminski 04fc574229 Replacement of classes BOX2 and VECTOR2 with their extended versions
include/vector2d.h: Removed old version
include/math/math_util.h: rescale() for VECTOR2
include/math/vector2d.h: New version of VECTOR2
include/math/box2.h: New version of BOX2
common/drawframe.cpp: Refactorization of code, so it is compatible with new classes
include/plot_common.h, pcbnew/basepcbframe.cpp: Changed header inclusion path
CMakeLists.txt: Added definition to turn on WX_COMPATIBILITY for replacement classes
2013-03-28 17:30:09 +01:00
jean-pierre charras f6b6665fed Pcbnew, Module Editor: fix bug Bug #1161114 (pad not visible after undoing a move pad) 2013-03-28 10:40:29 +01:00
Lorenzo Marcantonio 0da9086397 Extremely trivial stuff (mostly cosmetics) 2013-03-28 07:40:19 +01:00
Andrey Fedorushkov c5852c1237 all: new Russian GOST patch - author Konstantin Baranovskiy
pcbnew: fix print format in THROW_IO_ERROR
        fix properties file export_vrml.cpp
2013-03-28 00:38:20 +04:00
jean-pierre charras 5bbd7cb013 Better fix for bug #1155888 2013-03-27 20:36:10 +01:00
jean-pierre charras a3b4a09fd2 Commit patch for x3d file reader (with minor changes). Commit other minor patches and fixes 2013-03-27 19:34:23 +01:00
Lorenzo Marcantonio bf783c42bd Renamed global variables:
Drc_On => g_Drc_On
Route_Layer_TOP => g_Route_Layer_TOP
Route_Layer_BOTTOM => g_Route_Layer_BOTTOM
Track_45_Only_Allowed => g_Track_45_Only_Allowed
2013-03-27 19:32:12 +01:00
Dick Hollenbeck 57e832dc65 reference a test program in a comment 2013-03-27 09:01:50 -05:00
Dick Hollenbeck ab2d301968 remove interrim fix, no longer needed 2013-03-27 08:33:24 -05:00
Lorenzo Marcantonio f1f961a43e Removed unused define TEXT_VTAB_HEIGHT 2013-03-26 21:02:23 +01:00
jean-pierre charras 8e345bd09c Pcbnew: Fix Bug #1160396 2013-03-26 19:15:30 +01:00
Wayne Stambaugh 0996c307ac Fix field text position access bug in Eeschema. (fixes lp:1160214) 2013-03-26 13:25:18 -04:00
jean-pierre charras fb8e505590 Pcbnew: fix an issue when texts in footprints have a size = 60 mils (default size for texts). After saving and reading the .kicad_pcb file, the size was not correct. 2013-03-26 18:05:47 +01:00
jean-pierre charras ec2804a78a Pcbnew: Fix a collision name between 2 methods: EDA_ITEM::GetFlags() and ZONE_CONTAINER::GetFlags(), which creates a very strange behavior when creating/edition zones.
ZONE_CONTAINER::GetFlags() is now named  ZONE_CONTAINER::GetLocalFlags().
2013-03-26 10:58:40 +01:00
jean-pierre charras 29d2ee3273 Pcbnew: fix issue in zone keepout dialog: layers not displayed on Linux, and minor changes 2013-03-25 20:11:22 +01:00
jean-pierre charras 6e3e6a1944 Pcbnew: fix issue in zone keepout dialog: layers not displayed on Linux, and minor changes 2013-03-25 19:48:07 +01:00
Wayne Stambaugh 1005fd2872 Fix SCH_FIELD get reference designator text bug. (fixes lp:1159401) 2013-03-25 13:09:55 -04:00
jean-pierre charras ab666cc267 Pcbnew: fix issue in zone keepout dialog: layers not displayed on Linux 2013-03-25 18:02:29 +01:00
jean-pierre charras e79df21353 Very minor changes in dialog zones. 2013-03-25 14:37:48 +01:00
Andrey Fedorushkov ff0ddbcac0 eeschema: fix build when KICAD_GOST ON (insert in bzr4019) 2013-03-24 00:37:48 +04:00
jean-pierre charras d1604137cc Pcbnew, ModEdit: fix issue when setting anchor position, and minor code cleaning. 2013-03-23 14:30:00 +01:00
Wayne Stambaugh 969efff611 Encapsulation, bug, context menu string, and, coding policy fixes.
* Complete encapsulation of the ZONE_CONTAINER class.
* Fixed a bug in the EDA_TEXT::Format() default effects behavior due to
  improper conversion to internal units and missing test for default
  thickness.
* Improved grammar of some Pcbnew context menu strings.
* Moved some more cleverly hidden BOARD object methods into class_board.cpp.
* Lots of coding policy and documentation fixes.
2013-03-20 10:50:12 -04:00
Dick Hollenbeck 293f7cca28 Consistent with my email posting from a day or two ago, remove the translated
standard layer name support from BOARD::GetLayerName().  This function evolved
in a contorted direction over time, and was being asked to return one of 3
different kinds of layer names, even though it only took a boolean to control
that choice.  

Users are better served by forcing them to get to know the concise new 
English Standard layer names.  This is because these concise names show up
in the "pretty" footprint/module files as the standard representation of
both feature and copper layers.

Change the name of BOARD::GetDefaultLayerName() to GetStandardLayerName().
Drop boolean argument to both BOARD::GetStandardLayerName() and 
BOARD::GetLayerName().
2013-03-19 23:46:32 -05:00
Carl Poirier 45a48cfcb2 Add library column to component and module select dialog. 2013-03-18 21:25:19 -04:00
Wayne Stambaugh 822cc6a781 More encapsulation work.
* Complete encapsulation of the MODULE class.
* Complete encapsulation of the EDA_TEXT class.
* Encapsulate most of the ZONE_CONTAINER class.
* Add pcbcommon library as a dependency for reSWIGging the scripting
  support.  This should cover most dependency cases.
2013-03-18 15:36:07 -04:00
Miguel Angel Ajo 658f02a6b9 checkcoding.py refactor from Edwin van den Oetelaar, some extra refactorings by me, improvement suggestions from Carl Poirier 2013-03-18 12:22:31 +01:00
jean-pierre charras 8d675d9bc0 Pcbnew: fix Bug #1156193 . Fix compil issues when KICAD_SCRIPTING_WXPYTHON is not enabled and KICAD_SCRIPTING is enabled 2013-03-17 20:04:42 +01:00
Miguel Angel Ajo fdf135d877 ReloadPlugins() python function, and mtime stored in the KICAD_PLUGINS dictionary 2013-03-17 03:03:18 +01:00
Miguel Angel Ajo a2bb144556 New register() method in plugins, used by the loader to handle runtime plugin reloading 2013-03-17 02:18:09 +01:00
Miguel Angel Ajo c867ed9de4 Refactoring python to wxArrayString, and better exception error reporting 2013-03-17 02:14:46 +01:00
Miguel Angel Ajo 39ef596bdc Fix wxString.Print call to be compatible with wx2.8, thanks to Барановский Константин and Edwin van den Oetelaar for submiting same patch, same hour, are you twins? ;) 2013-03-17 00:51:43 +01:00
jean-pierre charras a9bcaa1493 Pcbnew: designe rule dialog: fix incorect size of track list grid 2013-03-16 12:12:18 +01:00
Miguel Angel Ajo f05163fbeb Allow plugins to be reloaded without closing/opening pcbnew, next step is plugin editor, just a few lines away... 2013-03-16 04:27:48 +01:00
Miguel Angel Ajo 7ad3e0c544 Also check coding style of new files, not only modified ones 2013-03-16 00:28:35 +01:00
Miguel Angel Ajo 24882a9324 tool for checking coding style 2013-03-16 00:21:53 +01:00
Miguel Angel Ajo 9bb6ead2b1 LOCALE_IO toggle implementation for locale switches on scripting; code cleanups to comply with kicad coding style policy 2013-03-15 17:35:24 +01:00
Miguel Angel Ajo d6bcbc5cdf Fixed wxGrid re-creation and missing icon for dialog 2013-03-15 15:50:54 +01:00
Miguel Angel Ajo dc4b261c68 wxT added to the locales fix, message box on python exceptions inside wizard, added some missing copyright notices 2013-03-15 14:27:18 +01:00
Miguel Angel Ajo 9262f13eef Fix for locales that set , as a decimal point (which is incompatible with python scripting), also fixed the m_Reference encapsulation in module to Reference() 2013-03-15 01:56:36 +01:00
Dick Hollenbeck 82998d0cc0 EAGLE_PLUGIN now establishes (trace_min), (via_min_size), (via_min_drill), and Default Net's (clearance)
by groking the eagle *.brd info.  This makes it more probable that fewer DRC errors come about on first 
DRC attempt.
2013-03-14 17:54:47 -05:00
jean-pierre charras 8949cfe584 3D viewer: fix very minor issues (better rendering of 3D view). 2013-03-14 17:11:05 +01:00
jean-pierre charras c10d1fe279 Very minor fixes, mainly for the stable version 2013-03-13 20:15:09 +01:00
jean-pierre charras 9ed5ee8310 Last (minor) fixes for the stable version 2013-03-13 20:06:46 +01:00
Wayne Stambaugh 7b266ef475 Pcbnew encapsulation and code cleaning.
* Encapsulate most of the MODULE class.
* Start encapsulating the DIMENSION class.
* Lay some groundwork for EDA_TEXT encapsulation.
* Move cleverly hidden MODULE functions into class_module.cpp.
* Use std::swap to exchange TEXTE_PCB values for undo/redo.
* Remove unused members from MODULE class.
* The usual coding policy and documentation fixes.
2013-03-13 14:53:58 -04:00
Dick Hollenbeck 09f1a4fbb8 EAGLE_PLUGIN cu layer map fix broke footprint library loading 2013-03-13 11:38:54 -05:00
Dick Hollenbeck c7f55381a5 EAGLE_PLUGIN cu layer map fix 2013-03-13 11:17:16 -05:00
jean-pierre charras 81f35ffe73 Pcbnew: fix a bug in autoplac.cpp 2013-03-12 17:37:41 +01:00
jean-pierre charras 597b362603 Pcbnew: Fix many minor issues in print dialog, mainly in modedit. 2013-03-12 16:17:44 +01:00
Miguel Angel Ajo 0163e4b4e4 Reverted back the ( i ) parameters for python, applied the PyGILState_Ensure from Dick into his PyLOCK class 2013-03-12 01:37:45 +01:00
jean-pierre charras 98a77ee649 Pcbnew: print dialog: code cleanup and bug fixes (added some fixes from Sergey A. Borshch) 2013-03-11 20:30:58 +01:00
Dick Hollenbeck c9edd2c8de improvements to python's GIL acquisition and release, but not done yet, since I think the GIL needs to be acquired even when not involving wxPython. 2013-03-11 03:09:48 -05:00
jean-pierre charras 379ad3a8e7 Kicad manager: fix bug: .kicad_pcb files not saved in zip file 2013-03-10 20:55:21 +01:00
jean-pierre charras aca64b5dda Pcbnew: fix issues: Ensure pads type connector have a drill size= 0, like SMD pads. Ensure keepout zones have no net. 2013-03-10 14:59:47 +01:00
Miguel Angel Ajo d34639b79b Project templates now can find the system templates from KICAD environment variable 2013-03-10 02:35:24 +01:00
jean-pierre charras 0d4b157207 Pcbnew: Partial merge from pcad2kicad (from Alexander Lunev). Fix an old bug related to pads with offset: sometimes the connection to a zone was not detected. 2013-03-09 20:36:31 +01:00
jean-pierre charras 58160d9624 Pcbnew: fix bug in export vrml (bad Z position of 3D shapes). Very minor code cleaning. 2013-03-08 08:29:30 +01:00
Wayne Stambaugh 57e34dfb3c Documentation and coding policy fixes.
* Fix all Doxygen warnings except polygon files.
* Add footprint library table tasks to TODO.txt.
* Add definition to drag.h to prevent nesting.
* Coding policy fixes.
2013-03-07 12:12:59 -05:00
Baranovskiy Konstantin 67ab19289d Width factor for DXF plotting text used an inverted aspect ratio. 2013-03-07 08:15:35 -06:00
jean-pierre charras 7718bf6858 Gerbview: Minor fixes 2013-03-06 20:32:59 +01:00
jean-pierre charras ee467d0203 Pcbnew: fix Bug #1148785 (pcbnew crashes when using only one layer in autorouter ) , and a minor bug in dialog cleanup. 2013-03-06 10:04:27 +01:00
jean-pierre charras 9b7265810b Pcbnew, module edit dialogs: fix some "cosmetic" issues. 2013-03-04 20:59:12 +01:00
jean-pierre charras 24dc1092b1 Refinements 2013-03-04 20:31:09 +01:00
jean-pierre charras ab953f1381 Refinements 2013-03-04 20:15:23 +01:00
jean-pierre charras 83174e996e Dialog edit module: remove some wxStaticBoxSizer sizers. 2013-03-04 19:49:32 +01:00
jean-pierre charras 38069048fd Still fix very minor issues in dialog_edit_module_for_BoardEditor.cpp 2013-03-04 17:57:24 +01:00
jean-pierre charras 9fda651595 Still fix minor issues in dialog_edit_module_for_BoardEditor.cpp (noticeable only for non English users) 2013-03-04 17:39:08 +01:00
Wayne Stambaugh cb13ae57bc Minor Pcbnew dialog spacing and consistency fixes. (fixes lp:1143465)
* Fix spacing and consistency issues and debug warning due to improper flex
  grid sizer in module editor module properties dialog.
* Fix spacing and consistency issues in Pcbnew module properties dialog.
* Fix spelling error in DRC dialog message box text.
2013-03-04 11:04:53 -05:00
jean-pierre charras 6a45d30715 Pcbnew: fix strange things in module edit dialogs. 2013-03-04 13:08:35 +01:00
Andrey Fedorushkov a43f24617d pcbnew: fix build in linux gcc-4.5.2 2013-03-02 20:32:05 +04:00
jean-pierre charras f11a148d2d Eeschema: fix broken mirroring for texts and labels in block mirror X and Y (this fixes Bug #1135505)
Pcbnew: add in module popup menu an option to edit the footprint in Modedit (like in Eeschema for components)
minor icons enhancements.
2013-03-01 20:59:29 +01:00
Wayne Stambaugh 73cf4c0e49 Update coding policy to remove support for MSVC. 2013-03-01 08:32:55 -05:00
Dick Hollenbeck 8ea3cd1cb5 Debug build fix 2013-02-28 22:20:29 -06:00
Dick Hollenbeck 62979ae06d parse *.kicad_pcb files with numeric net_names 2013-02-28 10:17:24 -06:00
Dick Hollenbeck 5e998288d6 specctra_export to handle Edge Cuts graphics in modules 2013-02-27 09:54:29 -06:00
jean-pierre charras e01b851e1c CMakeLists.txt: use elseif token instead of elif which create strange issues with some cmake versions.
Fix minor issues in nsis config files
2013-02-27 13:46:40 +01:00
jean-pierre charras 2e6a40be96 CMakeLists.txt: use elseif token instead of elif which create issues with some cmake version.
Fix minor issues in nsis config files
2013-02-27 08:19:42 +01:00
jean-pierre charras 02c1ec5efc Minor fixes and cleanup 2013-02-26 12:25:30 +01:00
jean-pierre charras 78a6ba31d8 Fix Bug #1132416. Minor update in templates. 2013-02-24 18:31:18 +01:00
Baranoviskiy Konstantin 1ae23df0ba Remove redundant Eeschema plot submenu on platforms that do not support plot to clipboard. 2013-02-23 15:08:28 -05:00
Wayne Stambaugh 36ba9a7309 Add build option to use footprint library table. 2013-02-23 14:30:43 -05:00
Anton Blanchard 7ee129b21a Fixes segfault in Pcbnew module editor when clicking delete tool where there is no object. 2013-02-22 18:29:44 -05:00
Wayne Stambaugh b3d4123007 Fix Eeschema plot dialog escape key handling bug on some Linux distros. 2013-02-22 16:59:53 -05:00
Wayne Stambaugh 5bfd330692 Minor dialog and footprint ID class fixes.
* Make Pcbnew net list dialog honor escape key on Linux.
* Make Pcbnew swap layers dialog honor escape key on Linux.
* Layout and UI policy fixes for Pcbnew swap layer and net list dialogs.
* Layout and UI policy fixes for Eeschema plot dialog.
* Rename fpip.h to fpid.h.
* Fix FPID class compiler errors.
* Restore fpid.cpp to Pcbnew static library source list.
2013-02-22 15:03:00 -05:00
Dick Hollenbeck 49125d1a7d wxID_CANCEL, 5 pixel border around sizers, resizable search combobox, dialog_shim usage on a few dialogs 2013-02-22 07:47:35 -06:00
jean-pierre charras 6050ef41a9 Pcbnew: Very minor fix in plot dialog. 2013-02-22 09:04:15 +01:00
Baranovskiy Konstantin 0d809688ee Eeschema border and title block DXF plot color bug fix. 2013-02-21 18:45:46 -05:00
jean-pierre charras da20e80de6 Pcbnew: plot Dialog: add a popup menu (try mouse right click in plot dialog) to selected/unselect groups of layers to plot.
All: For new zoom centering option: use Shift+Ctrl key instead of Alt key to select the new zoom centering, because Alt key has a special function under Windows.
2 very minor other changes.
2013-02-21 21:53:50 +01:00
Baranovskiy Konstantin 1f46bf2e28 DXF plot layer color bug fix. (fixes lp:1126403) 2013-02-20 15:26:34 -05:00
jean-pierre charras f345dbe7e4 Eeschema: Fix Bug #1130262 (Inverted pins are plotted with erroneous line width) 2013-02-20 12:46:38 +01:00
Wayne Stambaugh 490c8d856e Minor dialog spacing, grammar, and sizer fixes. 2013-02-19 14:43:48 -05:00
jean-pierre charras 897a5b8de6 Pcbnew: Export vrml: fix an issue for 3D shapes having a local offset defined: the local offset was not correctly scaled. 2013-02-19 10:21:55 +01:00
Wayne Stambaugh 155cb4f158 Minor dialog spacing, grammar, and UI policy fixes. 2013-02-18 15:14:53 -05:00
Emmeran 445cf5860a Adds zooming method for zooming relative to the crosshair instead of centering
the crosshair after zooming.

This method is only used when the ALT key is held while using the mousewheel or
if it's permanently enabled in the options dialog next to the middle mouse
button panning option.
2013-02-18 09:57:39 -06:00
Dick Hollenbeck 6cb1bae032 fp lib table work 2013-02-15 19:09:53 -06:00
Dick Hollenbeck c0c9d667cd typos and tooltip 2013-02-15 18:13:35 -06:00
Jacobo Aragunde Perez b946032f56 Plot dxf format: fix issue for some non latin1 chars. 2013-02-15 12:53:16 +01:00
Antia Puentes df8826240f Commit patch from Antia Puentes relative to bug Bug #1125047 : PcbNew: Insert a footprint in the board, from the Library Browser, by double clicking on it, with a change to avoid the button release event (from the double click) to be seen by the main window. 2013-02-14 22:20:56 +01:00
unknown 5dda4f95a6 MacOSX: now autoplace is drawn correctly 2013-02-14 20:57:19 +01:00
unknown f3822e6ffa MacOSX: Now Arcs are shown in edit mode 2013-02-14 20:56:45 +01:00
Wayne Stambaugh 084ad26b73 Add CheckCXXSymbolExists.cmake to fix configure bug using CMake versions prior to 2.8.6. (fixes lp:1124854) 2013-02-14 13:39:36 -05:00
jean-pierre charras fafecb491e Remove outdated (and/or erroneous) documentation. 2013-02-14 18:57:12 +01:00
Dick Hollenbeck 0e6a590305 -fPIC only for non-MINGW. See http://mingw.5.n7.nabble.com/Option-fPIC-not-supported-td18480.html 2013-02-14 09:31:56 -06:00
Dick Hollenbeck 0e8c9fda5e typo 2013-02-14 08:50:32 -06:00
Dick Hollenbeck d2ac283570 add -fPIC for all builds, even cross comiling to Windows from Linux, even non Debug and Release builds 2013-02-14 07:12:54 -06:00
jean-pierre charras 69bdc16751 Pcbnew: Pcad2kicad: remove dead code. 2013-02-13 18:19:46 +01:00
Antia Puentes b8325a38a1 Eeschema: force file ext in"Sheet Save As" command (Bug #1122212 ) 2013-02-13 18:18:23 +01:00
Wayne Stambaugh 403a1a7e1f Fix bug caused by setting default drill size in D_PAD (fixes lp:1123392).
* Add check for pad type and force drill size to zero if pad is surface
  mount in PCB_PARSER.
* Modify the D_PAD SetAttribute method to clear drill size if pad type is
  set to surface mount.
2013-02-12 20:01:22 -05:00
Dick Hollenbeck cf481d2fc4 fix compiler warnings on gcc 4.6.3, Debug build 2013-02-12 11:41:13 -06:00
Emmeran c3e3fc4dba converted linux to dos file endings for wxfb files 2013-02-12 05:30:28 +01:00
Emmeran 254ad1b26b moved changes to dialogs into fbp files 2013-02-12 05:18:22 +01:00
Emmeran 2c642afd04 tabs converted to spaces except wxstruct.h 2013-02-12 04:56:46 +01:00
Wayne Stambaugh e43fab7c01 Pcbnew pad properties dialog assertion and layout fixes.
* Fixed spacing issue in pad properties dialog.
* Remove wxSHAPED flag from pad drawing panel to prevent assertion in
  wxSizer.
* Used sane default pad size and drill size settings to prevent wxRound
  assertions.
* Add license to class_board_design_settings.cpp.
2013-02-11 20:07:04 -05:00
jean-pierre charras 55f2914163 Eeschema: All fixed fields are now always saved in libraries. Therefore the footprint field can be set in lib (size, visibility) and imported in schematic with its predefined attributes, even if the footprint text is not set. 2013-02-11 19:50:55 +01:00
Wayne Stambaugh 96d7ac7c6a Configuration and compile documentation improvements.
* Improve the stable and testing build version option logic.
* Use CMake FindPythonInterp to configure the Python interpreter.
* Use Python interpreter to determine the system Python module install
  path if not already defined on the command line.
* Add header symbol checks for asinh(), acosh(), and atanh().
* Add test source to check for isinf() which can be defined as a C++template.
* Replace conditional compile on windows systems for aXXXh() with CMake
  configuration tests.
* A few minor MSVC compile fixes.
* Fix incorrect python environment string in fixswigimports.py
* Create a separate document for KiCad CMake build options.
* Create a separate how to compile KiCad on Windows document.
2013-02-10 19:41:49 -05:00
jean-pierre charras c9be096e88 eeschema, libedit l fix a bug in lib_arc.cpp which creates incorrect arc start and arc end parameters after rotation or mirror.
the Bug #1121079 is due to this bug, but Bug #1121079 itself cannot be fixed because this is the data inside the lib which is broken.
2013-02-10 19:02:45 +01:00
jean-pierre charras e18b8642c4 Upgrade boost to version 1.53.0 and clipper to 5.03 2013-02-10 14:52:01 +01:00
jean-pierre charras dad83c9004 Pcbnew: Try to find a better workaround for zone fiill bug (crash or bad fil areasl in very rare cases).
pcbnew+Eeschema: Fix a very minor bug: filename not displayed in frame reference.
2013-02-09 21:03:20 +01:00
Wayne Stambaugh f0a86c360c Improve Eeschema find dialog behavior.
* Remove ignore mouse events before creating find dialog for true mode-less
  behavior as was originally intended.
2013-02-07 15:36:35 -05:00
Wayne Stambaugh c6444b7d05 Improve zone context menu descriptions, fixes lp:1116483 2013-02-07 12:56:41 -05:00
jean-pierre charras 6b81b6931f Pcbnew: rework on connection calculation: fix an issue for "composite" pads (complex pad build by association of some basic pads):
sometimes connections where not seen.
2013-02-07 18:40:50 +01:00
Jacobo Aragunde Perez b391fb3faf Commit patch for bug 1116059 (Inconsistency between confirmation dialogs) 2013-02-07 18:35:37 +01:00
Dick Hollenbeck 2649c38bf7 plotter output file being left open fix. 2013-02-06 09:21:37 -06:00
jean-pierre charras 81266f2f71 Kicad manager: fix a minor issue noticeable on Kubuntu 12.04 (bad size of buttons area) 2013-02-06 14:15:40 +01:00
jean-pierre charras 05189f9ff5 Eeschema, Libedit: fixes color artifacts when moving/placing a pin.
Very minor other fixes.
2013-02-06 12:54:51 +01:00
jean-pierre charras a3f8783dca Very minor changes (tooltips update, to synchronize them with the doc update) 2013-02-04 09:52:56 +01:00
Andreas Beutling c20d23a552 fix some errors in common_plotHPGL_functions.cpp 2013-02-03 18:53:48 -06:00
Emmeran d2ed926077 added option to allow zooming around the crosshair instead of the center; can be enabled via options or by holding alt while using the mousewheel 2013-02-02 20:10:48 +01:00
jean-pierre charras c0b3ad8253 Changes for CvPcb to eeschema stuff file: the stuff file generation from CvPcb is removed. Eeschema now imports footprints names from the .cmp usual file created by CvPcb or by Pcbnew (Why to use 2 file formats for the same thing?) .
Pcbnew: in netlist dialog: The user now can choose between the netlist and the .cmp file to import footprints names.
Therfore no need to delete the .cmp file when exists to use only the netlist.
This is useful for users who use CvPcb only once to fill footprints fields in schematic, and after edit/modify the footprints fields in schematic outside CvPcb.
2013-02-02 18:39:59 +01:00
Jacobo Aragunde Perez 30495f780a Commit fixes for bugs #1108773 and #1110651 and a bug fix improvement for #1101718 and #1102381. 2013-02-01 08:58:49 +01:00
Jacobo Aragunde Perez a2114c44ad Commit patch to fix bug 1108838 (+ fix a very minor fix in eeschema, when loading a new component) 2013-01-30 17:15:45 +01:00
jean-pierre charras 0f06a927ff Pcbnew: Workaround to fix a crash when filling zone in Pcbnew nanometers (see Bug #1106451 ). Also happens with one of my boards.
Could be a bug inside boost::polygon. This is a workaround, because one never knows if this kind of bug is fixed.
However it fixes this issue for the 2 boards.
2013-01-27 14:54:43 +01:00
jean-pierre charras c5c41b8ab5 Fix bug in TestSegmentHit( wxPoint aRefPoint, wxPoint aStart, wxPoint aEnd, int aDist ), when aDist = 0. (fix Bug #1106744 ) 2013-01-27 11:06:09 +01:00
jean-pierre charras 1f4ca54938 Pcbnew: fix a very old bug in DRC, pad to pad drc tests: sometimes a test between a rectangular pad and an oval pad was skipped.
Segment Hit Test: enhanced detection near segment ends (noticeable for instance when clicking on short tracks in Pcbnew.
Remove duplicate code about segment hit test.
remove unused file.
2013-01-26 18:49:48 +01:00
jean-pierre charras 720e3e9272 Eeschema: fix a bug which crashes Eeschema (when a label is being created, and its type is changed by popup menu, for instance to a text, before it was put on schematic)
remove unused file and minor coding style fix
2013-01-25 18:29:54 +01:00
acobo Aragunde Perez a42400272d Eeschema: Add "append schematic" feature. Fix bug 1101718 <Empty plot filename> 2013-01-24 19:46:42 +01:00
Jacobo Aragunde Perez 19558b48c1 Eeschema: Add "append schematic" feature. Fix bug 1101718 <Empty plot filename> 2013-01-24 18:46:37 +01:00
Dick Hollenbeck 744d875838 fix intermittent build problem involving out of sequence python invocation 2013-01-23 10:35:40 -06:00
Dick Hollenbeck 59d2523c49 fix compiler warnings with gcc 4.6.3 on x86_64 linux 2013-01-23 10:13:42 -06:00
Jacobo Aragunde Perez 13fdde5e5d Eeschema: hotkey enhancement while moving a block or an item. 2013-01-21 21:16:04 +01:00
jean-pierre charras 86e73c1bae Gerbview: Fix a minor but annoying issue in gerbview config: colors setup is broken when running a testing version after an old gerbview version (due to a bug of this old version which breaks the color config) 2013-01-21 21:02:07 +01:00
Jacobo Aragunde Perez 6cd558fd5c Eeschema: fix Bug #1102381 <eeschema: -cache.lib file not created the first time you save a schematic> 2013-01-21 20:58:02 +01:00
Dick Hollenbeck 8f45c7d27e merge in branch fp-lib-table 2013-01-20 21:27:01 -06:00
Dick Hollenbeck 3518b18351 more fp lib table work 2013-01-20 21:12:16 -06:00
jean-pierre charras 6dea106650 Pcbnew: fix a minor bug I created in rev 3912.
Still try to find a better fix for Bug #1100876, however I am thinking the bug is not in Kicad:
looks like a buggy version of wxWidgets is used, which sends sometimes an unwanted wxCommandEvent event,
when an event::Check() is called inside a function called by a  wxUpdateUIEvent event.
2013-01-19 16:01:17 +01:00
jean-pierre charras 123a29d126 Pcbnew: Fix Bug #1097345 <module editor "change body item width (current)" does nothing.> 2013-01-19 13:58:54 +01:00
jean-pierre charras 9a8383de24 Pcbnew: fix bug Bug #1101399 (Custom page size gets reset after restarting pcbnew) (bug also in eeschema)
Try to find a better fix for Bug #1100876
2013-01-19 10:58:25 +01:00
jean-pierre charras 2453201d7b Try to fix Bug #1100876< Modes (track/footprint) not available.>
It could be a race condition when setting the tools state on and off in PCB_EDIT_FRAME::OnSelectAutoPlaceMode( wxCommandEvent& aEvent ) on some Linux/wxWidgets versions
(does not happen on my computer)
2013-01-18 15:12:57 +01:00
Jacobo Aragunde Perez 14deef3adf Add patch from Jacobo Aragunde Perez <Log of opened and closed applications in KiCad launcher> 2013-01-18 11:44:35 +01:00
Jacobo Aragunde Perez 8c191e5ba8 Add patch from Jacobo Aragunde Perez <Log of opened and closed applications in KiCad launcher> 2013-01-18 11:42:23 +01:00
Dick Hollenbeck 20fc4a2efe fix goof-ed preprocessor test 2013-01-18 00:13:31 -06:00
Dick Hollenbeck 49a577dd59 Enhance DIALOG_SHIM to optionally call SetFocus() after the derived class's constructor has been called, for wx 2.8 and wxGTK 2013-01-18 00:04:25 -06:00
jean-pierre charras 8b8f5d45c9 Pcbnew: fix a minor bug: shape 3D filename not displayed in msg panel when clicking on a footprint. 2013-01-17 18:34:03 +01:00
jean-pierre charras cec687bad2 Scripting: fix erroneous extension for S exp board files, which prevent to open a .kicad_pcb file from a python script
Make scripting version compilable on platforms where the python executable is not python2:
Just define it by -DPYTHON_EXECUTABLE=<python executable filename> when running cmake (there was already a partial fix for this)
2013-01-16 20:15:56 +01:00
jean-pierre charras 9891e2d986 Scripting: fix erroneous extension for Sexp board files
Make scripting version compilable on platforms where the python executable is not python2 (define it by -DPYTHON_EXECUTABLE=<python executable filename>)
2013-01-16 13:38:30 +01:00
jean-pierre charras 24b23e2383 Pcbnew: store in configuration the default line width (now in mm), under a new keyword, to avoid a strange behavior of pcbnew in decimils version (old pcbnew versions), after running pcbnew in nanometers. 2013-01-15 10:31:11 +01:00
jean-pierre charras 413aa106a2 AUTHORS.txt: add some contributor names (I certainly forgot some other contributors, and I apologize).
Demos: convert .brd files to .kicad_pcb files and fix 2 broken files
2013-01-14 13:16:23 +01:00
jean-pierre charras 097dcd724f Kicad manager: fix a recent bug: project tree not updated when kicad is launched by a command line with a project name to open.
Pcbnew: export vrml:
* move dialog functions to a new file: dialog_export_vrml.cpp (to be consistent with other dialogs).
* fix some coding style issues
* added patch from Cirilo Bernardo.
2013-01-13 19:41:15 +01:00
jean-pierre charras 1454880fb7 Kicad manager: fix a recent bug: project tree not updated when kicad is launched by a command line with a project name to open.
pcbnew: export vrml:
* move dialog functions in a new file: dialog_export_vrml.cpp.
* fix coding style issues
* patch add from cirilo Bernardo.
2013-01-13 17:55:07 +01:00
Dick Hollenbeck c6a712dec3 pcbnew/CMakeLists.txt formatting and librt fix 2013-01-12 18:34:16 -06:00
Heikki Pulkkinen 2c888b86f5 protect data in class_track.h, switch to using member accessors 2013-01-12 18:04:00 -06:00
Wayne Stambaugh 7481dcf520 Base object decoupling improvements.
* Improve MSG_PANEL_ITEM to handle message panel information.
* Create containers for passing message panel items between objects and
  the message panel.
* Rename EDA_ITEM::DisplayInfo to EDA_ITEM::GetMsgPanelInfo.
* Remove all direct manipulation of EDA_DRAW_FRAME from all objects derived
  from EDA_ITEM.
2013-01-12 12:32:24 -05:00
jean-pierre charras 435a34cd60 3D viewer: allows import of models created with openscad and convertedvia meshconv to wrl (thanks to Georg Gast <georg@schorsch-tech.de>)
Export VRML: fix scaling issue for pcbnew - nanometers.
2013-01-12 11:35:08 +01:00
Miguel Angel Ajo 23ffcf8f89 MacOSX compilation fixes 2013-01-10 23:10:05 +01:00
jean-pierre charras 89d6a09401 Commit missing files. 2013-01-10 13:20:16 +01:00
jean-pierre charras b8fce6a8e1 EDA_LIST_DIALOG: add a filter option to select names to display is list, from a kamil zorychta's patch <kamil.zorychta@gmail.com>
Use wxFormBuilder to create EDA_LIST_DIALOG_BASE, like other dialogs.
Minor code cleanup (remove unused functions and coding style fixes) and minor bug fixes.
2013-01-10 13:18:43 +01:00
Wayne Stambaugh 523e7eb397 Pcbnew BOARD object encapsulation improvements. 2013-01-09 13:52:44 -05:00
jean-pierre charras 30a3668779 Pcbnew: Enhancement in connections calculations:
Until now, 2 tracks were seen as connected only if one end of the first track is *exactly* on one end of the other track.
Now the 2 ends are seen as connected when they are "near" i.e. the distance between the 2 ends is < track width/2
2013-01-08 18:58:06 +01:00
jean-pierre charras d95ea479c4 Pcbnew: Fix unwanted selection clarification popmenu in board editor after double clicking on a DRC Unconnected error
(For DRC clearance error, it was fixed  in bzr 3838, but forgotten for DRC Unconnected error)
2013-01-07 21:52:15 +01:00
jean-pierre charras baf18a6379 Pcbnew: Fix Bug #1096766 ( Can't create filled zones after keepout zones) 2013-01-07 08:46:01 +01:00
jean-pierre charras 92831ee7d4 Gerbview: add option to show negative objects. 2013-01-06 14:31:49 +01:00
Dick Hollenbeck de823996b5 when linking a DSO, require all symbols to be resolved 2013-01-04 17:02:10 -06:00
jean-pierre charras 936974f12c Pcbnew: fix link issue (undefined Read_GPCB_Descr symbol) in scripting mode. 2013-01-04 23:00:05 +01:00
Jacobo Aragunde Perez 0c88507dcf Prevent Pcbnew from opening the same file twice. 2013-01-04 18:47:59 +01:00
Jacobo Aragunde Perez 9184095b34 Eeschema:commit patch <Prevent Eeschema from opening the same file twice> with a small fix for windows. 2013-01-04 13:06:50 +01:00
Wayne Stambaugh f1eea58b6b Remove unused Geda footprint import source code file. 2013-01-03 16:51:26 -05:00
Wayne Stambaugh 49f2206ef0 Doxygen warning fixes. 2013-01-03 15:21:40 -05:00
jean-pierre charras 8f94a14063 Kicad manager: cleanup code, remove dead or not working code. Fix minor isssues 2013-01-03 20:25:12 +01:00
Dick Hollenbeck 9843e0c436 add eagle *.lbr lib path extension for future use 2013-01-03 10:33:22 -06:00
jean-pierre charras e3149cd2b0 Kicad: Fix a compil issue under Linux, and minor code cleaning, about wxFileWatcher 2013-01-02 23:12:16 +01:00
jean-pierre charras 7c5d2ab029 Kicad: Fix compil issue under Linux, and minor code cleaning, about wxFileWatcher 2013-01-02 22:49:56 +01:00
jean-pierre charras 6422be116b Eeschema, Libedit: Fix potential issues when using some hot keys. 2013-01-02 09:34:46 +01:00
jean-pierre charras 50eef193ff Eeschema, Libedit: fix potential bugs. 2013-01-02 08:55:48 +01:00
Dick Hollenbeck 8092d98ea3 1) Implement EAGLE_PLUGIN::FootprintLoad(), FootprintEnumerate(), and IsFootprintWritable().
2) Add PCAD_PLUGIN to _pcbnew.so for scripting, fixing a linking bug.
2013-01-01 22:05:48 -06:00
jean-pierre charras ed42891509 Eeschema: fix Bug #1095005 2013-01-01 21:52:37 +01:00
Brian Sidebotham 6124226428 switch a template's board format to kicad_pcb format 2013-01-01 14:48:32 -06:00
Brian Sidebotham 6c22590d4a Fixes a bug in the template file copying mechanism. The previous code failed to honour sub-directorys and flattened the whole tree whilst copying files.
I have fixed this so that sub-directories that are not the meta directory will get copied verbatim into the new project directory.
2013-01-01 14:39:25 -06:00
jean-pierre charras 950d9ae23a Kicad manager:
* Use the recent wxFileSystemWatcher to automatically update the tree project when a file is created/deleted/renamed in the project directory
(and if the file type is usually shown by the manager.)
Needs wxWidgets 2.9.4 or more recent.
* Also code cleanup, dead code or useless code removed.
2013-01-01 16:57:48 +01:00
jean-pierre charras a12ff75fee Kicad: files watcher: fix Linux specific issues 2013-01-01 15:06:49 +01:00
jean-pierre charras 681413bb97 Kicad manager: first use of wxFileSystemWatcher (only with wxWidgets >= 2.9.2) to monitor files list. 2012-12-31 09:12:29 +01:00
Wayne Stambaugh 1ebe2c8728 Fix Pcbnew s-expr file parser bug. 2012-12-30 10:40:05 -05:00
Antia Puentes 41dd21ac7b Eeschema: Allow to edit an schematic item while dragging 2012-12-29 13:55:36 +01:00
Alexander Lunef 6b6d9706bd Pcbnew: Add pcad2kicad pcb plugin, to import PCAD boards ( .pcb ASCII data file PCad 2000 format ) from Alexander Lunef 2012-12-29 10:54:25 +01:00
Wayne Stambaugh 1b57a79636 Add Pcbnew GEDA PCB module plugin support.
* Create new GEDA PCB plug in.
* Add support for opening GEDA PCB footprints with module editor.
* Make import footprint file dialog remember last selected footprint
  type during current session.
* Update module editor file import to use new GEDA PCB plug in.
* Let IO_MGR know about GEDA PCB plug in.
* Create a WHITESPACE_FILTER_READER to simplify parsing GEDA PCB footprint
  files.
2012-12-28 15:52:12 -05:00
jean-pierre charras a1f3b7d53f Eeschema: fix incorrect hotkey commands while moving/dragging a component. 2012-12-28 16:56:41 +01:00
jean-pierre charras 1118ef8f19 Pcbnew: board editor: allows pad edition by hotkey 'E' (was accessible only by mouse button right click)
All: minor code cleaning and very minor bug fixes.
2012-12-27 17:42:41 +01:00
unknown 4b9526adb1 MacOSX: deleted obsolete code 2012-12-23 11:57:02 +01:00
unknown ef3f42dfab MacOSX: fixing possible crash 2012-12-23 11:55:24 +01:00
unknown 6f018668c2 MacOSX: refresh overlay with new-deleted objects 2012-12-23 11:53:54 +01:00
jean-pierre charras f20d6e8d05 Eeschema: fix bug 1092864 2012-12-21 19:57:56 +01:00
jean-pierre charras 0574bf8aba Eeschema: fix bug 1092834 (Hotkey 'G' Drag label not working) 2012-12-21 13:56:17 +01:00
jean-pierre charras 7ea9f8ddcc Pcbnew: Rework on recovery files menu 2012-12-21 08:58:51 +01:00
Dick Hollenbeck e4d9cb77fc extend fp_lib_table on multiple row paste 2012-12-20 23:29:40 -06:00
jean-pierre charras 7eee33a6a0 Pcbnew: fix issue when loading a recovery backup board file.
Because now there are 2 formats, board backup files extensions are .brd-bak or .kicad_pcb-bak instead of the old .000 extension, depending on the initial file format.
2012-12-20 21:20:56 +01:00
jean-pierre charras 3bbafe14f5 Pcbnew: fix bug: missing call to SetFileFormatVersionAtLoad after loading a board, in legacy format. 2012-12-20 19:05:18 +01:00
Dick Hollenbeck 1dc048662b fix a fairly serious bug which would leave SOLDERMASK_LAYER_FRONT layer turned off in PADs, when loading *.kicad_pcb files 2012-12-20 00:56:17 -06:00
jean-pierre charras 7546651a30 Pcbnew: class DIMENSION: code cleaning 2012-12-19 20:31:36 +01:00
jean-pierre charras 6d16131b03 Pcbnew: fix minor bugs. Fix bug 1091593 and 1091693 . Minor code cleaning 2012-12-18 18:50:00 +01:00
Wayne Stambaugh 7eb196b4d1 Doxygen warning fixes. 2012-12-18 08:54:44 -05:00
jean-pierre charras 1e8f7f7ba8 Pcbnew: allows pcbnew to open a .kicad_pcb or a .brd file, from the command line. 2012-12-16 14:48:54 +01:00
jean-pierre charras eefbd1610e eeschema: make new netlist format (S expr netlist format) the default for Pcbnew netlists in dialog netlist.
Also move netlist_control.* to dialogs/dialog_netlist.*, to be consistent with other file dialogs.
2012-12-16 12:36:18 +01:00
jean-pierre charras 0f8af51da6 Pcbnew: add a dialog to load a legacy file in "old" projects, when the .kicad_pcb file is not existing, and the correspoinding .brd file exists.
Fix also an issue in pcb_parser when a netclass name is just a number (like a track width as name)
2012-12-15 14:39:36 +01:00
jean-pierre charras c14dad91b2 3d viewer: code cleaning. Display options are now stored in config. 2012-12-15 09:52:02 +01:00
Wayne Stambaugh 2538262531 Fix angle scaling error in Pcbnew s-expr file format parser. (fixes the arc bug part of lp:1090524) 2012-12-14 16:37:59 -05:00
Dick Hollenbeck 453a135a3e fix bug 2012-12-14 13:58:50 -06:00
Dick Hollenbeck 0cfa6d8097 fix pcbnew file save as problem, if previous file by same basename did not exist. Show default file ext. 2012-12-14 13:42:38 -06:00
jean-pierre charras 7e77f3b902 Kicad manager: shows *.kicad_pcb files the project tree. 2012-12-14 20:37:51 +01:00
Dick Hollenbeck 71d2467963 minor file save as fixes, move legacy header into its plugin 2012-12-14 12:14:28 -06:00
Dick Hollenbeck a6140c799d Switch over to *.kicad_pcb format as the default BOARD format.
Add KiCadPcbFileExt global.
2012-12-14 10:54:54 -06:00
Wayne Stambaugh bd7217b090 Fix minor version information text formmatting error. 2012-12-12 11:52:24 -05:00
jean-pierre charras cc45f4f212 Pcbnew: fix Bug #1089120. Also change "Length Die" expression to "Length Pad To Die" in code 2012-12-12 12:57:17 +01:00
Dick Hollenbeck d95710f8e0 allow . in layer names 2012-12-10 23:39:36 -06:00
Wayne Stambaugh b3703f1f91 Fix FreeRoute launcher Java executable path error on Windows (fixes lp:1087589) 2012-12-10 21:44:20 -05:00
jean-pierre charras 104d63fd7c Eeschema: Erc dialog: enhancement. Now not modal.
Pcbnew: Drc dialog: fix a old very minor bug.
Added: single click on an item in marker list moves the board  graphic cursor on the corresponding marker location on the board
Double clicking is not modified.
2012-12-10 20:08:09 +01:00
jean-pierre charras df994764a5 Pcbnew: Add a minimal test for illegal chars in footprints libname (like space and dir separtor)
Also a minor cosmetic enhancement
2012-12-10 12:18:42 +01:00
Dick Hollenbeck 764ef2dcc9 note that the clipboard format is spreadsheet compatible 2012-12-09 14:53:46 -06:00
Dick Hollenbeck 1dddc22a9b embellish fp_lib_table editor with beginnings of cut, copy, paste 2012-12-09 14:51:42 -06:00
Dick Hollenbeck ebac5c4a70 change spelling to jive with my email on developers list 2012-12-08 23:34:12 -06:00
Dick Hollenbeck 59a3715e40 more fp_lib_table work, enhance parser 2012-12-08 17:58:03 -06:00
jean-pierre charras 86bb2f325e Eeschema: fix compil issue with wxWidgets 2.8.12 2012-12-08 20:36:28 +01:00
jean-pierre charras eb370afe4a Eeschema: Add hotkey 'U' to edit reference. Better filtering for hotheys V, F, U: now the corresponding field is selected without selection list between component and the field. 2012-12-08 18:24:49 +01:00
jean-pierre charras fc06b1762f All: Fix an usually unwanted behavior in kicad: When closing a dialog (mainly ERC, DRC and recently a component selection by the library viewer on a double click) the mouse release left button event (which is seen by the parent after closing the dialog, becuse it is actually made in the parent) generate an unwanted command (item selection, component place ...)
This event can be now skipped if needed by calling  EDA_DRAW_FRAME::SkipNextLeftButtonReleaseEvent() from the dialog.
Very minor other fixes
2012-12-07 11:05:19 +01:00
jean-pierre charras a1fed86b28 Try to fix an unwanted left mouse release button event, when closing a dialog on a click or double click,
and therefore when the mouse butoon is released in the parent window
Minor other fixes.
2012-12-06 22:53:00 +01:00
unknown a96a265a7b MacOSX: fixes refresh of lines and outlines when drawing 2012-12-06 19:10:58 +01:00
unknown a2d65bb523 MacOSX: Fixes the append always beaviour of cvpcb when reading netlists 2012-12-06 19:10:00 +01:00
unknown 7c966fa775 MacOSX: cleanups 3817 & completes 3820 2012-12-06 19:08:34 +01:00
Marco Mattila 8042d6f892 Update board modified state when (un)locking a module in pcbnew. 2012-12-06 12:13:19 +02:00
Dick Hollenbeck d4c8c0bb52 merge patch with refinement 2012-12-04 13:12:50 -06:00
Dick Hollenbeck 148d567aa4 Prevent the double click from being as a single click in the parent
window which would cause the part to be parked rather than staying
in drag mode.
2012-12-04 13:09:53 -06:00
Antia Puentes 85e96c92ed In eeschema, when inserting a component into the schematic using the
Library Browser tool, you have to select it in the components listbox
and then press the "Insert component into schematic" button to close the
window and return to the schematic.

The attached patch enables the selection and insertion of a component in
schematic by double clicking on it in the Library Browser component
listbox. As the double clicking should have effect only if the Library
Browser was launched to load a component in schematic, the patch checks
for NULL the m_Semaphore variable, used two distinguish the mode in
which the Library Browser is running (modal, used when inserting a
component in schematic, or non-modal).
2012-12-04 13:04:04 -06:00
Marco Mattila b25e440ba9 Fix BOM-by-reference generator to print the separator character instead of the ascii code 2012-12-03 17:06:49 +02:00
jean-pierre charras c4d874cdb1 Pcbnew: plot solder mask layer with min width value specified: algorithm modified to reduce artifacts. 2012-12-03 15:27:34 +01:00
jean-pierre charras 4e96cc4bbb Pcbnew: minor coding style fixes. Very minor fixes. Minor enhancements. Fix bug #1085523 2012-12-02 12:38:00 +01:00
jean-pierre charras 78f928544f Pcbnew: minor enhancements. 2012-12-01 21:03:33 +01:00
jean-pierre charras 0edbe77903 Eeschema: dialog ERC: minor enhancements and code cleaning. 2012-11-30 13:28:23 +01:00
Marco Mattila ccf8c3bd83 Fix pcbnew zone corner filleting 2012-11-30 07:51:47 +02:00
Heikki Pulkkinen f8020f4728 Pcbnew: commit patch from Heikki Pulkkinen (via displayed with its right size and clearance during track creation/edition) 2012-11-29 20:27:08 +01:00
Wayne Stambaugh 23bded5697 Pcbnew print fixes and improvements.
* Fix offset errors when scale factor greater is than one.
* Changed behavior of fit in page when not drawing border and
  title block to fit board outline in page.
* Fix offset errors when mirroring (still not 100% correct on MSW with
  wxWidgets 2.9.4).
* Lots of the usual code cleaning and simplifying.
2012-11-28 20:50:58 -05:00
jean-pierre charras 9df7292af6 Pcbvew: fix a strange bug which swap x and y values for pad offsets when reading a s expr *.kicad_pcb board file. 2012-11-28 19:04:57 +01:00
Dick Hollenbeck bcb05fbc14 merge in evolving fp lib_table work 2012-11-28 09:24:53 -06:00
Lorenzo Marcantonio 7adc495692 Added warning about gcc 4.7.1 miscompile in COMPILING.txt 2012-11-28 08:38:02 +01:00
jean-pierre charras 69f8ee8ee2 Polyline.cpp: fix a bad wxASSERT test which generate error messages in Debug mode when there is no error, in DEBUG mode, when filling zones with holes. 2012-11-27 21:12:39 +01:00
Dick Hollenbeck 4acb97e02e reverse throw() clauses to quiet SWIG errors 2012-11-27 13:57:38 -06:00
Dick Hollenbeck 7cd840bf83 richio improvements, fix dangling open file 2012-11-27 08:25:50 -06:00
Dick Hollenbeck 9577736788 start using FILE_LINE_READER( const wxString& ) 2012-11-27 08:14:15 -06:00
Dick Hollenbeck f7ec499ee9 Change READ_LINE classes to use less virtual functions, and READ_LINE::ReadLine() to return char*
which can eliminate a subsequent call to READ_LINE::Line() for a small performance gain.
2012-11-27 07:50:01 -06:00
Dick Hollenbeck a64e1b3397 Fix dangling open file introduced as recent workaround 2012-11-27 06:42:28 -06:00
Dick Hollenbeck abeba63ed5 Another constructor for FILE_LINE_READER which enables more consistent file open strategies, and only call setvbuf() when the file is at position 0 2012-11-27 06:33:12 -06:00
jean-pierre charras 0dd05887d2 Csv Boom file: fix a minor error in commit 3818 2012-11-26 20:14:38 +01:00
jean-pierre charras f8b3873b83 Eeschema: Fixes and enhancements in BOM list generation and BOM code:
* remove useless spaces in csv bom file format.
 * remove KICAD_GOST conditionnal compilation and merge KICAD_GOST code with the "normal" code.
 * Csv file format created by KICAD_GOST code is now available for everybody through the BOM dialog options (as it should).
 * fix coding style issues.
2012-11-26 18:28:54 +01:00
unknown 63362c97f5 MacOSX: a strange bug with setvbuf in FILE_LINE_READER disalign the netlist reader. 2012-11-25 13:17:02 +01:00
unknown b07b214293 MacOSX: Crash in pcbnew during edit footprint and changing layer from dialog (Fixes: #764678) 2012-11-25 09:08:25 +01:00
unknown e368ae3230 MacOSX: now editing Text on PCBNEW works nicelly as expected. 2012-11-25 00:23:36 +01:00
unknown 9cf627a656 MacOSX: Fixes Crash when adding text on pcbnew (bug #891347) 2012-11-24 23:03:30 +01:00
Marco Mattila 5d383f1885 Fix saving of local thermal parameters in pcbnew legacy_plugin. 2012-11-24 18:02:10 +02:00
jean-pierre charras f9b7ede7ff Pcbnew: fix bug1082146 (Keep-out areas get destroyed by "export settings to other zones" )
Eeschema: fix bug 1082107 (error message" component not found" when no component selected from select component dialog box)
2012-11-23 10:18:52 +01:00
jean-pierre charras a2a44bb7ef Pcbnew: fix bug1082146 (Keep-out areas get destroyed by "export settings to other zones" )
Eeschema: fix bug 1082107 (error message" component not found" when no component selected from select component dialog box)
2012-11-23 10:10:37 +01:00
jean-pierre charras 1f37ca437b BOM list code cleanup. 2012-11-22 21:33:52 +01:00
unknown ac77e047f4 MacOSX: disabling BufferedBitmap of OSX in gerbview, not supported nor accelerable and bitmap becomes too large in case of retina display to be usable 2012-11-20 20:19:24 +01:00
jean-pierre charras 02a6baad8a polygon: update clipper lib. 2012-11-20 12:42:39 +01:00
jean-pierre charras 799ef3bc0d Eeschema: item drag command: Fix issue for overlapping items (from a Younes Manton's idea)
Added: display info when clicking on labels.
2012-11-20 12:35:09 +01:00
unknown b337dccd0c MacOSX: problems with cvpcb after multiline patch:
1) OSX compiler is really choosy (class_components_listbox.cpp)
2) Old OSX code maked an endless loop (listboxes.cpp)
2012-11-19 22:34:25 +01:00
Dick Hollenbeck 8867bf262b Eliminate many assumptions in Pcbnew's library manager, pertaining to locality of libraries and
their type, by using the more abstract PLUGIN::Footprint*() functions.

This is an intermediate phase only, other changes will be necessary as library table support comes in.
Encapsulate usage of library path searching, since that will go away as library table support comes in.
Add FOOTPRINT_EDIT_FRAME::{get,set}LibPath() and FOOTPRINT_EDIT_FRAME::{get,set}LibNickName() functions
to provide this encapsulation.
2012-11-19 10:19:38 -06:00
jean-pierre charras 0543670734 Try to fix a compil issue with some wxWidget versions. 2012-11-19 15:32:34 +01:00
jean-pierre charras 9c66afb6fe Pcbnew: enhanced dialog for SVG export 2012-11-16 15:13:31 +01:00
Dick Hollenbeck 0dc8241605 Add *.kicad_mod as default import footprint extension. Turn on all Cu layers for thru hole pads in case loading non-wildcard s-expression footprint files. 2012-11-15 10:46:43 -06:00
Dick Hollenbeck 7ca5c4099e remove -std=c++0x compiler option since nobody is ready for it, and accordingly back into auto_ptr from unique_ptr 2012-11-15 10:04:10 -06:00
jean-pierre charras e40c8fa164 Pcbnew: fix incorrect filenames when plotting layers 2012-11-15 11:47:23 +01:00
jean-pierre charras df88d0cbea Fix compil issue under MinGW: for an obscure reason the option -std=c++0x creates error in wxWidget code:
some functions used in wxWidgets ( like _strdup and few other) are not defined when this option is set. 
but the equivalent option -std=gnu++0x works fine so it is used under mingw instead of  -std=c++0x.
(Under Linux/OSX  the option -std=c++0x is used)
2012-11-14 21:07:09 +01:00
Dick Hollenbeck f73e785662 1) Switch to boost hashtable support from wx macros which did not handle std::string.
This required the additional compiler command line option "-std=c++0x".

2) Switch to unique_ptr from auto_ptr which is C++ deprecated.

3) Change to new English layer names per mailing list discussion, see class_board.cpp.

4) When saving to *.kicad_pcb or *.kicad_mod, identify opportunities to use wildcard
   layer sets, for pads so far.

5) Switch to two std::string hashtables in pcb_parser.cpp, away from one wxString based one
   for layer names and layer sets mapping. One hashtable holds the mask, the other the index.
   Layer sets are only in the mask table.

6) Move "LOCALE_IO toggle" into PCB_IO::Format() since it is a public API function and
   caller should find it as convenient as possible to use.  LOCALE_IO should handle
   nesting OK in the case where public Format() is called from one of the Footprint*()
   functions.

7) Drop support for "export module to new library".  Creating new libraries will have to
   be handled in concert with library table entries, and we've talked recently about
   creating a better footprint library manager, one that resides in a DLL/DSO.  So
   this kind of functionality needs to be handled in there in the near future.

8) Change name of exported PCB_IO module/footprint to *.kicad_mod and not *.emp.
2012-11-14 01:15:59 -06:00
jean-pierre charras 1bb685cc57 pcbnew: fix minor issues.
pcb_calculator: fix a compil warning (gcc 4.7)
2012-11-12 17:19:10 +01:00
Dick Hollenbeck 5d4da5ede9 switch to new s-expression format for footprint exports, use english layernames for naked footprints, dodge conflict with pythons HAVE_GETC_UNLOCKED 2012-11-10 00:39:18 -06:00
Dick Hollenbeck fe295788e7 footprint save to use untranslated (English) layer names 2012-11-09 13:00:00 -06:00
Dick Hollenbeck f8b3eaedb5 populate PCB_PARSER::m_layerMap with English layernames so footprints
can be parsed, since they do not have an overriding layer name map
like a BOARD does.

Avoid doubly looking up hashtable entries in m_layerMap.

Minor code reformatting.
2012-11-09 00:58:00 -06:00
Dick Hollenbeck e5e83eba05 remove old sourceforge mailing list export file 2012-11-08 13:45:14 -06:00
jean-pierre charras 28a35c9883 Pcbnew: Add a min width parameter to plot solder mask layers.
* If this param is set to 0, the previous behavior is used.
* Else the solder mask is plotted as polygon, with shapes near than  this min width value are  merged.
Pcbnew in nanometer version: fix a serious rounding issue due to the fact dialogs were using 4 digits for mantissa.
* This is not enough for nanometer coordinates ( 8 are needed to display a value in inches),
*  so sometimes after closing a dialog, some coordinates were modified, although no new value was entered.
Minor other bug fixed.
2012-11-06 18:58:53 +01:00
jean-pierre charras d8a6c7c1bf Add a min width parameter to plot solder mask layers. 2012-11-05 21:20:34 +01:00
jean-pierre charras c8f6806287 Eeschema: fix an old bug: sometimes E hotkey (and some other' hot keys) was editing a previously selected item, not the item under the mouse cursor
Templates: remove useless backup files
2012-10-31 21:27:31 +01:00
Dick Hollenbeck 8bf57814a4 implement move up, move down in lib table editor 2012-10-31 09:41:47 -05:00
Dick Hollenbeck c2d4338024 remove unused #include <wxfstream.h> from several places 2012-10-29 16:56:18 -05:00
Dick Hollenbeck 6410862b15 add new templates to template/CMakeLists.txt, group all templates into one installation COMPONENT 2012-10-29 16:55:05 -05:00
Hans Henry von Tresckow 4845668a4a TI Stellaris Launchpad Boosterpack Template.
Here is a first cut at the 40pin booster pack template. I made 2
versions, BoosterPack40, which has the optional J5 connector and is
2"x1.7" and BoosterPack40_min, which is 2"x1.35" and leaves the
switches accessible.
2012-10-29 15:48:33 -05:00
Marco Mattila 146adbf831 Do not force vias to be substracted from silkscreen in pcbnew gerber plot 2012-10-28 22:51:47 +02:00
Dick Hollenbeck d1f291acb8 128 pixel icons from Frabrizio's script and tar file. 2012-10-28 14:10:07 -05:00
Dick Hollenbeck 4b7c3010e0 switch from STREAM_OUTPUTFORMATTER to FILE_OUTPUTFORMATTER mostly throughout,and minor richio factoring 2012-10-25 10:41:20 -05:00
Wayne Stambaugh 4039f66530 Add missing scripting build flags to EDA_BASE_FRAME::CopyVersionInfoToClipboard. 2012-10-25 10:27:35 -04:00
Dick Hollenbeck 4ce6362f4c streamline the FILE_OUTPUTFORMATTER API for ease of use 2012-10-25 02:10:59 -05:00
Dick Hollenbeck 5765ebef08 add class FILE_OUTPUTFORMATTER and use it in PCB_IO, since it is about 8-10 faster than STREAM_OUTPUTFORMATTER 2012-10-25 00:52:55 -05:00
Dick Hollenbeck a3eb501225 move wxString constructor outside loop for speed 2012-10-24 13:59:37 -05:00
Dick Hollenbeck 82706bf152 fix ownership issue in wxFFile vs. FILE_LINE_READER 2012-10-24 13:42:39 -05:00
Dick Hollenbeck 5e852ba1fd move PCB_PARSER into PCB_IO as a member 2012-10-24 13:20:33 -05:00
Dick Hollenbeck d49cdb2ded DSN_LEXER underneath PCB_PARSER does not own the LINE_READER it receives, fix memory leak 2012-10-24 12:38:10 -05:00
Wayne Stambaugh a8ad1f8097 Fix compile error against wxWidgets 2.8 brach. 2012-10-23 13:20:22 -04:00
jean-pierre charras 2ea3c4acac Eeschema: Bug fix (move component field was not undoable)
Minor enhancement in popup menus for wire and bus.
Kicad: stm32f0discovery template: very minor fix.
2012-10-23 18:37:19 +02:00
Dick Hollenbeck d1e3bad24f pcbnew import footprint fixed for legacy nanometer format 2012-10-22 15:41:26 -05:00
Kerusey Karyu 06f46e4b14 Fix error in stm32f100-discovery-shield.brd 2012-10-21 10:40:10 +02:00
Kerusey Karyu 54714fd989 Add stm32f100-discovery-shield template 2012-10-20 18:16:34 +02:00
jean-pierre charras 912d308b9d Kicad: bug fix in menubar when changing the selected locale.
fctsys.h: remove useless define.
Fix minor issues and add minor enhancements.
2012-10-18 21:31:40 +02:00
Dick Hollenbeck 0b71e4a98a more fp_lib_table work 2012-10-18 10:28:50 -05:00
Wayne Stambaugh 900bef9ccf Put KiCad on a diet to remove the uncessary slices of pi. (fixes 1066194) 2012-10-17 16:59:05 -04:00
Dick Hollenbeck 7106d1e605 more fp_lib_table work 2012-10-17 10:12:17 -05:00
jean-pierre charras 6840ec0d09 Fix a minor compatibility issue in .pro file for new boards, between decimils and nanometers versions of Pcbnew. 2012-10-17 12:57:21 +02:00
Dick Hollenbeck 0e8e811b14 decouple wxGridTableBase from FP_LIB_TABLE, this was poor information hiding 2012-10-16 20:00:25 -05:00
Dick Hollenbeck 3dc986bbf6 fp_lib_table dialog work 2012-10-16 01:56:57 -05:00
Dick Hollenbeck 34813dc07c remove one-ness bug from CMakeLists.txt 2012-10-16 00:28:39 -05:00
Wayne Stambaugh f79d75076c Only use -O1 GCC optimization level for versions 4.7 and above for now. 2012-10-15 21:42:50 -04:00
Dick Hollenbeck 57b5ce84a5 add dialog for fp_lib_table 2012-10-15 17:37:08 -05:00
Dick Hollenbeck 395338f46a add dialog for fp_lib_table 2012-10-15 17:30:01 -05:00
Wayne Stambaugh c33cd27626 Minor FP_LIB_ID object changes. 2012-10-15 16:48:01 -04:00
jean-pierre charras 2ca4512443 Kicad manager: project_template.cpp: accepts lower and upper case HTML keywords (compatibility with libreoffice) 2012-10-15 19:55:04 +02:00
Dick Hollenbeck 76b4dc7346 Commit Dick's changes to the FP_LIB_TABLE object. 2012-10-15 12:19:42 -04:00
Wayne Stambaugh 53609d2ecd Merge changes from testing branch. 2012-10-15 09:40:40 -04:00
Dick Hollenbeck d24054ac00 make nanometers the default board internal units within Pcbnew 2012-10-15 00:21:31 -05:00
Wayne Stambaugh 2c0619f69d Initial commit of footprint library table code. 2012-10-14 21:38:32 -04:00
jean-pierre charras f039aeb4c8 missing files 2012-10-14 19:00:47 +02:00
Brian Sidebotham ab0e47d402 Commit patch from Brian Sidebotham: Project template in Kicad manager 2012-10-14 18:57:11 +02:00
jean-pierre charras 03128b7530 Eeschema: always stores sheet filename in unix-like notation, and fix a bug when editing sheet file name.
Pcbnew: add PDF format  for drill map generation.
Plotter classes: tweaking code.
2012-10-13 20:54:33 +02:00
Andrey Fedorushkov ed3e79325f eeschema: fix segfault when edit text and empty editing text 2012-10-13 22:33:58 +04:00
unknown c4c715fcd0 OSX: Corrected issue with Menus, workaround/fix for an issue with Mountain Lion 2012-10-13 20:23:03 +02:00
Wayne Stambaugh 86b83ddbc9 Fix footprint library file extension bug in CvPcb and Pcbnew due to s-expression changes, fixes lp:1064593. 2012-10-09 15:18:12 -04:00
Wayne Stambaugh 62c43eaf53 Add Boost version to EDA_BASE_FRAME::CopyVersionInfoToClipboard(). 2012-10-09 11:31:55 -04:00
Wayne Stambaugh 33cf2243a8 Check for getc_unlocked() and fall back to getc() in richio if it's not available. 2012-10-09 10:31:36 -04:00
Dick Hollenbeck 02a1c2f096 optimize isSpace for negative 8 bit bytes 2012-10-08 15:01:17 -05:00
Dick Hollenbeck b841150c23 *) Use fgetc() technique to avoid strlen() in FILE_LINE_READER::ReadLine(),
which was having difficulty with embedded nuls in files coming from PCAD.

*) Make dsnlexer.cpp's isSpace() treat nuls as whitespace.
2012-10-08 14:34:46 -05:00
Dick Hollenbeck 3db19ba2eb eeschema erc dialog extends from DIALOG_SHIM 2012-10-08 14:34:04 -05:00
Dick Hollenbeck 22d1f50455 minor. 2012-10-08 14:30:38 -05:00
Wayne Stambaugh baee140518 Convert footpint library log functions to trace functions to reduce debug output. 2012-10-07 18:26:17 -04:00
Dick Hollenbeck deaa4529ae Commit Dick's INPUTSTREAM_LINE_READER patch. 2012-10-07 17:26:41 -04:00
Wayne Stambaugh bed29749f2 Pcbnew s-experssion footprint library implementation.
* Add footprint methods to PCB_IO.
* Add FP_CACHE and FP_CACHE_ITEM for handling new footprint library design.
* Add code to save legacy libraries in new format.
* Change behavior of BOARD_ITEM::GetLayerName() to return the default layer
  name when the item does not have a BOARD as a parent.
* Minor changes to the module output formatter when writing to module library
  files (no BOARD as parent).
* Add new (and some that I forgot along the way) CMake flags to
  EDA_BASE_FRAME::CopyVersionInfoToClipboard().
* Add -Wno-narrowing to GCC flags to stop GCC 4.7 from complaining about
  a conversion from int to unsigned in the Boost polygon library.
* Add INPUT_STREAM_READER to richio.cpp to allow using any object derived
  from wxInputStream as a LINE_READER (needs to be validated).
2012-10-07 11:37:25 -04:00
jean-pierre charras e57cbd3348 Dialog drill file: remove precision choice, because only one choice was acceptable
(the option with the smallest number of digits for coordinates created unacceptable truncation coordinates in Excellon drill files)
2012-10-05 21:04:17 +02:00
jean-pierre charras 2f788445a9 Pcbnew: drill files creation: better dialog to create driil files, map files and report file. Code cleaning 2012-10-05 14:25:12 +02:00
jean-pierre charras d4e55c69c1 Pcbnew: fix an issue when collecting vias (for instance when left clicking on a via, it was not always detected)
This bug was mainly noticeable when using buried vias (some were never detected)
Minor other fixes (typos, strings hard to translate ...)
2012-10-04 19:47:28 +02:00
jean-pierre charras d07351c8ba More dialogs derived from DIALO_SHIM 2012-10-04 08:57:15 +02:00
jean-pierre charras 2412caf494 Pcbnew: make all dialogs derived from DIALOG_SHIM. 2012-10-03 13:25:30 +02:00
jean-pierre charras 9b6f75afd3 Pcbnew: Make scripting version compilable under Windows 2012-10-01 08:04:06 +02:00
jean-pierre charras a4b2a6537c Make scripting version compilable under Windows 2012-09-30 19:50:17 +02:00
jean-pierre charras cfaa7d9e54 Eeschema: fix a bug in my previous commit 2012-09-28 20:45:04 +02:00
jean-pierre charras 0ca3012c67 Eeschema: code cleanup, remove dead code and some global and useless variables 2012-09-28 19:47:41 +02:00
jean-pierre charras 42ebece808 Eeschema: fix Bug #1057225 2012-09-27 20:18:56 +02:00
unknown 0d7510c129 [MacOSX] Updated Icons - Document ones still missing :( 2012-09-27 19:20:44 +02:00
Felix Morgner ebe697f62a Added support for multi-selection and multi-editing in cvpcb. 2012-09-26 15:57:58 -05:00
Felix Morgner 29240fd14b fixed code to better comply with the coding style guidelines 2012-09-26 19:22:48 +02:00
Felix Morgner 97f4d18a13 Added mutli-selection to cvpcb 2012-09-26 17:36:48 +02:00
unknown 8ef0dd69da MacOSX - Fixed some issues launching bundles/binaries 2012-09-26 00:33:42 +02:00
jean-pierre charras 30d41b33d1 Finishing code cleaning in plot functions. 2012-09-25 09:49:29 +02:00
jean-pierre charras 2ce06cfe08 Pcbnew: fix compil warning and a minor bug in plot negative (frame fer plotted in white therefore not visible).
minor code cleaning
2012-09-24 18:03:03 +02:00
jean-pierre charras 3b1a1125d2 convert_from_iu: erroneous definition of MILS_PER_IU, MM_PER_IU (and therefore Iu2Mils)
only for Pcbnew in Decimils version. These definitions are provided, but not yet used in code.
2012-09-24 08:46:20 +02:00
jean-pierre charras 93cdfb566b Pcbnew, plot functions: fix bug in SVG plotter, fix a minor other bug when using PS plotter (trcak width fine adjust not working)
and plot code cleaning continued
2012-09-24 08:39:59 +02:00
jean-pierre charras b61ac2069d pcb_calculator: fix compil issue about isinf (under mingw) 2012-09-22 17:45:15 +02:00
jean-pierre charras 6e8a71ec34 pcb_calculator: fix compil issue about isinf. 2012-09-22 14:13:57 +02:00
jean-pierre charras 3b3fc0151e Cvpcb: remove macros MAX, MIN, ABS (forgotten file in my last commit) 2012-09-22 13:29:30 +02:00
jean-pierre charras f5643f2332 All: remove macros MAX, MIN, ABS from macros.h and replace these macros by std::max, std::min and std::abs (mainly found in old code). 2012-09-22 13:19:37 +02:00
Dick Hollenbeck 38e5d961f6 switch all <math.h> includes to <cmath> includes on an attempt to dodge some abiguous references to atan2() 2012-09-21 12:02:54 -05:00
jean-pierre charras 5be15bed82 Pcbnew: some code cleanup in plot functions. 2012-09-21 10:20:38 +02:00
jean-pierre charras deb6aa8cc5 Fix incorrect titles in SVG export dialog 2012-09-20 21:15:14 +02:00
jean-pierre charras 3b3e19ee8a dcsvg (and therefore KicadSVGFileDC) is now unused. Use SVG plotter only to export a board SVG file.
SVG export does not use no more wxWidgets wxDC.
In pcbnew SVG files can be created by plot menu (in B&W) or export SVG menu (B&W or Color).
Export SVG menu is more suitable to create a view of a board, and plot menu is better to create a B&W document of silkscreen layers.
(In the future, the 2 menus could be merged, because they are not very different).
Note: pcbnew plot code is cleaned, mainly in dialog files, but still needs more cleanup.
2012-09-20 20:58:41 +02:00
Craig Southeren a713e47713 This fixes a MSVC compile error caused by a static scalar initialiser. 2012-09-20 08:54:35 -05:00
Craig Southeren abbc83bd51 Fix MSVC compile errors caused by struct forward declared as class 2012-09-20 08:38:50 -05:00
Dick Hollenbeck 7d4aaa8cdb fmin() was giving grief to MSVC, switch to std::min() 2012-09-20 08:22:33 -05:00
Dick Hollenbeck 06b3172333 This change fixes a compile error on MSVC 2012-09-20 08:15:12 -05:00
jean-pierre charras 2062cf8fe4 eeschema: plot functions: code cleaning.
SVG plotter: fix issues in draw arc and draw rectangle.
2012-09-18 16:50:30 +02:00
jean-pierre charras 3e15da5bcc Eescheam: plot HPGL: add comments and minor fix. 2012-09-18 10:39:56 +02:00
jean-pierre charras 520eace689 eeschema: plot dialog: minor fix 2012-09-17 21:28:17 +02:00
jean-pierre charras 9ed3c5dc46 Eeschema: Plot dialogs: unify 5 dialogs (which means 5 duplicate code) to only one plot dialog (like in Pcbnew)
remove duplicate code and clean it.
Simplify HPGL dialog: plot offet removed and replaced by only one option:
plot origin to center of sheet or not (some HPGL  plotters have the plot origin to center of the paper area,
and others have this origin at the bottom left corner)
This is surely enough.
2012-09-17 20:39:42 +02:00
Marco Mattila 7db3834f0b Move pcbnew pcb edge layer plot checkbox to common plot options 2012-09-17 21:14:41 +03:00
jean-pierre charras 5979b1a1b6 Add missing files 2012-09-17 19:56:40 +02:00
jean-pierre charras d283a8c878 Eeschema: Plot dialogs: unify 5 dialogs (which means 5 duplicate code) to only one plot dialog (like in Pcbnew)
clean duplicate code.
Simplify HPGL dialog: plot offet removed and replace by only one option (plot origin to center of sheet or not)
This is surely enought.
2012-09-17 19:42:27 +02:00
jean-pierre charras 3f2a258930 Pcbnew: added: SVG plotter. Need refinements, but works.
Mainly to plot drill maps, but can be used to plot boards, for documentation.
The print svg still exists, but the plot SVG has more options (mirroring, holes in pads),
however  print svg allows color print, and full board printing, and plot does not.
2012-09-15 14:13:03 +02:00
jean-pierre charras 550d36dc33 Pcbnew: fix minor issue when loading a foorprint: if the footprint name has lower case letters, the name was asked twice 2012-09-13 14:15:24 +02:00
jean-pierre charras 46b9d9e359 All: fix most of Doxygen warnings. 2012-09-12 19:28:55 +02:00
jean-pierre charras 3e084a3b0e Pcbnew: fix compil error I created in my previous commit.
All: fix some Doxygen warnings
2012-09-12 13:11:30 +02:00
jean-pierre charras 391a663360 All: better code to handle opened frames libview, libedit, modview, modedit.
Other minor fixes.
2012-09-12 11:53:11 +02:00
jean-pierre charras 068ae2f344 Code cleaning, minor fixes and minor coding style fixes. wxWidgets 2.9.4 compatibility fix( deprecated function MakeModal ) 2012-09-11 21:03:21 +02:00
jean-pierre charras 64dfea78b8 Pcbnew: drag functions: serious cleanup and better code. Use now the connectivity functions to find tracks connected to pads,
and therefore  tracks are now dragged when a end point is inside a pad, not necessary on the pad position.
However, drag functions still need more cleanup.
2012-09-11 09:33:17 +02:00
jean-pierre charras 3bbcd30396 Pcbnew: cleanup functions: now, cleanup uses same algorithm as connectivity calculations to detect pads connections, and is faster.
therefore tracks which have a end point inside a pad, but not necessaryexactly  to the pad position are seen as connected, and are no more removed.
Side effect: reconnect to pads option is removed, because it is useless.
TODO: use this algorithm in drag functions.
Minor other fixes
2012-09-07 21:29:44 +02:00
Dick Hollenbeck 09bfd3311c apply DIALOG_SHIM to dialog_lib_edit_text_base and make dialog_lib_edit_pin_base apportion more width for pin name 2012-09-07 11:15:18 -05:00
Lorenzo Marcantonio fdd0e02c35 Substituted the few remaining uses of long instead of time_t 2012-09-05 14:13:33 +02:00
jean-pierre charras 10b5322b87 The last one compil error fix. 2012-09-02 19:53:34 +02:00
jean-pierre charras f01feef636 fix compil errors 2012-09-02 18:38:52 +02:00
Lorenzo Marcantonio 1aed2b3114 Another fix for wx2.9 compilation (same issue as before, another call...) 2012-09-02 17:46:19 +02:00
Lorenzo Marcantonio adc9b70d72 Probable fix for compilation under wx 2.9 (doesnt hurt anyway) 2012-09-02 16:13:50 +02:00
Lorenzo Marcantonio 5f86a70891 Enforced EDA_COLOR_T type and minor const-ification 2012-09-02 14:06:47 +02:00
Lorenzo Marcantonio ea9a84b748 Enforced EDA_COLOR_T type and minor const-ification 2012-09-02 13:01:12 +02:00
Lorenzo Marcantonio c73ca9a6da Encapsulated drawmode as an enum for type checking 2012-09-01 15:38:27 +02:00
jean-pierre charras e467e58857 Modedit: very minor enhancements. 2012-08-31 21:19:48 +02:00
Marco Mattila bb73777a4a Take pad clearance into account in intersection detection during pcbnew zone filling. 2012-08-31 21:43:09 +03:00
jean-pierre charras a63a62f827 Pcbnew: fix bug: deleting a cutout in a zone was not undoable. 2012-08-31 17:59:14 +02:00
jean-pierre charras 1c6574e69d Fix 0 length segment in outline zone creation, that breaks zone chamfer option. 2012-08-31 15:58:23 +02:00
jean-pierre charras 313785b421 Pcbnew: in SVG export, add option to export only the board area, not the full page.
dialog plot functions: fix compil warnings with wxWidgets 2.8
2012-08-31 09:43:37 +02:00
Lorenzo Marcantonio b6261f3d80 Refactored PCB plot infrastructure
Removed filename from the BASE_SCREEN class
Scripting support for board plot
2012-08-30 21:25:12 +02:00
Lorenzo Marcantonio 3dc4de85b5 Fully encapsulated with accessors PCB_PLOT_PARAMS 2012-08-30 20:06:13 +02:00
Lorenzo Marcantonio bb0711eb3f Minor plot driver enhancements 2012-08-29 22:13:47 +02:00
Lorenzo Marcantonio 0cb647ee1e Removed g_pcb_plot_options from gerbview (which has no plotting anyway...) 2012-08-29 20:43:51 +02:00
Lorenzo Marcantonio 5a0c37e2b9 Removed PCB_BASE_FRAME::m_printBorderAndTitleBlock (all dead code) 2012-08-29 20:34:34 +02:00
Lorenzo Marcantonio 4a3ddd5b2c const-ifiation of member 2012-08-29 19:35:23 +02:00
Lorenzo Marcantonio e6095e6fd8 Added 'parachute' std::exception handling to python interface 2012-08-29 19:32:14 +02:00
Lorenzo Marcantonio 33d1d0f8e4 Added MEASUREMENT sysvar to DXF driver, marks explicitly the file as metric 2012-08-29 19:31:00 +02:00
Lorenzo Marcantonio d02025b0ed Fixed format string (spurious character was added) in HPGL driver 2012-08-29 19:29:45 +02:00
Lorenzo Marcantonio 28af99d95d Fixed compilation with unicode (wxString to printf without GetChars) 2012-08-29 19:28:33 +02:00
Lorenzo Marcantonio 619c8e689a Script plotting patch 2012-08-29 18:59:50 +02:00
jean-pierre charras c03355d67f Minor cosmetic enhancements.
Kicad manager: shows now svg files in tree files.
Pcbnew: fix incorrect printing (board out of page) when creating drill map in postscript format ( noticeable mainly for small boards)
2012-08-29 14:40:09 +02:00
Lorenzo Marcantonio 417572f3c5 Missing a wxT in call to LogDebug 2012-08-29 13:28:37 +02:00
Dick Hollenbeck c5ed76f104 wxFileName::CreateTemporaryFile() is switching to /tmp directory when no preceding path is present 2012-08-28 10:41:08 -05:00
jean-pierre charras 5721a279c8 Pcbnew: Fix bug 1042394 and very minor code cleaning. 2012-08-28 08:51:18 +02:00
jean-pierre charras 0cf8553b2e 3D viewer: code tweaking 2012-08-27 13:41:22 +02:00
jean-pierre charras 6d5b865741 3D viewer: fix a very minor issue, and more code cleaning. 2012-08-27 09:06:52 +02:00
jean-pierre charras 7b08e81991 3D viewer: fix very minor issue. Remove duplicate code 2012-08-26 20:10:28 +02:00
jean-pierre charras 6d4e0ff665 3D viewer:
*  serious code cleanup (remove duplicate code)
  *  shows (option in 3D preference menu) the copper items (tracks, zones...)  in 3D, using 35 microns copper thickness.
      However, because there are a lot more3D data to show (roughly 4 times more), this is slower.
2012-08-26 15:59:55 +02:00
Dick Hollenbeck bd6ea96ed6 wxServer was a confusing define, since it is also a wxWidgets class, do not use it 2012-08-24 06:31:09 -05:00
Gregor Riepl 9feccc625b The listener is opened on INADDR_ANY, so it will accept any network
connection, no matter if it is originating locally or from the outside
of the host. There is no check in place to discard non-local
connections. The only security against a malicious attack would be
provided by a local firewall, which is not guaranteed to be installed on
every workstation kicad is used on.

I tested this, and a host running eeschema accepts connections on TCP
port 4243 from other hosts on the internet.

A patch to remedy this potentially serious security hole is attached. It
creates the listener on localhost instead. A flag is provided to allow
the creation of sockets on 0.0.0.0 instead, if required. localhost is
the default.
2012-08-24 06:19:52 -05:00
Dick Hollenbeck 65949662f6 *) 64 bit size_t is not compatible with %u printf format control. use "%zu"
where the 'z' prefix is for size_t arguments.

*) minor beautification
2012-08-24 06:14:10 -05:00
jean-pierre charras 22defb9ad4 3d-viewer and polygon functions: remove duplicate code about conversion from basic shapes to polygons. 2012-08-23 21:15:58 +02:00
Marco Mattila 37cb4d00df Fix pcbnew thermal stub removal for pads with locally defined thermal properties. 2012-08-22 23:16:21 +03:00
jean-pierre charras a48c0ece4b 3D-viewer: code cleanup.
Eeschema: annotate and netlist dialogs: enhancements.
Minor  coding policy fixes and  changes.
2012-08-21 12:45:54 +02:00
Dick Hollenbeck b8c77dc417 work around wx2.8 wierdness 2012-08-16 10:34:41 -05:00
Dick Hollenbeck ed42ae5a79 fix problem with eeschema print dialog showing up on missing monitor 2012-08-15 12:55:48 -05:00
Dick Hollenbeck 20f83297ce legacy plugin fully support text horiz/vert justification, eagle plugin text fixes 2012-08-11 14:14:45 -05:00
jean-pierre charras 896dc0fcf6 3D-viewer: code cleaning. Added option in menu: show a 3D grid.
All: press ctrl+shift key when moving the mouse allows the graphic cursor to be moved outside the grid.
(useful to place graphic objects, texts in any position, regardless the current grid)
2012-08-11 14:52:13 +02:00
Dick Hollenbeck f8a238e670 fixes for plugins 2012-08-11 00:50:17 -05:00
Miguel Angel Ajo 3b8f2a551b pcbnew: Show/Hide button for scripting console 2012-08-10 23:53:50 +02:00
Miguel Angel Ajo 2263633df8 pcbnew: fix bug 1033510 that crashes pcbnew when no footprint wizard is selected 2012-08-06 22:41:41 +02:00
Miguel Angel Ajo 59b7a8ff8f pcbnew: footprint wizards now can export the output module to the library or board 2012-08-05 00:15:57 +02:00
jean-pierre charras 9e6b63e3da Pcbnew: fix a minor issue in non copper zones when creating the solid filled areas. 2012-08-04 18:33:04 +02:00
jean-pierre charras 5eb63c42f1 Remove Kbool from Kicad. Use Clipper instead.
Clipper is, by far, more easier to use than Kbool, and is currently actively maintained.
It is used only to normalize polygons, i.e. to convert self intersecting polygons to simple polygons,
which is not possible with boost::polygon.
2012-08-04 13:52:04 +02:00
jean-pierre charras 1bba1c5ee0 Remove Kbool from Kicad. Use Clipper instead, last changes 2012-08-04 13:47:24 +02:00
jean-pierre charras f7047d3cfa Remove Kbool from Kicad. Use Clipper instead. 2012-08-04 11:43:27 +02:00
jean-pierre charras cb16951519 Very minor fixes. 2012-08-03 17:43:15 +02:00
jean-pierre charras 14dc5709ee Eeschema: fix crash when changing a label type to an other label type during creation.
Pcbnew: code cleaning in polygon functions
2012-08-02 19:36:14 +02:00
jean-pierre charras 7d03b0af33 Polygon code cleanup 2012-08-02 19:32:42 +02:00
Miguel Angel Ajo 33f7d83c71 scripting + pcbnew: Merged with scripting branch, now it supports -DKICAD_SCRIPTING_WXPYTHON for full wx integration with python 2012-08-02 19:31:39 +02:00
Miguel Angel Ajo e469a6b3d8 pcbnew scripting: cleanup, renamed KICAD_SCRIPTING_EXPERIMENT to KICAD_SCRIPTING_WXPYTHON, now every flavour compiles 2012-08-02 19:24:53 +02:00
jean-pierre charras 2971ea6564 Eeschema: fix crash when changing a label type to a global label during creation.
Pcbnew: code cleaning in polygons
2012-08-02 15:23:53 +02:00
Miguel Angel Ajo 02ced9a339 scripting: fixed kicad compilation, cleanups 2012-08-02 09:47:30 +02:00
Miguel Angel Ajo 1960a8768e pcbnew: wxPyBeginBlockThreads before every python call 2012-08-01 14:50:21 +02:00
Miguel Angel Ajo f4c8abb1b4 Double Python initialization fixed 2012-08-01 13:54:20 +02:00
jean-pierre charras ab9630b825 PolyLine and math_for_graphics code cleanup: remove arc support in CPolyLine class:
This is an obscure legacy code from FreePCB, never used, never tested, never maintained.
2012-08-01 10:08:37 +02:00
jean-pierre charras e79d6ae971 Cleanup math_for_graphic code 2012-08-01 09:07:56 +02:00
Miguel Angel Ajo 0348e13258 pcbnew scripting: fixed for coding style policy 2012-07-31 23:00:33 +02:00
jean-pierre charras 40c7c7dae8 Remove freepcb arc legacy code from PolyLine. 2012-07-31 19:51:58 +02:00
jean-pierre charras 396695c866 Remove arcs support in zone outlines: this is a legacy code from FreePCB, never used, never tested, never maintained. 2012-07-31 15:12:51 +02:00
jean-pierre charras a07ae76bcc Fix issues in zones creation (DRC and merging) I created in 3658.1 2012-07-30 09:40:25 +02:00
Miguel Angel Ajo 0221700226 merged divertion 2012-07-30 00:24:40 +02:00
Miguel Angel Ajo d8f3424554 pcbnew: scripting, Capacitive Touch Slider Wizard 2012-07-29 23:40:41 +02:00
jean-pierre charras 623234c7c2 More work on a better support of polygons in Kicad (code cleaning). 2012-07-25 20:46:25 +02:00
jean-pierre charras 49aff4eba3 Start work on a better support of polygons in Kicad (code cleaning).
Some coding style policy fix.
2012-07-25 09:36:56 +02:00
Miguel Angel Ajo 9281d15c70 Footprint wizard converts from user units to internal units back and forth, so user can type in mm or mils now 2012-07-23 00:23:17 +02:00
Miguel Angel Ajo e482826ac3 .dso -> .pyd is the right extension for python .dll WIN32 2012-07-22 14:19:52 +02:00
Miguel Angel Ajo 49e2e292dd Adam Vašíček patches for WIN32 compilation of kicad scripting 2012-07-22 14:15:38 +02:00
jean-pierre charras d721f176f8 Eeschema: fix a bug that crashes eeschema (only when compiled in debug mode) when creating a new wire, and when any wire orientation is allowed. 2012-07-21 18:52:29 +02:00
Marco Mattila 58532cd8c5 Fix axis offset issue in pcbnew gerber circular interpolation. 2012-07-18 22:32:47 +03:00
Marco Mattila 37fe3ca01a Edit eeschema single part per line sorting code. 2012-07-17 22:13:35 +03:00
jean-pierre charras 1a01535313 Libedit and Modedit: fix minor, but annoying issues when editing items 2012-07-17 17:29:29 +02:00
Marco Mattila 2ba0f5d807 Fix eeschema single part per line bom generation. 2012-07-16 21:49:04 +03:00
Miguel Angel Ajo 48fa8fd20b Fixes Win32 compilation that my previous commit broke, thanks to JP 2012-07-16 16:48:51 +02:00
jean-pierre charras eeb179fc9a Pcbnew: Fix crash after opening footprint wizard 2012-07-16 15:34:08 +02:00
jean-pierre charras 76d1abb9ca Fix compil issues under mingw 2012-07-16 11:19:23 +02:00
Miguel Angel Ajo 68d2aed8af Python scripting and fixes for non-scripting compilation 2012-07-16 07:53:22 +02:00
Miguel Angel Ajo dfdecb7e0b Merged with testing 2012-07-15 22:38:25 +02:00
Miguel Angel Ajo 2b54414e60 Support for nanometer build, extra example 2012-07-15 22:01:05 +02:00
Marco Mattila 2f03f95e9d Use circular interpolation for circles and arcs in pcbnew gerber plots. 2012-07-15 20:28:52 +03:00
jean-pierre charras a828d714c6 Pcbnew: more about keepout areas: remove keepout for pads option and add keepout for copper zones option.
Export keepout to Specctra DSN file.
2012-07-14 18:27:25 +02:00
jean-pierre charras e36a3dd460 Pcbnew: Add keepout areas (Copper zones without tracks or/and vias).
This is *a work in progress*, so some features are missing, and/or could be modified.
Mainly keepout zones are not yet exported to autorouters, and pads are not taken in account.
Some code cleanup in polygon.*
2012-07-13 20:55:29 +02:00
jean-pierre charras b60fda3fec Eeschema: fix compatibility issue with wxWidgets 2.8.12 2012-07-12 17:01:14 +02:00
jean-pierre charras 590b237338 Eeschema: fix compatibility issue with wxWidgets 2.8.12 2012-07-12 16:59:06 +02:00
unknown 237592fbda All: Fix Assertion on sheet properties, in debug mode 2012-07-11 10:02:47 +02:00
jean-pierre charras 9a6a301c4f Eeschema: fix wrong bitmap size in hierarchy navigator tree 2012-07-10 14:26:26 +02:00
jean-pierre charras 064c057200 Pcbnew: commit Lorenzo Marcantonio's patch for THT thermals (added loading/saving using S. expr).
Fix incorrect import of smd pads from Gpcb.
Very minor change in dialog print.
2012-07-09 09:10:07 +02:00
Marco Mattila d1077e6171 Add rotation field to pcbnew text item property dialog. 2012-07-09 01:02:00 +03:00
Dick Hollenbeck b90e483117 fix for bug 1022026 2012-07-07 13:27:44 -05:00
Miguel Angel Ajo ad25f4c43a Cleanup toward test-merge 2012-07-06 21:10:55 +02:00
Wayne Stambaugh de22ae4a99 Save and load print parameters and minor code cleaning in new Pcbnew file format. 2012-07-05 13:02:45 -04:00
jean-pierre charras d166463bca Eeschema: bug fix: when creating new connections, junctions were not always automatically added when needed.
Fix an other minor bug.
2012-07-05 13:37:48 +02:00
jean-pierre charras ef326260c2 Pcbnew: fix incorrect detection of arcs having angles != 90 degrees 2012-07-05 11:29:42 +02:00
Marco Mattila a969e87f13 Add copy to text items in pcbnew. Automatically mirror text items added to back silkscreen (bug 1017446). 2012-07-04 22:50:47 +03:00
jean-pierre charras 532fb73c43 Pcbnew, gen Excellon files: fix truncation coordinates in decimal format, units = inches (old bug)
Coordinates were using always 3 digits (1/1000 inch  for mantissa). Uses now 4 digits max in inches and 3 digits max in mm
The resolution is therefore 1/10000 inch or 1/1000 mm. Note this is a limitation of Excellon format.
2012-07-03 15:46:58 +02:00
jean-pierre charras 0c79aa30ab Pcbnew: fix 2 minor issues, noticeable only in debug mode.
When reading board files, the net 0 was stored twice.
It creates only log messges in debug mode, because the list of nets is rebuild after reading files.
2012-06-30 10:20:04 +02:00
Miguel Angel Ajo cd68572df5 code cleanup and comments 2012-06-27 23:19:19 +02:00
jean-pierre charras a37cc75bd7 Pcbnew: save/load .kicad_pcb files: fix 2 minor issues.
Use now English layers names to build filenames in plot functions (for techical layers), because translated names create sometimes problems in filenames.
(should do not change anything for English users)
Fix compil issue under wxGTK 2.8.12, created by my recent commit.
Minor changes to make translations easier.
2012-06-27 22:11:04 +02:00
jean-pierre charras 3b8118ac0b Pcbnew: save/load .kicad_pcb files: fix 2 minor issues.
Use now English layers names to build filenames in plot functions (for techical layers), because translated names create sometimes  problems in filenames.
(should do not change anything for English users)
2012-06-27 22:07:37 +02:00
jean-pierre charras bdf725f86b Pcbnew: fix compil issue under wxGTK 2.8.12 2012-06-26 22:18:01 +02:00
jean-pierre charras c8866b7d4c Pcbnew: minor changes in pcb-parser.cpp and kicad_plugin.cpp to make translations easier.
Code cleaning in autoroute functions.
2012-06-26 19:57:37 +02:00
Jean-Pierre Charras 552b211124 Commit JP's custom page size fix for Pcbnew s-expressions file format with minor changes. Thanks JP. 2012-06-25 19:52:57 -04:00
jean-pierre charras 680fe999b2 All: fix a truncation issue in ReturnValueFromString that creates sometimes a small error for values entered in dialogs.
Pcbnew: fix a compatibility issue with nano version for zones parameters.
2012-06-25 22:59:19 +02:00
Miguel Angel Ajo 1e380374eb merge with lp:kicad 2012-06-25 22:51:19 +02:00
Dick Hollenbeck 25705ad61b use the same format string in the test program as in LEGACY_PLUGIN for record keeping purposes 2012-06-25 09:44:47 -05:00
Dick Hollenbeck 6351d5a283 remove "long double" dependency, mingw was falling over when using it. 2012-06-24 13:41:37 -05:00
Wayne Stambaugh 1666e12db2 Minor Pcbnew s-expression improvements.
* Put text effects on a single line.
* Remove size token when defining drill sizes.
* Don't save net in pad definition when pad has no connection.
2012-06-23 21:19:41 -04:00
Dick Hollenbeck 728cbcdff4 bzr add test program to verify new conversion strategy 2012-06-23 19:44:02 -05:00
Dick Hollenbeck bd047624e5 legacy_plugin was not round tripping nanometers, add test program to verify new conversion strategy 2012-06-23 18:21:03 -05:00
jean-pierre charras 0e8f5b8147 Fix an issue (only found using gcc under mingw) in dsnlexer.cpp, using ::isspace( ) function that accepts only a 7 bit ASCII value under gcc/ mingw. 2012-06-20 22:33:05 +02:00
jean-pierre charras 45d4353cf4 Pcbnew: small cosmetic enhancement: add a bitmap for zone duplicate command. 2012-06-20 11:57:36 +02:00
Moses McKnight c7455ca776 Commit patches from Moses McKnight, to avoid duplicate junctions. 2012-06-20 11:52:29 +02:00
jean-pierre charras 5def0c2eea Pcbnew: fix incorrect arc export in SVG file export.
Very minor other fixes.
2012-06-19 21:25:41 +02:00
Dick Hollenbeck 9e4090f601 DIMENSION::m_Value not being saved in LEGACY_PLUGIN using scaling, DIMENSION::AdjustDimensionDetails() uses arrowz appropriate to build 2012-06-18 23:53:08 -05:00
Dick Hollenbeck d1a8ecca70 a) (zone (fill (mode was wrong, b) put fill on one line 2012-06-18 23:23:42 -05:00
Dick Hollenbeck 69415616f8 parsing problem was unbalanced (smoothing) element 2012-06-18 23:08:00 -05:00
jean-pierre charras 7eec35e4ea Pcbnew: Fix an other compatibility issue in kicad nanometers. 2012-06-17 20:29:11 +02:00
jean-pierre charras f76bf37229 Pcbnew: fix issues in kicad nanometer in zone ediition and detection.
autoroute functions: code cleaning
2012-06-17 18:06:12 +02:00
Wayne Stambaugh 5c335f3acc Pcbnew s-expression file parser bug fixes and file size improvements.
* Use index when saving layers to handle translated layer names.
* Add LOCALE_IO switcher when loading s-expression format.
* Make SEGVIA default to through hole to improve file size.
* Don't save default orientation of 0 degrees in TEXTE_MODULE and TEXTE_PCB.
* Don't save default zone configuration parameters.
* Save multiple zone corners on a single line.
* Fixed missing ( check in graphic and module arc parsers.
* Consistency improvements for DRAWSEGMENT and EDGE_MODULE objects.
* Minor tweaks to D_PAD formatting.
2012-06-16 18:49:24 -04:00
jean-pierre charras 98f91f8b0a Pcbnew: automatic selection of plugin when loading a file with .kicad_pcb extension from history list.
Very minor other fixes
2012-06-14 21:10:32 +02:00
jean-pierre charras 93e568b254 fix incorrect use of KIROUND instead of KiROUND in parseBoardUnits( const char* aExpected ) (see comments in .h file)
very minor fix in pcb_parser.cpp
Fix scaling issue with nanometers in gpcb footprint import.
2012-06-14 08:29:54 +02:00
Andrey Fedorushkov e86579b576 pcbnew: minor fix printf in pcb_parser 2012-06-14 09:34:18 +04:00
Wayne Stambaugh 672ffefb5f Pcbnew s-expression file parser bug fixes.
* Change save order of drawings to match legacy file format object order.
* Set end point of SEGVIA to start point so the round trip back to legacy
  format is the same.
* Fixed bug saving and loading oval pad drill parameters.
* Fixed bug saving and loading rectangular pad deltas.
* Fixed missing layer for PCB_TARGET.
* Fixed EDA_TEXT italic bug.  Thanks Dick!
* Remove some left over debug logging statements.
2012-06-13 19:04:42 -04:00
Andrey Fedorushkov c500a6704e pcbnew: show clearance when move or drag via 2012-06-13 17:32:43 +04:00
jean-pierre charras 3e0c355d7b Pcbnew: fix issue about order of tracks this order was modified when reading and writing a board, even without any change in board.
Fix compil warnings and wx28 compatibility.
code cleaning in autoroute functions.
2012-06-11 14:04:34 +02:00
jean-pierre charras 87da1b2d0c fix compil warnings 2012-06-11 07:40:52 +02:00
Dick Hollenbeck 0d45084914 Commit Dick's Pcbnew s-expression file parser bug fixes.
* Apply Dick's patch along with a few minor changes to fix some clashes with
  changes in my branch.  Thanks Dick!
* Added missing DRAWSEGMENT line angle.
* Fix thru hole pad layer mask issue.
2012-06-10 20:47:15 -04:00
jean-pierre charras 9097433898 Pcbnew: Fix compil issues with wxWidgets 2.8.12
Some code cleaning in autoroute functions.
2012-06-10 18:21:18 +02:00
Dick Hollenbeck 0b704e356f CPolyPt constructors 2012-06-10 04:48:42 -05:00
Dick Hollenbeck d847d5b942 There was no reason for insertBeforeMe on track loading.
Tracks should be loaded in the same order as they were saved, no exceptions.
This is for the version control system user.
But even with this objective now implemented in LEGACY_PLUGIN, the TRACKS
are still going through a food processor after they are loaded, and the poor
version control system user has no relief, even with this patch.

TRACKS are always modified after being loaded, and I think this needs to be fixed still.
2012-06-09 19:39:40 -05:00
Wayne Stambaugh 694c900cd4 Added file include/convert_from_iu.h left out of last commit. 2012-06-09 14:00:30 -04:00
Wayne Stambaugh 9204086f41 Add Pcbnew s-expression file parser.
* Add s-expression file parser object and keyword files.
* Fix minor issues with s-expression file formatting.
* Fix a minor bug the zone container fill state parsing in the legacy plugin.
* Move EDA_TEXT visibility definition to eda_text.h.
* Add minor BOARD_ITEM object improvements to support s-expression file
  parser.
2012-06-09 13:00:13 -04:00
jean-pierre charras d8395dfeb6 Fix some minor bugs in plot functions 2012-06-09 11:38:58 +02:00
jean-pierre charras 39f84d7fe4 Pcbnew: Update incorrect or incomplete copyrights in many files.
Minor code cleaning in autoroute files.
2012-06-08 11:56:42 +02:00
Dick Hollenbeck bbc8c1121f EAGLE_PLUGIN::Load() is now completed. 2012-06-06 21:23:47 -05:00
Dick Hollenbeck 383ffdfe0a EAGLE_PLUGIN::Load() is now completed. 2012-06-06 20:49:43 -05:00
Ryan Bunch 8c89c1daf5 allow comments in library files 2012-06-06 09:12:39 -05:00
jean-pierre charras 706337b8ea Pcbnew: move files relative to autoroute/autoplace to autorouter folder.
fix nanometer compatibility.
minor code and comments cleaning (although theses files need a lot of code cleaning)
2012-06-05 21:09:30 +02:00
jean-pierre charras 9f67477858 Pcbnew: move files relative to autoroute/autoplace to autorouter folder.
fix nanometer compatibility.
minor code and comments cleaning (although theses files need a lot of code cleaning)
2012-06-05 21:07:33 +02:00
Marco Mattila b703d81561 Add missing checks and undo support to pcbnew zone duplication. 2012-06-05 14:44:22 +03:00
Dick Hollenbeck 9e8be6cd28 EAGLE_PLUGIN: read a portion of the design rules and calculate
pad and via sizes from those settings when diameter is not given
in the local object.  Calculation algorithms are inferred from the
UI help of the Eagle program.

For edge connector type of footprints, some copper pads can be on the
back side even within packages.

Flipping of packages to back was not being done correctly, but I think this 
is working now.

There are still remaining issues with text positioning that I am working on.
2012-06-04 23:39:37 -05:00
Marco Mattila 250960f771 Add zone duplication to pcbnew. 2012-06-04 22:04:12 +03:00
Miguel Angel Ajo bbfb0d669c merges tip, conflict resolved 2012-06-03 22:21:53 +02:00
Miguel Angel Ajo ad14802227 merge 1 with tip 2012-06-03 22:06:51 +02:00
jean-pierre charras d5b1087fb8 Appying lajos' patch to boost 1.49 2012-06-03 19:41:49 +02:00
jean-pierre charras 150b7cd4e2 Fix eagle_plugin issue (File not found) under Windows. 2012-06-03 17:47:53 +02:00
jean-pierre charras 20fc8ee3cc Eeschema: Fix incorrect display refresh when editing the reference of a component from the popup menu. 2012-06-03 13:16:08 +02:00
Marco Mattila 47877ec70c Do some ZONE_CONTAINED encapsulation. 2012-06-03 00:19:17 +03:00
Dick Hollenbeck 91e8aca0a9 EAGLE_PLUGIN: finish xpath error reporting mechanism for XML document traversal 2012-06-02 12:07:30 -05:00
jean-pierre charras f809cc2db7 CvPcb: fix focus issue when the display footprint frame is shown (the footprint list loses the focus each time a new footprint is selected, therefore the keyboard cannot be used to select footprints) 2012-06-01 14:03:50 +02:00
Dick Hollenbeck b07caa93c9 EAGLE_PLUGIN: load layer definitions, zone parameters, text positions.
Sketch for BOARD::Move().  Pass page_width and page_height to PLUGIN::Save().
2012-06-01 02:39:32 -05:00
jean-pierre charras a65c42b7d8 Cvpcb: code cleaning and minot fix 2012-05-31 19:41:37 +02:00
Dick Hollenbeck 583006b599 EAGLE_PLUGIN add mechanical "hole" support for both MODULEs and BOARD 2012-05-31 10:18:55 -05:00
jean-pierre charras 29b5837a91 Eeschema, Libedit: Fix bug that can crashes Eeschema: In libedit 2 mandatory fields could be deleted. Fixed now.
Very minor other fixes.
2012-05-31 15:47:02 +02:00
Dick Hollenbeck 26eadad611 EAGLE_PLUGIN now positions text correct for most cases 2012-05-30 16:40:32 -05:00
Marco Mattila 0aafa5a591 Add flip to pcbnew text fields. 2012-05-30 20:38:52 +03:00
Dick Hollenbeck 0a42863bd1 add translation to static file filters, comments 2012-05-30 09:14:42 -05:00
Dick Hollenbeck a1f23f3a4c generalize the BOARD loading process PCB_EDIT_FRAME::LoadOnePcbFile() to use any supported PLUGIN 2012-05-29 16:01:17 -05:00
Marco Mattila badef10f41 Derive pcbnew find dialog from DIALOG_SHIM. 2012-05-29 23:43:17 +03:00
Dick Hollenbeck f1284bd73c Mostly EAGLE_PLUGIN work:
* Derive the pcbnew copper zone and non-copper zone dialog windows from DIAG_SHIM,
  which injects some template code.
* Update UIpolicies.txt to talk about DIALOG_SHIM support.
* Add zone support to eagle_plugin.
* Organize ZONE_CONTAINER class declaration for future privacy and accessors.
2012-05-29 13:10:56 -05:00
jean-pierre charras d2926d2edf Pcbnew: menu Edit/Reset modules fields size: Add dialog to select what modules are modified. 2012-05-29 14:25:10 +02:00
Marco Mattila da45f02f6a Move pcbnew find dialog into dialogs subdirectory and use wxFormBuilder for it. 2012-05-28 23:01:51 +03:00
Lorenzo Marcantonio 67a3a7521f Rename BASE_SCREEN member m_NumberOfScreen to m_NumberOfScreens. 2012-05-26 20:19:12 -04:00
Lorenzo Marcantonio 699f87c617 Remove unused definitions in bitmaps.h. 2012-05-25 11:00:51 -04:00
Andrey Fedorushkov a568ed2bd8 eeschema: fix set bus width when define KICAD_GOST 2012-05-25 18:33:58 +04:00
jean-pierre charras 6b4366a0a4 Pcbnew: fix crash in legacy_plugin.cpp when reading old lib files.
fix a compil warning.
CvPcb: fix regressions :
 Shows now a void field instead of the dummy footprint name $nonane (whenthere is  no footprint selected in netlist).
 The active footprint selection changes only if a new component is selected from the component file,
 and does not change just when the next component is automatically selected, after a footprint selection.
 Speed up delete association and auto associe.
2012-05-25 08:58:52 +02:00
Lorenzo Marcantonio 5aa957bcff Rationalize numeric time stamps to type time_t. 2012-05-24 21:52:04 -04:00
Dick Hollenbeck f22b5abfac more amazing free eagle_plugin work 2012-05-24 10:00:59 -05:00
unknown 8811f5053d Commit patch from Brian Sidebotham (Bus width value option) 2012-05-24 08:51:52 +02:00
Dick Hollenbeck b16571bb86 more eagle plugin work 2012-05-23 20:18:30 -05:00
Andrey Fedorushkov d12cf29322 Pcbnew: fix control data valid in design rules when define USE_PCBNEW_NANOMETRES 2012-05-23 18:25:15 +04:00
jean-pierre charras 7c8c7984a1 Libedit: fix minor bug: Copy doc not working in Properties dialog. 2012-05-23 12:06:33 +02:00
Dick Hollenbeck a35ddcd0e1 more eagle_plugin work 2012-05-22 12:51:18 -05:00
Dick Hollenbeck ddc95bc7f7 fix bug added two revisions ago by me 2012-05-21 13:50:46 -05:00
jean-pierre charras ce99a71a52 Eeschema: Fix a minor issue in block command
Very minor code cleaning
2012-05-20 21:18:06 +02:00
Dick Hollenbeck 9882eef93a eagle plugin first work 2012-05-20 08:14:46 -05:00
jean-pierre charras 140667308d Very minor fixes. 2012-05-19 21:04:03 +02:00
jean-pierre charras f50859fd09 Pcbnew: fix bug Bug #1001107 (Solder Mask Ratio Clearance bad value)
Because this bug could create bad values in footprint libraries, this parameter is now checked
when reading a footprint description in legacy format
2012-05-18 10:33:57 +02:00
jean-pierre charras 86267bd8d6 Fix 2 minor warning compil (unused variables) 2012-05-16 22:44:21 +02:00
jean-pierre charras e5f6738280 Fix compil issues with gcc 4.6 and boost 1.49 2012-05-16 18:59:47 +02:00
Dick Hollenbeck d6acc8debe move boost update script to out of way place, fix bug in it 2012-05-16 07:01:40 -05:00
Miguel Angel Ajo 84c562de1c Footprint wizard, plus fixes 2012-05-16 11:35:18 +02:00
Dick Hollenbeck ddd6bb632a bring in skeleton for eagle_plugin and update boost for use of RapidXML within property_tree 2012-05-15 21:27:27 -05:00
Dick Hollenbeck 85b69b8689 move all hashtable declarations into include/hashtables.h, prepare for boost usage 2012-05-15 21:00:25 -05:00
Dick Hollenbeck b2837d38b8 update to boost 1.49.0 subset 2012-05-15 20:42:04 -05:00
Dick Hollenbeck 06582b4cf9 try to delete a footprint library before exporting or creating, quietly 2012-05-15 08:58:55 -05:00
henner zeller f5d0863b2e commit patch from henner zeller (make EDA_LIST_DIALOG resizable) 2012-05-14 17:23:20 +02:00
jean-pierre charras f05c0cd6ce Libedit: fix Bug #994014.
Pcbnew: fix Pcbnew name capitalization in messages.
About dialog: add a link to kicad-pcb.org
2012-05-13 17:31:58 +02:00
jean-pierre charras 223642904f Remove PCB_INTERNAL_UNIT define because it is no more used in code.
3D viewer: fix incorrect scaling factor when using nanometers.
Very minor other fixes
2012-05-11 11:02:35 +02:00
Miguel Angel Ajo 8317e918d9 wxGrid instead of list, now we do really have values... 2012-05-11 00:30:26 +02:00
Miguel Angel Ajo d497b62fb3 Cosmetic fixes, before moving to wxGrid 2012-05-10 22:49:07 +02:00
jean-pierre charras 014ba087a8 Gerbview: fix incorrect processing of ICI command in Excellon drill files. 2012-05-10 13:02:44 +02:00
Miguel Angel Ajo dfa1f480b5 Footprint wizard UI gets the module from python wizard, and show it 2012-05-10 10:53:05 +02:00
Miguel Angel Ajo 9ce8fcd268 * Read string array results from python methods~ 2012-05-10 08:44:08 +02:00
jean-pierre charras 6bd07d3d63 Fix capitalization issues in title bar and config files (broken by bzr rev 3543) 2012-05-10 08:25:27 +02:00
Miguel Angel Ajo 125d820dac footprint wizard UI and footprint wizard lists 2012-05-10 01:04:08 +02:00
Miguel Angel Ajo f77f7e645b * Footprint wizard UI: Added to module editor.
* Footprint wizard C++ generic classes
* Footprint wizard C++ to python wrappers 
* Automatic plugin loader from ~/.kicad/plugins
* Python plugin architecture: Footprint wizards
2012-05-09 19:37:25 +02:00
Dick Hollenbeck 82bee848a1 Fix some comments. Enhance LEGACY_PLUGIN such that it can tolerate, then fix bad legacy footprint libraries containing duplicate footprint names.
This may have been an undocumented bug from more than a year ago, which manifested itself in *.mod files containing duplicate names.
LEGACY_PLUGIN loads those now quietly, but appends "_v2", "_v3", etc. to each succeeding duplicate sharing the same name.
2012-05-08 19:26:15 -05:00
Dick Hollenbeck 41aa30c93f this helps zooming on some window types 2012-05-08 16:09:18 -05:00
Dick Hollenbeck 594c4102f6 Fix Pcbnew markers in nanometer build with proper scaling factor. Use double in Zoom() 2012-05-07 16:47:25 -05:00
Dick Hollenbeck cf1ae599f1 Make drawframe.cpp's StatusBar use field widths which are dynamically determined
base on expected text and current window font.

Expand the virtual world to 2.14 meters in the nanometer build of PCBNEW.
This seems to be holding up for now.
2012-05-06 18:32:01 -05:00
Dick Hollenbeck 9fbc499361 more nanometer work, see comment at line 66 of pcbnew/classpcb.cpp 2012-05-06 15:10:43 -05:00
jean-pierre charras 3d747571d6 Gerbview: Fix a compil issue in my last commit. 2012-05-06 21:41:53 +02:00
jean-pierre charras 036e02e052 Gerbview: Fix a compil issue in my last commit. 2012-05-06 21:29:52 +02:00
jean-pierre charras d03a9188ae Fix a grid selection issue when starting Eeschema or Gerbview:
Eeschema (also Libedit and Libview) now starts always to the default grid (50 mils)
Gerbview starts with the last selected grid, but the validity is tested.
In Pcbnew the grid value is always displayed, so it should always be good.
2012-05-06 20:04:14 +02:00
jean-pierre charras a07e6e4013 Fix grid selection issue when starting Eeschema or Gerbview:
Eeschema (also Libedit and Libview) starts always to the default grid (50 mils)
Gerbview starts with the last selected grid, but the validity is tested.
In Pcbnew the grid value is always displayed, so it should always be good.
2012-05-06 18:55:51 +02:00
Miguel Angel Ajo ea0562c124 KiCad scripting plugin architecture, footprint wizards first 2012-05-05 22:18:47 +02:00
Dick Hollenbeck 215b6cc634 move import directory to new branch kicad-contrib 2012-05-05 15:06:14 -05:00
Jerry Jacobs jerkejacobs@gmail.com f7460dfa9c Cosmetic UI changes mostly for Mac OS X, see CHANGELOG.txt 2012-05-05 18:03:21 +02:00
Jerry Jacobs jerkejacobs@gmail.com 92a285378a Cosmetic UI changes mostly for Mac OS X, see CHANGELOG.txt 2012-05-05 18:02:09 +02:00
Dick Hollenbeck d033f2235f Remove zip library by switching to wxZlibOutputStream for PDF plotter.
Delete LEGACY_PLUGIN cache after deleting library of same name.
Remove automatically generted freerouter help header.
Add Normalize() to BOX2.
Clamp some values in the virtual space of drawframe.cpp
2012-05-04 23:55:36 -05:00
jean-pierre charras 29016a1fe4 Commit missing files 2012-05-04 20:57:32 +02:00
jean-pierre charras d75596c9b8 Gerbview: remove dependencies from Pcbnew.
Should allow Pcbnew code easier to change and Gerbview code more understandable and easier to maintain.
Code cleaning (remove dead code, add comments).
Minor other enhancements.
2012-05-04 20:16:13 +02:00
jean-pierre charras 8ef3f8ade3 Gerbview: remove dependencies from Pcbnew.
Should allow Pcbnew code easier to change and Gerbview code more understandable and easier to maintain.
Code cleaning (remove dead code, add comments).
Minor other enhancements.
2012-05-04 19:44:42 +02:00
Lorenzo Marcantonio cdce807375 Commit patch from Lorenzo Marcantonio about plot functions enhancement.
Fix some warning compil issues.
Add zlib sources to avoid build issues under Windows (zlib not installed with mingw).
2012-05-03 22:17:34 +02:00
jean-pierre charras 4c9cf84dff Add missing files 2012-05-03 21:08:14 +02:00
jean-pierre charras f878e38d12 Add patch from Lorenzo Marcantonio. Fix some warning issues, and zlib issue under Windows (zlib sources added) 2012-05-03 20:37:56 +02:00
Frank Bennett 24c572b806 This import directory contains tools for importing
to Kicad from other EDA tools.

  edif2kicad        / EDIF to EEschema schematic import
    Tools with EDIF out writer:
       o OrCad
       o DataXpress
       o Viewlogic
       o IntuSoft ICAP
       o Protel nVisage
       o PADS ?
       o P-CAD ?
       o EDIF viewer (www.cimmetry.com)
       o EDIF translator (www.elgris.com/content/edif_overview.html)

  pcb123net2kicad   / converts a pcb123 netlist to Kicad default format
2012-05-02 13:58:54 -06:00
Miguel Angel Ajo abb05eae40 support for footprint library operations 2012-05-01 17:13:36 +02:00
jean-pierre charras 934271b272 Cvpcb: Fix Bug #992429 2012-05-01 12:43:16 +02:00
Miguel Angel Ajo a3366e6c95 merged to testing, fixed some scripting imports 2012-04-30 18:05:22 +02:00
Dick Hollenbeck 8971bf7546 Add tools/parser_gen.cpp which is the beginnings of an s-expression parser
generation tool.  For now, it is just an s-expression beautifier using
our "non-specctra mode" version of s-expressions.
2012-04-29 21:57:48 -05:00
jean-pierre charras 3a673cc06e Remove old function valeur_param(), that does not work in Kicad Nanometer 2012-04-27 16:41:51 +02:00
jean-pierre charras 8bf09f65cf Remove valeur_param(), that does not work in Kicad Nanometer 2012-04-27 16:15:11 +02:00
jean-pierre charras b7f5699b3e Fix some (not all) bad values displayed in NANOMETER mode. 2012-04-27 08:11:41 +02:00
jean-pierre charras 7d01550649 missing change. 2012-04-27 00:04:09 +02:00
jean-pierre charras 05aedc7c57 All: change MILS_TO_IU_SCALING_FACTOR constant to IU_PER_MILS ( and MM_TO_IU_SCALING_FACTOR to IU_PER_MM)
Also fix bug 985654.
2012-04-26 23:35:40 +02:00
jean-pierre charras 9af5367aee All: change MILS_TO_IU_SCALING_FACTOR constant to IU_PER_MILS ( and MM_TO_IU_SCALING_FACTOR to IU_PER_MM)
Also fix bug 985654.
2012-04-26 23:34:20 +02:00
jean-pierre charras 3c1015942d All: change MILS_TO_IU_SCALING_FACTOR constant to MILS_PER_IU ( and MM_TO_IU_SCALING_FACTOR to MM_PER_IU)
Also fix bug 985654.
2012-04-26 22:21:31 +02:00
jean-pierre charras 98329144a0 commit missing files 2012-04-25 21:46:30 +02:00
jean-pierre charras dc990a5309 Define MM_TO_IU_SCALING_FACTOR (scaling factor from mm to internal units) only in convert_to_biu.h
Other scaling factors (MILS_TO_IU_SCALING_FACTOR and DECIMILS_TO_IU_SCALING_FACTOR)
also defined only in convert_to_biu.h.
Allows different scaling value for Gerbview.
Needs more tests.
2012-04-25 21:33:24 +02:00
Dick Hollenbeck c28dc2bb13 I was disappointed when I disassembled the code using the KiROUND() inline function
solution to see that it was not pre-computing constants when used in static initializers.

So we have two use cases, and need two solutions to be optimal, since the compiler 
is too stupid to do the right thing.

I think we need something else for compile time computable constants, to be optimal 
in both use cases.  There is quite a bit of code savings by using a macro for that 
situation from my testing.  To fully capitalize on this, we need to go back and make 
Mm2mils() and what not macros also, or have MACRO versions of them too.
2012-04-25 09:12:25 -05:00
Miguel Angel Ajo c3fa406d60 C++ plugin exceptions correctly handled now 2012-04-24 22:28:23 +02:00
Dick Hollenbeck 3c84312ac5 TODO 2012-04-24 09:23:41 -05:00
Dick Hollenbeck a88656ea5a Somebody else spelled rectangle as badly as me, fix the mingw build 2012-04-23 21:39:56 -05:00
Dick Hollenbeck 86ad0d2c62 * Add DRECT, DPOINT, and DSIZE (double rect, point, and size) using Torsten's vector2d.h
as a starting point
* Make double Distance() take double arguments and remove internal range checking.
* Start on EDA_DRAW_FRAME::AdjustScrollBars() and use "double" for most all calculations
  in anticipation of setting INT_MAX INT_MIN limits eventually.
2012-04-23 16:56:26 -05:00
Miguel Angel Ajo 5512567d74 wxArrayString typemaps, class missing yet 2012-04-23 08:59:37 +02:00
Wayne Stambaugh d14d7f67b3 Pcbnew s-expression file format improvements.
* Move board item object Format() functions into PCB_IO object.
* Change file format to use layer names instead of numbers.
* Change file extension to kicad_pcb.
2012-04-22 11:16:39 -04:00
Miguel Angel Ajo f6b8a150bb merged to last testing, also added automatic file extension detection on save/load 2012-04-22 13:14:58 +02:00
Miguel Angel Ajo ba8ab188d8 Merged to testing, needs some fixes 2012-04-21 22:04:02 +02:00
Miguel Angel Ajo b188f76b65 Exceptions handled on board Load/Save 2012-04-20 23:20:56 +02:00
Dick Hollenbeck 48a745e934 todo 2012-04-19 15:28:54 -05:00
Dick Hollenbeck e1c9cbedd7 missing include 2012-04-19 15:07:36 -05:00
Dick Hollenbeck c53c5b47ea // Dick Hollenbeck's KiROUND R&D
// This provides better project control over rounding to int from double
// than wxRound() did.  This scheme provides better logging in Debug builds
// and it provides for compile time calculation of constants.


#include <stdio.h>
#include <assert.h>
#include <limits.h>

//-----<KiROUND KIT>------------------------------------------------------------

/**
 * KiROUND
 * rounds a floating point number to an int using
 * "round halfway cases away from zero".
 * In Debug build an assert fires if will not fit into an int.
 */

#if defined( DEBUG )

// DEBUG: a macro to capture line and file, then calls this inline

static inline int KiRound( double v, int line, const char* filename )
{
    v = v < 0 ? v - 0.5 : v + 0.5;
    if( v > INT_MAX + 0.5 )
    {
        printf( "%s: in file %s on line %d, val: %.16g too ' > 0 ' for int\n", __FUNCTION__, filename, line, v );
    }
    else if( v < INT_MIN - 0.5 )
    {
        printf( "%s: in file %s on line %d, val: %.16g too ' < 0 ' for int\n", __FUNCTION__, filename, line, v );
    }
    return int( v );
}

#define KiROUND( v )    KiRound( v, __LINE__, __FILE__ )

#else

// RELEASE: a macro so compile can pre-compute constants.

#define KiROUND( v )  int( (v) < 0 ? (v) - 0.5 : (v) + 0.5 )

#endif


//-----</KiROUND KIT>-----------------------------------------------------------

// Only a macro is compile time calculated, an inline function causes a static constructor
// in a situation like this.
// Therefore the Release build is best done with a MACRO not an inline function.
int Computed = KiROUND( 14.3 * 8 );


int main( int argc, char** argv )
{
    for( double d = double(INT_MAX)-1;  d < double(INT_MAX)+8;  d += 2.0 )
    {
        int i = KiROUND( d );

        printf( "t: %d  %.16g\n", i, d );
    }

    return 0;
}
2012-04-19 01:55:45 -05:00
Dick Hollenbeck 487ac04a1b use a block scope to invoke wxFFile's destructor before renaming temporary file 2012-04-18 07:24:40 -05:00
jean-pierre charras c98771f683 Make Gerbview working with USE_PCBNEW_NANOMETRES option ON 2012-04-18 09:07:13 +02:00
Dick Hollenbeck 9f990349ff PLUGIN API Doxygen comments 2012-04-17 09:54:48 -05:00
Dick Hollenbeck 3aed6de76e uncrustify math_for_graphics, add copyright legacy_plugin.h 2012-04-17 09:18:14 -05:00
Dick Hollenbeck 1be7a45f18 touch ups 2012-04-17 01:13:22 -05:00
Dick Hollenbeck 531228f3c0 LEGACY_PLUGIN is now in full use:
*) for footprint access into *.mod files and 
*) BOARD save/load

The item_io.cpp and ioascii.cpp have been set off to the side for reference
as *.notused, for awhile.

The CMake options USE_NEW_PCBNEW_LOAD and USE_NEW_PCBNEW_SAVE are gone,
this is now the mandatory usage of the LEGACY_PLUGIN.  This should reduce
code maintenance for awhile until the s-expression plugin comes into 
play.  But at least for legacy format, there is not two code bodies
to maintain any more.

A new LEGACY_PLUGIN footprint library caching scheme is in place which 
needs some testing.  It should not be any faster, but might give better 
results in a networked environment if there is *.mod files on the server.
2012-04-16 22:12:53 -05:00
Dick Hollenbeck 15a53269d2 cvpcb LEGACY_PLUGIN usage factoring 2012-04-16 21:58:03 -05:00
Dick Hollenbeck 7187639286 more footprint support for LEGACY_PLUGIN 2012-04-16 20:35:43 -05:00
Wayne Stambaugh fd72c74184 Removal of internal units.
* Remove internal units from BASE_SCREEN and it's derivatives.
* Remove internal units from EDA_DRAW_FRAME and it's derivatives.
* Use build time code to replace internal units conversions.
* Fix scaling bug in page layout sample window that I created in my
  last commit.
2012-04-16 19:31:29 -04:00
Wayne Stambaugh 9912fce370 More internal unit improvements.
* Move all convert from user to internal units into base_units.cpp.
* Remove internal units parameters from all moved conversion functions.
* Revise all source code that calls the moved conversion functions.
* Remove internal units from all dialog text control helper classes.
2012-04-16 13:39:32 -04:00
jean-pierre charras 063850bc20 Fix a serious bug in EDA_RECT::Intersects
Kicad manager: code cleaning. Dead code removed and minor fixes. support of new .kicad_brd extension.
2012-04-16 14:56:01 +02:00
Dick Hollenbeck fb8c1ad75b work on footprint plugin API 2012-04-15 22:18:41 -05:00
Wayne Stambaugh 805c6b9711 Pcbnew nanometer internal unit fixes.
* Scale page reference border and title block, grid sizes, and zoom factors
  correctly for nanometers.
2012-04-15 21:25:26 -04:00
lajos kamocsay e3fbd46a79 Commit patch fixing an issue in pan with middle mouse button (from lajos kamocsay)
Other minor fixes.
2012-04-15 12:33:35 +02:00
Miguel Angel Ajo 9fc9ca3265 merged testing branch 2012-04-14 23:18:27 +02:00
Wayne Stambaugh 40aee428b5 More internal unit improvements.
* Move all convert from internal to user units functions into separate file.
* Remove internal units parameter from all moved conversion functions.
* Revise all source code that calls the moved conversion functions.
* Compile these conversion routines separately for the appropriate pcb or
  schematic internal units.
* Move internal units specific status bar update code into the appropriate
  application for updating the status bar.
* Move millimeter user units rounding function to common.cpp.
2012-04-13 14:51:24 -04:00
jean-pierre charras b7fe42a545 Eeschema: BOM list generation: some fixes and enhancements.
drawframe.cpp: commit a fix about scrollbars  from lajos kamocsay
2012-04-13 20:44:02 +02:00
Wayne Stambaugh 5cbd311e80 Internal unit improvements and Pcbnew s-expression file format changes.
* Move EDA_TEXT object into separate header and source file.
* Compile EDA_TEXT class separately for BOARD_ITEM and SCH_ITEM units.
* Compile PAGE_INFO  class separately for BOARD_ITEM and SCH_ITEM units.
* Minor formatting tweaks to Pcbnew s-expression file.
* Move internal unit formatting functions into BOARD_ITEM and SCH_ITEM.
2012-04-12 17:31:31 -04:00
lajos kamocsay 4f74bf88f1 Fix small issue when panning with middle button. 2012-04-12 09:58:12 +02:00
Dick Hollenbeck 4df999cbe2 fix comment 2012-04-11 18:51:16 -05:00
Dick Hollenbeck 039fe4bddf * Coding standards, private functions are lowercase.
* Fix bug in PCBNEW dialog_pad_properties.cpp that I introduced several days ago.
  The m_Master_Pad stuff is stored in the PCB_EDIT_FRAME's BOARD_DESIGN_SETTINGS,
  not in the FOOTPRINT_EDIT_FRAME's BOARD_DESIGN_SETTINGS (i.e. not stored in 
  the module editor's dummy BOARD).  Now we properly initialize the
  DIALOG_PAD_PROPERTIES::m_Pad_Master reference to the correct master pad
  dope, instead of to the dummy module BOARD's master pad, which is not used.
2012-04-11 18:30:06 -05:00
jean-pierre charras 833bbc5b88 Eeschema: fix a bug in my previous commit. 2012-04-11 23:01:20 +02:00
jean-pierre charras c0dfc5bb89 All: new middle mouse pan feature, from lajos kamocsay (and jp charras for some enhancements).
If enable in preference menu, allow the pan with drag mouse with middle button down.
both unlimited and limited pan is allowed.
2012-04-11 20:54:20 +02:00
Dick Hollenbeck b1866205ed handle negative constants 2012-04-11 10:50:17 -05:00
lajos kamocsay 50067840c7 This is some boost weirdness. 2012-04-11 09:55:40 -05:00
Dick Hollenbeck aa6c9e7f21 improve comments in specctra stuff 2012-04-11 09:49:11 -05:00
jean-pierre charras cf4991979d Pcbnew nanometer: fix hatch lines issue in polyline.cpp
Some minor code cleaning.
2012-04-11 11:47:57 +02:00
Dick Hollenbeck 09cfdfd756 add PCNBEW nanometer support to specctra round-tripper, use micro-meters to do it. 2012-04-10 11:28:26 -05:00
Dick Hollenbeck 72970d8c7d remove #include <auto_ptr.h> 2012-04-09 08:56:30 -05:00
jean-pierre charras c3d320aa8c Move AddMenuItem inline functions outside wxstruct.h in a new file (menu_helpers.h)
Enhancements in AddMenuItem (that accepts now a menu type)
Partial use of the Edwin van den Oetelaar's patch (patch not fully working or correct)
2012-04-09 11:16:47 +02:00
Miguel Angel Ajo 3fcbc847a9 lajos kamocsay compilation patches 2012-04-09 08:53:24 +02:00
Miguel Angel Ajo 151fc3065b detect building status of the swig .py file (on parallel make builds). Fix unit conversion returns (From_xxx) to integer, what's all the wxPoint/wxRect/wx.. expect. Extended createPcb.py example 2012-04-09 08:19:57 +02:00
Alexander Zakamaldin 7eeb8a2c0c This bug is not evident for the first glance because most PS viewers fix this issue and print well.
But when using raw printing (for linux - 'lpr some_file.ps') the bug gets out.

Alexander.
2012-04-08 18:37:26 -05:00
Dick Hollenbeck 93437e3539 Add DMils2iu() for scaling deci-mils to internal units.
Instrument saveNETCLASS() with fmtBIU().
Can now round trip to mm board file using LEGACY_PLUGIN in DEBUG build.
2012-04-08 18:32:32 -05:00
Dick Hollenbeck ae81396710 *) Change LEGACY_PLUGIN to respect saving and loading of UNDEFINED_DRILL_DIAMETER.
*) Allow building without defining 
        USE_NEW_PCBNEW_LOAD & USE_NEW_PCBNEW_SAVE.
	pcbnew/files.cpp would not link.
2012-04-08 14:01:54 -05:00
Miguel Angel Ajo 7a61b1f4b9 missing script 2012-04-08 17:00:15 +02:00
Miguel Angel Ajo 6fd2e6ced0 Fix units.i and add some extra wrappers wxSizeMM, wxSizeMils wxRectMM wxRectMils 2012-04-08 16:59:12 +02:00
Miguel Angel Ajo f3ddaf5dce Fixed wxSize bug, wxPoint(double,double) support, units. Fixed GetBoard wasn't accessible at every build. Extended example for board creation (now adds pads). Also fixed the _pcbnew loading from pcbnew which should only go to the internal _pcbnew and not the _pcbnew.so/dso. Right installation path for _pcbnew.so (in linux only) 2012-04-08 16:25:49 +02:00
Wayne Stambaugh 961b408f10 Pcbnew s-expression file format changes.
* Save dialog now supports saving boards to new file format.
* Add CMake option to build s-expression file save.
* Add check to main CMakeList.txt file to make sure nanometers are
  enables when the new file format is built.
* Minor tweaks to object format functions for improved output.
* Rename kicad_plugin.h/cpp to legacy_plugin.h/cpp.
2012-04-07 14:05:56 -04:00
jean-pierre charras 18c5a9aef4 remove old xpm icons, no more used. 2012-04-07 16:34:56 +02:00
jean-pierre charras 880844d178 Remove old xpm icons files 2012-04-07 13:09:57 +02:00
Miguel Angel Ajo f55cf6f90d TODO.txt updated 2012-04-06 22:42:39 +02:00
Miguel Angel Ajo ea90b73781 Add method for MODULE in python that takes care of memory handling 2012-04-06 22:38:32 +02:00
Miguel Angel Ajo e81576b74e example for pcb creation in scripting 2012-04-06 21:48:00 +02:00
Miguel Angel Ajo 4de3380ca5 BOARD::Add now it's wrapped in python and clears the .thisown flag on python to avoid GC from deleting the object later (BOARD will do) 2012-04-06 21:46:45 +02:00
Dick Hollenbeck 7f2ecfe721 USE_NEW_PCBNEW_LOAD and USE_NEW_PCBNEW_SAVE are enabled by default.
This uses the new LEGACY_PLUGIN, so we can force more usage & testing of it
before ioascii.cpp and item_io.cpp are deleted, along with 
BOARD_ITEM::Save() and BOARD_ITEM::ReadDescr() associated functions.
2012-04-06 14:31:28 -05:00
Miguel Angel Ajo 62c00ba871 Compilation cleanup, TODO.txt update about library creation 2012-04-06 20:13:03 +02:00
jean-pierre charras d55c34f662 Pcbnew: fix Bug #975014 2012-04-06 20:03:16 +02:00
Miguel Angel Ajo 76821902c8 Added wxRect and wxSize wrappers to wx.i 2012-04-05 23:41:45 +02:00
jean-pierre charras 504fd3e282 Finish Pcb Calculator work 2012-04-05 20:56:06 +02:00
Dick Hollenbeck 86da74e0bc todo 2012-04-05 13:29:42 -05:00
Dick Hollenbeck 484bbcbfba Remove g_PcbPlotOptions, use wxformbuilder to subclass DIALOG_SHIM on several dialogs 2012-04-05 13:27:56 -05:00
Andrey Fedorushkov 500e3b9d85 pcb_calc: fix build in linux distrib Mageia1 with wxgtk2.8-2.8.11-4.mga1 2012-04-04 21:08:16 +04:00
jean-pierre charras b299c85f98 pcb_calculator: fixes and enhancements (not finished) 2012-04-03 20:26:05 +02:00
jean-pierre charras 6a39f5bd1c pcb_calculator: enhancement in Regulators page dialog:
* support for 3 terminal regulators
* add a data file management to store parameters for regulators ( name, vref value, Iadj value, type)
Needs some refinements, but it is already very useable.

 Commit dialog page setting patch from Alexander Zakamaldin
2012-04-02 20:11:00 +02:00
Wayne Stambaugh 2cecd66a50 Initial Pcbnew s-expression file format commit.
* Add s-expression Format() function to all objects derived from
  BOARD_ITEM.
* Add s-expression Format() function to base objects as required.
* Add functions to convert coordinates from base internal units
  (nanometers) to millimeter string for writing to s-expression
  file.
* Add temporary dummy conversion functions to prevent link errors
  until schematic and board object and action code can be separated
  into DSO/DLL.
* Add CMake build option to build Pcbnew with nanometer internal
  units.
2012-04-01 16:51:56 -04:00
Alexander Zakamaldin ca15df807c fix minor issue a page layout in GOST mode 2012-03-29 08:47:29 +04:00
jean-pierre charras ce4d8d902d Libedit, dialog edit pin: fix wxDialogs tabbing order 2012-03-28 18:53:02 +02:00
jean-pierre charras 0f83413a8f Fix issues about translations:
Eeschema: one string with a bad char (\a, not useable in internationalized strings).
Dialog_page_settings: use not translated strings in code, so strings can be freely translated for the UI.
(Initial code was not working with existing translations)
Update 2 icons.
2012-03-27 18:41:13 +02:00
Wayne Stambaugh 12a5a2da41 Minor code improvements and coding policy fixes.
* BLOCK_SELECTOR class is not longer derived from EDA_ITEM.
* Encapsulate BLOCK_SELECTOR class member variables and add access methods.
* Move HandleBlockBegin() function from block_commande.cpp to drawframe.cpp.
* Remove virtual methods from top level derived objects per future
  coding policy change.
* Remove Doxygen copydoc statement from objects derived from EDA_ITEM
  since the comments are automatically copied to the derived object.
* Removed copy and pasted Doxygen comments from objects derived from
  EDA_ITEM.
2012-03-26 19:47:08 -04:00
Alexander Zakamaldin 15f53f6d97 Alexander's patches, with refinements from Dick 2012-03-26 16:52:53 -05:00
Alexander Zakamaldin 40d78f97e6 Alexander's patches, with refinements 2012-03-26 16:45:05 -05:00
Fabrizio Tappero cbe9446e50 Update icons 2012-03-24 16:38:55 +01:00
jean-pierre charras 890e7beb26 class EDA_RECT: is no more derived from EDA_ITEM, just from EDA_RECT (reason: does not use anything in EDA_ITEM)
issue in cast to wxRect fixed (EDA_RECT accepts negative size, but not wxRect, so the wxRectcast  is normalized now).
This fixes some bugs.
A minor other bug fix in Pcbnew.
2012-03-24 15:25:30 +01:00
Dick Hollenbeck 72926fd4ee Backout my usage of DIALOG_EXTEND_WITH_SHIM in favor of wxFormbuilder's
subclass DIALOG_SHIM support.
Tried dialog_drc but it has nesting problems due to use of DRCLISTBOX, which
needs to be put into its own header file to untangle.
2012-03-22 13:36:20 -05:00
Dick Hollenbeck 0d62f4706a Add include/dialog_shim.h and common/dialog_shim.cpp for use by wxformbuilder's "subclass a wxDialog" support.
This works, but in my version of wxformbuilder there is a bug which does not properly show the 
subclass property, even though it is still in play.  This happens after saving then loading the *.fbp file.
So it is a nuisance bug, but does not affect functionality.
2012-03-22 02:02:49 -05:00
jean-pierre charras da20193852 Pcbnew: Allows an offset for SMD type (and CONNECTOR type) pads. 2012-03-20 21:22:38 +01:00
Andrey Fedorushkov cdc07b5d4e eeschema: add forgotten major fix in bzr3471 2012-03-20 19:19:07 +04:00
Andrey Fedorushkov df0d018b40 eeschema: fix sorting parts generate BOM "Single part per line" 2012-03-20 18:41:57 +04:00
jean-pierre charras d02e5ecdc5 Update some icons with new icons from Fabrizio Tappero.
Remove 2 duplicate icons.
Minor cosmetic enhancements and fixes in popup menus.
2012-03-20 15:17:58 +01:00
Miguel Angel Ajo 7ee96336d7 Fixed Board.Save, listPcb.py +x and updated TODO.txt 2012-03-20 07:34:23 +01:00
Dick Hollenbeck 89ce14bfee start toying with DIALOG_SHIM 2012-03-19 15:57:19 -05:00
Dick Hollenbeck b5b6e9997d quiet warnings, add Clamp() 2012-03-19 11:29:24 -05:00
Miguel Angel Ajo 9ea12cf091 fixed DEBUG build dependency... 2012-03-19 16:39:50 +01:00
Miguel Angel Ajo 5d6ca51ea8 * cleanups: board.i board_item.i separated from pcbnew.i
* dlist.i empty list fixed (Segfault)
* units.i: FromMM FromMils ToMM ToMils
* added a little example (listPcb.py) that shows most items in a board
2012-03-19 12:21:29 +01:00
Miguel Angel Ajo 2d0a80bcbb std::vector and std::string items
DLIST iterator code, now we can do:

    for module in pcb.m_Modules:
    	print module.GetReference()

instead of:

    module = pcb.m_Modules

    while module:
	print module.GetReference()
	module = module.Next()

or even:
    module_list = list(pcb.m_Modules)
2012-03-19 09:36:38 +01:00
jean-pierre charras a2eea79ea8 Eeschema: fix a bug in bool SCH_LINE::MergeOverlap( SCH_LINE* aLine ): ends point of resulting segment incorrects.
remove unused icon files.
2012-03-19 08:48:29 +01:00
Miguel Angel Ajo fe52062f04 fixed ident tabs 2012-03-19 08:40:43 +01:00
Miguel Angel Ajo 6c4f5c78d0 Cast() method to cast down classes from BOARD_ITEM to all childs 2012-03-18 22:35:51 +01:00
Miguel Angel Ajo d7a65ae09f Fixed some indent, and added some conditional compiles on pcbnew.cpp 2012-03-18 10:09:51 +01:00
Miguel Angel Ajo e97a630235 * More cleanup (common wrappers moved to scripting, instead of pcbnew/scripting)
* Added a first test 'testLoadSave.py'
2012-03-17 18:30:03 +01:00
Miguel Angel Ajo f66f15ce90 pcbnew_scripting_helpers.cpp/h to handle generic scripting tools
CMakeLists.txt options to build scripting or scripting modules
2012-03-17 16:17:13 +01:00
Wayne Stambaugh 7b6b9a6e22 Minor code and Doxygen comment improvements.
* Remove double Clone() function calls from all classes derived from
  EDA_ITEM.
* Lots of Doxygen comment warning fixes.
2012-03-17 10:39:27 -04:00
Joe Ferner 4d471306f4 Joe Ferner's merge 2012-03-16 22:01:53 -05:00
Dick Hollenbeck e3dbc609d1 cleanups 2012-03-16 21:11:44 -05:00
jean-pierre charras 67bb18921b Eeschema: fix bug Bug #956818 2012-03-16 20:08:57 +01:00
Joe Ferner 83c75f9291 Added a toolbar button to cvpcb to filter by pin/pad count. 2012-03-15 14:20:22 -04:00
Wayne Stambaugh fce606ed94 Hit test method rationalization and other minor improvements.
* All objects derived from EDA_ITEM now have consistent hit test method
  definitions.
* Remove double function calls from all classes derived from SCH_ITEM.
* Lots of Doxygen comment fixes.
2012-03-15 10:31:16 -04:00
jean-pierre charras 24a9663db4 Update compiling.txt doc. 2012-03-15 09:56:55 +01:00
Andrey Fedorushkov b7dba5f72b all: add display distance to local coordinates in status bar 2012-03-13 13:33:39 +04:00
Dick Hollenbeck 60d245e968 todo 2012-03-12 10:18:32 -05:00
jean-pierre charras 689324ad24 Eeschema: minor fixes:
* make 2 bitmaps more visible.
* fix incorrect screen redraw when rotating a component.
* netlist : the pcbnew advanced format can be now stored (persistant option) in project config.
2012-03-12 11:04:40 +01:00
Dick Hollenbeck 5a2d655c4a * Add PCB_EDIT_FRAME::syncLayerVisibilities(), PCB_LAYER_MANAGER::SyncLayerVisibilities().
* Save all visibilities, layer and render, in BOARD and restore on load.
2012-03-11 19:40:48 -05:00
Miguel Angel Ajo a6b258c953 build _pcbnew DSO/DLL 2012-03-11 20:48:43 +01:00
Miguel Angel Ajo 765df72a6e code cleanup, io_mgr and kicad_plugin included when enabled in cmake... 2012-03-11 20:07:10 +01:00
Miguel Angel Ajo 2b5b1b2a40 wxString, wxPoint and wxChar wrappers 2012-03-10 22:40:41 +01:00
jean-pierre charras 55b3776f42 Pcbnew: Fix Bug #951414 (Windows specific)
Ckecks more pad parameters in pad editor dialog (previously not tested, so a pad could have some very incorrect parameters)
2012-03-10 14:00:31 +01:00
jean-pierre charras f36217fb92 Pcbnew: regression fix when using the new netlist format:
* when a footprint has  many pads having the same pad name, only the first pad was connected to the net
2012-03-10 08:58:21 +01:00
jean-pierre charras 6881dae3bc Dialog exit: better icon.
Pcbnew:
 * graphic_item_properties_base.fbp * dialog pad edit: make some strings more easier to translate.
 * global pad edition: fix a bug that change pad position instead of pad size (round pas only).
Eeschema:
 * fix a bug: new created wires were not alwaes shows until the screen was redrawn.
2012-03-09 19:58:58 +01:00
Marco Mattila 02c7630bbb Fix compilation issue with KicadSVGFileDC. 2012-03-08 22:47:09 +02:00
Marco Mattila d80207d69e Add more pad local copper zone settings in pcbnew. Tune the pad properties dialog a little. 2012-03-08 22:44:03 +02:00
jean-pierre charras 09a999c8a1 All: added a standard exit dialog called by int DisplayExitDialog( wxWindow* aParent, const wxString& aMessage )
Called when closing pcbnew, cvpcb and eeschema.
Minor code cleaning: remove duplicate or not used strings (mainly file extensions and wildcards)
2012-03-08 18:47:23 +01:00
jean-pierre charras e3dd66ddb4 All: try to fix incorrect acs in plot SVG under wxWidgets 2.9:
wxWidgets 2.9 knows wxSVGFILEDC device context.
Unfortunately, arcs are drawn as pies (this is a feature, not a bug).
This is not correct for Kicad.
So Kicad has its own wxSVGFILEDC (named KicadSVGFileDC) that is basically the same as wxSVGFILEDC,
but with arcs drawn as arcs, not pies.
Note also under wxWidgets 2.8 does not know wxSVGFILEDC , so kicad had already its own SVG device context.
2012-03-07 21:18:00 +01:00
Dick Hollenbeck f36ffece70 remove clamping from PAGE_INFO setters 2012-03-06 14:10:12 -06:00
jean-pierre charras d6d74ef77f Libedit: fix bug (svg export does not work)
other minor fixes.
2012-03-06 15:08:59 +01:00
Miguel Angel Ajo 279c944628 wxPoint + more lists 2012-03-05 23:49:49 +01:00
Alexander Zakamaldin ff624c35e3 Problem with the Help link "getting started in kicad" 2012-03-01 09:53:34 -06:00
Miguel Angel Ajo a6deca4da8 Added a starting scripting dialog for tests 2012-03-01 08:21:53 +01:00
Dick Hollenbeck 14d5685528 Load BOARD project settings before loading BOARD in case BOARD has
any configuration overrides.

Call SetDesignSettings() in PCB_BASE_FRAME::ReadSetup().
2012-02-29 09:25:38 -06:00
Miguel Angel Ajo cb13201fd5 SWIG+Python initial scripting support added.
It does nothing but loading and initializing right now.
2012-02-28 22:30:46 +01:00
jean-pierre charras e56b50474a Pcbnew: Hight contrast mode: commit last patch from Miguel Angel Ajo Pelayo, which also fixes an old bug.
All: prepare better compatibility with wxWidgets 2.9.4. Works fine with 2.8.x (I hope...)
2012-02-28 21:14:17 +01:00
Wayne Stambaugh 83b94092b6 Minor Eeschema LIB_ITEM object improvements. 2012-02-27 18:02:08 -05:00
Wayne Stambaugh fe8318d336 Fixes wxSingleChoiceDialog ambiguous constructor compile bug using wxWidgets 2.9.4 or greater. 2012-02-26 14:57:48 -05:00
jean-pierre charras 898c009f50 ModEdit (and ModView): make "invisible" texts visible. They are not visible in the board editor, but must be visible in the footprint editor.
Minor doc update.
2012-02-26 19:49:00 +01:00
Wayne Stambaugh b8bdc638bf Eeschema object list and other minor improvements.
* Convert Eeschema from manually linked list to DLIST for storing
  SCH_ITEM objects.
* Add helper functions to SCH_SCREEN for appending list of SCH_ITEM
  objects.
* Fix bug in wire editing code for accurate undo/redo behavior.
* Add member to DLIST to append another DLIST.
* Other minor code cleaning.
2012-02-26 13:39:39 -05:00
jean-pierre charras 3537b47ba8 Pcbnew: better icon for zone unfill. Minor code cleaning in 3D viewer 2012-02-25 20:55:40 +01:00
jean-pierre charras 9bde5a6482 Pcbnew: fix compil issue. 2012-02-25 08:55:14 +01:00
Marco Mattila f8b7583de5 Add module and pad local parameters for pad-zone connections (thermal, solid etc.) in pcbnew. 2012-02-25 01:23:46 +02:00
Simon Schubert d484fbd93c Pcbnew: fix bad arcs in plot postscript (from Simon Schubert) 2012-02-24 18:17:03 +01:00
Marco Mattila 214e5cc6e3 Fix wxUniCharRef casting issue in eeschema single part per line BOM generation code (?). 2012-02-24 17:00:56 +02:00
Marco Mattila a6c123d4e4 Add correct value sorting (1u < 1n) to bom exports. 2012-02-24 01:57:29 +02:00
jean-pierre charras 363a438fc6 Pcbnew: zone filling: fix broken thermal relief shape for oval pads. mainly noticeable for oval pads having very different X and Y sizes. 2012-02-23 15:59:57 +01:00
Marco Mattila 2c4975c5b5 Fix compiler warnings introduced in 3430. 2012-02-23 14:54:54 +02:00
Marco Mattila f8d96846d5 Fix eeschema component drawing issue during copy. Add hotkey for block save. 2012-02-23 01:35:26 +02:00
Dick Hollenbeck a57fd395fe Uncrustify 0.59 has some new options, it is still actively supported, now under GIT. 2012-02-22 16:00:55 -06:00
Marco Mattila 9feea24516 Make single part per line BOM generation compare all component fields. 2012-02-22 23:37:34 +02:00
jean-pierre charras 41f2b5ec8d Eeschema: Add better dialog to edit an existing field of the current edited component. 2012-02-22 15:04:48 +01:00
jean-pierre charras a8e9046c6c Libedit: Add better dialog to edit an existing field of the current edited component. 2012-02-21 18:47:30 +01:00
Dick Hollenbeck 67b1db7123 remove unneeded debug printf 2012-02-21 09:58:24 -06:00
Dick Hollenbeck 2a59f5ce00 fix infinite loop while generating drill file, bug introduced in 3419 2012-02-21 09:51:11 -06:00
jean-pierre charras 14cf2d9532 Fix 2 minor bugs:
* Pcbnew: in hight contrast mode the 'V' hotkey did not always refresh the screen.
* Eeschema: incorrect print scale when the option 'Show page limits' is disable.
2012-02-20 19:46:56 +01:00
Dick Hollenbeck c10d526385 update TODO.txt with personal items 2012-02-20 09:21:42 -06:00
Dick Hollenbeck 32efce9f86 Miguel's changes 2012-02-20 08:43:49 -06:00
Dick Hollenbeck 533d885923 * Remove virtual BOARD_ITEM::{Get,Set}Position() which in turn means all
derived classes' implementations of these functions become non virtual and
    can be truly _inlined_ for speed!  All GetPosition() in derived classes were also
    changed to return const wxPoint&, that is, a reference rather than a
    full copy of the position wxPoint. There was no need for polymorphism in
    {Get,Set}Position() since we never call these functions via generic pointer.
  * Remove BOARD::{Get,Set}Position() since they were only there to satisfy
    the pure virtuals established in BOARD_ITEM, which are now gone.
  * Added const wxPoint& CPolyLine::GetPos(), made CPolyLine::Get{X,Y}() inline.
  * Derive CPolyPt from wxPoint so we can return "const wxPoint&" fromt
    CPolyLine::GetPos().
2012-02-19 22:48:25 -06:00
Dick Hollenbeck 9903dd5ad9 see CHANGELOG.txt 2012-02-19 22:33:54 -06:00
jean-pierre charras ad5a85ed51 Fix @JP messages (no bugs, just comment lines)
Eeschema: Viewlib is now accessible from Libedit (to browse libs or load a component to edit)
Libedit: uses now the same dialog as the schematic editor to load a component
Some code cleaning.
2012-02-19 20:53:11 +01:00
Marco Mattila f25e5a1012 Use wxStandardPaths to find out the path to binaries in linux. 2012-02-19 21:13:53 +02:00
Miguel Angel Ajo acb7148ac4 Added hotkey for high contrast mode as 'H' 2012-02-19 18:33:06 +01:00
Dick Hollenbeck 585c87a8c6 * remove global g_Pad_Master global and put it into BOARD_DESIGN_SETTINGS
which is in turn already within BOARD.
  * encapsulate class D_PAD with accessors, making data private.
  * make D_PAD::GetBoundingRadius() do its longer calculation lazily, based on
    m_boundingRadius == -1.
2012-02-18 22:10:49 -06:00
Dick Hollenbeck 9d651f85f1 see CHANGELOG.txt 2012-02-18 22:02:19 -06:00
jean-pierre charras ddef0a729d Layers manager: add in popup menu option to hide all coppers layers but active layer.
Design rules: increase number of vias and tracks sizes
Pcbnew: netlist reader: change from my recent commits to keep netnames in pads for footprints not in netlist
(allow an user to place some footprints by hand, set pads netnames and do not lost these netnames when loading a netlsit)
Fix other very minor issues.
2012-02-17 20:43:43 +01:00
jean-pierre charras 7a0b449ac3 Kicad project manager: add .cmp, .drl .pos and .rpt files management.
Code cleaning and other minor fixes.
2012-02-16 21:03:33 +01:00
Dick Hollenbeck f8bcc9966d wxWidgets Debug builds apparently have some tricky technique to validate
the match between wxString::Format() or wxString::Printf() format strings
with passed arguments, but does this at runtime, not compile time.
Fix some mismatches.  size_t is a 64 bit type on x86_64 whereas int and
unsigned are 32 bit types.  On 32 bit machines they are all 32 bits so
this error is probably not triggered.
2012-02-16 00:17:01 -06:00
jean-pierre charras f300ddcada Cvpcb: fix compil error. 2012-02-15 17:28:33 +01:00
jean-pierre charras c28013930e Pcbnew: fix Bug #932509 2012-02-15 14:10:52 +01:00
jean-pierre charras 45b820abe2 Pcbnew: footprint placement file creation:
* Added a dialog to select options: one or 2 files, units (mm or inch), and force INSERT option.
 * code cleaning
 * Modify corresponding  icon in menu to show a footprint, not a schematic component.
2012-02-15 11:41:16 +01:00
jean-pierre charras 034177f0c0 Icons for modedit and modview: remove unused or duplicate icons files and rename files. Tweak some icons. 2012-02-13 15:27:34 +01:00
jean-pierre charras 5edbac54d3 Modedit: add dialog to edit footprint body items. Fix also minor issues about footprint body items edition. 2012-02-12 20:39:37 +01:00
Fabio Varesano 09bf5ca5a0 there was a 0 more in the scale factor for
the millimeters. The attacched patch fixes this and also the comments 
on the generated file to have "Unit = mm" instead of Inches.
2012-02-11 12:54:36 -06:00
jean-pierre charras 814f9ebc5b CvPcb: serious code cleaning. More comments. Remove useless files and some files renamed with a better name. 2012-02-11 10:04:26 +01:00
Dick Hollenbeck 6680975105 fix some warnings in Debug mode under wx 2.9.x 2012-02-10 16:26:42 -06:00
jean-pierre charras dfdbcd8325 Modview: fix minor issues. 2012-02-10 16:31:11 +01:00
jean-pierre charras 2820371a00 Pcbnew - ModView: add 3D view, and fix issues. 2012-02-10 09:49:43 +01:00
jean-pierre charras 5f1d1869e3 Pcbnew: Added: modview. This footprint viewer frame which has the same purpose as Viewlib in Eeschema.
this viewer is built using the new  FOOTPRINT_VIEWER_FRAME class.
2012-02-09 21:33:38 +01:00
Dick Hollenbeck a60a4405c8 fix portion of bug 928330 mentioned in comment #2 2012-02-09 09:00:37 -06:00
Dick Hollenbeck 24d596ee53 fix bug 921553 2012-02-08 09:06:06 -06:00
Dick Hollenbeck 0c37fcebe8 fix 2012-02-07 11:36:24 -06:00
Dick Hollenbeck 1ca7408701 typos 2012-02-06 09:31:36 -06:00
jean-pierre charras eceaf3bfb4 Pcbnew: fix Bug #927293. fix compil issue with wxWidgets 2.9.3 2012-02-06 10:10:32 +01:00
Dick Hollenbeck 68f8d44e0d * move globals into BOARD:
bool g_Zone_45_Only, is now in BOARD::m_zoneSettings.m_Zone_45_Only
    ZONE_SETTINGS g_Zone_Default_Setting is now in BOARD::m_zoneSettings
  * Changed classs ZONE_SETTING to class ZONE_SETTINGS.
  * Changed ZONE_SETTINGS::Import() to operator << ( ZONE_CONTAINER )
  * Added BOARD::{Get,Set}ZoneSettings().
  * Added PCB_BASE_FRAME::{Get,Set}ZoneSettings().
  * Save/load BOARD::m_zoneSettings.m_Zone_45_Only to/from BOARD file.
  * Removed PCB_EDIT_FRAME::InstallDialogNonCopperZonesEditor() in favor of
    ::InvokeNonCopperZonesEditor() declared in zones.h
  * Added ::InvokeCopperZonesEditor() declared in zones.h
  * Removed dialog_copper_zones.h since DIALOG class is now declared in *.cpp.
  * Renamed to enum ZONE_EDIT_T in zones.h
  * SetVisibleAlls() is not called as it was in two previous cases for several
    reasons.  BOARD_DESIGN_SETTINGS constructor controls what is visible initially.
    and in the near future so will the *.brd file.  I believe the user should
    have visibility setting rentention accross editing sessions of zones,
    fields, etc.
  * BOARD_DESIGN_SETTINGS constructor initializes hidden text as not visible.
  * Added PCB_EDIT_FRAME::SyncRenderStates() and PCB_LAYER_WIDGET::syncRenderStates()
    so the checkboxes can be set after loading a BOARD file containing previous
    visibility settings.
2012-02-06 01:16:47 -06:00
Dick Hollenbeck ab5f27c5af merge 2012-02-06 01:14:51 -06:00
Dick Hollenbeck f7d074d64c see CHANGELOG.txt 2012-02-05 23:44:19 -06:00
jean-pierre charras 6ad9366be0 Undo redo change and code cleanup. 2012-02-05 14:02:46 +01:00
jean-pierre charras 32cea2e656 Pcbnew: Fix incorrect behavior of undo/redo command (this issue happens only when a new track is created, and an old redundant track is deleted)
Minor code cleaning
2012-02-04 21:30:00 +01:00
Dick Hollenbeck 17cf16dd19 get rid of some globals, share BOARD_DESIGN_SETTINGS from PCB_EDIT_FRAME with FOOTPRINT_EDIT_FRAME 2012-02-02 11:45:37 -06:00
Dick Hollenbeck f533541b67 CHANGELOG.txt 2012-02-02 01:33:53 -06:00
Dick Hollenbeck f4ccffc754 Remove:
-wxSize         g_ModuleTextSize;      /* Default footprint texts size */
  -int            g_ModuleSegmentWidth;
  -int            g_ModuleTextWidth;

and add similarly named variables to BOARD_DESIGN_SETTINGS, which are 
in a BOARD.
2012-02-02 01:25:21 -06:00
Dick Hollenbeck 6a51e74319 put module text configuration variables into the BOARD 2012-02-02 01:23:00 -06:00
jean-pierre charras eb99d460a3 commint forgotten file 2012-02-01 21:17:43 +01:00
jean-pierre charras 25a92406ce Pcbnew and Cvpcb: more about new netlist support: see CHANGELOG (important changes).
Also commit updated icnos from Fabrizio.
2012-02-01 20:49:37 +01:00
Andrey Fedorushkov e2f76ff8e3 revert my bug commit 3389 2012-02-01 15:53:32 +04:00
Andrey Fedorushkov a7cfb276a6 fix bug plot arc to dxf-format in back_silkscreen, comment and draw layers 2012-02-01 15:42:18 +04:00
Andrey Fedorushkov a26ea8134c fix DXF plot arc 2012-02-01 13:36:43 +04:00
Dick Hollenbeck 892cf8be29 document KICAD_T enum better, remove PCB_ZONE_EDGE_T usages 2012-01-30 15:21:40 -06:00
Dick Hollenbeck 4880bc49e1 support new zone field ZPriority in kicad_plugin.cpp, enhance TESTLINE() so it does not match substrings 2012-01-30 09:53:28 -06:00
jean-pierre charras 068eb252c5 Pcbnew: added a priority level for zones: a zone with a hight priority can be now inside an other low priority zone.
useful for complex zones.
fix in footprint copy.
minor enhancement in netlist/ Footprints Test.
2012-01-30 14:43:02 +01:00
jean-pierre charras e784171e11 Pcbnew: Minor fix and enhancement. 2012-01-30 14:25:46 +01:00
jean-pierre charras 98db29d939 Add priority level to zones. 2012-01-29 20:29:19 +01:00
jean-pierre charras 6fddeb89bc New netlist format: Cvpcb: code cleaning. Pcbew: minor enhancements 2012-01-28 20:25:59 +01:00
jean-pierre charras e51810cb65 Restore INSTALL.txt, erroneously removed.
Pcbnew: minor code change in netlist functions.
2012-01-27 19:56:06 +01:00
Dick Hollenbeck 27ae0785c1 kicad CMakeList.txt library dependency order 2012-01-27 09:40:04 -06:00
Alain Portal 1dabea71da Fix build issues on RedHat based systems when using shared libraries. 2012-01-26 16:45:23 -05:00
unknown e6fe79daca MacOSX: Handling exec 2012-01-26 20:48:45 +01:00
jean-pierre charras dd54429ff6 Pcbnew: First draft to use a new netlist format ( containing the same info as the intermediate netlist, but using S expressions)
* Eeschema can generate this netlist format.
*   Pcbnew can use (automatic identification) the current format or the new format.
*   Cvpcb does not use yet the new format.
2012-01-26 10:37:36 +01:00
Dick Hollenbeck 47c9866131 tune the order of link libraries, based on estimated dependency sequence 2012-01-25 08:56:52 -06:00
unknown c39e8b142e MacOSX: Gerbview mouse fixed 2012-01-24 20:07:35 +01:00
unknown 1b54306b2f MacOSX: Fix in eeschema component move 2012-01-24 18:46:32 +01:00
Gerd v. Egidy 1a193d24ef bom-in-python script does not compile 2012-01-23 09:32:08 -06:00
Dick Hollenbeck d27bdd02ef add tools directory, move container_test.cpp there on standby 2012-01-23 09:25:46 -06:00
Dick Hollenbeck 9474623ff0 * Switch to C++'s true and false and away from C" TRUE and FALSE.
* Enhance class PLUGIN's comments to improve their value as instructional.
  * Switch #includes from "file.h" to <file.h>, and fiddle with search paths
    by using include_directories(BEFORE ...)
  * dialog_page_settings did not have symmetrical space on its right border.
    And it now remembers it last position and size within a program session.
  * base_screen.cpp is now compiled twice, once for {pcbnew,cvpcb} and once
    for eeschema, in preparation for "compile time" support of internal units
    rather than "runtime" support.
2012-01-22 23:17:34 -06:00
Dick Hollenbeck caf2439116 compile base_screen.cpp separately for {pcbnew,cvpcb} and eeschema, so we can diverge internal units at compile time, not runtime 2012-01-22 22:53:21 -06:00
Dick Hollenbeck 4ad507b4e9 dialog_page_settings needed right border space, retain last dialog size and position 2012-01-22 22:45:57 -06:00
Dick Hollenbeck 9e61e71cb1 switch to <> for includes from "" per conversation with Jean-Pierre and Wayne, adjust search paths 2012-01-22 22:33:36 -06:00
Dick Hollenbeck 1176351701 enhance comments since PLUGIN needs good documentation for others 2012-01-22 11:21:03 -06:00
Dick Hollenbeck ed835a4973 switch to C++'s false and true from C's FALSE and TRUE 2012-01-22 11:20:22 -06:00
jean-pierre charras 641c7a6d57 Eeschema: fix bug #919636
Pcbnew: 2 minor enhancements
2012-01-21 16:02:49 +01:00
jean-pierre charras 8bfbdc8cf5 Pcbnew: fix a serious bug: crashes when attempt to modify a zone that had lost its net (after eeschema changes for instance) 2012-01-19 19:12:30 +01:00
Lorenzo Marcantonio eae27b0baa This moves the 'Place Junction' button near the 'No Connection' one, to
keep all the labelling tools together in the eeschema toolbar.
2012-01-18 09:06:48 -06:00
Dick Hollenbeck 6281f981fa towards making KICAD_GOST a runtime option, hoping for unified paper size 2012-01-18 09:02:50 -06:00
unknown ee08bfb6aa Better icons in Eeschema from Fabrizio Tappero 2012-01-17 20:23:07 +01:00
Dick Hollenbeck 6a07109e10 set paper orientation into wxPrintData when possible 2012-01-17 09:34:05 -06:00
Alexander Zakamaldin 28d18a4f70 This patch is intended for poedit to do it's job better. 2012-01-17 09:02:17 -06:00
Dick Hollenbeck 14e81fca0e portrait setting was being overwritten in dialog_page_settings.cpp, add updatePortrait(), improve comments 2012-01-17 08:58:58 -06:00
Dick Hollenbeck 6d0cb74b64 try and support Electra *.ses files 2012-01-16 15:43:07 -06:00
Dick Hollenbeck 29b40bc75f switch to comboboxes on page size dialogs, fix PLUGIN header 2012-01-16 14:49:34 -06:00
Dick Hollenbeck d78bf5a93c switch to combobox on page size dialogs, fix PLUGIN header 2012-01-16 14:48:32 -06:00
Dick Hollenbeck f37b21bf6c fix order of cvpcb link libraries, make some PAGE_INFO functions inline 2012-01-15 23:38:11 -06:00
Dick Hollenbeck 7309784487 fix syntax error in kicad_plugin.cpp, carve out class_page_info.cpp, and add PAGE_INFO::Custom 2012-01-15 23:17:23 -06:00
Dick Hollenbeck 55426fb047 Add "portrait" support to the page size settings for all standard paper
sizes.  Tested with postscript output only.  Required minor file format changes
    to reflect the "portrait" setting.  common/dialogs/dialog_page_settings.cpp
    uses a checkbox but its name is "Landscape", which is inverted from portrait,
    but since it is the more common choice, I used that rather than portrait.
    The tooltip for that checkbox makes it clear.  No portrait mode is supported
    for "User" paper size.
2012-01-15 22:11:43 -06:00
Dick Hollenbeck a1172b6211 fix bug with user page size not taking effect immediately 2012-01-15 15:07:01 -06:00
Dick Hollenbeck 271a865d01 segment CHANGELOG.txt according to past years and current year 2012-01-14 20:11:35 -06:00
Dick Hollenbeck 5050dd13f4 commit CHANGELOG.txt before splitting into to years 2012-01-14 20:04:37 -06:00
Dick Hollenbeck 5ce81bf386 changes 2012-01-14 19:31:39 -06:00
Wayne Stambaugh 40fd3e9ae2 Pcbnew object improvements.
* Remove unnecessary copy constructors from board and module library
  objects.
* Add doClone() method to board and library objects.
* Add comment to class definitions where the default copy constructor
  generated by the compiler was adequate.
* Replace copy method with clone method where applicable.
* Remove DuplicateStruct() function.
* Remove track object copy function.
2012-01-14 14:50:32 -05:00
jean-pierre charras d8bffe12d7 Eeschema: Fix erroneous message [Read Only] after creating a new project, and obviously the corresponding schematic file does not yet exist (replaced by [no file]) 2012-01-14 12:52:46 +01:00
jean-pierre charras 7566aa2824 Code cleaning and better comments.
Gebview: fix issue in export to pcbnew (Track arc shapes are now exported, approximated by segments)
2012-01-13 19:35:46 +01:00
Dick Hollenbeck c97ede5c34 fix windows version of GetRunningMicroSecs() 2012-01-13 11:11:34 -06:00
Dick Hollenbeck a2416f0b3f add GetRunningMicroSecs() to libcommon for debug timing 2012-01-13 03:46:02 -06:00
unknown 89eefbdc6a MacOSX: Grid now is displayed correctly 2012-01-10 23:27:31 +01:00
unknown 44f64a852b MacOSX: Drag Modules and Tracks now works correctly 2012-01-10 22:55:07 +01:00
jean-pierre charras 11ecb09eab Pcbnew: fix issue when KICAD_NANOMETER is defined: when zones use htcth to show zones areas, hatch lines were incorrectly calculated (hunded of thousand lines created)
Eeschema: fix issue in search: search not made in reference strings.
Minor fixes, code cleaning and comment enhancements.
2012-01-10 21:12:46 +01:00
unknown e6f686533f MacOSX: Main issue catch! wxPen with size 0 draws NOTHING (8 months to spot it) 2012-01-10 20:52:48 +01:00
unknown c8dd7d95de MacOSX: compile error fix after r3329 2012-01-10 18:54:40 +01:00
Wayne Stambaugh 81a7af5704 Eeschema schematic object improvements.
* Remove unnecessary copy constructors from schematic and component
  library objects.
* Add comment to class definitions where the default copy constructor
  generated by the compiler was adequate.
* Add assignment operator to EDA_ITEM, SCH_ITEM, and all schematic
  objects where the default assignment operator generated by the
  compiler would not be adequate.
2012-01-09 15:26:55 -05:00
Andrey Fedorushkov e0dd754995 fix build when defined KICAD_GOST 2012-01-09 23:13:20 +04:00
Dick Hollenbeck 178e024721 ++all
* Carve out TITLE_BLOCK from BASE_SCREEN
  * Add include/hashtables.h and put class PROPERTIES in there.
    Change PROPERTIES to use "const char*" as the key instead of wxString.
++eeschema
  * Add shim class SCH_BASE_FRAME which introduces the data model SCH_SCREEN
    to the frame EESCHEMA frame class hierarchy and allows sharing of:
    SCH_SCREEN* GetScreen() const;                              // overload EDA_DRAW_FRAME
    void SetPageSettings( const PAGE_INFO& aPageSettings );     // overload EDA_DRAW_FRAME
    const PAGE_INFO& GetPageSettings () const;                  // overload EDA_DRAW_FRAME
    const wxSize GetPageSizeIU() const;                         // overload EDA_DRAW_FRAME
    const wxPoint& GetOriginAxisPosition() const;               // overload EDA_DRAW_FRAME
    void SetOriginAxisPosition( const wxPoint& aPosition );     // overload EDA_DRAW_FRAME
    const TITLE_BLOCK& GetTitleBlock() const;                   // overload EDA_DRAW_FRAME
    void SetTitleBlock( const TITLE_BLOCK& aTitleBlock );       // overload EDA_DRAW_FRAME
2012-01-09 11:32:27 -06:00
Dick Hollenbeck 99877adb39 ++eeschema
Add shim class SCH_BASE_FRAME which introduces the data model SCH_SCREEN
    to the frame class hierarchy.
2012-01-09 11:24:01 -06:00
Dick Hollenbeck 5d8779fac2 CHANGELOG.txt 2012-01-09 02:37:16 -06:00
Dick Hollenbeck 34e07ef245 carve out TITLE_BLOCK class from BASE_SCREEN, add hashtables.h for PROPERTIES 2012-01-09 02:35:06 -06:00
Александр Закамалдин c2f006f37a Patch drifted with time, and a patch hunk was erroneously applied by the patch program,
rather than being rejected.
2012-01-07 15:49:24 -06:00
Александр Закамалдин f19506c3ce This patch implements width tuning (width correction) for PS plotting of tracks, pads and vias.
This feature is very useful for electronics hobbyists who use DIY PCB technology 
(both toner transfer and photoresist methods).
Also width correction may be useful for PCB designers who take care of track width etching.
This patch also fixes some minor PS plotting issues.
2012-01-07 00:02:38 -06:00
jean-pierre charras 313a40875a Pcbnew: Now, archive modules function archives footprints with default orientation (0 degrees) and default side (Front layer) 2012-01-06 21:32:19 +01:00
jean-pierre charras c49acaddf4 Eeschema: add compil option in sch_field.cpp to go back to old behavior for field texts justifications (this option is not activated)
Note: only vertical texts have a modified behavior.
Minor other changes.
2012-01-06 20:00:59 +01:00
Dick Hollenbeck e2487270e5 improved comments 2012-01-05 12:16:21 -06:00
Dick Hollenbeck 2a29b56b12 add container_test 2012-01-05 11:29:17 -06:00
Dick Hollenbeck 746c533c3c Ki_PageDescr was re-written as a proper C++ class and renamed to PAGE_INFO.
It describes paper.  The m_Offset field was dropped since it was only used
    in HPGL plotting within EESCHEMA.  PAGE_INFO instance was moved out of
    BASE_SCREEN (which is on its way out) into both SCH_SCREEN and BOARD.


----------- This line and the following will be ignored --------------

modified:
  CMakeLists.txt
  common/CMakeLists.txt
  common/base_screen.cpp
  common/basicframe.cpp
  common/class_plotter.cpp
  common/common.cpp
  common/common_plotHPGL_functions.cpp
  common/common_plotPS_functions.cpp
  common/common_plot_functions.cpp
  common/dialogs/dialog_page_settings.cpp
  common/dialogs/dialog_page_settings.h
  common/dialogs/dialog_page_settings_base.cpp
  common/dialogs/dialog_page_settings_base.fbp
  common/dialogs/dialog_page_settings_base.h
  common/drawframe.cpp
  common/drawpanel.cpp
  common/pcbcommon.cpp
  common/projet_config.cpp
  common/worksheet.cpp
  cvpcb/class_DisplayFootprintsFrame.cpp
  cvpcb/class_footprints_listbox.cpp
  cvpcb/cvframe.cpp
  eeschema/dialogs/dialog_SVG_print.cpp
  eeschema/dialogs/dialog_SVG_print.h
  eeschema/dialogs/dialog_build_BOM.cpp
  eeschema/dialogs/dialog_plot_schematic_DXF.cpp
  eeschema/dialogs/dialog_plot_schematic_HPGL.cpp
  eeschema/dialogs/dialog_plot_schematic_PS.cpp
  eeschema/dialogs/dialog_print_using_printer.cpp
  eeschema/eeschema_config.cpp
  eeschema/files-io.cpp
  eeschema/libedit_plot_component.cpp
  eeschema/libeditframe.cpp
  eeschema/libeditframe.h
  eeschema/load_one_schematic_file.cpp
  eeschema/sch_screen.cpp
  eeschema/sch_sheet.h
  eeschema/schframe.cpp
  eeschema/viewlib_frame.cpp
  eeschema/viewlib_frame.h
  gerbview/dialogs/dialog_show_page_borders.cpp
  gerbview/dialogs/gerbview_dialog_display_options_frame.cpp
  gerbview/events_called_functions.cpp
  gerbview/gerbview.cpp
  gerbview/gerbview.h
  gerbview/gerbview_config.cpp
  gerbview/gerbview_frame.cpp
  gerbview/initpcb.cpp
  include/appl_wxstruct.h
  include/class_base_screen.h
  include/class_colors_design_settings.h
  include/class_pcb_screen.h
  include/class_sch_screen.h
  include/common.h
  include/pcbstruct.h
  include/plot_common.h
  include/wxBasePcbFrame.h
  include/wxEeschemaStruct.h
  include/wxstruct.h
  pcbnew/basepcbframe.cpp
  pcbnew/class_board.h
  pcbnew/class_pad.cpp
  pcbnew/class_pad.h
  pcbnew/class_track.h
  pcbnew/classpcb.cpp
  pcbnew/dialogs/dialog_SVG_print.cpp
  pcbnew/dialogs/dialog_gendrill.h
  pcbnew/dialogs/dialog_pad_properties.cpp
  pcbnew/export_gencad.cpp
  pcbnew/gen_drill_report_files.cpp
  pcbnew/gen_modules_placefile.cpp
  pcbnew/gendrill.cpp
  pcbnew/gendrill.h
  pcbnew/graphpcb.cpp
  pcbnew/initpcb.cpp
  pcbnew/io_mgr.h
  pcbnew/ioascii.cpp
  pcbnew/item_io.cpp
  pcbnew/kicad_plugin.cpp
  pcbnew/loadcmp.cpp
  pcbnew/minimun_spanning_tree.h
  pcbnew/moduleframe.cpp
  pcbnew/onleftclick.cpp
  pcbnew/pcbframe.cpp
  pcbnew/pcbnew_config.cpp
  pcbnew/pcbplot.h
  pcbnew/plotdxf.cpp
  pcbnew/plotgerb.cpp
  pcbnew/plothpgl.cpp
  pcbnew/plotps.cpp
  pcbnew/print_board_functions.cpp
  pcbnew/printout_controler.cpp
  pcbnew/printout_controler.h
  pcbnew/solve.cpp
  pcbnew/xchgmod.cpp
unknown:
  3239.patch
  3268.patch
  build/
  container_test.cpp
  debug/
  dick
  release/
  new/build/
  new/doxygen.sty
  pcbnew/basepcbframe.cpp.orig
  pcbnew/plotps.cpp.orig
pending merges:
  Dick Hollenbeck 2012-01-05 fix unreleased bug pertaining to "Sheet" line in a *.brd file
    Dick Hollenbeck 2012-01-05 [merge] merge in mainline into KICAD_PLUGIN work, which is for the PCBNEW nanometer support
    Dick Hollenbeck 2012-01-05 cannot use plugin until done
    Dick Hollenbeck 2012-01-05 finish up SCH_SHEET::{Set,Get}PageSettings() switch over
    Dick Hollenbeck 2012-01-04 remove page size globals from eeschema
    Dick Hollenbeck 2011-12-30 moving objects into BOARD which are saved in a *.brd file, for PLUGIN access
    Dick Hollenbeck 2011-12-22 [merge] merge in testing
    Dick Hollenbeck 2011-12-22 rename Ki_PageDescr to PAGE_INFO, encapsulate it in accessors, and move it into the BOARD
2012-01-05 10:40:36 -06:00
Dick Hollenbeck 3ddd2445e5 fix unreleased bug pertaining to "Sheet" line in a *.brd file 2012-01-05 10:37:51 -06:00
Dick Hollenbeck a682132503 merge in mainline into KICAD_PLUGIN work, which is for the PCBNEW nanometer support 2012-01-05 10:30:58 -06:00
Dick Hollenbeck 00bee0fa54 cannot use plugin until done 2012-01-05 09:36:45 -06:00
Dick Hollenbeck 4d25d2ffcc finish up SCH_SHEET::{Set,Get}PageSettings() switch over 2012-01-05 02:07:11 -06:00
Wayne Stambaugh 1db4a96c2c Eeschema schematic object improvements.
* Move SCH_ITEM::Place() code into SCH_EDIT_FRAME so schematic item
  objects no longer have any knowledge of the schematic frame window
  or undo/redo containers.
2012-01-04 17:08:46 -05:00
jean-pierre charras 8fef15cd56 Fix bug 910364: When a footprint saved in a .mod file is not on front layer and/or not with orientation 0 degree, the Module editor load it incorrectly.
note:  the Module editor save it with default orientation and layer, but the archive function does not, so some footprints can be not editable.
TODO: modify the Archive Function to use the default layer / orientation.
2012-01-04 20:10:33 +01:00
Dick Hollenbeck 64396d15c8 remove page size globals from eeschema 2012-01-04 00:18:38 -06:00
Wayne Stambaugh 5d209f798a Minor coding policy and code readability improvements. 2012-01-03 12:14:17 -05:00
Wayne Stambaugh 811006ed8f Remove unused EDA_ITEM list from BASE_SCREEN. 2012-01-02 15:45:46 -05:00
Dick Hollenbeck 555e9ed5fe moving objects into BOARD which are saved in a *.brd file, for PLUGIN access 2011-12-30 23:44:00 -06:00
jean-pierre charras 49eb11e135 Eeschema: Fix issue in Search/ReplaceAll
Pcbnew: fix a very minor issue.
2011-12-30 20:04:40 +01:00
jean-pierre charras a40cc0d9fc Commit forgotten file 2011-12-30 13:44:02 +01:00
jean-pierre charras 23078fe9c4 Pcbnew: Fix error message in Module Editor after a global pad change.
Minor other enhancements and code cleaning.
2011-12-30 13:29:54 +01:00
Wayne Stambaugh 254c6dc993 Encapsulation and other minor improvements.
* EDA_DRAW_PANEL completely encapsulated.
* Moved OSX m_overlay member from EDA_DRAW_PANEL to EDA_DRAW_FRAME where
  it is used.
* Doxygen comment warning fixes.
2011-12-29 15:11:42 -05:00
jean-pierre charras 66d0b809da Pcbnew: fix potential bug in connections calculations (see Bug #909298 ). 2011-12-28 16:14:46 +01:00
Wayne Stambaugh d0223dc1a0 Fix wxWidgets 2.8 build error. 2011-12-28 09:15:00 -05:00
jean-pierre charras 876b58cebc 3D view: Fix Bug #908871
Eeschema: fix a minor issue.
2011-12-27 19:08:50 +01:00
jean-pierre charras a21c2b4144 Eeschema: fix bug that creates duplicate segments instead of breaking them at junctions points.
Duplicate segments where created in drag command and netlist calculations.
2011-12-23 09:16:36 +01:00
Dick Hollenbeck b38bde7e12 merge in testing 2011-12-22 16:12:21 -06:00
Dick Hollenbeck 5cce143273 rename Ki_PageDescr to PAGE_INFO, encapsulate it in accessors, and move it into the BOARD 2011-12-22 15:57:50 -06:00
Guillaume Simard 75b97c9e0d While working on the layer changing patch, I found that changing track
size while routing (W, Ctrl+W) didn't update the track in the display
window (you had to move the mouse to get a refresh).
2011-12-22 09:41:16 -06:00
Wayne Stambaugh 91d3e9d924 More encapsulation improvements.
* EDA_DRAW_FRAME completely encapsulated.
* Encapsulate the the low hanging fruit in EDA_DRAW_PANEL.
2011-12-22 08:28:11 -05:00
jean-pierre charras b6819aa8dd Fix issue in GPcb footprints import.
Better code in test connections in zones.
Very minor other fixes
2011-12-22 09:07:50 +01:00
Wayne Stambaugh 60cb12c062 Eeschema find and replace improvements.
* Add check box and flag to ignore replacing the component reference
  designator field.
* Fix a resizing bug when switching between the find and replace modes of
  the find/replace dialog.
* Fix replace component reference designator field bug.
* Force rebuild of search list when schematic is modified and the replace
  dialog is closed.
* Prevent finding the next item when the find/replace dialog is closed.
* Respect warp mouse pointer setting when closing find/replace dialog.
* Fix duplicate mnemonic control accelerator keys in find/replace dialog.
2011-12-21 15:21:15 -05:00
Wayne Stambaugh 8ea57a4b36 More encapsulation work and other minor improvements.
* EDA_RECT and EDA_ITEM completely encapsulated.
* Removed unnecessary EDA_ITEM member m_Selected and replaced functionality
  with SELECTED flag bit.
2011-12-21 08:42:02 -05:00
Wayne Stambaugh dd96425a72 Removed -static-libgcc linker flag that caused Pcbnew to crash on Windows when raising an exception in release builds using MinGW GCC 4.6.1 2011-12-21 08:19:14 -05:00
Wayne Stambaugh 1bdcac1aac Fix debug assertion on wxWidgets 2.9.3. 2011-12-20 10:23:47 -05:00
jean-pierre charras 70443d06a2 Pcbnew: Enhanced algorithm to calculate board connections:
* A track is seen connected to a pad if the track end is inside the pad shape.
* Pads inside pads are now seen connected, if the center of the pad is *inside* the other pad.
* this is made to be sure a large copper area is shared by the 2 pads,  and to keep algorithm fast.
2011-12-19 12:58:24 +01:00
jean-pierre charras e23512d815 Cvpcb: fix incorrect behavior when clicking on a component 2011-12-18 21:22:16 +01:00
jean-pierre charras 8db20a6589 Minor enhancement and minor code cleaning. 2011-12-18 18:57:05 +01:00
jean-pierre charras e7787b18d3 fix bug: EDA_ITEM::m_forceVisible not initialized in constructor. 2011-12-18 16:26:09 +01:00
jean-pierre charras 7f7bbbcfb4 Some demo files updated. 2011-12-18 10:06:22 +01:00
jean-pierre charras 6a966bdb61 All: fix compatibility issues with wxWidgets 2.9.3
Minor cosmetic enhancements.
Pcbnew: more workd abput connection algorithms (work in progress)
2011-12-17 22:21:03 +01:00
Wayne Stambaugh 702ac16d12 Encapsulate EDA_APP class. 2011-12-16 15:12:49 -05:00
Alexander Zakamaldin 8c9150c223 fix 2011-12-16 12:15:24 -06:00
Dick Hollenbeck af4e13e528 improvements, hopefully 2011-12-16 11:03:25 -06:00
Wayne Stambaugh 8951032d07 More encapsulation work and other minor improvements.
* EDA_DRAW_FRAME completely encapsulated except for DrawFrame member.
* Moved members specific to Pcbnew from EDA_DRAW_FRAME to PCB_BASE_FRAME
  or PCB_EDIT_FRAME as appropriate.
* Replace EDA_TOOLBAR with wxAuiToolBar as EDA_TOOL bar provided no
  additional functionality and made code less readable.
* Remove EDA_TOOLBAR class definition from wxstruct.h and delete file
  wineda_toolbar.cpp.
* Rename tool bar members to something more descriptive since the
  horizontal and vertical references wont mean anything once the
  tool bars are movable.
* Lots of dead code removal.
2011-12-16 08:32:23 -05:00
Dick Hollenbeck a5a64daf75 fix bugs in kicad_plugin.cpp.
KICAD_PLUGIN::Load() is solid now, except for missing globals, which
still need to get moved into the class BOARD.

Same for KICAD_PLUGIN::Save(), only missing globals, which once they
are in the BOARD class, will be added.
2011-12-15 20:39:59 -06:00
Dick Hollenbeck b3e7510d31 plugin testing has started 2011-12-15 10:48:36 -06:00
Dick Hollenbeck 4bc6b69a96 legacy pcbnew plugin touch ups 2011-12-14 20:24:52 -06:00
Guillaume Simard 00b0d03dee fix 2011-12-14 16:35:03 -06:00
Guillaume Simard 1c24f3b14a Make CvPcb correctly preview the selected component footprint if one has already been assigned. 2011-12-14 15:23:32 -05:00
Wayne Stambaugh 65383f28a2 More EDA_DRAW_FRAME encapsulation work. 2011-12-14 15:03:15 -05:00
Dick Hollenbeck ef1c63169e fix EDA_ITEM::Show() prototype bug, fix KICAD_PLUGIN::Save() problem with netclasses. 2011-12-14 11:25:42 -06:00
jean-pierre charras 7cf1f011ef Pcbnew: fix issue when creating new tracks: sometimes a ratsnest remains active although a track exists. 2011-12-14 12:31:49 +01:00
Dick Hollenbeck 4aeeaed4c7 minor 2011-12-14 01:03:55 -06:00
Dick Hollenbeck ebe2f2b950 ++common
* changed all the RotatePoint() functions in trigo.{h,cpp} to take a double as the
    angle, which is still in tenths of degrees for now.
  * EDA_TEXT::m_Orient is now double, still in tenths of degrees (for a short while),
    but the double means parsing files and saving them use a different format string.
++pcbnew
  * DRAWSEGMENT::GetStart() and GetEnd() do not operate for S_ARC like they used to.
    They are now simply accessors for m_Start and m_End.  Use DRAWSEGMENT::GetArcStart()
    and GetArcEnd() and GetCenter() for arcs.  specctra_export.cpp was the only
    source file dependent on the old behavior.
  * DIMENSION::m_Text is now contained, not dynamically allocated.
  * more kicad_plugin work.
2011-12-13 22:43:51 -06:00
Dick Hollenbeck 9998946886 kicad_plugin 2011-12-13 22:29:25 -06:00
Guillaume Simard 0b16a37675 Add undo/redo support for Pcbnew auto place, auto move, and auto route features. 2011-12-13 15:42:42 -05:00
jean-pierre charras f860b5a058 pcbnew/class_track.h: remove duplicate class members. 2011-12-13 21:28:25 +01:00
Wayne Stambaugh 4f982ee3d1 Add Eeschema replace code.
* Enable replace toolbar button and menu entry.
* Improve find replace logging granularity.
* Fix find and replace dialog control hiding and disabling.
* Minor improvements to the SCH_FIND_REPLACE_DATA object.
* Move find collector list iterator into the collector object.
* Add visibility override flag to EDA_ITEM to temporarily show items that
  are hidden during find and replace.
2011-12-13 10:37:33 -05:00
Wayne Stambaugh 5f4acdee0e Fix infinite recursion bug in SCH_COMPONENT::SetTimeStamp(). 2011-12-12 15:59:43 -05:00
Wayne Stambaugh e640cc187b Fix a minor bug in my last commit that caused the debug build to fail. 2011-12-12 10:16:05 -05:00
Wayne Stambaugh d52fa9bcfc Encapsulate LABEL_OBJECT class and message panel window member of EDA_DRAW_FRAME. 2011-12-12 09:02:37 -05:00
Dick Hollenbeck 3029f0dd16 kicad_plugin work, and accessors along with making some fields protected or private 2011-12-12 02:39:41 -06:00
Dick Hollenbeck 9f69d80b12 plugin work, accessors 2011-12-12 02:37:05 -06:00
Dick Hollenbeck 573e154c18 ++PCBNew
* added BOARD::GetPad(int), made BOARD::m_NetInfo private, and contained
    within the BOARD, not dynamically allocated and owned via pointer.
  * added BOARD::GetPadCount()
  * changed NETINFO_LIST::GetCount() to GetNetCount()
  * added BOARD::GetNetCount()
  * more kicad_plugin work.
2011-12-09 23:47:13 -06:00
Dick Hollenbeck ad49eea20d more kicad_plugin work, make BOARD::m_NetInfo private 2011-12-09 23:33:24 -06:00
jean-pierre charras 1dfb8ee3ce Pcbnew: GPcb footprint import: fix incorrect pad size. 2011-12-09 18:43:34 +01:00
Wayne Stambaugh bca57a4330 Encapsulate SCH_EDIT_FRAME and LIB_EDIT_FRAME classes. 2011-12-09 11:37:11 -05:00
jean-pierre charras ea483333f4 Pcbnew: GPcb module import: fix incorrect position and size of texts. 2011-12-09 17:17:38 +01:00
jean-pierre charras 9f2d83c148 Pcbnew: fix bad initialization of default track width and vias sizes when starting pcbnew with no board loaded. 2011-12-09 11:36:00 +01:00
Wayne Stambaugh 4a59e203cb Encapsulate LIB_PIN class and begin encapsulating SCH_EDIT_FRAME class. 2011-12-08 16:05:43 -05:00
jean-pierre charras 697137585e Pcbnew: bug fix: some Global Design Rules not copied to the board after change. 2011-12-08 20:55:10 +01:00
jean-pierre charras 8031ec9d89 All: fix hotkey issue with wxWidgets-2.9.3 (Window only): hotkey events called twice.
* Fix compil issue about automatically created pcb_plot_params.h :
     pcb_plot_params.* moved from pcbnew to common because item_io.cpp (using this file) is compiled in common.
2011-12-08 19:23:44 +01:00
Wayne Stambaugh 54310ba2bc Encapsulate SCH_POLYLINE, SCH_SHEET, and SCH_TEXT classes. 2011-12-08 10:45:01 -05:00
Marco Mattila 60a894bded Fix thermal relief gap calculation for circular pads in pcbnew. 2011-12-08 01:58:43 +02:00
unknown f40cbb06d6 OSX: PCB Calculator correction 2011-12-07 22:06:02 +01:00
Wayne Stambaugh 01576229fe Encapsulate SCH_JUNCTION, SCH_LINE, and SCH_NO_CONNECT classes. 2011-12-07 15:19:29 -05:00
Wayne Stambaugh 6ad505b6e4 Encapsulate SCH_FIELD class. 2011-12-07 13:47:59 -05:00
jean-pierre charras 9c79b55078 All: fix a collision name between accessor function GetTimeStamp and GetTimeStamp in common.cpp.
In common.cpp GetTimeStamp is renamed GetNewTimeStamp (a better name).
Pcbnew: prepare work to calculate connections between pads that inteserct and therefore can be connected without any track (composite pads).
2011-12-07 16:49:32 +01:00
Wayne Stambaugh aac231c39a Encapsulate SCH_BUS_ENTRY class. 2011-12-07 09:08:52 -05:00
Dick Hollenbeck 6b577e1516 Collect all the PCBNew Save() and ReadDesc...() functions into new file item_io.cpp,
which should eventually go away in favor of kicad_plugin.cpp.
Add CMake options USE_NEW_PCBNEW_LOAD and USE_NEW_PCBNEW_SAVE, which should not be
used yet, and both default to OFF accordingly.
2011-12-06 23:39:18 -06:00
Dick Hollenbeck 79b4503d01 more plugin work 2011-12-06 23:28:49 -06:00
Wayne Stambaugh 1673a59a65 Encapsulate DANGLING_END_ITEM class. 2011-12-06 16:02:21 -05:00
Wayne Stambaugh ae395070d9 Zero memory to duplicate behavior changed when C malloc() was replaced by C++ new(). 2011-12-06 09:46:48 -05:00
jean-pierre charras eced38791a Pcbnew: remove global variables (g_TabOneLayerMask and g_ViaType_Name) 2011-12-06 09:35:13 +01:00
Dick Hollenbeck 7d3c3cc1e3 fix compile of kicad_plugin.cpp with wxWidgets 2.9.x 2011-12-06 00:19:36 -06:00
Dick Hollenbeck a26fdf3b54 Fix problem with BOARD bounding box in saved *.brd files,
and TEXTE_MODULE size in kicad_plugin.
Link in io_mgr and kicad_plugin but do not call them yet
2011-12-05 11:22:19 -06:00
Dick Hollenbeck b162585beb fix formatting problems that came about from incompatible tabbing in Lorenzo's patch 2011-12-05 01:03:57 -06:00
Dick Hollenbeck 77fb880f2d ++PCBNew
* Removed Pcb_Frame argument from BOARD() constructor, since it precludes
    having a BOARD being edited by more than one editor, it was a bad design.
    And this meant removing m_PcbFrame from BOARD.
  * removed BOARD::SetWindowFrame(), since BOARD::m_PcbFrame gone.
  * Removed the global BOARD_DESIGN_SETTINGS which was in class_board.cpp
  * Added BOARD_DESIGN_SETTINGS to the BOARD class, a full instance
  * A couple of dialogs now only change BOARD_DESIGN_SETTINGS when OK is pressed,
    such as dialog_mask_clearance, dialog_drc, etc.
  * Removed common/pcbcommon.cpp's int g_CurrentVersionPCB = 1 and replaced it
    with build_version.h's #define BOARD_FILE_VERSION, although there may be a
    better place for this constant.
  * Made the public functions in PARAM_CFG_ARRAY be type const.
    void SaveParam(..) const and void ReadParam(..) const
  * PARAM_CFG_BASE now has virtual destructor since we have various ways of
    destroying the derived classes and boost::ptr_vector must be told about this.
  * Pass const PARAM_CFG_ARRAY& instead of PARAM_CFG_ARRAY so that we can use
    an automatic PARAM_CFG_ARRAY which is on the stack.
  * PCB_EDIT_FRAME::GetProjectFileParameters() may no longer cache the array,
    since it has to access the current BOARD and the BOARD can change.
    Remember BOARD_DESIGN_SETTINGS are now in the BOARD.
  * Made the m_BoundingBox member private, this was a brutally hard task,
    and indicative of the lack of commitment to accessors and object oriented
    design on the part of KiCad developers.  We must do better.
    Added BOARD::GetBoundingBox, SetBoundingBox(), ComputeBoundingBox().
  * Added PCB_BASE_FRAME::GetBoardBoundingBox() which calls BOARD::ComputeBoundingBox()
2011-12-05 00:28:17 -06:00
Dick Hollenbeck 46222d488e ++PCBNew
* Removed Pcb_Frame argument from BOARD() constructor, since it precludes
    having a BOARD being edited by more than one editor, it was a bad design.
    And this meant removing m_PcbFrame from BOARD.
  * removed BOARD::SetWindowFrame(), and BOARD::m_PcbFrame
  * Removed the global BOARD_DESIGN_SETTINGS which was in class_board.cpp
  * added BOARD_DESIGN_SETTINGS to the BOARD class, a full instance
  * a couple dialogs now only change BOARD_DESIGN_SETTINGS when OK is pressed,
    such as dialog_mask_clearance, dialog_drc, etc.
  * Removed common/pcbcommon.cpp's int g_CurrentVersionPCB = 1 and replaced it
    with build_version.h's #define BOARD_FILE_VERSION, although there may be a
    better place for this constant.
  * Made the public functions in PARAM_CFG_ARRAY be type const.
    void SaveParam(..) const and void ReadParam(..) const
  * PARAM_CFG_BASE now has virtual destructor since we have various way of
    destroying the derived class and boost::ptr_vector must be told about this.
  * Pass const PARAM_CFG_ARRAY& instead of PARAM_CFG_ARRAY so that we can use
    an automatic PARAM_CFG_ARRAY which is on the stack.\
  * PCB_EDIT_FRAME::GetProjectFileParameters() may no longer cache the array,
    since it has to access the current BOARD and the BOARD can change.
    Remember BOARD_DESIGN_SETTINGS are now in the BOARD.
  * Made the m_BoundingBox member private, this was a brutally hard task,
    and indicative of the lack of commitment to accessors and object oriented
    design on the part of KiCad developers.  We must do better.
    Added BOARD::GetBoundingBox, SetBoundingBox(), ComputeBoundingBox().
  * Added PCB_BASE_FRAME::GetBoardBoundingBox() which calls BOARD::ComputeBoundingBox()
2011-12-05 00:15:33 -06:00
jean-pierre charras c0abe47d87 Pcbnew:
Enhanced algorithms to calculate board connections:
    Previously, a track was seen connected to a pad only if the track end is
    exactly on the pad position.
    Now a track is seen connected to a pad if the track end is inside the pad shape.
    Algorithm to calculate pads connections to track is still very fast.
    However some other functions (drag pads, track len calculation ...)
    still need the track end exactly on the pad position.
Dead code removal.
2011-12-04 18:57:03 +01:00
jean-pierre charras d6321ab2a1 Pcbnew: fix Bug #899373 2011-12-03 15:04:17 +01:00
Dick Hollenbeck ca1cc1c76e First working version of KICAD_PLUGIN::Load(), short of some globals and minor conflicts 2011-12-02 15:58:27 -06:00
Dick Hollenbeck 92593c3ea9 First working copy of KICAD_PLUGIN::Load() 2011-12-02 15:56:47 -06:00
Dick Hollenbeck 4b2a89683a fix comments, add IO_MGR::Save() 2011-12-02 10:57:44 -06:00
Dick Hollenbeck a830db6d86 fix warnings and comment 2011-12-02 10:55:31 -06:00
Dick Hollenbeck 7fb62aedc7 Improved PLUGIN documentation in io_mgr.h 2011-12-02 10:28:00 -06:00
Lorenzo Marcantonio c7fa954449 Update to the GENCAD import export 2011-12-02 09:09:57 -06:00
Dick Hollenbeck a002e04838 KICAD_PLUG intermediate work, for eventual nanometer boards 2011-12-01 16:54:58 -06:00
Dick Hollenbeck fe38bab63e KICAD_PLUG work 2011-12-01 16:50:41 -06:00
Wayne Stambaugh 86e0c29c25 Improve Eeschema find code and add initial replace plumbing.
* Replace Eeschema find code with a collector based implementation.
* Fixed a search bug when all subsequent searches of an item would ignore
  the remaining valid child items when an item had more than one child
  item that matched the search criteria.
* Add SCH_FIND_COLLECTOR class to find all items that meet the specified
  search criteria.
* Add SCH_FIND_COLLECT0R_DATA to keep track of information for all matching
  items.
* Use collector to iterate over the list of items that match the search
  criteria rather than trying to start at the last matched item.
* Remove unused searching methods from sheet path and sheet path list
  objects.
* Add replace and replace all functionality to Eeschema find dialog.
* Push matching methods down to EDA_ITEM class so they can be used by
  other derived objects.
* Add method to EDA_ITEM to test if item supports replacing.
* Add flag to find/replace data to support replace feature.
* Disable wild card matching check box when dialog is in replace mode as
  wild card replacement is not supported at this time.
* The usual Doxygen comment and coding policy fixes.
2011-12-01 11:49:28 -05:00
Dick Hollenbeck e554792ea5 KICAD_PLUGIN alternate nanometer board loader work 2011-12-01 00:06:08 -06:00
Dick Hollenbeck a82f60e302 KICAD_PLUGIN alternate nanometer board loader work 2011-12-01 00:04:23 -06:00
Marco Mattila 072a7ac84a Don't subtract soldermask from other than silkscreen layers when plotting gerbers from pcbnew. 2011-12-01 00:06:27 +02:00
Dick Hollenbeck 8dcfd7be61 KICAD_PLUGIN and nanometer intermediate checkin, work in progress... 2011-11-30 15:15:56 -06:00
jean-pierre charras a401afe52e Pcbnew: Fix bug Bug #898178 2011-11-30 21:05:17 +01:00
jean-pierre charras f2ccc83a29 Add Bulgarian language. Update translators list.
Pcbnew: prepare work on new algos for connections calculations.
2011-11-30 12:45:49 +01:00
Dick Hollenbeck b0ccf97226 more KICAD_PLUGIN work progress 2011-11-30 01:43:46 -06:00
Dick Hollenbeck 77cccbc405 This patch restores some of the goodness in Vladimir's rev 3239, and in particular
the GetPosition() and SetPosition() changes.  It also starts towards making m_Orientation
and m_Thickness fields private with accessors, but does not complete this latter goal.
2011-11-29 11:25:30 -06:00
Dick Hollenbeck 6370db0587 intermediate check in to show progress on new nanometer file loader PLUGIN 2011-11-28 21:08:14 -06:00
Dick Hollenbeck b5c71915c7 initial work on PCBNew PLUGIN support, in preparation for nanometer board load and save 2011-11-27 22:32:29 -06:00
jean-pierre charras c96777369d Pcbnew: Fix issue in Undo/Redo command: for very large boards ( > 20000 items) this command could take a long time. Now fast. 2011-11-27 13:29:01 +01:00
jean-pierre charras 9d663c5819 Update version number 2011-11-26 21:02:59 +01:00
Dick Hollenbeck 218eaf92ec changes 2011-11-25 09:40:40 -06:00
Dick Hollenbeck bbc31e07e9 changes 2011-11-25 09:15:46 -06:00
Dick Hollenbeck db889737be add board internal units plan, first incomplete draft. 2011-11-25 02:03:55 -06:00
jean-pierre charras d16ddf42cb Fix a minor issue in my last commit 2011-11-24 22:07:03 +01:00
jean-pierre charras fa0f0bfad9 Eeschema: fix crash in intermediate netlist generation when a component has no pins (like logos or images).
Pcbnew: texts in dimensions can be now moved.
Gerbview: fix incorrect number of layers  in export to pcbnew function.
2011-11-24 20:57:41 +01:00
Dick Hollenbeck 23e28fdd93 Temporarily reverse out the evolving support for finer Board Internal Units (BIU)s. 2011-11-24 11:32:51 -06:00
Vladimir Uryvaev cb62a3b039 Debug bug:) fix. Wayne found it. 2011-11-18 03:16:36 +04:00
Wayne Stambaugh 0cb15dba0a Added new find replace image to bitmap header file. 2011-11-17 13:39:18 -05:00
Vladimir Ur 48112f1a50 Nanometric work
- D_PAD members converted;
- style improved;
- GetPosition made returning value, added SetPosition;
- highly experimental, test it please!
2011-11-17 21:47:27 +04:00
Fabrizio Tappero b99290a060 Change find image, add new find replace image, and remove unused image cpp files. 2011-11-17 11:32:01 -05:00
Wayne Stambaugh ce013119b9 Fix Eeschema find item bugs and other minor changes.
* Fix bug in hierarchical searches using sheet path pointers which are
  destroyed on every search.  Use human readable path as last sheet found
  in test to prevent comparison of deleted pointers.
* Fix a bug in SCH_COMPONENT::Matches() that would prevent searching for
  pins if the search all fields flags was not set.
* Fix a bug in SCH_COMPONENT::Matches() to use the sheet path to perform
  the comparison to the correct reference designator and unit number.
* Fix wrapping in sheet path and sheet path list MatchNextItem methods.
* Push search methods down to EDA_ITEM object so advanced searching can
  be performed on all items derived from EDA_ITEM.
* Add virtual method to EDA_ITEM object to test if item supports replacing
  text.
* Replace switch statement magic numbers in Eeschema socket connection code
  with Pcbnew for improved readability.
2011-11-16 20:06:08 -05:00
Dick Hollenbeck 851643110f fix compiler warning 2011-11-16 14:52:51 -06:00
Vladimir Ur 45d9f292f9 D_PAD conversion: m_Pos converted
PCB_ITEM: GetPosition -- removed reference
load/save length in config
2011-11-16 21:04:12 +04:00
jean-pierre charras b3723ae020 Pcbnew: fix a possible crash after a board cleanup 2011-11-15 20:21:16 +01:00
Vladimir Ur 498bb81c0a Some code restyling: VECTOR_PCB is an array. Cleanup uncontrolled definitions of abs, max, etc. max is now overloaded function and MAX is a macro. 2011-11-15 22:26:06 +04:00
Vladimir Ur cfbc1d6b70 Nanometric work. Design rules, D_PAD (except m_Pos) is now in new units. Metric files can be loaded w/o KICAD_NANOMETRE flag set but saved only with this flag, this could help to gain some compatibility during transition process. ifdef'd code is somewhat minimized by using transition macros. Some potential code bugs are commented. 2011-11-14 20:56:05 +04:00
jean-pierre charras 7355272818 Very minor fix 2011-11-12 19:53:04 +01:00
jean-pierre charras 3c49b63a6b Pcbnew: fix bad icon in ModEdit toolbar. 2011-11-12 11:51:20 +01:00
jean-pierre charras db7b0a2272 Forgotten change. 2011-11-12 10:58:20 +01:00
jean-pierre charras 42e99ac2eb Some better icons.
Fix bug 880132 (Justify not correct)
Note: justifications are now always relative to the text, in libedit (as before) and schematic editor:
if rotated, justification is rotated, because in Pcbnew rotation can have any value.
2011-11-12 10:51:06 +01:00
Wayne Stambaugh 6f86b4ec95 Remove message dialogs from COMPONENT_LIBRARY class.
* Move the component library save file creation and write error dialogs
  into the appropriate frame object.
* Change the save component library and document definitions take an
  OUTPUTFORMATTER object instead of a file name.
* Change the component alias save document definition function to take
  an OUTPUTFORMATTER object instead of a file handle.
2011-11-11 15:10:24 -05:00
Vladimir Ur 574b492479 Metric KiCad work continues. Partially processed D_PAD class. It is still need to be tested including all these import and export procedures... 2011-11-11 21:44:20 +04:00
Wayne Stambaugh c9cf188e08 Fix write file bug when file is in the project path and no path is defined. 2011-11-11 11:08:58 -05:00
jean-pierre charras b459a204a4 Eeschema: bug 880132 : partial fix.
Pcbnew: remove useless code.
Doc: remobe obsolete reference to MINIZIP (which do not exist now)
2011-11-11 08:00:51 +01:00
Wayne Stambaugh a8ca4dbc3a Fix for hidden find dialog when display settings change. 2011-11-10 12:01:33 -05:00
Wayne Stambaugh 21c4e4940b Memory allocation improvements and other minor fixes.
* Replace C malloc() and free() functions with C++ new and delete
  operators or the appropriate STL container.
* Add option to end mouse capture function to skip executing the end
  mouse capture callback.
* Lots of coding policy and Doxygen comment goodness.
2011-11-10 10:55:05 -05:00
jean-pierre charras ee6e44669f Pcbnew: remove dead or obsolete code. Add or fix some comments.
Add minor enhancements.
2011-11-10 09:21:11 +01:00
Vladimir Ur b84cab3fc0 General design rules tab converted to nanoscale. A bit of refactorisation in via sizes. And build key is KICAD_NANOMETRE not KICAD_NANOMETRIC (as I stated in previous commit). 2011-11-09 21:35:16 +04:00
Vladimir Ur a9edcb5f10 Work on internal (nano)metric length units started.
Added configuartion option KICAD_NANOMETRIC for this.
* With option set to false: *
- it should work and compile as usual
- some values are saved with decimal point (which should be backward/forward compatible as old versions should just drop fractional part)
* With option set to true: *
- lengths in Global Design Rules should be settable 1nm steps.
FROM/TO_LEGACY_LU(_DBL) macros introduced for easy interconnection between old and new units.
2011-11-09 17:25:49 +04:00
Dick Hollenbeck ee207e2249 sweet editor, compiler warning 2011-11-08 15:14:39 -06:00
Wayne Stambaugh 28f06953fc Minor fixes, dead code removal, and coding policy fixes.
* Use version of DateAndTime that returns a wxString and delete the
  version that takes a char* as it is no longer required.
* Merge StrNumICmp() and StrLenNumICmp() into StrLenNumCmp() to create a
  single function for comparing strings with integers and remove a lot
  of duplicate code.
* Remove unused strupper from string.cpp.
* Use wxArrayString for sorting the EDA_LIST_DIALOG contents.
2011-11-08 11:37:25 -05:00
jean-pierre charras 90e3024517 Pcbnew: code cleaning in ratsnest.cpp. Add comments. 2011-11-08 17:18:46 +01:00
jean-pierre charras 6222a3a8f7 Pcbnew: Fix a membar issue: Layer setup incorrect location (seems due to an error when using copy/paste editor command) 2011-11-07 21:34:35 +01:00
Wayne Stambaugh 14482a174b Fix cursor warping out of client when zooming bug.
* Modify algorithm to correctly calculate the virtual drawing size and
  offset required to place the drawing correctly under all conditions.
* Ignore default wxWidgets scroll keys on Windows in EDA_DRAW_PANEL key
  event handler.
2011-11-07 14:04:24 -05:00
jean-pierre charras a2395a0417 Pcbnew: Fix typo in 2 filenames. Add comments in ratsnest.cpp.
Fix bug 887202.
2011-11-07 19:04:19 +01:00
jean-pierre charras fb2fc2f43f Pcbnew: more work on a better algorithm to calculate the full ratsnest.
Lee algorithm replaced by a Minimun Spanning Tree algo (using Prim's algorithm ).
Tested on a 5350 pads board, it is more than 100 times faster.
Also fix a crash when clicking on tool  "delete selected items" (main horizontal toolbar),
and remove this tool (currently, no code in Pcbnew for this tool)
2011-11-06 17:16:19 +01:00
Dick Hollenbeck dccd6a0499 Change various KiCad case utilization to precisely "KiCad" 2011-11-04 10:53:37 -05:00
jean-pierre charras 01ffe94974 Pcbnew: connect.cpp: enhanced ( faster and more powerful ) algorithm to calculate connections between pads.
Code cleaning.
2011-11-03 20:07:59 +01:00
Wayne Stambaugh 67f51b6e69 Use output formatter to save component library files and objects. 2011-11-01 11:06:26 -04:00
jean-pierre charras 105eec0693 Pcbnew: Fix bug I created in my previous commit.
More about code refactoring in connect.cpp: RecalculateAllTracksNetcode() is 50 times faster with a board using 27000 tracks
Use right icon in pcbnew for load board and new board.
2011-11-01 09:51:27 +01:00
Dick Hollenbeck ea4dd30143 formatting and compiler warnings 2011-11-01 03:06:33 -05:00
Dick Hollenbeck abfa841a98 sweet editor now shows GAL canvas 2011-11-01 03:05:56 -05:00
Wayne Stambaugh 1003c372bf Use line reader to load component library files and objects. 2011-10-31 16:49:48 -04:00
jean-pierre charras ff99823130 Fix minor issue under wxWidgets 2.9.3 in DRC dialog display.
More work about code refactoring in connect.cpp
2011-10-31 21:29:46 +01:00
jean-pierre charras fe431f1e8e Pcbnew: starting work on better ratsnest and connections calculations algorithms.
This first draft should fix bug 851670 and is faster than existing alogorithm.
2011-10-31 14:44:13 +01:00
Dick Hollenbeck 2ee49802a9 sweet editor work 2011-10-30 00:02:23 -05:00
jean-pierre charras 2ab46f7fa3 Pcbnew: fix minor issue: Footprint bounding box was too large for very small footprints (like SM0204) due to the minimal size value used in calculations. 2011-10-29 14:01:59 +02:00
Wayne Stambaugh 77e721f7ce Unify Eeschema orient commands and other minor fixes.
* Create command event handler for orienting schematic items and block.
* Remove redundant orient item and block command handler code and IDs.
* Remove redundant cancel current command event table entry.
* Remove unnecessary schematic bitmap object virtual functions.
* Set path when saving schematic sheet files to prevent assertion in
  updated path and file write permission test function.
* Restore directory and file name write permission test function to it's
  previous behavior to prevent unexpected save results.
* Add an assertion to verify the path is not empty to directory and file
  write permission test function.
* Improve documentation for path and file write permission test function.
* Fix Doxygen link warnings.
2011-10-28 16:30:50 -04:00
Wayne Stambaugh d4d1491a81 Fix schematic library pin editing bug. Fixes lp:809506
* Change edit pin per part flag to only have effect when editing
  component with multiple parts or alternate body styles.
* Move global edit pin pert part variable into library editor frame
  object.
* Note that this only fixes the bug when the component does not have
  multiple parts or alternate body styles.
2011-10-28 09:43:37 -04:00
jean-pierre charras b2b86d2e04 Fix erroneous test for non writable folder, when trying to save a schematic file with no path in name.
(seems wxFileName.IsDirWritable() fails under Windows when the path is empty (does not use the CWD).)
2011-10-27 20:38:31 +02:00
Wayne Stambaugh 3f3e7fd9f5 Unify Eeschema drag item commands into a single event handler.
* Create command event handler for draggining all schematic items.
* Remove redundant delete item command handler code.
* Remove unused close current tool command ID from process special
  functions event handler.
2011-10-27 13:51:22 -04:00
Wayne Stambaugh deec9e9ac8 Unify Eeschema edit item commands into a single event handler.
* Create command event handler for editing all schematic and child items.
* Remove unique edit schematic item command IDs.
* Unify find item, undo, and redo hot key commands.
2011-10-27 09:34:28 -04:00
Vladimir Ur 5634eaaf7a PCBNEW favored module placed on OPPOSITE side selected layer become.
Now it select module from selected side if present. Especially handy in contrast view.
2011-10-27 17:01:32 +04:00
jean-pierre charras 05f8a7bfb7 Fix message in KiCad Dialog About (forgotten USE_BOOST_POLYGON_LIBRARY option removed). 2011-10-27 07:43:44 +02:00
Wayne Stambaugh c1aa4fc1d0 Factor Eeschema rotate item hot keys into a rotate event handler.
* Add a rotate event handler to schematic frame object.
* Remove unique rotate item command IDs.
* Use process event instead of post event to eliminate the need to clean
  up the command event client object from the heap.
* Unify find next item and next DRC error hot key commands.
* Unify move and rotate hot keys commands.
2011-10-26 16:46:04 -04:00
jean-pierre charras 51570c73e1 bitmap2component: code cleanup. 2011-10-26 13:06:04 +02:00
jean-pierre charras 6afafe1114 bitmap2component: use BOOST:POLYGON instead of KBool, and minor enhancements. 2011-10-26 11:53:42 +02:00
jean-pierre charras c431a1e701 remove useless USE_BOOST_POLYGON_LIBRARY cmake option, and remove unused files.
BOOST POLYGON is always used in zone filling functions.
Kbool is still in use in other calculations.
2011-10-25 18:24:56 +02:00
Andrey Fedorushkov 177103021e Pcbnew: add send msg to Eeschema when move module 2011-10-24 19:23:06 +04:00
Wayne Stambaugh 5dd4e8ff47 Factor Eeschema place item hot keys into select tool event handler. 2011-10-24 09:56:35 -04:00
Andrey Fedorushkov 8b36b16b03 Eeschema:
* Fix bug in draw reference for multiunit component
* Code cleanup for drag item
2011-10-24 17:11:11 +04:00
jean-pierre charras b04ea483a8 Make some messages translatable. 2011-10-22 20:21:57 +02:00
Wayne Stambaugh 55bb147862 Complete Eeschema unified move code.
* Schematic fields now use unified move code.
* Move the unified move code into file schedit.cpp
* Remove old schematic field move code.
2011-10-22 08:31:44 -04:00
Wayne Stambaugh f2ba32a950 Initial ground work to make schematic fields use unified move code.
* Remove external dependency for adding suffix to reference designator
  fields.
* Make schematic field get and set position methods transform coordinates
  relative to the parent component object that owns them.
* Make base text class get text method virtual so derived classes can
  change the base string according to their individual requirements.
* Fix a problem with default place schematic item add in last commit.
2011-10-21 14:17:51 -04:00
Wayne Stambaugh 35c893e84f More Eeschema schematic item move code unification.
* Tweak move item to support moving schematic sheet pin objects.
* Change schematic sheet pin set position to constrain position within
  the parent sheet.
* Schematic sheet pin moving now handled by unified move code.
* Remove old schematic sheet pin move code.
* Add custom client data object for passing hot key information to
  command event handlers.
* Fix a bug that prevented changes to schematic sheet pin objects from
  being undone.
2011-10-21 09:59:15 -04:00
Dick Hollenbeck cca9777064 commit Brian's BOM generation scripts so they don't get lost 2011-10-20 10:49:07 -05:00
Dick Hollenbeck 2f386b6be2 coding standards cleanups 2011-10-20 09:46:06 -05:00
Vladimir Ur 6d19312f51 Automatic footprint assignment now can be done without equ file, if conditions are met:
* symbol in sch library have only single footprint filter,
* footprint filter have no wildcards,
* according footprint exists in pcb lib.
This could remove need in long equ files for lots of ICs.
2011-10-20 15:28:37 +04:00
Dick Hollenbeck a16b8a5474 sweet editor using GAL, links but does not work 2011-10-19 23:08:15 -05:00
Wayne Stambaugh 27b72c4c89 Minor Eeschema fixes.
* Fix a set position method bug in schematic item that caused the fields
  to drawn in the wrong position.
* Group zoom hot keys to use the same command event in schematic and
  library editor frames.
2011-10-19 19:17:28 -04:00
Wayne Stambaugh dbdce87679 Eeschema schematic item move code unification.
* Add get and set position methods to all schematic items.
* Encapsulate schematic item position members.
* Add swap data method to schematic items that lacked one.
* Remove global swap data function used by undo and redo functions.
* Unify as many schematic move methods as possible.
* Remove unnecessary place schematic item methods.
* All schematic items are now moved in the same event handler.
* Fixed bug in hierarchical sheet get menu item string method.
* Make no connect and junction items movable, fixes lp:804048
2011-10-19 16:32:21 -04:00
Fabrizio Tappero 2fd37df46a icons update. 2011-10-19 20:55:21 +02:00
Wayne Stambaugh 32a55c5c6e Minor menu bar fixes.
* Fixed bug on Windows that prevented the menu short cuts from working
  properly.
* Fix duplicate menu short cut keys in KiCad, Pcbnew, and Eeschema.
* Add menu short cuts for all possible menu entries.
2011-10-18 15:59:19 -04:00
jean-pierre charras 481a3f1ba1 Eeschema, Libedit: Use 16x16 icons in comboboxes inside the pin editor dialog. This gives a better look to this dialog. 2011-10-18 21:18:04 +02:00
jean-pierre charras 74f6c56d27 Fix very minor issues and code cleaning 2011-10-18 19:28:49 +02:00
jean-pierre charras bcaf8c7e70 Eeschema: Fix confusing labels in libedit (for pins and graphic items sharing).
Fix icons in macro menu.
2011-10-18 12:18:05 +02:00
jean-pierre charras d1f4eecc3a Eeschema: Fix icons in macro menu.
Fix confusing labels in libedit (for pins and graphic items sharing)
2011-10-18 12:16:27 +02:00
jean-pierre charras 7f5fef431a Icons update 2011-10-18 10:28:12 +02:00
Wayne Stambaugh f6a0f2743e Minor dialog fixes and code cleaning.
* Grammar and spelling fixes in Eeschema, CvPcb, and Pcbnew path and
  library dialog tool tips.
* Translate the French file name subrill.cpp to highlight.cpp.
* Lots of coding style policy fixes.
2011-10-17 16:01:27 -04:00
jean-pierre charras 9b49ee6208 Replace icon_cvpcb.svg file (broken?)
Gerbview: very minor fix
2011-10-17 18:49:14 +02:00
jean-pierre charras 198e472ba3 Gerbview: minor enhancement.
All: fix some strings very hard to translate in messages.
2011-10-16 10:02:36 +02:00
Wayne Stambaugh 4226ac02dc More auto save improvements.
* Factor test for auto save file into base frame class.
* Added auto save feature to Eeschema for saving schematics, addresses
  launchpad question 173631.
* Add auto save interval control to Eeschema options dialog.
* Fix problem with subsequent auto saves in last commit.
2011-10-15 09:25:57 -04:00
jean-pierre charras 4606630f5a CvPcb: make footprint filter case insensitive (Fix Bug #873417 ) 2011-10-14 18:44:15 +02:00
Wayne Stambaugh 5d8d561565 Make CvPcb stay open on save the default behavior. Fixes 872265 2011-10-13 16:13:11 -04:00
Wayne Stambaugh 6a6ac8b47b Pcbnew auto save improvements.
* Factor auto save common code into base frame class so all frame windows
  can take advantage of the shiny new auto save goodness.
* Use a timer instead of depending on mouse and keyboard events to trigger
  an auto save.
* Check for auto save file when opening a board and ask user if they
  wish to use the auto save file or the last saved board file.
* Protect all base frame public members.
2011-10-13 15:56:32 -04:00
jean-pierre charras 6417d7f882 Pcbnew: Fix an issue when try to importing gpcb footprints 2011-10-13 20:37:43 +02:00
Wayne Stambaugh 93ee368556 Factor bus label parsing function into net list object. 2011-10-12 11:34:52 -04:00
Wayne Stambaugh d89171768b More Eeschema net list object generation improvements.
* Add net list object creation functions to schematic sheet and label
  objects.
* Remove function to add schematic object net list items as it is no
  longer needed.
* Add license statements to all modified files that required one.
2011-10-12 10:03:43 -04:00
Andrey Fedorushkov b73037a282 cvpcb: add send message to eeschema when selecting item in list components 2011-10-12 17:09:12 +04:00
Wayne Stambaugh 1888ac386f Eeschema net list object generation improvements.
* Add net list object creation functions to schematic component object.
* Remove external variables used by the verify bus label and parse bus
  label functions.
* Remove redundant net list object include sheet path member assignment.
* Add license statements to all modified files that required one.
2011-10-11 16:23:56 -04:00
Wayne Stambaugh 535958a274 Eeschema net list object generation improvements.
* Define function to allow schematic objects to create their own net list
  objects.
* Add net list object creation functions to schematic line, junction, and
  no connect objects.
* Add license statements to all modified files that required one.
2011-10-11 09:38:13 -04:00
Wayne Stambaugh 35e1f2abed Eeschema ERC improvements and other minor fixes.
* Move the hierarchical label connected test into the NETLIST_OBJECT class.
* ERC pin type strings can now be translated.
* Remove unused EDA_DRAW_PANEL attribute from all ERC test functions.
* Add get marker count method to SCH_SCREENS object.
* Redundant header removal.
* Lots of coding style policy fixes.
2011-10-07 10:41:30 -04:00
Wayne Stambaugh 6e5cfde4b1 Minor copy version information to clipboard improvements.
* Add KiCad build option states to copy version information to clipboard
  function.
* Add a note to the main CMakeList.txt file to let developers know that
  new option states should be added to the copy version information to
  clipboard function.
2011-10-05 14:26:22 -04:00
Fabrizio Tappero and jean-pierre charras 52828730cb Commit new icons from Fabrizio Tappero .
(With a minor change for icon_cvpcb.svg: better look on dark backgrounds)
Fix bug 668200.
2011-10-05 14:36:32 +02:00
jean-pierre charras e3eae253df Fix typo errors and make translations more easy. 2011-10-03 21:11:09 +02:00
Wayne Stambaugh 104123aa88 Fix error when opening component library file names with dot. 2011-10-02 16:24:41 -04:00
Wayne Stambaugh 71224984bb Fix Pcbnew KICAD_T enum names for consistency. 2011-10-01 15:24:27 -04:00
Wayne Stambaugh 181f4ab54c Application name capitalization fixes.
* Correct all user strings and comments for the correct capitalization of
  application names according to JP.  They are KiCad, Pcbnew, CvPcb,
  Eeschema, and GerbView.
* Add a note the the user interface policy about the correct capitalization.
2011-09-30 14:15:37 -04:00
Roman Bashkov 5d1f303a16 pcbnew:
* Add visible clearance when edit node or track segment,
  add parameter "show clearance for new or edited track with via area"
  in "Display options" menu.
2011-09-30 12:24:10 +04:00
Wayne Stambaugh 6a48348831 Minor PCBNew code fixes.
* Translate French code names and comments.
* Dead code removal.
* Hot key object and structure coding style policy fixes.
* Doxygen comment warning fixes.
2011-09-29 12:49:40 -04:00
Fabrizio Tappero 33be36f175 New icons 2011-09-28 21:12:10 +02:00
jean-pierre charras 1a63b68990 Pcbnew: Fix 2 minor bugs about pcb texts: flipped texts have an incorrect rotation angle,
and text dialog editor did not handle properly negative rotation angles values.
Eeschema: fix bug when rotating (only using the Rotate hotkey) a field.
2011-09-28 10:32:31 +02:00
jean-pierre charras 1e3963b75d Eeschema: fix bug when rotating (only using the Rotate hotkey) a field. 2011-09-28 09:38:58 +02:00
jean-pierre charras ca290eeb97 Pcbnew: Fix 2 minor bugs about pcb texts: flipped texts have an incorrect rotation angle,
and text dialog editor did not handle properly negative rotation angles values.
2011-09-28 08:10:15 +02:00
Wayne Stambaugh dbe7934931 Fix PCBNew segfault when adding a module. 2011-09-27 16:43:18 -04:00
Wayne Stambaugh ca12278e90 PCB common library global variable removal and other minor fixes.
* Move auto save time global variables into PCB_EDIT_FRAME object.
* Move footprint library name list global variable int PCB_EDIT_FRAME
  object.
* Improve library back up and temporary file error message strings and make
  them translatable.
* PCBNew string unification.
* Translate French code names and comments.
* Coding style policy and Doxygen comment fixes.
2011-09-26 16:32:56 -04:00
Wayne Stambaugh db0e93fa8e Minor common PCB library code fixes.
* More common header file compiler fixes.
* Translate French code naming and comments.
* Remove global variable ScreenPcb.
* Dead code removal.
2011-09-24 14:33:28 -04:00
jean-pierre charras c8a041fbeb Use accelerators from hot keys in place menu, from the Fabrizio's idea 2011-09-24 19:15:29 +02:00
Marco Mattila 273d14d8a0 Fix drawsegment bounding box and hittest issues in pcbnew. 2011-09-24 01:40:36 +03:00
jean-pierre charras 024592281f Preparing hotkeys/shortcuts changes in place menu. 2011-09-23 22:00:30 +02:00
Wayne Stambaugh 5dbcca1543 PCB common library header rationalization.
* All header files used to create the PCB common library now compile as
  stand alone code.  This prevents the need to define them in a specific
  order to make source code compile properly.  It should also now be
  possible to relocate the source code to build the common PCB library
  to a separate folder.
2011-09-23 09:57:12 -04:00
JP Charras and Fabrizio Tappero, fabrizio.tappero b57b079c9b Update .cpp icon files not updated in previous commit.
Fix minor issues.
Fic compil issue in dimension.cpp with wxMSW 2.8.12 (wxMSW 2.8.12 only).
2011-09-22 21:16:55 +02:00
1752 changed files with 162822 additions and 295266 deletions
-3
View File
@@ -1,7 +1,6 @@
boost_root
.downloads-by-cmake
Build
build
common/netlist_keywords.*
common/netlist_lexer.h
common/pcb_plot_params_lexer.h
@@ -31,8 +30,6 @@ install_manifest.txt
Documentation/doxygen
Documentation/development/doxygen
*.bak
.*.swp
*.~*
common/pcb_plot_params_keywords.cpp
include/pcb_plot_params_lexer.h
pcbnew/specctra_keywords.cpp
-2
View File
@@ -1,2 +0,0 @@
[core]
excludesfile .bzrignore
+17 -35
View File
@@ -57,33 +57,16 @@ void S3D_MASTER::ObjectCoordsTo3DUnits( std::vector< S3D_VERTEX >& aVertices )
// adjust rotation
if( m_MatRotation.x )
{
double a = aVertices[ii].y;
double b = aVertices[ii].z;
RotatePoint( &a, &b, m_MatRotation.x * 10 );
aVertices[ii].y = (float)a;
aVertices[ii].z = (float)b;
}
RotatePoint( &aVertices[ii].y, &aVertices[ii].z, m_MatRotation.x * 10 );
if( m_MatRotation.y )
{
double a = aVertices[ii].z;
double b = aVertices[ii].x;
RotatePoint( &a, &b, m_MatRotation.x * 10 );
aVertices[ii].z = (float)a;
aVertices[ii].x = (float)b;
}
RotatePoint( &aVertices[ii].z, &aVertices[ii].x, m_MatRotation.y * 10 );
if( m_MatRotation.z )
{
double a = aVertices[ii].x;
double b = aVertices[ii].y;
RotatePoint( &a, &b, m_MatRotation.x * 10 );
aVertices[ii].x = (float)a;
aVertices[ii].y = (float)b;
}
RotatePoint( &aVertices[ii].x, &aVertices[ii].y, m_MatRotation.z * 10 );
/* adjust offset position (offset is given in UNIT 3D (0.1 inch) */
#define SCALE_3D_CONV ((IU_PER_MILS * 1000) / UNITS3D_TO_UNITSPCB)
aVertices[ii].x += m_MatPosition.x * SCALE_3D_CONV;
aVertices[ii].y += m_MatPosition.y * SCALE_3D_CONV;
aVertices[ii].z += m_MatPosition.z * SCALE_3D_CONV;
@@ -105,9 +88,9 @@ void TransfertToGLlist( std::vector< S3D_VERTEX >& aVertices, double aBiuTo3DUni
ay = aVertices[1].y - aVertices[0].y;
az = aVertices[1].z - aVertices[0].z;
bx = aVertices[2].x - aVertices[0].x;
by = aVertices[2].y - aVertices[0].y;
bz = aVertices[2].z - aVertices[0].z;
bx = aVertices[aVertices.size() - 1].x - aVertices[0].x;
by = aVertices[aVertices.size() - 1].y - aVertices[0].y;
bz = aVertices[aVertices.size() - 1].z - aVertices[0].z;
nx = ay * bz - az * by;
ny = az * bx - ax * bz;
@@ -150,14 +133,14 @@ void TransfertToGLlist( std::vector< S3D_VERTEX >& aVertices, double aBiuTo3DUni
glEnd();
}
S3DPOINT_VALUE_CTRL::S3DPOINT_VALUE_CTRL( wxWindow* aParent, wxBoxSizer* aBoxSizer )
VERTEX_VALUE_CTRL::VERTEX_VALUE_CTRL( wxWindow* aParent, wxBoxSizer* aBoxSizer )
{
wxString text;
wxFlexGridSizer* gridSizer = new wxFlexGridSizer( 0, 2, 0, 0 );
gridSizer->AddGrowableCol( 1 );
gridSizer->SetFlexibleDirection( wxHORIZONTAL );
gridSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
gridSizer->AddGrowableCol( 1 );
gridSizer->SetFlexibleDirection( wxHORIZONTAL );
gridSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
aBoxSizer->Add( gridSizer, 0, wxEXPAND, 5 );
@@ -186,16 +169,15 @@ S3DPOINT_VALUE_CTRL::S3DPOINT_VALUE_CTRL( wxWindow* aParent, wxBoxSizer* aBoxSiz
}
S3DPOINT_VALUE_CTRL::~S3DPOINT_VALUE_CTRL()
VERTEX_VALUE_CTRL::~VERTEX_VALUE_CTRL()
{
// Nothing to delete: all items are managed by the parent window.
}
S3DPOINT S3DPOINT_VALUE_CTRL::GetValue()
S3D_VERTEX VERTEX_VALUE_CTRL::GetValue()
{
S3DPOINT value;
double dtmp;
S3D_VERTEX value;
double dtmp;
m_XValueCtrl->GetValue().ToDouble( &dtmp );
value.x = dtmp;
@@ -207,7 +189,7 @@ S3DPOINT S3DPOINT_VALUE_CTRL::GetValue()
}
void S3DPOINT_VALUE_CTRL::SetValue( S3DPOINT vertex )
void VERTEX_VALUE_CTRL::SetValue( S3D_VERTEX vertex )
{
wxString text;
@@ -225,7 +207,7 @@ void S3DPOINT_VALUE_CTRL::SetValue( S3DPOINT vertex )
}
void S3DPOINT_VALUE_CTRL::Enable( bool onoff )
void VERTEX_VALUE_CTRL::Enable( bool onoff )
{
m_XValueCtrl->Enable( onoff );
m_YValueCtrl->Enable( onoff );
+175 -213
View File
@@ -1,33 +1,8 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 1992-2014 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file 3d_canvas.cpp
*/
#include <fctsys.h>
#include <trigo.h>
#include <project.h>
#include <gestfich.h>
#include <wx/image.h>
@@ -39,9 +14,7 @@
#include <wx/clipbrd.h>
#include <wx/wupdlock.h>
#ifdef __WINDOWS__
#include <GL/glew.h> // must be included before gl.h
#endif
#include <gestfich.h>
#include <3d_viewer.h>
#include <3d_canvas.h>
@@ -49,8 +22,34 @@
#include <trackball.h>
#include <3d_viewer_id.h>
#include <textures/text_silk.h>
#include <textures/text_pcb.h>
// -----------------
// helper function (from wxWidgets, opengl/cube.cpp sample
// -----------------
void CheckGLError()
{
GLenum errLast = GL_NO_ERROR;
for ( ; ; )
{
GLenum err = glGetError();
if ( err == GL_NO_ERROR )
return;
// normally the error is reset by the call to glGetError() but if
// glGetError() itself returns an error, we risk looping forever here
// so check that we get a different error than the last time
if ( err == errLast )
{
wxLogError(wxT("OpenGL error state couldn't be reset."));
return;
}
errLast = err;
wxLogError(wxT("OpenGL error %d"), err);
}
}
/*
@@ -66,9 +65,6 @@ BEGIN_EVENT_TABLE( EDA_3D_CANVAS, wxGLCanvas )
// mouse events
EVT_RIGHT_DOWN( EDA_3D_CANVAS::OnRightClick )
EVT_MOUSEWHEEL( EDA_3D_CANVAS::OnMouseWheel )
#ifdef USE_OSX_MAGNIFY_EVENT
EVT_MAGNIFY( EDA_3D_CANVAS::OnMagnify )
#endif
EVT_MOTION( EDA_3D_CANVAS::OnMouseMove )
// other events
@@ -76,29 +72,12 @@ BEGIN_EVENT_TABLE( EDA_3D_CANVAS, wxGLCanvas )
EVT_MENU_RANGE( ID_POPUP_3D_VIEW_START, ID_POPUP_3D_VIEW_END, EDA_3D_CANVAS::OnPopUpMenu )
END_EVENT_TABLE()
// Define an invalid value for some unsigned int indexes
#define INVALID_INDEX GL_INVALID_VALUE
EDA_3D_CANVAS::EDA_3D_CANVAS( EDA_3D_FRAME* parent, int* attribList ) :
wxGLCanvas( parent, wxID_ANY, attribList, wxDefaultPosition, wxDefaultSize,
wxFULL_REPAINT_ON_RESIZE )
{
m_init = false;
m_reportWarnings = true;
m_shadow_init = false;
// set an invalide value to not yet initialized indexes managing
// textures created to enhance 3D rendering
m_text_pcb = m_text_silk = INVALID_INDEX;
m_text_fake_shadow_front = INVALID_INDEX;
m_text_fake_shadow_back = INVALID_INDEX;
m_text_fake_shadow_board = INVALID_INDEX;
// position of the front and back layers
// (will be initialized to a better value later)
m_ZBottom = 0.0;
m_ZTop = 0.0;
m_lightPos = S3D_VERTEX(0.0f, 0.0f, 30.0f);
// Clear all gl list identifiers:
for( int ii = GL_ID_BEGIN; ii < GL_ID_END; ii++ )
@@ -116,16 +95,10 @@ EDA_3D_CANVAS::~EDA_3D_CANVAS()
ClearLists();
m_init = false;
delete m_glRC;
// Free the list of parsers list
for( unsigned int i = 0; i < m_model_parsers_list.size(); i++ )
if( m_model_parsers_list[i] )
delete m_model_parsers_list[i];
}
void EDA_3D_CANVAS::ClearLists( int aGlList )
void EDA_3D_CANVAS::ClearLists( GLuint aGlList )
{
if( aGlList )
{
@@ -144,19 +117,6 @@ void EDA_3D_CANVAS::ClearLists( int aGlList )
m_glLists[ii] = 0;
}
// When m_text_fake_shadow_??? is set to INVALID_INDEX, textures are no yet
// created.
if( m_text_fake_shadow_front != INVALID_INDEX )
glDeleteTextures( 1, &m_text_fake_shadow_front );
if( m_text_fake_shadow_back != INVALID_INDEX )
glDeleteTextures( 1, &m_text_fake_shadow_back );
if( m_text_fake_shadow_board != INVALID_INDEX )
glDeleteTextures( 1, &m_text_fake_shadow_board );
m_shadow_init = false;
}
@@ -170,7 +130,7 @@ void EDA_3D_CANVAS::OnChar( wxKeyEvent& event )
void EDA_3D_CANVAS::SetView3D( int keycode )
{
int ii;
double delta_move = 0.7 * GetPrm3DVisu().m_Zoom;
double delta_move = 0.7 * g_Parm_3D_Visu.m_Zoom;
switch( keycode )
{
@@ -191,22 +151,22 @@ void EDA_3D_CANVAS::SetView3D( int keycode )
break;
case WXK_HOME:
GetPrm3DVisu().m_Zoom = 1.0;
g_Parm_3D_Visu.m_Zoom = 1.0;
m_draw3dOffset.x = m_draw3dOffset.y = 0;
trackball( GetPrm3DVisu().m_Quat, 0.0, 0.0, 0.0, 0.0 );
trackball( g_Parm_3D_Visu.m_Quat, 0.0, 0.0, 0.0, 0.0 );
break;
case WXK_END:
break;
case WXK_F1:
GetPrm3DVisu().m_Zoom /= 1.4;
if( GetPrm3DVisu().m_Zoom <= 0.01 )
GetPrm3DVisu().m_Zoom = 0.01;
g_Parm_3D_Visu.m_Zoom /= 1.4;
if( g_Parm_3D_Visu.m_Zoom <= 0.01 )
g_Parm_3D_Visu.m_Zoom = 0.01;
break;
case WXK_F2:
GetPrm3DVisu().m_Zoom *= 1.4;
g_Parm_3D_Visu.m_Zoom *= 1.4;
break;
case '+':
@@ -219,59 +179,59 @@ void EDA_3D_CANVAS::SetView3D( int keycode )
case 'R':
m_draw3dOffset.x = m_draw3dOffset.y = 0;
for( ii = 0; ii < 4; ii++ )
GetPrm3DVisu().m_Rot[ii] = 0.0;
g_Parm_3D_Visu.m_Rot[ii] = 0.0;
trackball( GetPrm3DVisu().m_Quat, 0.0, 0.0, 0.0, 0.0 );
trackball( g_Parm_3D_Visu.m_Quat, 0.0, 0.0, 0.0, 0.0 );
break;
case 'x':
for( ii = 0; ii < 4; ii++ )
GetPrm3DVisu().m_Rot[ii] = 0.0;
g_Parm_3D_Visu.m_Rot[ii] = 0.0;
trackball( GetPrm3DVisu().m_Quat, 0.0, 0.0, 0.0, 0.0 );
GetPrm3DVisu().m_ROTZ = -90;
GetPrm3DVisu().m_ROTX = -90;
trackball( g_Parm_3D_Visu.m_Quat, 0.0, 0.0, 0.0, 0.0 );
g_Parm_3D_Visu.m_ROTZ = -90;
g_Parm_3D_Visu.m_ROTX = -90;
break;
case 'X':
for( ii = 0; ii < 4; ii++ )
GetPrm3DVisu().m_Rot[ii] = 0.0;
g_Parm_3D_Visu.m_Rot[ii] = 0.0;
trackball( GetPrm3DVisu().m_Quat, 0.0, 0.0, 0.0, 0.0 );
GetPrm3DVisu().m_ROTZ = 90;
GetPrm3DVisu().m_ROTX = -90;
trackball( g_Parm_3D_Visu.m_Quat, 0.0, 0.0, 0.0, 0.0 );
g_Parm_3D_Visu.m_ROTZ = 90;
g_Parm_3D_Visu.m_ROTX = -90;
break;
case 'y':
for( ii = 0; ii < 4; ii++ )
GetPrm3DVisu().m_Rot[ii] = 0.0;
g_Parm_3D_Visu.m_Rot[ii] = 0.0;
trackball( GetPrm3DVisu().m_Quat, 0.0, 0.0, 0.0, 0.0 );
GetPrm3DVisu().m_ROTX = -90;
trackball( g_Parm_3D_Visu.m_Quat, 0.0, 0.0, 0.0, 0.0 );
g_Parm_3D_Visu.m_ROTX = -90;
break;
case 'Y':
for( ii = 0; ii < 4; ii++ )
GetPrm3DVisu().m_Rot[ii] = 0.0;
g_Parm_3D_Visu.m_Rot[ii] = 0.0;
trackball( GetPrm3DVisu().m_Quat, 0.0, 0.0, 0.0, 0.0 );
GetPrm3DVisu().m_ROTX = -90;
GetPrm3DVisu().m_ROTZ = -180;
trackball( g_Parm_3D_Visu.m_Quat, 0.0, 0.0, 0.0, 0.0 );
g_Parm_3D_Visu.m_ROTX = -90;
g_Parm_3D_Visu.m_ROTZ = -180;
break;
case 'z':
for( ii = 0; ii < 4; ii++ )
GetPrm3DVisu().m_Rot[ii] = 0.0;
g_Parm_3D_Visu.m_Rot[ii] = 0.0;
trackball( GetPrm3DVisu().m_Quat, 0.0, 0.0, 0.0, 0.0 );
trackball( g_Parm_3D_Visu.m_Quat, 0.0, 0.0, 0.0, 0.0 );
break;
case 'Z':
for( ii = 0; ii < 4; ii++ )
GetPrm3DVisu().m_Rot[ii] = 0.0;
g_Parm_3D_Visu.m_Rot[ii] = 0.0;
trackball( GetPrm3DVisu().m_Quat, 0.0, 0.0, 0.0, 0.0 );
GetPrm3DVisu().m_ROTX = -180;
trackball( g_Parm_3D_Visu.m_Quat, 0.0, 0.0, 0.0, 0.0 );
g_Parm_3D_Visu.m_ROTX = -180;
break;
default:
@@ -288,54 +248,50 @@ void EDA_3D_CANVAS::OnMouseWheel( wxMouseEvent& event )
if( event.ShiftDown() )
{
if( event.GetWheelRotation() < 0 )
SetView3D( WXK_UP ); // move up
{
/* up */
SetView3D( WXK_UP );
}
else
SetView3D( WXK_DOWN ); // move down
{
/* down */
SetView3D( WXK_DOWN );
}
}
else if( event.ControlDown() )
{
if( event.GetWheelRotation() > 0 )
SetView3D( WXK_RIGHT ); // move right
{
/* right */
SetView3D( WXK_RIGHT );
}
else
SetView3D( WXK_LEFT ); // move left
{
/* left */
SetView3D( WXK_LEFT );
}
}
else
{
if( event.GetWheelRotation() > 0 )
{
GetPrm3DVisu().m_Zoom /= 1.4;
g_Parm_3D_Visu.m_Zoom /= 1.4;
if( GetPrm3DVisu().m_Zoom <= 0.01 )
GetPrm3DVisu().m_Zoom = 0.01;
if( g_Parm_3D_Visu.m_Zoom <= 0.01 )
g_Parm_3D_Visu.m_Zoom = 0.01;
}
else
GetPrm3DVisu().m_Zoom *= 1.4;
g_Parm_3D_Visu.m_Zoom *= 1.4;
DisplayStatus();
Refresh( false );
}
GetPrm3DVisu().m_Beginx = event.GetX();
GetPrm3DVisu().m_Beginy = event.GetY();
g_Parm_3D_Visu.m_Beginx = event.GetX();
g_Parm_3D_Visu.m_Beginy = event.GetY();
}
#ifdef USE_OSX_MAGNIFY_EVENT
void EDA_3D_CANVAS::OnMagnify( wxMouseEvent& event )
{
double magnification = ( event.GetMagnification() + 1.0f );
GetPrm3DVisu().m_Zoom /= magnification;
if( GetPrm3DVisu().m_Zoom <= 0.01 )
GetPrm3DVisu().m_Zoom = 0.01;
DisplayStatus();
Refresh( false );
}
#endif
void EDA_3D_CANVAS::OnMouseMove( wxMouseEvent& event )
{
wxSize size( GetClientSize() );
@@ -347,12 +303,12 @@ void EDA_3D_CANVAS::OnMouseMove( wxMouseEvent& event )
{
/* drag in progress, simulate trackball */
trackball( spin_quat,
(2.0 * GetPrm3DVisu().m_Beginx - size.x) / size.x,
(size.y - 2.0 * GetPrm3DVisu().m_Beginy) / size.y,
(2.0 * g_Parm_3D_Visu.m_Beginx - size.x) / size.x,
(size.y - 2.0 * g_Parm_3D_Visu.m_Beginy) / size.y,
( 2.0 * event.GetX() - size.x) / size.x,
( size.y - 2.0 * event.GetY() ) / size.y );
add_quats( spin_quat, GetPrm3DVisu().m_Quat, GetPrm3DVisu().m_Quat );
add_quats( spin_quat, g_Parm_3D_Visu.m_Quat, g_Parm_3D_Visu.m_Quat );
}
else if( event.MiddleIsDown() )
{
@@ -360,11 +316,11 @@ void EDA_3D_CANVAS::OnMouseMove( wxMouseEvent& event )
/* Current zoom and an additional factor are taken into account
* for the amount of panning. */
const double PAN_FACTOR = 8.0 * GetPrm3DVisu().m_Zoom;
const double PAN_FACTOR = 8.0 * g_Parm_3D_Visu.m_Zoom;
m_draw3dOffset.x -= PAN_FACTOR *
( GetPrm3DVisu().m_Beginx - event.GetX() ) / size.x;
( g_Parm_3D_Visu.m_Beginx - event.GetX() ) / size.x;
m_draw3dOffset.y -= PAN_FACTOR *
(event.GetY() - GetPrm3DVisu().m_Beginy) / size.y;
(event.GetY() - g_Parm_3D_Visu.m_Beginy) / size.y;
}
/* orientation has changed, redraw mesh */
@@ -372,8 +328,8 @@ void EDA_3D_CANVAS::OnMouseMove( wxMouseEvent& event )
Refresh( false );
}
GetPrm3DVisu().m_Beginx = event.GetX();
GetPrm3DVisu().m_Beginy = event.GetY();
g_Parm_3D_Visu.m_Beginx = event.GetX();
g_Parm_3D_Visu.m_Beginy = event.GetY();
}
@@ -515,7 +471,7 @@ void EDA_3D_CANVAS::DisplayStatus()
msg.Printf( wxT( "dy %3.2f" ), m_draw3dOffset.y );
Parent()->SetStatusText( msg, 2 );
msg.Printf( _( "Zoom: %3.1f" ), 45 * GetPrm3DVisu().m_Zoom );
msg.Printf( wxT( "View: %3.1f" ), 45 * g_Parm_3D_Visu.m_Zoom );
Parent()->SetStatusText( msg, 3 );
}
@@ -534,48 +490,16 @@ void EDA_3D_CANVAS::OnEraseBackground( wxEraseEvent& event )
// Do nothing, to avoid flashing.
}
typedef struct s_sImage
{
unsigned int width;
unsigned int height;
unsigned int bytes_per_pixel; /* 2:RGB16, 3:RGB, 4:RGBA */
unsigned char pixel_data[64 * 64 * 4 + 1];
}tsImage;
GLuint load_and_generate_texture( tsImage *image )
{
GLuint texture;
glPixelStorei (GL_UNPACK_ALIGNMENT, 1);
glPixelStorei (GL_PACK_ALIGNMENT, 1);
glGenTextures( 1, &texture );
glBindTexture( GL_TEXTURE_2D, texture );
gluBuild2DMipmaps( GL_TEXTURE_2D, GL_RGBA, image->width, image->height,
GL_RGBA, GL_UNSIGNED_BYTE, image->pixel_data );
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR );
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
return texture;
}
/* Initialize broad parameters for OpenGL */
void EDA_3D_CANVAS::InitGL()
{
wxSize size = GetClientSize();
if( !m_init )
{
m_init = true;
m_text_pcb = load_and_generate_texture( (tsImage *)&text_pcb );
m_text_silk = load_and_generate_texture( (tsImage *)&text_silk );
GetPrm3DVisu().m_Zoom = 1.0;
g_Parm_3D_Visu.m_Zoom = 1.0;
m_ZBottom = 1.0;
m_ZTop = 10.0;
@@ -584,12 +508,12 @@ void EDA_3D_CANVAS::InitGL()
glEnable( GL_ALPHA_TEST );
glEnable( GL_LINE_SMOOTH );
// glEnable(GL_POLYGON_SMOOTH); // creates issues with some graphic cards
glEnable( GL_NORMALIZE );
glShadeModel( GL_SMOOTH );
glEnable( GL_COLOR_MATERIAL );
glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE );
// speedups
//glEnable( GL_DITHER );
glEnable( GL_DITHER );
glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_DONT_CARE );
glHint( GL_LINE_SMOOTH_HINT, GL_NICEST );
glHint( GL_POLYGON_SMOOTH_HINT, GL_NICEST );
@@ -597,50 +521,90 @@ void EDA_3D_CANVAS::InitGL()
// Initialize alpha blending function.
glEnable( GL_BLEND );
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
}
}
// set viewing projection
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
#define MAX_VIEW_ANGLE 160.0 / 45.0
if( g_Parm_3D_Visu.m_Zoom > MAX_VIEW_ANGLE )
g_Parm_3D_Visu.m_Zoom = MAX_VIEW_ANGLE;
if( Parent()->ModeIsOrtho() )
{
// OrthoReductionFactor is chosen so as to provide roughly the same size as
// Perspective View
const double orthoReductionFactor = 400 / g_Parm_3D_Visu.m_Zoom;
// Initialize Projection Matrix for Ortographic View
glOrtho( -size.x / orthoReductionFactor, size.x / orthoReductionFactor,
-size.y / orthoReductionFactor, size.y / orthoReductionFactor, 1, 10 );
}
else
{
// Ratio width / height of the window display
double ratio_HV = (double) size.x / size.y;
// Initialize Projection Matrix for Perspective View
gluPerspective( 45.0 * g_Parm_3D_Visu.m_Zoom, ratio_HV, 1, 10 );
}
// position viewer
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
glTranslatef( 0.0F, 0.0F, -( m_ZBottom + m_ZTop) / 2 );
// clear color and depth buffers
glClearColor( g_Parm_3D_Visu.m_BgColor.m_Red,
g_Parm_3D_Visu.m_BgColor.m_Green,
g_Parm_3D_Visu.m_BgColor.m_Blue, 1 );
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
// Setup light sources:
SetLights();
CheckGLError();
}
/* Initialize OpenGL light sources. */
void EDA_3D_CANVAS::SetLights()
{
// activate light. the source is above the xy plane, at source_pos
GLfloat source_pos[4] = { m_lightPos.x, m_lightPos.y, m_lightPos.z, 0.0f };
GLfloat light_color[4]; // color of lights (RGBA values)
double light;
GLfloat light_color[4];
/* set viewing projection */
light_color[3] = 1.0;
GLfloat Z_axis_pos[4] = { 0.0, 0.0, 3.0, 0.0 };
GLfloat lowZ_axis_pos[4] = { 0.0, 0.0, -3.0, 0.5 };
// Light above the xy plane
light_color[0] = light_color[1] = light_color[2] = 0.0;
glLightfv( GL_LIGHT0, GL_AMBIENT, light_color );
light_color[0] = light_color[1] = light_color[2] = 1.0;
/* activate light */
light = 1.0;
light_color[0] = light_color[1] = light_color[2] = light;
glLightfv( GL_LIGHT0, GL_POSITION, Z_axis_pos );
glLightfv( GL_LIGHT0, GL_DIFFUSE, light_color );
light_color[0] = light_color[1] = light_color[2] = 1.0;
glLightfv( GL_LIGHT0, GL_SPECULAR, light_color );
glLightfv( GL_LIGHT0, GL_POSITION, source_pos );
light_color[0] = light_color[1] = light_color[2] = 0.2;
glLightModelfv( GL_LIGHT_MODEL_AMBIENT, light_color );
glLightModeli( GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE );
glEnable( GL_LIGHT0 ); // White spot on Z axis ( top )
light = 0.3;
light_color[0] = light_color[1] = light_color[2] = light;
glLightfv( GL_LIGHT1, GL_POSITION, lowZ_axis_pos );
glLightfv( GL_LIGHT1, GL_DIFFUSE, light_color );
glEnable( GL_LIGHT0 ); // White spot on Z axis
glEnable( GL_LIGHT1 ); // White spot on Z axis ( bottom)
glEnable( GL_LIGHTING );
}
/* Create a Screenshot of the current 3D view.
* Output file format is png or jpeg, or image is copied to the clipboard
*/
void EDA_3D_CANVAS::TakeScreenshot( wxCommandEvent& event )
{
static wxFileName fn; // Remember path between saves during this session only.
wxString FullFileName;
wxString file_ext, mask;
bool fmt_is_jpeg = false;
// First time path is set to the project path.
if( !fn.IsOk() )
fn = Parent()->Prj().GetProjectFullName();
wxFileName fn( Parent()->GetDefaultFileName() );
wxString FullFileName;
wxString file_ext, mask;
bool fmt_is_jpeg = false;
if( event.GetId() == ID_MENU_SCREENCOPY_JPEG )
fmt_is_jpeg = true;
@@ -649,24 +613,23 @@ void EDA_3D_CANVAS::TakeScreenshot( wxCommandEvent& event )
{
file_ext = fmt_is_jpeg ? wxT( "jpg" ) : wxT( "png" );
mask = wxT( "*." ) + file_ext;
FullFileName = Parent()->GetDefaultFileName();
fn.SetExt( file_ext );
FullFileName = EDA_FILE_SELECTOR( _( "3D Image File Name:" ), fn.GetPath(),
fn.GetFullName(), file_ext, mask, this,
wxFD_SAVE | wxFD_OVERWRITE_PROMPT, true );
FullFileName = EDA_FileSelector( _( "3D Image filename:" ), wxEmptyString,
fn.GetFullName(), file_ext, mask, this,
wxFD_SAVE, true );
if( FullFileName.IsEmpty() )
return;
fn = FullFileName;
// Be sure the screen area destroyed by the file dialog is redrawn before making
// a screen copy.
// Without this call, under Linux the screen refresh is made to late.
wxYield();
}
struct viewport_params
struct vieport_params
{
GLint originx;
GLint originy;
@@ -674,10 +637,6 @@ void EDA_3D_CANVAS::TakeScreenshot( wxCommandEvent& event )
GLint y;
} viewport;
// Be sure we have the latest 3D view (remember 3D view is buffered)
Refresh();
wxYield();
// Build image from the 3D buffer
wxWindowUpdateLocker noUpdates( this );
glGetIntegerv( GL_VIEWPORT, (GLint*) &viewport );
@@ -695,6 +654,7 @@ void EDA_3D_CANVAS::TakeScreenshot( wxCommandEvent& event )
viewport.x, viewport.y,
GL_ALPHA, GL_UNSIGNED_BYTE, alphabuffer );
image.SetData( pixelbuffer );
image.SetAlpha( alphabuffer );
image = image.Mirror( false );
@@ -702,15 +662,17 @@ void EDA_3D_CANVAS::TakeScreenshot( wxCommandEvent& event )
if( event.GetId() == ID_TOOL_SCREENCOPY_TOCLIBBOARD )
{
wxBitmapDataObject* dobjBmp = new wxBitmapDataObject;
dobjBmp->SetBitmap( bitmap );
if( wxTheClipboard->Open() )
{
wxBitmapDataObject* dobjBmp = new wxBitmapDataObject( bitmap );
if( !wxTheClipboard->SetData( dobjBmp ) )
wxMessageBox( _( "Failed to copy image to clipboard" ) );
wxTheClipboard->Flush(); /* the data in clipboard will stay
* available after the application exits */
* available after the
* application exits */
wxTheClipboard->Close();
}
}
+26 -232
View File
@@ -1,9 +1,9 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2012 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2012 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -43,15 +43,10 @@
#endif
#include <3d_struct.h>
#include <modelparsers.h>
#include <class_module.h>
#include <CBBox.h>
class BOARD_DESIGN_SETTINGS;
class EDA_3D_FRAME;
class SHAPE_POLY_SET;
class REPORTER;
class S3D_VERTEX;
class VIA;
class D_PAD;
@@ -66,14 +61,8 @@ enum GL_LIST_ID
GL_ID_BOARD, // List id for copper layers
GL_ID_TECH_LAYERS, // List id for non copper layers (masks...)
GL_ID_AUX_LAYERS, // List id for user layers (draw, eco, comment)
GL_ID_3DSHAPES_SOLID_FRONT, // List id for 3D shapes, non transparent entities
GL_ID_3DSHAPES_TRANSP_FRONT,// List id for 3D shapes, transparent entities
GL_ID_3DSHAPES_SOLID_BACK, // List id for 3D shapes, non transparent entities
GL_ID_3DSHAPES_TRANSP_BACK, // List id for 3D shapes, transparent entities
GL_ID_SHADOW_FRONT,
GL_ID_SHADOW_BACK,
GL_ID_SHADOW_BOARD,
GL_ID_BODY, // Body only list
GL_ID_3DSHAPES_SOLID, // List id for 3D shapes, non transparent entities
GL_ID_3DSHAPES_TRANSP, // List id for 3D shapes, transparent entities
GL_ID_END
};
@@ -81,37 +70,11 @@ class EDA_3D_CANVAS : public wxGLCanvas
{
private:
bool m_init;
bool m_reportWarnings; ///< true to report all warnings when building the 3D scene
///< false to report errors only
GLuint m_glLists[GL_ID_END]; ///< GL lists
GLuint m_glLists[GL_ID_END]; // GL lists
wxGLContext* m_glRC;
wxRealPoint m_draw3dOffset; ///< offset to draw the 3D mesh.
double m_ZBottom; ///< position of the back layer
double m_ZTop; ///< position of the front layer
GLuint m_text_pcb; ///< an index to the texture generated for pcb texts
GLuint m_text_silk; ///< an index to the texture generated for silk layers
// Index to the textures generated for shadows
bool m_shadow_init;
GLuint m_text_fake_shadow_front;
GLuint m_text_fake_shadow_back;
GLuint m_text_fake_shadow_board;
CBBOX m_boardAABBox; ///< Axis Align Bounding Box of the board
CBBOX m_fastAABBox; ///< Axis Align Bounding Box that contain the other bounding boxes
CBBOX m_fastAABBox_Shadow; ///< A bit scalled version of the m_fastAABBox
S3D_VERTEX m_lightPos;
/// Stores the list of parsers for each new file name (dont repeat files already loaded)
std::vector<S3D_MODEL_PARSER *> m_model_parsers_list;
std::vector<wxString> m_model_filename_list;
void create_and_render_shadow_buffer( GLuint *aDst_gl_texture,
GLuint aTexture_size, bool aDraw_body, int aBlurPasses );
void calcBBox();
wxRealPoint m_draw3dOffset; // offset to draw the 3D mesh.
double m_ZBottom; // position of the back layer
double m_ZTop; // position of the front layer
public:
EDA_3D_CANVAS( EDA_3D_FRAME* parent, int* attribList = 0 );
@@ -127,26 +90,16 @@ public:
* @param aGlList = the list to clear.
* if 0 (default) all lists are cleared
*/
void ClearLists( int aGlList = 0 );
void ClearLists( GLuint aGlList = 0 );
// Event functions:
void OnPaint( wxPaintEvent& event );
void OnEraseBackground( wxEraseEvent& event );
void OnChar( wxKeyEvent& event );
void OnMouseWheel( wxMouseEvent& event );
#ifdef USE_OSX_MAGNIFY_EVENT
void OnMagnify( wxMouseEvent& event );
#endif
void OnMouseMove( wxMouseEvent& event );
void OnRightClick( wxMouseEvent& event );
void OnPopUpMenu( wxCommandEvent& event );
/**
* Function TakeScreenshot
*
* creates a screenshot of the current 3D view and save to file as png or jpeg or image
* is copied to the clipboard
*/
void TakeScreenshot( wxCommandEvent& event );
void OnEnterWindow( wxMouseEvent& event );
@@ -159,217 +112,58 @@ public:
/**
* Function CreateDrawGL_List
* Prepares the parameters of the OpenGL draw list
* creates the OpenGL draw list items (board, grid ...)
* @param aErrorMessages = a REPORTER which will filled with error messages,
* if any
* @param aActivity = a REPORTER to display activity state
* creates the OpenGL draw list items (board, grid ...
*/
void CreateDrawGL_List( REPORTER* aErrorMessages, REPORTER* aActivity );
void CreateDrawGL_List();
void InitGL();
void ReportWarnings( bool aReport ) { m_reportWarnings = aReport; }
void SetLights();
void SetOffset(double aPosX, double aPosY)
{
m_draw3dOffset.x = aPosX;
m_draw3dOffset.y = aPosY;
}
/** @return the INFO3D_VISU which contains the current parameters
* to draw the 3D view og the board
*/
INFO3D_VISU& GetPrm3DVisu() const;
private:
/**
* return true if we are in realistic mode render
*/
bool isRealisticMode() const;
/**
* @return true if aItem should be displayed
* @param aItem = an item of DISPLAY3D_FLG enum
*/
bool isEnabled( DISPLAY3D_FLG aItem ) const;
/** Helper function
* @return true if aLayer should be displayed, false otherwise
*/
bool is3DLayerEnabled( LAYER_ID aLayer ) const;
/**
* @return the size of the board in pcb units
*/
wxSize getBoardSize() const;
/**
* @return the position of the board center in pcb units
*/
wxPoint getBoardCenter() const;
/**
* Helper function setGLTechLayersColor
* Initialize the color to draw the non copper layers
* in realistic mode and normal mode.
*/
void setGLTechLayersColor( LAYER_NUM aLayer );
/**
* Helper function setGLCopperColor
* Initialize the copper color to draw the board
* in realistic mode (a golden yellow color )
*/
void setGLCopperColor();
/**
* Helper function setGLEpoxyColor
* Initialize the color to draw the epoxy body board in realistic mode.
*/
void setGLEpoxyColor( float aTransparency = 1.0 );
/**
* Helper function setGLSolderMaskColor
* Initialize the color to draw the solder mask layers in realistic mode.
*/
void setGLSolderMaskColor( float aTransparency = 1.0 );
/**
* Function buildBoard3DView
* Function BuildBoard3DView
* Called by CreateDrawGL_List()
* Populates the OpenGL GL_ID_BOARD draw list with board items only on copper layers.
* 3D footprint shapes, tech layers and aux layers are not on this list
* Fills aErrorMessages with error messages created by some calculation function
* display activity state
* @param aBoardList =
* @param aBodyOnlyList =
* @param aErrorMessages = a REPORTER to add error and warning messages
* created by the build process (can be NULL)
* @param aActivity = a REPORTER to display activity state
*/
void buildBoard3DView( GLuint aBoardList, GLuint aBodyOnlyList,
REPORTER* aErrorMessages, REPORTER* aActivity );
void BuildBoard3DView();
/**
* Function buildTechLayers3DView
* Function BuildTechLayers3DView
* Called by CreateDrawGL_List()
* Populates the OpenGL GL_ID_TECH_LAYERS draw list with items on tech layers
* @param aErrorMessages = a REPORTER to add error and warning messages
* created by the build process (can be NULL)
* @param aActivity = a REPORTER to display activity state
* Populates the OpenGL GL_ID_BOARD draw list with items on tech layers
*/
void buildTechLayers3DView( REPORTER* aErrorMessages, REPORTER* aActivity );
void BuildTechLayers3DView();
/**
* Function buildBoardThroughHolesPolygonList
* Helper funtion to build the list of the board through holes polygons
* @param allBoardHoles = the SHAPE_POLY_SET to populate
* @param aSegCountPerCircle = the number of segments to approximate a circle
* @param aOptimizeLargeCircles = true to use more than aSegCountPerCircle
* for large circles (a large circle dimatere is > 1mm )
*/
void buildBoardThroughHolesPolygonList( SHAPE_POLY_SET& allBoardHoles,
int aSegCountPerCircle, bool aOptimizeLargeCircles );
/**
* Function buildShadowList
* Called by CreateDrawGL_List()
*/
void buildShadowList( GLuint aFrontList, GLuint aBacklist, GLuint aBoardList );
/**
* Function buildFootprintShape3DList
* Function BuildFootprintShape3DList
* Called by CreateDrawGL_List()
* Fills the OpenGL GL_ID_3DSHAPES_SOLID and GL_ID_3DSHAPES_TRANSP
* draw lists with 3D footprint shapes
* @param aOpaqueList is the gl list for non transparent items
* @param aTransparentList is the gl list for non transparent items,
* @param aErrorMessages = a REPORTER to add error and warning messages
* created by the build process (can be NULL)
* @param aActivity = a REPORTER to display activity state
* which need to be drawn after all other items
*/
void buildFootprintShape3DList( GLuint aOpaqueList,
GLuint aTransparentList,
REPORTER* aErrorMessages, REPORTER* aActivity );
void BuildFootprintShape3DList( GLuint aOpaqueList,
GLuint aTransparentList);
/**
* Function buildBoard3DAuxLayers
* Function BuildBoard3DAuxLayers
* Called by CreateDrawGL_List()
* Fills the OpenGL GL_ID_AUX_LAYERS draw list
* with items on aux layers only
* @param aErrorMessages = a REPORTER to add error and warning messages
* created by the build process (can be NULL)
* @param aActivity = a REPORTER to display activity state
* which need to be drawn after all other items
*/
void buildBoard3DAuxLayers( REPORTER* aErrorMessages, REPORTER* aActivity );
void BuildBoard3DAuxLayers();
void draw3DGrid( double aGriSizeMM );
void draw3DAxis();
void Draw3DGrid( double aGriSizeMM );
void Draw3DAxis();
/**
* Helper function BuildPadShapeThickOutlineAsPolygon:
* Build a pad outline as non filled polygon, to draw pads on silkscreen layer
* with a line thickness = aWidth
* Used only to draw pads outlines on silkscreen layers.
*/
void buildPadShapeThickOutlineAsPolygon( const D_PAD* aPad,
SHAPE_POLY_SET& aCornerBuffer,
int aWidth,
int aCircleToSegmentsCount,
double aCorrectionFactor );
/**
* Helper function draw3DViaHole:
* Draw the via hole:
* Build a vertical hole (a cylinder) between the first and the last via layers
*/
void draw3DViaHole( const VIA * aVia );
/**
* Helper function draw3DPadHole:
* Draw the pad hole:
* Build a vertical hole (round or oblong) between the front and back layers
*/
void draw3DPadHole( const D_PAD * aPad );
/**
* function render3DComponentShape
* insert mesh in gl list
* @param module
* @param aIsRenderingJustNonTransparentObjects = true to load non transparent objects
* @param aIsRenderingJustTransparentObjects = true to load non transparent objects
* in openGL, transparent objects should be drawn *after* non transparent objects
*/
void render3DComponentShape( MODULE* module,
bool aIsRenderingJustNonTransparentObjects,
bool aIsRenderingJustTransparentObjects );
/**
* function read3DComponentShape
* read the 3D component shape(s) of the footprint (physical shape).
* @param module
* @return true if load was succeeded, false otherwise
*/
bool read3DComponentShape( MODULE* module );
/**
* function generateFakeShadowsTextures
* creates shadows of the board an footprints
* for aesthetical purpose
* @param aErrorMessages = a REPORTER to add error and warning messages
* created by the build process (can be NULL)
* @param aActivity = a REPORTER to display activity state
*/
void generateFakeShadowsTextures( REPORTER* aErrorMessages, REPORTER* aActivity );
void Draw3DViaHole( const VIA * aVia );
void Draw3DPadHole( const D_PAD * aPad );
DECLARE_EVENT_TABLE()
};
void CheckGLError(const char *aFileName, int aLineNumber);
#endif /* _3D_CANVAS_H_ */
+55 -61
View File
@@ -1,7 +1,11 @@
/**
* @file 3d_class.cpp
*/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -21,15 +25,55 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file 3d_class.cpp
*/
#include <fctsys.h>
#include "3d_viewer.h"
#include "3d_struct.h"
#include "modelparsers.h"
#include <3d_viewer.h>
S3D_MATERIAL::S3D_MATERIAL( S3D_MASTER* father, const wxString& name ) :
EDA_ITEM( father, NOT_USED )
{
m_DiffuseColor.x = m_DiffuseColor.y = m_DiffuseColor.z = 1.0;
m_SpecularColor.x = m_SpecularColor.y = m_SpecularColor.z = 1.0;
m_AmbientIntensity = 1.0;
m_Transparency = 0.0;
m_Shininess = 1.0;
m_Name = name;
}
void S3D_MATERIAL::SetMaterial()
{
S3D_MASTER * s3dParent = (S3D_MASTER *) GetParent();
s3dParent->SetLastTransparency( m_Transparency );
if( ! s3dParent->IsOpenGlAllowed() )
return;
glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE );
glColor4f( m_DiffuseColor.x * m_AmbientIntensity,
m_DiffuseColor.y * m_AmbientIntensity,
m_DiffuseColor.z * m_AmbientIntensity,
1.0 - m_Transparency );
#if 0
glColorMaterial( GL_FRONT_AND_BACK, GL_SPECULAR );
glColor3f( m_SpecularColor.x, m_SpecularColor.y, m_SpecularColor.z );
glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE );
#endif
}
bool S3D_MASTER::IsOpenGlAllowed()
{
if( m_loadNonTransparentObjects ) // return true for non transparent objects only
{
if( m_lastTransparency == 0.0 )
return true;
}
if( m_loadTransparentObjects ) // return true for transparent objects only
if( m_lastTransparency != 0.0 )
return true;
return false;
}
void S3D_MASTER::Insert( S3D_MATERIAL* aMaterial )
@@ -54,18 +98,10 @@ S3D_MASTER::S3D_MASTER( EDA_ITEM* aParent ) :
EDA_ITEM( aParent, NOT_USED )
{
m_MatScale.x = m_MatScale.y = m_MatScale.z = 1.0;
m_lastTransparency = 0.0;
m_3D_Drawings = NULL;
m_Materials = NULL;
m_parser = NULL;
m_ShapeType = FILE3D_NONE;
m_use_modelfile_diffuseColor = true;
m_use_modelfile_emissiveColor = true;
m_use_modelfile_specularColor = true;
m_use_modelfile_ambientIntensity = true;
m_use_modelfile_transparency = true;
m_use_modelfile_shininess = true;
}
@@ -78,14 +114,12 @@ S3D_MASTER:: ~S3D_MASTER()
{
next = m_3D_Drawings->Next();
delete m_3D_Drawings;
m_3D_Drawings = 0;
}
for( ; m_Materials != NULL; m_Materials = nextmat )
{
nextmat = m_Materials->Next();
delete m_Materials;
m_Materials = NULL;
}
}
@@ -116,59 +150,19 @@ void S3D_MASTER::SetShape3DName( const wxString& aShapeName )
return;
wxFileName fn = m_Shape3DName;
m_Shape3DNameExtension = fn.GetExt();
wxString ext = fn.GetExt();
if( m_Shape3DNameExtension == wxT( "wrl" ) ||
m_Shape3DNameExtension == wxT( "x3d" ) )
if( ext == wxT( "wrl" ) || ext == wxT( "x3d" ) )
m_ShapeType = FILE3D_VRML;
else if( m_Shape3DNameExtension == wxT( "idf" ) )
else if( ext == wxT( "idf" ) )
m_ShapeType = FILE3D_IDF;
else
m_ShapeType = FILE3D_UNKNOWN;
// Expand any environment variables embedded in footprint's m_Shape3DName field.
// To ensure compatibility with most of footprint's m_Shape3DName field,
// if the m_Shape3DName is not an absolute path the default path
// given by the environment variable KISYS3DMOD will be used
if( m_Shape3DName.StartsWith( wxT("${") ) )
m_Shape3DFullFilename = wxExpandEnvVars( m_Shape3DName );
else
m_Shape3DFullFilename = m_Shape3DName;
wxFileName fnFull( m_Shape3DFullFilename );
if( !( fnFull.IsAbsolute() || m_Shape3DFullFilename.StartsWith( wxT(".") ) ) )
{
wxString default_path;
wxGetEnv( KISYS3DMOD, &default_path );
if( !( default_path.IsEmpty() ) )
{
if( !default_path.EndsWith( wxT("/") ) && !default_path.EndsWith( wxT("\\") ) )
default_path += wxT("/");
m_Shape3DFullFilename = default_path + m_Shape3DFullFilename;
}
}
return;
}
const wxString S3D_MASTER::GetShape3DFullFilename()
{
return m_Shape3DFullFilename;
}
const wxString S3D_MASTER::GetShape3DExtension()
{
return m_Shape3DNameExtension;
}
STRUCT_3D_SHAPE::STRUCT_3D_SHAPE( EDA_ITEM* aParent ) :
EDA_ITEM( aParent, NOT_USED )
{
+957 -905
View File
File diff suppressed because it is too large Load Diff
+127 -134
View File
@@ -33,28 +33,35 @@
#include <3d_viewer.h>
#include <info3d_visu.h>
#include <3d_draw_basic_functions.h>
#include <modelparsers.h>
// Imported function:
extern void TransfertToGLlist( std::vector<S3D_VERTEX>& aVertices, double aBiuTo3DUnits );
extern void CheckGLError();
// Number of segments to approximate a circle by segments
#define SEGM_PER_CIRCLE 24
#define SEGM_PER_CIRCLE 16
#ifndef CALLBACK
#define CALLBACK
#endif
// Variables used to pass a value to call back openGL functions
static float s_textureScale;
static double s_currentZpos;
static double s_biuTo3Dunits;
bool s_useTextures;
// CALLBACK functions for GLU_TESS
static void CALLBACK tessBeginCB( GLenum which );
static void CALLBACK tessEndCB();
static void CALLBACK tessErrorCB( GLenum errorCode );
static void CALLBACK tessCPolyPt2Vertex( const GLvoid* data );
void TransfertToGLlist( std::vector< S3D_VERTEX >& aVertices, double aBiuTo3DUnits );
// 2 helper functions to set the current normal vector for gle items
static inline void SetNormalZpos()
{
glNormal3f( 0.0, 0.0, 1.0 );
}
static inline void SetNormalZneg()
{
glNormal3f( 0.0, 0.0, -1.0 );
}
/* Draw3D_VerticalPolygonalCylinder is a helper function.
*
@@ -62,7 +69,7 @@ void TransfertToGLlist( std::vector< S3D_VERTEX >& aVertices, double aBiuTo3DUni
* from Z position = aZpos to aZpos + aHeight
* Used to create the vertical sides of 3D horizontal shapes with thickness.
*/
static void Draw3D_VerticalPolygonalCylinder( const SHAPE_POLY_SET& aPolysList,
static void Draw3D_VerticalPolygonalCylinder( const CPOLYGONS_LIST& aPolysList,
int aHeight, int aZpos,
bool aInside, double aBiuTo3DUnits )
{
@@ -87,61 +94,42 @@ static void Draw3D_VerticalPolygonalCylinder( const SHAPE_POLY_SET& aPolysList,
coords[3].z = coords[0].z;
// Draw the vertical polygonal side
for( int idx = 0; idx < aPolysList.OutlineCount(); idx++ )
int startContour = 0;
for( unsigned ii = 0; ii < aPolysList.GetCornersCount(); ii++ )
{
// Each polygon in aPolysList is a polygon with holes
const SHAPE_POLY_SET::POLYGON& curr_polywithholes = aPolysList.CPolygon( idx );
unsigned jj = ii + 1;
// Draw the outline of each simple polygon inside the polygon with holes:
for( unsigned ipoly = 0; ipoly < curr_polywithholes.size(); ipoly++ )
if( aPolysList.IsEndContour( ii ) || jj >= aPolysList.GetCornersCount() )
{
const SHAPE_LINE_CHAIN& path = curr_polywithholes[ipoly]; // a simple polygon
for( int jj = 0; jj < path.PointCount(); jj++ )
{
const VECTOR2I& a = path.CPoint( jj );
const VECTOR2I& b = path.CPoint( jj + 1 );
// Build the 4 vertices of each GL_QUAD
coords[0].x = a.x;
coords[0].y = -a.y;
coords[1].x = coords[0].x;
coords[1].y = coords[0].y; // only z change
coords[2].x = b.x;
coords[2].y = -b.y;
coords[3].x = coords[2].x;
coords[3].y = coords[2].y; // only z change
// Creates the GL_QUAD
TransfertToGLlist( coords, aBiuTo3DUnits );
}
jj = startContour;
startContour = ii + 1;
}
// Build the 4 vertices of each GL_QUAD
coords[0].x = aPolysList.GetX( ii );
coords[0].y = -aPolysList.GetY( ii );
coords[1].x = coords[0].x;
coords[1].y = coords[0].y; // only z change
coords[2].x = aPolysList.GetX( jj );
coords[2].y = -aPolysList.GetY( jj );
coords[3].x = coords[2].x;
coords[3].y = coords[2].y; // only z change
// Creates the GL_QUAD
TransfertToGLlist( coords, aBiuTo3DUnits );
}
}
void SetGLColor( EDA_COLOR_T color, double alpha )
{
double red, green, blue;
const StructColors &colordata = g_ColorRefs[ColorGetBase( color )];
float red = colordata.m_Red / 255.0;
float blue = colordata.m_Blue / 255.0;
float green = colordata.m_Green / 255.0;
glColor4f( red, green, blue, (float)alpha );
}
void SetGLColor( S3D_COLOR& aColor, float aTransparency )
{
glColor4f( aColor.m_Red, aColor.m_Green, aColor.m_Blue, aTransparency );
}
void SetGLTexture( GLuint text_id, float scale )
{
glEnable( GL_TEXTURE_2D );
glBindTexture( GL_TEXTURE_2D, text_id );
s_textureScale = scale; // for Tess callback functions
red = colordata.m_Red / 255.0;
blue = colordata.m_Blue / 255.0;
green = colordata.m_Green / 255.0;
glColor4f( red, green, blue, alpha );
}
@@ -153,15 +141,9 @@ void SetGLTexture( GLuint text_id, float scale )
* The top side is located at aZpos + aThickness / 2
* The bottom side is located at aZpos - aThickness / 2
*/
void Draw3D_SolidHorizontalPolyPolygons( const SHAPE_POLY_SET& aPolysList,
int aZpos, int aThickness, double aBiuTo3DUnits,
bool aUseTextures,
float aNormal_Z_Orientation )
void Draw3D_SolidHorizontalPolyPolygons( const CPOLYGONS_LIST& aPolysList,
int aZpos, int aThickness, double aBiuTo3DUnits )
{
// for Tess callback functions:
s_biuTo3Dunits = aBiuTo3DUnits;
s_useTextures = aUseTextures;
GLUtesselator* tess = gluNewTess();
gluTessCallback( tess, GLU_TESS_BEGIN, ( void (CALLBACK*) () )tessBeginCB );
@@ -169,63 +151,58 @@ void Draw3D_SolidHorizontalPolyPolygons( const SHAPE_POLY_SET& aPolysList,
gluTessCallback( tess, GLU_TESS_ERROR, ( void (CALLBACK*) () )tessErrorCB );
gluTessCallback( tess, GLU_TESS_VERTEX, ( void (CALLBACK*) () )tessCPolyPt2Vertex );
GLdouble v_data[3];
double zpos = ( aZpos + (aThickness / 2.0) ) * aBiuTo3DUnits;
s_currentZpos = zpos; // for Tess callback functions
v_data[2] = zpos;
GLdouble v_data[3];
double zpos = ( aZpos + (aThickness / 2) ) * aBiuTo3DUnits;
g_Parm_3D_Visu.m_CurrentZpos = zpos;
v_data[2] = aZpos + (aThickness / 2);
// Set normal toward positive Z axis, for a solid object on the top side
// Set normal to toward positive Z axis, for a solid object only (to draw the top side)
if( aThickness )
SetNormalZpos();
//gluTessProperty( tess, GLU_TESS_BOUNDARY_ONLY, GL_FALSE );
gluTessProperty( tess, GLU_TESS_WINDING_RULE, GLU_TESS_WINDING_ODD );
glNormal3f( 0.0, 0.0, aNormal_Z_Orientation );
// gluTessProperty(tess, GLU_TESS_WINDING_RULE, GLU_TESS_WINDING_ODD);
// Draw solid areas contained in this list
SHAPE_POLY_SET polylist = aPolysList; // temporary copy for gluTessVertex
CPOLYGONS_LIST polylist = aPolysList; // temporary copy for gluTessVertex
for( int side = 0; side < 2; side++ )
{
int startContour = 1;
for ( int idx = 0; idx < polylist.OutlineCount(); ++idx )
for( unsigned ii = 0; ii < polylist.GetCornersCount(); ii++ )
{
gluTessBeginPolygon( tess, NULL );
SHAPE_POLY_SET::POLYGON& curr_polywithholes = polylist.Polygon( idx ); // a polygon with holes
for( unsigned ipoly = 0; ipoly < curr_polywithholes.size(); ipoly++ )
if( startContour == 1 )
{
SHAPE_LINE_CHAIN& curr_poly = curr_polywithholes[ipoly]; // a simple polygon
gluTessBeginPolygon( tess, NULL );
gluTessBeginContour( tess );
for( int ipt = 0; ipt < curr_poly.PointCount(); ipt++ )
{
v_data[0] = curr_poly.Point( ipt ).x * aBiuTo3DUnits;
v_data[1] = -curr_poly.Point( ipt ).y * aBiuTo3DUnits;
// gluTessVertex store pointers on data, not data, so do not store
// different corners values in a temporary variable
// but send pointer on each CPolyPt value in polylist
// before calling gluDeleteTess
gluTessVertex( tess, v_data, &curr_poly.Point( ipt ) );
}
gluTessEndContour( tess );
startContour = 0;
}
gluTessEndPolygon( tess );
}
v_data[0] = polylist.GetX( ii ) * aBiuTo3DUnits;
v_data[1] = -polylist.GetY( ii ) * aBiuTo3DUnits;
// gluTessVertex store pointers on data, not data, so do not store
// different corners values in a temporary variable
// but send pointer on each CPolyPt value in polylist
// before calling gluDeleteTess
gluTessVertex( tess, v_data, &polylist[ii] );
if( polylist.IsEndContour( ii ) )
{
gluTessEndContour( tess );
gluTessEndPolygon( tess );
startContour = 1;
}
}
if( aThickness == 0 )
break;
// Prepare the bottom side of solid areas
zpos = ( aZpos - (aThickness / 2.0) ) * aBiuTo3DUnits;
s_currentZpos = zpos; // for Tess callback functions
zpos = ( aZpos - (aThickness / 2) ) * aBiuTo3DUnits;
g_Parm_3D_Visu.m_CurrentZpos = zpos;
v_data[2] = zpos;
glNormal3f( 0.0, 0.0, -aNormal_Z_Orientation );
// Now;, set normal to toward negative Z axis, for the solid object bottom side
SetNormalZneg();
}
gluDeleteTess( tess );
@@ -234,8 +211,22 @@ void Draw3D_SolidHorizontalPolyPolygons( const SHAPE_POLY_SET& aPolysList,
return;
// Build the 3D data : vertical side
Draw3D_VerticalPolygonalCylinder( polylist, aThickness, aZpos - (aThickness / 2.0),
true, aBiuTo3DUnits );
Draw3D_VerticalPolygonalCylinder( polylist, aThickness, aZpos - (aThickness / 2), false, aBiuTo3DUnits );
}
/* draw the solid polygon found in aPolysList
* The first polygon is the main polygon, others are holes
* See Draw3D_SolidHorizontalPolyPolygons for more info
*/
void Draw3D_SolidHorizontalPolygonWithHoles( const CPOLYGONS_LIST& aPolysList,
int aZpos, int aThickness,
double aBiuTo3DUnits )
{
CPOLYGONS_LIST polygon;
ConvertPolysListWithHolesToOnePolygon( aPolysList, polygon );
Draw3D_SolidHorizontalPolyPolygons( polygon, aZpos, aThickness, aBiuTo3DUnits );
}
@@ -249,7 +240,7 @@ void Draw3D_ZaxisCylinder( wxPoint aCenterPos, int aRadius,
int aZpos, double aBiuTo3DUnits )
{
const int slice = SEGM_PER_CIRCLE;
SHAPE_POLY_SET outer_cornerBuffer;
CPOLYGONS_LIST outer_cornerBuffer;
TransformCircleToPolygon( outer_cornerBuffer, aCenterPos,
aRadius + (aThickness / 2), slice );
@@ -257,41 +248,42 @@ void Draw3D_ZaxisCylinder( wxPoint aCenterPos, int aRadius,
std::vector<S3D_VERTEX> coords;
coords.resize( 4 );
SHAPE_POLY_SET inner_cornerBuffer;
CPOLYGONS_LIST inner_cornerBuffer;
if( aThickness ) // build the the vertical inner polygon (hole)
TransformCircleToPolygon( inner_cornerBuffer, aCenterPos,
aRadius - (aThickness / 2), slice );
if( aHeight )
{
// Draw the vertical outer side
Draw3D_VerticalPolygonalCylinder( outer_cornerBuffer,
aHeight, aZpos, false, aBiuTo3DUnits );
aHeight, aZpos, false, aBiuTo3DUnits );
if( aThickness )
// Draws the vertical inner side (hole)
Draw3D_VerticalPolygonalCylinder( inner_cornerBuffer,
aHeight, aZpos, true, aBiuTo3DUnits );
aHeight, aZpos, true, aBiuTo3DUnits );
}
if( aThickness )
{
// draw top (front) and bottom (back) horizontal sides (rings)
outer_cornerBuffer.AddHole( inner_cornerBuffer.COutline( 0 ) );
SetNormalZpos();
outer_cornerBuffer.Append( inner_cornerBuffer );
CPOLYGONS_LIST polygon;
ConvertPolysListWithHolesToOnePolygon( outer_cornerBuffer, polygon );
// draw top (front) horizontal ring
Draw3D_SolidHorizontalPolyPolygons( outer_cornerBuffer, aZpos + aHeight,
0, aBiuTo3DUnits, false, 1.0f );
Draw3D_SolidHorizontalPolyPolygons( polygon, aZpos + aHeight, 0, aBiuTo3DUnits );
if( aHeight )
{
// draw bottom (back) horizontal ring
Draw3D_SolidHorizontalPolyPolygons( outer_cornerBuffer, aZpos,
0, aBiuTo3DUnits, false, -1.0f );
SetNormalZneg();
Draw3D_SolidHorizontalPolyPolygons( polygon, aZpos, 0, aBiuTo3DUnits );
}
}
SetNormalZpos();
}
@@ -309,20 +301,20 @@ void Draw3D_ZaxisOblongCylinder( wxPoint aAxis1Pos, wxPoint aAxis2Pos,
const int slice = SEGM_PER_CIRCLE;
// Build the points to approximate oblong cylinder by segments
SHAPE_POLY_SET cornerBuffer;
CPOLYGONS_LIST outer_cornerBuffer;
int segm_width = (aRadius * 2) + aThickness;
TransformRoundedEndsSegmentToPolygon( cornerBuffer, aAxis1Pos,
TransformRoundedEndsSegmentToPolygon( outer_cornerBuffer, aAxis1Pos,
aAxis2Pos, slice, segm_width );
// Draw the oblong outer cylinder
if( aHeight )
Draw3D_VerticalPolygonalCylinder( cornerBuffer, aHeight, aZpos,
Draw3D_VerticalPolygonalCylinder( outer_cornerBuffer, aHeight, aZpos,
false, aBiuTo3DUnits );
if( aThickness )
{
SHAPE_POLY_SET inner_cornerBuffer;
CPOLYGONS_LIST inner_cornerBuffer;
segm_width = aRadius * 2;
TransformRoundedEndsSegmentToPolygon( inner_cornerBuffer, aAxis1Pos,
aAxis2Pos, slice, segm_width );
@@ -334,19 +326,24 @@ void Draw3D_ZaxisOblongCylinder( wxPoint aAxis1Pos, wxPoint aAxis2Pos,
// Build the horizontal full polygon shape
// (outer polygon shape - inner polygon shape)
cornerBuffer.AddHole( inner_cornerBuffer.COutline( 0 ) );
outer_cornerBuffer.Append( inner_cornerBuffer );
CPOLYGONS_LIST polygon;
ConvertPolysListWithHolesToOnePolygon( outer_cornerBuffer, polygon );
// draw top (front) horizontal side (ring)
Draw3D_SolidHorizontalPolyPolygons( cornerBuffer, aZpos + aHeight, 0, aBiuTo3DUnits, false,
1.0f );
SetNormalZpos();
Draw3D_SolidHorizontalPolyPolygons( polygon, aZpos + aHeight, 0, aBiuTo3DUnits );
if( aHeight )
{
// draw bottom (back) horizontal side (ring)
Draw3D_SolidHorizontalPolyPolygons( cornerBuffer, aZpos, 0, aBiuTo3DUnits, false,
-1.0f );
SetNormalZneg();
Draw3D_SolidHorizontalPolyPolygons( polygon, aZpos, 0, aBiuTo3DUnits );
}
}
SetNormalZpos();
}
@@ -359,12 +356,12 @@ void Draw3D_ZaxisOblongCylinder( wxPoint aAxis1Pos, wxPoint aAxis2Pos,
void Draw3D_SolidSegment( const wxPoint& aStart, const wxPoint& aEnd,
int aWidth, int aThickness, int aZpos, double aBiuTo3DUnits )
{
SHAPE_POLY_SET cornerBuffer;
const int slice = SEGM_PER_CIRCLE;
CPOLYGONS_LIST cornerBuffer;
const int slice = SEGM_PER_CIRCLE;
TransformRoundedEndsSegmentToPolygon( cornerBuffer, aStart, aEnd, slice, aWidth );
Draw3D_SolidHorizontalPolyPolygons( cornerBuffer, aZpos, aThickness, aBiuTo3DUnits, false, 1.0f );
Draw3D_SolidHorizontalPolyPolygons( cornerBuffer, aZpos, aThickness, aBiuTo3DUnits );
}
@@ -374,11 +371,11 @@ void Draw3D_ArcSegment( const wxPoint& aCenterPos, const wxPoint& aStartPoint,
{
const int slice = SEGM_PER_CIRCLE;
SHAPE_POLY_SET cornerBuffer;
CPOLYGONS_LIST cornerBuffer;
TransformArcToPolygon( cornerBuffer, aCenterPos, aStartPoint, aArcAngle,
slice, aWidth );
Draw3D_SolidHorizontalPolyPolygons( cornerBuffer, aZpos, aThickness, aBiuTo3DUnits, false, 1.0f );
Draw3D_SolidHorizontalPolyPolygons( cornerBuffer, aZpos, aThickness, aBiuTo3DUnits );
}
@@ -401,15 +398,11 @@ void CALLBACK tessEndCB()
void CALLBACK tessCPolyPt2Vertex( const GLvoid* data )
{
// cast back to double type
const VECTOR2I* ptr = (const VECTOR2I*) data;
const CPolyPt* ptr = (const CPolyPt*) data;
if( s_useTextures )
{
glTexCoord2f( ptr->x * s_biuTo3Dunits * s_textureScale,
-ptr->y * s_biuTo3Dunits * s_textureScale);
}
glVertex3d( ptr->x * s_biuTo3Dunits, -ptr->y * s_biuTo3Dunits, s_currentZpos );
glVertex3d( ptr->x * g_Parm_3D_Visu.m_BiuTo3Dunits,
-ptr->y * g_Parm_3D_Visu.m_BiuTo3Dunits,
g_Parm_3D_Visu.m_CurrentZpos );
}
+16 -21
View File
@@ -36,17 +36,27 @@
* @param aZpos = z position in board internal units
* @param aThickness = thickness in board internal units
* @param aBiuTo3DUnits = board internal units to 3D units scaling value
* @param aUseTextures = true to use textxures for the polygons
* @param aNormal_Z_Orientation = the normal Z orientation to apply
* If aThickness = 0, a polygon area is drawn in a XY plane at Z position = aZpos.
* If aThickness > 0, a solid object is drawn.
* The top side is located at aZpos + aThickness / 2
* The bottom side is located at aZpos - aThickness / 2
*/
void Draw3D_SolidHorizontalPolyPolygons( const SHAPE_POLY_SET& aPolysList,
int aZpos, int aThickness, double aBiuTo3DUnits,
bool aUseTextures,
float aNormal_Z_Orientation );
void Draw3D_SolidHorizontalPolyPolygons( const CPOLYGONS_LIST& aPolysList,
int aZpos, int aThickness, double aBiuTo3DUnits );
/** draw the solid polygon found in aPolysList
* The first polygonj is the main polygon, others are holes
* @param aPolysList = the polygon with holes to draw
* @param aZpos = z position in board internal units
* @param aThickness = thickness in board internal units
* @param aBiuTo3DUnits = board internal units to 3D units scaling value
* If aThickness = 0, a polygon area is drawn in a XY plane at Z position = aZpos.
* If aThickness > 0, a solid object is drawn.
* The top side is located at aZpos + aThickness / 2
* The bottom side is located at aZpos - aThickness / 2
*/
void Draw3D_SolidHorizontalPolygonWithHoles( const CPOLYGONS_LIST& aPolysList,
int aZpos, int aThickness, double aBiuTo3DUnits );
/** draw a thick segment using 3D primitives, in a XY plane
* @param aStart = YX position of start point in board units
@@ -115,20 +125,5 @@ void Draw3D_ZaxisOblongCylinder( wxPoint aAxis1Pos, wxPoint aAxis2Pos,
*/
void SetGLColor( EDA_COLOR_T aColor, double aTransparency = 1.0 );
/**
* Set the current 3D color from a S3D_COLOR color, with optional transparency
* @param aColor = a S3D_COLOR RGB color index
* @param aTransparency = the color transparency (default = 1.0 = no transparency)
*/
void SetGLColor( S3D_COLOR& aColor, float aTransparency );
/**
* Set a texture id and a scale to apply when rendering the polygons
* @param text_id = texture ID created by glGenTextures
* @param scale = scale to apply to texture coords
*/
void SetGLTexture( GLuint text_id, float scale );
#endif // _3D_DRAW_BASIC_FUNCTIONS_H_
-637
View File
@@ -1,637 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2014-2015 Mario Luzeiro <mrluzeiro@gmail.com>
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file 3d_draw_board_body.cpp
*
*/
#include <fctsys.h>
#include <common.h>
#include <trigo.h>
#include <pcbstruct.h>
#include <drawtxt.h>
#include <layers_id_colors_and_visibility.h>
#include <wxBasePcbFrame.h>
#include <class_board.h>
#include <class_module.h>
#include <class_track.h>
#include <class_edge_mod.h>
#include <class_zone.h>
#include <class_drawsegment.h>
#include <class_pcb_text.h>
#include <colors_selection.h>
#include <convert_basic_shapes_to_polygon.h>
#define GLM_FORCE_RADIANS
#include <gal/opengl/glm/gtc/matrix_transform.hpp>
#include <gal/opengl/opengl_compositor.h>
#ifdef __WINDOWS__
#include <GL/glew.h> // must be included before gl.h
#endif
#include <3d_viewer.h>
#include <3d_canvas.h>
#include <info3d_visu.h>
#include <trackball.h>
#include <3d_draw_basic_functions.h>
#include <geometry/shape_poly_set.h>
#include <geometry/shape_file_io.h>
#include <CImage.h>
#include <reporter.h>
// An option for all operations on polygons:
// when useFastModeForPolygons = true, calculations can be *a lot* faster.
// but created polygons can be not stricty simple (can share edges)
// Although stricty simple are better for glu tesselation functions, I do not see
// any issue when allowing not stricty simple polygons.
// But I see *very* long calculations when setting useFastMode to false.
// So, be careful if changing thie option
bool useFastModeForPolygons = true;
/* returns the Z orientation parameter 1.0 or -1.0 for aLayer
* Z orientation is 1.0 for all layers but "back" layers:
* B_Cu , B_Adhes, B_Paste ), B_SilkS
* used to calculate the Z orientation parameter for glNormal3f
*/
GLfloat Get3DLayer_Z_Orientation( LAYER_NUM aLayer );
void EDA_3D_CANVAS::buildBoardThroughHolesPolygonList( SHAPE_POLY_SET& allBoardHoles,
int aSegCountPerCircle, bool aOptimizeLargeCircles )
{
// hole diameter value to change seg count by circle:
int small_hole_limit = Millimeter2iu( 1.0 );
int copper_thickness = GetPrm3DVisu().GetCopperThicknessBIU();
BOARD* pcb = GetBoard();
// Build holes of through vias:
for( TRACK* track = pcb->m_Track; track; track = track->Next() )
{
if( track->Type() != PCB_VIA_T )
continue;
VIA *via = static_cast<VIA*>( track );
if( via->GetViaType() != VIA_THROUGH )
continue;
int holediameter = via->GetDrillValue();
int hole_outer_radius = (holediameter + copper_thickness) / 2;
TransformCircleToPolygon( allBoardHoles,
via->GetStart(), hole_outer_radius,
aSegCountPerCircle );
}
// Build holes of through pads:
for( MODULE* footprint = pcb->m_Modules; footprint; footprint = footprint->Next() )
{
for( D_PAD* pad = footprint->Pads(); pad; pad = pad->Next() )
{
// Calculate a factor to apply to segcount for large holes ( > 1 mm)
// (bigger pad drill size -> more segments) because holes in pads can have
// very different sizes and optimizing this segcount gives a better look
// Mainly mounting holes have a size bigger than small_hole_limit
wxSize padHole = pad->GetDrillSize();
if( ! padHole.x ) // Not drilled pad like SMD pad
continue;
// we use the hole diameter to calculate the seg count.
// for round holes, padHole.x == padHole.y
// for oblong holes, the diameter is the smaller of (padHole.x, padHole.y)
int diam = std::min( padHole.x, padHole.y );
int segcount = aSegCountPerCircle;
if( diam > small_hole_limit )
{
double segFactor = (double)diam / small_hole_limit;
segcount = (int)(aSegCountPerCircle * segFactor);
// limit segcount to 48. For a circle this is a very good approx.
if( segcount > 48 )
segcount = 48;
}
// The hole in the body is inflated by copper thickness.
int inflate = copper_thickness;
// If not plated, no copper.
if( pad->GetAttribute () == PAD_ATTRIB_HOLE_NOT_PLATED )
inflate = 0;
pad->BuildPadDrillShapePolygon( allBoardHoles, inflate, segcount );
}
}
allBoardHoles.Simplify( useFastModeForPolygons );
}
void EDA_3D_CANVAS::buildBoard3DView( GLuint aBoardList, GLuint aBodyOnlyList,
REPORTER* aErrorMessages, REPORTER* aActivity )
{
BOARD* pcb = GetBoard();
// If FL_RENDER_SHOW_HOLES_IN_ZONES is true, holes are correctly removed from copper zones areas.
// If FL_RENDER_SHOW_HOLES_IN_ZONES is false, holes are not removed from copper zones areas,
// but the calculation time is twice shorter.
bool remove_Holes = isEnabled( FL_RENDER_SHOW_HOLES_IN_ZONES );
bool realistic_mode = isRealisticMode();
bool useTextures = isRealisticMode() && isEnabled( FL_RENDER_TEXTURES );
// Number of segments to convert a circle to polygon
// We use 2 values: the first gives a good shape (for instanes rond pads)
// the second is used to speed up calculations, when a poor approximation is acceptable (holes)
const int segcountforcircle = 18;
double correctionFactor = 1.0 / cos( M_PI / (segcountforcircle * 2.0) );
const int segcountLowQuality = 12; // segments to draw a circle with low quality
// to reduce time calculations
// for holes and items which do not need
// a fine representation
double correctionFactorLQ = 1.0 / cos( M_PI / (segcountLowQuality * 2.0) );
SHAPE_POLY_SET bufferPolys; // copper areas: tracks, pads and filled zones areas
// when holes are removed from zones
SHAPE_POLY_SET bufferPcbOutlines; // stores the board main outlines
SHAPE_POLY_SET bufferZonesPolys; // copper filled zones areas
// when holes are not removed from zones
SHAPE_POLY_SET currLayerHoles; // Contains holes for the current layer
SHAPE_POLY_SET allLayerHoles; // Contains holes for all layers
// Build a polygon from edge cut items
wxString msg;
if( !pcb->GetBoardPolygonOutlines( bufferPcbOutlines, allLayerHoles, &msg ) )
{
if( aErrorMessages )
{
msg << wxT("\n") << _("Unable to calculate the board outlines.\n"
"Therefore use the board boundary box.") << wxT("\n\n");
aErrorMessages->Report( msg, REPORTER::RPT_WARNING );
}
}
// Build board holes, with optimization of large holes shape.
buildBoardThroughHolesPolygonList( allLayerHoles, segcountLowQuality, true );
LSET cu_set = LSET::AllCuMask( GetPrm3DVisu().m_CopperLayersCount );
glNewList( aBoardList, GL_COMPILE );
for( LSEQ cu = cu_set.CuStack(); cu; ++cu )
{
LAYER_ID layer = *cu;
// Skip non enabled layers in normal mode,
// and internal layers in realistic mode
if( !is3DLayerEnabled( layer ) )
continue;
if( aActivity )
aActivity->Report( wxString::Format( _( "Build layer %s" ), LSET::Name( layer ) ) );
bufferPolys.RemoveAllContours();
bufferZonesPolys.RemoveAllContours();
currLayerHoles.RemoveAllContours();
// Draw track shapes:
for( TRACK* track = pcb->m_Track; track; track = track->Next() )
{
if( !track->IsOnLayer( layer ) )
continue;
track->TransformShapeWithClearanceToPolygon( bufferPolys,
0, segcountforcircle,
correctionFactor );
// Add blind/buried via holes
if( track->Type() == PCB_VIA_T )
{
VIA *via = static_cast<VIA*>( track );
if( via->GetViaType() == VIA_THROUGH )
continue; // already done
int holediameter = via->GetDrillValue();
int thickness = GetPrm3DVisu().GetCopperThicknessBIU();
int hole_outer_radius = (holediameter + thickness) / 2;
TransformCircleToPolygon( currLayerHoles,
via->GetStart(), hole_outer_radius,
segcountLowQuality );
}
}
// draw pad shapes
for( MODULE* module = pcb->m_Modules; module; module = module->Next() )
{
// Note: NPTH pads are not drawn on copper layers when the pad
// has same shape as its hole
module->TransformPadsShapesWithClearanceToPolygon( layer,
bufferPolys,
0,
segcountforcircle,
correctionFactor, true );
// Micro-wave modules may have items on copper layers
module->TransformGraphicShapesWithClearanceToPolygonSet( layer,
bufferPolys,
0,
segcountforcircle,
correctionFactor );
// pad holes are already in list.
}
// Draw copper zones. Note:
// * if the holes are removed from copper zones
// the polygons are stored in bufferPolys (which contains all other polygons)
// * if the holes are NOT removed from copper zones
// the polygons are stored in bufferZonesPolys
if( isEnabled( FL_ZONE ) )
{
for( int ii = 0; ii < pcb->GetAreaCount(); ii++ )
{
ZONE_CONTAINER* zone = pcb->GetArea( ii );
LAYER_NUM zonelayer = zone->GetLayer();
if( zonelayer == layer )
{
zone->TransformSolidAreasShapesToPolygonSet(
remove_Holes ? bufferPolys : bufferZonesPolys,
segcountLowQuality, correctionFactorLQ );
}
}
}
// draw graphic items on copper layers (texts)
for( BOARD_ITEM* item = pcb->m_Drawings; item; item = item->Next() )
{
if( !item->IsOnLayer( layer ) )
continue;
switch( item->Type() )
{
case PCB_LINE_T: // should not exist on copper layers
( (DRAWSEGMENT*) item )->TransformShapeWithClearanceToPolygon(
bufferPolys, 0, segcountforcircle, correctionFactor );
break;
case PCB_TEXT_T:
( (TEXTE_PCB*) item )->TransformShapeWithClearanceToPolygonSet(
bufferPolys, 0, segcountLowQuality, correctionFactor );
break;
default:
break;
}
}
// bufferPolys contains polygons to merge. Many overlaps .
// Calculate merged polygons
if( bufferPolys.IsEmpty() )
continue;
// Use Clipper lib to subtract holes to copper areas
if( currLayerHoles.OutlineCount() )
{
currLayerHoles.Append(allLayerHoles);
currLayerHoles.Simplify( useFastModeForPolygons );
bufferPolys.BooleanSubtract( currLayerHoles, useFastModeForPolygons );
}
else
bufferPolys.BooleanSubtract( allLayerHoles, useFastModeForPolygons );
int thickness = GetPrm3DVisu().GetLayerObjectThicknessBIU( layer );
int zpos = GetPrm3DVisu().GetLayerZcoordBIU( layer );
float zNormal = 1.0f; // When using thickness it will draw first the top and then botton (with z inverted)
// If we are not using thickness, then the z-normal has to match the layer direction
// because just one plane will be drawn
if( !thickness )
zNormal = Get3DLayer_Z_Orientation( layer );
if( realistic_mode )
{
setGLCopperColor();
}
else
{
EDA_COLOR_T color = g_ColorsSettings.GetLayerColor( layer );
SetGLColor( color );
}
// If holes are removed from copper zones, bufferPolys contains all polygons
// to draw (tracks+zones+texts).
Draw3D_SolidHorizontalPolyPolygons( bufferPolys, zpos, thickness,
GetPrm3DVisu().m_BiuTo3Dunits, useTextures,
zNormal );
// If holes are not removed from copper zones (for calculation time reasons,
// the zone polygons are stored in bufferZonesPolys and have to be drawn now:
if( !bufferZonesPolys.IsEmpty() )
{
Draw3D_SolidHorizontalPolyPolygons( bufferZonesPolys, zpos, thickness,
GetPrm3DVisu().m_BiuTo3Dunits, useTextures,
zNormal );
}
}
if( aActivity )
aActivity->Report( _( "Build board body" ) );
// Draw plated vertical holes inside the board, but not always. They are drawn:
// - if the board body is not shown, to show the holes.
// - or if the copper thickness is shown
if( !isEnabled( FL_SHOW_BOARD_BODY ) || isEnabled( FL_USE_COPPER_THICKNESS ) )
{
// Draw vias holes (vertical cylinders)
for( const TRACK* track = pcb->m_Track; track; track = track->Next() )
{
if( track->Type() == PCB_VIA_T )
{
const VIA *via = static_cast<const VIA*>(track);
draw3DViaHole( via );
}
}
// Draw pads holes (vertical cylinders)
for( const MODULE* module = pcb->m_Modules; module; module = module->Next() )
{
for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() )
if( pad->GetAttribute () != PAD_ATTRIB_HOLE_NOT_PLATED )
draw3DPadHole( pad );
}
}
glEndList();
// Build the body board:
glNewList( aBodyOnlyList, GL_COMPILE );
if( isRealisticMode() )
{
setGLEpoxyColor( 1.00 );
}
else
{
EDA_COLOR_T color = g_ColorsSettings.GetLayerColor( Edge_Cuts );
SetGLColor( color, 0.7 );
}
float copper_thickness = GetPrm3DVisu().GetCopperThicknessBIU();
// a small offset between substrate and external copper layer to avoid artifacts
// when drawing copper items on board
float epsilon = Millimeter2iu( 0.01 );
float zpos = GetPrm3DVisu().GetLayerZcoordBIU( B_Cu );
float board_thickness = GetPrm3DVisu().GetLayerZcoordBIU( F_Cu )
- GetPrm3DVisu().GetLayerZcoordBIU( B_Cu );
// items on copper layers and having a thickness = copper_thickness
// are drawn from zpos - copper_thickness/2 to zpos + copper_thickness
// therefore substrate position is copper_thickness/2 to
// substrate_height - copper_thickness/2
zpos += (copper_thickness + epsilon) / 2.0f;
board_thickness -= copper_thickness + epsilon;
bufferPcbOutlines.BooleanSubtract( allLayerHoles, useFastModeForPolygons );
if( !bufferPcbOutlines.IsEmpty() )
{
Draw3D_SolidHorizontalPolyPolygons( bufferPcbOutlines, zpos + board_thickness / 2.0,
board_thickness, GetPrm3DVisu().m_BiuTo3Dunits, useTextures,
1.0f );
}
glEndList();
}
void EDA_3D_CANVAS::buildTechLayers3DView( REPORTER* aErrorMessages, REPORTER* aActivity )
{
BOARD* pcb = GetBoard();
bool useTextures = isRealisticMode() && isEnabled( FL_RENDER_TEXTURES );
// Number of segments to draw a circle using segments
const int segcountforcircle = 18;
double correctionFactor = 1.0 / cos( M_PI / (segcountforcircle * 2) );
const int segcountLowQuality = 12; // segments to draw a circle with low quality
// to reduce time calculations
// for holes and items which do not need
// a fine representation
double correctionFactorLQ = 1.0 / cos( M_PI / (segcountLowQuality * 2) );
// segments to draw a circle to build texts. Is is used only to build
// the shape of each segment of the stroke font, therefore no need to have
// many segments per circle.
const int segcountInStrokeFont = 8;
SHAPE_POLY_SET bufferPolys;
SHAPE_POLY_SET allLayerHoles; // Contains through holes, calculated only once
SHAPE_POLY_SET bufferPcbOutlines; // stores the board main outlines
// Build a polygon from edge cut items
wxString msg;
if( !pcb->GetBoardPolygonOutlines( bufferPcbOutlines, allLayerHoles, &msg ) )
{
if( aErrorMessages )
{
msg << wxT("\n") <<
_("Unable to calculate the board outlines.\n"
"Therefore use the board boundary box.") << wxT("\n\n");
aErrorMessages->Report( msg, REPORTER::RPT_WARNING );
}
}
// Build board holes, with no optimization of large holes shape.
buildBoardThroughHolesPolygonList( allLayerHoles, segcountLowQuality, false );
// draw graphic items, on technical layers
static const LAYER_ID teckLayerList[] = {
B_Adhes,
F_Adhes,
B_Paste,
F_Paste,
B_SilkS,
F_SilkS,
B_Mask,
F_Mask,
};
// User layers are not drawn here, only technical layers
for( LSEQ seq = LSET::AllTechMask().Seq( teckLayerList, DIM( teckLayerList ) ); seq; ++seq )
{
LAYER_ID layer = *seq;
if( !is3DLayerEnabled( layer ) )
continue;
if( layer == Edge_Cuts && isEnabled( FL_SHOW_BOARD_BODY ) )
continue;
if( aActivity )
aActivity->Report( wxString::Format( _( "Build layer %s" ), LSET::Name( layer ) ) );
bufferPolys.RemoveAllContours();
for( BOARD_ITEM* item = pcb->m_Drawings; item; item = item->Next() )
{
if( !item->IsOnLayer( layer ) )
continue;
switch( item->Type() )
{
case PCB_LINE_T:
( (DRAWSEGMENT*) item )->TransformShapeWithClearanceToPolygon(
bufferPolys, 0, segcountforcircle, correctionFactor );
break;
case PCB_TEXT_T:
( (TEXTE_PCB*) item )->TransformShapeWithClearanceToPolygonSet(
bufferPolys, 0, segcountLowQuality, 1.0 );
break;
default:
break;
}
}
for( MODULE* module = pcb->m_Modules; module; module = module->Next() )
{
if( layer == F_SilkS || layer == B_SilkS )
{
// On silk screen layers, the pad shape is only the pad outline
// never a filled shape
D_PAD* pad = module->Pads();
int linewidth = g_DrawDefaultLineThickness;
for( ; pad; pad = pad->Next() )
{
if( !pad->IsOnLayer( layer ) )
continue;
buildPadShapeThickOutlineAsPolygon( pad, bufferPolys,
linewidth, segcountforcircle, correctionFactor );
}
}
else
module->TransformPadsShapesWithClearanceToPolygon( layer,
bufferPolys, 0, segcountforcircle, correctionFactor );
// On tech layers, use a poor circle approximation, only for texts (stroke font)
module->TransformGraphicShapesWithClearanceToPolygonSet( layer,
bufferPolys, 0, segcountforcircle, correctionFactor, segcountInStrokeFont );
}
// Draw non copper zones
if( isEnabled( FL_ZONE ) )
{
for( int ii = 0; ii < pcb->GetAreaCount(); ii++ )
{
ZONE_CONTAINER* zone = pcb->GetArea( ii );
if( !zone->IsOnLayer( layer ) )
continue;
zone->TransformSolidAreasShapesToPolygonSet(
bufferPolys, segcountLowQuality, correctionFactorLQ );
}
}
// bufferPolys contains polygons to merge. Many overlaps .
// Calculate merged polygons and remove pads and vias holes
if( bufferPolys.IsEmpty() )
continue;
// Solder mask layers are "negative" layers.
// Shapes should be removed from the full board area.
if( layer == B_Mask || layer == F_Mask )
{
SHAPE_POLY_SET cuts = bufferPolys;
bufferPolys = bufferPcbOutlines;
cuts.Append(allLayerHoles);
cuts.Simplify( useFastModeForPolygons );
bufferPolys.BooleanSubtract( cuts, useFastModeForPolygons );
}
// Remove holes from Solder paste layers and silkscreen
else if( layer == B_Paste || layer == F_Paste
|| layer == B_SilkS || layer == F_SilkS )
{
bufferPolys.BooleanSubtract( allLayerHoles, useFastModeForPolygons );
}
int thickness = 0;
if( layer != B_Mask && layer != F_Mask )
thickness = GetPrm3DVisu().GetLayerObjectThicknessBIU( layer );
int zpos = GetPrm3DVisu().GetLayerZcoordBIU( layer );
if( layer == Edge_Cuts )
{
thickness = GetPrm3DVisu().GetLayerZcoordBIU( F_Cu )
- GetPrm3DVisu().GetLayerZcoordBIU( B_Cu );
zpos = GetPrm3DVisu().GetLayerZcoordBIU( B_Cu )
+ (thickness / 2);
}
else
{
// for Draw3D_SolidHorizontalPolyPolygons, zpos it the middle between bottom and top
// sides.
// However for top layers, zpos should be the bottom layer pos,
// and for bottom layers, zpos should be the top layer pos.
if( Get3DLayer_Z_Orientation( layer ) > 0 )
zpos += thickness/2;
else
zpos -= thickness/2 ;
}
float zNormal = 1.0f; // When using thickness it will draw first the top and then botton (with z inverted)
// If we are not using thickness, then the znormal must face the layer direction
// because it will draw just one plane
if( !thickness )
zNormal = Get3DLayer_Z_Orientation( layer );
setGLTechLayersColor( layer );
Draw3D_SolidHorizontalPolyPolygons( bufferPolys, zpos,
thickness, GetPrm3DVisu().m_BiuTo3Dunits, useTextures,
zNormal );
}
}
-493
View File
@@ -1,493 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 1992-2014 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file 3d_draw_helper_functions.cpp
*/
#include <fctsys.h>
#include <PolyLine.h>
#include <colors.h>
#include <colors_selection.h>
#include <class_pad.h>
#include <class_track.h>
#include <convert_basic_shapes_to_polygon.h>
#include <3d_viewer.h>
#include <3d_canvas.h>
#include <info3d_visu.h>
#include <3d_draw_basic_functions.h>
#define TEXTURE_PCB_SCALE 5.0
// -----------------
// helper function (from wxWidgets, opengl/cube.cpp sample
// -----------------
void CheckGLError(const char *aFileName, int aLineNumber)
{
GLenum errLast = GL_NO_ERROR;
for ( ; ; )
{
GLenum err = glGetError();
if ( err == GL_NO_ERROR )
return;
// normally the error is reset by the call to glGetError() but if
// glGetError() itself returns an error, we risk looping forever here
// so check that we get a different error than the last time
if ( err == errLast )
{
wxLogError(wxT("OpenGL error state couldn't be reset."));
return;
}
errLast = err;
wxLogError( wxT( "OpenGL error %d At: %s, line: %d" ), err,
GetChars( FROM_UTF8( aFileName ) ), aLineNumber );
}
}
INFO3D_VISU& EDA_3D_CANVAS::GetPrm3DVisu() const
{
return Parent()->GetPrm3DVisu();
}
wxSize EDA_3D_CANVAS::getBoardSize() const
{
// return the size of the board in pcb units
return GetPrm3DVisu().m_BoardSize;
}
wxPoint EDA_3D_CANVAS::getBoardCenter() const
{
// return the position of the board center in pcb units
return GetPrm3DVisu().m_BoardPos;
}
// return true if we are in realistic mode render
bool EDA_3D_CANVAS::isRealisticMode() const
{
return GetPrm3DVisu().IsRealisticMode();
}
// return true if aItem should be displayed
bool EDA_3D_CANVAS::isEnabled( DISPLAY3D_FLG aItem ) const
{
return GetPrm3DVisu().GetFlag( aItem );
}
// Helper function: initialize the copper color to draw the board
// in realistic mode.
void EDA_3D_CANVAS::setGLCopperColor()
{
glDisable( GL_TEXTURE_2D );
SetGLColor( GetPrm3DVisu().m_CopperColor, 1.0 );
}
// Helper function: initialize the color to draw the epoxy
// body board in realistic mode.
void EDA_3D_CANVAS::setGLEpoxyColor( float aTransparency )
{
// Generates an epoxy color, near board color
SetGLColor( GetPrm3DVisu().m_BoardBodyColor, aTransparency );
if( isEnabled( FL_RENDER_TEXTURES ) )
{
SetGLTexture( m_text_pcb, TEXTURE_PCB_SCALE );
}
}
// Helper function: initialize the color to draw the
// solder mask layers in realistic mode.
void EDA_3D_CANVAS::setGLSolderMaskColor( float aTransparency )
{
// Generates a solder mask color
SetGLColor( GetPrm3DVisu().m_SolderMaskColor, aTransparency );
if( isEnabled( FL_RENDER_TEXTURES ) )
{
SetGLTexture( m_text_pcb, TEXTURE_PCB_SCALE );
}
}
// Helper function: initialize the color to draw the non copper layers
// in realistic mode and normal mode.
void EDA_3D_CANVAS::setGLTechLayersColor( LAYER_NUM aLayer )
{
EDA_COLOR_T color;
if( isRealisticMode() )
{
switch( aLayer )
{
case B_Paste:
case F_Paste:
SetGLColor( GetPrm3DVisu().m_SolderPasteColor, 1 );
break;
case B_SilkS:
case F_SilkS:
SetGLColor( GetPrm3DVisu().m_SilkScreenColor, 0.96 );
if( isEnabled( FL_RENDER_TEXTURES ) )
{
SetGLTexture( m_text_silk, 10.0f );
}
break;
case B_Mask:
case F_Mask:
setGLSolderMaskColor( 0.90 );
break;
default:
color = g_ColorsSettings.GetLayerColor( aLayer );
SetGLColor( color, 0.7 );
break;
}
}
else
{
color = g_ColorsSettings.GetLayerColor( aLayer );
SetGLColor( color, 0.7 );
}
}
void EDA_3D_CANVAS::draw3DAxis()
{
if( ! m_glLists[GL_ID_AXIS] )
{
m_glLists[GL_ID_AXIS] = glGenLists( 1 );
glNewList( m_glLists[GL_ID_AXIS], GL_COMPILE );
glEnable( GL_COLOR_MATERIAL );
glBegin( GL_LINES );
SetGLColor( RED );
glNormal3f( 0.0f, 0.0f, 1.0f ); // Normal is Z axis
glVertex3f( 0.0f, 0.0f, 0.0f );
glVertex3f( -10.0f, 0.0f, 0.0f );
glVertex3f( 0.0f, 0.0f, 0.0f );
glVertex3f( 10.0f, 0.0f, 0.0f ); // X axis
SetGLColor( GREEN );
glVertex3f( 0.0f, 0.0f, 0.0f );
glVertex3f( 0.0f, -10.0f, 0.0f ); // Y axis
glVertex3f( 0.0f, 0.0f, 0.0f );
glVertex3f( 0.0f, 10.0f, 0.0f );
SetGLColor( BLUE );
glNormal3f( 1.0f, 0.0f, 0.0f ); // Normal is Y axis
glVertex3f( 0.0f, 0.0f, 0.0f );
glVertex3f( 0.0f, 0.0f, -10.0f );
glVertex3f( 0.0f, 0.0f, 0.0f );
glVertex3f( 0.0f, 0.0f, 10.0f ); // Z axis
glEnd();
glEndList();
}
}
// draw a 3D grid: an horizontal grid (XY plane and Z = 0,
// and a vertical grid (XZ plane and Y = 0)
void EDA_3D_CANVAS::draw3DGrid( double aGriSizeMM )
{
double zpos = 0.0;
EDA_COLOR_T gridcolor = DARKGRAY; // Color of grid lines
EDA_COLOR_T gridcolor_marker = LIGHTGRAY; // Color of grid lines every 5 lines
const double scale = GetPrm3DVisu().m_BiuTo3Dunits;
const double transparency = 0.3;
glNormal3f( 0.0, 0.0, 1.0 );
wxSize brd_size = getBoardSize();
wxPoint brd_center_pos = getBoardCenter();
brd_center_pos.y = -brd_center_pos.y;
int xsize = std::max( brd_size.x, Millimeter2iu( 100 ) ) * 1.2;
int ysize = std::max( brd_size.y, Millimeter2iu( 100 ) ) * 1.2;
// Grid limits, in 3D units
double xmin = (brd_center_pos.x - xsize / 2) * scale;
double xmax = (brd_center_pos.x + xsize / 2) * scale;
double ymin = (brd_center_pos.y - ysize / 2) * scale;
double ymax = (brd_center_pos.y + ysize / 2) * scale;
double zmin = Millimeter2iu( -50 ) * scale;
double zmax = Millimeter2iu( 100 ) * scale;
// Draw horizontal grid centered on 3D origin (center of the board)
for( int ii = 0; ; ii++ )
{
if( (ii % 5) )
SetGLColor( gridcolor, transparency );
else
SetGLColor( gridcolor_marker, transparency );
int delta = KiROUND( ii * aGriSizeMM * IU_PER_MM );
if( delta <= xsize / 2 ) // Draw grid lines parallel to X axis
{
glBegin( GL_LINES );
glVertex3f( (brd_center_pos.x + delta) * scale, -ymin, zpos );
glVertex3f( (brd_center_pos.x + delta) * scale, -ymax, zpos );
glEnd();
if( ii != 0 )
{
glBegin( GL_LINES );
glVertex3f( (brd_center_pos.x - delta) * scale, -ymin, zpos );
glVertex3f( (brd_center_pos.x - delta) * scale, -ymax, zpos );
glEnd();
}
}
if( delta <= ysize / 2 ) // Draw grid lines parallel to Y axis
{
glBegin( GL_LINES );
glVertex3f( xmin, -(brd_center_pos.y + delta) * scale, zpos );
glVertex3f( xmax, -(brd_center_pos.y + delta) * scale, zpos );
glEnd();
if( ii != 0 )
{
glBegin( GL_LINES );
glVertex3f( xmin, -(brd_center_pos.y - delta) * scale, zpos );
glVertex3f( xmax, -(brd_center_pos.y - delta) * scale, zpos );
glEnd();
}
}
if( ( delta > ysize / 2 ) && ( delta > xsize / 2 ) )
break;
}
// Draw vertical grid on Z axis
glNormal3f( 0.0, -1.0, 0.0 );
// Draw vertical grid lines (parallel to Z axis)
double posy = -brd_center_pos.y * scale;
for( int ii = 0; ; ii++ )
{
if( (ii % 5) )
SetGLColor( gridcolor, transparency );
else
SetGLColor( gridcolor_marker, transparency );
double delta = ii * aGriSizeMM * IU_PER_MM;
glBegin( GL_LINES );
xmax = (brd_center_pos.x + delta) * scale;
glVertex3f( xmax, posy, zmin );
glVertex3f( xmax, posy, zmax );
glEnd();
if( ii != 0 )
{
glBegin( GL_LINES );
xmin = (brd_center_pos.x - delta) * scale;
glVertex3f( xmin, posy, zmin );
glVertex3f( xmin, posy, zmax );
glEnd();
}
if( delta > xsize / 2.0f )
break;
}
// Draw horizontal grid lines on Z axis (parallel to X axis)
for( int ii = 0; ; ii++ )
{
if( (ii % 5) )
SetGLColor( gridcolor, transparency);
else
SetGLColor( gridcolor_marker, transparency );
double delta = ii * aGriSizeMM * IU_PER_MM * scale;
if( delta <= zmax )
{
// Draw grid lines on Z axis (positive Z axis coordinates)
glBegin( GL_LINES );
glVertex3f( xmin, posy, delta );
glVertex3f( xmax, posy, delta );
glEnd();
}
if( delta <= -zmin && ( ii != 0 ) )
{
// Draw grid lines on Z axis (negative Z axis coordinates)
glBegin( GL_LINES );
glVertex3f( xmin, posy, -delta );
glVertex3f( xmax, posy, -delta );
glEnd();
}
if( ( delta > zmax ) && ( delta > -zmin ) )
break;
}
}
// Draw 3D pads.
void EDA_3D_CANVAS::draw3DPadHole( const D_PAD* aPad )
{
// Draw the pad hole
wxSize drillsize = aPad->GetDrillSize();
bool hasHole = drillsize.x && drillsize.y;
if( !hasHole )
return;
// Store here the points to approximate hole by segments
SHAPE_POLY_SET holecornersBuffer;
int thickness = GetPrm3DVisu().GetCopperThicknessBIU();
int height = GetPrm3DVisu().GetLayerZcoordBIU( F_Cu ) -
GetPrm3DVisu().GetLayerZcoordBIU( B_Cu );
if( isRealisticMode() )
setGLCopperColor();
else
SetGLColor( DARKGRAY );
int holeZpoz = GetPrm3DVisu().GetLayerZcoordBIU( B_Cu ) - thickness / 2;
int holeHeight = height + thickness;
if( drillsize.x == drillsize.y ) // usual round hole
{
int hole_radius = ( drillsize.x + thickness ) / 2;
Draw3D_ZaxisCylinder( aPad->GetPosition(),
hole_radius, holeHeight,
thickness, holeZpoz, GetPrm3DVisu().m_BiuTo3Dunits );
}
else // Oblong hole
{
wxPoint ends_offset;
int width;
if( drillsize.x > drillsize.y ) // Horizontal oval
{
ends_offset.x = ( drillsize.x - drillsize.y ) / 2;
width = drillsize.y;
}
else // Vertical oval
{
ends_offset.y = ( drillsize.y - drillsize.x ) / 2;
width = drillsize.x;
}
RotatePoint( &ends_offset, aPad->GetOrientation() );
wxPoint start = aPad->GetPosition() + ends_offset;
wxPoint end = aPad->GetPosition() - ends_offset;
int hole_radius = ( width + thickness ) / 2;
// Draw the hole
Draw3D_ZaxisOblongCylinder( start, end, hole_radius, holeHeight,
thickness, holeZpoz, GetPrm3DVisu().m_BiuTo3Dunits );
}
}
void EDA_3D_CANVAS::draw3DViaHole( const VIA* aVia )
{
LAYER_ID top_layer, bottom_layer;
int thickness = GetPrm3DVisu().GetCopperThicknessBIU();
int inner_radius = (int)((float)aVia->GetDrillValue() * 1.01f) / 2.0f; // This add a bit more in order to correct a draw artifact while using tickness
aVia->LayerPair( &top_layer, &bottom_layer );
// Drawing via hole:
if( isRealisticMode() )
setGLCopperColor();
else
{
EDA_COLOR_T color = g_ColorsSettings.GetItemColor( VIAS_VISIBLE + aVia->GetViaType() );
SetGLColor( color );
}
int height = GetPrm3DVisu().GetLayerZcoordBIU( top_layer ) -
GetPrm3DVisu().GetLayerZcoordBIU( bottom_layer ) + thickness;
int zpos = GetPrm3DVisu().GetLayerZcoordBIU( bottom_layer ) - thickness / 2;
Draw3D_ZaxisCylinder( aVia->GetStart(), inner_radius, height,
thickness, zpos, GetPrm3DVisu().m_BiuTo3Dunits );
}
/* Build a pad outline as non filled polygon, to draw pads on silkscreen layer
* Used only to draw pads outlines on silkscreen layers.
*/
void EDA_3D_CANVAS::buildPadShapeThickOutlineAsPolygon( const D_PAD* aPad,
SHAPE_POLY_SET& aCornerBuffer,
int aWidth,
int aCircleToSegmentsCount,
double aCorrectionFactor )
{
if( aPad->GetShape() == PAD_SHAPE_CIRCLE ) // Draw a ring
{
TransformRingToPolygon( aCornerBuffer, aPad->ShapePos(),
aPad->GetSize().x / 2, aCircleToSegmentsCount, aWidth );
return;
}
// For other shapes, draw polygon outlines
SHAPE_POLY_SET corners;
aPad->BuildPadShapePolygon( corners, wxSize( 0, 0 ),
aCircleToSegmentsCount, aCorrectionFactor );
// Add outlines as thick segments in polygon buffer
const SHAPE_LINE_CHAIN& path = corners.COutline( 0 );
for( int ii = 0; ii < path.PointCount(); ii++ )
{
const VECTOR2I& a = path.CPoint( ii );
const VECTOR2I& b = path.CPoint( ii + 1 );
TransformRoundedEndsSegmentToPolygon( aCornerBuffer,
wxPoint( a.x, a.y ),
wxPoint( b.x, b.y ),
aCircleToSegmentsCount, aWidth );
}
}
GLfloat Get3DLayer_Z_Orientation( LAYER_NUM aLayer )
{
double nZ = 1.0;
if( ( aLayer == B_Cu )
|| ( aLayer == B_Adhes )
|| ( aLayer == B_Paste )
|| ( aLayer == B_SilkS )
|| ( aLayer == B_Mask ) )
nZ = -1.0;
return nZ;
}
+91 -471
View File
@@ -5,7 +5,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -28,7 +28,6 @@
#include <fctsys.h>
#include <kiface_i.h>
#include <pgm_base.h>
#include <macros.h>
#include <3d_viewer.h>
#include <3d_canvas.h>
@@ -45,40 +44,7 @@ INFO3D_VISU g_Parm_3D_Visu;
static const wxChar keyBgColor_Red[] = wxT( "BgColor_Red" );
static const wxChar keyBgColor_Green[] = wxT( "BgColor_Green" );
static const wxChar keyBgColor_Blue[] = wxT( "BgColor_Blue" );
static const wxChar keyBgColor_Red_Top[] = wxT( "BgColor_Red_Top" );
static const wxChar keyBgColor_Green_Top[] = wxT( "BgColor_Green_Top" );
static const wxChar keyBgColor_Blue_Top[] = wxT( "BgColor_Blue_Top" );
static const wxChar keySMaskColor_Red[] = wxT( "SMaskColor_Red" );
static const wxChar keySMaskColor_Green[] = wxT( "SMaskColor_Green" );
static const wxChar keySMaskColor_Blue[] = wxT( "SMaskColor_Blue" );
static const wxChar keySPasteColor_Red[] = wxT( "SPasteColor_Red" );
static const wxChar keySPasteColor_Green[] = wxT( "SPasteColor_Green" );
static const wxChar keySPasteColor_Blue[] = wxT( "SPasteColor_Blue" );
static const wxChar keySilkColor_Red[] = wxT( "SilkColor_Red" );
static const wxChar keySilkColor_Green[] = wxT( "SilkColor_Green" );
static const wxChar keySilkColor_Blue[] = wxT( "SilkColor_Blue" );
static const wxChar keyCopperColor_Red[] = wxT( "CopperColor_Red" );
static const wxChar keyCopperColor_Green[] = wxT( "CopperColor_Green" );
static const wxChar keyCopperColor_Blue[] = wxT( "CopperColor_Blue" );
static const wxChar keyBoardBodyColor_Red[] = wxT( "BoardBodyColor_Red" );
static const wxChar keyBoardBodyColor_Green[] = wxT( "BoardBodyColor_Green" );
static const wxChar keyBoardBodyColor_Blue[]= wxT( "BoardBodyColor_Blue" );
static const wxChar keyShowRealisticMode[] = wxT( "ShowRealisticMode" );
static const wxChar keyRenderShadows[] = wxT( "Render_Shadows" );
static const wxChar keyRenderRemoveHoles[] = wxT( "Render_RemoveHoles" );
static const wxChar keyRenderTextures[] = wxT( "Render_Textures" );
static const wxChar keyRenderSmoothNormals[] = wxT( "Render_Smooth_Normals" );
static const wxChar keyRenderUseModelNormals[] =wxT( "Render_Use_Model_Normals" );
static const wxChar keyRenderMaterial[] = wxT( "Render_Material" );
static const wxChar keyRenderShowModelBBox[] = wxT( "Render_ShowModelBoudingBoxes" );
static const wxChar keyShowAxis[] = wxT( "ShowAxis" );
static const wxChar keyShowGrid[] = wxT( "ShowGrid3D" );
static const wxChar keyShowGridSize[] = wxT( "Grid3DSize" );
@@ -131,74 +97,16 @@ EDA_3D_FRAME::EDA_3D_FRAME( KIWAY* aKiway, PCB_BASE_FRAME* aParent,
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
// Create the status line
static const int status_dims[4] = { -1, 130, 130, 170 };
static const int dims[5] = { -1, 100, 100, 100, 140 };
CreateStatusBar( DIM( status_dims ) );
SetStatusWidths( DIM( status_dims ), status_dims );
CreateStatusBar( 5 );
SetStatusWidths( 5, dims );
CreateMenuBar();
ReCreateMainToolbar();
// Make a EDA_3D_CANVAS
// Note: We try to use anti aliasing if the graphic card allows that,
// but only on wxWidgets >= 3.0.0 (this option does not exist on wxWidgets 2.8)
int attrs[] = { // This array should be 2*n+1
// Sadly wxwidgets / glx < 13 allowed
// a thing named "boolean attributes" that don't take a value.
// (See src/unix/glx11.cpp -> wxGLCanvasX11::ConvertWXAttrsToGL() ).
// To avoid problems due to this, just specify those attributes twice.
// Only WX_GL_RGBA, WX_GL_DOUBLEBUFFER, WX_GL_STEREO are such boolean
// attributes.
// Boolean attributes (using itself at padding):
WX_GL_RGBA, WX_GL_RGBA,
WX_GL_DOUBLEBUFFER, WX_GL_DOUBLEBUFFER,
// Normal attributes with values:
WX_GL_DEPTH_SIZE, 16,
WX_GL_STENCIL_SIZE, 1,
WX_GL_SAMPLE_BUFFERS, 1, // Enable multisampling support (antialiasing).
WX_GL_SAMPLES, 0, // Disable AA for the start.
0 }; // NULL termination
// Check if the canvas supports multisampling.
if( EDA_3D_CANVAS::IsDisplaySupported( attrs ) )
{
// Check for possible sample sizes, start form the top.
int maxSamples = 8; // Any higher doesn't change anything.
int samplesOffset = 0;
for( unsigned int ii = 0; ii < DIM( attrs ); ii += 2 )
{
if( attrs[ii] == WX_GL_SAMPLES )
{
samplesOffset = ii+1;
break;
}
}
attrs[samplesOffset] = maxSamples;
for( ; maxSamples > 0 && !EDA_3D_CANVAS::IsDisplaySupported( attrs );
maxSamples = maxSamples>>1 )
{
attrs[samplesOffset] = maxSamples;
}
}
else
{
// Disable multisampling
for( unsigned int ii = 0; ii < DIM( attrs ); ii += 2 )
{
if( attrs[ii] == WX_GL_SAMPLE_BUFFERS )
{
attrs[ii+1] = 0;
break;
}
}
}
int attrs[] = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, WX_GL_DEPTH_SIZE, 16, 0 };
m_canvas = new EDA_3D_CANVAS( this, attrs );
m_auimgr.SetManagedWindow( this );
@@ -241,66 +149,16 @@ void EDA_3D_FRAME::LoadSettings( wxConfigBase* aCfg )
{
EDA_BASE_FRAME::LoadSettings( aCfg );
INFO3D_VISU& prms = GetPrm3DVisu();
INFO3D_VISU& prms = g_Parm_3D_Visu;
aCfg->Read( keyBgColor_Red, &GetPrm3DVisu().m_BgColor.m_Red, 0.4 );
aCfg->Read( keyBgColor_Green, &GetPrm3DVisu().m_BgColor.m_Green, 0.4 );
aCfg->Read( keyBgColor_Blue, &GetPrm3DVisu().m_BgColor.m_Blue, 0.5 );
aCfg->Read( keyBgColor_Red_Top, &GetPrm3DVisu().m_BgColor_Top.m_Red, 0.8 );
aCfg->Read( keyBgColor_Green_Top, &GetPrm3DVisu().m_BgColor_Top.m_Green, 0.8 );
aCfg->Read( keyBgColor_Blue_Top, &GetPrm3DVisu().m_BgColor_Top.m_Blue, 0.9 );
// m_SolderMaskColor default value = dark grey-green
aCfg->Read( keySMaskColor_Red, &GetPrm3DVisu().m_SolderMaskColor.m_Red, 100.0 * 0.2 / 255.0 );
aCfg->Read( keySMaskColor_Green, &GetPrm3DVisu().m_SolderMaskColor.m_Green, 255.0 * 0.2 / 255.0 );
aCfg->Read( keySMaskColor_Blue, &GetPrm3DVisu().m_SolderMaskColor.m_Blue, 180.0 * 0.2 / 255.0 );
// m_SolderPasteColor default value = light grey
aCfg->Read( keySPasteColor_Red, &GetPrm3DVisu().m_SolderPasteColor.m_Red, 128.0 /255.0 );
aCfg->Read( keySPasteColor_Green, &GetPrm3DVisu().m_SolderPasteColor.m_Green, 128.0 /255.0 );
aCfg->Read( keySPasteColor_Blue, &GetPrm3DVisu().m_SolderPasteColor.m_Blue, 128.0 /255.0 );
// m_SilkScreenColor default value = white
aCfg->Read( keySilkColor_Red, &GetPrm3DVisu().m_SilkScreenColor.m_Red, 0.9 );
aCfg->Read( keySilkColor_Green, &GetPrm3DVisu().m_SilkScreenColor.m_Green, 0.9 );
aCfg->Read( keySilkColor_Blue, &GetPrm3DVisu().m_SilkScreenColor.m_Blue, 0.9 );
// m_CopperColor default value = gold
aCfg->Read( keyCopperColor_Red, &GetPrm3DVisu().m_CopperColor.m_Red, 255.0 * 0.7 / 255.0 );
aCfg->Read( keyCopperColor_Green, &GetPrm3DVisu().m_CopperColor.m_Green, 223.0 * 0.7 / 255.0 );
aCfg->Read( keyCopperColor_Blue, &GetPrm3DVisu().m_CopperColor.m_Blue, 0.0 /255.0 );
// m_BoardBodyColor default value = FR4, in realistic mode
aCfg->Read( keyBoardBodyColor_Red, &GetPrm3DVisu().m_BoardBodyColor.m_Red, 51.0 / 255.0 );
aCfg->Read( keyBoardBodyColor_Green, &GetPrm3DVisu().m_BoardBodyColor.m_Green, 43.0 / 255.0 );
aCfg->Read( keyBoardBodyColor_Blue, &GetPrm3DVisu().m_BoardBodyColor.m_Blue, 22.0 /255.0 );
aCfg->Read( keyBgColor_Red, &g_Parm_3D_Visu.m_BgColor.m_Red, 0.0 );
aCfg->Read( keyBgColor_Green, &g_Parm_3D_Visu.m_BgColor.m_Green, 0.0 );
aCfg->Read( keyBgColor_Blue, &g_Parm_3D_Visu.m_BgColor.m_Blue, 0.0 );
bool tmp;
aCfg->Read( keyShowRealisticMode, &tmp, false );
prms.SetFlag( FL_USE_REALISTIC_MODE, tmp );
aCfg->Read( keyRenderShadows, &tmp, false );
prms.SetFlag( FL_RENDER_SHADOWS, tmp );
aCfg->Read( keyRenderRemoveHoles, &tmp, false );
prms.SetFlag( FL_RENDER_SHOW_HOLES_IN_ZONES, tmp );
aCfg->Read( keyRenderTextures, &tmp, false );
prms.SetFlag( FL_RENDER_TEXTURES, tmp );
aCfg->Read( keyRenderSmoothNormals, &tmp, false );
prms.SetFlag( FL_RENDER_SMOOTH_NORMALS, tmp );
aCfg->Read( keyRenderUseModelNormals, &tmp, false );
prms.SetFlag( FL_RENDER_USE_MODEL_NORMALS, tmp );
aCfg->Read( keyRenderMaterial, &tmp, false );
prms.SetFlag( FL_RENDER_MATERIAL, tmp );
aCfg->Read( keyRenderShowModelBBox, &tmp, false );
prms.SetFlag( FL_RENDER_SHOW_MODEL_BBOX, tmp );
aCfg->Read( keyShowAxis, &tmp, true );
prms.SetFlag( FL_AXIS, tmp );
@@ -308,6 +166,7 @@ void EDA_3D_FRAME::LoadSettings( wxConfigBase* aCfg )
prms.SetFlag( FL_GRID, tmp );
aCfg->Read( keyShowGridSize, &prms.m_3D_Grid, 10.0 );
prms.SetFlag( FL_MODULE, tmp );
aCfg->Read( keyShowFootprints, &tmp, true );
prms.SetFlag( FL_MODULE, tmp );
@@ -345,59 +204,25 @@ void EDA_3D_FRAME::SaveSettings( wxConfigBase* aCfg )
{
EDA_BASE_FRAME::SaveSettings( aCfg );
INFO3D_VISU& prms = GetPrm3DVisu();
INFO3D_VISU& prms = g_Parm_3D_Visu;
aCfg->Write( keyBgColor_Red, GetPrm3DVisu().m_BgColor.m_Red );
aCfg->Write( keyBgColor_Green, GetPrm3DVisu().m_BgColor.m_Green );
aCfg->Write( keyBgColor_Blue, GetPrm3DVisu().m_BgColor.m_Blue );
aCfg->Write( keyBgColor_Red_Top, GetPrm3DVisu().m_BgColor_Top.m_Red );
aCfg->Write( keyBgColor_Green_Top, GetPrm3DVisu().m_BgColor_Top.m_Green );
aCfg->Write( keyBgColor_Blue_Top, GetPrm3DVisu().m_BgColor_Top.m_Blue );
aCfg->Write( keySMaskColor_Red, GetPrm3DVisu().m_SolderMaskColor.m_Red );
aCfg->Write( keySMaskColor_Green, GetPrm3DVisu().m_SolderMaskColor.m_Green );
aCfg->Write( keySMaskColor_Blue, GetPrm3DVisu().m_SolderMaskColor.m_Blue );
aCfg->Write( keySPasteColor_Red, GetPrm3DVisu().m_SolderPasteColor.m_Red );
aCfg->Write( keySPasteColor_Green, GetPrm3DVisu().m_SolderPasteColor.m_Green );
aCfg->Write( keySPasteColor_Blue, GetPrm3DVisu().m_SolderPasteColor.m_Blue );
aCfg->Write( keySilkColor_Red, GetPrm3DVisu().m_SilkScreenColor.m_Red );
aCfg->Write( keySilkColor_Green, GetPrm3DVisu().m_SilkScreenColor.m_Green );
aCfg->Write( keySilkColor_Blue, GetPrm3DVisu().m_SilkScreenColor.m_Blue );
aCfg->Write( keyCopperColor_Red, GetPrm3DVisu().m_CopperColor.m_Red );
aCfg->Write( keyCopperColor_Green, GetPrm3DVisu().m_CopperColor.m_Green );
aCfg->Write( keyCopperColor_Blue, GetPrm3DVisu().m_CopperColor.m_Blue );
aCfg->Write( keyBoardBodyColor_Red, GetPrm3DVisu().m_BoardBodyColor.m_Red );
aCfg->Write( keyBoardBodyColor_Green, GetPrm3DVisu().m_BoardBodyColor.m_Green );
aCfg->Write( keyBoardBodyColor_Blue, GetPrm3DVisu().m_BoardBodyColor.m_Blue );
aCfg->Write( keyShowRealisticMode, prms.GetFlag( FL_USE_REALISTIC_MODE ) );
aCfg->Write( keyRenderShadows, prms.GetFlag( FL_RENDER_SHADOWS ) );
aCfg->Write( keyRenderRemoveHoles, prms.GetFlag( FL_RENDER_SHOW_HOLES_IN_ZONES ) );
aCfg->Write( keyRenderTextures, prms.GetFlag( FL_RENDER_TEXTURES ) );
aCfg->Write( keyRenderSmoothNormals, prms.GetFlag( FL_RENDER_SMOOTH_NORMALS ) );
aCfg->Write( keyRenderUseModelNormals, prms.GetFlag( FL_RENDER_USE_MODEL_NORMALS ) );
aCfg->Write( keyRenderMaterial, prms.GetFlag( FL_RENDER_MATERIAL ) );
aCfg->Write( keyRenderShowModelBBox, prms.GetFlag( FL_RENDER_SHOW_MODEL_BBOX ) );
aCfg->Write( keyShowAxis, prms.GetFlag( FL_AXIS ) );
aCfg->Write( keyShowGrid, prms.GetFlag( FL_GRID ) );
aCfg->Write( keyShowGridSize, prms.m_3D_Grid );
aCfg->Write( keyShowFootprints, prms.GetFlag( FL_MODULE ) );
aCfg->Write( keyShowCopperThickness, prms.GetFlag( FL_USE_COPPER_THICKNESS ) );
aCfg->Write( keyShowZones, prms.GetFlag( FL_ZONE ) );
aCfg->Write( keyShowAdhesiveLayers, prms.GetFlag( FL_ADHESIVE ) );
aCfg->Write( keyShowSilkScreenLayers, prms.GetFlag( FL_SILKSCREEN ) );
aCfg->Write( keyShowSolderMaskLayers, prms.GetFlag( FL_SOLDERMASK ) );
aCfg->Write( keyShowSolderPasteLayers, prms.GetFlag( FL_SOLDERPASTE ) );
aCfg->Write( keyShowCommentsLayer, prms.GetFlag( FL_COMMENTS ) );
aCfg->Write( keyShowEcoLayers, prms.GetFlag( FL_ECO ) );
aCfg->Write( keyShowBoardBody, prms.GetFlag( FL_SHOW_BOARD_BODY ) );
aCfg->Write( keyBgColor_Red, g_Parm_3D_Visu.m_BgColor.m_Red );
aCfg->Write( keyBgColor_Green, g_Parm_3D_Visu.m_BgColor.m_Green );
aCfg->Write( keyBgColor_Blue, g_Parm_3D_Visu.m_BgColor.m_Blue );
aCfg->Write( keyShowRealisticMode, prms.GetFlag( FL_USE_REALISTIC_MODE ) );
aCfg->Write( keyShowAxis, prms.GetFlag( FL_AXIS ) );
aCfg->Write( keyShowGrid, prms.GetFlag( FL_GRID ) );
aCfg->Write( keyShowGridSize, prms.m_3D_Grid );
aCfg->Write( keyShowFootprints, prms.GetFlag( FL_MODULE ) );
aCfg->Write( keyShowCopperThickness, prms.GetFlag( FL_USE_COPPER_THICKNESS ) );
aCfg->Write( keyShowZones, prms.GetFlag( FL_ZONE ) );
aCfg->Write( keyShowAdhesiveLayers, prms.GetFlag( FL_ADHESIVE ) );
aCfg->Write( keyShowSilkScreenLayers, prms.GetFlag( FL_SILKSCREEN ) );
aCfg->Write( keyShowSolderMaskLayers, prms.GetFlag( FL_SOLDERMASK ) );
aCfg->Write( keyShowSolderPasteLayers, prms.GetFlag( FL_SOLDERPASTE ) );
aCfg->Write( keyShowCommentsLayer, prms.GetFlag( FL_COMMENTS ) );
aCfg->Write( keyShowEcoLayers, prms.GetFlag( FL_ECO ) );
aCfg->Write( keyShowBoardBody, prms.GetFlag( FL_SHOW_BOARD_BODY ) );
}
@@ -410,23 +235,23 @@ void EDA_3D_FRAME::Process_Zoom( wxCommandEvent& event )
case ID_ZOOM_PAGE:
for( ii = 0; ii < 4; ii++ )
GetPrm3DVisu().m_Rot[ii] = 0.0;
g_Parm_3D_Visu.m_Rot[ii] = 0.0;
GetPrm3DVisu().m_Zoom = 1.0;
g_Parm_3D_Visu.m_Zoom = 1.0;
m_canvas->SetOffset( 0.0, 0.0 );
trackball( GetPrm3DVisu().m_Quat, 0.0, 0.0, 0.0, 0.0 );
trackball( g_Parm_3D_Visu.m_Quat, 0.0, 0.0, 0.0, 0.0 );
break;
case ID_ZOOM_IN:
GetPrm3DVisu().m_Zoom /= 1.2;
g_Parm_3D_Visu.m_Zoom /= 1.2;
if( GetPrm3DVisu().m_Zoom <= 0.01 )
GetPrm3DVisu().m_Zoom = 0.01;
if( g_Parm_3D_Visu.m_Zoom <= 0.01 )
g_Parm_3D_Visu.m_Zoom = 0.01;
break;
case ID_ZOOM_OUT:
GetPrm3DVisu().m_Zoom *= 1.2;
g_Parm_3D_Visu.m_Zoom *= 1.2;
break;
case ID_ZOOM_REDRAW:
@@ -475,33 +300,32 @@ void EDA_3D_FRAME::Process_Special_Functions( wxCommandEvent& event )
break;
case ID_RELOAD3D_BOARD:
m_reloadRequest = true;
NewDisplay();
return;
break;
case ID_ROTATE3D_X_POS:
GetPrm3DVisu().m_ROTX += ROT_ANGLE;
g_Parm_3D_Visu.m_ROTX += ROT_ANGLE;
break;
case ID_ROTATE3D_X_NEG:
GetPrm3DVisu().m_ROTX -= ROT_ANGLE;
g_Parm_3D_Visu.m_ROTX -= ROT_ANGLE;
break;
case ID_ROTATE3D_Y_POS:
GetPrm3DVisu().m_ROTY += ROT_ANGLE;
g_Parm_3D_Visu.m_ROTY += ROT_ANGLE;
break;
case ID_ROTATE3D_Y_NEG:
GetPrm3DVisu().m_ROTY -= ROT_ANGLE;
g_Parm_3D_Visu.m_ROTY -= ROT_ANGLE;
break;
case ID_ROTATE3D_Z_POS:
GetPrm3DVisu().m_ROTZ += ROT_ANGLE;
g_Parm_3D_Visu.m_ROTZ += ROT_ANGLE;
break;
case ID_ROTATE3D_Z_NEG:
GetPrm3DVisu().m_ROTZ -= ROT_ANGLE;
g_Parm_3D_Visu.m_ROTZ -= ROT_ANGLE;
break;
case ID_MOVE3D_LEFT:
@@ -530,133 +354,68 @@ void EDA_3D_FRAME::Process_Special_Functions( wxCommandEvent& event )
m_canvas->TakeScreenshot( event );
break;
case ID_MENU3D_BGCOLOR_BOTTOM_SELECTION:
if( Set3DColorFromUser( GetPrm3DVisu().m_BgColor, _( "Background Color, Bottom" ) ) )
m_canvas->Refresh( true );
case ID_MENU3D_BGCOLOR_SELECTION:
Set3DBgColor();
return;
case ID_MENU3D_BGCOLOR_TOP_SELECTION:
if( Set3DColorFromUser( GetPrm3DVisu().m_BgColor_Top, _( "Background Color, Top" ) ) )
m_canvas->Refresh( true );
return;
case ID_MENU3D_SILKSCREEN_COLOR_SELECTION:
Set3DSilkScreenColorFromUser();
return;
case ID_MENU3D_SOLDERMASK_COLOR_SELECTION:
Set3DSolderMaskColorFromUser();
return;
case ID_MENU3D_SOLDERPASTE_COLOR_SELECTION:
Set3DSolderPasteColorFromUser();
return;
case ID_MENU3D_COPPER_COLOR_SELECTION:
Set3DCopperColorFromUser();
break;
case ID_MENU3D_PCB_BODY_COLOR_SELECTION:
Set3DBoardBodyColorFromUser();
break;
case ID_MENU3D_REALISTIC_MODE:
GetPrm3DVisu().SetFlag( FL_USE_REALISTIC_MODE, isChecked );
GetMenuBar()->FindItem( ID_MENU3D_COMMENTS_ONOFF )->Enable( !isChecked );
GetMenuBar()->FindItem( ID_MENU3D_ECO_ONOFF )->Enable( !isChecked );
NewDisplay();
return;
case ID_MENU3D_FL_RENDER_SHADOWS:
GetPrm3DVisu().SetFlag( FL_RENDER_SHADOWS, isChecked );
NewDisplay();
return;
case ID_MENU3D_FL_RENDER_SHOW_HOLES_IN_ZONES:
GetPrm3DVisu().SetFlag( FL_RENDER_SHOW_HOLES_IN_ZONES, isChecked );
NewDisplay();
return;
case ID_MENU3D_FL_RENDER_TEXTURES:
GetPrm3DVisu().SetFlag( FL_RENDER_TEXTURES, isChecked );
NewDisplay(GL_ID_BOARD);
NewDisplay(GL_ID_TECH_LAYERS);
return;
case ID_MENU3D_FL_RENDER_SMOOTH_NORMALS:
GetPrm3DVisu().SetFlag( FL_RENDER_SMOOTH_NORMALS, isChecked );
NewDisplay();
return;
case ID_MENU3D_FL_RENDER_USE_MODEL_NORMALS:
GetPrm3DVisu().SetFlag( FL_RENDER_USE_MODEL_NORMALS, isChecked );
NewDisplay();
return;
case ID_MENU3D_FL_RENDER_MATERIAL:
GetPrm3DVisu().SetFlag( FL_RENDER_MATERIAL, isChecked );
NewDisplay();
return;
case ID_MENU3D_FL_RENDER_SHOW_MODEL_BBOX:
GetPrm3DVisu().SetFlag( FL_RENDER_SHOW_MODEL_BBOX, isChecked );
g_Parm_3D_Visu.SetFlag( FL_USE_REALISTIC_MODE, isChecked );
NewDisplay();
return;
case ID_MENU3D_SHOW_BOARD_BODY:
GetPrm3DVisu().SetFlag( FL_SHOW_BOARD_BODY, isChecked );
g_Parm_3D_Visu.SetFlag( FL_SHOW_BOARD_BODY, isChecked );
NewDisplay();
return;
case ID_MENU3D_AXIS_ONOFF:
GetPrm3DVisu().SetFlag( FL_AXIS, isChecked );
g_Parm_3D_Visu.SetFlag( FL_AXIS, isChecked );
m_canvas->Refresh();
return;
case ID_MENU3D_MODULE_ONOFF:
GetPrm3DVisu().SetFlag( FL_MODULE, isChecked );
g_Parm_3D_Visu.SetFlag( FL_MODULE, isChecked );
m_canvas->Refresh();
return;
case ID_MENU3D_USE_COPPER_THICKNESS:
GetPrm3DVisu().SetFlag( FL_USE_COPPER_THICKNESS, isChecked );
NewDisplay( GL_ID_BOARD );
NewDisplay( GL_ID_TECH_LAYERS );
g_Parm_3D_Visu.SetFlag( FL_USE_COPPER_THICKNESS, isChecked );
NewDisplay(GL_ID_BOARD);
return;
case ID_MENU3D_ZONE_ONOFF:
GetPrm3DVisu().SetFlag( FL_ZONE, isChecked );
NewDisplay( GL_ID_BOARD );
g_Parm_3D_Visu.SetFlag( FL_ZONE, isChecked );
NewDisplay(GL_ID_BOARD);
return;
case ID_MENU3D_ADHESIVE_ONOFF:
GetPrm3DVisu().SetFlag( FL_ADHESIVE, isChecked );
NewDisplay( GL_ID_TECH_LAYERS );
g_Parm_3D_Visu.SetFlag( FL_ADHESIVE, isChecked );
NewDisplay(GL_ID_TECH_LAYERS);
return;
case ID_MENU3D_SILKSCREEN_ONOFF:
GetPrm3DVisu().SetFlag( FL_SILKSCREEN, isChecked );
NewDisplay( GL_ID_TECH_LAYERS );
g_Parm_3D_Visu.SetFlag( FL_SILKSCREEN, isChecked );
NewDisplay(GL_ID_TECH_LAYERS);
return;
case ID_MENU3D_SOLDER_MASK_ONOFF:
GetPrm3DVisu().SetFlag( FL_SOLDERMASK, isChecked );
NewDisplay( GL_ID_TECH_LAYERS );
g_Parm_3D_Visu.SetFlag( FL_SOLDERMASK, isChecked );
NewDisplay(GL_ID_TECH_LAYERS);
return;
case ID_MENU3D_SOLDER_PASTE_ONOFF:
GetPrm3DVisu().SetFlag( FL_SOLDERPASTE, isChecked );
NewDisplay( GL_ID_TECH_LAYERS );
g_Parm_3D_Visu.SetFlag( FL_SOLDERPASTE, isChecked );
NewDisplay(GL_ID_TECH_LAYERS);
return;
case ID_MENU3D_COMMENTS_ONOFF:
GetPrm3DVisu().SetFlag( FL_COMMENTS, isChecked );
NewDisplay( GL_ID_AUX_LAYERS );
g_Parm_3D_Visu.SetFlag( FL_COMMENTS, isChecked );
NewDisplay(GL_ID_AUX_LAYERS);
return;
case ID_MENU3D_ECO_ONOFF:
GetPrm3DVisu().SetFlag( FL_ECO, isChecked );
NewDisplay( GL_ID_AUX_LAYERS );
g_Parm_3D_Visu.SetFlag( FL_ECO, isChecked );
NewDisplay(GL_ID_AUX_LAYERS);
return;
default:
@@ -673,7 +432,7 @@ void EDA_3D_FRAME::On3DGridSelection( wxCommandEvent& event )
{
int id = event.GetId();
for( int ii = ID_MENU3D_GRID_NOGRID; ii < ID_MENU3D_GRID_END; ii++ )
for( int ii = ID_MENU3D_GRID; ii < ID_MENU3D_GRID_END; ii++ )
{
if( event.GetId() == ii )
continue;
@@ -684,27 +443,27 @@ void EDA_3D_FRAME::On3DGridSelection( wxCommandEvent& event )
switch( id )
{
case ID_MENU3D_GRID_NOGRID:
GetPrm3DVisu().SetFlag( FL_GRID, false );
g_Parm_3D_Visu.SetFlag( FL_GRID, false );
break;
case ID_MENU3D_GRID_10_MM:
GetPrm3DVisu().SetFlag( FL_GRID, true );
GetPrm3DVisu().m_3D_Grid = 10.0;
g_Parm_3D_Visu.SetFlag( FL_GRID, true );
g_Parm_3D_Visu.m_3D_Grid = 10.0;
break;
case ID_MENU3D_GRID_5_MM:
GetPrm3DVisu().SetFlag( FL_GRID, true );
GetPrm3DVisu().m_3D_Grid = 5.0;
g_Parm_3D_Visu.SetFlag( FL_GRID, true );
g_Parm_3D_Visu.m_3D_Grid = 5.0;
break;
case ID_MENU3D_GRID_2P5_MM:
GetPrm3DVisu().SetFlag( FL_GRID, true );
GetPrm3DVisu().m_3D_Grid = 2.5;
g_Parm_3D_Visu.SetFlag( FL_GRID, true );
g_Parm_3D_Visu.m_3D_Grid = 2.5;
break;
case ID_MENU3D_GRID_1_MM:
GetPrm3DVisu().SetFlag( FL_GRID, true );
GetPrm3DVisu().m_3D_Grid = 1.0;
g_Parm_3D_Visu.SetFlag( FL_GRID, true );
g_Parm_3D_Visu.m_3D_Grid = 1.0;
break;
default:
@@ -716,24 +475,21 @@ void EDA_3D_FRAME::On3DGridSelection( wxCommandEvent& event )
}
void EDA_3D_FRAME::NewDisplay( int aGlList )
void EDA_3D_FRAME::NewDisplay( GLuint aGlList )
{
m_canvas->ClearLists( aGlList );
m_reloadRequest = false;
// Rebuild the 3D board and refresh the view on reload request:
if( m_reloadRequest )
m_canvas->ReportWarnings( true );
m_canvas->ClearLists( aGlList );
m_canvas->CreateDrawGL_List();
m_canvas->Refresh( true );
m_canvas->DisplayStatus();
m_reloadRequest = false;
}
void EDA_3D_FRAME::OnActivate( wxActivateEvent& event )
{
// Reload data if 3D frame shows a board,
// Reload data if 3D frame shows a footprint,
// because it can be changed since last frame activation
if( m_reloadRequest )
NewDisplay();
@@ -744,166 +500,30 @@ void EDA_3D_FRAME::OnActivate( wxActivateEvent& event )
/* called to set the background color of the 3D scene
*/
bool EDA_3D_FRAME::Set3DColorFromUser( S3D_COLOR &aColor, const wxString& aTitle,
wxColourData* aPredefinedColors )
void EDA_3D_FRAME::Set3DBgColor()
{
wxColour newcolor, oldcolor;
S3D_COLOR color;
wxColour newcolor, oldcolor;
oldcolor.Set( KiROUND( aColor.m_Red * 255 ),
KiROUND( aColor.m_Green * 255 ),
KiROUND( aColor.m_Blue * 255 ) );
oldcolor.Set( KiROUND( g_Parm_3D_Visu.m_BgColor.m_Red * 255 ),
KiROUND( g_Parm_3D_Visu.m_BgColor.m_Green * 255 ),
KiROUND( g_Parm_3D_Visu.m_BgColor.m_Blue * 255 ) );
wxColourData emptyColorSet; // Provides a empty predefined set of colors
// if no color set available to avoid use of an
// old color set
newcolor = wxGetColourFromUser( this, oldcolor );
if( aPredefinedColors == NULL )
aPredefinedColors = &emptyColorSet;
newcolor = wxGetColourFromUser( this, oldcolor, aTitle, aPredefinedColors );
if( !newcolor.IsOk() ) // Cancel command
return false;
if( !newcolor.IsOk() ) // Happens on cancel dialog
return;
if( newcolor != oldcolor )
{
aColor.m_Red = (double) newcolor.Red() / 255.0;
aColor.m_Green = (double) newcolor.Green() / 255.0;
aColor.m_Blue = (double) newcolor.Blue() / 255.0;
g_Parm_3D_Visu.m_BgColor.m_Red = (double) newcolor.Red() / 255.0;
g_Parm_3D_Visu.m_BgColor.m_Green = (double) newcolor.Green() / 255.0;
g_Parm_3D_Visu.m_BgColor.m_Blue = (double) newcolor.Blue() / 255.0;
NewDisplay();
}
return true;
}
/* called to set the silkscreen color. Sets up a number of default colors
*/
bool EDA_3D_FRAME::Set3DSilkScreenColorFromUser()
{
wxColourData definedColors;
definedColors.SetCustomColour(0, wxColour( 241, 241, 241 ) ); // White
definedColors.SetCustomColour(1, wxColour( 180, 180, 180 ) ); // Gray
bool change = Set3DColorFromUser( GetPrm3DVisu().m_SilkScreenColor,
_( "Silk Screen Color" ),
&definedColors );
if( change )
NewDisplay( GL_ID_TECH_LAYERS );
return change;
}
/* called to set the soldermask color. Sets up a number of default colors
*/
bool EDA_3D_FRAME::Set3DSolderMaskColorFromUser()
{
wxColourData definedColors;
definedColors.SetCustomColour(0, wxColour( 20, 51, 36 ) ); // Green
definedColors.SetCustomColour(1, wxColour( 43, 10, 65 ) ); // Purple
definedColors.SetCustomColour(2, wxColour( 117, 19, 21 ) ); // Red
definedColors.SetCustomColour(3, wxColour( 54, 79, 116) ); // Light blue
definedColors.SetCustomColour(4, wxColour( 11, 11, 11 ) ); // Black
definedColors.SetCustomColour(5, wxColour( 241, 241,241) ); // White
bool change = Set3DColorFromUser( GetPrm3DVisu().m_SolderMaskColor,
_( "Solder Mask Color" ),
&definedColors );
if( change )
NewDisplay( GL_ID_TECH_LAYERS );
return change;
}
/* called to set the copper surface color. Sets up a number of default colors
*/
bool EDA_3D_FRAME::Set3DCopperColorFromUser()
{
wxColourData definedColors;
definedColors.SetCustomColour( 0, wxColour( 184, 115, 50 ) ); // Copper
definedColors.SetCustomColour( 1, wxColour( 233, 221, 82 ) ); // Gold
definedColors.SetCustomColour( 2, wxColour( 213, 213, 213) ); // Silver
definedColors.SetCustomColour( 3, wxColour( 160, 160, 160) ); // tin
bool change = Set3DColorFromUser( GetPrm3DVisu().m_CopperColor,
_( "Copper Color" ),
&definedColors );
if( change )
NewDisplay( GL_ID_BOARD );
return change;
}
/* called to set the board body color. Sets up a number of default colors
*/
bool EDA_3D_FRAME::Set3DBoardBodyColorFromUser()
{
wxColourData definedColors;
definedColors.SetCustomColour( 0, wxColour( 51, 43, 22 ) ); // FR4 natural, dark
definedColors.SetCustomColour( 1, wxColour( 109, 116, 75 ) ); // FR4 natural
definedColors.SetCustomColour( 2, wxColour( 78, 14, 5 ) ); // brown/red
definedColors.SetCustomColour( 3, wxColour( 146, 99, 47 ) ); // brown 1
definedColors.SetCustomColour( 4, wxColour( 160, 123, 54 ) ); // brown 2
definedColors.SetCustomColour( 5, wxColour( 146, 99, 47 ) ); // brown 3
definedColors.SetCustomColour( 6, wxColour( 63, 126, 71 ) ); // green 1
definedColors.SetCustomColour( 7, wxColour( 117, 122, 90 ) ); // green 2
bool change = Set3DColorFromUser( GetPrm3DVisu().m_BoardBodyColor,
_( "Board Body Color" ),
&definedColors );
if( change )
NewDisplay( GL_ID_BOARD );
return change;
}
/* called to set the solder paste layer color. Sets up a number of default colors
*/
bool EDA_3D_FRAME::Set3DSolderPasteColorFromUser()
{
wxColourData definedColors;
definedColors.SetCustomColour(0, wxColour( 128, 128, 128 ) ); // grey
definedColors.SetCustomColour(1, wxColour( 213, 213, 213 ) ); // Silver
definedColors.SetCustomColour(2, wxColour( 90, 90, 90 ) ); // grey 2
bool change = Set3DColorFromUser( GetPrm3DVisu().m_SolderPasteColor,
_( "Solder Paste Color" ),
&definedColors );
if( change )
NewDisplay( GL_ID_TECH_LAYERS );
return change;
}
BOARD* EDA_3D_FRAME::GetBoard()
{
return Parent()->GetBoard();
}
INFO3D_VISU& EDA_3D_FRAME::GetPrm3DVisu() const
{
// return the INFO3D_VISU which contains the current parameters
// to draw the 3D view of the board
return g_Parm_3D_Visu;
}
bool EDA_3D_FRAME::IsEnabled( DISPLAY3D_FLG aItem ) const
{
// return true if aItem must be displayed
return GetPrm3DVisu().GetFlag( aItem );
}
-156
View File
@@ -1,156 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2014-2015 Mario Luzeiro <mrluzeiro@gmail.com>
* Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file 3d_class.cpp
*/
#include <fctsys.h>
#include <3d_struct.h>
#include <3d_material.h>
#include <info3d_visu.h>
#ifdef __WXMAC__
# ifdef __DARWIN__
# include <OpenGL/glu.h>
# else
# include <glu.h>
# endif
#else
# include <GL/glu.h>
#endif
S3D_MATERIAL::S3D_MATERIAL( S3D_MASTER* father, const wxString& name ) :
EDA_ITEM( father, NOT_USED )
{
m_Name = name;
m_AmbientColor.clear();
m_DiffuseColor.clear();
m_EmissiveColor.clear();
m_SpecularColor.clear();
m_Shininess.clear();
m_Transparency.clear();
m_ColorPerVertex = false;
}
void SetOpenGlDefaultMaterial()
{
glm::vec4 ambient( 0.2f, 0.2f, 0.2f, 1.0f );
glm::vec4 specular( 0.0f, 0.0f, 0.0f, 1.0f );
glm::vec4 emissive( 0.0f, 0.0f, 0.0f, 1.0f );
glm::vec4 diffuse( 0.0f, 0.0f, 0.0f, 1.0f );
GLint shininess_value = 0;
glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE );
glMateriali ( GL_FRONT_AND_BACK, GL_SHININESS, shininess_value );
glMaterialfv( GL_FRONT_AND_BACK, GL_EMISSION, &emissive.x );
glMaterialfv( GL_FRONT_AND_BACK, GL_SPECULAR, &specular.x );
glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT, &ambient.x );
glMaterialfv( GL_FRONT_AND_BACK, GL_DIFFUSE, &diffuse.x );
}
bool S3D_MATERIAL::SetOpenGLMaterial( unsigned int aMaterialIndex, bool aUseMaterial )
{
if( aUseMaterial )
{
float transparency_value = 0.0f;
if( m_Transparency.size() > aMaterialIndex )
{
transparency_value = m_Transparency[aMaterialIndex];
}
else
{
if( m_Transparency.size() > 0 )
transparency_value = m_Transparency[0];
}
if( m_DiffuseColor.size() > aMaterialIndex )
{
glm::vec3 color = m_DiffuseColor[aMaterialIndex];
glColor4f( color.x, color.y, color.z, 1.0f - transparency_value );
}
else
{
if( m_DiffuseColor.size() == 0 )
{
glColor4f( 0.8f, 0.8f, 0.8f, 1.0f );
}
}
if( m_Shininess.size() > 0 )
{
glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, m_Shininess[0] );
}
// emissive
if( m_EmissiveColor.size() > aMaterialIndex )
{
glm::vec4 emissive;
emissive[0] = m_EmissiveColor[aMaterialIndex].x;
emissive[1] = m_EmissiveColor[aMaterialIndex].y;
emissive[2] = m_EmissiveColor[aMaterialIndex].z;
emissive[3] = 1.0f;
glMaterialfv( GL_FRONT_AND_BACK, GL_EMISSION, &emissive.x );
}
// specular
if( m_SpecularColor.size() > aMaterialIndex )
{
glm::vec4 specular;
specular[0] = m_SpecularColor[aMaterialIndex].x;
specular[1] = m_SpecularColor[aMaterialIndex].y;
specular[2] = m_SpecularColor[aMaterialIndex].z;
specular[3] = 1.0f;
glMaterialfv( GL_FRONT_AND_BACK, GL_SPECULAR, &specular.x );
}
// ambient
if( m_AmbientColor.size() > aMaterialIndex )
{
glm::vec4 ambient;
ambient[0] = m_AmbientColor[aMaterialIndex].x;
ambient[1] = m_AmbientColor[aMaterialIndex].y;
ambient[2] = m_AmbientColor[aMaterialIndex].z;
ambient[3] = 1.0f;
glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT, &ambient.x );
}
return (transparency_value != 0.0f);
}
else
{
if( m_DiffuseColor.size() > aMaterialIndex )
{
glm::vec3 color = m_DiffuseColor[aMaterialIndex];
glColor4f( color.x, color.y, color.z, 1.0 );
}
}
return false;
}
-83
View File
@@ -1,83 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2014-2015 Mario Luzeiro <mrluzeiro@gmail.com>
* Copyright (C) 1992-2014 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file 3d_material.h
*/
#ifndef STRUCT_3D_MATERIAL_H
#define STRUCT_3D_MATERIAL_H
#include <common.h>
#include <base_struct.h>
#define GLM_FORCE_RADIANS
#include <gal/opengl/glm/glm.hpp>
class S3D_MASTER;
class S3D_MATERIAL : public EDA_ITEM // openGL "material" data
{
public:
wxString m_Name;
// Material list
std::vector< glm::vec3 > m_AmbientColor;
std::vector< glm::vec3 > m_DiffuseColor;
std::vector< glm::vec3 > m_EmissiveColor;
std::vector< glm::vec3 > m_SpecularColor;
std::vector< float > m_Shininess;
std::vector< float > m_Transparency;
bool m_ColorPerVertex;
public:
S3D_MATERIAL( S3D_MASTER* father, const wxString& name );
S3D_MATERIAL* Next() const { return (S3D_MATERIAL*) Pnext; }
S3D_MATERIAL* Back() const { return (S3D_MATERIAL*) Pback; }
/**
* Initialize the material prms.
* @param aMaterialIndex = the index in list of available materials
* @param aUseMaterial = true to use the values found in the available material
* = false to use only the color, and other prms are fixed
* @return true if the material is transparency
*/
bool SetOpenGLMaterial(unsigned int aMaterialIndex, bool aUseMaterial);
#if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
#endif
/** Get class name
* @return string "S3D_MATERIAL"
*/
virtual wxString GetClass() const
{
return wxT( "S3D_MATERIAL" );
}
};
void SetOpenGlDefaultMaterial();
#endif
File diff suppressed because it is too large Load Diff
-107
View File
@@ -1,107 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2014-2015 Mario Luzeiro <mrluzeiro@gmail.com>
* Copyright (C) 1992-2014 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file 3d_mesh_model.h
* @brief
*/
#ifndef __3D_MESH_MODEL_H__
#define __3D_MESH_MODEL_H__
#include <memory>
#include <boost/shared_ptr.hpp>
#include <vector>
#define GLM_FORCE_RADIANS
#include <gal/opengl/glm/glm.hpp>
#include "3d_struct.h"
#include "3d_material.h"
#include "CBBox.h"
class S3D_MESH;
/** A smart pointer to an S3D_MESH object */
typedef boost::shared_ptr<S3D_MESH> S3D_MESH_PTR;
/** A container of smar S3D_MESH object pointers */
typedef std::vector<S3D_MESH_PTR> S3D_MESH_PTRS;
class S3D_MESH
{
public:
S3D_MESH();
~S3D_MESH();
void openGL_RenderAllChilds( bool aIsRenderingJustNonTransparentObjects,
bool aIsRenderingJustTransparentObjects );
S3D_MATERIAL *m_Materials;
// Point and index list
std::vector< S3D_VERTEX > m_Point;
std::vector< std::vector<int> > m_CoordIndex;
std::vector< std::vector<int> > m_NormalIndex;
std::vector< S3D_VERTEX > m_PerFaceColor;
std::vector< S3D_VERTEX > m_PerFaceNormalsNormalized;
std::vector< S3D_VERTEX > m_PerVertexNormalsNormalized;
std::vector< int > m_MaterialIndexPerFace;
std::vector< std::vector<int> > m_MaterialIndexPerVertex;
S3D_MESH_PTRS childs;
S3D_VERTEX m_translation;
glm::vec4 m_rotation;
S3D_VERTEX m_scale;
CBBOX &getBBox();
private:
std::vector< S3D_VERTEX > m_PerFaceNormalsRaw_X_PerFaceSquaredArea;
std::vector< std::vector< S3D_VERTEX > > m_PerFaceVertexNormals;
std::vector< S3D_VERTEX > m_PointNormalized;
std::vector< std::vector<int> > m_InvalidCoordIndexes; //!TODO: check for invalid CoordIndex in file and remove the index and the same material index
bool isPerFaceNormalsComputed;
void calcPerFaceNormals ();
bool isPointNormalizedComputed;
void calcPointNormalized();
bool isPerPointNormalsComputed;
void calcPerPointNormals();
bool isPerVertexNormalsVerified;
void perVertexNormalsVerify_and_Repair();
void calcBBox();
void calcBBoxAllChilds();
CBBOX m_BBox;
void openGL_Render( bool aIsRenderingJustNonTransparentObjects,
bool aIsRenderingJustTransparentObjects );
};
#endif
+72 -119
View File
@@ -1,10 +1,9 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015 Mario Luzeiro <mrluzeiro@gmail.com>
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras@wanadoo.fr
* Copyright (C) 2012 Jean-Pierre Charras, jp.charras@wanadoo.fr
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -33,32 +32,70 @@
#include <macros.h>
#include <kicad_string.h>
#include <pgm_base.h>
#define GLM_FORCE_RADIANS
#include <gal/opengl/glm/gtc/matrix_transform.hpp>
#include <3d_viewer.h>
#include <info3d_visu.h>
#include "3d_struct.h"
#include "modelparsers.h"
S3D_MODEL_PARSER *S3D_MODEL_PARSER::Create( S3D_MASTER* aMaster,
S3D_MODEL_PARSER* S3D_MODEL_PARSER::Create( S3D_MASTER* aMaster,
const wxString aExtension )
{
if ( aExtension == wxT( "x3d" ) )
{
return new X3D_MODEL_PARSER( aMaster );
}
else if ( aExtension == wxT( "wrl" ) )
{
return new VRML_MODEL_PARSER( aMaster );
}
else
{
return NULL;
}
}
return NULL;
}
int S3D_MASTER::ReadData( S3D_MODEL_PARSER* aParser )
const wxString S3D_MASTER::GetShape3DFullFilename()
{
if( m_Shape3DFullFilename.IsEmpty() || aParser == NULL )
return -1;
wxString filename = m_Shape3DFullFilename;
wxString shapeName;
// Expand any environment variables embedded in footprint's m_Shape3DName field.
// To ensure compatibility with most of footprint's m_Shape3DName field,
// if the m_Shape3DName is not an absolute path the default path
// given by the environment variable KISYS3DMOD will be used
if( m_Shape3DName.StartsWith( wxT("${") ) )
shapeName = wxExpandEnvVars( m_Shape3DName );
else
shapeName = m_Shape3DName;
wxFileName fn( shapeName );
if( fn.IsAbsolute() || shapeName.StartsWith( wxT(".") ) )
return shapeName;
wxString default_path;
wxGetEnv( wxT( KISYS3DMOD ), &default_path );
if( default_path.IsEmpty() )
return shapeName;
if( !default_path.EndsWith( wxT("/") ) && !default_path.EndsWith( wxT("\\") ) )
default_path += wxT("/");
default_path += shapeName;
return default_path;
}
int S3D_MASTER::ReadData()
{
if( m_Shape3DName.IsEmpty() )
return 1;
wxString filename = GetShape3DFullFilename();
#ifdef __WINDOWS__
filename.Replace( wxT( "/" ), wxT( "\\" ) );
@@ -66,114 +103,30 @@ int S3D_MASTER::ReadData( S3D_MODEL_PARSER* aParser )
filename.Replace( wxT( "\\" ), wxT( "/" ) );
#endif
if( wxFileName::FileExists( filename ) )
if( !wxFileName::FileExists( filename ) )
{
wxFileName fn( filename );
if( aParser->Load( filename ) )
{
// Invalidate bounding boxes
m_fastAABBox.Reset();
m_BBox.Reset();
m_parser = aParser;
return 0;
}
wxLogDebug( wxT( "3D shape '%s' not found, even tried '%s' after env var substitution." ),
GetChars( m_Shape3DName ),
GetChars( filename )
);
return -1;
}
wxLogDebug( wxT( "3D shape '%s' not found, even tried '%s' after env var substitution." ),
GetChars( m_Shape3DName ),
GetChars( filename ) );
wxFileName fn( filename );
wxString extension = fn.GetExt();
S3D_MODEL_PARSER* parser = S3D_MODEL_PARSER::Create( this, extension );
if( parser )
{
parser->Load( filename );
delete parser;
return 0;
}
else
{
wxLogDebug( wxT( "Unknown file type '%s'" ), GetChars( extension ) );
}
return -1;
}
void S3D_MASTER::Render( bool aIsRenderingJustNonTransparentObjects,
bool aIsRenderingJustTransparentObjects )
{
if( m_parser == NULL )
return;
double aVrmlunits_to_3Dunits = g_Parm_3D_Visu.m_BiuTo3Dunits * UNITS3D_TO_UNITSPCB;
glScalef( aVrmlunits_to_3Dunits, aVrmlunits_to_3Dunits, aVrmlunits_to_3Dunits );
glTranslatef( m_MatPosition.x * SCALE_3D_CONV,
m_MatPosition.y * SCALE_3D_CONV,
m_MatPosition.z * SCALE_3D_CONV );
glRotatef( -m_MatRotation.z, 0.0f, 0.0f, 1.0f );
glRotatef( -m_MatRotation.y, 0.0f, 1.0f, 0.0f );
glRotatef( -m_MatRotation.x, 1.0f, 0.0f, 0.0f );
glScalef( m_MatScale.x, m_MatScale.y, m_MatScale.z );
for( unsigned int idx = 0; idx < m_parser->childs.size(); idx++ )
m_parser->childs[idx]->openGL_RenderAllChilds( aIsRenderingJustNonTransparentObjects,
aIsRenderingJustTransparentObjects );
}
CBBOX &S3D_MASTER::getBBox( )
{
if( !m_BBox.IsInitialized() )
calcBBox();
return m_BBox;
}
CBBOX &S3D_MASTER::getFastAABBox( )
{
if( !m_fastAABBox.IsInitialized() )
calcBBox();
return m_fastAABBox;
}
void S3D_MASTER::calcBBox()
{
if( m_parser == NULL )
return;
bool firstBBox = true;
for( unsigned int idx = 0; idx < m_parser->childs.size(); idx++ )
if( firstBBox )
{
firstBBox = false;
m_BBox = m_parser->childs[idx]->getBBox();
}
else
m_BBox.Union( m_parser->childs[idx]->getBBox() );
// Calc transformation matrix to apply in AABBox
float aVrmlunits_to_3Dunits = g_Parm_3D_Visu.m_BiuTo3Dunits * UNITS3D_TO_UNITSPCB;
glm::mat4 fullTransformMatrix;
fullTransformMatrix = glm::scale( glm::mat4(), S3D_VERTEX( aVrmlunits_to_3Dunits,
aVrmlunits_to_3Dunits,
aVrmlunits_to_3Dunits ) );
fullTransformMatrix = glm::translate( fullTransformMatrix, S3D_VERTEX( m_MatPosition.x * SCALE_3D_CONV,
m_MatPosition.y * SCALE_3D_CONV,
m_MatPosition.z * SCALE_3D_CONV) );
if( m_MatRotation.z != 0.0 )
fullTransformMatrix = glm::rotate( fullTransformMatrix, glm::radians(-(float)m_MatRotation.z), S3D_VERTEX( 0.0f, 0.0f, 1.0f ) );
if( m_MatRotation.y != 0.0 )
fullTransformMatrix = glm::rotate( fullTransformMatrix, glm::radians(-(float)m_MatRotation.y), S3D_VERTEX( 0.0f, 1.0f, 0.0f ) );
if( m_MatRotation.x != 0.0 )
fullTransformMatrix = glm::rotate( fullTransformMatrix, glm::radians(-(float)m_MatRotation.x), S3D_VERTEX( 1.0f, 0.0f, 0.0f ) );
fullTransformMatrix = glm::scale( fullTransformMatrix, S3D_VERTEX( m_MatScale.x, m_MatScale.y, m_MatScale.z ) );
// Apply transformation
m_fastAABBox = m_BBox;
m_fastAABBox.ApplyTransformationAA( fullTransformMatrix );
}
+107 -61
View File
@@ -1,8 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2014-2015 Mario Luzeiro <mrluzeiro@gmail.com>
* Copyright (C) 2004 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
*
@@ -33,25 +32,71 @@
#include <common.h>
#include <base_struct.h>
#include <3d_material.h>
#include <3d_types.h>
#include <CBBox.h>
/* 3D modeling units -> PCB units conversion scale:
* 1 "3D model unit" wings3d = 1 unit = 2.54 mm = 0.1 inch = 100 mils
*/
#define UNITS3D_TO_UNITSPCB (IU_PER_MILS * 100)
class S3D_MASTER;
class STRUCT_3D_SHAPE;
class S3D_MODEL_PARSER;
// Master structure for a 3D footprint shape description
/* S3D_VERTEX manages a 3D coordinate (3 float numbers: x,y,z coordinates)*/
class S3D_VERTEX
{
public:
double x, y, z;
public:
S3D_VERTEX()
{
x = y = z = 0.0;
}
S3D_VERTEX( double px, double py, double pz)
{
x = px;
y = py;
z = pz;
}
};
class S3D_MATERIAL : public EDA_ITEM /* openGL "material" data*/
{
public:
wxString m_Name;
S3D_VERTEX m_DiffuseColor;
S3D_VERTEX m_EmissiveColor;
S3D_VERTEX m_SpecularColor;
float m_AmbientIntensity;
float m_Transparency;
float m_Shininess;
public:
S3D_MATERIAL( S3D_MASTER* father, const wxString& name );
S3D_MATERIAL* Next() const { return (S3D_MATERIAL*) Pnext; }
S3D_MATERIAL* Back() const { return (S3D_MATERIAL*) Pback; }
void SetMaterial();
#if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
#endif
};
/* Master structure for a 3D item description */
class S3D_MASTER : public EDA_ITEM
{
public:
S3DPOINT m_MatScale; ///< a scaling factor for the entire 3D footprint shape
S3DPOINT m_MatRotation; ///< a grotation for the entire 3D footprint shape
S3DPOINT m_MatPosition; ///< an offset for the entire 3D footprint shape
STRUCT_3D_SHAPE* m_3D_Drawings; ///< the list of basic shapes
S3D_MATERIAL* m_Materials; ///< the list of materiels used by the shapes
S3D_MODEL_PARSER* m_parser; ///< it store the loaded file to be rendered later
S3D_VERTEX m_MatScale;
S3D_VERTEX m_MatRotation;
S3D_VERTEX m_MatPosition;
STRUCT_3D_SHAPE* m_3D_Drawings;
S3D_MATERIAL* m_Materials;
enum FILE3D_TYPE
{
@@ -61,19 +106,13 @@ public:
FILE3D_UNKNOWN
};
// Check defaults in S3D_MASTER
bool m_use_modelfile_diffuseColor;
bool m_use_modelfile_emissiveColor;
bool m_use_modelfile_specularColor;
bool m_use_modelfile_ambientIntensity;
bool m_use_modelfile_transparency;
bool m_use_modelfile_shininess;
private:
wxString m_Shape3DName; ///< The 3D shape filename in 3D library
FILE3D_TYPE m_ShapeType; ///< Shape type based on filename extension
wxString m_Shape3DFullFilename; ///< Full file path name
wxString m_Shape3DNameExtension; ///< Extension of the shape file name
wxString m_Shape3DName; /* 3D shape name in 3D library */
FILE3D_TYPE m_ShapeType;
double m_lastTransparency; // last transparency value from
// last material in use
bool m_loadTransparentObjects;
bool m_loadNonTransparentObjects;
public:
S3D_MASTER( EDA_ITEM* aParent );
@@ -83,20 +122,32 @@ public:
S3D_MASTER* Back() const { return (S3D_MASTER*) Pback; }
// Accessors
void SetLastTransparency( double aValue ) { m_lastTransparency = aValue; }
void SetLoadTransparentObjects( bool aLoad )
{ m_loadTransparentObjects = aLoad; }
void SetLoadNonTransparentObjects( bool aLoad )
{ m_loadNonTransparentObjects = aLoad; }
void Insert( S3D_MATERIAL* aMaterial );
/**
* Function IsOpenGlAllowed
* @return true if opengl current list accepts a gl data
* used to filter transparent objects, which are drawn after
* non transparent objects
*/
bool IsOpenGlAllowed();
void Copy( S3D_MASTER* pattern );
/**
* Function ReadData
* Select the parser to read the 3D data file (vrml, x3d ...)
* and build the description objects list
* @param aParser the parser that should be used to read model data and stored in
*/
int ReadData( S3D_MODEL_PARSER* aParser );
void Render( bool aIsRenderingJustNonTransparentObjects,
bool aIsRenderingJustTransparentObjects );
int ReadData();
/**
* Function ObjectCoordsTo3DUnits
@@ -122,14 +173,6 @@ public:
return m_Shape3DName;
}
/** Get class name
* @return string "S3D_MASTER"
*/
virtual wxString GetClass() const
{
return wxT( "S3D_MASTER" );
}
/**
* Function GetShape3DFullFilename
* @return the full filename of the 3D shape,
@@ -138,12 +181,6 @@ public:
*/
const wxString GetShape3DFullFilename();
/**
* Function GetShape3DExtension
* @return the extension of the filename of the 3D shape,
*/
const wxString GetShape3DExtension();
/**
* Function SetShape3DName
* @param aShapeName = file name of the data file relative to the 3D shape
@@ -152,23 +189,6 @@ public:
* (vrl, x3d, idf ) the type of file.
*/
void SetShape3DName( const wxString& aShapeName );
/**
* Function getBBox Model Space Bouding Box
* @return return the model space bouding box
*/
CBBOX &getBBox();
/**
* Function getFastAABBox
* @return return the Axis Align Bounding Box of the other bouding boxes
*/
CBBOX &getFastAABBox();
private:
void calcBBox();
CBBOX m_BBox; ///< Model oriented Bouding Box
CBBOX m_fastAABBox; ///< Axis Align Bounding Box that contain the other bounding boxes
};
@@ -192,4 +212,30 @@ public:
#endif
};
/**
* Class VERTEX_VALUE_CTRL
* displays a vertex for editing. A vertex is a triplet of values
* Values can be scale, rotation, offset...
*/
class VERTEX_VALUE_CTRL
{
private:
wxTextCtrl* m_XValueCtrl, * m_YValueCtrl, * m_ZValueCtrl;
public:
VERTEX_VALUE_CTRL( wxWindow* parent, wxBoxSizer* BoxSizer );
~VERTEX_VALUE_CTRL();
/**
* Function GetValue
* @return the vertex in internal units.
*/
S3D_VERTEX GetValue();
void SetValue( S3D_VERTEX vertex );
void Enable( bool enbl );
void SetToolTip( const wxString& text );
};
#endif // STRUCT_3D_H
+53 -152
View File
@@ -1,9 +1,9 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2013 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -51,11 +51,15 @@ void EDA_3D_FRAME::ReCreateMainToolbar()
m_mainToolBar->AddTool( ID_RELOAD3D_BOARD, wxEmptyString,
KiBitmap( import3d_xpm ), _( "Reload board" ) );
#if (defined(__WINDOWS__) || defined(__APPLE__ ) )
// Does not work properly under linux
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_TOOL_SCREENCOPY_TOCLIBBOARD, wxEmptyString,
KiBitmap( copy_button_xpm ),
_( "Copy 3D image to clipboard" ) );
_( "Copy 3D Image to Clipboard" ) );
#endif
m_mainToolBar->AddSeparator();
@@ -134,116 +138,47 @@ void EDA_3D_FRAME::CreateMenuBar()
menuBar->Append( fileMenu, _( "&File" ) );
AddMenuItem( fileMenu, ID_MENU_SCREENCOPY_PNG,
_( "Create Image (png format)" ),
KiBitmap( export_xpm ) );
AddMenuItem( fileMenu, ID_MENU_SCREENCOPY_JPEG,
_( "Create Image (jpeg format)" ),
KiBitmap( export_xpm ) );
fileMenu->Append( ID_MENU_SCREENCOPY_PNG, _( "Create Image (png format)" ) );
fileMenu->Append( ID_MENU_SCREENCOPY_JPEG, _( "Create Image (jpeg format)" ) );
#if (defined(__WINDOWS__) || defined(__APPLE__ ) )
// Does not work properly under linux
fileMenu->AppendSeparator();
fileMenu->Append( ID_TOOL_SCREENCOPY_TOCLIBBOARD, _( "Copy 3D Image to Clipboard" ) );
#endif
fileMenu->AppendSeparator();
AddMenuItem( fileMenu, ID_TOOL_SCREENCOPY_TOCLIBBOARD,
_( "Copy 3D Image to Clipboard" ),
KiBitmap( copy_button_xpm ) );
fileMenu->AppendSeparator();
AddMenuItem( fileMenu, wxID_EXIT,
_( "&Exit" ),
KiBitmap( exit_xpm ) );
fileMenu->Append( wxID_EXIT, _( "&Exit" ) );
menuBar->Append( prefsMenu, _( "&Preferences" ) );
AddMenuItem( prefsMenu, ID_MENU3D_REALISTIC_MODE,
_( "Realistic Mode" ),
KiBitmap( use_3D_copper_thickness_xpm ), wxITEM_CHECK );
wxMenu * renderOptionsMenu = new wxMenu;
AddMenuItem( prefsMenu, renderOptionsMenu, ID_MENU3D_COLOR,
_( "Render Options" ), KiBitmap( tools_xpm ) );
AddMenuItem( renderOptionsMenu, ID_MENU3D_FL_RENDER_SHADOWS,
_( "Render Shadows" ),
KiBitmap( green_xpm ), wxITEM_CHECK );
AddMenuItem( renderOptionsMenu, ID_MENU3D_FL_RENDER_SHOW_HOLES_IN_ZONES,
_( "Show Holes in Zones" ),
_( "Holes inside a copper layer copper zones are shown, "
"but the calculation time is longer" ),
KiBitmap( green_xpm ), wxITEM_CHECK );
AddMenuItem( renderOptionsMenu, ID_MENU3D_FL_RENDER_TEXTURES,
_( "Render Textures" ),
_( "Apply a grid/cloud textures to board, solder mask and silk screen" ),
KiBitmap( green_xpm ), wxITEM_CHECK );
AddMenuItem( renderOptionsMenu, ID_MENU3D_FL_RENDER_SMOOTH_NORMALS,
_( "Render Smooth Normals" ),
KiBitmap( green_xpm ), wxITEM_CHECK );
AddMenuItem( renderOptionsMenu, ID_MENU3D_FL_RENDER_USE_MODEL_NORMALS,
_( "Use Model Normals" ),
KiBitmap( green_xpm ), wxITEM_CHECK );
AddMenuItem( renderOptionsMenu, ID_MENU3D_FL_RENDER_MATERIAL,
_( "Render Material Properties" ),
KiBitmap( green_xpm ), wxITEM_CHECK );
AddMenuItem( renderOptionsMenu, ID_MENU3D_FL_RENDER_SHOW_MODEL_BBOX,
_( "Show Model Bounding Boxes" ),
KiBitmap( green_xpm ), wxITEM_CHECK );
_( "Realistic Mode" ), KiBitmap( use_3D_copper_thickness_xpm ), wxITEM_CHECK );
prefsMenu->AppendSeparator();
// Add submenu set Colors
wxMenu * setColorMenu = new wxMenu;
AddMenuItem( prefsMenu, setColorMenu, ID_MENU3D_COLOR,
_( "Choose Colors" ), KiBitmap( palette_xpm ) );
wxMenu * setBgColorMenu = new wxMenu;
AddMenuItem( setColorMenu, setBgColorMenu, ID_MENU3D_BGCOLOR,
_( "Background Color" ), KiBitmap( palette_xpm ) );
AddMenuItem( setBgColorMenu, ID_MENU3D_BGCOLOR_TOP_SELECTION,
_( "Background Top Color" ), KiBitmap( setcolor_3d_bg_xpm ) );
AddMenuItem( setBgColorMenu, ID_MENU3D_BGCOLOR_BOTTOM_SELECTION,
_( "Background Bottom Color" ), KiBitmap( setcolor_3d_bg_xpm ) );
AddMenuItem( setColorMenu, ID_MENU3D_SILKSCREEN_COLOR_SELECTION,
_( "Silkscreen Color" ), KiBitmap( setcolor_silkscreen_xpm ) );
AddMenuItem( setColorMenu, ID_MENU3D_SOLDERMASK_COLOR_SELECTION,
_( "Solder Mask Color" ), KiBitmap( setcolor_soldermask_xpm ) );
AddMenuItem( setColorMenu, ID_MENU3D_SOLDERPASTE_COLOR_SELECTION,
_( "Solder Paste Color" ), KiBitmap( setcolor_solderpaste_xpm ) );
AddMenuItem( setColorMenu, ID_MENU3D_COPPER_COLOR_SELECTION,
_( "Copper/Surface Finish Color" ), KiBitmap( setcolor_copper_xpm ) );
AddMenuItem( setColorMenu, ID_MENU3D_PCB_BODY_COLOR_SELECTION,
_( "Board Body Color" ), KiBitmap( setcolor_board_body_xpm ) );
AddMenuItem( prefsMenu, ID_MENU3D_BGCOLOR_SELECTION,
_( "Choose background color" ), KiBitmap( palette_xpm ) );
AddMenuItem( prefsMenu, ID_MENU3D_AXIS_ONOFF,
_( "Show 3D &Axis" ), KiBitmap( axis3d_front_xpm ), wxITEM_CHECK );
_( "Show 3D &Axis" ), KiBitmap( axis3d_front_xpm ), wxITEM_CHECK );
// Creates grid menu
wxMenu * gridlistMenu = new wxMenu;
AddMenuItem( prefsMenu, gridlistMenu, ID_MENU3D_GRID,
_( "3D Grid" ), KiBitmap( grid_xpm ) );
gridlistMenu->AppendCheckItem( ID_MENU3D_GRID_NOGRID, _( "No 3D Grid" ), wxEmptyString );
gridlistMenu->AppendCheckItem( ID_MENU3D_GRID_10_MM, _( "3D Grid 10 mm" ), wxEmptyString );
gridlistMenu->AppendCheckItem( ID_MENU3D_GRID_5_MM, _( "3D Grid 5 mm" ), wxEmptyString );
gridlistMenu->AppendCheckItem( ID_MENU3D_GRID_2P5_MM, _( "3D Grid 2.5 mm" ), wxEmptyString );
gridlistMenu->AppendCheckItem( ID_MENU3D_GRID_1_MM, _( "3D Grid 1 mm" ), wxEmptyString );
gridlistMenu->Append( ID_MENU3D_GRID_NOGRID, _( "No 3D Grid" ), wxEmptyString, true );
gridlistMenu->Append( ID_MENU3D_GRID_10_MM, _( "3D Grid 10 mm" ), wxEmptyString, true );
gridlistMenu->Append( ID_MENU3D_GRID_5_MM, _( "3D Grid 5 mm" ), wxEmptyString, true );
gridlistMenu->Append( ID_MENU3D_GRID_2P5_MM, _( "3D Grid 2.5 mm" ), wxEmptyString, true );
gridlistMenu->Append( ID_MENU3D_GRID_1_MM, _( "3D Grid 1 mm" ), wxEmptyString, true );
// If the grid is on, check the corresponding menuitem showing the grid size
if( IsEnabled( FL_GRID ) )
if( g_Parm_3D_Visu.GetFlag( FL_GRID ) )
{
gridlistMenu->Check( ID_MENU3D_GRID_10_MM, GetPrm3DVisu().m_3D_Grid == 10.0 );
gridlistMenu->Check( ID_MENU3D_GRID_5_MM, GetPrm3DVisu().m_3D_Grid == 5.0 );
gridlistMenu->Check( ID_MENU3D_GRID_2P5_MM, GetPrm3DVisu().m_3D_Grid == 2.5 );
gridlistMenu->Check( ID_MENU3D_GRID_1_MM, GetPrm3DVisu().m_3D_Grid == 1.0 );
gridlistMenu->Check( ID_MENU3D_GRID_10_MM, g_Parm_3D_Visu.m_3D_Grid == 10.0 );
gridlistMenu->Check( ID_MENU3D_GRID_5_MM, g_Parm_3D_Visu.m_3D_Grid == 5.0 );
gridlistMenu->Check( ID_MENU3D_GRID_2P5_MM, g_Parm_3D_Visu.m_3D_Grid == 2.5 );
gridlistMenu->Check( ID_MENU3D_GRID_1_MM, g_Parm_3D_Visu.m_3D_Grid == 1.0 );
}
else
gridlistMenu->Check( ID_MENU3D_GRID_NOGRID, true );
@@ -251,41 +186,35 @@ void EDA_3D_FRAME::CreateMenuBar()
prefsMenu->AppendSeparator();
AddMenuItem( prefsMenu, ID_MENU3D_SHOW_BOARD_BODY,
_( "Show Board Bod&y" ), KiBitmap( use_3D_copper_thickness_xpm ), wxITEM_CHECK );
_( "Show Board Body" ), KiBitmap( use_3D_copper_thickness_xpm ), wxITEM_CHECK );
AddMenuItem( prefsMenu, ID_MENU3D_USE_COPPER_THICKNESS,
_( "Show Copper &Thickness" ), KiBitmap( use_3D_copper_thickness_xpm ), wxITEM_CHECK );
_( "Show Copper Thickness" ), KiBitmap( use_3D_copper_thickness_xpm ), wxITEM_CHECK );
AddMenuItem( prefsMenu, ID_MENU3D_MODULE_ONOFF,
_( "Show 3D M&odels" ), KiBitmap( shape_3d_xpm ), wxITEM_CHECK );
_( "Show 3D F&ootprints" ), KiBitmap( shape_3d_xpm ), wxITEM_CHECK );
AddMenuItem( prefsMenu, ID_MENU3D_ZONE_ONOFF,
_( "Show Zone &Filling" ), KiBitmap( add_zone_xpm ), wxITEM_CHECK );
prefsMenu->AppendSeparator();
wxMenu * layersMenu = new wxMenu;
AddMenuItem( prefsMenu, layersMenu, ID_MENU3D_LAYERS,
_( "Show &Layers" ), KiBitmap( tools_xpm ) );
AddMenuItem( layersMenu, ID_MENU3D_ADHESIVE_ONOFF,
AddMenuItem( prefsMenu, ID_MENU3D_ADHESIVE_ONOFF,
_( "Show &Adhesive Layers" ), KiBitmap( tools_xpm ), wxITEM_CHECK );
AddMenuItem( layersMenu, ID_MENU3D_SILKSCREEN_ONOFF,
_( "Show &Silkscreen Layers" ), KiBitmap( add_text_xpm ), wxITEM_CHECK );
AddMenuItem( prefsMenu, ID_MENU3D_SILKSCREEN_ONOFF,
_( "Show &Silkscreen Layer" ), KiBitmap( add_text_xpm ), wxITEM_CHECK );
AddMenuItem( layersMenu, ID_MENU3D_SOLDER_MASK_ONOFF,
AddMenuItem( prefsMenu, ID_MENU3D_SOLDER_MASK_ONOFF,
_( "Show Solder &Mask Layers" ), KiBitmap( pads_mask_layers_xpm ), wxITEM_CHECK );
AddMenuItem( layersMenu, ID_MENU3D_SOLDER_PASTE_ONOFF,
AddMenuItem( prefsMenu, ID_MENU3D_SOLDER_PASTE_ONOFF,
_( "Show Solder &Paste Layers" ), KiBitmap( pads_mask_layers_xpm ), wxITEM_CHECK );
// Other layers are not "board" layers, and are not shown in realistic mode
// These menus will be disabled in in realistic mode
AddMenuItem( layersMenu, ID_MENU3D_COMMENTS_ONOFF,
_( "Show &Comments and Drawing Layers" ), KiBitmap( edit_sheet_xpm ), wxITEM_CHECK );
AddMenuItem( prefsMenu, ID_MENU3D_COMMENTS_ONOFF,
_( "Show &Comments and Drawings Layer" ), KiBitmap( edit_sheet_xpm ), wxITEM_CHECK );
AddMenuItem( layersMenu, ID_MENU3D_ECO_ONOFF,
AddMenuItem( prefsMenu, ID_MENU3D_ECO_ONOFF,
_( "Show &Eco Layers" ), KiBitmap( edit_sheet_xpm ), wxITEM_CHECK );
SetMenuBar( menuBar );
@@ -302,68 +231,40 @@ void EDA_3D_FRAME::SetMenuBarOptionsState()
wxMenuItem* item;
// Set the state of toggle menus according to the current display options
item = menuBar->FindItem( ID_MENU3D_REALISTIC_MODE );
item->Check( GetPrm3DVisu().IsRealisticMode() );
item = menuBar->FindItem( ID_MENU3D_COMMENTS_ONOFF );
item->Enable( !GetPrm3DVisu().IsRealisticMode() );
item = menuBar->FindItem( ID_MENU3D_ECO_ONOFF );
item->Enable( !GetPrm3DVisu().IsRealisticMode() );
item = menuBar->FindItem( ID_MENU3D_FL_RENDER_SHADOWS );
item->Check( GetPrm3DVisu().GetFlag( FL_RENDER_SHADOWS ) );
item = menuBar->FindItem( ID_MENU3D_FL_RENDER_SHADOWS );
item->Check( GetPrm3DVisu().GetFlag( FL_RENDER_SHADOWS ) );
item = menuBar->FindItem( ID_MENU3D_FL_RENDER_SHOW_HOLES_IN_ZONES );
item->Check( GetPrm3DVisu().GetFlag( FL_RENDER_SHOW_HOLES_IN_ZONES ) );
item = menuBar->FindItem( ID_MENU3D_FL_RENDER_TEXTURES );
item->Check( GetPrm3DVisu().GetFlag( FL_RENDER_TEXTURES ) );
item = menuBar->FindItem( ID_MENU3D_FL_RENDER_SMOOTH_NORMALS );
item->Check( GetPrm3DVisu().GetFlag( FL_RENDER_SMOOTH_NORMALS ) );
item = menuBar->FindItem( ID_MENU3D_FL_RENDER_USE_MODEL_NORMALS );
item->Check( GetPrm3DVisu().GetFlag( FL_RENDER_USE_MODEL_NORMALS ) );
item = menuBar->FindItem( ID_MENU3D_FL_RENDER_MATERIAL );
item->Check( GetPrm3DVisu().GetFlag( FL_RENDER_MATERIAL ) );
item = menuBar->FindItem( ID_MENU3D_FL_RENDER_SHOW_MODEL_BBOX );
item->Check( GetPrm3DVisu().GetFlag( FL_RENDER_SHOW_MODEL_BBOX ) );
item->Check(g_Parm_3D_Visu.GetFlag( FL_USE_REALISTIC_MODE ) );
item = menuBar->FindItem( ID_MENU3D_SHOW_BOARD_BODY );
item->Check( GetPrm3DVisu().GetFlag( FL_SHOW_BOARD_BODY ) );
item->Check(g_Parm_3D_Visu.GetFlag( FL_SHOW_BOARD_BODY ) );
item = menuBar->FindItem( ID_MENU3D_USE_COPPER_THICKNESS );
item->Check( GetPrm3DVisu().GetFlag( FL_USE_COPPER_THICKNESS ) );
item->Check(g_Parm_3D_Visu.GetFlag( FL_USE_COPPER_THICKNESS ) );
item = menuBar->FindItem( ID_MENU3D_MODULE_ONOFF );
item->Check( GetPrm3DVisu().GetFlag( FL_MODULE ) );
item->Check(g_Parm_3D_Visu.GetFlag( FL_MODULE ) );
item = menuBar->FindItem( ID_MENU3D_ZONE_ONOFF );
item->Check( GetPrm3DVisu().GetFlag( FL_ZONE ) );
item->Check(g_Parm_3D_Visu.GetFlag( FL_ZONE ) );
item = menuBar->FindItem( ID_MENU3D_AXIS_ONOFF );
item->Check( GetPrm3DVisu().GetFlag( FL_AXIS ) );
item->Check(g_Parm_3D_Visu.GetFlag( FL_AXIS ) );
item = menuBar->FindItem( ID_MENU3D_ADHESIVE_ONOFF );
item->Check( GetPrm3DVisu().GetFlag( FL_ADHESIVE ) );
item->Check(g_Parm_3D_Visu.GetFlag( FL_ADHESIVE ) );
item = menuBar->FindItem( ID_MENU3D_SILKSCREEN_ONOFF );
item->Check( GetPrm3DVisu().GetFlag( FL_SILKSCREEN ) );
item->Check(g_Parm_3D_Visu.GetFlag( FL_SILKSCREEN ) );
item = menuBar->FindItem( ID_MENU3D_SOLDER_MASK_ONOFF );
item->Check( GetPrm3DVisu().GetFlag( FL_SOLDERMASK ) );
item->Check(g_Parm_3D_Visu.GetFlag( FL_SOLDERMASK ) );
item = menuBar->FindItem( ID_MENU3D_SOLDER_PASTE_ONOFF );
item->Check( GetPrm3DVisu().GetFlag( FL_SOLDERPASTE ) );
item->Check(g_Parm_3D_Visu.GetFlag( FL_SOLDERPASTE ) );
item = menuBar->FindItem( ID_MENU3D_COMMENTS_ONOFF );
item->Check( GetPrm3DVisu().GetFlag( FL_COMMENTS ) );
item->Check(g_Parm_3D_Visu.GetFlag( FL_COMMENTS ) );
item = menuBar->FindItem( ID_MENU3D_ECO_ONOFF );
item->Check( GetPrm3DVisu().GetFlag( FL_ECO ));
item->Check(g_Parm_3D_Visu.GetFlag( FL_ECO ));
}
void EDA_3D_FRAME::SetToolbars()
-108
View File
@@ -1,108 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015 Mario Luzeiro <mrluzeiro@gmail.com>
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file 3d_types.h
*/
#ifndef _3D_TYPES_H_
#define _3D_TYPES_H_
#define GLM_FORCE_RADIANS
#include <gal/opengl/glm/glm.hpp>
#include <base_units.h> // for IU_PER_MILS
/**
* @note For historical reasons the 3D modeling unit is 0.1 inch
* 1 3Dunit = 2.54 mm = 0.1 inch = 100 mils
*/
#define UNITS3D_TO_UNITSPCB (IU_PER_MILS * 100)
/**
* scaling factor for 3D shape offset ( S3D_MASTER::m_MatPosition member )
* Was in inches in legacy version, and, due to a mistake, still in inches
* in .kicad_pcb files (which are using mm)
* so this scaling convert file units (inch) to 3D units (0.1 inch), only
* for S3D_MASTER::m_MatPosition parameter
*/
#define SCALE_3D_CONV 10
// S3D_VERTEX manages a opengl 3D coordinate (3 float numbers: x,y,z coordinates)
// float are widely used in opengl functions.
// they are used here in coordinates which are also used in opengl functions.
#define S3D_VERTEX glm::vec3
// S3DPOINT manages a set of 3 double values (x,y,z )
// It is used for values which are not directly used in opengl functions.
// It is used in dialogs, or when reading/writing files for instance
class S3DPOINT
{
public:
double x, y, z;
public:
S3DPOINT()
{
x = y = z = 0.0;
}
S3DPOINT( double px, double py, double pz)
{
x = px;
y = py;
z = pz;
}
};
/**
* Class S3DPOINT_VALUE_CTRL
* displays a S3DPOINT for editing (in dialogs). A S3DPOINT is a triplet of values
* Values can be scale, rotation, offset...
*/
class S3DPOINT_VALUE_CTRL
{
private:
wxTextCtrl* m_XValueCtrl, * m_YValueCtrl, * m_ZValueCtrl;
public:
S3DPOINT_VALUE_CTRL( wxWindow* parent, wxBoxSizer* BoxSizer );
~S3DPOINT_VALUE_CTRL();
/**
* Function GetValue
* @return the 3D point in internal units.
*/
S3DPOINT GetValue();
void SetValue( S3DPOINT a3Dpoint );
void Enable( bool enbl );
void SetToolTip( const wxString& text );
};
#endif // 3D_TYPES_H
+19 -76
View File
@@ -37,22 +37,29 @@
#endif
#include <wx/glcanvas.h>
#ifdef __WXMAC__
# ifdef __DARWIN__
# include <OpenGL/glu.h>
# else
# include <glu.h>
# endif
#else
# include <GL/glu.h>
#endif
#define KISYS3DMOD "KISYS3DMOD"
#include <3d_struct.h>
#include <info3d_visu.h>
/// A variable name whose value holds the path of 3D shape files.
/// Currently an environment variable, eventually a project variable.
#define KISYS3DMOD wxT( "KISYS3DMOD" )
/// All 3D files are expected to be stored in LIB3D_FOLDER, or one of
/// its subdirectory.
#define LIB3D_FOLDER wxT( "packages3d" )
#define KISYS3DMOD "KISYS3DMOD"
class EDA_3D_CANVAS;
class PCB_BASE_FRAME;
class wxColourData;
#define KICAD_DEFAULT_3D_DRAWFRAME_STYLE (wxDEFAULT_FRAME_STYLE | wxWANTS_CHARS)
#define LIB3D_PATH wxT( "packages3d" )
class EDA_3D_FRAME : public KIWAY_PLAYER
@@ -96,7 +103,7 @@ public:
* @param aGlList = the list to rebuild.
* if 0 (default) all lists are rebuilt
*/
void NewDisplay( int aGlList = 0 );
void NewDisplay( GLuint aGlList = 0 );
void SetDefaultFileName(const wxString &aFn) { m_defaultFileName = aFn; }
const wxString &GetDefaultFileName() const { return m_defaultFileName; }
@@ -104,21 +111,9 @@ public:
/// Toggles orthographic projection on and off
void ToggleOrtho(){ m_ortho = !m_ortho ; Refresh(true);};
/// @return the orthographic projection flag
/// Returns the orthographic projection flag
bool ModeIsOrtho() { return m_ortho ;};
/** @return the INFO3D_VISU which contains the current parameters
* to draw the 3D view og the board
*/
INFO3D_VISU& GetPrm3DVisu() const;
/**
* @return true if aItem must be displayed
* @param aItem = an item of DISPLAY3D_FLG enum
*/
bool IsEnabled( DISPLAY3D_FLG aItem ) const;
private:
// Event handlers:
void Exit3DFrame( wxCommandEvent& event );
@@ -146,59 +141,7 @@ private:
double BestZoom();
void RedrawActiveWindow( wxDC* DC, bool EraseBg );
/**
* Function Set3DColorFromUser
* Get a S3D_COLOR from a wx colour dialog
* @param aColor is the S3D_COLOR to change
* @param aTitle is the title displayed in the colordialog selector
* @param aPredefinedColors is a reference to a wxColourData
* which contains a few predefined colors
* if it is NULL, no predefined colors are used
* @return true if a new color is chosen, false if
* no change or aborted by user
*/
bool Set3DColorFromUser( S3D_COLOR &aColor, const wxString& aTitle,
wxColourData* aPredefinedColors = NULL );
/**
* Function Set3DSolderMaskColorFromUser
* Set the solder mask color from a set of colors
* @return true if a new color is chosen, false if
* no change or aborted by user
*/
bool Set3DSolderMaskColorFromUser();
/**
* Function Set3DSolderPasteColorFromUser
* Set the solder mask color from a set of colors
* @return true if a new color is chosen, false if
* no change or aborted by user
*/
bool Set3DSolderPasteColorFromUser();
/**
* Function Set3DCopperColorFromUser
* Set the copper color from a set of colors
* @return true if a new color is chosen, false if
* no change or aborted by user
*/
bool Set3DCopperColorFromUser();
/**
* Function Set3DBoardBodyBodyColorFromUser
* Set the copper color from a set of colors
* @return true if a new color is chosen, false if
* no change or aborted by user
*/
bool Set3DBoardBodyColorFromUser();
/**
* Function Set3DSilkScreenColorFromUser
* Set the silkscreen color from a set of colors
* @return true if a new color is chosen, false if
* no change or aborted by user
*/
bool Set3DSilkScreenColorFromUser();
void Set3DBgColor();
DECLARE_EVENT_TABLE()
};
+3 -21
View File
@@ -8,15 +8,13 @@
* Please add IDs that are unique to the 3D viewer here and not in the global
* id.h file. This will prevent the entire project from being rebuilt when
* adding new commands to the 3D viewer.
* However the number of IDs should be < ROOM_FOR_3D_VIEWER, defined in id.h
* Please change the value of ROOM_FOR_3D_VIEWER if too small.
*/
#include <id.h> // Generic Id.
#include <id.h> // Generic Id.
enum id_3dview_frm
{
ID_START_COMMAND_3D = ID_KICAD_3D_VIEWER_START,
ID_START_COMMAND_3D = ID_END_LIST,
ID_ROTATE3D_X_NEG,
ID_ROTATE3D_X_POS,
ID_ROTATE3D_Y_NEG,
@@ -30,20 +28,11 @@ enum id_3dview_frm
ID_MOVE3D_UP,
ID_MOVE3D_DOWN,
ID_ORTHO,
ID_MENU3D_COLOR,
ID_MENU3D_BGCOLOR,
ID_MENU3D_BGCOLOR_BOTTOM_SELECTION,
ID_MENU3D_BGCOLOR_TOP_SELECTION,
ID_MENU3D_SILKSCREEN_COLOR_SELECTION,
ID_MENU3D_SOLDERMASK_COLOR_SELECTION,
ID_MENU3D_SOLDERPASTE_COLOR_SELECTION,
ID_MENU3D_PCB_BODY_COLOR_SELECTION,
ID_MENU3D_COPPER_COLOR_SELECTION,
ID_MENU3D_BGCOLOR_SELECTION,
ID_MENU3D_USE_COPPER_THICKNESS,
ID_MENU3D_AXIS_ONOFF,
ID_MENU3D_MODULE_ONOFF,
ID_MENU3D_ZONE_ONOFF,
ID_MENU3D_LAYERS,
ID_MENU3D_ADHESIVE_ONOFF,
ID_MENU3D_SILKSCREEN_ONOFF,
ID_MENU3D_SOLDER_PASTE_ONOFF,
@@ -52,13 +41,6 @@ enum id_3dview_frm
ID_MENU3D_ECO_ONOFF,
ID_MENU3D_SHOW_BOARD_BODY,
ID_MENU3D_REALISTIC_MODE,
ID_MENU3D_FL_RENDER_SHADOWS,
ID_MENU3D_FL_RENDER_SHOW_HOLES_IN_ZONES,
ID_MENU3D_FL_RENDER_TEXTURES,
ID_MENU3D_FL_RENDER_SMOOTH_NORMALS,
ID_MENU3D_FL_RENDER_USE_MODEL_NORMALS,
ID_MENU3D_FL_RENDER_MATERIAL,
ID_MENU3D_FL_RENDER_SHOW_MODEL_BBOX,
ID_END_COMMAND_3D,
ID_TOOL_SET_VISIBLE_ITEMS,
-278
View File
@@ -1,278 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015 Mario Luzeiro <mrluzeiro@gmail.com>
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file CBBox.cpp
* @brief Bounding Box class implementation
*/
#include "CBBox.h"
// openGL includes used for debug the bounding box
#ifdef __WXMAC__
# ifdef __DARWIN__
# include <OpenGL/glu.h>
# else
# include <glu.h>
# endif
#else
# include <GL/glu.h>
#endif
CBBOX::CBBOX()
{
Reset();
}
CBBOX::CBBOX( const S3D_VERTEX &aPbInit )
{
m_min = aPbInit;
m_max = aPbInit;
m_initialized = true;
}
CBBOX::CBBOX( const S3D_VERTEX &aPbMin, const S3D_VERTEX &aPbMax )
{
Set( aPbMin, aPbMax );
}
CBBOX::~CBBOX()
{
}
void CBBOX::Set( const S3D_VERTEX &aPbMin, const S3D_VERTEX &aPbMax )
{
m_min.x = glm::min( aPbMin.x, aPbMax.x );
m_min.y = glm::min( aPbMin.y, aPbMax.y );
m_min.z = glm::min( aPbMin.z, aPbMax.z );
m_max.x = glm::max( aPbMin.x, aPbMax.x );
m_max.y = glm::max( aPbMin.y, aPbMax.y );
m_max.z = glm::max( aPbMin.z, aPbMax.z );
m_initialized = true;
}
bool CBBOX::IsInitialized() const
{
return m_initialized;
}
void CBBOX::Reset()
{
m_min = S3D_VERTEX( 0.0f, 0.0f, 0.0f );
m_max = S3D_VERTEX( 0.0f, 0.0f, 0.0f );
m_initialized = false;
}
void CBBOX::Union( const S3D_VERTEX &aPoint )
{
if( !m_initialized )
{
m_initialized = true;
// Initialize the bounding box with the given point
m_min = aPoint;
m_max = aPoint;
}
else
{
// get the minimun value between the added point and the existent bounding box
m_min.x = glm::min( m_min.x, aPoint.x );
m_min.y = glm::min( m_min.y, aPoint.y );
m_min.z = glm::min( m_min.z, aPoint.z );
// get the maximun value between the added point and the existent bounding box
m_max.x = glm::max( m_max.x, aPoint.x );
m_max.y = glm::max( m_max.y, aPoint.y );
m_max.z = glm::max( m_max.z, aPoint.z );
}
}
void CBBOX::Union( const CBBOX &aBBox )
{
if( aBBox.m_initialized == false )
return;
if( !m_initialized )
{
// Initialize the bounding box with the given bounding box
m_initialized = true;
m_min = aBBox.m_min;
m_max = aBBox.m_max;
}
else
{
// get the minimun value between the added bounding box and the existent bounding box
m_min.x = glm::min( m_min.x, aBBox.m_min.x );
m_min.y = glm::min( m_min.y, aBBox.m_min.y );
m_min.z = glm::min( m_min.z, aBBox.m_min.z );
// get the maximun value between the added bounding box and the existent bounding box
m_max.x = glm::max( m_max.x, aBBox.m_max.x );
m_max.y = glm::max( m_max.y, aBBox.m_max.y );
m_max.z = glm::max( m_max.z, aBBox.m_max.z );
}
}
S3D_VERTEX CBBOX::GetCenter() const
{
return (m_max + m_min) * 0.5f;
}
S3D_VERTEX CBBOX::Min() const
{
return m_min;
}
S3D_VERTEX CBBOX::Max() const
{
return m_max;
}
void CBBOX::Scale( float aScale )
{
if( m_initialized == false )
return;
S3D_VERTEX scaleV = S3D_VERTEX( aScale, aScale, aScale );
S3D_VERTEX centerV = GetCenter();
m_min = (m_min - centerV) * scaleV + centerV;
m_max = (m_max - centerV) * scaleV + centerV;
}
bool CBBOX::OverlapsBox( const CBBOX &aBBox ) const
{
if( aBBox.m_initialized == false )
return false;
bool x = ( m_max.x >= aBBox.m_min.x ) && ( m_min.x <= aBBox.m_max.x );
bool y = ( m_max.y >= aBBox.m_min.y ) && ( m_min.y <= aBBox.m_max.y );
bool z = ( m_max.z >= aBBox.m_min.z ) && ( m_min.z <= aBBox.m_max.z );
return ( x && y && z );
}
bool CBBOX::Inside( const S3D_VERTEX &aPoint ) const
{
if( m_initialized == false )
return false;
return (( aPoint.x >= m_min.x ) && ( aPoint.x <= m_max.x ) &&
( aPoint.y >= m_min.y ) && ( aPoint.y <= m_max.y ) &&
( aPoint.z >= m_min.z ) && ( aPoint.z <= m_max.z ));
}
float CBBOX::Volume() const
{
if( m_initialized == false )
return 0.0f;
S3D_VERTEX d = m_max - m_min;
return d.x * d.y * d.z;
}
void CBBOX::ApplyTransformation( glm::mat4 aTransformMatrix )
{
if( m_initialized == false )
return;
S3D_VERTEX v1 = S3D_VERTEX( aTransformMatrix * glm::vec4( m_min.x, m_min.y, m_min.z, 1.0f ) );
S3D_VERTEX v2 = S3D_VERTEX( aTransformMatrix * glm::vec4( m_max.x, m_max.y, m_max.z, 1.0f ) );
Reset();
Union( v1 );
Union( v2 );
}
void CBBOX::ApplyTransformationAA( glm::mat4 aTransformMatrix )
{
if( m_initialized == false )
return;
// apply the transformation matrix for each of vertices of the bounding box
// and make a union with all vertices
CBBOX tmpBBox = CBBOX( S3D_VERTEX( aTransformMatrix * glm::vec4( m_min.x, m_min.y, m_min.z, 1.0f ) ) );
tmpBBox.Union( S3D_VERTEX( aTransformMatrix * glm::vec4( m_max.x, m_min.y, m_min.z, 1.0f ) ) );
tmpBBox.Union( S3D_VERTEX( aTransformMatrix * glm::vec4( m_min.x, m_max.y, m_min.z, 1.0f ) ) );
tmpBBox.Union( S3D_VERTEX( aTransformMatrix * glm::vec4( m_min.x, m_min.y, m_max.z, 1.0f ) ) );
tmpBBox.Union( S3D_VERTEX( aTransformMatrix * glm::vec4( m_min.x, m_max.y, m_max.z, 1.0f ) ) );
tmpBBox.Union( S3D_VERTEX( aTransformMatrix * glm::vec4( m_max.x, m_max.y, m_min.z, 1.0f ) ) );
tmpBBox.Union( S3D_VERTEX( aTransformMatrix * glm::vec4( m_max.x, m_min.y, m_max.z, 1.0f ) ) );
tmpBBox.Union( S3D_VERTEX( aTransformMatrix * glm::vec4( m_max.x, m_max.y, m_max.z, 1.0f ) ) );
m_min = tmpBBox.m_min;
m_max = tmpBBox.m_max;
}
void CBBOX::GLdebug() const
{
if( m_initialized == false )
return;
glBegin( GL_LINE_LOOP );
glVertex3f( m_min.x, m_min.y, m_min.z );
glVertex3f( m_max.x, m_min.y, m_min.z );
glVertex3f( m_max.x, m_max.y, m_min.z );
glVertex3f( m_min.x, m_max.y, m_min.z );
glEnd();
glBegin( GL_LINE_LOOP );
glVertex3f( m_min.x, m_min.y, m_max.z );
glVertex3f( m_max.x, m_min.y, m_max.z );
glVertex3f( m_max.x, m_max.y, m_max.z );
glVertex3f( m_min.x, m_max.y, m_max.z );
glEnd();
glBegin( GL_LINE_STRIP );
glVertex3f( m_min.x, m_min.y, m_min.z );
glVertex3f( m_min.x, m_min.y, m_max.z );
glEnd();
glBegin( GL_LINE_STRIP );
glVertex3f( m_max.x, m_min.y, m_min.z );
glVertex3f( m_max.x, m_min.y, m_max.z );
glEnd();
glBegin( GL_LINE_STRIP );
glVertex3f( m_max.x, m_max.y, m_min.z );
glVertex3f( m_max.x, m_max.y, m_max.z );
glEnd();
glBegin( GL_LINE_STRIP );
glVertex3f( m_min.x, m_max.y, m_min.z );
glVertex3f( m_min.x, m_max.y, m_max.z );
glEnd();
}
-182
View File
@@ -1,182 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015 Mario Luzeiro <mrluzeiro@gmail.com>
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file CBBox.h
* @brief Bounding Box class definition
*/
#ifndef CBBox_h
#define CBBox_h
#define GLM_FORCE_RADIANS
#include <gal/opengl/glm/glm.hpp>
#include <3d_types.h>
/**
* Class CBBOX
* manages a bounding box defined by two S3D_VERTEX points.
*/
class CBBOX
{
public:
/**
* Constructor CBBOX
* Create with default values a bounding box (not inizialized)
*/
CBBOX();
/**
* Constructor CBBOX
* Initialize a bounding box with a given point
* @param aPbInit a point for the bounding box initialization
*/
CBBOX( const S3D_VERTEX &aPbInit );
/**
* Constructor CBBOX
* Initialize a bounding box with a minimon and a maximun point
* @param aPbMin the minimun point to initialize the bounding box
* @param aPbMax the maximun point to initialize the bounding box
*/
CBBOX( const S3D_VERTEX &aPbMin, const S3D_VERTEX &aPbMax );
~CBBOX();
/**
* Function Set
* Set bounding box with new parameters
* @param aPbMin the minimun point to initialize the bounding box
* @param aPbMax the maximun point to initialize the bounding box
*/
void Set( const S3D_VERTEX &aPbMin, const S3D_VERTEX &aPbMax );
/**
* Function Union
* recalculate the bounding box adding a point
* @param aPoint the point to be bounded
*/
void Union( const S3D_VERTEX &aPoint );
/**
* Function Union
* recalculate the bounding box adding other bounding box
* @param aBBox the bounding box to be bounded
*/
void Union( const CBBOX &aBBox );
/**
* Function Scale
* scales a bounding box by its center
* @param aScale scale factor to apply
*/
void Scale( float aScale );
/**
* Function OverlapsBox
* test if a bounding box overlaps this box
* @param aBBox the bounding box to check if it overlaps
*/
bool OverlapsBox( const CBBOX &aBBox ) const;
/**
* Function Inside
* check is a point is inside this bounding box
* @param aPoint point to test
*/
bool Inside( const S3D_VERTEX &aPoint ) const;
/**
* Function ApplyTransformation
* apply a transformation matrix to the box points
* @param aTransformMatrix matrix to apply to the points of the bounding box
*/
void ApplyTransformation( glm::mat4 aTransformMatrix );
/**
* Function ApplyTransformationAA
* apply a transformation matrix to the box points and recalculate it
* to fit an axis aligned bounding box
* @param aTransformMatrix matrix to apply to the points of the bounding box
*/
void ApplyTransformationAA( glm::mat4 aTransformMatrix );
/**
* Function Volume
* calculate the volume of a bounding box
* @return float - volume of this bounding box
*/
float Volume() const;
/**
* Function GLdebug
* render a wired bounding box using openGL
*/
void GLdebug() const;
/**
* Function IsInitialized
* check if this bounding box is already initialized
* @return bool - return true if it was initialized, false if otherwise
*/
bool IsInitialized() const;
/**
* Function Reset
* reset the bounding box to zero and de-initialized it
*/
void Reset();
/**
* Function GetCenter
* return the center point of the bounding box
* @return S3D_VERTEX - the position of the center of this bounding box
*/
S3D_VERTEX GetCenter() const;
/**
* Function Min
* return the minimun vertex pointer
* @return S3D_VERTEX - the minimun vertice position
*/
S3D_VERTEX Min() const;
/**
* Function Max
* return the maximum vertex pointer
* @return S3D_VERTEX - the maximun vertice position
*/
S3D_VERTEX Max() const;
private:
S3D_VERTEX m_min; ///< point of the lower position of the bounding box
S3D_VERTEX m_max; ///< point of the higher position of the bounding box
bool m_initialized; ///< initialization status of the bounding box. true - if initialized, false otherwise
};
#endif // CBBox_h
-440
View File
@@ -1,440 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015 Mario Luzeiro <mrluzeiro@gmail.com>
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file CImage.cpp
* @brief one 8bit-channel image implementation
*/
#include "CImage.h"
#include <wx/image.h> // Used for save an image to disk
#include <string.h> // For memcpy
#ifndef CLAMP
#define CLAMP(n, min, max) {if (n < min) n=min; else if (n > max) n = max;}
#endif
CIMAGE::CIMAGE( unsigned int aXsize, unsigned int aYsize )
{
m_wxh = aXsize * aYsize;
m_pixels = (unsigned char*)malloc( m_wxh );
m_width = aXsize;
m_height = aYsize;
m_wraping = (E_WRAP)WRAP_CLAMP;
}
CIMAGE::~CIMAGE()
{
free( m_pixels );
}
unsigned char* CIMAGE::GetBuffer() const
{
return m_pixels;
}
bool CIMAGE::wrapCoords( int *aXo, int *aYo ) const
{
int x = *aXo;
int y = *aYo;
switch(m_wraping)
{
case WRAP_CLAMP:
x = (x < 0 )?0:x;
x = (x >= (int)(m_width - 1))?(m_width - 1):x;
y = (y < 0)?0:y;
y = (y >= (int)(m_height - 1))?(m_height - 1):y;
break;
case WRAP_WRAP:
x = (x < 0)?((m_width - 1)+x):x;
x = (x >= (int)(m_width - 1))?(x - m_width):x;
y = (y < 0)?((m_height - 1)+y):y;
y = (y >= (int)(m_height - 1))?(y - m_height):y;
break;
default:
break;
}
if( (x < 0) || (x >= (int)m_width) ||
(y < 0) || (y >= (int)m_height) )
return false;
*aXo = x;
*aYo = y;
return true;
}
void CIMAGE::Setpixel( int aX, int aY, unsigned char aValue )
{
if( wrapCoords( &aX, &aY ) )
m_pixels[aX + aY * m_width] = aValue;
}
unsigned char CIMAGE::Getpixel( int aX, int aY ) const
{
if( wrapCoords( &aX, &aY ) )
return m_pixels[aX + aY * m_width];
else
return 0;
}
void CIMAGE::Invert()
{
for( unsigned int it = 0; it < m_wxh; it++ )
m_pixels[it] = 255 - m_pixels[it];
}
void CIMAGE::CopyFull( const CIMAGE *aImgA, const CIMAGE *aImgB, E_IMAGE_OP aOperation )
{
int aV, bV;
if( aOperation == COPY_RAW )
{
if ( aImgA == NULL )
return;
}
else
{
if ( (aImgA == NULL) || (aImgB == NULL) )
return;
}
switch(aOperation)
{
case COPY_RAW:
memcpy( m_pixels, aImgA->m_pixels, m_wxh );
break;
case COPY_ADD:
for( unsigned int it = 0;it < m_wxh; it++ )
{
aV = aImgA->m_pixels[it];
bV = aImgB->m_pixels[it];
aV = (aV + bV);
aV = (aV > 255)?255:aV;
m_pixels[it] = aV;
}
break;
case COPY_SUB:
for( unsigned int it = 0;it < m_wxh; it++ )
{
aV = aImgA->m_pixels[it];
bV = aImgB->m_pixels[it];
aV = (aV - bV);
aV = (aV < 0)?0:aV;
m_pixels[it] = aV;
}
break;
case COPY_DIF:
for( unsigned int it = 0;it < m_wxh; it++ )
{
aV = aImgA->m_pixels[it];
bV = aImgB->m_pixels[it];
m_pixels[it] = abs(aV - bV);
}
break;
case COPY_MUL:
for( unsigned int it = 0;it < m_wxh; it++ )
{
aV = aImgA->m_pixels[it];
bV = aImgB->m_pixels[it];
m_pixels[it] = (unsigned char)((((float)aV / 255.0f) * ((float)bV / 255.0f)) * 255);
}
break;
case COPY_AND:
for( unsigned int it = 0;it < m_wxh; it++ )
{
m_pixels[it] = aImgA->m_pixels[it] & aImgB->m_pixels[it];
}
break;
case COPY_OR:
for( unsigned int it = 0;it < m_wxh; it++ )
{
m_pixels[it] = aImgA->m_pixels[it] | aImgB->m_pixels[it];
}
break;
case COPY_XOR:
for( unsigned int it = 0;it < m_wxh; it++ )
{
m_pixels[it] = aImgA->m_pixels[it] ^ aImgB->m_pixels[it];
}
break;
case COPY_BLEND50:
for( unsigned int it = 0;it < m_wxh; it++ )
{
aV = aImgA->m_pixels[it];
bV = aImgB->m_pixels[it];
m_pixels[it] = (aV + bV) / 2;
}
break;
case COPY_MIN:
for( unsigned int it = 0;it < m_wxh; it++ )
{
aV = aImgA->m_pixels[it];
bV = aImgB->m_pixels[it];
m_pixels[it] = (aV < bV)?aV:bV;
}
break;
case COPY_MAX:
for( unsigned int it = 0;it < m_wxh; it++ )
{
aV = aImgA->m_pixels[it];
bV = aImgB->m_pixels[it];
m_pixels[it] = (aV > bV)?aV:bV;
}
break;
default:
break;
}
}
// TIP: If you want create or test filters you can use GIMP
// with a generic convolution matrix and get the values from there.
// http://docs.gimp.org/nl/plug-in-convmatrix.html
static const S_FILTER FILTERS[] = {
// Hi Pass
{
{ { 0, -1, -1, -1, 0},
{-1, 2, -4, 2, -1},
{-1, -4, 13, -4, -1},
{-1, 2, -4, 2, -1},
{ 0, -1, -1, -1, 0}
},
7,
255
},
// Blur
{
{ { 3, 5, 7, 5, 3},
{ 5, 9, 12, 9, 5},
{ 7, 12, 20, 12, 7},
{ 5, 9, 12, 9, 5},
{ 3, 5, 7, 5, 3}
},
182,
0
},
// Blur Invert
{
{ { 0, 0, 0, 0, 0},
{ 0, 0, -1, 0, 0},
{ 0, -1, 0, -1, 0},
{ 0, 0, -1, 0, 0},
{ 0, 0, 0, 0, 0}
},
4,
255
},
//
{
{ { 0, 2, 4, 2, 0},
{ 2, -2, 1, -2, 2},
{ 4, 1, -8, 1, 4},
{ 2, -2, 1, -2, 2},
{ 0, 2, 4, 2, 0}
},
20,
0
},
// Cartoon
{
{ {-1, -1, -1, -1, 0},
{-1, 0, 0, 0, 0},
{-1, 0, 4, 0, 0},
{ 0, 0, 0, 1, 0},
{ 0, 0, 0, 0, 4}
},
3,
0
},
// Emboss
{
{ {-1, -1, -1, -1, 0},
{-1, -1, -1, 0, 1},
{-1, -1, 0, 1, 1},
{-1, 0, 1, 1, 1},
{ 0, 1, 1, 1, 1}
},
1,
128
},
// Sharpen
{
{ {-1, -1, -1, -1, -1},
{-1, 2, 2, 2, -1},
{-1, 2, 8, 2, -1},
{-1, 2, 2, 2, -1},
{-1, -1, -1, -1, -1}
},
8,
0
},
// Melt
{
{ { 4, 2, 6, 8, 1},
{ 1, 2, 5, 4, 2},
{ 0, -1, 1, -1, 0},
{ 0, 0, -2, 0, 0},
{ 0, 0, 0, 0, 0}
},
32,
0
},
// Sobel Gx
{
{ { 0, 0, 0, 0, 0},
{ 0, -1, 0, 1, 0},
{ 0, -2, 0, 2, 0},
{ 0, -1, 0, 1, 0},
{ 0, 0, 0, 0, 0}
},
1,
0
},
// Sobel Gy
{
{ { 1, 2, 4, 2, 1},
{-1, -1, 0, 1, 1},
{-2, -2, 0, 2, 2},
{-1, -1, 0, 1, 1},
{-1, -2, -4, -2, -1},
},
1,
0
}
};// Filters
//!TODO: This functions can be optimized slipting it between the edges and
// do it without use the getpixel function.
// Optimization can be done to m_pixels[ix + iy * m_width]
// but keep in mind the parallel process of the algorithm
void CIMAGE::EfxFilter( CIMAGE *aInImg, E_FILTER aFilterType )
{
S_FILTER filter = FILTERS[aFilterType];
aInImg->m_wraping = WRAP_CLAMP;
m_wraping = WRAP_CLAMP;
#ifdef USE_OPENMP
#pragma omp parallel for
#endif /* USE_OPENMP */
for( int iy = 0; iy < (int)m_height; iy++)
{
for( int ix = 0; ix < (int)m_width; ix++ )
{
int v = 0;
for( int sy = 0; sy < 5; sy++ )
{
for( int sx = 0; sx < 5; sx++ )
{
int factor = filter.kernel[sx][sy];
unsigned char pixelv = aInImg->Getpixel( ix + sx - 2, iy + sy - 2 );
v += pixelv * factor;
}
}
v /= filter.div;
v += filter.offset;
CLAMP(v, 0, 255);
m_pixels[ix + iy * m_width] = v;
}
}
}
void CIMAGE::SetPixelsFromNormalizedFloat( const float * aNormalizedFloatArray )
{
for( unsigned int i = 0; i < m_wxh; i++ )
{
int v = aNormalizedFloatArray[i] * 255;
CLAMP(v, 0, 255);
m_pixels[i] = v;
}
}
void CIMAGE::SaveAsPNG( wxString aFileName ) const
{
unsigned char* pixelbuffer = (unsigned char*) malloc( m_wxh * 3 );
wxImage image( m_width, m_height );
for( unsigned int i = 0; i < m_wxh; i++)
{
unsigned char v = m_pixels[i];
// Set RGB value with all same values intensities
pixelbuffer[i * 3 + 0] = v;
pixelbuffer[i * 3 + 1] = v;
pixelbuffer[i * 3 + 2] = v;
}
image.SetData( pixelbuffer );
image = image.Mirror( false );
image.SaveFile( aFileName + ".png", wxBITMAP_TYPE_PNG );
image.Destroy();
}
-190
View File
@@ -1,190 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015 Mario Luzeiro <mrluzeiro@gmail.com>
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file CImage.h
* @brief one 8bit-channel image definition
*/
#ifndef CImage_h
#define CImage_h
#include <wx/string.h>
/// Image operation type
enum E_IMAGE_OP {
COPY_RAW,
COPY_ADD,
COPY_SUB,
COPY_DIF,
COPY_MUL,
COPY_AND,
COPY_OR,
COPY_XOR,
COPY_BLEND50,
COPY_MIN,
COPY_MAX
};
/// Image wrap type enumeration
enum E_WRAP {
WRAP_ZERO, ///< Coords that wraps are not evaluated
WRAP_CLAMP, ///< Coords are clamped to image size
WRAP_WRAP ///< Coords are wrapped arround
};
/// Filter type enumeration
enum E_FILTER {
FILTER_HIPASS,
FILTER_GAUSSIAN_BLUR,
FILTER_INVERT_BLUR,
};
/// 5x5 Filter struct parameters
typedef struct {
signed char kernel[5][5];
unsigned char div;
unsigned char offset;
}S_FILTER;
/**
* Class CIMAGE
* manages a 8-bit channel image
*/
class CIMAGE
{
public:
/**
* Constructor CIMAGE
* constructs a CIMAGE based on image size
* @param aXsize x size
* @param aYsize y size
*/
CIMAGE( unsigned int aXsize, unsigned int aYsize );
~CIMAGE();
/**
* Function Setpixel
* set a value in a pixel position, position is clamped in accord with the
* current clamp settings
* @param aX x position
* @param aY y position
* @param aValue value to set the pixel
*/
void Setpixel( int aX, int aY, unsigned char aValue );
/**
* Function Getpixel
* get the pixel value from pixel position, position is clamped in accord with the
* current clamp settings
* @param aX x position
* @param aY y position
* @return unsigned char - pixel value
*/
unsigned char Getpixel( int aX, int aY ) const;
/**
* Function CopyFull
* perform a copy operation, based on operation type. The result destination is the self image class
* @param aImgA an image input
* @param aImgB an image input
* @param aOperation operation to perform
* COPY_RAW this <- aImgA
* COPY_ADD this <- CLAMP(aImgA + aImgB)
* COPY_SUB this <- CLAMP(aImgA - aImgB)
* COPY_DIF this <- abs(aImgA - aImgB)
* COPY_MUL this <- aImgA * aImgB
* COPY_AND this <- aImgA & aImgB
* COPY_OR this <- aImgA | aImgB
* COPY_XOR this <- aImgA ^ aImgB
* COPY_BLEND50 this <- (aImgA + aImgB) / 2
* COPY_MIN this <- (aImgA < aImgB)?aImgA:aImgB
* COPY_MAX this <- (aImgA > aImgB)?aImgA:aImgB
*/
void CopyFull( const CIMAGE *aImgA, const CIMAGE *aImgB, E_IMAGE_OP aOperation );
/**
* Function Invert
* invert the values of image this <- (255 - this)
*/
void Invert();
/**
* Function EfxFilter
* apply a filter to the input image and stores it in the image class
* this <- FilterType(aInImg)
* @param aInImg input image
* @param aFilterType filter type to apply
*/
void EfxFilter( CIMAGE *aInImg, E_FILTER aFilterType );
/**
* Function SaveAsPNG
* save image buffer to a PNG file into the working folder.
* each of RGB channel will have the 8bit-channel from the image.
* @param aFileName fime name (without extension)
*/
void SaveAsPNG( wxString aFileName ) const;
/**
* Function SetPixelsFromNormalizedFloat
* set the current channel from a float normalized (0.0 - 1.0) buffer
* this <- CLAMP(NormalizedFloat * 255)
* @param aNormalizedFloatArray a float array with the same size of the image
*/
void SetPixelsFromNormalizedFloat( const float * aNormalizedFloatArray );
/**
* Function GetBuffer
* get the image buffer pointer
* @return unsigned char * - the pointer of the buffer 8bit channel
*/
unsigned char* GetBuffer() const;
private:
/**
* Function wrapCoords
* calculate the coordinates points in accord with the current clamping settings
* @param aXo X coordinate to be converted (output)
* @param aXo Y coordinate to be converted (output)
* @return bool - true if the coordinates are inside the image, false otherwise
*/
bool wrapCoords( int *aXo, int *aYo ) const;
private:
unsigned char* m_pixels; ///< buffer to store the image 8bit-channel
unsigned int m_width; ///< width of the image
unsigned int m_height; ///< height of the image
unsigned int m_wxh; ///< width * height precalc value
E_WRAP m_wraping; ///< current wrapping type
};
#endif // CImage_h
+1 -13
View File
@@ -2,10 +2,8 @@ add_definitions(-DPCBNEW)
include_directories(BEFORE ${INC_BEFORE})
include_directories(
textures
../pcbnew
../polygon
${GLEW_INCLUDE_DIR}
${INC_AFTER}
)
@@ -16,24 +14,14 @@ set(3D-VIEWER_SRCS
3d_canvas.cpp
3d_class.cpp
3d_draw.cpp
3d_draw_board_body.cpp
3d_draw_basic_functions.cpp
3d_draw_helper_functions.cpp
3d_frame.cpp
3d_material.cpp
3d_mesh_model.cpp
3d_read_mesh.cpp
3d_toolbar.cpp
info3d_visu.cpp
trackball.cpp
vrmlmodelparser.cpp
vrml_aux.cpp
vrml_v1_modelparser.cpp
vrml_v2_modelparser.cpp
x3dmodelparser.cpp
CImage.cpp
CBBox.cpp
vrmlmodelparser.cpp
)
add_library(3d-viewer STATIC ${3D-VIEWER_SRCS})
add_dependencies( 3d-viewer pcbcommon )
+3 -46
View File
@@ -1,26 +1,3 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2014-2015 KiCad Developers, see CHANGELOG.TXT for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "dialog_3D_view_option_base.h"
#include <3d_viewer.h>
@@ -41,14 +18,11 @@ private:
void OnShowAllClick( wxCommandEvent& event );
void OnShowNoneClick( wxCommandEvent& event );
void OnOKClick( wxCommandEvent& event );
void OnCheckRealisticMode( wxCommandEvent& event );
};
void EDA_3D_FRAME::Install_3D_ViewOptionDialog( wxCommandEvent& event )
{
DIALOG_3D_VIEW_OPTIONS dlg( this );
if( dlg.ShowModal() == wxID_OK )
{
SetMenuBarOptionsState();
@@ -64,16 +38,13 @@ DIALOG_3D_VIEW_OPTIONS::DIALOG_3D_VIEW_OPTIONS( EDA_3D_FRAME* parent )
initDialog();
SetDefaultItem( (wxWindow*) m_sdbSizerOK );
Layout();
GetSizer()->SetSizeHints( this );
GetSizer()->SetSizeHints(this);
Centre();
}
void DIALOG_3D_VIEW_OPTIONS::initDialog()
{
m_bitmapRealisticMode->SetBitmap( KiBitmap( use_3D_copper_thickness_xpm ) );
m_bitmapCuThickness->SetBitmap( KiBitmap( use_3D_copper_thickness_xpm ) );
m_bitmap3Dshapes->SetBitmap( KiBitmap( shape_3d_xpm ) );
m_bitmapAreas->SetBitmap( KiBitmap( add_zone_xpm ) );
@@ -85,7 +56,6 @@ void DIALOG_3D_VIEW_OPTIONS::initDialog()
m_bitmapECO->SetBitmap( KiBitmap( edit_sheet_xpm ) );
// Check/uncheck checkboxes
m_checkBoxRealisticMode->SetValue( m_3Dprms.GetFlag( FL_USE_REALISTIC_MODE ) );
m_checkBoxCuThickness->SetValue( m_3Dprms.GetFlag( FL_USE_COPPER_THICKNESS ) );
m_checkBox3Dshapes->SetValue( m_3Dprms.GetFlag( FL_MODULE ) );
m_checkBoxAreas->SetValue( m_3Dprms.GetFlag( FL_ZONE ) );
@@ -93,19 +63,8 @@ void DIALOG_3D_VIEW_OPTIONS::initDialog()
m_checkBoxSolderMask->SetValue( m_3Dprms.GetFlag( FL_SOLDERMASK ) );
m_checkBoxSolderpaste->SetValue( m_3Dprms.GetFlag( FL_SOLDERPASTE ) );
m_checkBoxAdhesive->SetValue( m_3Dprms.GetFlag( FL_ADHESIVE ) );
m_checkBoxComments->SetValue( m_3Dprms.GetFlag( FL_COMMENTS ) );
m_checkBoxECO->SetValue( m_3Dprms.GetFlag( FL_ECO ) );
bool enable = !m_3Dprms.GetFlag( FL_USE_REALISTIC_MODE );
m_checkBoxComments->Enable( enable );
m_checkBoxECO->Enable( enable );
}
void DIALOG_3D_VIEW_OPTIONS::OnCheckRealisticMode( wxCommandEvent& event )
{
bool enable = !m_checkBoxRealisticMode->GetValue();
m_checkBoxComments->Enable( enable );
m_checkBoxECO->Enable( enable );
}
void DIALOG_3D_VIEW_OPTIONS::OnShowAllClick( wxCommandEvent& event )
@@ -122,7 +81,6 @@ void DIALOG_3D_VIEW_OPTIONS::OnShowAllClick( wxCommandEvent& event )
m_checkBoxECO->SetValue( state );
}
void DIALOG_3D_VIEW_OPTIONS::OnShowNoneClick( wxCommandEvent& event )
{
bool state = false;
@@ -137,11 +95,10 @@ void DIALOG_3D_VIEW_OPTIONS::OnShowNoneClick( wxCommandEvent& event )
m_checkBoxECO->SetValue( state );
}
void DIALOG_3D_VIEW_OPTIONS::OnOKClick( wxCommandEvent& event )
{
m_3Dprms.SetFlag( FL_USE_REALISTIC_MODE, m_checkBoxRealisticMode->GetValue() );
m_3Dprms.SetFlag( FL_USE_COPPER_THICKNESS, m_checkBoxCuThickness->GetValue() );
m_3Dprms.SetFlag( FL_USE_COPPER_THICKNESS,
m_checkBoxCuThickness->GetValue() );
m_3Dprms.SetFlag( FL_MODULE, m_checkBox3Dshapes->GetValue() );
m_3Dprms.SetFlag( FL_ZONE, m_checkBoxAreas->GetValue() );
m_3Dprms.SetFlag( FL_SILKSCREEN, m_checkBoxSilkscreen->GetValue() );
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jun 17 2015)
// C++ code generated with wxFormBuilder (version Oct 8 2012)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@@ -20,69 +20,63 @@ DIALOG_3D_VIEW_OPTIONS_BASE::DIALOG_3D_VIEW_OPTIONS_BASE( wxWindow* parent, wxWi
bSizerLeft = new wxBoxSizer( wxHORIZONTAL );
wxFlexGridSizer* fgSizeShowOpts;
fgSizeShowOpts = new wxFlexGridSizer( 0, 2, 0, 0 );
fgSizeShowOpts = new wxFlexGridSizer( 9, 2, 0, 0 );
fgSizeShowOpts->SetFlexibleDirection( wxBOTH );
fgSizeShowOpts->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_bitmapRealisticMode = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgSizeShowOpts->Add( m_bitmapRealisticMode, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_checkBoxRealisticMode = new wxCheckBox( this, wxID_ANY, _("Realistic mode"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizeShowOpts->Add( m_checkBoxRealisticMode, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_bitmapCuThickness = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgSizeShowOpts->Add( m_bitmapCuThickness, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
fgSizeShowOpts->Add( m_bitmapCuThickness, 0, wxALL, 5 );
m_checkBoxCuThickness = new wxCheckBox( this, wxID_ANY, _("Show copper thickness"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizeShowOpts->Add( m_checkBoxCuThickness, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
fgSizeShowOpts->Add( m_checkBoxCuThickness, 0, wxALL, 5 );
m_bitmap3Dshapes = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgSizeShowOpts->Add( m_bitmap3Dshapes, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
fgSizeShowOpts->Add( m_bitmap3Dshapes, 0, wxALL, 5 );
m_checkBox3Dshapes = new wxCheckBox( this, wxID_ANY, _("Show 3D Models"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizeShowOpts->Add( m_checkBox3Dshapes, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_checkBox3Dshapes = new wxCheckBox( this, wxID_ANY, _("Show component 3D shapes"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizeShowOpts->Add( m_checkBox3Dshapes, 0, wxALL, 5 );
m_bitmapAreas = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgSizeShowOpts->Add( m_bitmapAreas, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
fgSizeShowOpts->Add( m_bitmapAreas, 0, wxALL, 5 );
m_checkBoxAreas = new wxCheckBox( this, wxID_ANY, _("Show filled areas in zones"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizeShowOpts->Add( m_checkBoxAreas, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
fgSizeShowOpts->Add( m_checkBoxAreas, 0, wxALL, 5 );
m_bitmapSilkscreen = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgSizeShowOpts->Add( m_bitmapSilkscreen, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
fgSizeShowOpts->Add( m_bitmapSilkscreen, 0, wxALL, 5 );
m_checkBoxSilkscreen = new wxCheckBox( this, wxID_ANY, _("Show silkscreen layers"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizeShowOpts->Add( m_checkBoxSilkscreen, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
fgSizeShowOpts->Add( m_checkBoxSilkscreen, 0, wxALL, 5 );
m_bitmapSolderMask = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgSizeShowOpts->Add( m_bitmapSolderMask, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
fgSizeShowOpts->Add( m_bitmapSolderMask, 0, wxALL, 5 );
m_checkBoxSolderMask = new wxCheckBox( this, wxID_ANY, _("Show solder mask layers"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizeShowOpts->Add( m_checkBoxSolderMask, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
fgSizeShowOpts->Add( m_checkBoxSolderMask, 0, wxALL, 5 );
m_bitmapSolderPaste = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgSizeShowOpts->Add( m_bitmapSolderPaste, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
fgSizeShowOpts->Add( m_bitmapSolderPaste, 0, wxALL, 5 );
m_checkBoxSolderpaste = new wxCheckBox( this, wxID_ANY, _("Show solder paste layers"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizeShowOpts->Add( m_checkBoxSolderpaste, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
fgSizeShowOpts->Add( m_checkBoxSolderpaste, 0, wxALL, 5 );
m_bitmapAdhesive = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgSizeShowOpts->Add( m_bitmapAdhesive, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
fgSizeShowOpts->Add( m_bitmapAdhesive, 0, wxALL, 5 );
m_checkBoxAdhesive = new wxCheckBox( this, wxID_ANY, _("Show adhesive layers"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizeShowOpts->Add( m_checkBoxAdhesive, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
fgSizeShowOpts->Add( m_checkBoxAdhesive, 0, wxALL, 5 );
m_bitmapComments = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgSizeShowOpts->Add( m_bitmapComments, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
fgSizeShowOpts->Add( m_bitmapComments, 0, wxALL, 5 );
m_checkBoxComments = new wxCheckBox( this, wxID_ANY, _("Show comments and drawings layers"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizeShowOpts->Add( m_checkBoxComments, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_checkBoxComments = new wxCheckBox( this, wxID_ANY, _("Show comments and drawings Layers"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizeShowOpts->Add( m_checkBoxComments, 0, wxALL, 5 );
m_bitmapECO = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgSizeShowOpts->Add( m_bitmapECO, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
fgSizeShowOpts->Add( m_bitmapECO, 0, wxALL, 5 );
m_checkBoxECO = new wxCheckBox( this, wxID_ANY, _("Show ECO layers"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizeShowOpts->Add( m_checkBoxECO, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_checkBoxECO = new wxCheckBox( this, wxID_ANY, _("Show ECOs layers"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizeShowOpts->Add( m_checkBoxECO, 0, wxALL, 5 );
bSizerLeft->Add( fgSizeShowOpts, 1, wxEXPAND, 5 );
@@ -112,28 +106,27 @@ DIALOG_3D_VIEW_OPTIONS_BASE::DIALOG_3D_VIEW_OPTIONS_BASE( wxWindow* parent, wxWi
m_sdbSizer->AddButton( m_sdbSizerCancel );
m_sdbSizer->Realize();
bSizerMain->Add( m_sdbSizer, 0, wxALL|wxEXPAND, 5 );
bSizerMain->Add( m_sdbSizer, 0, wxALIGN_RIGHT, 5 );
this->SetSizer( bSizerMain );
this->Layout();
bSizerMain->Fit( this );
this->Centre( wxBOTH );
// Connect Events
m_checkBoxRealisticMode->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_3D_VIEW_OPTIONS_BASE::OnCheckRealisticMode ), NULL, this );
m_buttonShowAll->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_3D_VIEW_OPTIONS_BASE::OnShowAllClick ), NULL, this );
m_buttonShowNone->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_3D_VIEW_OPTIONS_BASE::OnShowNoneClick ), NULL, this );
m_sdbSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_3D_VIEW_OPTIONS_BASE::OnCancelClick ), NULL, this );
m_sdbSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_3D_VIEW_OPTIONS_BASE::OnOKClick ), NULL, this );
}
DIALOG_3D_VIEW_OPTIONS_BASE::~DIALOG_3D_VIEW_OPTIONS_BASE()
{
// Disconnect Events
m_checkBoxRealisticMode->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_3D_VIEW_OPTIONS_BASE::OnCheckRealisticMode ), NULL, this );
m_buttonShowAll->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_3D_VIEW_OPTIONS_BASE::OnShowAllClick ), NULL, this );
m_buttonShowNone->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_3D_VIEW_OPTIONS_BASE::OnShowNoneClick ), NULL, this );
m_sdbSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_3D_VIEW_OPTIONS_BASE::OnCancelClick ), NULL, this );
m_sdbSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_3D_VIEW_OPTIONS_BASE::OnOKClick ), NULL, this );
}
+26 -197
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="13" />
<FileVersion major="1" minor="11" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
@@ -20,10 +20,8 @@
<property name="path">.</property>
<property name="precompiled_header"></property>
<property name="relative_path">1</property>
<property name="skip_lua_events">1</property>
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property>
<object class="Dialog" expanded="1">
@@ -44,7 +42,7 @@
<property name="minimum_size"></property>
<property name="name">DIALOG_3D_VIEW_OPTIONS_BASE</property>
<property name="pos"></property>
<property name="size">-1,-1</property>
<property name="size">340,344</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
<property name="title">3D Display Options</property>
@@ -116,180 +114,11 @@
<property name="name">fgSizeShowOpts</property>
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
<property name="permission">none</property>
<property name="rows">0</property>
<property name="rows">9</property>
<property name="vgap">0</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxStaticBitmap" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_bitmapRealisticMode</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Realistic mode</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_checkBoxRealisticMode</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox">OnCheckRealisticMode</event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticBitmap" expanded="1">
<property name="BottomDockable">1</property>
@@ -370,7 +199,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
@@ -458,7 +287,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticBitmap" expanded="1">
<property name="BottomDockable">1</property>
@@ -539,7 +368,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
@@ -570,7 +399,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Show 3D Models</property>
<property name="label">Show component 3D shapes</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@@ -627,7 +456,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticBitmap" expanded="1">
<property name="BottomDockable">1</property>
@@ -708,7 +537,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
@@ -796,7 +625,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticBitmap" expanded="1">
<property name="BottomDockable">1</property>
@@ -877,7 +706,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
@@ -965,7 +794,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticBitmap" expanded="1">
<property name="BottomDockable">1</property>
@@ -1046,7 +875,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
@@ -1134,7 +963,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticBitmap" expanded="1">
<property name="BottomDockable">1</property>
@@ -1215,7 +1044,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
@@ -1303,7 +1132,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticBitmap" expanded="1">
<property name="BottomDockable">1</property>
@@ -1384,7 +1213,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
@@ -1472,7 +1301,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticBitmap" expanded="1">
<property name="BottomDockable">1</property>
@@ -1553,7 +1382,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
@@ -1584,7 +1413,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Show comments and drawings layers</property>
<property name="label">Show comments and drawings Layers</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@@ -1641,7 +1470,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticBitmap" expanded="1">
<property name="BottomDockable">1</property>
@@ -1722,7 +1551,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
@@ -1753,7 +1582,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Show ECO layers</property>
<property name="label">Show ECOs layers</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@@ -2082,7 +1911,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="flag">wxALIGN_RIGHT</property>
<property name="proportion">0</property>
<object class="wxStdDialogButtonSizer" expanded="1">
<property name="Apply">0</property>
@@ -2097,7 +1926,7 @@
<property name="name">m_sdbSizer</property>
<property name="permission">protected</property>
<event name="OnApplyButtonClick"></event>
<event name="OnCancelButtonClick"></event>
<event name="OnCancelButtonClick">OnCancelClick</event>
<event name="OnContextHelpButtonClick"></event>
<event name="OnHelpButtonClick"></event>
<event name="OnNoButtonClick"></event>
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jun 17 2015)
// C++ code generated with wxFormBuilder (version Oct 8 2012)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@@ -40,8 +40,6 @@ class DIALOG_3D_VIEW_OPTIONS_BASE : public DIALOG_SHIM
private:
protected:
wxStaticBitmap* m_bitmapRealisticMode;
wxCheckBox* m_checkBoxRealisticMode;
wxStaticBitmap* m_bitmapCuThickness;
wxCheckBox* m_checkBoxCuThickness;
wxStaticBitmap* m_bitmap3Dshapes;
@@ -68,15 +66,15 @@ class DIALOG_3D_VIEW_OPTIONS_BASE : public DIALOG_SHIM
wxButton* m_sdbSizerCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnCheckRealisticMode( wxCommandEvent& event ) { event.Skip(); }
virtual void OnShowAllClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnShowNoneClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOKClick( wxCommandEvent& event ) { event.Skip(); }
public:
DIALOG_3D_VIEW_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("3D Display Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
DIALOG_3D_VIEW_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("3D Display Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 340,344 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_3D_VIEW_OPTIONS_BASE();
};
+43 -62
View File
@@ -1,8 +1,8 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2014 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 1992-2014 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2012 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -62,19 +62,16 @@ INFO3D_VISU::INFO3D_VISU()
m_CopperLayersCount = 2;
m_BoardSettings = NULL;
m_copperThickness = 0;
m_epoxyThickness = 0;
m_nonCopperLayerThickness = 0;
m_BiuTo3Dunits = 1.0;
zpos_offset = 0.0;
m_CopperThickness = 0;
m_EpoxyThickness = 0;
m_NonCopperLayerThickness = 0;
// default all special item layers Visible
m_drawFlags.set();
for( ii = 0; ii < FL_LAST; ii++ )
m_drawFlags[ii] = true;
SetFlag( FL_GRID, false );
SetFlag( FL_USE_COPPER_THICKNESS, false );
SetFlag( FL_RENDER_SHADOWS, false );
SetFlag( FL_RENDER_SHOW_HOLES_IN_ZONES, false );
}
@@ -87,17 +84,13 @@ INFO3D_VISU::~INFO3D_VISU()
*/
void INFO3D_VISU::InitSettings( BOARD* aBoard )
{
// Calculates the board bounding box
// First, use only the board outlines
EDA_RECT bbbox = aBoard->ComputeBoundingBox( true );
EDA_RECT bbbox = aBoard->ComputeBoundingBox( false );
// If no outlines, use the board with items
if( bbbox.GetWidth() == 0 && bbbox.GetHeight() == 0 )
bbbox = aBoard->ComputeBoundingBox( false );
// Gives a non null size to avoid issues in zoom / scale calculations
if( bbbox.GetWidth() == 0 && bbbox.GetHeight() == 0 )
bbbox.Inflate( Millimeter2iu( 10 ) );
{
bbbox.SetWidth( Millimeter2iu( 100 ) );
bbbox.SetHeight( Millimeter2iu( 100 ) );
}
m_BoardSettings = &aBoard->GetDesignSettings();
@@ -114,109 +107,97 @@ void INFO3D_VISU::InitSettings( BOARD* aBoard )
m_BiuTo3Dunits = 2.0 / std::max( m_BoardSize.x, m_BoardSize.y );
m_epoxyThickness = aBoard->GetDesignSettings().GetBoardThickness() * m_BiuTo3Dunits;
m_EpoxyThickness = aBoard->GetDesignSettings().GetBoardThickness() * m_BiuTo3Dunits;
// TODO use value defined by user (currently use default values by ctor
m_copperThickness = COPPER_THICKNESS * m_BiuTo3Dunits;
m_nonCopperLayerThickness = TECH_LAYER_THICKNESS * m_BiuTo3Dunits;
m_CopperThickness = COPPER_THICKNESS * m_BiuTo3Dunits;
m_NonCopperLayerThickness = TECH_LAYER_THICKNESS * m_BiuTo3Dunits;
// Init Z position of each layer
// calculate z position for each copper layer
// Z = 0 is the z position of the back (bottom) layer (layer id = 31)
// Z = m_epoxyThickness is the z position of the front (top) layer (layer id = 0)
// all unused copper layer z position are set to 0
int layer;
int copper_layers_cnt = m_CopperLayersCount;
for( layer = 0; layer < copper_layers_cnt; layer++ )
{
m_layerZcoord[layer] =
m_epoxyThickness - (m_epoxyThickness * layer / (copper_layers_cnt - 1));
m_LayerZcoord[layer] =
m_EpoxyThickness * layer / (copper_layers_cnt - 1);
}
#define layerThicknessMargin 1.1
double zpos_offset = m_nonCopperLayerThickness * layerThicknessMargin;
double zpos_copper_back = - layerThicknessMargin*m_copperThickness/2;
double zpos_copper_front = m_epoxyThickness + layerThicknessMargin*m_copperThickness/2;
double zpos_offset = m_NonCopperLayerThickness * layerThicknessMargin;
double zpos_copper_back = m_LayerZcoord[0] - layerThicknessMargin*m_CopperThickness/2;
double zpos_copper_front = m_EpoxyThickness + layerThicknessMargin*m_CopperThickness/2;
// Fill remaining unused copper layers and back layer zpos
// with 0
for( ; layer < MAX_CU_LAYERS; layer++ )
// Fill remaining unused copper layers and front layer zpos
// with m_EpoxyThickness
// Solder mask and Solder paste have the same Z position
for( ; layer <= LAST_COPPER_LAYER; layer++ )
{
m_layerZcoord[layer] = 0;
m_LayerZcoord[layer] = m_EpoxyThickness;
}
// calculate z position for each non copper layer
// Solder mask and Solder paste have the same Z position
for( int layer_id = MAX_CU_LAYERS; layer_id < LAYER_ID_COUNT; layer_id++ )
for( int layer_id = FIRST_NON_COPPER_LAYER; layer_id < NB_PCB_LAYERS; layer_id++ )
{
double zpos;
switch( layer_id )
{
case B_Adhes:
case ADHESIVE_N_BACK:
zpos = zpos_copper_back - 3 * zpos_offset;
break;
case F_Adhes:
case ADHESIVE_N_FRONT:
zpos = zpos_copper_front + 3 * zpos_offset;
break;
case B_Paste:
case SOLDERPASTE_N_BACK:
zpos = zpos_copper_back - 1 * zpos_offset;
break;
case F_Paste:
case SOLDERPASTE_N_FRONT:
zpos = zpos_copper_front + 1 * zpos_offset;
break;
case B_Mask:
case SOLDERMASK_N_BACK:
zpos = zpos_copper_back - 1 * zpos_offset;
break;
case F_Mask:
case SOLDERMASK_N_FRONT:
zpos = zpos_copper_front + 1 * zpos_offset;
break;
case B_SilkS:
case SILKSCREEN_N_BACK:
zpos = zpos_copper_back - 2 * zpos_offset;
break;
case F_SilkS:
case SILKSCREEN_N_FRONT:
zpos = zpos_copper_front + 2 * zpos_offset;
break;
default:
zpos = zpos_copper_front + (layer_id - MAX_CU_LAYERS + 4) * zpos_offset;
zpos = zpos_copper_front +
(layer_id - FIRST_NON_COPPER_LAYER + 4) * zpos_offset;
break;
}
m_layerZcoord[layer_id] = zpos;
m_LayerZcoord[layer_id] = zpos;
}
}
/* return the Z position of 3D shapes, in 3D Units
* aIsFlipped: true for modules on Front (top) layer, false
* if on back (bottom) layer
* Note: in draw functions, the copper has a thickness = m_copperThickness
* Vias and tracks are draw with the top side position = m_copperThickness/2
* and the bottom side position = -m_copperThickness/2 from the Z layer position
* Note: in draw functions, the copper has a thickness = m_CopperThickness
* Vias and tracks are draw with the top side position = m_CopperThickness/2
* and the bottom side position = -m_CopperThickness/2 from the Z layer position
*/
double INFO3D_VISU::GetModulesZcoord3DIU( bool aIsFlipped )
{
if( aIsFlipped )
{
if( g_Parm_3D_Visu.GetFlag( FL_SOLDERPASTE ) )
return m_layerZcoord[B_SilkS] - ( m_copperThickness / 2.0 );
else
return m_layerZcoord[B_Paste] - ( m_copperThickness / 2.0 );
}
if( aIsFlipped )
return m_LayerZcoord[LAYER_N_BACK] - ( m_CopperThickness / 2 );
else
{
if( g_Parm_3D_Visu.GetFlag( FL_SOLDERPASTE ) )
return m_layerZcoord[F_SilkS] + ( m_copperThickness / 2.0 );
else
return m_layerZcoord[F_Paste] + ( m_copperThickness / 2.0 );
}
return m_LayerZcoord[LAYER_N_FRONT] + ( m_CopperThickness / 2 );
}
+31 -41
View File
@@ -52,9 +52,7 @@
class BOARD_DESIGN_SETTINGS;
/** Minor class to store a 3D color (R, G, B) 3 floats range 0 to 1.0
*/
class S3D_COLOR
class S3D_COLOR /* 3D color (R, G, B) 3 floats range 0 to 1.0*/
{
public:
double m_Red, m_Green, m_Blue;
@@ -64,6 +62,7 @@ public: S3D_COLOR()
}
};
/* information needed to display 3D board */
enum DISPLAY3D_FLG {
FL_AXIS=0, FL_MODULE, FL_ZONE,
FL_ADHESIVE, FL_SILKSCREEN, FL_SOLDERMASK, FL_SOLDERPASTE,
@@ -72,18 +71,9 @@ enum DISPLAY3D_FLG {
FL_USE_COPPER_THICKNESS,
FL_SHOW_BOARD_BODY,
FL_USE_REALISTIC_MODE,
FL_RENDER_SHADOWS,
FL_RENDER_SHOW_HOLES_IN_ZONES,
FL_RENDER_TEXTURES,
FL_RENDER_SMOOTH_NORMALS,
FL_RENDER_USE_MODEL_NORMALS,
FL_RENDER_MATERIAL,
FL_RENDER_SHOW_MODEL_BBOX,
FL_LAST
};
/** Helper class to handle information needed to display 3D board
*/
class INFO3D_VISU
{
public:
@@ -93,12 +83,6 @@ public:
double m_Zoom; // 3D zoom value
double m_3D_Grid; // 3D grid value, in mm
S3D_COLOR m_BgColor;
S3D_COLOR m_BgColor_Top;
S3D_COLOR m_BoardBodyColor; // in realistic mode: FR4 board color
S3D_COLOR m_SolderMaskColor; // in realistic mode: solder mask color
S3D_COLOR m_SolderPasteColor; // in realistic mode: solder paste color
S3D_COLOR m_SilkScreenColor; // in realistic mode: SilkScreen color
S3D_COLOR m_CopperColor; // in realistic mode: copper color
wxPoint m_BoardPos; // center board actual position in board units
wxSize m_BoardSize; // board actual size in board units
int m_CopperLayersCount; // Number of copper layers actually used by the board
@@ -107,34 +91,35 @@ public:
double m_BiuTo3Dunits; // Normalization scale to convert board
// internal units to 3D units
// to normalize 3D units between -1.0 and +1.0
double zpos_offset;
// to scale 3D units between -1.0 and +1.0
double m_CurrentZpos; // temporary storage of current value of Z position,
// used in some calculation
private:
double m_layerZcoord[LAYER_ID_COUNT]; // Z position of each layer (normalized)
double m_copperThickness; // Copper thickness (normalized)
double m_epoxyThickness; // Epoxy thickness (normalized)
double m_nonCopperLayerThickness; // Non copper layers thickness
std::bitset<FL_LAST> m_drawFlags; // Enable/disable flags (see DISPLAY3D_FLG list)
double m_LayerZcoord[NB_LAYERS]; // Z position of each layer (normalized)
double m_CopperThickness; // Copper thickness (normalized)
double m_EpoxyThickness; // Epoxy thickness (normalized)
double m_NonCopperLayerThickness; // Non copper layers thickness
bool m_drawFlags[FL_LAST]; // Enable/disable flags (see DISPLAY3D_FLG list)
public: INFO3D_VISU();
~INFO3D_VISU();
// Accessors
bool GetFlag( DISPLAY3D_FLG aFlag ) const { return m_drawFlags[aFlag]; }
void SetFlag( DISPLAY3D_FLG aFlag, bool aState )
bool SetFlag( DISPLAY3D_FLG aFlag, bool aState )
{
m_drawFlags[aFlag] = aState;
return m_drawFlags[aFlag] = aState;
}
/**
* Initialize 3D Parameters depending on aBoard
* Function InitSettings
* Initialize info 3D Parameters from aBoard
* @param aBoard: the board to display
*/
void InitSettings( BOARD* aBoard );
/**
* function GetModulesZcoord3DIU
* @return the Z position of 3D shapes, in 3D Units
* @param aIsFlipped: true for modules on Front (top) layer, false
* if on back (bottom) layer
@@ -142,15 +127,17 @@ public: INFO3D_VISU();
double GetModulesZcoord3DIU( bool aIsFlipped );
/**
* function GetLayerZcoordBIU
* @return the Z coordinate of the layer aLayer, in Board Internal Units
* @param aLayerId: the layer number
*/
int GetLayerZcoordBIU( int aLayerId )
{
return KiROUND( m_layerZcoord[aLayerId] / m_BiuTo3Dunits );
return KiROUND( m_LayerZcoord[aLayerId] / m_BiuTo3Dunits );
}
/**
* function GetCopperThicknessBIU
* @return the thickness (Z size) of the copper, in Board Internal Units
* note: the thickness (Z size) of the copper is not the thickness
* of the layer (the thickness of the layer is the epoxy thickness / layer count)
@@ -160,10 +147,11 @@ public: INFO3D_VISU();
*/
int GetCopperThicknessBIU() const
{
bool use_thickness = GetFlag( FL_USE_COPPER_THICKNESS );
bool use_thickness = GetFlag( FL_USE_COPPER_THICKNESS )
// || GetFlag( FL_USE_REALISTIC_MODE )
;
return use_thickness ?
KiROUND( m_copperThickness / m_BiuTo3Dunits )
KiROUND( m_CopperThickness / m_BiuTo3Dunits )
: 0;
}
@@ -173,7 +161,7 @@ public: INFO3D_VISU();
*/
int GetEpoxyThicknessBIU() const
{
return KiROUND( m_epoxyThickness / m_BiuTo3Dunits );
return KiROUND( m_EpoxyThickness / m_BiuTo3Dunits );
}
/**
@@ -185,9 +173,11 @@ public: INFO3D_VISU();
*/
int GetNonCopperLayerThicknessBIU() const
{
bool use_thickness = GetFlag( FL_USE_COPPER_THICKNESS );
bool use_thickness = GetFlag( FL_USE_COPPER_THICKNESS )
// || GetFlag( FL_USE_REALISTIC_MODE )
;
return use_thickness ?
KiROUND( m_nonCopperLayerThickness / m_BiuTo3Dunits )
KiROUND( m_NonCopperLayerThickness / m_BiuTo3Dunits )
: 0;
}
@@ -198,11 +188,11 @@ public: INFO3D_VISU();
*
* Note: if m_drawFlags[FL_USE_COPPER_THICKNESS] is not set, returns 0
*/
int GetLayerObjectThicknessBIU( int aLayerId ) const
int GetLayerObjectThicknessBIU( int aLayerId) const
{
return IsCopperLayer( aLayerId ) ?
GetCopperThicknessBIU() :
GetNonCopperLayerThicknessBIU();
return aLayerId >= FIRST_NON_COPPER_LAYER ?
GetNonCopperLayerThicknessBIU() :
GetCopperThicknessBIU();
}
bool IsRealisticMode() { return GetFlag( FL_USE_REALISTIC_MODE ); }
+62 -166
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 Tuomas Vaherkoski <tuomasvaherkoski@gmail.com>
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -30,12 +30,16 @@
#define MODELPARSERS_H
#include <map>
#include <memory>
#include <vector>
#include <wx/string.h>
#include <3d_mesh_model.h>
class S3D_MASTER;
class S3D_VERTEX;
extern void TransfertToGLlist( std::vector< S3D_VERTEX >& aVertices, double aBiuTo3DUnits );
class S3D_MODEL_PARSER;
class X3D_MODEL_PARSER;
/**
@@ -45,11 +49,12 @@ class X3D_MODEL_PARSER;
class S3D_MODEL_PARSER
{
public:
S3D_MODEL_PARSER( S3D_MASTER* aMaster ) :
S3D_MODEL_PARSER(S3D_MASTER* aMaster) :
master( aMaster )
{}
virtual ~S3D_MODEL_PARSER(){}
virtual ~S3D_MODEL_PARSER()
{}
S3D_MASTER* GetMaster()
{
@@ -65,18 +70,12 @@ public:
* @param aExtension is file extension of the file you are going to parse.
*/
static S3D_MODEL_PARSER* Create( S3D_MASTER* aMaster, const wxString aExtension );
/**
* virtual Function
* Function Load
*
* Concrete parsers should implement this function
* @param aFilename = the full file name of the file to load
* @return true if as succeeded
*/
virtual bool Load( const wxString& aFilename ) {
return false;
};
S3D_MESH_PTRS childs;
virtual void Load( const wxString aFilename ) = 0;
private:
S3D_MASTER* master;
@@ -94,11 +93,10 @@ class X3D_MODEL_PARSER: public S3D_MODEL_PARSER
public:
X3D_MODEL_PARSER( S3D_MASTER* aMaster );
~X3D_MODEL_PARSER();
bool Load( const wxString& aFilename );
void Load( const wxString aFilename );
typedef std::map< wxString, wxString > PROPERTY_MAP;
typedef std::vector< wxXmlNode* > NODE_LIST;
typedef std::vector< wxXmlNode* > NODE_LIST;
/**
* Function GetChildsByName
@@ -119,10 +117,14 @@ public:
*/
static void GetNodeProperties( wxXmlNode* aNode, PROPERTY_MAP& aProps );
private:
wxString m_Filename;
S3D_MESH_PTR m_model;
/**
* Return string representing x3d file in vrml format
* Function Load must be called before this function, otherwise empty
* data set is returned.
*/
wxString VRML_representation();
private:
std::vector< wxString > vrml_materials;
std::vector< wxString > vrml_points;
std::vector< wxString > vrml_coord_indexes;
@@ -135,163 +137,57 @@ private:
void rotate( S3D_VERTEX& aCoordinate, S3D_VERTEX& aRotAxis, double angle );
};
typedef std::map< std::string, std::vector< glm::vec3 > > VRML2_COORDINATE_MAP;
typedef std::map< std::string, S3D_MESH_PTR > VRML2_DEF_GROUP_MAP;
/**
* class VRML2_MODEL_PARSER
* Parses
*/
class VRML2_MODEL_PARSER
{
public:
VRML2_MODEL_PARSER( S3D_MODEL_PARSER* aModelParser );
~VRML2_MODEL_PARSER();
bool Load( const wxString& aFilename );
/**
* Function Load
* Load a VRML2 filename and apply a transformation to the root
* @param aFilename file name with path
* @param aTransformationModel a model with translation, rotation and scale to apply to default root
* @return bool - true if finnished with success
*/
bool Load( const wxString& aFilename, S3D_MESH_PTR aTransformationModel );
/**
* Return string representing VRML2 file in vrml2 format
* Function Load must be called before this function, otherwise empty
* data set is returned.
*/
wxString VRML2_representation();
private:
int loadFileModel( S3D_MESH_PTR transformationModel );
int read_Transform();
int read_DEF();
int read_DEF_Coordinate();
int read_Shape();
int read_appearance();
int read_Appearance();
int read_material();
int read_Material();
int read_IndexedFaceSet();
int read_IndexedLineSet();
int read_Coordinate();
int read_CoordinateDef();
int read_Normal();
int read_NormalIndex();
int read_Color();
int read_coordIndex();
int read_colorIndex();
int read_geometry();
int read_IndexedFaceSet_USE();
int read_Transform_USE();
int read_Inline();
/** Function debug_enter
* Used in debug to increase a ' ' in the m_debugSpacer,
* should be called after the first debug comment in a function
*/
void debug_enter();
/** Function debug_exit
* Used in debug to decrease a ' ' in the m_debugSpacer,
* should be called before the last debug comment in a funtion before exit
*/
void debug_exit();
bool m_normalPerVertex;
bool colorPerVertex;
S3D_MESH_PTR m_model; ///< It stores the current model that the parsing is adding data
FILE* m_file;
wxFileName m_Filename;
VRML2_COORDINATE_MAP m_defCoordinateMap;
VRML2_DEF_GROUP_MAP m_defGroupMap; ///< Stores a list of labels for groups and meshs that will be used later by the USE keyword
S3D_MODEL_PARSER* m_ModelParser;
S3D_MASTER* m_Master;
wxString m_debugSpacer; ///< Used to give identation space
int m_counter_DEF_GROUP; ///< Counts the number of DEF * GROUPS used
int m_counter_USE_GROUP; ///< Counts the number of USE * used, in the end, if m_counter_DEF_GROUP > 0 and m_counter_USE_GROUP == 0 then it will add the first group with childs
bool m_discardLastGeometry; ///< If true, it should not store the latest loaded geometry (used to discard IndexedLineSet, but load it)
};
/**
* class VRML1_MODEL_PARSER
* Parses
*/
class VRML1_MODEL_PARSER
{
public:
VRML1_MODEL_PARSER( S3D_MODEL_PARSER* aModelParser );
~VRML1_MODEL_PARSER();
bool Load( const wxString& aFilename );
/**
* Return string representing VRML2 file in vrml2 format
* Function Load must be called before this function, otherwise empty
* data set is returned.
*/
wxString VRML2_representation();
private:
int read_separator();
int readMaterial();
int readCoordinate3();
int readIndexedFaceSet();
int readMaterial_ambientColor();
int readMaterial_diffuseColor();
int readMaterial_emissiveColor();
int readMaterial_specularColor();
int readMaterial_shininess();
int readMaterial_transparency();
int readCoordinate3_point();
int readIndexedFaceSet_coordIndex();
int readIndexedFaceSet_materialIndex();
bool m_normalPerVertex;
bool colorPerVertex;
S3D_MESH_PTR m_model;
FILE* m_file;
wxString m_Filename;
S3D_MODEL_PARSER* m_ModelParser;
S3D_MASTER* m_Master;
};
/**
* class VRML_MODEL_PARSER
* class WRL_MODEL_PARSER
* Parses
*/
class VRML_MODEL_PARSER: public S3D_MODEL_PARSER
{
public:
/**
* ctor: initialize a VRML file parser
* @param aMaster = a ref to a 3D footprint shape description to fill
* by the vrml file data
*/
VRML_MODEL_PARSER( S3D_MASTER* aMaster );
~VRML_MODEL_PARSER();
void Load( const wxString aFilename );
private:
/**
* Function ReadMaterial
* read the description of a 3D material definition in the form:
* DEF yellow material Material (
* DiffuseColor 1.00000 1.00000 0.00000e 0
* EmissiveColor 0.00000e 0 0.00000e 0 0.00000e 0
* SpecularColor 1.00000 1.00000 1.00000
* AmbientIntensity 1.00000
* Transparency 0.00000e 0
* Shininess 1.00000
*)
* Or type:
* USE yellow material
*/
int readMaterial( FILE* file, int* LineNum );
int readChildren( FILE* file, int* LineNum );
int readShape( FILE* file, int* LineNum );
int readAppearance( FILE* file, int* LineNum );
int readGeometry( FILE* file, int* LineNum );
/**
* Function load
* Load a 3D file and build a S3D_MASTER shape.
* file has .vrml ext and can be VRML 1 or VRML 2 format
* @param aFilename = the full filename to read
* @param aVrmlunits_to_3Dunits = the csaling factor to convert the 3D file unit
* to our internal units.
* Function ReadCoordList
* reads 3D coordinate lists like:
* coord Coordinate { point [
* -5.24489 6.57640e-3 -9.42129e-2,
* -5.11821 6.57421e-3 0.542654,
* -3.45868 0.256565 1.32000 ] }
* or:
* normal Normal { vector [
* 0.995171 -6.08102e-6 9.81541e-2,
* 0.923880 -4.09802e-6 0.382683,
* 0.707107 -9.38186e-7 0.707107]
* }
*
* text_buffer contains the first line of this node :
* "coord Coordinate { point ["
*/
bool Load( const wxString& aFilename );
void readCoordsList( FILE* file, char* text_buffer, std::vector< double >& aList,
int* LineNum );
};
#endif // MODELPARSERS_H
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -19,7 +19,7 @@
* LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
* THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
* ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
* ANY THEORY OF LIABILITY, ARISING OUT OF OR IN PAD_CONNECTION WITH THE
* POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
*
* US Government Users Restricted Rights
+1 -1
View File
@@ -19,7 +19,7 @@
* LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
* THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
* ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
* ANY THEORY OF LIABILITY, ARISING OUT OF OR IN PAD_CONNECTION WITH THE
* POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
*
* US Government Users Restricted Rights
-270
View File
@@ -1,270 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2014-2015 Mario Luzeiro <mrluzeiro@gmail.com>
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file vrml_aux.cpp
* @brief implements auxiliar functions to parse VRML files
*/
#include "vrml_aux.h"
bool GetString( FILE* File, char* aDstString, size_t maxDstLen )
{
if( (!aDstString) || (maxDstLen == 0) )
return false;
int c;
while( ( c = fgetc( File ) ) != EOF )
{
if( c == '\"' )
{
break;
}
}
if( c != '\"' )
{
return false;
}
while( (( c = fgetc( File ) ) != EOF) && (maxDstLen > 0) )
{
if( c == '\"' )
{
break;
}
maxDstLen--;
*aDstString = c;
aDstString++;
}
*aDstString = 0;
if( c == '\"' )
{
return true;
}
return false;
}
static int SkipGetChar ( FILE* File );
static int SkipGetChar( FILE* File )
{
int c;
bool re_parse;
if( ( c = fgetc( File ) ) == EOF )
{
// DBG( printf( "EOF\n" ) );
return EOF;
}
// DBG( printf( "c %c 0x%02X\n", c, c ) );
do
{
re_parse = false;
if( (c == ' ') || (c == '\t') || (c == '{') || (c == '[') )
{
// DBG( printf( "Skipping space \\t or { or [\n" ) );
do
{
if( ( c = fgetc( File ) ) == EOF )
{
// DBG( printf( "EOF\n" ) );
return EOF;
}
} while( (c == ' ') || (c == '\t') || (c == '{') || (c == '[') );
}
if( (c == '#') || (c == '\n') || (c == '\r') || (c == 0) || (c == ',') )
{
if( c == '#' )
{
// DBG( printf( "Skipping # \\n or \\r or 0, 0x%02X\n", c ) );
do
{
if( ( c = fgetc( File ) ) == EOF )
{
// DBG( printf( "EOF\n" ) );
return EOF;
}
} while( (c != '\n') && (c != '\r') && (c != 0) && (c != ',') );
}
else
{
if( ( c = fgetc( File ) ) == EOF )
{
// DBG( printf( "EOF\n" ) );
return EOF;
}
}
re_parse = true;
}
} while( re_parse == true );
return c;
}
bool GetNextTag( FILE* File, char* tag, size_t len )
{
int c = SkipGetChar( File );
if( c == EOF )
{
return false;
}
tag[0] = c;
tag[1] = 0;
// DBG( printf( "tag[0] %c\n", tag[0] ) );
if( (c != '}') && (c != ']') )
{
len--;
char* dst = &tag[1];
while( fscanf( File, "%c", dst ) && len > 0 )
{
if( (*dst == ' ') || (*dst == '[') || (*dst == '{')
|| (*dst == '\t') || (*dst == '\n')|| (*dst == '\r') )
{
*dst = 0;
break;
}
dst++;
len--;
}
// DBG( printf( "tag %s\n", tag ) );
c = SkipGetChar( File );
if( c != EOF )
{
// Puts again the read char in the buffer
ungetc( c, File );
}
}
return true;
}
int Read_NotImplemented( FILE* File, char closeChar )
{
int c;
// DBG( printf( "look for %c\n", closeChar) );
while( ( c = fgetc( File ) ) != EOF )
{
if( c == '{' )
{
// DBG( printf( "{\n") );
Read_NotImplemented( File, '}' );
}
else if( c == '[' )
{
// DBG( printf( "[\n") );
Read_NotImplemented( File, ']' );
}
else if( c == closeChar )
{
// DBG( printf( "%c\n", closeChar) );
return 0;
}
}
// DBG( printf( " NotImplemented failed\n" ) );
return -1;
}
int ParseVertexList( FILE* File, std::vector<glm::vec3>& dst_vector )
{
// DBG( printf( " ParseVertexList\n" ) );
dst_vector.clear();
glm::vec3 vertex;
while( ParseVertex( File, vertex ) )
{
dst_vector.push_back( vertex );
}
return 0;
}
bool ParseVertex( FILE* File, glm::vec3& dst_vertex )
{
float a, b, c;
int ret = fscanf( File, "%e %e %e", &a, &b, &c );
dst_vertex.x = a;
dst_vertex.y = b;
dst_vertex.z = c;
int s = SkipGetChar( File );
if( s != EOF )
{
// Puts again the read char in the buffer
ungetc( s, File );
}
// DBG( printf( "ret%d(%.9f,%.9f,%.9f)", ret, a,b,c) );
return ret == 3;
}
bool ParseFloat( FILE* aFile, float *aDstFloat, float aDefaultValue )
{
float value;
int ret = fscanf( aFile, "%e", &value );
if( ret == 1 )
*aDstFloat = value;
else
*aDstFloat = aDefaultValue;
return ret == 1;
}
-113
View File
@@ -1,113 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2014-2015 Mario Luzeiro <mrluzeiro@gmail.com>
* Copyright (C) 1992-2014 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file vrml_aux.h
* @brief auxiliar functions to parse VRML files
*/
#ifndef _VRML_AUX_H
#define _VRML_AUX_H
#include <fctsys.h>
#include <common.h>
#include <macros.h>
#include <base_struct.h>
#define GLM_FORCE_RADIANS
#include <gal/opengl/glm/glm.hpp>
#include <vector>
#include <kicad_string.h>
#include <info3d_visu.h>
#ifdef __WXMAC__
# ifdef __DARWIN__
# include <OpenGL/glu.h>
# else
# include <glu.h>
# endif
#else
# include <GL/glu.h>
#endif
#include <wx/glcanvas.h>
/**
* Function GetEpoxyThicknessBIU
* skip a VRML block and eventualy internal blocks until it find the close char
* @param File file to read from
* @param closeChar the expected close char of the block
* @return int - -1 if failed, 0 if OK
*/
int Read_NotImplemented( FILE* File, char closeChar);
/**
* Function ParseVertexList
* parse a vertex list
* @param File file to read from
* @param dst_vector destination vector list
* @return int - -1 if failed, 0 if OK
*/
int ParseVertexList( FILE* File, std::vector< glm::vec3 > &dst_vector);
/**
* Function ParseVertex
* parse a vertex
* @param File file to read from
* @param dst_vertex destination vector
* @return bool - return true if the 3 elements are read
*/
bool ParseVertex( FILE* File, glm::vec3 &dst_vertex );
/**
* Function ParseFloat
* parse a float value
* @param aFile file to read from
* @param aDstFloat destination float
* @param aDefaultValue = the default value, when the actual value cannot be read
* @return bool - Return true if the float was read without error
*/
bool ParseFloat( FILE* aFile, float *aDstFloat, float aDefaultValue );
/**
* Function GetNextTag
* parse the next tag
* @param File file to read from
* @param tag destination pointer
* @param len max length of storage
* @return bool - true if succeeded, false if EOF
*/
bool GetNextTag( FILE* File, char* tag, size_t len );
/**
* Function GetString
* parse a string, it expects starting by " and end with "
* @param File file to read from
* @param aDstString destination pointer
* @param maxDstLen max length of storage
* @return bool - true if successful read the string, false if failed to get a string
*/
bool GetString( FILE* File, char* aDstString, size_t maxDstLen );
#endif
-439
View File
@@ -1,439 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2014 Mario Luzeiro <mrluzeiro@gmail.com>
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file vrml_v1_modelparser.cpp
*/
#include <fctsys.h>
#include <vector>
#include <macros.h>
#include <kicad_string.h>
#include <info3d_visu.h>
#include "3d_struct.h"
#include "modelparsers.h"
#include "vrml_aux.h"
#define BUFLINE_SIZE 32
/**
* Trace mask used to enable or disable the trace output of the VRML V1 parser code.
* The debug output can be turned on by setting the WXTRACE environment variable to
* "KI_TRACE_VRML_V1_PARSER". See the wxWidgets documentation on wxLogTrace for
* more information.
*/
static const wxChar* traceVrmlV1Parser = wxT( "KI_TRACE_VRML_V1_PARSER" );
VRML1_MODEL_PARSER::VRML1_MODEL_PARSER( S3D_MODEL_PARSER* aModelParser )
{
m_ModelParser = aModelParser;
m_Master = m_ModelParser->GetMaster();
m_model.reset();
m_file = NULL;
m_normalPerVertex = true;
colorPerVertex = true;
}
VRML1_MODEL_PARSER::~VRML1_MODEL_PARSER()
{
}
bool VRML1_MODEL_PARSER::Load( const wxString& aFilename )
{
char text[BUFLINE_SIZE];
wxLogTrace( traceVrmlV1Parser, wxT( "Loading: %s" ), GetChars( aFilename ) );
m_file = wxFopen( aFilename, wxT( "rt" ) );
if( m_file == NULL )
return false;
// Switch the locale to standard C (needed to print floating point numbers)
LOCALE_IO toggle;
m_ModelParser->childs.clear();
while( GetNextTag( m_file, text, sizeof(text) ) )
{
if( ( *text == '}' ) || ( *text == ']' ) )
{
continue;
}
if( strcmp( text, "Separator" ) == 0 )
{
m_model.reset( new S3D_MESH() );
m_ModelParser->childs.push_back( m_model );
read_separator();
}
}
fclose( m_file );
return true;
}
int VRML1_MODEL_PARSER::read_separator()
{
char text[BUFLINE_SIZE];
// DBG( printf( "Separator\n" ) );
while( GetNextTag( m_file, text, sizeof(text) ) )
{
if( strcmp( text, "Material" ) == 0 )
{
readMaterial();
}
else if( strcmp( text, "Coordinate3" ) == 0 )
{
readCoordinate3();
}
else if( strcmp( text, "IndexedFaceSet" ) == 0 )
{
readIndexedFaceSet();
}
else if( strcmp( text, "Separator" ) == 0 )
{
S3D_MESH_PTR parent( m_model.get() );
S3D_MESH_PTR new_mesh_model( new S3D_MESH() );
m_model->childs.push_back( new_mesh_model );
m_model.reset( new_mesh_model.get() );
// recursive
read_separator();
m_model.reset( parent.get() );
}
else if( ( *text != '}' ) )
{
// DBG( printf( "read_NotImplemented %s\n", text ) );
Read_NotImplemented( m_file, '}' );
}
else
break;
}
return 0;
}
int VRML1_MODEL_PARSER::readMaterial()
{
char text[BUFLINE_SIZE];
S3D_MATERIAL* material = NULL;
// DBG( printf( " readMaterial\n" ) );
wxString mat_name;
material = new S3D_MATERIAL( m_Master, mat_name );
m_Master->Insert( material );
m_model->m_Materials = material;
while( GetNextTag( m_file, text, sizeof(text) ) )
{
if( *text == ']' )
{
continue;
}
if( *text == '}' )
{
return 0;
}
if( strcmp( text, "ambientColor" ) == 0 )
{
readMaterial_ambientColor();
}
else if( strcmp( text, "diffuseColor" ) == 0 )
{
readMaterial_diffuseColor();
}
else if( strcmp( text, "emissiveColor" ) == 0 )
{
readMaterial_emissiveColor();
}
else if( strcmp( text, "specularColor" ) == 0 )
{
readMaterial_specularColor();
}
else if( strcmp( text, "shininess" ) == 0 )
{
readMaterial_shininess();
}
else if( strcmp( text, "transparency" ) == 0 )
{
readMaterial_transparency();
}
}
wxLogTrace( traceVrmlV1Parser, wxT( " readMaterial failed" ) );
return -1;
}
int VRML1_MODEL_PARSER::readCoordinate3()
{
char text[BUFLINE_SIZE];
// DBG( printf( " readCoordinate3\n" ) );
while( GetNextTag( m_file, text, sizeof( text ) ) )
{
if( *text == ']' )
{
continue;
}
if( *text == '}' )
{
return 0;
}
if( strcmp( text, "point" ) == 0 )
{
readCoordinate3_point();
}
}
wxLogTrace( traceVrmlV1Parser, wxT( " readCoordinate3 failed" ) );
return -1;
}
int VRML1_MODEL_PARSER::readIndexedFaceSet()
{
char text[BUFLINE_SIZE];
// DBG( printf( " readIndexedFaceSet\n" ) );
while( GetNextTag( m_file, text, sizeof(text) ) )
{
if( *text == ']' )
{
continue;
}
if( *text == '}' )
{
return 0;
}
if( strcmp( text, "coordIndex" ) == 0 )
{
readIndexedFaceSet_coordIndex();
}
else if( strcmp( text, "materialIndex" ) == 0 )
{
readIndexedFaceSet_materialIndex();
}
}
wxLogTrace( traceVrmlV1Parser, wxT( " readIndexedFaceSet failed" ) );
return -1;
}
int VRML1_MODEL_PARSER::readMaterial_ambientColor()
{
// DBG( printf( " readMaterial_ambientColor\n" ) );
return ParseVertexList( m_file, m_model->m_Materials->m_AmbientColor );
}
int VRML1_MODEL_PARSER::readMaterial_diffuseColor()
{
// DBG( printf( " readMaterial_diffuseColor\n" ) );
return ParseVertexList( m_file, m_model->m_Materials->m_DiffuseColor );
}
int VRML1_MODEL_PARSER::readMaterial_emissiveColor()
{
// DBG( printf( " readMaterial_emissiveColor\n" ) );
int ret = ParseVertexList( m_file, m_model->m_Materials->m_EmissiveColor );
if( m_Master->m_use_modelfile_emissiveColor == false )
{
m_model->m_Materials->m_EmissiveColor.clear();
}
return ret;
}
int VRML1_MODEL_PARSER::readMaterial_specularColor()
{
// DBG( printf( " readMaterial_specularColor\n" ) );
int ret = ParseVertexList( m_file, m_model->m_Materials->m_SpecularColor );
if( m_Master->m_use_modelfile_specularColor == false )
{
m_model->m_Materials->m_SpecularColor.clear();
}
return ret;
}
int VRML1_MODEL_PARSER::readMaterial_shininess()
{
// DBG( printf( " readMaterial_shininess\n" ) );
m_model->m_Materials->m_Shininess.clear();
float shininess_value;
while( fscanf( m_file, "%f,", &shininess_value ) )
{
// VRML value is normalized and openGL expects a value 0 - 128
shininess_value = shininess_value * 128.0f;
m_model->m_Materials->m_Shininess.push_back( shininess_value );
}
if( m_Master->m_use_modelfile_shininess == false )
{
m_model->m_Materials->m_Shininess.clear();
}
// DBG( printf( " m_Shininess.size: %ld\n", m_model->m_Materials->m_Shininess.size() ) );
return 0;
}
int VRML1_MODEL_PARSER::readMaterial_transparency()
{
// DBG( printf( " readMaterial_transparency\n" ) );
m_model->m_Materials->m_Transparency.clear();
float tmp;
while( fscanf( m_file, "%f,", &tmp ) )
{
m_model->m_Materials->m_Transparency.push_back( tmp );
}
if( m_Master->m_use_modelfile_transparency == false )
{
m_model->m_Materials->m_Transparency.clear();
}
// DBG( printf( " m_Transparency.size: %ld\n", m_model->m_Materials->m_Transparency.size() ) );
return 0;
}
int VRML1_MODEL_PARSER::readCoordinate3_point()
{
// DBG( printf( " readCoordinate3_point\n" ) );
if( ParseVertexList( m_file, m_model->m_Point ) == 0 )
{
return 0;
}
wxLogTrace( traceVrmlV1Parser, wxT( " readCoordinate3_point failed" ) );
return -1;
}
int VRML1_MODEL_PARSER::readIndexedFaceSet_coordIndex()
{
// DBG( printf( " readIndexedFaceSet_coordIndex\n" ) );
m_model->m_CoordIndex.clear();
glm::ivec3 coord;
int dummy; // should be -1
while( fscanf( m_file, "%d,%d,%d,%d,", &coord[0], &coord[1], &coord[2], &dummy ) )
{
std::vector<int> coord_list;
coord_list.resize( 3 );
coord_list[0] = coord[0];
coord_list[1] = coord[1];
coord_list[2] = coord[2];
if( (coord[0] == coord[1])
|| (coord[0] == coord[2])
|| (coord[2] == coord[1]) )
{
wxLogTrace( traceVrmlV1Parser, wxT( " invalid coordIndex at index %zu (%d, %d, %d, %d)" ),
m_model->m_CoordIndex.size() + 1, coord[0], coord[1], coord[2], dummy );
}
if( dummy != -1 )
{
wxLogTrace( traceVrmlV1Parser, wxT( " Error at index %zu, -1 Expected, got %d" ),
m_model->m_CoordIndex.size() + 1, dummy );
}
m_model->m_CoordIndex.push_back( coord_list );
}
// DBG( printf( " m_CoordIndex.size: %ld\n", m_model->m_CoordIndex.size() ) );
return 0;
}
int VRML1_MODEL_PARSER::readIndexedFaceSet_materialIndex()
{
// DBG( printf( " readIndexedFaceSet_materialIndex\n" ) );
m_model->m_MaterialIndexPerFace.clear();
int index;
while( fscanf( m_file, "%d,", &index ) )
{
m_model->m_MaterialIndexPerFace.push_back( index );
}
// DBG( printf( " m_MaterialIndexPerFace.size: %ld\n", m_model->m_MaterialIndexPerFace.size() ) );
return 0;
}
File diff suppressed because it is too large Load Diff
+520 -33
View File
@@ -37,53 +37,540 @@
#include "3d_struct.h"
#include "modelparsers.h"
// separator chars
static const char* sep_chars = " \t\n\r";
VRML_MODEL_PARSER::VRML_MODEL_PARSER( S3D_MASTER* aMaster ) :
S3D_MODEL_PARSER( aMaster )
{
}
{}
VRML_MODEL_PARSER::~VRML_MODEL_PARSER()
{
}
{}
bool VRML_MODEL_PARSER::Load( const wxString& aFilename )
void VRML_MODEL_PARSER::Load( const wxString aFilename )
{
char line[11 + 1];
char line[1024], * text;
FILE* file;
//DBG( printf( "Load %s", GetChars( aFilename ) ) );
int LineNum = 0;
file = wxFopen( aFilename, wxT( "rt" ) );
if( file == NULL )
return false;
if( fgets( line, 11, file ) == NULL )
{
fclose( file );
return false;
return;
}
// Switch the locale to standard C (needed to print floating point numbers like 1.3)
SetLocaleTo_C_standard();
while( GetLine( file, line, &LineNum, 512 ) )
{
text = strtok( line, sep_chars );
if ( text == NULL )
continue;
if( stricmp( text, "DEF" ) == 0 || stricmp( text, "Transform" ) == 0 || stricmp( text, "Group" ) == 0 )
{
while( GetLine( file, line, &LineNum, 512 ) )
{
text = strtok( line, sep_chars );
if( text == NULL )
continue;
if( *text == '}' )
break;
if( stricmp( text, "children" ) == 0 )
{
readChildren( file, &LineNum );
}
}
}
}
fclose( file );
childs.clear();
if( stricmp( line, "#VRML V2.0" ) == 0 )
{
VRML2_MODEL_PARSER *vrml2_parser = new VRML2_MODEL_PARSER( this );
vrml2_parser->Load( aFilename );
delete vrml2_parser;
return true;
}
else if( stricmp( line, "#VRML V1.0" ) == 0 )
{
VRML1_MODEL_PARSER *vrml1_parser = new VRML1_MODEL_PARSER( this );
vrml1_parser->Load( aFilename );
delete vrml1_parser;
return true;
}
DBG( printf( "Unknown internal VRML file format: %s\n", line ) );
return false;
SetLocaleTo_Default(); // revert to the current locale
}
int VRML_MODEL_PARSER::readMaterial( FILE* file, int* LineNum )
{
char line[512], * text, * command;
wxString mat_name;
S3D_MATERIAL* material = NULL;
command = strtok( NULL, sep_chars );
text = strtok( NULL, sep_chars );
mat_name = FROM_UTF8( text );
if( stricmp( command, "USE" ) == 0 )
{
for( material = GetMaster()->m_Materials; material; material = material->Next() )
{
if( material->m_Name == mat_name )
{
material->SetMaterial();
return 1;
}
}
DBG( printf( "ReadMaterial error: material not found\n" ) );
return 0;
}
if( stricmp( command, "DEF" ) == 0 || stricmp( command,"Transform" ) == 0 || stricmp( command, "Material") == 0)
{
material = new S3D_MATERIAL( GetMaster(), mat_name );
GetMaster()->Insert( material );
while( GetLine( file, line, LineNum, 512 ) )
{
text = strtok( line, sep_chars );
if( text == NULL )
continue;
if( text[0] == '}' )
{
material->SetMaterial();
return 0;
}
if( stricmp( text, "diffuseColor" ) == 0 )
{
text = strtok( NULL, sep_chars );
material->m_DiffuseColor.x = atof( text );
text = strtok( NULL, sep_chars );
material->m_DiffuseColor.y = atof( text );
text = strtok( NULL, sep_chars );
material->m_DiffuseColor.z = atof( text );
}
else if( stricmp( text, "emissiveColor" ) == 0 )
{
text = strtok( NULL, sep_chars );
material->m_EmissiveColor.x = atof( text );
text = strtok( NULL, sep_chars );
material->m_EmissiveColor.y = atof( text );
text = strtok( NULL, sep_chars );
material->m_EmissiveColor.z = atof( text );
}
else if( strnicmp( text, "specularColor", 13 ) == 0 )
{
text = strtok( NULL, sep_chars );
material->m_SpecularColor.x = atof( text );
text = strtok( NULL, sep_chars );
material->m_SpecularColor.y = atof( text );
text = strtok( NULL, sep_chars );
material->m_SpecularColor.z = atof( text );
}
else if( strnicmp( text, "ambientIntensity", 16 ) == 0 )
{
text = strtok( NULL, sep_chars );
material->m_AmbientIntensity = atof( text );
}
else if( strnicmp( text, "transparency", 12 ) == 0 )
{
text = strtok( NULL, sep_chars );
material->m_Transparency = atof( text );
}
else if( strnicmp( text, "shininess", 9 ) == 0 )
{
text = strtok( NULL, sep_chars );
material->m_Shininess = atof( text );
}
}
}
return -1;
}
int VRML_MODEL_PARSER::readChildren( FILE* file, int* LineNum )
{
char line[1024], * text;
while( GetLine( file, line, LineNum, 512 ) )
{
text = strtok( line, sep_chars );
if( *text == '[' )
continue;
if( *text == ']' )
return 0;
if( *text == ',' )
continue;
if( stricmp( text, "Shape" ) == 0 )
{
readShape( file, LineNum );
}
else
{
DBG( printf( "ReadChildren error line %d <%s> \n", *LineNum, text ) );
break;
}
}
return 1;
}
int VRML_MODEL_PARSER::readShape( FILE* file, int* LineNum )
{
char line[1024], * text;
int err = 1;
while( GetLine( file, line, LineNum, 512 ) )
{
text = strtok( line, sep_chars );
if( *text == '}' )
{
err = 0;
break;
}
if( *text == '{' )
{
continue;
}
if( stricmp( text, "appearance" ) == 0 )
{
readAppearance( file, LineNum );
}
else if( stricmp( text, "geometry" ) == 0 )
{
readGeometry( file, LineNum );
}
else
{
DBG( printf( "ReadShape error line %d <%s> \n", *LineNum, text ) );
break;
}
}
return err;
}
int VRML_MODEL_PARSER::readAppearance( FILE* file, int* LineNum )
{
char line[1024], * text;
int err = 1;
while( GetLine( file, line, LineNum, 512 ) )
{
text = strtok( line, sep_chars );
if( *text == '}' )
{
err = 0;
break;
}
if( *text == '{' )
{
continue;
}
if( stricmp( text, "material" ) == 0 )
{
readMaterial( file, LineNum );
}
else
{
DBG( printf( "ReadAppearance error line %d <%s> \n", *LineNum, text ) );
break;
}
}
return err;
}
void VRML_MODEL_PARSER::readCoordsList( FILE* file, char* text_buffer,
std::vector< double >& aList, int* LineNum )
{
unsigned int ii = 0, jj = 0;
char* text;
bool HasData = false;
bool StartData = false;
bool EndNode = false;
char string_num[512];
text = text_buffer;
while( !EndNode )
{
if( *text == 0 ) // Needs data !
{
text = text_buffer;
GetLine( file, text_buffer, LineNum, 512 );
}
while( !EndNode && *text )
{
switch( *text )
{
case '[':
StartData = true;
jj = 0;
string_num[jj] = 0;
break;
case '}':
EndNode = true;
break;
case ']':
case '\t':
case ' ':
case ',':
jj = 0;
if( !StartData || !HasData )
break;
aList.push_back( atof( string_num ) );
string_num[jj] = 0;
ii++;
HasData = false;
if( *text == ']' )
{
StartData = false;
}
break;
default:
if( !StartData )
break;
if( jj >= sizeof( string_num ) )
break;
string_num[jj] = *text;
jj++;
string_num[jj] = 0;
HasData = true;
break;
}
text++;
}
}
}
int VRML_MODEL_PARSER::readGeometry( FILE* file, int* LineNum )
{
char line[1024], buffer[1024], * text;
int err = 1;
std::vector< double > points;
std::vector< double > list;
double vrmlunits_to_3Dunits = g_Parm_3D_Visu.m_BiuTo3Dunits * UNITS3D_TO_UNITSPCB;
while( GetLine( file, line, LineNum, 512 ) )
{
strcpy( buffer, line );
text = strtok( buffer, sep_chars );
if( text == NULL )
continue;
if( *text == '}' )
{
err = 0;
break;
}
if( stricmp( text, "creaseAngle" ) == 0 )
{
continue;
}
if( *text == '{' )
{
continue;
}
if( stricmp( text, "normalPerVertex" ) == 0 )
{
text = strtok( NULL, " ,\t\n\r" );
if( text && stricmp( text, "true" ) == 0 )
{
}
else
{
}
continue;
}
if( stricmp( text, "colorPerVertex" ) == 0 )
{
text = strtok( NULL, " ,\t\n\r" );
if( text && stricmp( text, "true" ) == 0 )
{
}
else
{
}
continue;
}
if( stricmp( text, "normal" ) == 0 )
{
readCoordsList( file, line, list, LineNum );
list.clear();
continue;
}
if( stricmp( text, "normalIndex" ) == 0 )
{
while( GetLine( file, line, LineNum, 512 ) )
{
text = strtok( line, " ,\t\n\r" );
while( text )
{
if( *text == ']' )
break;
text = strtok( NULL, " ,\t\n\r" );
}
if( text && (*text == ']') )
break;
}
continue;
}
if( stricmp( text, "color" ) == 0 )
{
readCoordsList( file, line, list, LineNum );
list.clear();
continue;
}
if( stricmp( text, "solid" ) == 0 )
{
// ignore solid
continue;
}
if( stricmp( text, "colorIndex" ) == 0 )
{
while( GetLine( file, line, LineNum, 512 ) )
{
text = strtok( line, " ,\t\n\r" );
while( text )
{
if( *text == ']' )
break;
text = strtok( NULL, " ,\t\n\r" );
}
if( text && (*text == ']') )
break;
}
continue;
}
if( stricmp( text, "coord" ) == 0 )
{
readCoordsList( file, line, points, LineNum );
}
else if( stricmp( text, "coordIndex" ) == 0 )
{
if( points.size() < 3 || points.size() % 3 != 0 )
{
wxLogError( wxT( "3D geometry read error <%s> at line %d." ),
GetChars( FROM_UTF8( text ) ), *LineNum );
err = 1;
break;
}
std::vector< int > coordIndex;
std::vector< S3D_VERTEX > vertices;
while( GetLine( file, line, LineNum, 512 ) )
{
int jj;
text = strtok( line, " ,\t\n\r" );
while( text )
{
if( *text == ']' )
break;
jj = atoi( text );
if( jj < 0 )
{
for( jj = 0; jj < (int) coordIndex.size(); jj++ )
{
int kk = coordIndex[jj] * 3;
if( (kk < 0) || ((kk + 3) > (int)points.size()) )
{
wxLogError( wxT( "3D geometry index read error <%s> at line %d." ),
GetChars( FROM_UTF8( text ) ), *LineNum );
err = 1;
break;
}
S3D_VERTEX vertex;
vertex.x = points[kk];
vertex.y = points[kk + 1];
vertex.z = points[kk + 2];
vertices.push_back( vertex );
}
if( GetMaster()->IsOpenGlAllowed() )
{
GetMaster()->ObjectCoordsTo3DUnits( vertices );
TransfertToGLlist( vertices, vrmlunits_to_3Dunits );
}
vertices.clear();
coordIndex.clear();
}
else
{
coordIndex.push_back( jj );
}
text = strtok( NULL, " ,\t\n\r" );
}
if( text && (*text == ']') )
break;
}
}
else
{
wxLogError( wxT( "3D geometry read error <%s> at line %d." ),
GetChars( FROM_UTF8( text ) ), *LineNum );
err = 1;
break;
}
}
return err;
}
+142 -223
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 Tuomas Vaherkoski <tuomasvaherkoski@gmail.com>
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -40,50 +40,32 @@
#include <modelparsers.h>
#include <xnode.h>
/**
* Trace mask used to enable or disable the trace output of the X3D parser code.
* The debug output can be turned on by setting the WXTRACE environment variable to
* "KI_TRACE_X3D_PARSER". See the wxWidgets documentation on wxLogTrace for
* more information.
*/
static const wxChar* traceX3DParser = wxT( "KI_TRACE_X3D_PARSER" );
X3D_MODEL_PARSER::X3D_MODEL_PARSER( S3D_MASTER* aMaster ) :
S3D_MODEL_PARSER( aMaster )
{
m_model.reset();
}
{}
X3D_MODEL_PARSER::~X3D_MODEL_PARSER()
{}
void X3D_MODEL_PARSER::Load( const wxString aFilename )
{
}
bool X3D_MODEL_PARSER::Load( const wxString& aFilename )
{
wxLogTrace( traceX3DParser, wxT( "Loading: %s" ), GetChars( aFilename ) );
wxXmlDocument doc;
if( !doc.Load( aFilename ) )
{
wxLogTrace( traceX3DParser, wxT( "Error while parsing file: %s" ), GetChars( aFilename ) );
return false;
wxLogError( wxT( "Error while parsing file '%s'" ), GetChars( aFilename ) );
return;
}
if( doc.GetRoot()->GetName() != wxT( "X3D" ) )
{
wxLogTrace( traceX3DParser, wxT( "Filetype is not X3D: %s" ), GetChars( aFilename ) );
return false;
wxLogError( wxT( "Filetype is not X3D '%s'" ), GetChars( aFilename ) );
return;
}
// Switch the locale to standard C (needed to print floating point numbers)
LOCALE_IO toggle;
childs.clear();
// Shapes are inside of Transform nodes
// Transform node contains information about
// transition, scale and rotation of the shape
@@ -91,49 +73,68 @@ bool X3D_MODEL_PARSER::Load( const wxString& aFilename )
GetChildsByName( doc.GetRoot(), wxT( "Transform" ), transforms );
for( NODE_LIST::iterator node_it = transforms.begin();
node_it != transforms.end();
node_it++ )
node_it != transforms.end();
node_it++ )
{
m_model.reset( new S3D_MESH() );
childs.push_back( m_model );
wxXmlNode* node = *node_it;
wxXmlAttribute* prop = node->GetAttributes();
wxLogTrace( traceX3DParser, wxT( "Transform: %s %s" ), prop->GetName(), prop->GetValue() );
readTransform( node );
readTransform( *node_it );
}
}
wxString X3D_MODEL_PARSER::VRML_representation()
{
wxString output;
for( unsigned i = 0; i < vrml_points.size(); i++ )
{
output +=
wxT( "Shape {\n"
" appearance Appearance {\n"
" material Material {\n" ) +
vrml_materials[i] +
wxT( " }\n"
" }\n"
" geometry IndexedFaceSet {\n"
" solid TRUE\n"
" coord Coordinate {\n"
" point [\n") +
vrml_points[i] +
wxT( " ]\n"
" }\n"
" coordIndex [\n" ) +
vrml_coord_indexes[i] +
wxT( " ]\n"
" }\n"
"},\n" );
}
return true;
return output;
}
void X3D_MODEL_PARSER::GetChildsByName( wxXmlNode* aParent,
const wxString aName,
std::vector<wxXmlNode*>& aResult )
const wxString aName,
std::vector< wxXmlNode* >& aResult )
{
// (-Breadth-first search (BFS)-)
// **NOTE** This function was changed to get only the first depth of ocorrences
// so it will be an workarround for the Bug #1443431
std::queue<wxXmlNode*> found;
// Breadth-first search (BFS)
std::queue< wxXmlNode* > found;
found.push( aParent );
while( !found.empty() )
{
wxXmlNode* elem = found.front();
wxXmlNode *elem = found.front();
for( wxXmlNode* child = elem->GetChildren();
for( wxXmlNode *child = elem->GetChildren();
child != NULL;
child = child->GetNext() )
{
if( child->GetName() == aName )
{
aResult.push_back( child );
else // **NOTE** This function was changed here to get only the first depth of ocorrences
found.push( child );
}
found.push( child );
}
found.pop();
@@ -153,13 +154,11 @@ void X3D_MODEL_PARSER::GetNodeProperties( wxXmlNode* aNode, PROPERTY_MAP& aProps
}
}
/* Private ----- */
void X3D_MODEL_PARSER::readTransform( wxXmlNode* aTransformNode )
{
NODE_LIST childnodes;
GetChildsByName( aTransformNode, wxT( "Material" ), childnodes );
for( NODE_LIST::iterator node = childnodes.begin();
@@ -174,10 +173,7 @@ void X3D_MODEL_PARSER::readTransform( wxXmlNode* aTransformNode )
PROPERTY_MAP properties;
GetNodeProperties( aTransformNode, properties );
GetChildsByName( aTransformNode, wxT( "IndexedFaceSet" ), childnodes );
GetChildsByName( aTransformNode, wxT("IndexedFaceSet"), childnodes );
for( NODE_LIST::iterator node = childnodes.begin();
node != childnodes.end();
@@ -192,10 +188,7 @@ void X3D_MODEL_PARSER::readTransform( wxXmlNode* aTransformNode )
void X3D_MODEL_PARSER::readMaterial( wxXmlNode* aMatNode )
{
glm::vec3 color;
PROPERTY_MAP properties;
GetNodeProperties( aMatNode, properties );
// DEFine new Material named as value of DEF
@@ -206,33 +199,22 @@ void X3D_MODEL_PARSER::readMaterial( wxXmlNode* aMatNode )
S3D_MATERIAL* material = new S3D_MATERIAL( GetMaster(), properties[ wxT( "DEF" ) ] );
GetMaster()->Insert( material );
m_model->m_Materials = material;
if( !parseDoubleTriplet( properties[ wxT( "diffuseColor" ) ], color ) )
if( !parseDoubleTriplet( properties[ wxT( "diffuseColor" ) ],
material->m_DiffuseColor ) )
{
// DBG( printf( "diffuseColor parsing error" ) );
}
else
{
m_model->m_Materials->m_DiffuseColor.push_back( color );
DBG( printf("diffuseColor parsing error") );
}
if( !parseDoubleTriplet( properties[ wxT( "specularColor" ) ], color ) )
if( !parseDoubleTriplet( properties[ wxT( "specularColor" ) ],
material->m_SpecularColor ) )
{
// DBG( printf( "specularColor parsing error" ) );
}
else
{
m_model->m_Materials->m_SpecularColor.push_back( color );
DBG( printf("specularColor parsing error") );
}
if( !parseDoubleTriplet( properties[ wxT( "emissiveColor" ) ], color ) )
if( !parseDoubleTriplet( properties[ wxT( "emissiveColor" ) ],
material->m_EmissiveColor ) )
{
// DBG( printf( "emissiveColor parsing error" ) );
}
else
{
m_model->m_Materials->m_EmissiveColor.push_back( color );
DBG( printf("emissiveColor parsing error") );
}
wxStringTokenizer values;
@@ -240,47 +222,40 @@ void X3D_MODEL_PARSER::readMaterial( wxXmlNode* aMatNode )
if( values.GetNextToken().ToDouble( &amb ) )
{
m_model->m_Materials->m_AmbientColor.push_back( glm::vec3( amb, amb, amb ) );
material->m_AmbientIntensity = amb;
}
else
{
// DBG( printf( "ambienterror" ) );
DBG( printf( "ambienterror" ) );
}
values.SetString( properties[ wxT( "shininess" ) ] );
if( values.GetNextToken().ToDouble( &shine ) )
{
// VRML value is normalized and openGL expects a value 0 - 128
if( shine > 1.0 )
{
shine = 1.0;
} else if( shine < 0.0 )
{
shine = 0.0;
}
shine = shine * 128.0f;
m_model->m_Materials->m_Shininess.push_back( shine );
material->m_Shininess = shine;
}
else
{
// DBG( printf( "shininess error" ) );
DBG( printf( "shininess error" ) );
}
values.SetString( properties[ wxT( "transparency" ) ] );
if( values.GetNextToken().ToDouble( &transp ) )
{
m_model->m_Materials->m_Transparency.push_back( transp );
material->m_Transparency = transp;
}
else
{
// DBG( printf( "trans error" ) );
DBG( printf( "trans error") );
}
material->SetMaterial();
// VRML
wxString vrml_material;
PROPERTY_MAP::const_iterator p = ++properties.begin(); // skip DEF
PROPERTY_MAP::const_iterator p = ++properties.begin(); // skip DEF
for( ; p != properties.end(); p++ )
{
@@ -289,6 +264,7 @@ void X3D_MODEL_PARSER::readMaterial( wxXmlNode* aMatNode )
vrml_materials.push_back( vrml_material );
}
// USE existing material named by value of USE
else if( properties.find( wxT( "USE" ) ) != properties.end() )
{
@@ -302,71 +278,60 @@ void X3D_MODEL_PARSER::readMaterial( wxXmlNode* aMatNode )
wxString vrml_material;
vrml_material.Append( wxString::Format( wxT( "specularColor %f %f %f\n" ),
material->m_SpecularColor[0].x,
material->m_SpecularColor[0].y,
material->m_SpecularColor[0].z ) );
material->m_SpecularColor.x,
material->m_SpecularColor.y,
material->m_SpecularColor.z ) );
vrml_material.Append( wxString::Format( wxT( "diffuseColor %f %f %f\n" ),
material->m_DiffuseColor[0].x,
material->m_DiffuseColor[0].y,
material->m_DiffuseColor[0].z ) );
material->m_DiffuseColor.x,
material->m_DiffuseColor.y,
material->m_DiffuseColor.z ) );
vrml_material.Append( wxString::Format( wxT( "emissiveColor %f %f %f\n" ),
material->m_EmissiveColor[0].x,
material->m_EmissiveColor[0].y,
material->m_EmissiveColor[0].z ) );
material->m_EmissiveColor.x,
material->m_EmissiveColor.y,
material->m_EmissiveColor.z ) );
vrml_material.Append( wxString::Format( wxT( "ambientIntensity %f\n" ),
material->m_AmbientColor[0].x ) );
vrml_material.Append( wxString::Format( wxT( "ambientIntensity %f\n"),
material->m_AmbientIntensity ) );
vrml_material.Append( wxString::Format( wxT( "shininess %f\n" ),
material->m_Shininess[0] ) );
vrml_material.Append( wxString::Format( wxT( "shininess %f\n"),
material->m_Shininess ) );
vrml_material.Append( wxString::Format( wxT( "transparency %f\n" ),
material->m_Transparency[0] ) );
vrml_material.Append( wxString::Format( wxT( "transparency %f\n"),
material->m_Transparency ) );
vrml_materials.push_back( vrml_material );
m_model->m_Materials = material;
material->SetMaterial();
return;
}
}
// DBG( printf( "ReadMaterial error: material not found\n" ) );
DBG( printf( "ReadMaterial error: material not found\n" ) );
}
}
bool X3D_MODEL_PARSER::parseDoubleTriplet( const wxString& aData,
S3D_VERTEX& aResult )
S3D_VERTEX& aResult )
{
wxStringTokenizer tokens( aData );
wxStringTokenizer tokens(aData);
double x = 0;
double y = 0;
double z = 0;
bool ret = tokens.GetNextToken().ToDouble( &x )
&& tokens.GetNextToken().ToDouble( &y )
&& tokens.GetNextToken().ToDouble( &z );
aResult.x = x;
aResult.y = y;
aResult.z = z;
return ret;
return tokens.GetNextToken().ToDouble( &aResult.x ) &&
tokens.GetNextToken().ToDouble( &aResult.y ) &&
tokens.GetNextToken().ToDouble( &aResult.z );
}
void X3D_MODEL_PARSER::rotate( S3D_VERTEX& aV,
S3D_VERTEX& aU,
double angle )
S3D_VERTEX& aU,
double angle )
{
S3D_VERTEX rotated;
double C = cos( angle );
double S = sin( angle );
double t = 1.0 - C;
double C = cos( angle );
double S = sin( angle );
double t = 1.0 - C;
rotated.x = ( t * aU.x * aU.x + C ) * aV.x +
( t * aU.x * aU.y - S * aU.z ) * aV.y +
@@ -380,9 +345,9 @@ void X3D_MODEL_PARSER::rotate( S3D_VERTEX& aV,
( t * aU.y * aU.z + S * aU.x ) * aV.y +
( t * aU.z * aU.z + C) * aV.z;
aV.x = rotated.x;
aV.y = rotated.y;
aV.z = rotated.z;
aV.x = rotated.x;
aV.y = rotated.y;
aV.z = rotated.z;
}
@@ -393,13 +358,12 @@ void X3D_MODEL_PARSER::rotate( S3D_VERTEX& aV,
* 4. Apply geometry to Master object
*/
void X3D_MODEL_PARSER::readIndexedFaceSet( wxXmlNode* aFaceNode,
PROPERTY_MAP& aTransformProps )
PROPERTY_MAP& aTransformProps)
{
/* Step 1: Read transform data
* --------------------------- */
S3D_VERTEX translation;
parseDoubleTriplet( aTransformProps[ wxT( "translation" ) ], translation );
S3D_VERTEX scale;
@@ -407,36 +371,31 @@ void X3D_MODEL_PARSER::readIndexedFaceSet( wxXmlNode* aFaceNode,
S3D_VERTEX rotation;
double angle = 0.0;
wxStringTokenizer tokens( aTransformProps[ wxT( "rotation" ) ] );
wxStringTokenizer tokens(aTransformProps[ wxT( "rotation" ) ]);
double x = 0.0, y = 0.0, z = 0.0;
if( !(tokens.GetNextToken().ToDouble( &rotation.x ) &&
tokens.GetNextToken().ToDouble( &rotation.y ) &&
tokens.GetNextToken().ToDouble( &rotation.z ) &&
tokens.GetNextToken().ToDouble( &angle ) ) )
{
DBG( printf("rotation read error") );
}
if( !( tokens.GetNextToken().ToDouble( &x )
&& tokens.GetNextToken().ToDouble( &y )
&& tokens.GetNextToken().ToDouble( &z )
&& tokens.GetNextToken().ToDouble( &angle ) ) )
{
// DBG( printf( "rotation read error" ) );
}
else
{
rotation.x = x;
rotation.y = y;
rotation.z = z;
}
double vrmlunits_to_3Dunits = g_Parm_3D_Visu.m_BiuTo3Dunits *
UNITS3D_TO_UNITSPCB;
/* Step 2: Read all coordinate points
* ---------------------------- */
std::vector<double> points;
std::vector< double > points;
NODE_LIST coordinates;
GetChildsByName( aFaceNode, wxT( "Coordinate" ), coordinates );
GetChildsByName( aFaceNode, wxT( "Coordinate" ), coordinates);
PROPERTY_MAP coordinate_properties;
// IndexedFaceSet has one Coordinate child node
GetNodeProperties( coordinates[0], coordinate_properties );
// Save points to vector as doubles
wxStringTokenizer point_tokens( coordinate_properties[ wxT( "point" ) ] );
wxStringTokenizer point_tokens( coordinate_properties[ wxT("point") ] );
double point = 0.0;
while( point_tokens.HasMoreTokens() )
@@ -447,13 +406,13 @@ void X3D_MODEL_PARSER::readIndexedFaceSet( wxXmlNode* aFaceNode,
}
else
{
wxLogTrace( traceX3DParser, wxT( "Error converting to double" ) );
wxLogError( wxT( "Error converting to double" ) );
}
}
if( points.size() % 3 != 0 )
{
// DBG( printf( "Number of points is incorrect" ) );
DBG( printf( "Number of points is incorrect" ) );
return;
}
@@ -461,14 +420,14 @@ void X3D_MODEL_PARSER::readIndexedFaceSet( wxXmlNode* aFaceNode,
* apply transforms in order of SCALE, ROTATION, TRANSLATION
*/
wxString vrml_pointlist;
std::vector<S3D_VERTEX> triplets;
std::vector< S3D_VERTEX > triplets;
for( unsigned id = 0; id < points.size() / 3; id++ )
{
int triplet_indx = id * 3;
S3D_VERTEX point( points[ triplet_indx ],
points[ triplet_indx + 1 ],
points[ triplet_indx + 2 ] );
points[ triplet_indx + 1 ],
points[ triplet_indx + 2 ] );
point.x *= scale.x;
point.y *= scale.y;
@@ -480,7 +439,7 @@ void X3D_MODEL_PARSER::readIndexedFaceSet( wxXmlNode* aFaceNode,
point.y += translation.y;
point.z += translation.z;
m_model->m_Point.push_back( point );
triplets.push_back(point);
// VRML
vrml_pointlist.Append( wxString::Format( wxT( "%f %f %f\n" ), point.x, point.y, point.z ) );
@@ -488,72 +447,18 @@ void X3D_MODEL_PARSER::readIndexedFaceSet( wxXmlNode* aFaceNode,
vrml_points.push_back( vrml_pointlist );
/* Step 3: Read all color points
* ---------------------------- */
std::vector<double> color_points;
NODE_LIST color;
GetChildsByName( aFaceNode, wxT( "Color" ), color );
// Some models lack color information, need to handle this safely
if( !color.empty() )
{
PROPERTY_MAP color_properties;
// IndexedFaceSet has one Coordinate child node
GetNodeProperties( color[0], color_properties );
// Save points to vector as doubles
wxStringTokenizer colorpoint_tokens( color_properties[ wxT( "color" ) ] );
double color_point = 0.0;
while( colorpoint_tokens.HasMoreTokens() )
{
if( colorpoint_tokens.GetNextToken().ToDouble( &color_point ) )
{
color_points.push_back( color_point );
}
else
{
wxLogTrace( traceX3DParser, wxT( "Error converting to double" ) );
}
}
if( color_points.size() % 3 != 0 )
{
// DBG( printf( "Number of points is incorrect" ) );
return;
}
/* Create 3D face color from 3 color points
*/
m_model->m_Materials->m_DiffuseColor.clear();
for( unsigned id = 0; id < color_points.size() / 3; id++ )
{
m_model->m_MaterialIndexPerFace.push_back( id );
int color_triplet_indx = id * 3;
glm::vec3 colorface( color_points[ color_triplet_indx + 0 ],
color_points[ color_triplet_indx + 1 ],
color_points[ color_triplet_indx + 2 ] );
m_model->m_Materials->m_DiffuseColor.push_back( colorface );
}
}
/* -- Read coordinate indexes -- */
PROPERTY_MAP faceset_properties;
GetNodeProperties( aFaceNode, faceset_properties );
std::vector< S3D_VERTEX > vertices;
std::vector< int > coordIndex;
wxString coordIndex_str = faceset_properties[ wxT( "coordIndex" ) ];
wxStringTokenizer index_tokens( coordIndex_str );
wxString vrml_coord_indx_list;
std::vector<int> coord_list;
coord_list.clear();
while( index_tokens.HasMoreTokens() )
{
long index = 0;
@@ -565,15 +470,29 @@ void X3D_MODEL_PARSER::readIndexedFaceSet( wxXmlNode* aFaceNode,
{
/* Step 4: Apply geometry to Master object
* --------------------------------------- */
m_model->m_CoordIndex.push_back( coord_list );
std::vector<int>::const_iterator id;
coord_list.clear();
for( id = coordIndex.begin();
id != coordIndex.end();
id++ )
{
vertices.push_back( triplets.at( *id ) );
}
if( GetMaster()->IsOpenGlAllowed() )
{
GetMaster()->ObjectCoordsTo3DUnits( vertices );
TransfertToGLlist( vertices, vrmlunits_to_3Dunits );
}
vertices.clear();
coordIndex.clear();
vrml_coord_indx_list.Append( wxT( "-1\n" ) );
}
else
{
coord_list.push_back( index );
vrml_coord_indx_list.Append( wxString::Format( wxT( "%ld " ), index ) );
coordIndex.push_back( index );
vrml_coord_indx_list.Append( wxString::Format( wxT( "%u " ), index ) );
}
}
+5 -16
View File
@@ -1,5 +1,5 @@
* Copyright (C) 1992-2014 Jean-Pierre Charras
* Copyright (C) 1992-2014 Kicad Developers Team
* Copyright (C) 1992-2010 Jean-Pierre Charras
* Copyright (C) 1992-2010 Kicad Developers Team
* under GNU General Public License (see copyright.txt)
== Main Authors
@@ -17,20 +17,9 @@ Rok Markovic <rok[at]kanardia.eu>
Tim Hanson <sideskate[at]gmail-dot-com>
Vesa Solonen <vesa.solonen[at]hut-dot-fi>
Alexander Zakamaldin <zaka62[at]mail.ru>
Miguel Angel Ajo Pelayo <miguelangel[at]nbee.es> (Python Scripting)
Alexander Lunev <al.lunev[at]yahoo.com> (Pcad to Kicad converter)
Jacobo Aragunde Perez <jaragunde[at]igalia.com> for Igalia and the CERN
Brian Sidebotham <brian.sidebotham[at]gmail.com>
Maciej Sumiński <maciej.suminski[at]cern.ch>
Tomasz Wlostowski <tomasz.wlostowski[at]cern.ch>
Henner Zeller <h.zeller[at]acm.org>
Mark Roszko <mark.roszko[at]gmail.com>
Daniel Majewski <lordblick[at]gmail.com>
Konstantin Baranovskiy <baranovskiykonstantin[at]gmail.com>
Torsten Hüter <torstenhtr[at]gmx.de>
Nick Østergaard <oe.nick[at]gmail.com>
Andrew Zonenberg <azonenberg[at]drawersteak.com>
Cirilo Bernardo <cirilo_bernardo[at]yahoo.com>
Miguel Angel Ajo Pelayo <miguelangel@nbee.es> (Python Scripting)
Alexander Lunev <al.lunev@yahoo.com> (Pcad to Kicad converter)
Jacobo Aragunde Perez <jaragunde@igalia.com> for Igalia and the CERN
See also CHANGELOG.txt for contributors.
+137 -247
View File
@@ -23,6 +23,10 @@ set( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules )
# reports.
#
#option( USE_KIWAY_DLLS "Build the major modules as KIFACE DLLs or DSOs, will soon be the norm." ON )
set( USE_KIWAY_DLLS true ) # this is now mandatory, the code is the same anyways, the old code is gone.
# The desire is to migrate designs *away from* case independence, and to create designs which use
# literally (case specific) interpreted component names. But for backwards compatibility,
# you may turn OFF this option if you really must. (Remember that with KiCad using text
@@ -32,39 +36,36 @@ set( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules )
# have this option turned OFF, the xml export's referential integrity is broken
# on library part name. Hence the default is ON now, as of 29-Jan-2014.
option( KICAD_KEEPCASE
"Use case sensitive string matching for component names (default ON)."
"ON= case specific string matching on component names, OFF= match names as if they were spelt using uppercase."
ON
)
option( USE_WX_GRAPHICS_CONTEXT
"Use wxGraphicsContext for rendering (default OFF). Warning, this is experimental" )
"Use wxGraphicsContext for rendering ( default OFF). Warning, this is experimental" )
option( USE_WX_OVERLAY
"Use wxOverlay: Always ON for MAC (default OFF). Warning, this is experimental" )
"Use wxOverlay: Always ON for MAC ( default OFF). Warning, this is experimental" )
option( KICAD_SCRIPTING
"Build the Python scripting support inside KiCad binaries (default OFF)."
"set this option ON to build the scripting support inside kicad binaries"
)
option( KICAD_SCRIPTING_MODULES
"Build KiCad Python modules that can be used from scripting languages (default OFF)."
"set this option ON to build kicad modules that can be used from scripting languages"
)
option( KICAD_SCRIPTING_WXPYTHON
"Build wxPython implementation for wx interface building in Python and py.shell (default OFF)."
"set this option ON to build wxpython implementation for wx interface building in python and py.shell"
)
option( KICAD_BUILD_STATIC
"Build dependencies as static libraries. OSX only. (default OFF)."
"Builds Kicad and all libraries static"
)
option( KICAD_BUILD_DYNAMIC
"Build dependencies as shared libraries. Required for wxPython support. OXS only. (default OFF)."
"Builds Kicad and all libraries dynamic (required for wxPython)"
)
option( USE_OSX_DEPS_BUILDER
"Build dependencies from source instead of dependencies installed on system. OSX only. (default OFF)."
)
# WARNING: KiCad developers strongly advise you to build Boost with supplied patches,
# as it is known to work with KiCad. Other versions may contain bugs that may result
@@ -74,6 +75,7 @@ option( KICAD_SKIP_BOOST
)
mark_as_advanced( KICAD_SKIP_BOOST ) # Normal builders should build Boost.
# when option KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES is enabled:
# PYTHON_EXECUTABLE can be defined when invoking cmake
# ( use -DPYTHON_EXECUTABLE=<python path>/python.exe or python2 )
@@ -82,7 +84,6 @@ mark_as_advanced( KICAD_SKIP_BOOST ) # Normal builders should build Boost.
option( BUILD_GITHUB_PLUGIN "Build the GITHUB_PLUGIN for pcbnew." ON )
# This can be set to a custom name to brag about a particular branch in the "About" dialog:
set( KICAD_REPO_NAME "product" CACHE STRING "Name of the tree from which this build came." )
@@ -94,33 +95,16 @@ set( KICAD_REPO_NAME "product" CACHE STRING "Name of the tree from which this bu
set( DOWNLOAD_DIR ${PROJECT_SOURCE_DIR}/.downloads-by-cmake
CACHE PATH "Location of KiCad downloads, suggested is a dir common to all builds, i.e. global." )
# Add option to add user directories for linker, if any
#Add option to add user directories for linker, if any
LINK_DIRECTORIES( ${LINK_DIRECTORIES_PATH} )
if( UNIX )
set( KICAD_USER_CONFIG_DIR $ENV{HOME} CACHE PATH "Location of user specific KiCad config files" )
elseif( MINGW )
set( KICAD_USER_CONFIG_DIR $ENV{APPDATA} CACHE PATH "Location of user specific KiCad config files" )
set( KICAD_USER_CONFIG_DIR $ENV{%APPDATA%} CACHE PATH "Location of user specific KiCad config files" )
endif()
mark_as_advanced( KICAD_USER_CONFIG_DIR )
# Set default data file path to CMAKE_INSTALL_PREFIX if it wasn't specified during the
# CMake configuration. The value of DEFAULT_INSTALL_PATH is expanded in config.h and
# used in the source code to define the base path for kicad search paths and environment
# variables.
if( NOT DEFAULT_INSTALL_PATH )
set( DEFAULT_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}"
CACHE
PATH
"Location of KiCad data files." )
endif()
message( STATUS "Kicad install dir: <${DEFAULT_INSTALL_PATH}>" )
# Generate build system specific header file.
include( PerformFeatureChecks )
perform_feature_checks()
#================================================
# Set flags for GCC, or treat llvm as GCC
@@ -199,28 +183,16 @@ if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
# Since version 2.8.5, Cmake uses a response file (.rsp) to
# pass the list of include paths to gcc
# unfortunately, under mingw32+msys, at least with gcc 4.8 and previous,
# this file is not always expanded and in this case include paths defined in this file
# are not taken in account ( this is the case of wxWidgets includes )
# If it is the case, disable this response file for includes ( See Windows-GNU.cmake module )
if( false ) #set to true to disable the include response file
if( WIN32 AND MSYS AND NOT CMAKE_CROSSCOMPILING )
# fixme: it is needed only with MSYS+MINGW32? or always under MINGW
if( ${CMAKE_SIZEOF_VOID_P} MATCHES 4 )
set( CMAKE_CXX_USE_RESPONSE_FILE_FOR_INCLUDES 0 )
endif()
# this file is not expanded and include paths defined in this file are not taken in account
# this is the case of wxWidgets includes
# Disable this response file for includes ( See Windows-GNU.cmake module )
if( WIN32 AND MSYS AND NOT CMAKE_CROSSCOMPILING )
# fixme: it is needed only with MSYS+MINGW32? or always under MINGW
if( ${CMAKE_SIZEOF_VOID_P} MATCHES 4 )
set( CMAKE_CXX_USE_RESPONSE_FILE_FOR_INCLUDES 0 )
endif()
endif()
# for some reasons, cmake does do use always a response file to send the list of objects
# to the archiver, and because this list can be very long, and can create issue
# when it is used in a command line, force use of a response file to store it
SET( CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS 1 )
# The MinGW compiler can use the microsoft system snprintf as standard and it has a broken
# API with respect to the C99 standard, so make sure we force it to use its own compliant
# snprintf
add_definitions(-D__USE_MINGW_ANSI_STDIO=1)
else()
# We build DLL/DSOs from static libraries, so create position independent
# code for all cases, since we do not have DLL/DSO specific static
@@ -255,8 +227,8 @@ if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
if( APPLE )
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__ASSERTMACROS__" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__ASSERTMACROS__" )
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__ASSERTMACROS__ -mmacosx-version-min=10.5" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__ASSERTMACROS__ -mmacosx-version-min=10.5" )
# Allows .dylib relocation in the future - needed by fixbundle
set( CMAKE_LD_FLAGS "${CMAKE_LD_FLAGS} -headerpad_max_install_names")
@@ -269,12 +241,6 @@ if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
EXEC_PROGRAM( wx-config ARGS --cxx OUTPUT_VARIABLE CMAKE_CXX_COMPILER )
endif()
# There seems to be no consistent behavior when -mmacosx-min-version is
# not specified, so force user to set minimum OSX version to build for
if( NOT CMAKE_OSX_DEPLOYMENT_TARGET )
message( FATAL_ERROR "Please specify target OS X version using -DCMAKE_OSX_DEPLOYMENT_TARGET=10.x" )
endif()
endif()
endif( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
@@ -304,13 +270,19 @@ if( USE_WX_GRAPHICS_CONTEXT )
endif()
# By default images in menu items are enabled on all platforms except OSX.
if( NOT APPLE )
set( USE_IMAGES_IN_MENUS ON CACHE BOOL "Enable images in menus" )
else()
set( USE_IMAGES_IN_MENUS OFF CACHE BOOL "Enable images in menus" )
endif()
# Allow user to override the default settings for adding images to menu items. By default
# images in menu items are enabled on all platforms except OSX. This can be over ridden by
# defining -DUSE_IMAGES_IN_MENUS=ON/OFF to force the preferred behavior.
if( NOT DEFINED USE_IMAGES_IN_MENUS )
if( NOT APPLE )
set( USE_IMAGES_IN_MENUS ON )
endif()
else()
if( USE_IMAGES_IN_MENUS )
set( USE_IMAGES_IN_MENUS ON )
endif()
endif()
# KIFACE_SUFFIX is the file extension used for top level program modules which
@@ -333,83 +305,39 @@ set( KIFACE_PREFIX "_" )
#================================================
# Locations for install targets.
#================================================
if( NOT APPLE )
set( KICAD_BIN bin
CACHE PATH "Location of KiCad binaries." )
set( KICAD_FP_LIB_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}"
CACHE PATH "Default path where footprint libraries are installed." )
if( UNIX )
# Everything without leading / is relative to CMAKE_INSTALL_PREFIX.
set( KICAD_BIN ${CMAKE_INSTALL_PREFIX}/bin
CACHE PATH "Location of KiCad binaries." )
if( WIN32 )
set( KICAD_PLUGINS ${KICAD_BIN}/scripting/plugins
CACHE PATH "Location of KiCad plugins." )
else()
set( KICAD_PLUGINS lib/kicad/plugins
CACHE PATH "Location of KiCad plugins." )
endif()
set( KICAD_PLUGINS lib/kicad/plugins
CACHE PATH "Location of KiCad plugins." )
set( KICAD_DATA share/kicad
CACHE PATH "Location of KiCad data files." )
set( KICAD_DOCS share/doc/kicad
CACHE PATH "Location of KiCad documentation files." )
set( KICAD_DEMOS ${KICAD_DATA}/demos
CACHE PATH "Location of KiCad demo files." )
set( KICAD_TEMPLATE ${KICAD_DATA}/template
CACHE PATH "Location of KiCad template files." )
else()
# everything without leading / is relative to CMAKE_INSTALL_PREFIX.
# CMAKE_INSTALL_PREFIX is root of .dmg image
set( KICAD_BIN ${CMAKE_INSTALL_PREFIX}
CACHE PATH "Location of KiCad binaries." FORCE )
# some paths to single app bundle
set( OSX_BUNDLE_MAIN "kicad.app" )
set( OSX_BUNDLE_BIN_DIR "Contents/MacOS" )
set( OSX_BUNDLE_LIB_DIR "Contents/Frameworks" )
set( OSX_BUNDLE_KIFACE_DIR "Contents/PlugIns" )
set( OSX_BUNDLE_SUP_DIR "Contents/SharedSupport" )
set( OSX_BUNDLE_APP_DIR "Contents/Applications" )
set( OSX_BUNDLE_BUILD_DIR "${CMAKE_BINARY_DIR}/kicad/${OSX_BUNDLE_MAIN}" )
set( OSX_BUNDLE_BUILD_BIN_DIR "${OSX_BUNDLE_BUILD_DIR}/${OSX_BUNDLE_BIN_DIR}" )
set( OSX_BUNDLE_BUILD_LIB_DIR "${OSX_BUNDLE_BUILD_DIR}/${OSX_BUNDLE_LIB_DIR}" )
set( OSX_BUNDLE_BUILD_KIFACE_DIR "${OSX_BUNDLE_BUILD_DIR}/${OSX_BUNDLE_KIFACE_DIR}" )
set( OSX_BUNDLE_INSTALL_DIR "${KICAD_BIN}/${OSX_BUNDLE_MAIN}" )
set( OSX_BUNDLE_INSTALL_BIN_DIR "${OSX_BUNDLE_INSTALL_DIR}/${OSX_BUNDLE_BIN_DIR}" )
set( OSX_BUNDLE_INSTALL_LIB_DIR "${OSX_BUNDLE_INSTALL_DIR}/${OSX_BUNDLE_LIB_DIR}" )
set( OSX_BUNDLE_INSTALL_KIFACE_DIR "${OSX_BUNDLE_INSTALL_DIR}/${OSX_BUNDLE_KIFACE_DIR}" )
# everything provided with the application bundle goes into
# kicad.app/Contents/SharedSupport => accessible via GetDataDir()
# everything else to the .dmg image
set( KICAD_DATA ${OSX_BUNDLE_INSTALL_DIR}/${OSX_BUNDLE_SUP_DIR}
CACHE PATH "Location of KiCad data files." FORCE )
set( KICAD_TEMPLATE ${KICAD_DATA}/template
CACHE PATH "Location of KiCad template files." FORCE )
set( KICAD_PLUGINS ${KICAD_DATA}/plugins
CACHE PATH "Location of KiCad plugins." FORCE )
set( KICAD_DOCS doc
CACHE PATH "Location of KiCad documentation files." FORCE )
set( KICAD_DEMOS demos
CACHE PATH "Location of KiCad demo files." FORCE )
# Override default paths for fixup_bundle
set( OSX_BUNDLE_OVERRIDE_PATHS "
function( gp_item_default_embedded_path_override item default_embedded_path_var )
# by default, embed things right next to the main bundle executable:
set( path \"@executable_path/../../Contents/MacOS\" )
set( overridden 0 )
# embed .dylibs right next to the main bundle executable:
if( item MATCHES \"\\\\.dylib$\" )
set( path \"@executable_path/../Frameworks\" )
set( overridden 1 )
endif()
set( \${default_embedded_path_var} \"\${path}\" PARENT_SCOPE )
endfunction(gp_item_default_embedded_path_override)
"
)
set( KICAD_FP_LIB_INSTALL_PATH "${KICAD_FP_LIB_INSTALL_PATH}/share/kicad/modules" )
endif()
if( MINGW )
# Everything without leading / is relative to CMAKE_INSTALL_PREFIX.
set( KICAD_PLUGINS ${KICAD_BIN}/plugins
CACHE PATH "Location of KiCad plugins." )
set( KICAD_DATA share
CACHE PATH "Location of KiCad data files." )
set( KICAD_DOCS doc
CACHE PATH "Location of KiCad documentation files." )
set( KICAD_FP_LIB_INSTALL_PATH "${KICAD_FP_LIB_INSTALL_PATH}/modules" )
endif()
set( KICAD_DEMOS ${KICAD_DATA}/demos
CACHE PATH "Location of KiCad demo files." )
set( KICAD_TEMPLATE ${KICAD_DATA}/template
CACHE PATH "Location of KiCad template files." )
mark_as_advanced( KICAD_BIN
KICAD_PLUGINS
KICAD_DATA
@@ -426,24 +354,9 @@ include( ExternalProject )
#================================================
include( CheckFindPackageResult )
##########################
# Find wxWidgets library #
##########################
# Here you can define what libraries of wxWidgets you need for your
# application. You can figure out what libraries you need here;
# http://www.wxwidgets.org/manuals/2.8/wx_librarieslist.html
# Turn on wxWidgets compatibility mode for some classes
add_definitions( -DWX_COMPATIBILITY )
# See line 41 of CMakeModules/FindwxWidgets.cmake
set( wxWidgets_CONFIG_OPTIONS ${wxWidgets_CONFIG_OPTIONS} --static=no )
find_package( wxWidgets 3.0.0 COMPONENTS gl aui adv html core net base xml stc REQUIRED )
# Include wxWidgets macros.
include( ${wxWidgets_USE_FILE} )
#######################
# Find OpenGL library #
#######################
@@ -460,12 +373,9 @@ check_find_package_result( OPENGL_FOUND "OpenGL" )
# Always defined, empty if no libraries are to be built
add_custom_target( lib-dependencies )
# Only download and build all dependencies from source on OSX if the user specifically requests
# it. Otherwise, respect the developers wishes to use the dependencies already installed on
# their system
if( APPLE AND USE_OSX_DEPS_BUILDER )
if( KICAD_BUILD_STATIC OR KICAD_BUILD_DYNAMIC )
# This should be built in all cases, if swig exec is not available
# This should be built in all cases, if swig exec is not avaiable
# will be impossible also enable SCRIPTING being for PCBNEW required immediately
include( download_pcre )
@@ -508,24 +418,31 @@ if( APPLE AND USE_OSX_DEPS_BUILDER )
set( PYTHON_DEST ${LIBWXPYTHON_ROOT}/wxPython/lib/python2.6/site-packages )
set(wxWidgets_BIN_DIR ${LIBWXPYTHON_ROOT}/bin/wxrc )
set(wxWidgets_CONFIG_EXECUTABLE ${LIBWXPYTHON_ROOT}/bin/wx-config )
set(wxWidgets_INCLUDE_DIRS ${LIBWXPYTHON_ROOT}/include/wx-3.0 )
set(wxWidgets_LIBRARY_DIRS ${LIBWXPYTHON_ROOT}/lib )
add_dependencies( lib-dependencies libwxpython )
add_dependencies( lib-dependencies swig )
else()
include( download_wxwidgets )
add_dependencies( lib-dependencies libwx )
endif()
include( download_libpng )
include( download_pkgconfig )
set( PKG_CONFIG_EXECUTABLE "${PKGCONFIG_ROOT}/bin/pkg-config" )
set( PKG_CONFIG_EXECUTABLE "${PKGCONFIG_ROOT}/bin/pkg-config" )
include( download_glew )
set( GLEW_GLEW_LIBRARY "${GLEW_ROOT}/lib/libGLEW.a" )
set( GLEW_INCLUDE_DIR "${GLEW_ROOT}/include" )
set( GLEW_GLEW_LIBRARY "${GLEW_ROOT}/lib/libGLEW.a" )
set( GLEW_INCLUDE_DIR "${GLEW_ROOT}/include" )
include( download_pixman )
set( PIXMAN_LIBRARY "${PIXMAN_ROOT}/lib/libpixman-1.a" )
set( PIXMAN_LIBRARY "${PIXMAN_ROOT}/lib/libpixman-1.a" )
include( download_cairo )
set( CAIRO_INCLUDE_DIR "${CAIRO_ROOT}/include/cairo" )
set( CAIRO_LIBRARY "${CAIRO_ROOT}/lib/libcairo.a" )
set( CAIRO_INCLUDE_DIR "${CAIRO_ROOT}/include/cairo" )
set( CAIRO_LIBRARY "${CAIRO_ROOT}/lib/libcairo.a" )
add_dependencies( lib-dependencies boost )
add_dependencies( lib-dependencies cairo )
@@ -534,13 +451,11 @@ if( APPLE AND USE_OSX_DEPS_BUILDER )
add_dependencies( lib-dependencies pkgconfig )
if( KICAD_BUILD_DYNAMIC AND APPLE )
add_custom_target( osx_fix_bundles ALL DEPENDS
eeschema gerbview kicad pcbnew bitmap2component pcb_calculator pl_editor)
add_custom_command(TARGET osx_fix_bundles
POST_BUILD COMMAND ${PROJECT_SOURCE_DIR}/scripts/osx_fixbundle.sh ${PROJECT_SOURCE_DIR}
COMMENT "Migrating dylibs to bundles")
add_custom_target( osx_fix_bundles ALL DEPENDS cvpcb eeschema gerbview kicad pcbnew bitmap2component pcb_calculator pl_editor)
add_custom_command(TARGET osx_fix_bundles POST_BUILD COMMAND ${PROJECT_SOURCE_DIR}/scripts/osx_fixbundle.sh ${PROJECT_SOURCE_DIR} COMMENT "Migrating dylibs to bundles")
endif()
endif()
endif( KICAD_BUILD_STATIC OR KICAD_BUILD_DYNAMIC)
#####################
# Find GLEW library #
@@ -568,22 +483,48 @@ if( KICAD_SKIP_BOOST )
message( FATAL_ERROR "Boost 1.54+ libraries are required." )
endif()
# Keeps CMake from complaining about undefined boost dependencies even though Boost was
# found. Sigh!!!!!
add_custom_target( boost )
add_custom_target( boost ) # it is required to meet some further dependencies
message( WARNING "
WARNING: You decided to skip building boost library.
KiCad developers strongly advise you to build the bundled boost library, as it is known to work with KiCad.
Other versions may contain bugs that may result in KiCad errors." )
else()
add_dependencies( lib-dependencies boost )
include( download_boost )
endif()
##########################
# Find wxWidgets library #
##########################
# Here you can define what libraries of wxWidgets you need for your
# application. You can figure out what libraries you need here;
# http://www.wxwidgets.org/manuals/2.8/wx_librarieslist.html
# See line 41 of CMakeModules/FindwxWidgets.cmake
set( wxWidgets_CONFIG_OPTIONS --static=no )
# On Apple only wxwidgets 2.9 or higher doesn't need to find aui part of base
# Seems no more needed on wx-3
if( APPLE AND ( KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES OR KICAD_SCRIPTING_WXPYTHON) )
find_package( wxWidgets COMPONENTS gl adv html core net base xml QUIET )
else()
find_package( wxWidgets COMPONENTS gl aui adv html core net base xml QUIET )
endif()
if( NOT (KICAD_BUILD_STATIC OR KICAD_BUILD_DYNAMIC) )
check_find_package_result( wxWidgets_FOUND "wxWidgets" )
endif()
# Include wxWidgets macros.
include( ${wxWidgets_USE_FILE} )
# Include MinGW resource compiler.
include( MinGWResourceCompiler )
# Generate build system specific header file.
include( PerformFeatureChecks )
perform_feature_checks()
# Find GDI+ on windows if wxGraphicsContext is available.
if( MINGW AND USE_WX_GRAPHICS_CONTEXT )
find_package( GdiPlus )
@@ -613,8 +554,16 @@ set( INC_AFTER
# Find Python and other scripting resources
if( KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES )
if( APPLE )
set( PYTHON_LIBRARY /System/Library/Frameworks/Python.framework/Versions/2.6/Python )
set( PYTHON_INCLUDE_DIR /System/Library/Frameworks/Python.framework/Versions//2.6/include/python2.6 )
set( PythonInterp_FIND_VERSION 2.6 )
set( PythonLibs_FIND_VERSION 2.6 )
endif()
# force a python version < 3.0
set( PythonInterp_FIND_VERSION 2.6 )
set( PythonInterp_FIND_VERSION 2.6)
set( PythonLibs_FIND_VERSION 2.6 )
find_package( PythonInterp )
@@ -624,72 +573,25 @@ if( KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES )
if( NOT PYTHON_VERSION_MAJOR EQUAL 2 )
message( FATAL_ERROR "Python 2.x is required." )
endif()
# Get the correct Python site package install path from the Python interpreter found by
# FindPythonInterp unless the user specifically defined a custom path.
if( NOT PYTHON_SITE_PACKAGE_PATH )
execute_process( COMMAND ${PYTHON_EXECUTABLE} -c "import distutils.sysconfig;print\"%s\"%distutils.sysconfig.get_python_lib(plat_specific=0, standard_lib=0, prefix='')"
execute_process( COMMAND ${PYTHON_EXECUTABLE} -c "import distutils.sysconfig;print\"%s\"%distutils.sysconfig.get_python_lib()"
OUTPUT_VARIABLE PYTHON_SITE_PACKAGE_PATH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if( NOT PYTHON_SITE_PACKAGE_PATH )
message( FATAL_ERROR "Error occurred while attempting to find the Python site library path." )
message( FATAL_ERROR "Error occurred while attemping to find the Python site library path." )
endif()
endif()
if( NOT APPLE )
set( PYTHON_DEST "${PYTHON_SITE_PACKAGE_PATH}"
CACHE PATH "Python module install path."
)
else()
# relative path for python in bundle
set( PYTHON_LIB_DIR "python/site-packages" )
# install into bundle Frameworks folder
set( PYTHON_DEST "${OSX_BUNDLE_BUILD_LIB_DIR}/${PYTHON_LIB_DIR}"
CACHE PATH "Python module install path."
)
endif()
set( PYTHON_DEST "${PYTHON_SITE_PACKAGE_PATH}" CACHE PATH "Python module install path." )
mark_as_advanced( PYTHON_DEST )
message( STATUS "Python module install path: ${PYTHON_DEST}" )
find_package( PythonLibs 2.6 )
if( KICAD_SCRIPTING_WXPYTHON )
# Check to see if the correct version of wxPython is installed based on the version of
# wxWidgets found. At least the major an minor version should match.
set( _wxpy_version "${wxWidgets_VERSION_MAJOR}.${wxWidgets_VERSION_MINOR}" )
set( _py_cmd "import wxversion;print wxversion.checkInstalled('${_wxpy_version}')" )
# Add user specified Python site package path.
if( PYTHON_SITE_PACKAGE_PATH )
set( _py_cmd
"import sys;sys.path.insert(0, \"${PYTHON_SITE_PACKAGE_PATH}\");${_py_cmd}" )
endif()
execute_process( COMMAND ${PYTHON_EXECUTABLE} -c "${_py_cmd}"
RESULT_VARIABLE WXPYTHON_VERSION_RESULT
OUTPUT_VARIABLE WXPYTHON_VERSION_FOUND
OUTPUT_STRIP_TRAILING_WHITESPACE
)
# message( STATUS "WXPYTHON_VERSION_FOUND: ${WXPYTHON_VERSION_FOUND}" )
# message( STATUS "WXPYTHON_VERSION_RESULT: ${WXPYTHON_VERSION_RESULT}" )
# Check to see if any version of wxPython is installed on the system.
if( WXPYTHON_VERSION_RESULT GREATER 0 )
message( FATAL_ERROR "wxPython does not appear to be installed on the system." )
endif()
if( NOT WXPYTHON_VERSION_FOUND STREQUAL "True" )
message( FATAL_ERROR
"wxPython version ${_wxpy_version} does not appear to be installed on the system." )
endif()
set( WXPYTHON_VERSION ${_wxpy_version} CACHE STRING "wxPython version found." )
message( STATUS "wxPython version ${_wxpy_version} found." )
endif()
#message( STATUS "PYTHON_INCLUDE_DIRS:${PYTHON_INCLUDE_DIRS}" )
# Infrequently needed headers go at end of search paths, append to INC_AFTER which
@@ -701,6 +603,11 @@ if( KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES )
endif()
# Automagically create version header file.
include( CreateBzrVersionHeader )
create_bzr_version_header()
if( EXISTS ${CMAKE_SOURCE_DIR}/include/config.h )
# This file may exist ( created by an alternate process to the svn test above),
# e.g. could be created by a checkout script that produces a source tar file.
@@ -715,24 +622,6 @@ endif()
# 'CMakeLists.txt' files to process
#================================================
if( APPLE )
# Remove app bundles in ${KICAD_BIN} before installing anything new.
# Must be defined before all includes so that it is executed first.
install( CODE "
message( STATUS \"Removing existing application bundles...\" )
# Remove links to standalone apps
file( REMOVE ${KICAD_BIN}/bitmap2component.app )
file( REMOVE ${KICAD_BIN}/eeschema.app )
file( REMOVE ${KICAD_BIN}/gerbview.app )
file( REMOVE ${KICAD_BIN}/pcb_calculator.app )
file( REMOVE ${KICAD_BIN}/pcbnew.app )
file( REMOVE ${KICAD_BIN}/pl_editor.app )
# Remove main bundle
file( REMOVE_RECURSE ${KICAD_BIN}/${OSX_BUNDLE_MAIN} )
" COMPONENT Runtime
)
endif()
############################
# Binaries ( CMake targets ) #
############################
@@ -762,7 +651,7 @@ add_subdirectory( qa )
# except perhaps bitmap lib. This allows a multi-threaded build to succeed.
add_dependencies( pcbnew boost )
add_dependencies( eeschema boost )
add_dependencies( cvpcb_kiface boost )
add_dependencies( cvpcb boost )
add_dependencies( gal boost )
add_dependencies( common boost )
add_dependencies( pcbcommon boost )
@@ -773,10 +662,10 @@ add_dependencies( pl_editor boost )
add_dependencies( pnsrouter boost )
if( KICAD_BUILD_STATIC OR KICAD_BUILD_DYNAMIC )
if ( KICAD_BUILD_STATIC OR KICAD_BUILD_DYNAMIC )
add_dependencies( pcbnew lib-dependencies )
add_dependencies( eeschema lib-dependencies )
add_dependencies( cvpcb_kiface lib-dependencies )
add_dependencies( cvpcb lib-dependencies )
add_dependencies( common lib-dependencies )
add_dependencies( gal lib-dependencies )
add_dependencies( pcbcommon lib-dependencies )
@@ -786,7 +675,7 @@ if( KICAD_BUILD_STATIC OR KICAD_BUILD_DYNAMIC )
add_dependencies( pnsrouter lib-dependencies )
endif()
if( KICAD_BUILD_DYNAMIC )
if ( KICAD_BUILD_DYNAMIC )
endif()
#############
@@ -818,9 +707,6 @@ else()
message( STATUS "WARNING: Doxygen not found - doxygen-docs (Source Docs) target not created" )
endif()
# Generate config.h.
configure_file( ${PROJECT_SOURCE_DIR}/CMakeModules/config.h.cmake
${CMAKE_BINARY_DIR}/config.h )
#================================================
# "make uninstall" rules
@@ -842,6 +728,10 @@ install( FILES INSTALL.txt
DESTINATION ${KICAD_DOCS}
COMPONENT resources )
install( FILES resources/freeroute.jnlp
DESTINATION ${KICAD_BIN}
COMPONENT resources )
###
# Install scripts
###
@@ -855,7 +745,7 @@ endif()
###
# FreeDesktop .desktop and MIME resources
###
if( UNIX AND NOT APPLE )
if( UNIX )
# Set paths
set( UNIX_MIME_DIR resources/linux/mime )
+43 -36
View File
@@ -2,7 +2,7 @@
# This program source code file is part of KICAD, a free EDA CAD application.
#
# Copyright (C) 2010 Wayne Stambaugh <stambaughw@verizon.net>
# Copyright (C) 2010-2015 Kicad Developers, see AUTHORS.txt for contributors.
# Copyright (C) 2010 Kicad Developers, see AUTHORS.txt for contributors.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -22,11 +22,7 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#
macro( create_bzr_version_header _bzr_src_path )
# If bzr is not found or an error occurs using the bzr commands to determine the repo
# version, set the build version string to "no-bzr"
set( KICAD_BUILD_VERSION "no-bzr" )
macro( create_bzr_version_header )
# Include Bazaar support to automagically create version header file.
find_package( Bazaar )
@@ -34,42 +30,53 @@ macro( create_bzr_version_header _bzr_src_path )
set( _Bazaar_SAVED_LC_ALL "$ENV{LC_ALL}" )
set( ENV{LC_ALL} C )
# Get the tree revision
execute_process(
COMMAND ${Bazaar_EXECUTABLE} revno --tree ${_bzr_src_path}
OUTPUT_VARIABLE _bzr_TREE_DATE
RESULT_VARIABLE _bzr_revno_result
OUTPUT_STRIP_TRAILING_WHITESPACE )
# Get the tree revison
execute_process( COMMAND
${Bazaar_EXECUTABLE} revno --tree ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE _bazaar_TREE_DATE
OUTPUT_STRIP_TRAILING_WHITESPACE)
if( ${_bzr_revno_result} EQUAL 0 )
# Get more info about that revision
execute_process(
COMMAND ${Bazaar_EXECUTABLE} log -r${_bzr_TREE_DATE} ${_bzr_src_path}
OUTPUT_VARIABLE _bzr_LAST_CHANGE_LOG
ERROR_VARIABLE _bzr_log_error
RESULT_VARIABLE _bzr_log_result
OUTPUT_STRIP_TRAILING_WHITESPACE )
# Get more info about that revision
execute_process( COMMAND
${Bazaar_EXECUTABLE} log -r${_bazaar_TREE_DATE} ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE _bazaar_LAST_CHANGE_LOG
ERROR_VARIABLE _bazaar_log_error
RESULT_VARIABLE _bazaar_log_result
OUTPUT_STRIP_TRAILING_WHITESPACE )
if( ${_bzr_log_result} EQUAL 0 )
string( REGEX REPLACE "^(.*\n)?revno: ([^ \n]+).*"
"\\2" Kicad_REPO_REVISION "${_bzr_LAST_CHANGE_LOG}" )
string( REGEX REPLACE "^(.*\n)?committer: ([^\n]+).*"
"\\2" Kicad_REPO_LAST_CHANGED_AUTHOR "${_bzr_LAST_CHANGE_LOG}" )
string( REGEX REPLACE "^(.*\n)?timestamp: [a-zA-Z]+ ([^ \n]+).*"
"\\2" Kicad_REPO_LAST_CHANGED_DATE "${_bzr_LAST_CHANGE_LOG}" )
endif()
endif()
if( NOT ${_bzr_log_result} EQUAL 0 )
message(STATUS "Using <build_version.h> for version string.")
else( NOT ${_bzr_log_result} EQUAL 0 )
string( REGEX REPLACE "^(.*\n)?revno: ([^ \n]+).*"
"\\2" Kicad_REPO_REVISION "${_bazaar_LAST_CHANGE_LOG}" )
string( REGEX REPLACE "^(.*\n)?committer: ([^\n]+).*"
"\\2" Kicad_REPO_LAST_CHANGED_AUTHOR "${_bazaar_LAST_CHANGE_LOG}" )
string( REGEX REPLACE "^(.*\n)?timestamp: [a-zA-Z]+ ([^ \n]+).*"
"\\2" Kicad_REPO_LAST_CHANGED_DATE "${_bazaar_LAST_CHANGE_LOG}" )
endif( NOT ${_bzr_log_result} EQUAL 0 )
set( ENV{LC_ALL} ${_Bazaar_SAVED_LC_ALL} )
endif()
endif( Bazaar_FOUND )
# Check to make sure 'bzr log' command did not fail. Otherwise, default
# to "no-bzr" as the revision.
# Check to make sure 'bzr log' command did not fail. Otherwise fallback
# to version strings defined in "<kicad-src-dir>/include/build_version.h".
if( Kicad_REPO_LAST_CHANGED_DATE )
string( REGEX REPLACE "^([0-9]+)\\-([0-9]+)\\-([0-9]+)" "\\1-\\2-\\3"
_kicad_bzr_date ${Kicad_REPO_LAST_CHANGED_DATE} )
_kicad_bzr_date ${Kicad_REPO_LAST_CHANGED_DATE} )
set( KICAD_BUILD_VERSION "(${_kicad_bzr_date} BZR ${Kicad_REPO_REVISION})" )
endif()
set( KICAD_BUILD_VERSION ${KICAD_BUILD_VERSION} )
endmacro()
# Definition to conditionally use date and revision returned from the
# Bazaar log command instead of hand coded date and revision in
# "include/build_version.h". If Bazaar is not found then the date
# and version information must be manually edited.
# Directive means bzr build, program version and build version will
# reflect this.
add_definitions( -DHAVE_SVN_VERSION )
# Generate version.h.
configure_file( ${CMAKE_SOURCE_DIR}/CMakeModules/version.h.cmake
${CMAKE_BINARY_DIR}/version.h)
message( STATUS "Kicad Bazaar build version: ${KICAD_BUILD_VERSION}")
endif(Kicad_REPO_LAST_CHANGED_DATE)
endmacro(create_bzr_version_header)
-105
View File
@@ -1,105 +0,0 @@
#
# This program source code file is part of KICAD, a free EDA CAD application.
#
# Copyright (C) 2010 Wayne Stambaugh <stambaughw@verizon.net>
# Copyright (C) 2010-2015 Kicad Developers, see AUTHORS.txt for contributors.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, you may find one here:
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# or you may search the http://www.gnu.org website for the version 2 license,
# or you may write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#
macro( create_git_version_header _git_src_path )
# If bzr is not found or an error occurs using the git commands to determine the repo
# version, set the build version string to "no-git"
set( KICAD_BUILD_VERSION "no-git" )
# Include Git support to automagically create version header file.
find_package( Git )
if( GIT_FOUND )
set( _Git_SAVED_LC_ALL "$ENV{LC_ALL}" )
set( ENV{LC_ALL} C )
# Get latest commit hash
execute_process(
COMMAND
${GIT_EXECUTABLE} --no-pager log -1 HEAD
--pretty=format:%H
WORKING_DIRECTORY ${_git_src_path}
OUTPUT_VARIABLE _git_LONG_HASH
ERROR_VARIABLE _git_log_error
RESULT_VARIABLE _git_log_result
OUTPUT_STRIP_TRAILING_WHITESPACE)
if( ${_git_log_result} EQUAL 0 )
execute_process(
COMMAND
${GIT_EXECUTABLE} --no-pager log -1 HEAD
--pretty=format:%h
WORKING_DIRECTORY ${_git_src_path}
OUTPUT_VARIABLE _git_SHORT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(
COMMAND
${GIT_EXECUTABLE} --no-pager log -1 HEAD
--pretty=format:%cn
WORKING_DIRECTORY ${_git_src_path}
OUTPUT_VARIABLE _git_LAST_COMITTER
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(
COMMAND
${GIT_EXECUTABLE} --no-pager log -1 HEAD
--pretty=format:%cd --date=short
WORKING_DIRECTORY ${_git_src_path}
OUTPUT_VARIABLE _git_LAST_CHANGE_LOG
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(
COMMAND
${GIT_EXECUTABLE} rev-list HEAD --count
--first-parent
WORKING_DIRECTORY ${_git_src_path}
OUTPUT_VARIABLE _git_SERIAL
OUTPUT_STRIP_TRAILING_WHITESPACE)
message(STATUS "Git hash: ${_git_LONG_HASH}")
if( ${_git_log_result} EQUAL 0 )
string( REGEX REPLACE "^(.*\n)?revno: ([^ \n]+).*"
"\\2" Kicad_REPO_REVISION "BZR ${_git_SERIAL}, Git ${_git_SHORT_HASH}" )
string( REGEX REPLACE "^(.*\n)?committer: ([^\n]+).*"
"\\2" Kicad_REPO_LAST_CHANGED_AUTHOR "${_git_LAST_COMITTER}")
string( REGEX REPLACE "^(.*\n)?timestamp: [a-zA-Z]+ ([^ \n]+).*"
"\\2" Kicad_REPO_LAST_CHANGED_DATE "${_git_LAST_CHANGE_LOG}")
endif()
endif()
set( ENV{LC_ALL} ${_Git_SAVED_LC_ALL} )
endif( GIT_FOUND )
# Check to make sure 'git' command did not fail. Otherwise fallback
# to "no-git" as the revision.
if( Kicad_REPO_LAST_CHANGED_DATE )
string( REGEX REPLACE "^([0-9]+)\\-([0-9]+)\\-([0-9]+)" "\\1-\\2-\\3"
_kicad_git_date ${Kicad_REPO_LAST_CHANGED_DATE} )
set( KICAD_BUILD_VERSION "(${_kicad_git_date} ${Kicad_REPO_REVISION})" )
endif()
set( KICAD_BUILD_VERSION ${KICAD_BUILD_VERSION} )
endmacro()
+9 -9
View File
@@ -54,28 +54,28 @@ if( Bazaar_EXECUTABLE )
# Fetch the Bazaar executable version.
execute_process( COMMAND ${Bazaar_EXECUTABLE} --version
OUTPUT_VARIABLE _bzr_version_output
OUTPUT_VARIABLE bzr_version_output
ERROR_VARIABLE _bzr_version_error
RESULT_VARIABLE _bzr_version_result
OUTPUT_STRIP_TRAILING_WHITESPACE )
if( ${_bzr_version_result} EQUAL 0 )
set( Bazaar_FOUND TRUE )
string( REGEX REPLACE "^[\n]*Bazaar \\(bzr\\) ([0-9.a-z]+).*"
"\\1" Bazaar_VERSION "${_bzr_version_output}" )
string( REGEX REPLACE "^(.*\n)? \(bzr\) ([^\n]+).*"
"\\2" Bazaar_VERSION "${_bzr_version_output}" )
message( STATUS "Bazaar version control system version ${Bazaar_VERSION} found." )
endif()
endif( ${_bzr_version_result} EQUAL 0 )
# restore the previous LC_ALL
set( ENV{LC_ALL} ${_Bazaar_SAVED_LC_ALL} )
endif()
endif( Bazaar_EXECUTABLE )
if( NOT Bazaar_FOUND )
if( NOT Bazaar_FIND_QUIETLY )
message( STATUS "Bazaar version control command line client was not found." )
else()
else( NOT Bazaar_FIND_QUIETLY )
if( Bazaar_FIND_REQUIRED )
message( FATAL_ERROR "Bazaar version control command line client was not found." )
endif()
endif()
endif()
endif( Bazaar_FIND_REQUIRED )
endif( NOT Bazaar_FIND_QUIETLY )
endif( NOT Bazaar_FOUND )
-1
View File
@@ -33,7 +33,6 @@ IF (WIN32)
NAMES glew glew32 glew32s
PATHS
$ENV{GLEW_ROOT_PATH}/lib
$ENV{GLEW_ROOT_PATH}/lib/Release/Win32
${OPENGL_LIBRARY_DIR}
)
-342
View File
@@ -1,342 +0,0 @@
#.rst:
# FindOpenSSL
# -----------
#
# Try to find the OpenSSL encryption library
#
# Once done this will define
#
# ::
#
# OPENSSL_ROOT_DIR - Set this variable to the root installation of OpenSSL
#
#
#
# Read-Only variables:
#
# ::
#
# OPENSSL_FOUND - system has the OpenSSL library
# OPENSSL_INCLUDE_DIR - the OpenSSL include directory
# OPENSSL_LIBRARIES - The libraries needed to use OpenSSL
# OPENSSL_VERSION - This is set to $major.$minor.$revision$path (eg. 0.9.8s)
#=============================================================================
# Copyright 2006-2009 Kitware, Inc.
# Copyright 2006 Alexander Neundorf <neundorf@kde.org>
# Copyright 2009-2011 Mathieu Malaterre <mathieu.malaterre@gmail.com>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
if (UNIX)
find_package(PkgConfig QUIET)
pkg_check_modules(_OPENSSL QUIET openssl)
endif ()
if (WIN32)
# http://www.slproweb.com/products/Win32OpenSSL.html
set(_OPENSSL_ROOT_HINTS
${OPENSSL_ROOT_DIR}
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;Inno Setup: App Path]"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;Inno Setup: App Path]"
ENV OPENSSL_ROOT_DIR
)
file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _programfiles)
set(_OPENSSL_ROOT_PATHS
"${_programfiles}/OpenSSL"
"${_programfiles}/OpenSSL-Win32"
"${_programfiles}/OpenSSL-Win64"
"C:/OpenSSL/"
"C:/OpenSSL-Win32/"
"C:/OpenSSL-Win64/"
)
unset(_programfiles)
else ()
set(_OPENSSL_ROOT_HINTS
${OPENSSL_ROOT_DIR}
ENV OPENSSL_ROOT_DIR
)
endif ()
set(_OPENSSL_ROOT_HINTS_AND_PATHS
HINTS ${_OPENSSL_ROOT_HINTS}
PATHS ${_OPENSSL_ROOT_PATHS}
)
find_path(OPENSSL_INCLUDE_DIR
NAMES
openssl/ssl.h
${_OPENSSL_ROOT_HINTS_AND_PATHS}
HINTS
${_OPENSSL_INCLUDEDIR}
PATH_SUFFIXES
include
)
if(WIN32 AND NOT CYGWIN)
if(MSVC)
# /MD and /MDd are the standard values - if someone wants to use
# others, the libnames have to change here too
# use also ssl and ssleay32 in debug as fallback for openssl < 0.9.8b
# TODO: handle /MT and static lib
# In Visual C++ naming convention each of these four kinds of Windows libraries has it's standard suffix:
# * MD for dynamic-release
# * MDd for dynamic-debug
# * MT for static-release
# * MTd for static-debug
# Implementation details:
# We are using the libraries located in the VC subdir instead of the parent directory eventhough :
# libeay32MD.lib is identical to ../libeay32.lib, and
# ssleay32MD.lib is identical to ../ssleay32.lib
find_library(LIB_EAY_DEBUG
NAMES
libeay32MDd
libeay32d
${_OPENSSL_ROOT_HINTS_AND_PATHS}
PATH_SUFFIXES
"lib"
"VC"
"lib/VC"
)
find_library(LIB_EAY_RELEASE
NAMES
libeay32MD
libeay32
${_OPENSSL_ROOT_HINTS_AND_PATHS}
PATH_SUFFIXES
"lib"
"VC"
"lib/VC"
)
find_library(SSL_EAY_DEBUG
NAMES
ssleay32MDd
ssleay32d
${_OPENSSL_ROOT_HINTS_AND_PATHS}
PATH_SUFFIXES
"lib"
"VC"
"lib/VC"
)
find_library(SSL_EAY_RELEASE
NAMES
ssleay32MD
ssleay32
ssl
${_OPENSSL_ROOT_HINTS_AND_PATHS}
PATH_SUFFIXES
"lib"
"VC"
"lib/VC"
)
set(LIB_EAY_LIBRARY_DEBUG "${LIB_EAY_DEBUG}")
set(LIB_EAY_LIBRARY_RELEASE "${LIB_EAY_RELEASE}")
set(SSL_EAY_LIBRARY_DEBUG "${SSL_EAY_DEBUG}")
set(SSL_EAY_LIBRARY_RELEASE "${SSL_EAY_RELEASE}")
include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
select_library_configurations(LIB_EAY)
select_library_configurations(SSL_EAY)
mark_as_advanced(LIB_EAY_LIBRARY_DEBUG LIB_EAY_LIBRARY_RELEASE
SSL_EAY_LIBRARY_DEBUG SSL_EAY_LIBRARY_RELEASE)
set( OPENSSL_LIBRARIES ${SSL_EAY_LIBRARY} ${LIB_EAY_LIBRARY} )
elseif(MINGW)
message( STATUS "Searching for OpenSSL in MinGW." )
# same player, for MinGW
set(LIB_EAY_NAMES libeay32)
set(SSL_EAY_NAMES ssleay32)
list(APPEND LIB_EAY_NAMES crypto)
list(APPEND SSL_EAY_NAMES ssl)
find_library(LIB_EAY
NAMES
${LIB_EAY_NAMES}
${_OPENSSL_ROOT_HINTS_AND_PATHS}
PATH_SUFFIXES
"lib"
"lib/MinGW"
# Do not search system path. Otherwise the DLL will be found rather than the link library.
NO_SYSTEM_ENVIRONMENT_PATH
NO_CMAKE_SYSTEM_PATH
)
find_library(SSL_EAY
NAMES
${SSL_EAY_NAMES}
${_OPENSSL_ROOT_HINTS_AND_PATHS}
PATH_SUFFIXES
"lib"
"lib/MinGW"
# Do not search system path. Otherwise the DLL will be found rather than the link library.
NO_SYSTEM_ENVIRONMENT_PATH
NO_CMAKE_SYSTEM_PATH
)
mark_as_advanced(SSL_EAY LIB_EAY)
set( OPENSSL_LIBRARIES ${SSL_EAY} ${LIB_EAY} )
unset(LIB_EAY_NAMES)
unset(SSL_EAY_NAMES)
else()
# Not sure what to pick for -say- intel, let's use the toplevel ones and hope someone report issues:
find_library(LIB_EAY
NAMES
libeay32
${_OPENSSL_ROOT_HINTS_AND_PATHS}
HINTS
${_OPENSSL_LIBDIR}
PATH_SUFFIXES
lib
)
find_library(SSL_EAY
NAMES
ssleay32
${_OPENSSL_ROOT_HINTS_AND_PATHS}
HINTS
${_OPENSSL_LIBDIR}
PATH_SUFFIXES
lib
)
mark_as_advanced(SSL_EAY LIB_EAY)
set( OPENSSL_LIBRARIES ${SSL_EAY} ${LIB_EAY} )
endif()
else()
find_library(OPENSSL_SSL_LIBRARY
NAMES
ssl
ssleay32
ssleay32MD
${_OPENSSL_ROOT_HINTS_AND_PATHS}
HINTS
${_OPENSSL_LIBDIR}
PATH_SUFFIXES
lib
)
find_library(OPENSSL_CRYPTO_LIBRARY
NAMES
crypto
${_OPENSSL_ROOT_HINTS_AND_PATHS}
HINTS
${_OPENSSL_LIBDIR}
PATH_SUFFIXES
lib
)
mark_as_advanced(OPENSSL_CRYPTO_LIBRARY OPENSSL_SSL_LIBRARY)
# compat defines
set(OPENSSL_SSL_LIBRARIES ${OPENSSL_SSL_LIBRARY})
set(OPENSSL_CRYPTO_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY})
set(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY})
endif()
function(from_hex HEX DEC)
string(TOUPPER "${HEX}" HEX)
set(_res 0)
string(LENGTH "${HEX}" _strlen)
while (_strlen GREATER 0)
math(EXPR _res "${_res} * 16")
string(SUBSTRING "${HEX}" 0 1 NIBBLE)
string(SUBSTRING "${HEX}" 1 -1 HEX)
if (NIBBLE STREQUAL "A")
math(EXPR _res "${_res} + 10")
elseif (NIBBLE STREQUAL "B")
math(EXPR _res "${_res} + 11")
elseif (NIBBLE STREQUAL "C")
math(EXPR _res "${_res} + 12")
elseif (NIBBLE STREQUAL "D")
math(EXPR _res "${_res} + 13")
elseif (NIBBLE STREQUAL "E")
math(EXPR _res "${_res} + 14")
elseif (NIBBLE STREQUAL "F")
math(EXPR _res "${_res} + 15")
else()
math(EXPR _res "${_res} + ${NIBBLE}")
endif()
string(LENGTH "${HEX}" _strlen)
endwhile()
set(${DEC} ${_res} PARENT_SCOPE)
endfunction()
if (OPENSSL_INCLUDE_DIR)
if (_OPENSSL_VERSION)
set(OPENSSL_VERSION "${_OPENSSL_VERSION}")
elseif(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h")
file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" openssl_version_str
REGEX "^#[\t ]*define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])+.*")
# The version number is encoded as 0xMNNFFPPS: major minor fix patch status
# The status gives if this is a developer or prerelease and is ignored here.
# Major, minor, and fix directly translate into the version numbers shown in
# the string. The patch field translates to the single character suffix that
# indicates the bug fix state, which 00 -> nothing, 01 -> a, 02 -> b and so
# on.
message(STATUS "OPENSSL_VERSION_STR=${openssl_version_str}")
string(REGEX REPLACE "^.*OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F]).*$"
"\\1;\\2;\\3;\\4;\\5" OPENSSL_VERSION_LIST "${openssl_version_str}")
list(GET OPENSSL_VERSION_LIST 0 OPENSSL_VERSION_MAJOR)
list(GET OPENSSL_VERSION_LIST 1 OPENSSL_VERSION_MINOR)
from_hex("${OPENSSL_VERSION_MINOR}" OPENSSL_VERSION_MINOR)
list(GET OPENSSL_VERSION_LIST 2 OPENSSL_VERSION_FIX)
from_hex("${OPENSSL_VERSION_FIX}" OPENSSL_VERSION_FIX)
list(GET OPENSSL_VERSION_LIST 3 OPENSSL_VERSION_PATCH)
if (NOT OPENSSL_VERSION_PATCH STREQUAL "00")
from_hex("${OPENSSL_VERSION_PATCH}" _tmp)
# 96 is the ASCII code of 'a' minus 1
math(EXPR OPENSSL_VERSION_PATCH_ASCII "${_tmp} + 96")
unset(_tmp)
# Once anyone knows how OpenSSL would call the patch versions beyond 'z'
# this should be updated to handle that, too. This has not happened yet
# so it is simply ignored here for now.
string(ASCII "${OPENSSL_VERSION_PATCH_ASCII}" OPENSSL_VERSION_PATCH_STRING)
endif ()
set(OPENSSL_VERSION "${OPENSSL_VERSION_MAJOR}.${OPENSSL_VERSION_MINOR}.${OPENSSL_VERSION_FIX}${OPENSSL_VERSION_PATCH_STRING}")
endif ()
endif ()
include(FindPackageHandleStandardArgs)
if (OPENSSL_VERSION)
find_package_handle_standard_args(OpenSSL
REQUIRED_VARS
OPENSSL_LIBRARIES
OPENSSL_INCLUDE_DIR
VERSION_VAR
OPENSSL_VERSION
FAIL_MESSAGE
"Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR"
)
else ()
find_package_handle_standard_args(OpenSSL "Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR"
OPENSSL_LIBRARIES
OPENSSL_INCLUDE_DIR
)
endif ()
mark_as_advanced(OPENSSL_INCLUDE_DIR OPENSSL_LIBRARIES)
@@ -0,0 +1,260 @@
# FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name> ... )
#
# This function is intended to be used in FindXXX.cmake modules files.
# It handles the REQUIRED, QUIET and version-related arguments to FIND_PACKAGE().
# It also sets the <UPPERCASED_NAME>_FOUND variable.
# The package is considered found if all variables <var1>... listed contain
# valid results, e.g. valid filepaths.
#
# There are two modes of this function. The first argument in both modes is
# the name of the Find-module where it is called (in original casing).
#
# The first simple mode looks like this:
# FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name> (DEFAULT_MSG|"Custom failure message") <var1>...<varN> )
# If the variables <var1> to <varN> are all valid, then <UPPERCASED_NAME>_FOUND
# will be set to TRUE.
# If DEFAULT_MSG is given as second argument, then the function will generate
# itself useful success and error messages. You can also supply a custom error message
# for the failure case. This is not recommended.
#
# The second mode is more powerful and also supports version checking:
# FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME [REQUIRED_VARS <var1>...<varN>]
# [VERSION_VAR <versionvar>
# [CONFIG_MODE]
# [FAIL_MESSAGE "Custom failure message"] )
#
# As above, if <var1> through <varN> are all valid, <UPPERCASED_NAME>_FOUND
# will be set to TRUE.
# After REQUIRED_VARS the variables which are required for this package are listed.
# Following VERSION_VAR the name of the variable can be specified which holds
# the version of the package which has been found. If this is done, this version
# will be checked against the (potentially) specified required version used
# in the find_package() call. The EXACT keyword is also handled. The default
# messages include information about the required version and the version
# which has been actually found, both if the version is ok or not.
# Use the option CONFIG_MODE if your FindXXX.cmake module is a wrapper for
# a find_package(... NO_MODULE) call, in this case all the information
# provided by the config-mode of find_package() will be evaluated
# automatically.
# Via FAIL_MESSAGE a custom failure message can be specified, if this is not
# used, the default message will be displayed.
#
# Example for mode 1:
#
# FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 DEFAULT_MSG LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
#
# LibXml2 is considered to be found, if both LIBXML2_LIBRARY and
# LIBXML2_INCLUDE_DIR are valid. Then also LIBXML2_FOUND is set to TRUE.
# If it is not found and REQUIRED was used, it fails with FATAL_ERROR,
# independent whether QUIET was used or not.
# If it is found, success will be reported, including the content of <var1>.
# On repeated Cmake runs, the same message won't be printed again.
#
# Example for mode 2:
#
# FIND_PACKAGE_HANDLE_STANDARD_ARGS(BISON REQUIRED_VARS BISON_EXECUTABLE
# VERSION_VAR BISON_VERSION)
# In this case, BISON is considered to be found if the variable(s) listed
# after REQUIRED_VAR are all valid, i.e. BISON_EXECUTABLE in this case.
# Also the version of BISON will be checked by using the version contained
# in BISON_VERSION.
# Since no FAIL_MESSAGE is given, the default messages will be printed.
#
# Another example for mode 2:
#
# FIND_PACKAGE(Automoc4 QUIET NO_MODULE HINTS /opt/automoc4)
# FIND_PACKAGE_HANDLE_STANDARD_ARGS(Automoc4 CONFIG_MODE)
# In this case, FindAutmoc4.cmake wraps a call to FIND_PACKAGE(Automoc4 NO_MODULE)
# and adds an additional search directory for automoc4.
# The following FIND_PACKAGE_HANDLE_STANDARD_ARGS() call produces a proper
# success/error message.
#=============================================================================
# Copyright 2007-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
INCLUDE(FindPackageMessage)
INCLUDE(CMakeParseArguments)
# internal helper macro
MACRO(_FPHSA_FAILURE_MESSAGE _msg)
IF (${_NAME}_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "${_msg}")
ELSE (${_NAME}_FIND_REQUIRED)
IF (NOT ${_NAME}_FIND_QUIETLY)
MESSAGE(STATUS "${_msg}")
ENDIF (NOT ${_NAME}_FIND_QUIETLY)
ENDIF (${_NAME}_FIND_REQUIRED)
ENDMACRO(_FPHSA_FAILURE_MESSAGE _msg)
# internal helper macro to generate the failure message when used in CONFIG_MODE:
MACRO(_FPHSA_HANDLE_FAILURE_CONFIG_MODE)
# <name>_CONFIG is set, but FOUND is false, this means that some other of the REQUIRED_VARS was not found:
IF(${_NAME}_CONFIG)
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: missing: ${MISSING_VARS} (found ${${_NAME}_CONFIG} ${VERSION_MSG})")
ELSE(${_NAME}_CONFIG)
# If _CONSIDERED_CONFIGS is set, the config-file has been found, but no suitable version.
# List them all in the error message:
IF(${_NAME}_CONSIDERED_CONFIGS)
SET(configsText "")
LIST(LENGTH ${_NAME}_CONSIDERED_CONFIGS configsCount)
MATH(EXPR configsCount "${configsCount} - 1")
FOREACH(currentConfigIndex RANGE ${configsCount})
LIST(GET ${_NAME}_CONSIDERED_CONFIGS ${currentConfigIndex} filename)
LIST(GET ${_NAME}_CONSIDERED_VERSIONS ${currentConfigIndex} version)
SET(configsText "${configsText} ${filename} (version ${version})\n")
ENDFOREACH(currentConfigIndex)
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} ${VERSION_MSG}, checked the following files:\n${configsText}")
ELSE(${_NAME}_CONSIDERED_CONFIGS)
# Simple case: No Config-file was found at all:
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: found neither ${_NAME}Config.cmake nor ${_NAME_LOWER}-config.cmake ${VERSION_MSG}")
ENDIF(${_NAME}_CONSIDERED_CONFIGS)
ENDIF(${_NAME}_CONFIG)
ENDMACRO(_FPHSA_HANDLE_FAILURE_CONFIG_MODE)
FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
# set up the arguments for CMAKE_PARSE_ARGUMENTS and check whether we are in
# new extended or in the "old" mode:
SET(options CONFIG_MODE)
SET(oneValueArgs FAIL_MESSAGE VERSION_VAR)
SET(multiValueArgs REQUIRED_VARS)
SET(_KEYWORDS_FOR_EXTENDED_MODE ${options} ${oneValueArgs} ${multiValueArgs} )
LIST(FIND _KEYWORDS_FOR_EXTENDED_MODE "${_FIRST_ARG}" INDEX)
IF(${INDEX} EQUAL -1)
SET(FPHSA_FAIL_MESSAGE ${_FIRST_ARG})
SET(FPHSA_REQUIRED_VARS ${ARGN})
SET(FPHSA_VERSION_VAR)
ELSE(${INDEX} EQUAL -1)
CMAKE_PARSE_ARGUMENTS(FPHSA "${options}" "${oneValueArgs}" "${multiValueArgs}" ${_FIRST_ARG} ${ARGN})
IF(FPHSA_UNPARSED_ARGUMENTS)
MESSAGE(FATAL_ERROR "Unknown keywords given to FIND_PACKAGE_HANDLE_STANDARD_ARGS(): \"${FPHSA_UNPARSED_ARGUMENTS}\"")
ENDIF(FPHSA_UNPARSED_ARGUMENTS)
IF(NOT FPHSA_FAIL_MESSAGE)
SET(FPHSA_FAIL_MESSAGE "DEFAULT_MSG")
ENDIF(NOT FPHSA_FAIL_MESSAGE)
ENDIF(${INDEX} EQUAL -1)
# now that we collected all arguments, process them
IF("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG")
SET(FPHSA_FAIL_MESSAGE "Could NOT find ${_NAME}")
ENDIF("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG")
# In config-mode, we rely on the variable <package>_CONFIG, which is set by find_package()
# when it successfully found the config-file, including version checking:
IF(FPHSA_CONFIG_MODE)
LIST(INSERT FPHSA_REQUIRED_VARS 0 ${_NAME}_CONFIG)
LIST(REMOVE_DUPLICATES FPHSA_REQUIRED_VARS)
SET(FPHSA_VERSION_VAR ${_NAME}_VERSION)
ENDIF(FPHSA_CONFIG_MODE)
IF(NOT FPHSA_REQUIRED_VARS)
MESSAGE(FATAL_ERROR "No REQUIRED_VARS specified for FIND_PACKAGE_HANDLE_STANDARD_ARGS()")
ENDIF(NOT FPHSA_REQUIRED_VARS)
LIST(GET FPHSA_REQUIRED_VARS 0 _FIRST_REQUIRED_VAR)
STRING(TOUPPER ${_NAME} _NAME_UPPER)
STRING(TOLOWER ${_NAME} _NAME_LOWER)
# collect all variables which were not found, so they can be printed, so the
# user knows better what went wrong (#6375)
SET(MISSING_VARS "")
SET(DETAILS "")
SET(${_NAME_UPPER}_FOUND TRUE)
# check if all passed variables are valid
FOREACH(_CURRENT_VAR ${FPHSA_REQUIRED_VARS})
IF(NOT ${_CURRENT_VAR})
SET(${_NAME_UPPER}_FOUND FALSE)
SET(MISSING_VARS "${MISSING_VARS} ${_CURRENT_VAR}")
ELSE(NOT ${_CURRENT_VAR})
SET(DETAILS "${DETAILS}[${${_CURRENT_VAR}}]")
ENDIF(NOT ${_CURRENT_VAR})
ENDFOREACH(_CURRENT_VAR)
# version handling:
SET(VERSION_MSG "")
SET(VERSION_OK TRUE)
SET(VERSION ${${FPHSA_VERSION_VAR}} )
IF (${_NAME}_FIND_VERSION)
IF(VERSION)
IF(${_NAME}_FIND_VERSION_EXACT) # exact version required
IF (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
SET(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"")
SET(VERSION_OK FALSE)
ELSE (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
SET(VERSION_MSG "(found suitable exact version \"${VERSION}\")")
ENDIF (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
ELSE(${_NAME}_FIND_VERSION_EXACT) # minimum version specified:
IF ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
SET(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is at least \"${${_NAME}_FIND_VERSION}\"")
SET(VERSION_OK FALSE)
ELSE ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
SET(VERSION_MSG "(found suitable version \"${VERSION}\", required is \"${${_NAME}_FIND_VERSION}\")")
ENDIF ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
ENDIF(${_NAME}_FIND_VERSION_EXACT)
ELSE(VERSION)
# if the package was not found, but a version was given, add that to the output:
IF(${_NAME}_FIND_VERSION_EXACT)
SET(VERSION_MSG "(Required is exact version \"${${_NAME}_FIND_VERSION}\")")
ELSE(${_NAME}_FIND_VERSION_EXACT)
SET(VERSION_MSG "(Required is at least version \"${${_NAME}_FIND_VERSION}\")")
ENDIF(${_NAME}_FIND_VERSION_EXACT)
ENDIF(VERSION)
ELSE (${_NAME}_FIND_VERSION)
IF(VERSION)
SET(VERSION_MSG "(found version \"${VERSION}\")")
ENDIF(VERSION)
ENDIF (${_NAME}_FIND_VERSION)
IF(VERSION_OK)
SET(DETAILS "${DETAILS}[v${VERSION}(${${_NAME}_FIND_VERSION})]")
ELSE(VERSION_OK)
SET(${_NAME_UPPER}_FOUND FALSE)
ENDIF(VERSION_OK)
# print the result:
IF (${_NAME_UPPER}_FOUND)
FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG}" "${DETAILS}")
ELSE (${_NAME_UPPER}_FOUND)
IF(FPHSA_CONFIG_MODE)
_FPHSA_HANDLE_FAILURE_CONFIG_MODE()
ELSE(FPHSA_CONFIG_MODE)
IF(NOT VERSION_OK)
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: ${VERSION_MSG} (found ${${_FIRST_REQUIRED_VAR}})")
ELSE(NOT VERSION_OK)
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} (missing: ${MISSING_VARS}) ${VERSION_MSG}")
ENDIF(NOT VERSION_OK)
ENDIF(FPHSA_CONFIG_MODE)
ENDIF (${_NAME_UPPER}_FOUND)
SET(${_NAME_UPPER}_FOUND ${${_NAME_UPPER}_FOUND} PARENT_SCOPE)
ENDFUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _FIRST_ARG)
-57
View File
@@ -1,57 +0,0 @@
#.rst:
# FindPackageMessage
# ------------------
#
#
#
# FIND_PACKAGE_MESSAGE(<name> "message for user" "find result details")
#
# This macro is intended to be used in FindXXX.cmake modules files. It
# will print a message once for each unique find result. This is useful
# for telling the user where a package was found. The first argument
# specifies the name (XXX) of the package. The second argument
# specifies the message to display. The third argument lists details
# about the find result so that if they change the message will be
# displayed again. The macro also obeys the QUIET argument to the
# find_package command.
#
# Example:
#
# ::
#
# if(X11_FOUND)
# FIND_PACKAGE_MESSAGE(X11 "Found X11: ${X11_X11_LIB}"
# "[${X11_X11_LIB}][${X11_INCLUDE_DIR}]")
# else()
# ...
# endif()
#=============================================================================
# Copyright 2008-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
function(FIND_PACKAGE_MESSAGE pkg msg details)
# Avoid printing a message repeatedly for the same find result.
if(NOT ${pkg}_FIND_QUIETLY)
string(REGEX REPLACE "[\n]" "" details "${details}")
set(DETAILS_VAR FIND_PACKAGE_MESSAGE_DETAILS_${pkg})
if(NOT "${details}" STREQUAL "${${DETAILS_VAR}}")
# The message has not yet been printed.
message(STATUS "${msg}")
# Save the find details in the cache to avoid printing the same
# message again.
set("${DETAILS_VAR}" "${details}"
CACHE INTERNAL "Details about finding ${pkg}")
endif()
endif()
endfunction()
+4 -4
View File
@@ -91,7 +91,7 @@ unset(_PYTHON3_VERSIONS)
# Search for newest python version if python executable isn't found
if(NOT PYTHON_EXECUTABLE)
# If using the MINGW compiler, we mustn't find the standard python
# distribution because of multiple C-Runtime errors. We must instead
# use the Python-a-mingw-us distribution
@@ -110,7 +110,7 @@ if(NOT PYTHON_EXECUTABLE)
else()
list( APPEND _Python_PPATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath] )
endif()
foreach(_CURRENT_VERSION ${_Python_VERSIONS})
set(_Python_NAMES python${_CURRENT_VERSION})
if(WIN32)
@@ -169,7 +169,7 @@ endif()
# handle the QUIETLY and REQUIRED arguments and set PYTHONINTERP_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PythonInterp REQUIRED_VARS PYTHON_EXECUTABLE VERSION_VAR PYTHON_VERSION_STRING)
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonInterp REQUIRED_VARS PYTHON_EXECUTABLE VERSION_VAR PYTHON_VERSION_STRING)
mark_as_advanced(PYTHON_EXECUTABLE)
+47 -31
View File
@@ -37,10 +37,9 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
include(CMakeFindFrameworks)
include(${CMAKE_CURRENT_LIST_DIR}/CMakeFindFrameworks.cmake)
# Search for the python framework on Apple.
cmake_find_frameworks(Python)
CMAKE_FIND_FRAMEWORKS(Python)
set(_PYTHON1_VERSIONS 1.6 1.5)
set(_PYTHON2_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0)
@@ -87,25 +86,32 @@ unset(_PYTHON3_VERSIONS)
foreach(_CURRENT_VERSION ${_Python_VERSIONS})
string(REPLACE "." "" _CURRENT_VERSION_NO_DOTS ${_CURRENT_VERSION})
if(WIN32)
if(MINGW)
find_library(PYTHON_DEBUG_LIBRARY
NAMES python{$_CURRENT_VERSION}_d
PATHS
"${PYTHON_ROOT_DIR}"
"c:/python${_CURRENT_VERSION}"
"c:/python${_CURRENT_VERSION_NO_DOTS}"
"C:/python/${_CURRENT_VERSION}.9"
"C:/python/${_CURRENT_VERSION}.8"
"C:/python/${_CURRENT_VERSION}.7"
"C:/python/${_CURRENT_VERSION}.6"
"C:/python/${_CURRENT_VERSION}.5"
"C:/python/${_CURRENT_VERSION}.4"
"C:/python/${_CURRENT_VERSION}.3"
"C:/python/${_CURRENT_VERSION}.2"
"C:/python/${_CURRENT_VERSION}.1"
"C:/python/${_CURRENT_VERSION}.0"
NO_SYSTEM_ENVIRONMENT_PATH
)
)
else()
find_library(PYTHON_DEBUG_LIBRARY
NAMES python${_CURRENT_VERSION_NO_DOTS}_d python
PATHS
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs/Debug
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs/Debug
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs/Debug
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs/Debug
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
)
endif()
endif()
@@ -115,20 +121,26 @@ foreach(_CURRENT_VERSION ${_Python_VERSIONS})
NAMES python${_CURRENT_VERSION}
PATHS
"${PYTHON_ROOT_DIR}"
"C:/python"
PATH_SUFFIXES
${_CURRENT_VERSION}
${_CURRENT_VERSION_NO_DOTS}
"C:/python/${_CURRENT_VERSION}.9"
"C:/python/${_CURRENT_VERSION}.8"
"C:/python/${_CURRENT_VERSION}.7"
"C:/python/${_CURRENT_VERSION}.6"
"C:/python/${_CURRENT_VERSION}.5"
"C:/python/${_CURRENT_VERSION}.4"
"C:/python/${_CURRENT_VERSION}.3"
"C:/python/${_CURRENT_VERSION}.2"
"C:/python/${_CURRENT_VERSION}.1"
"C:/python/${_CURRENT_VERSION}.0"
NO_SYSTEM_ENVIRONMENT_PATH
)
else()
find_library(PYTHON_LIBRARY
NAMES
python${_CURRENT_VERSION_NO_DOTS}
python${_CURRENT_VERSION}mu
python${_CURRENT_VERSION}m
python${_CURRENT_VERSION}u
python${_CURRENT_VERSION}
python${_CURRENT_VERSION_NO_DOTS}
python${_CURRENT_VERSION}mu
python${_CURRENT_VERSION}m
python${_CURRENT_VERSION}u
python${_CURRENT_VERSION}
PATHS
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
@@ -146,6 +158,7 @@ foreach(_CURRENT_VERSION ${_Python_VERSIONS})
PATH_SUFFIXES python${_CURRENT_VERSION}/config
)
# For backward compatibility, honour value of PYTHON_INCLUDE_PATH, if
# PYTHON_INCLUDE_DIR is not set.
if(DEFINED PYTHON_INCLUDE_PATH AND NOT DEFINED PYTHON_INCLUDE_DIR)
@@ -154,7 +167,6 @@ foreach(_CURRENT_VERSION ${_Python_VERSIONS})
endif()
set(PYTHON_FRAMEWORK_INCLUDES)
if(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_DIR)
foreach(dir ${Python_FRAMEWORKS})
set(PYTHON_FRAMEWORK_INCLUDES ${PYTHON_FRAMEWORK_INCLUDES}
@@ -166,13 +178,17 @@ foreach(_CURRENT_VERSION ${_Python_VERSIONS})
find_path(PYTHON_INCLUDE_DIR
NAMES Python.h
PATHS
"${PYTHON_ROOT_DIR}"
"C:/python${_CURRENT_VERSION}"
"C:/python${_CURRENT_VERSION_NOT_DOTS}"
PATH_SUFFIXES
include
python${_CURRENT_VERSION}
python${_CURRENT_VERSION_NOT_DOTS}
"${PYTHON_ROOT_DIR}/include"
"C:/python/${_CURRENT_VERSION}.9/include"
"C:/python/${_CURRENT_VERSION}.8/include"
"C:/python/${_CURRENT_VERSION}.7/include"
"C:/python/${_CURRENT_VERSION}.6/include"
"C:/python/${_CURRENT_VERSION}.5/include"
"C:/python/${_CURRENT_VERSION}.4/include"
"C:/python/${_CURRENT_VERSION}.3/include"
"C:/python/${_CURRENT_VERSION}.2/include"
"C:/python/${_CURRENT_VERSION}.1/include"
"C:/python/${_CURRENT_VERSION}.0/include"
)
else()
find_path(PYTHON_INCLUDE_DIR
@@ -223,14 +239,14 @@ set(PYTHON_DEBUG_LIBRARIES "${PYTHON_DEBUG_LIBRARY}")
set(PYTHON_LIBRARY_DEBUG "${PYTHON_DEBUG_LIBRARY}")
set(PYTHON_LIBRARY_RELEASE "${PYTHON_LIBRARY}")
include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
select_library_configurations(PYTHON)
SELECT_LIBRARY_CONFIGURATIONS(PYTHON)
# SELECT_LIBRARY_CONFIGURATIONS() sets ${PREFIX}_FOUND if it has a library.
# Unset this, this prefix doesn't match the module prefix, they are different
# for historical reasons.
unset(PYTHON_FOUND)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PythonLibs
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonLibs
REQUIRED_VARS PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS
VERSION_VAR PYTHONLIBS_VERSION_STRING)
File diff suppressed because it is too large Load Diff
+5 -3
View File
@@ -83,9 +83,6 @@ macro( perform_feature_checks )
check_symbol_exists( strncasecmp "strings.h" HAVE_STRNCASECMP )
check_symbol_exists( strtok_r "string.h" HAVE_STRTOKR )
check_cxx_symbol_exists( strcasecmp "string.h" HAVE_STRCASECMP )
check_cxx_symbol_exists( strncasecmp "string.h" HAVE_STRNCASECMP )
# Some platforms define malloc and free in malloc.h instead of stdlib.h.
check_symbol_exists( malloc "stdlib.h" MALLOC_IN_STDLIB_H )
@@ -112,4 +109,9 @@ macro( perform_feature_checks )
# getc() on platforms where getc_unlocked() doesn't exist.
check_symbol_exists( getc_unlocked "stdio.h" HAVE_FGETC_NOLOCK )
# Generate config.h.
configure_file( ${PROJECT_SOURCE_DIR}/CMakeModules/config.h.cmake
${CMAKE_BINARY_DIR}/config.h
)
endmacro( perform_feature_checks )
+7 -3
View File
@@ -374,10 +374,14 @@ const char* ${LEXERCLASS}::TokenName( T aTok )
{
const char* ret;
if( aTok < 0 )
ret = DSNLEXER::Syntax( aTok );
else if( (unsigned) aTok < keyword_count )
if( (unsigned) aTok < keyword_count )
{
ret = keywords[aTok].name;
}
else if( aTok < 0 )
{
ret = DSNLEXER::Syntax( aTok );
}
else
ret = \"token too big\";
-87
View File
@@ -1,87 +0,0 @@
#
# This program source code file is part of KICAD, a free EDA CAD application.
#
# Copyright (C) 2015 Wayne Stambaugh <stambaughw@verizon.net>
# Copyright (C) 2015 KiCad Developers, see AUTHORS.txt for contributors.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, you may find one here:
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# or you may search the http://www.gnu.org website for the version 2 license,
# or you may write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#
# Automagically create version header file if the version string was not defined during
# the build configuration. If CreateBzrVersionHeader or CreateGitVersionHeader cannot
# determine the current repo version, a version.h file is still created with
# KICAD_BUILD_VERSION set to "no-vcs-found".
if( NOT KICAD_BUILD_VERSION )
set( _wvh_version_str "no-vcs-found" )
# Detect the appropiate VCS and set the version string.
if( EXISTS "${SRC_PATH}/.bzr" )
message( STATUS "Using Bazaar to determine build version string." )
include( ${CMAKE_MODULE_PATH}/CreateBzrVersionHeader.cmake )
create_bzr_version_header( ${SRC_PATH} )
set( _wvh_version_str ${KICAD_BUILD_VERSION} )
elseif( EXISTS "${SRC_PATH}/.git" )
message( STATUS "Using Git to determine build version string." )
include( ${CMAKE_MODULE_PATH}/CreateGitVersionHeader.cmake )
create_git_version_header( ${SRC_PATH} )
set( _wvh_version_str ${KICAD_BUILD_VERSION} )
endif()
else()
set( _wvh_version_str ${KICAD_BUILD_VERSION} )
endif()
set( _wvh_write_version_file ON )
# Compare the version argument against the version in the existing header file for a mismatch.
if( EXISTS ${OUTPUT_FILE} )
file( STRINGS ${CMAKE_BINARY_DIR}/version.h _current_version_str
REGEX "^#define[\t ]+KICAD_BUILD_VERSION[\t ]+.*" )
string( REGEX REPLACE "^#define KICAD_BUILD_VERSION \"([()a-zA-Z0-9 -.]+)\".*"
"\\1" _wvh_last_version "${_current_version_str}" )
# No change, do not write version.h
if( _wvh_version_str STREQUAL _wvh_last_version )
message( STATUS "Not updating ${OUTPUT_FILE}" )
set( _wvh_write_version_file OFF )
endif()
endif()
if( _wvh_write_version_file )
message( STATUS "Writing ${OUTPUT_FILE} file with version: ${_wvh_version_str}" )
file( WRITE ${OUTPUT_FILE}
"/* Do not modify this file, it was automatically generated by CMake. */
/*
* Define the KiCad build version string.
*/
#ifndef __KICAD_VERSION_H__
#define __KICAD_VERSION_H__
#define KICAD_BUILD_VERSION \"${_wvh_version_str}\"
#endif /* __KICAD_VERSION_H__ */
"
)
endif()
# There should always be a valid version.h file. Otherwise, the build will fail.
if( NOT EXISTS ${CMAKE_BINARY_DIR}/version.h )
message( FATAL_ERROR "Configuration failed to write file ${OUTPUT_FILE}." )
endif()
+4 -6
View File
@@ -58,13 +58,11 @@
/// The legacy file format revision of the *.brd file created by this build
#define LEGACY_BOARD_FILE_VERSION 2
/// The install prefix defined during CMake configuration or fall back to CMAKE_INSTALL_PREFIX.
#define DEFAULT_INSTALL_PATH "@DEFAULT_INSTALL_PATH@"
/// The install prefix defined in CMAKE_INSTALL_PREFIX.
#define DEFAULT_INSTALL_PATH "@CMAKE_INSTALL_PREFIX@"
/// The wxPython version found during configuration.
#if defined( KICAD_SCRIPTING_WXPYTHON )
#define WXPYTHON_VERSION "@WXPYTHON_VERSION@"
#endif
/// Default footprint library install path when installed with `make install`.
#define DEFAULT_FP_LIB_PATH "@KICAD_FP_LIB_INSTALL_PATH@"
/// When defined, build the GITHUB_PLUGIN for pcbnew.
#cmakedefine BUILD_GITHUB_PLUGIN
+5 -8
View File
@@ -140,8 +140,11 @@ endif()
if( APPLE )
set( BOOST_CXXFLAGS "cxxflags=-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET} -fno-common" )
set( BOOST_LINKFLAGS "linkflags=-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET} -fno-common" )
# I set this to being compatible with wxWidgets
# wxWidgets still using libstdc++ (gcc), meanwhile OSX
# has switched to libc++ (llvm) by default
set( BOOST_CXXFLAGS "cxxflags=-mmacosx-version-min=10.5 -fno-common" )
set( BOOST_LINKFLAGS "linkflags=-mmacosx-version-min=10.5 -fno-common" )
set( BOOST_TOOLSET "toolset=darwin" )
if( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
@@ -216,8 +219,6 @@ ExternalProject_Add( boost
COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_macosx_older_openssl.patch" #https://svn.boost.org/trac/boost/ticket/9273
COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_mingw.patch" #https://svn.boost.org/trac/boost/ticket/7262
COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_mingw64_interlocked.patch"
# tell bzr about "added" files by last patch:
COMMAND bzr add libs/context/src/asm/make_i386_ms_pe_gas.S
COMMAND bzr add libs/context/src/asm/jump_i386_ms_pe_gas.S
@@ -311,10 +312,6 @@ ExternalProject_Add_Step( boost bzr_add_boost
ExternalProject_Add_Step( boost bzr_init_boost
COMMAND bzr init -q <SOURCE_DIR>
#creates a .bzrignore file in boost root dir, to avoid copying useless files
#moreover these files have a very very long name, and sometimes
#have a too long full file name to be handled by DOS commands
COMMAND echo "*.htm*" > ${PREFIX}/src/boost/.bzrignore
COMMENT "creating 'boost scratch repo' specifically for boost to track boost patches"
DEPENDERS bzr_add_boost
DEPENDEES download
+13
View File
@@ -0,0 +1,13 @@
/* Do not modify this file, it was automatically generated by CMake. */
/*
* Define the current source code Subversion commit number. The version
* string defined below does not update automatically when building the
* source with make. Run make rebuild_cache to update version strings.
*/
#ifndef __KICAD_SVN_VERSION_H__
#define __KICAD_SVN_VERSION_H__
#cmakedefine KICAD_BUILD_VERSION "@KICAD_BUILD_VERSION@"
#endif /* __KICAD_SVN_VERSION_H__ */
+354
View File
@@ -0,0 +1,354 @@
Note that the GPL below is copyrighted by the Free Software
Foundation, but the instance of code that it refers to (KiCad)
is copyrighted by the KiCad developers, those who actually wrote it.
The various CHANGELOG*.txt files and more importantly the Bazaar
repository contain a record of who wrote what.
Also note that the only valid version of the GPL as far as KiCad
is concerned is _this_ particular version of the license (ie v2, not
v2.2 or v3.x or whatever), unless explicitly otherwise stated.
Dick Hollenbeck
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
+216
View File
@@ -0,0 +1,216 @@
Compiling KiCad from Source
===========================
KiCad Documentation Team
Last revised on 12-mars-2012 by jp Charras
Introduction
------------
This is a generic guide how to compile kicad from scratch. On windows and linux.
If you need something more distribution specific or the experimental mac-osx port
read the other documents in the Documentation/compiling folder.
Installation of Tools
---------------------
On windows:
Get msys and mingw here:
http://mingw.org/
msys sets up a development environment that allows the bash shell to run.
mingw are a set of tools that run on windows or under msys. You will need
at least the following mingw packages: make, gcc, g++, binutils, autoconf, and
automake.
On linux:
Install "mesa". Use your package manager to install the
development libaries.
After a fresh install you need the following packages to compile and run
KiCad from source.
* bzr - Bazaar version control system
* CMake - Cross-platform make
* GLUT - The OpenGL Utility Library
* GLEW
* wxGTK or wxWidgets - The wxWidgets GUI toolkit with GTK+ bindings
* libbz2 (dev)
* libcairo (dev)
* Boost - Collection of portable C++ source libraries
boost will be automagically downloaded, copied in kicad sources tree and patched,
the first time you compile kicad.
Useful, but not required:
* Doxygen - Documentation system for several programming languages
Required to build Kicad with scripting (using python) support:
Python
Swig
KiCad uses the Bazaar version control system to track source code changes,
and download the boost libraries needed by Kicad.
Be sure you bzr install also includes bzrtools.
boost libraries will be downloaded the first time you build Kicad.
Compiler and basic development tools
-------------
Make sure g++, make and other tools are in your path.
If windows, then try running g++ and make from within your msys bash shell.
PLEASE NOTE: g++ 4.7.1 at least (possibly the 4.7.x series) is known to
miscompile pcbnew (it get zones wrong) with -O2; using -O1 is a suitable
workaround until they fix the compiler.
Install or Build wxWidgets
--------------------------
WARNING:
see wxWidgets_patch_notes.txt for patches and issues in wxWidgets.
On Windows, download
http://sourceforge.net/projects/wxwindows/files/3.0.0/wxWidgets-3.0.0.zip/download
or a newer version.
Do NOT use previous versions which all have annoying issues for KiCad.
Start msys so you have a bash shell.
Note also since 2.9 versions no need to build a "debug" version of the wxWidgets library,
the release and the debug version are same.
Unzip the wxWidgets zip file into the build directory. Change directories into
there, and then:
mkdir Release
cd Release
../configure --with-opengl
make
and under Linux, but not under Windows:
sudo make install that install wxWidgets libs and headers in /usr/local/
On linux, yo can also download wxWidgets 3.0 (recommandedd)
or you can use your package manager to install the
development versions of the wxWidgets packages which include the C++ headers.
The recommended way is to build wxWidgets from source, and use wxWidgets 3.0
or more recent (Older versions have a print function which does not work).
Verify that wx-config is in your path by running it from a command prompt.
Linux users then go to next step.
Install CMake
-------------
On windows, download the installation binary for windows from cmake.org.
Install that and choose to add cmake to your path during installation. You
will have to restart your command shell for the new path to take effect.
Verify that cmake is in your path by trying to run it from a command prompt.
On linux, use your package manager to install cmake. You should get cmake 2.8.4
or later. If only an older one is available in your package repository, build
cmake from source. Verify that cmake is in your path by trying to run it from a
command prompt.
Obtain Sources
--------------
You can use the Launchpad repository or a tar file for this. See the wiki.
To download files from Launchpad repository, you should install bazaar (bzr) that is a
version control system like subversion, mercurial, git...
Launchpad repository handle 2 branches for KiCda sources:
- a product branch (used by developers, which is most of time usable in production)
- a stable branch (a copy of the testing branch,
when the product branch is a stable state))
Remarks:
- The product branch is actively maintained
- From the product branch, you can go back to any previous version, using bzr features
- The stable branch is poorly or not maintained (and could be removed)
In order to have a working Kicad installtion, you need
- sources to build binaries
- libraries (they are not included in sources)
- documentation and translations (they are not included in sources)
product branch:
bzr branch lp:kicad kicad_src
Stable branch:
bzr branch lp:kicad/stable kicad_src
Components and Footprints libraries
all (schematic libs, 3D shapes ...) but new footprints libraries (use Download zip tool)
https://github.com/KiCad/kicad-library/
New footprints libraries (use Download zip tool for each lib you want)
https://github.com/KiCad/ for footprint libs (*.pretty folders)
A mirror of github is available, using bzr:
(schematic libs, 3D shapes ... all but new footprints libraries)
bzr checkout lp:~kicad-product-committers/kicad/library
Old legacy libraries:
bzr checkout lp:~dickelbeck/kicad/library-read-only
Note also Kicad is able to read on github.com/KiCad/ the *.pretty folders
without download, using github plugin.
(however the time to read them can be long)
Documentation and translations:
bzr branch lp:~kicad-developers/kicad/doc kicad_doc
Create Makefiles with CMake
---------------------------
On windows, go into your msys shell.
Linux and windows users both then make two "out of source" build directories:
cd <kicadSource>
mkdir -p build/release
mkdir build/debug (if you want a debug version of KiCad)
cd build/release
On either cmake command line shown below, you can optionally include
-DCMAKE_INSTALL_PREFIX=<finallInstallDir>
On windows, run the following command:
cmake -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release -DwxWidgets_ROOT_DIR=<wxInstallDir> ../../
On linux, run instead the following command:
cmake -DCMAKE_BUILD_TYPE=Release ../../
Take a look at CMakeCache.txt, and in particular CMAKE_INSTALL_PREFIX, which
gives the final install directory. If not what you want, edit it with a text
editor and re-run the same cmake command again, but with no
-DCMAKE_INSTALL_PREFIX given on the command line.
Compiling with Make
------------------~
You compile Kicad here. You will only need to do step 8) again when one of the
CMakeLists.txt files change. If windows, you must be in your msys shell.
On either platform then:
cd <kicadSource>/build/release
make
[sudo] make install
You are now done unless you want to make a Debug build.
Compiling a Debug version
-------------------------
cd <kicadSource>/build/debug
On either cmake command line shown below, you can optionally include
-DCMAKE_INSTALL_PREFIX=<finallInstallDir> before the final ../../ argument.
Although normally you do not install the Debug binaries, you can debug them
where they were built.
On windows, run the following command:
cmake -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Debug -DwxWidgets_ROOT_DIR=<wxInstallDir> ../../
where <wxInstallDir> is <wxWidgets path>/Release
On linux, run instead the following command:
cmake -DCMAKE_BUILD_TYPE=Debug -DwxWidgets_USE_DEBUG=ON ../../
Make the Debug binaries:
make
See Documentation/compiling/build-config.txt for a list of all CMake options
available when compiling KiCad.
+223
View File
@@ -0,0 +1,223 @@
Bazaar
======
KiCad uses the Bazaar version control system to track source code changes,
and download the boost libraries needed by Kicad.
The easiest way to get a copy of the KiCad source is to use Bazaar.
Bazaar can be download from http://wiki.bazaar.canonical.com.
Your best bet is to use the stand alone version of Bazaar
(which includes bzrtools, needed by Kicad) rather than one of
the Python specific versions.
Be sure bzrtools is also installed.
boost libraries will be downloaded the first time you build Kicad.
CMake
=====
KiCad uses CMake to generate the build files specific for the target platform
specified by the developer. This document attempts to define some of the more
common CMake and KiCad build configuration settings. You can use CMake either
by the command CMake on or the graphical version ccmake. This document only
documents a very small subset of the total CMake documentation For all of the
gory details, please see the complete CMake documentation at:
http://www.cmake.org/cmake/help/documentation.html.
Useful CMake Build Settings.
============================
This section defines some of the more common CMake build configuration setting
used when configuring KiCad. These settings are valid for all projects that
use CMake.
Changing the Build Generator.
-----------------------------
CMake attempts to create the project build system based on the platform. On
Posix systems CMake will create Unix Makefiles to build KiCad. On Windows
systems CMake will attempt to find the latest version of Visual C++ installed
on the system and create the appropriate project files. This behavior can be
changed by specifying the project generator using the -G "Project Generator"
switch on the command line. Please note, only a small subset of these project
generators are supported. If you want to use Eclipse on Linux to build KiCad,
you may be in for a lot of work.
CMAKE_BUILD_TYPE (Release/Debug/RelWithDebInfo/MinSizeRel)
----------------------------------------------------------
Default: Release
When configuring the KiCad build for the command line you must specify build
type. To create a debug build, set CMAKE_BUILD_TYPE to Debug. To create a
release build, set CMAKE_BUILD_TYPE to Release. See the CMake documentation
for other build types. For IDE project files, the build type can be selected
by the IDE configuration manager.
CMAKE_INSTALL_PATH (InstallPath)
--------------------------------
By default CMake will select the correct install path for your platform. If
you wish to install KiCad in a custom location, set CMAKE_INSTALL_PATH to the
path where you want to install KiCad. Please note that the default install
path that CMake chooses will likely overwrite the current version of KiCad
installed on your system.
wxWidgets Library Configuration.
================================
KiCad is built using the wxWidgets library. The following options allow you
to specifically tailor the wxWidgets library configuration. For the complete
list of wxWidgets setting see CMakeModules/FindwxWidgets.cmake in the KiCad
source.
wxWidgets_ROOT_DIR (NonDefaultwxWidgetsPath)
--------------------------------------------
CMake looks in the standard platform locations to find the default version of
the wxWidgets library. If you wish to use a custom built wxWidgets library,
set wxWidgets_ROOT_DIR to the correct path.
wxWidgets_USE_DEBUG (ON/OFF)
----------------------------
Default: OFF
When creating a debug build of KiCad, it is often useful to link against the
debug build of the wxWidgets. To use the debug build of wxWidgets, set
wxWidgets_USE_DEBUG to ON.
wxWidgets_USE_UNICODE (ON/OFF)
------------------------------
Default: ON (wxWidgets 2.9 or later), OFF (older versions)
If your platform supports Unicode and you wish to build KiCad with Unicode
support, set wxWidgets_USE_UNICODE to ON. Please note as of the 2.9 branch
this option is not required.
KiCad Specific Options
======================
All of the configuration settings below are specific to the KiCad project.
If for any reason you add or remove a build option to the KiCad CMake files,
please update the list below.
KICAD_SKIP_BOOST (ON/OFF)
--------------------------
Default: OFF
Use the version of the Boost library installed on the system rather than
building a local copy.
WARNING: The KiCad developers strongly advise you to build the bundled copy of
the Boost library, as it is known to work with KiCad. Other versions may
contain bugs that may result in KiCad errors.
USE_WX_GRAPHICS_CONTEXT (ON/OFF)
--------------------------------
Default: OFF
This option is *Experimental*. It enables advanced drawing library code using
wxGraphicsContext and should only be used for testing purposes. Under Windows,
a very recent version of mingw is needed. It also requires wxWidgets to be
built with the --enable-graphics_ctx configuration switch.
USE_IMAGES_IN_MENUS (ON/OFF)
----------------------------
Default: OFF for OSX, ON for other platforms.
This option is used to enable or disable building KiCad with images in menu
items. If this is not defined when CMake is used to create the build files,
images will be included in menu items on all platforms except OSX.
DOWNLOAD_DIR (PATH)
-------------------
Default: <source directory>/.downloads-by-cmake
Some external dependencies are automatically download and built when you
compile KiCad. This option specifies which directory they are stored in. If you
are building multiple copies of KiCad (e.g., to test different features or your
own modifications), it is recommended you set this option to a global directory
to avoid download and building the dependencies multiple times.
KICAD_USER_CONFIG_DIR (PATH)
----------------------------
Default: Home directory (Unix-based systems), Application data directory (Windows)
This option specifies where to store user-specific configuration information.
KICAD_KEEPCASE (ON/OFF)
-----------------------
Default: ON
If this is OFF, component names are automatically converted to uppercase meaning
they are case insensitive. If it is ON, component names are not changed and
are therefore case sensitive.
USE_WX_OVERLAY (ON/OFF)
-----------------------
Default: ON for OSX, OFF for other platforms.
This option enables or disables the use of wxOverlay for drawing operations.
Warning, this is experimental!
KICAD_SCRIPTING (ON/OFF)
------------------------
Default: OFF
This option enables or disables building Python scripting support within KiCad.
Currently only Pcbnew is supported. This option requires SWIG and Python to be
installed on the system.
KICAD_SCRIPTING_MODULES (ON/OFF)
--------------------------------
Default: OFF
This option enables or disables building KiCad Python modules that can be used
externally by Python. Currently only Pcbnew is supported. This option
requires SWIG and Python to be installed on the system.
KICAD_SCRIPTING_WXPYTHON (ON/OFF)
---------------------------------
Default: OFF
This option enables or disables building wxPython support into the KiCad
scripting support. Currently only Pcbnew is supported. This option requires
SWIG, Python, and wxPython to be installed on the system.
PYTHON_SITE_PACKAGE_PATH (PATH)
-------------------------------
Default: System site library path
When building KiCad with Python scripting enable, the Python site library path
is used by default. If you want to install the KiCad Python extension in a
different path, set this variable to the desired path.
BUILD_GITHUB_PLUGIN (ON/OFF)
----------------------------
Default: OFF
This option enables or disables building KiCad with a pcbnew plugin for loading
footprints from a GitHub repository.
KICAD_REPO_NAME (STRING)
------------------------
Default: "product"
The name of the repository this copy of KiCad was compiled from. This is
reported in the "About" dialog and is useful for people who are working with
multiple copies of the code from different sources. The default value is
"product", the name of the main development branch on Launchpad.
+226
View File
@@ -0,0 +1,226 @@
Introduction
------------
This document details how to build KiCad from source on Windows. The current
supported method of building KiCad for Windows systems is to use the MinGW
compiler, either from Windows or cross compiling from Linux. MSYS can be
used on Windows to extend the range of subprojects that you can build, but
is not needed to build KiCad itself.
Visual Studio is not supported, and don't ask about it, it is not supported
and will not be, ever.
Install Build Tools
-------------------
This section describes the tools required to build KiCad from source and how
to install them. Failure to install these tools properly will likely result
in build errors.
MinGW/MSYS
----------
MinGW/MSYS provides the compiler tools and a partial Posix environment useful
for building software. Download the MinGW installer from http://mingw.org.
Run the installer and and verify MinGW and MSYS are checked. You will also
need to expand the MinGW entry and select C++ from the list of supported
languages. Only C is installed by default and C++ is required to build KiCad.
Bazaar
------
KiCad uses the Bazaar version control system to track source code changes,
and download the boost libraries needed by Kicad.
The easiest way to get a copy of the KiCad source is to use Bazaar. Bazaar
can be download from http://wiki.bazaar.canonical.com/WindowsDownloads.
Your best bet is to use the stand alone version of Bazaar
(which includes bzrtools, needed Kicad) rather than one of
the Python specific versions.
CMake
-----
The KiCad source uses CMake to make sure the system has the required software
and libraries installed to properly compile the source. Download the latest
CMake installer from http://cmake.org. Run the installer and make sure the
add CMake to PATH variable check box is checked. If you fail to do this step,
the CMake executable will not be found.
Doxygen (Optional)
------------------
Doxygen is used to generate HTML documentation of the KiCad source code. While
it is not necessary to install Doxygen, it is a very good way to learn your way
around the KiCad code base. It is highly recommended for new developers. The
latest Doxygen installer can be downloaded from http://www.stack.nl/~dimitri/
doxygen/
Python (Optional)
-----------------
KiCad supports the Python scripting language (currently only Pcbnew scripting
exists). Currently the Python scripting support will only build against the
version 2 branch of Python. The Python installer can be downloaded from http://
www.python.org.
SWIG (Optional)
---------------
SWIG is used to generate the Python scripting code. It must be installed to
build the Python scripting support. Unfortunately there in no installer for
windows. You can download precompiled binaries from http://http://www.swig.
org/download.html and install swig.exe. Make sure the folder you install the
SWIG binary into is in the system PATH. Otherwise CMake will not be able to
find it.
NullSoft Installer System (Optional)
------------------------------------
The NullSoft Installer System (NSIS) is used to create a Windows installer for
end users from the binaries created from the KiCad source along with the
library and documentation files. NSIS is typically only used be developers who
create installers for end users and is not required if you install from source.
NSIS can be downloaded from http://nsis.sourceforge.net/Download.
Install and Build Libraries
---------------------------
This section documents installing and build all of the software libraries
required to build KiCad. As of now, these libraries have to be built because
MinGW builds of these libraries are not readily available Attempting to link
programs built on MinGW with libraries from other compilers (namely Microsoft
Visual C) is problematic. It can be done but it is not painless. As far as
the author of this document knows, MinGW can only link to Visual Studio C
libraries. The name mangling of Visual Studio C++ is not compatible with the
MinGW linker.
Build and Install the wxWidgets Library
---------------------------------------
The wxWidgets library is the base that KiCad is built upon. Version 2.9.4
or later of wxWidgets *should be* used on Windows. You may be able to build
KiCad with older versions of wxWidgets but it is not recommended. wxWidgets
can be downloaded from http://http://www.wxwidgets.org/downloads/
Unzip the wxWidgets zip file into your preferred build directory. Avoid using
spaces in the path names. Some MinGW tools do not play well with them. It is
always best to error on the side of caution.
Open MinGW and change to the wxWidgets source directory. If you don't want to
install the wxWidgets library into MinGW then enter the following commands:
#mkdir Release
#cd Release
#../configure --with-opengl
#make
If you want to install wxWidgets in MinGW then enter the following commands:
#mkdir Release
#cd Release
#../configure --prefix=/mingw --enable-monolithic=no --disable-shared --with-opengl
#make && make install
wxWidgets will be statically linked to Kicad, which avoid issus with wxWidgets dlls
Download the KiCad Source Code
------------------------------
You can use the Launchpad repository or a tar file for this. See the wiki.
To download files from Launchpad repository, you need to install the Bazaar
(bzr) version control system.
Launchpad repository has two branches for KiCad sources:
- a testing branch (used by developers)
- a stable branch (a copy of the testing branch, when this testing branch is
near a stable state)
To download the testing branch:
#bzr branch lp:kicad kicad_testing
To download the stable branch:
#bzr branch lp:kicad/stable kicad_stable
To download the component and footprint libraries
#bzr branch lp:~kicad-lib-committers/kicad/library kicad_libraries
To download the documentation and translation files:
#bzr branch lp:~kicad-developers/kicad/doc kicad_doc
Create Makefiles with CMake
---------------------------
Open your Msys shell. Create two "out of source" build directories at the
command line enter the following commands:
#cd <kicadSource>
#mkdir -p build/release # Build path can be anywhere you prefer.
#mkdir build/debug # Only if you want a debug version of KiCad.
To create a release build of KiCad, run the following command:
#cd build
#cmake -G "MSYS Makefiles" \ # Back slashes are not required
-DCMAKE_BUILD_TYPE=Release ../../ \ # and are for formatting only.
If the configuration fails, you have failed to install the required software
on you system. The error message should give you a good indication of what is
missing. You must resolve this before you can build KiCad.
Compiling the Code
------------------
To build KiCad, at the command line enter following comnands:
#cd <kicadSource>/build/release
#make
Installing KiCad
----------------
To install Kicad, at the command line enter the following commands:
#cd <kicadSource>/build/release
#make install
If you get any errors during the installation, you probably do not have the
appropriate privileges to the install path. Take a look at CMakeCache.txt
that was created when you ran CMake, and in particular look at the value of
the CMAKE_INSTALL_PREFIX variable. This is where KiCad will be installed. If
this not where you want KiCad installed, edit it with a text editor rerun the
make install command. You do not have the appropriate privileges to install
KiCad in the CMAKE_INSTALL_PATH, run the make install command as administrator.
You are now done unless you want to make a Debug build.
Compiling a Debug version
-------------------------
To create a debug version of KiCad, enter the following commands:
#cd <kicadSource>/build/debug
#cmake -G "MSYS Makefiles" \
-DCMAKE_BUILD_TYPE=Debug ../../
#make
Generally speaking you do not install debug binaries. They can be debugged in
place. To monitor the debugging output, you can download the Windows debug
viewer DbgView from http://technet.microsoft.com/en-us/sysinternals/
bb896647.aspx
Compiling the Python Scripting Support.
---------------------------------------
Before building KiCad Python scripting extension, you must create a MinGW
compatible Python link library. The directions to do this can be found in
the "How do I create Python extensions?" FAQ at http://www.mingw.org/wiki/FAQ.
To build KiCad with Python scripting support, run CMake as follows and then
compile the source as described above.
#cmake -G "MSYS Makefiles" \
-DCMAKE_BUILD_TYPE=Release \
-DKICAD_PYTHON_SCRIPTING=ON \
-DKICAD_PYTHON_MODULES=ON ../../
You only need to include the KICAD_PYTHON_MODULES option if you want to
install the python modules that ship with KiCad. Also note that the wxPython
support cannot be compiled on Windows at this time due to library conflicts
between MinGW and Python. Work is currently underway by the KiCad developers
to provide a MinGW build of Python which should resolve this issue.
Building the Developer Documentation
------------------------------------
To build the HTML developer documentation, run the following commands:
#cd <kicadSource>/build/debug
#make doxygen-docs
The documentation will be created in the <kicadSouce>/Documentation/html
directory.
+63
View File
@@ -0,0 +1,63 @@
Compiling KiCad on Apple Mac OS X
=================================
First written: 2010-01-31
by: Jerry Jacobs <xor.gate.engineering[at]gmail[dot]com>
Modified at: 2014-02-07
by: Marco Serantoni <marco.serantoni[at]gmail[dot]com>
Snow Leopard
------------
Requirements
* XCode Tools (http://developer.apple.com/tools/xcode)
* bzr (bazaar)
* CMake (http://www.cmake.org)
The build of Kicad for OSX is now easier than before.
The building system will download and compile the needed libraries for you
patching them accordly to the needs.
Building Kicad with no support for Scripting
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The building needs to know if you want a static binary or a dynamic one
Just set ONE of those two options KICAD_BUILD_STATIC or KICAD_BUILD_DYNAMIC
If you set KICAD_BUILD_DYNAMIC the building system will build all and include
the needed libraries for each executable in its bundle
cmake -DKICAD_BUILD_DYNAMIC=ON .
make
Building Kicad with support for Scripting
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Due some problems with some dependencies the build of this kind of binary is a bit
more complex, you should initially set KICAD_BUILD_DYNAMIC
then issue for example
cmake -DKICAD_BUILD_DYNAMIC=ON .
make swig
After successfully building you can set your KICAD_SCRIPTING* options (for example):
cmake -DKICAD_SCRIPTING=ON -DKICAD_SCRIPTING_WXPYTHON=ON -DKICAD_SCRIPTING_MODULES=ON .
make
The system will build all accordling your choices and package all in the bundle
I know bundles will be huge, but those will be autosufficient.
Building Kicad for other processors or Universal binaries
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I wish remember you should set the processor like
cmake -DCMAKE_OSX_ARCHITECTURES="x86_64"
for other platforms
cmake -DCMAKE_OSX_ARCHITECTURES="x86_64 -arch i386"
cmake -DCMAKE_OSX_ARCHITECTURES="x86_64 -arch i386 -arch ppc"
I know some you should prefer use ; as separator, this will be accomplished soon
keeping support for both the syntaxes
+35 -6
View File
@@ -1,4 +1,3 @@
# Doxyfile 1.8.2
# This file describes the settings to be used by the documentation system
@@ -325,6 +324,22 @@ INLINE_SIMPLE_STRUCTS = NO
TYPEDEF_HIDES_STRUCT = NO
# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
# determine which symbols to keep in memory and which to flush to disk.
# When the cache is full, less often used symbols will be written to disk.
# For small to medium size projects (<1000 input files) the default value is
# probably good enough. For larger projects a too small cache size can cause
# doxygen to be busy swapping symbols to and from disk most of the time
# causing a significant performance penalty.
# If the system has enough physical memory increasing the cache will improve the
# performance by keeping more symbols in memory. Note that the value works on
# a logarithmic scale so increasing the size by one will roughly double the
# memory usage. The cache size is given by this formula:
# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
# corresponding to a cache size of 2^16 = 65536 symbols.
SYMBOL_CACHE_SIZE = 4
# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be
# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given
# their name and scope. Since this can be an expensive process and often the
@@ -646,10 +661,7 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
INPUT = coding-style-policy.md \
stable-release-policy.md \
road-map.md \
compiling.md
INPUT = road-map.md
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
@@ -667,7 +679,7 @@ INPUT_ENCODING = UTF-8
# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py
# *.f90 *.f *.for *.vhd *.vhdl
FILE_PATTERNS =
FILE_PATTERNS = *.md
# The RECURSIVE tag can be used to turn specify whether or not subdirectories
# should be searched for input files as well. Possible values are YES and NO.
@@ -1399,6 +1411,23 @@ GENERATE_XML = NO
XML_OUTPUT = xml
# The XML_SCHEMA tag can be used to specify an XML schema,
# which can be used by a validating XML parser to check the
# syntax of the XML files.
XML_SCHEMA =
# The XML_DTD tag can be used to specify an XML DTD,
# which can be used by a validating XML parser to check the
# syntax of the XML files.
XML_DTD =
# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
# dump the program listings (including syntax highlighting
# and cross-referencing information) to the XML output. Note that
# enabling this will significantly increase the size of the XML output.
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
@@ -1,800 +0,0 @@
# KiCad C++ Source Code Style Guide #
Latest Publishing: February 2013
First Published: September 2010
written by
Wayne Stambaugh \<<stambaughw@verizon.net>\>
and
Dick Hollenbeck \<<dick@softplc.com>\>
[TOC]
# 1. Introduction # {#intro}
The purpose of this document is to provide a reference guide for KiCad
developers about how source code should be styled and formatted in
KiCad. It is not a comprehensive programming guide because it does not
discuss many things such as software engineering strategies, source
directories, existing classes, or how to internationalize text. The goal
is to make all of the KiCad source conform to this guide.
## 1.1 Why Coding Style Matters ## {#why}
You may be thinking to yourself that using the style defined in this
document will not make you a good programmer and you would be correct.
Any given coding style is no substitute for experience. However, any
experienced coder will tell that the only thing worse than looking at
code that is not in your preferred coding style, is looking at twenty
different coding styles that are not your preferred coding style.
Consistency makes a) problems easier to spot, and b) looking at code for
long periods of time more tolerable.
## 1.2 Enforcement ## {#enforcement}
The KiCad coding police are not going to break down your door and beat
you with your keyboard if you don't follow these guidelines (although
there are those who would argue that they should). However, there are
some very sound reasons why you should follow them. If you are
contributing patches, you are much more likely to be taken seriously by
the primary developers if your patches are formatted correctly. Busy
developers don't have the time to go back and reformat your code. If you
have a desire to become a regular KiCad developer with commit access to
the development branch, you're not likely to get a glowing
recommendation by the lead developers if you will not follow these
guidelines. It is just good programming courtesy to follow this policy
because it is respectful of the investment already made by the existing
developers. The other KiCad developers will appreciate your effort.
**Warning**
**Do not modify this document without the consent of the project
leader. All changes to this document require approval.**
# 2. Naming Conventions # {#naming_conventions}
Before delving into anything as esoteric as indentation and formatting,
naming conventions need to be addressed. This section does not attempt
to define what names you use for your code. Rather, it defines the style
for naming. See the references section for links to some excellent
coding references. When defining multiple word names use the following
conventions for improved readability:
- Use underscores for all upper and all lower case variables to make
multiple word names more readable.
- Use camel case for mixed case variable names.
Avoid mixing camel case and underscores.
**Examples**
~~~~~~~~~~~~~{.cpp}
CamelCaseName // if camelcase, then no underscores
all_lower_case_name
ALL_UPPER_CASE_NAME
~~~~~~~~~~~~~
## 2.1 Class, Type Definitions, Name Space, and Macro Names ## {#definitions}
Class, typedef, enum, name space, and macro names should be comprised of
all capital letters.
**Examples**
~~~~~~~~~~~~~{.cpp}
class SIMPLE
#define LONG_MACRO_WITH_UNDERSCORES
typedef boost::ptr_vector<PIN> PIN_LIST;
enum KICAD_T {...};
~~~~~~~~~~~~~
## 2.2 Local, Private and Automatic Variables ## {#local_variables}
The first character of automatic, static local, and private variable
names should be lower case. This indicates that the variable will not be
“visible” outside of the function, file, or class where they are
defined, respectively. The limited visibility is being acknowledged with
the lowercase starting letter, where lowercase is considered to be less
boisterous than uppercase.
**Examples**
~~~~~~~~~~~~~{.cpp}
int i;
double aPrivateVariable;
static char* static_variable = NULL;
~~~~~~~~~~~~~
## 2.3 Public and Global Variables ## {#global_variables}
The first character of public and global variable names are to be
uppercase. This indicates that the variable is visible outside the class
or file in which it was defined. (An exception is the use of prefix `g_`
which is also sometimes used to indicate a global variable.)
**Example**
~~~~~~~~~~~~~{.cpp}
char* GlobalVariable;
~~~~~~~~~~~~~
## 2.4 Local, Private and Static Functions ## {#functions}
The first character of local, private, and static functions should be
lower case. This indicates that the function is not visible outside the
class or file where it is defined.
**Example**
~~~~~~~~~~~~~{.cpp}
bool isModified();
static int buildList( int* list );
~~~~~~~~~~~~~
## 2.5 Function Arguments ## {#function_arguments}
Function arguments are prefixed with an 'a' to indicate these are
arguments to a function. The 'a' stands for “argument”, and it also
enables clever and concise Doxygen comments.
**Example**
~~~~~~~~~~~~~{.cpp}
/*/** */*
* Function SetFoo
* takes aFoo and copies it into this instance.
*/
void SetFoo( int aFoo );
~~~~~~~~~~~~~
Notice how the reader can say “a Foo” to himself when reading this.
## 2.6 Pointers ## {#pointers}
It is not desired to identify a pointer by building a 'p' into the
variable name. The pointer aspect of the variable pertains to type, not
purpose.
**Example**
~~~~~~~~~~~~~{.cpp}
MODULE* module;
~~~~~~~~~~~~~
The purpose of the variable is that it represents a MODULE. Something
like `p_module` would only make that harder to discern.
## 2.7 Accessing Member Variables and Member Functions ## {#accessing_members}
We do not use “`this->`” to access either member variables or member
functions from within the containing class. We let C++ perform this for
us.
# 3. Commenting # {#commenting}
Comments in KiCad typically fall into two categories: in line code
comments and Doxygen comments. In line comments have no set formatting
rules other than they should have the same indent level as the code if
they do not follow a statement. In line comments that follow statements
should not exceed 99 columns unless absolutely necessary. The prevents
word wrapping in an editor when the viewable columns is set to 100. In
line comments can use either the C++ or the C commenting style, but C++
comments are preferred for single line comments or comments consisting
of only a few lines.
## 3.1 Blank Lines Above Comments ## {#blank_lines_above_comments}
If a comment is the first thing on a line, then that comment should have
one or more blank lines above them. One blank line is preferred.
## 3.2 Doxygen ## {#doxygen}
Doxygen is a C++ source code documenting tool used by the project. Descriptive
*.html files can be generated from the source code by installing Doxygen and
building the target named **doxygen-docs**.
$ cd <kicad_build_base>
$ make doxygen-docs
The \*.html files will be placed into
\<kicad\_project\_base\>/Documentation/doxygen/html/
Doxygen comments are used to build developer documentation from the
source code. They should normally be only placed in header files and not
in \*.cpp files. This eliminates the obligation to keep two comments in
agreement with each other. is if the class, function, or enum, etc. is
only defined in a \*.cpp source file and not present in any header file,
in which case the Doxygen comments should go into the \*.cpp source file.
Again, avoid duplicating the Doxygen comments in both the header and
\*.cpp source files.
KiCad uses the JAVADOC comment style defined in the [“Documenting the
code”][doccode] section of the Doxygen [manual][manual]. Don't forget
to use the special Doxygen tags: bug, todo, deprecated, etc., so other
developers can quickly get useful information about your code. It is
good practice to actually generate the Doxygen \*.html files by
building target doxygen-docs, and then to review the quality of your
Doxygen comments with a web browser before submitting a patch.
[doccode]: http://www.stack.nl/~dimitri/doxygen/manual/docblocks.html
[manual]: http://www.stack.nl/~dimitri/doxygen/manual.html
### 3.2.1 Function Comments ### {#function_comments}
These go into a header file, unless the function is a private (i.e.
static) function known only to a \*.cpp file. The format of a function
comment is chosen to serve a dual purpose role: delineation of the
function declaration within the source code and to create a consistent
leading sentence in the doxygen html output. The chosen format is
“Function \<name\>” as shown in the example below.
**Example**
~~~~~~~~~~~~~{.cpp}
/*/** */*
* Function Print
* formats and writes text to the output stream.
* @param nestLevel is the multiple of spaces to precede the output with.
* @param fmt is a printf() style format string.
* @param ... is a variable list of parameters that will get blended into
* the output under control of the format string.
* @return int - the number of characters output.
* @throw IO_ERROR, if there is a problem outputting, such asisk.
*/
int PRINTF_FUNC Print( int nestLevel,
const char* fmt, ... ) throw( IO_ERROR );
~~~~~~~~~~~~~
The “Function \<name\>” text goes on the 2nd line of the comment. The
\@return keyword if present, should show the type of the return value
followed by a hiphen. The \@param keyword names a function parameter
and the text following should flow like a normal English sentence.
### 3.2.2 Class Comments ### {#class_comments}
A class comment describes a class declaration by giving the purpose and
use of the class. Its format is similar to a function comment. Doxygen
can use the html \<p\> (paragraph designation) to begin a new paragraph
in its output. So if the text of the comment is large, break it put into
multiple paragraphs.
**Example**
~~~~~~~~~~~~~{.cpp}
/*/** */*
* Class OUTPUTFORMATTER
* is an important interface (abstract) class used to output UTF8 text in
* a convenient way. The primary interface is "printf() - like" but
* with support for indentation control. The destination of the 8 bit
* wide text is up to the implementer.
* <p>
* The implementer only has to implement the write() function, but can
* also optionally re-implement GetQuoteChar().
* <p>
* If you want to output a wxString, then use CONV_TO_UTF8() on it
* before passing it as an argument to Print().
* <p>
* Since this is an abstract interface, only classes derived from
* this one may actually be used.
*/
class OUTPUTFORMATTER
{
~~~~~~~~~~~~~
# 4. Formatting # {#formatting}
This section defines the formatting style used in the KiCad source.
## 4.1 Indentation ## {#indentation}
The indentation level for the KiCad source code is defined as four
spaces. Please do not use tabs.
### 4.1.1 Defines ### {#defines}
There should be only one space after a \#define statement.
### 4.1.2 Column Alignment ### {#column_alignment}
Please try to align multiple consecutive similar lines into consistent
columns when possible, such as \#define lines which can be thought of as
containing 4 columns: \#define, symbol, value, and comment. Notice how
all 4 columns are aligned in the example below.
**Example**
~~~~~~~~~~~~~{.cpp}
#define LN_RED 12 // my favorite
#define LN_GREEN 13 // eco friendly
~~~~~~~~~~~~~
Another common case is the declaration of automatic variables. These are
preferably shown in columns of type and variable name.
## 4.2 Blank Lines ## {#blank_lines}
### 4.2.1 Function Declarations ### {#function_declarations}
There should be 1 blank line above a function declaration in a class
file if that function declaration is presented with a Javadoc comment.
This is consist with the statement above about blank lines above
comments.
### 4.2.2 Function Definitions ### {#function_definitions}
Function definitions in *.cpp files will not typically be accompanied by
any comment, since those are normally only in the header file. It is
desirable to set off the function definition within the *.cpp file by
leaving two blank lines above the function definition.
### 4.2.3 If Statements ### {#if_statements}
There should be one blank line above if statements.
## 4.3 Line Length ### {#line_length}
The maximum line width is 99 columns. An exception to this is a long
quoted string such as the internationalized text required to satisfy
MSVC++, described below.
## 4.4 Strings ## {#strings}
The KiCad project team no longer supports compiling with Microsoft
Visual C++. When you need to break long strings into smaller substrings,
please use the C99 compliant method for improved readability. Using
any of previously accepted methods defined below for breaking
long internationalized strings will no longer be accepted.
**Examples**
~~~~~~~~~~~~~{.cpp}
// This works with C99 compliant compilers is the **only** accepted method:
wxChar* foo = _( “this is a long string broken ”
“into pieces for readability.” );
// This works with MSVC, breaks POEdit, and is **not** acceptable:
wxChar* foo = _( “this is a long string broken ”
L“into pieces for readability” );
// This works with MSVC, is ugly, and is **not** accepted:
wxChar* foo = _( “this is a long string \
broken into pieces for readability” );
~~~~~~~~~~~~~
A second acceptable solution is to simply put the text all on one
line, even if it exceeds the 99 character line length limit. However,
the preferred method is to break strings within the 99 character limit
whenever possible to prevent wrapping.
## 4.5 Trailing Whitespace ## {#trailing_whitespace}
Many programming editors conveniently indent your code for you. Some of
them do it rather poorly and leave trailing whitespace. Thankfully, most
editors come with a remove trailing whitespace macro or at least a
setting to make trailing whitespace visible so you can see it and
manually remove it. Trailing whitespace is known to break some text
parsing tools. It also leads to unnecessary diffs in the version control
system. Please remove trailing whitespace.
## 4.6 Multiple Statements per Line ## {#multiple_statements_per_line}
It is generally preferred that each statement be placed on its own line.
This is especially true for statements without keywords.
**Example**
~~~~~~~~~~~~~{.cpp}
x=1; y=2; z=3; // Bad, should be on separate lines.
~~~~~~~~~~~~~
## 4.7 Braces ## {#braces}
Braces should be placed on the line proceeding the keyword and indented
to the same level. It is not necessary to use braces if there is only a
single line statement after the keyword. In the case of if..else
if..else, indent all to the same level.
**Example**
~~~~~~~~~~~~~{.cpp}
void function()
{
if( foo )
{
statement1;
statement2;
}
else if( bar )
{
statement3;
statement4;
}
else
statement5;
}
~~~~~~~~~~~~~
## 4.8 Parenthesis ## {#parenthesis}
Parenthesis should be placed immediately after function names and
keywords. Spaces should be placed after the opening parenthesis, before
the closing parenthesis, and between the comma and the next argument in
functions. No space is needed if a function has no arguments.
**Example**
~~~~~~~~~~~~~{.cpp}
void Function( int aArg1, int aArg2 )
{
while( busy )
{
if( a || b || c )
doSomething();
else
doSomethingElse();
}
}
~~~~~~~~~~~~~
## 4.9 Switch Formatting ## {#switch}
The case statement is to be indented to the same level as the switch.
**Example**
~~~~~~~~~~~~~{.cpp}
switch( foo )
{
case 1:
doOne();
break;
case 2:
doTwo();
// Fall through.
default:
doDefault();
}
~~~~~~~~~~~~~
# 5. License Statement # {#license_statement}
There is a the file copyright.h which you can copy into the top of
your new source files and edit the \<author\> field. KiCad depends on
the copyright enforcement capabilities of copyright law, and this
means that source files must be copyrighted and not be released into
the public domain. Each source file has one or more owners.
# 6. Header Files # {#header_files}
Project \*.h source files should:
- contain a license statement
- contain a nested include \#ifndef
- be fully self standing and not depend on other headers that are not
included within it.
The license statement was described above.
## 6.1 Nested Include #ifndef ## {#nested_include}
Each header file should include an \#ifndef which is commonly used to
prevent compiler errors in the case where the header file is seen
multiple times in the code stream presented to the compiler. Just
after the license statement, at the top of the file there should be
lines similar to these (but with a filename specific token other than
`RICHIO_H_`):
~~~~~~~~~~~~~{.cpp}
#ifndef RICHIO_H_
#define RICHIO_H_
~~~~~~~~~~~~~
And at the very bottom of the header file, use a line like this one:
~~~~~~~~~~~~~{.cpp}
#endif // RICHIO_H_
~~~~~~~~~~~~~
The \#ifndef wrapper begins after the license statement, and ends at
the very bottom of the file. It is important that it wrap any nested
\#include statements, so that the compiler can skip them if the
\#ifndef evaluates to false, which will reduce compilation time.
## 6.2 Headers Without Unsatisfied Dependencies ## {#header_depends}
Any header file should include other headers that it depends on. (Note:
KiCad is not at this point now, but this section is a goal of the
project.)
It should be possible to run the compiler on any header file within the
project, and with proper include paths being passed to the compiler, the
header file should compile without error.
**Example**
$ cd /svn/kicad/testing.checkout/include
$ g++ wx-config --cxxflags -I . xnode.h -o /tmp/junk
Such structuring of the header files removes the need within a client
\*.cpp file to include some project header file before some other project
header file. (A client \*.cpp file is one that intends to **use, not
implement,** the public API exposed within the header file.)
Client code should not have to piece together things that a header file
wishes to expose. The exposing header file should be viewed as a fully
sufficient **ticket to use** the public API of that header file.
This is not saying anything about how much to expose, only that that
which is exposed needs to be fully usable merely by including the header
file that exposes it, with no additional includes.
For situations where there is a class header file and an
implementation \*.cpp file, it is desirable to hide as much of the
private implementation as is practical and any header file that is not
needed as part of the public API can and should be included only in
the implementation \*.cpp file. However, the number one concern of
this section is that client (using) code can use the public API which
is exposed in the header file, merely by including that one header
file.
# 7. I Wrote X Lines of Code Before I Read This Document # {#x_lines}
It's OK. We all make mistakes. Fortunately, KiCad provides a
configuration file for the code beautifier uncrustify. Uncrustify won't
fix your naming problems but it does a pretty decent job of formatting
your source code. There are a few places where uncrustify makes some
less than ideal indentation choices. It struggles with the string
declaration macros wxT(“”) and \_(“”) and functions used as arguments to
other functions. After you uncrustify your source code, please review the
indentation for any glaring errors and manually fix them. See the
uncrustify [website][uncrustify] for more information.
[uncrustify]: http://uncrustify.sourceforge.net/
# 8. Show Me an Example # {#show_me_an_example}
Nothing drives the point home like an example. The source file richio.h
below was taken directly from the KiCad source.
~~~~~~~~~~~~~{.cpp}
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2007-2010 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2007 KiCad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef RICHIO_H_
#define RICHIO_H_
// This file defines 3 classes useful for working with DSN text files and is named
// "richio" after its author, Richard Hollenbeck, aka Dick Hollenbeck.
#include <string>
#include <vector>
// I really did not want to be dependent on wxWidgets in richio
// but the errorText needs to be wide char so wxString rules.
#include <wx/wx.h>
#include <cstdio> // FILE
/*/** */*
* Struct IOError
* is a class used to hold an error message and may be used to throw exceptions
* containing meaningful error messages.
*/
struct IOError
{
wxString errorText;
IOError( const wxChar* aMsg ) :
errorText( aMsg )
{
}
IOError( const wxString& aMsg ) :
errorText( aMsg )
{
}
};
/*/** */*
* Class LINE_READER
* reads single lines of text into its buffer and increments a line number counter.
* It throws an exception if a line is too long.
*/
class LINE_READER
{
protected:
FILE* fp;
int lineNum;
unsigned maxLineLength;
unsigned length;
char* line;
unsigned capacity;
public:
/*/** */*
* Constructor LINE_READER
* takes an open FILE and the size of the desired line buffer.
* @param aFile An open file in "ascii" mode, not binary mode.
* @param aMaxLineLength The number of bytes to use in the line buffer.
*/
LINE_READER( FILE* aFile, unsigned aMaxLineLength );
~LINE_READER()
{
delete[] line;
}
/*
int CharAt( int aNdx )
{
if( (unsigned) aNdx < capacity )
return (char) (unsigned char) line[aNdx];
return -1;
}
*/
/*/** */*
* Function ReadLine
* reads a line of text into the buffer and increments the line number
* counter. If the line is larger than the buffer size, then an exception
* is thrown.
* @return int - The number of bytes read, 0 at end of file.
* @throw IOError only when a line is too long.
*/
int ReadLine() throw (IOError);
operator char* ()
{
return line;
}
int LineNumber()
{
return lineNum;
}
unsigned Length()
{
return length;
}
};
/*/** */*
* Class OUTPUTFORMATTER
* is an interface (abstract class) used to output ASCII text in a convenient
* way. The primary interface is printf() like but with support for indentation
* control. The destination of the 8 bit wide text is up to the implementer.
* If you want to output a wxString, then use CONV_TO_UTF8() on it before passing
* it as an argument to Print().
* <p>
* Since this is an abstract interface, only classes derived from this one
* will be the implementations.
*/
class OUTPUTFORMATTER
{
#if defined(__GNUG__) // The GNU C++ compiler defines this
// When used on a C++ function, we must account for the "this" pointer,
// so increase the STRING-INDEX and FIRST-TO_CHECK by one.
// See http://docs.freebsd.org/info/gcc/gcc.info.Function_Attributes.html
// Then to get format checking during the compile, compile with -Wall or -Wformat
#define PRINTF_FUNC __attribute__ ((format (printf, 3, 4)))
#else
#define PRINTF_FUNC // nothing
#endif
public:
/*/** */*
* Function Print
* formats and writes text to the output stream.
*
* @param nestLevel The multiple of spaces to preceed the output with.
* @param fmt A printf() style format string.
* @param ... a variable list of parameters that will get blended into
* the output under control of the format string.
* @return int - the number of characters output.
* @throw IOError, if there is a problem outputting, such as a full disk.
*/
virtual int PRINTF_FUNC Print( int nestLevel, const char* fmt, ... ) throw( IOError ) = 0;
/*/** */*
* Function GetQuoteChar
* performs quote character need determination.
* It returns the quote character as a single character string for a given
* input wrapee string. If the wrappee does not need to be quoted,
* the return value is "" (the null string), such as when there are no
* delimiters in the input wrapee string. If you want the quote_char
* to be assuredly not "", then pass in "(" as the wrappee.
* <p>
* Implementations are free to override the default behavior, which is to
* call the static function of the same name.
* @param wrapee A string that might need wrapping on each end.
* @return const char* - the quote_char as a single character string, or ""
* if the wrapee does not need to be wrapped.
*/
virtual const char* GetQuoteChar( const char* wrapee ) = 0;
virtual ~OUTPUTFORMATTER() {}
/*/** */*
* Function GetQuoteChar
* performs quote character need determination according to the Specctra DSN
* specification.
* @param wrapee A string that might need wrapping on each end.
* @param quote_char A single character C string which provides the current
* quote character, should it be needed by the wrapee.
*
* @return const char* - the quote_char as a single character string, or ""
* if the wrapee does not need to be wrapped.
*/
static const char* GetQuoteChar( const char* wrapee, const char* quote_char );
};
/*/** */*
* Class STRINGFORMATTER
* implements OUTPUTFORMATTER to a memory buffer. After Print()ing the
* string is available through GetString()
*/
class STRINGFORMATTER : public OUTPUTFORMATTER
{
std::vector<char> buffer;
std::string mystring;
int sprint( const char* fmt, ... );
int vprint( const char* fmt, va_list ap );
public:
/*/** */*
* Constructor STRINGFORMATTER
* reserves space in the buffer
*/
STRINGFORMATTER( int aReserve = 300 ) :
buffer( aReserve, '\0' )
{
}
/*/** */*
* Function Clear
* clears the buffer and empties the internal string.
*/
void Clear()
{
mystring.clear();
}
/*/** */*
* Function StripUseless
* removes whitespace, '(', and ')' from the mystring.
*/
void StripUseless();
std::string GetString()
{
return mystring;
}
//-----<OUTPUTFORMATTER>------------------------------------------------
int PRINTF_FUNC Print( int nestLevel, const char* fmt, ... ) throw( IOError );
const char* GetQuoteChar( const char* wrapee );
//-----</OUTPUTFORMATTER>-----------------------------------------------
};
#endif // RICHIO_H_
~~~~~~~~~~~~~
# 9. Resources # {#resources}
There are plenty of excellent resources on the Internet on C++ coding
styles and coding do's and don'ts. Here are a few useful ones. In most
cases, the coding styles do not follow the KiCad coding style but there
is plenty of other good information here. Besides, most of them have
some great humor in them enjoyable to read. Who knows, you might even
learn something new.
- [C++ Coding Standard][cppstandard]
- [Linux Kernel Coding Style][kernel]
- [C++ Operator Overloading Guidelines][overloading]
- [Wikipedia's Programming Style Page][style]
[cppstandard]:http://www.possibility.com/Cpp/CppCodingStandard.html
[kernel]:http://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/Documentation/CodingStyle
[overloading]:http://www.cs.caltech.edu/courses/cs11/material/cpp/donnie/cpp-ops.html
[style]:http://en.wikipedia.org/wiki/Programming_style
-398
View File
@@ -1,398 +0,0 @@
# Building KiCad from Source #
If you are a user and not a developer, please consider using one of the prebuilt packages
of KiCad which can be found at the [download][] page on the [KiCad website][]. Building KiCad
from source is not for the faint of heart and is not recommended unless you have reasonable
software development experience. This document contains the instructions on how to build KiCad
from source on the supported platforms. It is not intended as a guide for installing or building
[library dependencies](#library_dependencies). Please consult you platforms documentation for
installing packages or the source code when building the library dependencies. Currently the
supported platforms are Windows Versions 7-10, just about any version of Linux, and OSX
10.7-10.10. You may be able to build KiCad on other platforms but it is not supported. On
Windows and Linux the [GNU GCC][] is the only supported compiler and on OSX [Clang][] is the
only supported compiler.
[TOC]
# Development Tools # {#development_tools}
Before you begin building KiCad, there are a few tools required in addition to your compiler.
Some of these tools are required to build from source and some are optional.
## CMake Build Configuration Tool ## {#cmake}
[CMake][] is the build configuration and makefile generation tool used by KiCad. It is required.
## Bazaar Version Control System ## {#bazaar}
The official source code repository is hosted on [Launchpad][] and requires the [Bazaar][] version
control system in order to create a branch of the latest source. Bazaar is not required if you are
going to build a stable version of KiCad from a source archive.
## GIT Version Control System ## {#git}
If you prefer to use [GIT][] for version control, there is a mirror of the official KiCad
repository on [Github][]. GIT is not required if you are going to build a stable version of
KiCad from a source archive. Please note that the Github mirror is read only. Do not submit
pull requests to Github. Changes should be sent to the KiCad developer's [mailing list][] as
an attached patch with [PATCH] at the beginning of the subject.
## Doxygen Code Documentation Generator ## {#doxygen_section}
The KiCad source code is documented using [Doxygen][] which parses the KiCad source code files
and builds a dependency tree along with the source documentation into HTML. Doxygen is only
required if you are going to build the KiCad documentation.
## SWIG Simplified Wrapper and Interface Generator ## {#swig}
[SWIG][] is used to generate the Python scripting language extensions for KiCad. SWIG is not
required if you are not going to build the KiCad scripting extension.
# Library Dependencies # {#library_dependencies}
This section includes a list of library dependencies required to build KiCad. It does not
include any dependencies of the libraries. Please consult the library's documentation for any
additional dependencies. Some of these libraries are optional depending on you build
configuration. This is not a guide on how to install the library dependencies using you systems
package management tools or how to build the library from source. Consult the appropriate
documentation to perform these tasks.
## wxWidgets Cross Platform GUI Library## {#wxwidgets}
[wxWidgets][] is the graphical user interface (GUI) library used by KiCad. The current minimum
version is 3.0.0. However, 3.0.2 should be used whenever possible as there are some known bugs
in prior versions that can cause problems on some platforms. Please note that there are also
some platform specific patches that must be applied before building wxWidgets from source. These
patches can be found in the [patches folder][] in the KiCad source. These patches are named by
the wxWidgets version and platform name they should be applied against. wxWidgets must be built
with the --with-opengl option. If you installed the packaged version of wxWidgets on your system,
verify that it was built with this option.
## Boost C++ Libraries ## {#boost}
The [Boost][] C++ library is required only if you intend to build KiCad with the system installed
version of Boost instead of the default internally built version. If you use the system installed
version of Boost, version 1.56 or greater is required. Please note there are some platform
specific patches required to build a working Boost library. These patches can be found in the
[patches folder][] in the KiCad source. These patches are named by the platform name they should
be applied against.
## OpenSSL Secure Socket Layer Library ## {#openssl}
The [OpenSSL][] library is only required when the KiCad build is configured with the Github plugin
enabled. See the [KiCad Build Configuration Options](#build_opts)` section for more information.
Please note that KiCad will download and build version 1.0.1e of OpenSSL by default. You should
probably use the version of OpenSSL installed on your system as it will most likely be more up to
date and contain the latest security fixes.
## GLEW OpenGL Extension Wrangler Library ## {#glew}
The [OpenGL Extension Wrangler][GLEW] is an OpenGL helper library used by the KiCad graphics
abstraction library [GAL] and is always required to build KiCad.
## GLUT OpenGL Utility Toolkit Library ## {#glut}
The [OpenGL Utility Toolkit][GLUT] is an OpenGL helper library used by the KiCad graphics
abstraction library [GAL] and is always required to build KiCad.
## Cairo 2D Graphics Library ## {#cairo}
The [Cairo][] 2D graphics library is used as a fallback rendering canvas when OpenGL is no
available and is always required to build KiCad.
## Python Programming Language ## {#python}
The [Python][] programming language is used to provide scripting support to KiCad. It only needs
to be install if the [KiCad scripting](#kicad_scripting) build configuration option is enabled.
## wxPython Library ## {#wxpython}
The [wxPython][] library is used to provide a scripting console for Pcbnew. It only needs to be
installed if the [wxPython scripting](#wxpython_scripting) build configuration option is enabled.
When building KiCad with wxPython support, make sure the version of the wxWidgets library and
the version of wxPython installed on your system are the same. Mismatched versions have been
known to cause runtime issues.
# KiCad Build Configuration Options # {#build_opts}
KiCad has many build options that can be configured to build different options depending on
the availability of support for each option on a given platform. This section documents
these options and their default values.
## Case Sensitivity ## {#case_sensitive_opt}
The KICAD_KEEPCASE option allows you to build KiCad so that the string matching for component
names is case sensitive of case insensitive. This option is enabled by default.
## Advanced Graphics Context ## {#graphics_context_opt}
The USE_WX_GRAPHICS_CONTEXT option replaces wxDC with wxGraphicsContext for graphics rendering.
This option is disabled by default. Warning: the is experimental and has not been maintained
so use at your own risk.
## Graphics Context Overlay ## {#overlay_opt}
The USE_WX_OVERLAY option is used to enable the optional wxOverlay class for graphics rendering
on OSX. This is enabled on OSX by default and disabled on all other platforms.
## Scripting Support ## {#scripting_opt}
The KICAD_SCRIPTING option is used to enable building the Python scripting support into Pcbnew.
This options is disabled by default.
## Scripting Module Support ## {#scripting_mod_opt}
The KICAD_SCRIPTING_MODULES option is used to enable building and installing the Python modules
supplied by KiCad. This option is disabled by default.
## wxPython Scripting Support ## {#wxpython_opt}
The KICAD_SCRIPTING_WXPYTHON option is used to enable building the wxPython interface into
Pcbnew including the wxPython console. This option is disabled by default.
## Build with Static Libraries ## {#static_lib_opt}
The KICAD_BUILD_STATIC option is used to build KiCad with static libraries. This option is
used for OSX builds only and is disabled by default.
## Build with Dynamic Libraries ## {#dynamic_lib_opt}
The KICAD_BUILD_DYNAMIC option is used to build KiCad with dynamic libraries. This option is
used for OSX only and is disabled by default.
## Build with System Boost ## {#boost_opt}
The KICAD_SKIP_BOOST option allow you to use the Boost libraries installed on your system to
be used instead of downloading Boost 1.54 and building a custom version specifically for
building KiCad. It is high recommended that you enable this option on Linux and use Boost
version 1.56 or greater. On other platforms you mileage may vary. This option is disabled
by default.
## OSX Dependency Builder ## {#osx_deps_opt}
The USE_OSX_DEPS_BUILDER option forces the build configuration to download and build the
required dependencies to build KiCad on OSX. This option is not longer maintained and most
likely is broken. Use it at your own peril.
## Github Plugin ## {#github_opt}
The BUILD_GITHUB_PLUGIN option is used to control if the Github plugin is built. This option is
enabled by default.
# Getting the KiCad Source Code ## {#getting_src}
There are several ways to get the KiCad source. If you want to build the stable version you
can down load the source archive from the [KiCad Launchpad][] developers page. Use tar or some
other archive program to extract the source on your system. If you are using tar, use the
following command:
tar -xzf kicad_src_archive.tar.gz
If you are contributing directly to the KiCad project on Launchpad, you can create a local
branch on your machine by using the following command:
bzr branch lp:repo_to_branch
If you prefer to use [GIT][] as you version control system, you can clone the KiCad mirror on
Github using the following command:
git clone https://github.com/KiCad/kicad-source-mirror
Here is a list of source links:
Stable release archive: https://launchpad.net/kicad/4.0/4.0.0-rc1/+download/kicad-4.0.0-rc1.tar.xz
Development branch: https://code.launchpad.net/~kicad-product-committers/kicad/product
Github mirror: https://github.com/KiCad/kicad-source-mirror
# Building KiCad on Linux # {#build_linux}
To perform a full build on Linux, run the following commands:
cd kicad_source_tree
mkdir -p build/release
mkdir build/debug # Optional for debug build.
cd build/release
cmake -DCMAKE_BUILD_TYPE=Release \
-DKICAD_SCRIPTING=ON \
-DKICAD_SCRIPTING_MODULES=ON \
-DKICAD_SCRIPTING_WXPYTHON=ON \
../../
make
sudo make install
If the CMake configuration fails, determine the missing dependencies and install them on your
system. By default, CMake sets the install path on Linux to /usr/local. Use the
CMAKE_INSTALL_PREFIX option to specify a different install path.
# Building KiCad on Windows # {#build_windows}
The preferred Windows build environment is [MSYS2][]. The [MinGW][] build environment is still
supported but it is not recommended because the developer is responsible for building *all* of
the dependencies from source which is a huge and frustrating undertaking. The [MSYS2][] project
provides packages for all of the require dependencies to build KiCad. To setup the [MSYS2][]
build environment, depending on your system download and run either the [MSYS2 32-bit Installer][]
or the [MSYS2 64-bit Installer][]. After the installer is finished, update to the latest
package versions by running the `msys2_shell.bat` file located in the MSYS2 install path and
running the command `pacman -Syu`. If the msys2-runtime package is updated, close the shell
and run `msys2_shell.bat`.
## MSYS2 the Easy Way ## {#msys2_easy}
The easiest way to build KiCad using the [MSYS2][] build environment is to use the KiCad
[PKGBUILD][] provided by the MSYS2 project to build package using the head of the KiCad
development branch. To build the KiCad package, run the `msys2_shell.bat` file located in the
MSYS2 install path and run the following commands:
pacman -S git
mkdir src
cd src
git clone https://github.com/Alexpux/MINGW-packages
cd MinGW-packages/mingw-w64-kicad-git
makepkg-mingw -is
This will download and install all of the build dependencies, clone the KiCad source mirror
from Github, create both 32-bit and 64-bit KiCad packages depending on your MSYS setup, and
install the newly built KiCad packages. Please note that this build process takes a very
long time to build even on a fast system.
## MSYS2 the Hard Way ## {#msys2_hard}
If you do not want to create KiCad packages and prefer the traditional `make && make install`
method of building KiCad, your task is significantly more involved. For 64 bit builds run
the `mingw64_shell.bat` file located in the MSYS2 install path. At the command prompt run the
the following commands:
pacman -S mingw-w64-x86_64-cmake \
mingw-w64-x86_64-doxygen \
mingw-w64-x86_64-gcc \
mingw-w64-x86_64-python2 \
mingw-w64-x86_64-pkg-config \
mingw-w64-x86_64-swig \
mingw-w64-x86_64-boost \
mingw-w64-x86_64-cairo \
mingw-w64-x86_64-glew \
mingw-w64-x86_64-openssl \
mingw-w64-x86_64-wxPython \
mingw-w64-x86_64-wxWidgets
cd kicad-source
mkdir -p build/release
mkdir build/debug # Optional for debug build.
cd build/release
cmake -DCMAKE_BUILD_TYPE=Release \
-G "MSYS Makefiles" \
-DCMAKE_PREFIX_PATH=/mingw64 \
-DCMAKE_INSTALL_PREFIX=/mingw64 \
-DDEFAULT_INSTALL_PATH=/mingw64 \
-DOPENSSL_ROOT_DIR=/mingw64 \
-DKICAD_SKIP_BOOST=ON \
-DKICAD_SCRIPTING=ON \
-DKICAD_SCRIPTING_MODULES=ON \
-DKICAD_SCRIPTING_WXPYTHON=ON \
../../
make install
# Building KiCad on OSX # {#build_osx}
Building on OSX is challenging at best. It typically requires building dependency libraries
that require patching in order to work correctly. For more information on the complexities of
building KiCad on OSX, see the [OSX bundle build scripts][].
Download the wxPython source and build using the following commands:
cd path-to-wxwidgets-src
patch -p0 < path-to-kicad-src/patches/wxwidgets-3.0.0_macosx.patch
patch -p0 < path-to-kicad-src/wxwidgets-3.0.0_macosx_bug_15908.patch
patch -p0 < path-to-kicad-src/patches/wxwidgets-3.0.0_macosx_soname.patch
patch -p0 < path-to-kicad-src/patches/wxwidgets-3.0.2_macosx_yosemite.patch
patch -p0 < path-to-kicad-src/patches/wxwidgets-3.0.0_macosx_scrolledwindow.patch
mkdir build
cd build
export MAC_OS_X_VERSION_MIN_REQUIRED=10.7
../configure \
--prefix=`pwd`/../wx-bin \
--with-opengl \
--enable-aui \
--enable-utf8 \
--enable-html \
--enable-stl \
--with-libjpeg=builtin \
--with-libpng=builtin \
--with-regex=builtin \
--with-libtiff=builtin \
--with-zlib=builtin \
--with-expat=builtin \
--without-liblzma \
--with-macosx-version-min=10.7 \
--enable-universal-binary=i386,x86_64 \
CC=clang \
CXX=clang++
Build KiCad using the following commands:
cd kicad-source
mkdir -p build/release
mkdir build/debug # Optional for debug build.
cd build/release
cmake -DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.7 \
-DwxWidgets_CONFIG_EXECUTABLE=path-to-wx-install/bin/wx-config \
-DKICAD_SCRIPTING=ON \
-DKICAD_SCRIPTING_MODULES=ON \
-DKICAD_SCRIPTING_WXPYTHON=ON \
-DPYTHON_EXECUTABLE=path-to-python-exe/python \
-DPYTHON_SITE_PACKAGE_PATH=wx/wx-bin/lib/python2.7/site-packages \
-DCMAKE_INSTALL_PREFIX=../bin \
-DCMAKE_BUILD_TYPE=Release \
../../
make
make install
# Known Issues # {#known_issues}
There are some known issues that are platform and/or dependencie specific. This section provides
a list of the currently known issues when building KiCad.
## Boost C++ Library Issues ## {#boost_issue}
As of version 5 of [GNU GCC][], using the default configuration of downloading, patching, and
building of Boost 1.54 will cause the KiCad build to fail. Therefore a newer version of Boost
must be used to build KiCad. If your system has Boost 1.56 or greater installed, you job is
straight forward. Configure your KiCad build using `-DKICAD_SKIP_BOOST=ON`. If your system
does not have Boost 1.56 or greater installed, you will have to download and [build Boost][]
from source. If you are building Boost on windows using [MinGW][] you will have to apply the
Boost patches in the KiCad source [patch folder][].
[download]: http://kicad-pcb.org/download/
[KiCad website]: http://kicad-pcb.org/
[KiCad Launchpad]: https://launchpad.net/kicad
[GNU GCC]: https://gcc.gnu.org/
[Clang]: http://clang.llvm.org/
[CMake]: https://cmake.org/
[Launchpad]: https://code.launchpad.net/~kicad-product-committers/kicad/product
[Bazaar]: http://bazaar.canonical.com/en/
[GIT]: https://git-scm.com/
[Github]: https://github.com/KiCad/kicad-source-mirror
[Doxygen]: http://www.stack.nl/~dimitri/doxygen/
[mailing list]: https://launchpad.net/~kicad-developers
[SWIG]: http://www.swig.org/
[wxWidgets]: http://wxwidgets.org/
[patches folder]: http://bazaar.launchpad.net/~kicad-product-committers/kicad/product/files/head:/patches/
[Boost]: http://www.boost.org/
[OpenSSL]: https://www.openssl.org/
[GLEW]: http://glew.sourceforge.net/
[GLUT]: https://www.opengl.org/resources/libraries/glut/
[Cairo]: http://cairographics.org/
[Python]: https://www.python.org/
[wxPython]: http://wxpython.org/
[MSYS2]: http://msys2.github.io/
[MSYS2 32-bit Installer]: http://repo.msys2.org/distrib/i686/msys2-i686-20150916.exe
[MSYS2 64-bit Installer]: http://repo.msys2.org/distrib/x86_64/msys2-x86_64-20150916.exe
[PKGBUILD]: https://github.com/Alexpux/MINGW-packages/blob/master/mingw-w64-kicad-git/PKGBUILD
[OSX bundle build scripts]:http://bazaar.launchpad.net/~adamwolf/+junk/kicad-mac-packaging/files
[MinGW]: http://mingw.org/
[build Boost]: http://www.boost.org/doc/libs/1_59_0/more/getting_started/index.html
+5 -78
View File
@@ -1,4 +1,4 @@
# Road Map #
# Road Map # {#mainpage}
This document is the KiCad Developer's road map document. It is a living
document that should be maintained as the project progresses. The goal of
@@ -222,7 +222,7 @@ provided by version 3 can be utilized.
- wxWidgets 3 is widely available on Linux distributions.
**Status:**
- Build now requires 3.0.0 or greater.
- No progress
## Linux Printing Improvements ## {#linux_print}
**Goal:**
@@ -428,20 +428,6 @@ Provide a method of passing information to other tools via the net list.
**Status:**
- No progress.
## Net Highlighting ## {#sch_net_highlight}
**Goal:**
Highlight wires, buses, and junctions when corresponding net in Pcbnew is selected.
**Task:**
- Add communications link to handle net selection from Pcbnew.
- Implement highlight algorithm for net objects.
- Highlight objects connected to net selected in Pcbnew.
**Dependencies:**
- [GAL port, maybe](#sch_gal).
**Status:**
- No progress.
# CvPcb: Footprint Association Tool # {#cvpcb}
This section covers the source code of the footprint assignment tool CvPcb.
@@ -536,7 +522,7 @@ Add features such as matched length and microwave tools to the P&S router.
- None
**Status:**
- Match trace length work in progress.
- No progress.
## Layer Improvements ## {#pcb_layers}
**Goal:**
@@ -553,7 +539,7 @@ Increase the number of usable technical and user defined layers in Pcbnew.
- None
**Status:**
- Work complete on 32 copper and 32 technical layers is complete.
- No progress.
## Pin and Part Swapping ## {#pcb_drc}
**Goal:**
@@ -620,7 +606,6 @@ Create additional DRC tests for improved error checking.
- Remove floating point code from clearance calculations to prevent rounding
errors.
- Add checks for component, silk screen, and mask clearances.
- Add checks for keep out zones.
- Remove DRC related limitations such as no arc or text on copper layers.
- Add option for saving and loading DRC options.
@@ -630,49 +615,6 @@ Create additional DRC tests for improved error checking.
**Progress:**
- Planning
## Segment End Point Snapping. ## {#segment_snapping}
**Goal:**
It is not uncommon for board edge segment end points to inadvertently not
be closed causing issues for the 3D viewer and exporting to different file
formats due the board outline not being a fully enclosed polygon. This
feature would add segment end snapping support to allow the board outline
to be fully enclosed. This feature would only need to be supported by the
GAL rendering.
**Tasks**
- Mark board edge segment ends with a drag indicator to make it visible to the
user that the segment end does not have an endpoint with any other board edge
segment.
- Allow the user to smap the unconnected segment end to the nearest segment end
point.
- Automatically connect unconnected segments with and additional segment when
opening the 3D viewer or exporting the board to another format. Warn the
user that an addition segment has be added and should be verified.
**Dependencies:**
- None
**Progress:**
- Initial discussion.
## Keepout Zones. ## {#keepout_zones}
**Goal:**
Add support for keepout zones on boards and footprints.
**Task:**
- Add keepout support to zone classes.
- Add keepout zone support to board editor.
- Add keepout zone support to library editor.
**Dependencies:**
- [DRC Improvements.](#drc_improvements)
**Progress:**
- Planning
## Gerber File Attributes ## {#gerber_attributes}
**Goal:**
@@ -689,22 +631,7 @@ document for more information.
- None
**Progress:**
- Done both in Pcbnew and Gerbview.
## Net Highlighting ## {#pcb_net_highlight}
**Goal:**
Highlight rats nest links and/or traces when corresponding net in Eeschema is selected.
**Task:**
- Add communications link to handle net selection from Eeschema.
- Implement highlight algorithm for objects connected to the selected net.
- Highlight objects connected to net selected in Eeschema
**Dependencies:**
- None.
**Status:**
- No progress.
- Under investigation.
# GerbView: Gerber File Viewer # {#gerbview}
@@ -1,80 +0,0 @@
# Stable Release Policy #
This document defines the project requirements that must be satisfied in order to create a new
stable release of the KiCad project. It is designed to be a reference for developers and user's
so that both groups expectations are understood. This document is only to be modified by the
project leader or at the request of the project leader. It should be noted that this policy is
not cast in stone and at any time in the future, should the decision be made by the project at
large that it can be revised to suit the ongoing needs of the project and it's users.
The current release policy is to support the concept of a lightweight stable release. The goal
is to provide regular stable releases of KiCad without the burden of trying to provide long term
support of a full stable release branch. Therefore, once a new release is created, the only
patches that will be made to the stable release branch will be for bugs that cause KiCad to crash
or possible corruption and/or loss of data. No other changes from the current development branch
will be backported to the last stable release by the project.
[TOC]
# Stable Release Interval # {#stable_release_interval}
The criteria required for new stable releases is based on the developers decision that enough
new features and/or improvements have been made to the current development branch to justify a
new stable release. This decision is completely discretionary and can be proposed at any time
by any developer on the KiCad developers mailing list. Once a request for a new stable release
is made, a consensus must be reached by the primary developers to proceed with the release with
the final decision and announcement being made by the project leader.
# Feature Freeze # {#feature_freeze}
Once the announcement has been made that a new stable release is in effect, the current
development branch is frozen. No new features or potentially disruptive core code changes can
be committed with out approval of the primary developers and/or the project leader.
# Bug Fixing # {#bug_fixing}
After the development branch has been frozen, work will continue to fix bugs reported against
the development branch. Bugs will be prioritized based on their severity. All bugs that cause
KiCad to crash or cause loss and/or corruption of data must be fixed. All other bugs must be
evaluated to see if they fit into the scope of the stable release. All bugs that fit into the
scope of the stable release will be tagged and must be fixed. All other bugs will be tagged for
the next stable release and fixed when it is convenient. Once the stable release is officially
announced, the bugs tagged as "Fix Committed" that are relevant to the stable release will be
changed to "Fix Released".
# User Documentation # {#user_docs}
The user documentation will be updated to reflect the current changes in the code. This includes
all new features, any behavioral changes to existing features, and all screen shots as required.
Completion of the English version of the user documentation is minimum that is required for
release. Foreign language translations can be released at any time as the become available.
# Stable Release Series Branch # {#stable_branch}
Once the primary developers decide that the stable release criteria has been met, a new series
branch will be created from the current product branch on Launchpad. At this time the freeze
will be removed from the product branch and normal development can resume. The stable release
version will be incremented from the previous stable release and tagged in the stable release
branch build configuration.
# System Installers # {#system_installers}
To proved the best user experience for platforms that do not have package managers, full system
installers will be provided. Currently this only pertains to Windows and OSX. The full system
installers will include all KiCad binary files, all binary library dependencies, user
documentation, component libraries, 3D model libraries, demo project files, and project template
files. Optionally, the footprint libraries can be included for users who prefer not us use the
GitHub plugin.
# Source Archives # {#source_archives}
To provide a convenient method for system packagers to build KiCad from known stable sources,
source archives in the most common formats along with the resulting md5sum checksum will be
added to either the KiCad developer's site on Launchpad or the main website at www.kicad-pcb.org.
# Stable Release Announcement # {#announcement}
Once all of the above tasks have been completed, the project leader will post an announcement on
the developers mailing list and the Launchpad site. This announcement should include a list of
new features and improvements made since the previous stable release.
@@ -1,5 +0,0 @@
#!/bin/bash
pandoc -f markdown_mmd -t html interactive_router.mmd > interactive_router.html
pandoc -f markdown_mmd -t latex interactive_router.mmd > tmp.tex
pdflatex interactive_router.tex
@@ -1,73 +0,0 @@
# Interactive Router #
The Interactive Router lets you quickly and efficient route your PCBs by shoving off or walking around items on the PCB that collide with the trace you are currently drawing.
Following modes are supported:
- **Shove**, attempting to push and shove all items colliding with the currently routed track.
- **Walk around**, trying to avoid obstacles by hugging/walking around them.
- **Highlight collisions** which highlights all violating objects with a nice, shiny green color and shows violating clearance regions.
## Setting up ##
Before using the Interactive Router, please set up these two things:
- Clearance settings. To set the clearances, open the *Design Rules* dialog and make sure at least the default clearance
value looks sensible.
- Enable OpenGL mode by selecting *View->Switch canvas to OpenGL* menu option or pressing **F11**.
![Screenshot](pictures/opengl_menu.png)
## Laying out tracks ##
To activate the router tool press the *Interactive Router* button ![Interactive Router Button](pictures/route_icon.png) or the **X** key.
The cursor will turn into a cross and the tool name, will appear in the status bar.
To start a track, click on any item (a pad, track or a via) or press the **X** key again hovering the mouse over that item.
The new track will use the net of the starting item. Clicking or pressing **X** on empty PCB space starts a track with no net assigned.
Move the mouse to define shape of the track. The router will try to follow mouse trail, hugging unmovable obstacles
(such as pads) and shoving colliding traces/vias, depending on the mode. Retreating mouse cursor will cause the shoved items to spring back
to their former locations.
Clicking on a pad/track/via in the same net finishes routing. Clicking in empty space fixes the segments routed so far and continues routing the trace.
In order to stop routing and undo all changes (shoved items, etc.), simply press **Esc**.
Pressing **V** or selecting *Place Through Via* from the context menu while routing a track attaches a via at the end of the trace being routed.
Pressing **V** again disables via placement. Clicking in any spot establishes the via and continues routing.
Pressing **/** or selecting *Switch Track Posture* from the context menu toggles the direction of the initial track segment between straight or diagonal.
**Note**: By default, the router snaps to centers/axes of the items. Snapping can be disabled by holding **Shift** while routing or selecting items.
## Setting track widths and via sizes ##
There are several ways to pre-select a track width/via size or to change it during routing:
- Use standard Kicad shortcuts.
- Press **W** or select *Custom Track Width* from the context menu to type in a custom width/via size.
- Pick a predefined width from the *Select Track Width* sub-menu of the context menu.
- Select *Use the starting track width* in the *Select Track Width* menu to pick the width from the start item (or the traces already connected to it).
## Dragging ##
The router can drag track segments, corners and vias. To drag an item, click on it with **Ctrl** key pressed, hover the mouse and press **G** or select *Drag Track/Via* from the context menu.
Finish dragging by clicking again or abort by pressing *Esc*.
## Options ##
The router behavior be configured by pressing *E* or selecting *Routing Options* from the context menu. It opens a window like the one below:
![Screenshot](pictures/router_options.png)
The options are:
- **Mode** - select how the router handles DRC violation (shoving, walking around, etc.)
- **Shove vias** - when disabled, vias are treated as un-movable objects and hugged instead of shoved.
- **Jump over obstacles** - when enabled, the router tries to move colliding traces behind solid obstacles (e.g. pads) instead of "reflecting" back the collision
- **Remove redundant tracks** - removes loops while routing (e.g. if the new track ensures same connectivity as an already existing one, the old track is removed). Loop removal works locally (only between the start and end of the currently routed trace).
- **Automatic neckdown** - when enabled, the router tries to break out pads/vias in a clean way, avoiding acute angles and jagged breakout traces.
- **Smooth dragged segments** - when enabled, the router attempts to merge several jagged segments into a single straight one (dragging mode).
- **Allow DRC violations** (*Highlight collisions* mode only) - allows to establish a track even if is violating the DRC rules.
- **Optimizer effort** - defines how much time the router shall spend optimizing the routed/shoved traces. More effort means cleaner routing (but slower), less effort means faster routing but somewhat jagged traces.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 547 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

+11
View File
@@ -0,0 +1,11 @@
So, finally we've got an integrated interactive, push-and-sometimes-shove router, although with a very limited user interface:
- Edit->Interactive router launches the tool,
- while routing: 'V' key places a via,
- '+' and '-' keys cycle through available layers,
- '/' key switches track posture.
Via/track dimensions are taken from the netclasses.
There are no other options available for the time being - promise to add them soon :)
Tom
+47 -11
View File
@@ -1,20 +1,56 @@
--== notes about wxWidgets problems ==--
Last Revised: 02-jul-2015
Last Revised: 28-Feb-2010
Kicad needs wxWidgets, the multi platform G.U.I toolkit.
use *only* wxWidgets
>= 3.0.1 On Windows
>= 3.0.2 on Linux (prevision versions have bugs which crash Kicad)
>= 3.0.2 on OSX (which need patches: see patches/wxwidgets-3.0.0_macosx_xxx)
Kicad needs wxWidgets, the multi platform G.U.I.
Known problems:
wxMSW:
use *only* wxWidgets >= 3.0
wxGTK
Use wxWidgets 2.8.10 or later
Linux and macOSX
- Printing problems (all version).
Note old versions of wxWidgets give *very ugly results*
(poor printing resolution set to 72ppi)
So use a very recent version (>= 2.8.10 (that also solve other bugs)
wxWidgets patch:
wxWidgets 2.9.1 (all platforms)
Has a problem when using the built in string to double conversion:
In countries using a comm instead of a point as floating number separator
after calling this conversion function, the comma is changed in point.
(Happens after reading a parameter stored in a wxConfig structure, if this
parameter is a double)
Workaround:
Use a version >= 2.9.3
*************************************************************************************
wxGTK version: All before wxWidgets 3.0
*************************************************************************************
Patch for printing wide traces that were shown with missing rounded end caps.
Without this patch, printing boards and schematics under Linux, and perhaps OSX
gives ugly drawings.
wxGTK-2.8.11/src/generic/dcpsg.cpp
search for:
line 1636
PsPrint( "%%EndProlog\n" );
Add after this line:
PsPrint("%%BeginSetup\n");
PsPrint( "1 setlinecap\n" );
PsPrint("%%EndSetup\n");
Known bug on Windows:
Postscript printers print tracks like thin line.
Postscript printers print tracks like tin line.
It happens only for PS drivers, and PDF printer.
Other drivers (PCL for instance) work fine,
so it is unlikely a bug inside Kicad/wxWidgets
On 3.0.2 Window version 64 bits:
The mirror mode gives a blank sheet.
This is a bug in wxWidgets 3.0.2
wxWidgets 3.0.2 must be patched (see patches/wxWidgets-3.0.2-msw-dc-orientation-fix.patch) and rebuilt.
+31 -6
View File
@@ -324,6 +324,22 @@ INLINE_SIMPLE_STRUCTS = NO
TYPEDEF_HIDES_STRUCT = NO
# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
# determine which symbols to keep in memory and which to flush to disk.
# When the cache is full, less often used symbols will be written to disk.
# For small to medium size projects (<1000 input files) the default value is
# probably good enough. For larger projects a too small cache size can cause
# doxygen to be busy swapping symbols to and from disk most of the time
# causing a significant performance penalty.
# If the system has enough physical memory increasing the cache will improve the
# performance by keeping more symbols in memory. Note that the value works on
# a logarithmic scale so increasing the size by one will roughly double the
# memory usage. The cache size is given by this formula:
# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
# corresponding to a cache size of 2^16 = 65536 symbols.
SYMBOL_CACHE_SIZE = 4
# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be
# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given
# their name and scope. Since this can be an expensive process and often the
@@ -645,10 +661,7 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
INPUT = Documentation/development/coding-style-policy.md \
Documentation/development/stable-release-policy.md \
Documentation/development/road-map.md \
Documentation/development/compiling.md \
INPUT = Documentation/development/road-map.md \
kicad \
pcbnew \
cvpcb \
@@ -692,7 +705,7 @@ RECURSIVE = YES
# Note that relative paths are relative to the directory from which doxygen is
# run.
EXCLUDE = polygon/clipper.cpp
EXCLUDE = include/boost
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
@@ -1213,7 +1226,7 @@ MATHJAX_EXTENSIONS =
# typically be disabled. For large projects the javascript based search engine
# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
SEARCHENGINE = YES
SEARCHENGINE = NO
# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
# implemented using a PHP enabled web server instead of at the web client
@@ -1410,6 +1423,18 @@ GENERATE_XML = NO
XML_OUTPUT = xml
# The XML_SCHEMA tag can be used to specify an XML schema,
# which can be used by a validating XML parser to check the
# syntax of the XML files.
XML_SCHEMA =
# The XML_DTD tag can be used to specify an XML DTD,
# which can be used by a validating XML parser to check the
# syntax of the XML files.
XML_DTD =
# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
# dump the program listings (including syntax highlighting
# and cross-referencing information) to the XML output. Note that
+87 -35
View File
@@ -24,43 +24,87 @@ Installation from binary packages
Installation from binary packages for Windows
---------------------------------------------
The KiCad binary archive can be installed anywhere on the system that as long as the user
has write privileges.
KiCad can be installed in 'C:\kicad', 'D:\kicad', 'C:\Program files\kicad',
'D:\Program files\kicad'.
You can create a shortcut to '${prefix}\bin\kicad.exe' where ${prefix} is the install path.
For example, for an installation in the folder 'C:\kicad', unzip KiCad
packages:
kicad-{version}.zip
kicad-doc-{version}.zip
kicad-library-{version}.zip
to the folder 'C:\kicad'.
The main program is the project manager (kicad.exe) and from it you can run
the other programs (schematic editor - eeschema, pcb editor - pcbnew,
utilities: cvpcb and gerbview).
You can create a shortcut to 'C:\kicad\bin\kicad.exe'.
Installation from binary packages for Linux
-------------------------------------------
KiCad can be installed in '/usr' or '/usr/local'. You must have "root" access for installation.
KiCad can be installed in '/usr' or '/usr/local'.
cd /
tar -xjf kicad-{version}.tbz2
tar -xjf kicad-doc-{version}.tbz2
tar -xjf kicad-library-{version}.tbz2
You must have "root" access for installation.
The main program is '/usr/bin/kicad'.
cd /
tar -xjf kicad-{version}.tbz2
tar -xjf kicad-doc-{version}.tbz2
tar -xjf kicad-library-{version}.tbz2
The main program is '/usr/bin/kicad'.
Linux and Windows KiCad install tree
-------------------------------------
Windows KiCad tree
------------------
${prefix}/bin - Binaries (executable files).
${prefix}/share/doc/kicad/ - Various documentation.
${prefix}/share/doc/kicad/help - Interactive help.
${prefix}/share/kicad/demos - Sample schematics and printed boards.
${prefix}/share/kicad/internat - Dictionaries for interface localization.
${prefix}/share/kicad/library - Interface localization files.
${prefix}/share/kicad/modules - Module libraries for printed boards.
${prefix}/share/kicad/modules/packages3d - 3D component models (.wrl and .wings format).
kicad/bin - Binaries (executable files).
kicad/doc - Various documentation.
kicad/doc/help - Interactive help.
kicad/share/demos - Sample schematics and printed boards.
kicad/share/internat - Interface localization files.
kicad/share/library - Libraries for schematic.
kicad/share/modules - Module libraries for printed boards.
kicad/share/modules/packages3d - 3D component models (.wrl and .wings format).
KiCad searches for the libraries, templates, 3D models, etc. bin/../share.
Files '*.mod' are libraries, and files '*.brd' are printed boards you can
view with pcbnew.
Files *.brd show the existing modules (and 3D shapes) in libraries.
Linux KiCad tree
----------------
KiCad can use the Windows tree or the below tree.
When Kicad is coming from Linux distribution, the tree is:
/usr/bin - Binaries (executable files).
/usr/share/doc/kicad/ - Various documentation.
/usr/share/doc/kicad/help - Interactive help.
/usr/share/kicad/demos - Sample schematics and printed boards.
/usr/share/kicad/internat - Dictionaries for interface localization.
/usr/share/kicad/library - Interface localization files.
/usr/share/kicad/modules - Module libraries for printed boards.
/usr/share/kicad/modules/packages3d - 3D component models (.wrl and .wings format).
if KiCad does not found its files in usr/share, the search is made in
/usr/local/kicad
and kicad uses the same tree as the Windows KiCad tree above
*** When KiCad comes from .tgz archive from http://iut-tice.ujf-grenoble.fr/cao/,
it must me installed in /usr/local and uses the Windows tree ***.
Files '*.mod' are the libraries, and files '*.brd' are printed boards you can
view with pcbnew.
Files *.brd show the existing modules (and 3D shapes) in libraries.
Warning:
Do not change the KiCad tree, or the location of binary files. Otherwise
KiCad may not be able to find some or all of its required files.
Do not change the KiCad tree, or the location of binary files,
else KiCad will not be able to find its required files (configuration,
libraries, etc.).
Mac OS X KiCad tree
-------------------
@@ -78,35 +122,35 @@ User files can be the same as the system wide files but only inside the users ho
$HOME/Library/Application Support/kicad
Warning:
These paths are hardcoded into KiCad, if you put them somewhere else KiCad will not find
them when a new project is created.
These paths are hardcoded into KiCad, if you put them somewhere else KiCad will not find them when a new
project is created.
Installation from source code
-----------------------------
Some dependencies must be satisfied for the correct installation of KiCad:
under Linux:
wxWidgets >= 2.8.11 http://www.wxwidgets.org/
(needs to be compiled with unicode support)
under Windows:MacOSX
wxWidgets >= 2.9.4 http://www.wxwidgets.org/
wxWidgets >= 3.0.0 http://www.wxwidgets.org/
CMake >= 2.8.4 http://www.cmake.org/
CMake >= 2.8.1 http://www.cmake.org/
Boost C++ Libraries:
files used by kicad are autmatically downloaded and patched if needed
from boost site ( http://www.boost.org/ )
OpenGL
Linux: Mesa 3D Graphics Library http://www.mesa3d.org/
Windows: built-in
Zlib Compression Library http://www.zlib.net/
In source-tree-build are mostly unwanted, so make a subdir called "build" and
In source-tree-build are mostly unwanted, so make a subdir called "build" and
change to it.
Call cmake with the path to KiCad. E.g., when your build-folder is "build"
Call cmake with the path to KiCad. E.g., when your build-folder is "build"
within source-tree, type "cmake ../".
Now your system get checked if it is able compiling KiCad and cmake generates
Now your system get checked if it is able compiling KiCad and cmake generates
the Makefiles.
After calling cmake just type "make" and build begins.
@@ -141,6 +185,14 @@ Required for Windows platform.
-DwxWidgets_USE_DEBUG=ON
Can be used only with -DCMAKE_BUILD_TYPE=Debug
-DwxWidgets_USE_STATIC=ON
For building statically linked executables. Can be used only if wxWidgets
configured and builded with "--enable-monolithic --disable-shared" parameters.
-DwxWidgets_USE_STATIC=OFF
For building dinamically linked executables. Can be used only if wxWidgets
configured and builded with "--disable-monolithic --enable-shared" parameters.
-DKICAD_KEEPCASE=ON
Build the KiCad with no component name conversion to uppercase (if you want your
ADuC.../Si.../bq... components named as just so).
@@ -155,7 +207,7 @@ When more output is wanted use this cmake parameter or call "make VERBOSE=1".
Extra CFLAGS and linker flags
-----------------------------
If you require extra flags for compiler and linker you may give them via
If you require extra flags for compiler and linker you may give them via
environment variables
"CXXFLAGS" (c++ compiler)
"LDFLAGS" (for linker)
+12 -11
View File
@@ -60,17 +60,18 @@ PCBNew
*) Paste (module ...) from clipboard into module editor.
Dick's Final TODO List:
======================
*) Milestone B of Modular KiCad Blueprint:
* Put SEARCH_STACK::LastVisitedPath() out of its misery.
* Combine CVPCB into PCBNEW.
*) Milestone C of Modular KiCad Blueprint
* SWIG class KIWAY, PROJECT, and KIWAY_MGR and fill out KIWAY_MGR as needed.
* Implement PROJECT::Substitute().
* Other stuff in blueprint milestone.
*) Get licensing cleaned up.
*) DLL-ization of pcbnew & eeschema
http://www.eevblog.com/forum/open-source-kicad-geda/seriously-irritated-with-the-library-editor!/
https://blueprints.launchpad.net/kicad/+spec/modular-kicad
Issues as a result of minimal testing:
* If eeschema launched from C++ project manager and does not find all libraries,
then the dialog showing the names of missing libraries is shown twice.
* Clear all/some? retained strings on project change.
* Clear the FP_LIB_TABLE when the last KIWAY_PLAYER using it is closed.
+18 -41
View File
@@ -3,7 +3,6 @@ include_directories( BEFORE ${INC_BEFORE} )
include_directories(
../potrace
../common
../polygon
${INC_AFTER}
)
@@ -21,17 +20,6 @@ set_source_files_properties( bitmap2cmp_gui.cpp PROPERTIES
COMPILE_DEFINITIONS "COMPILING_DLL"
)
if( APPLE )
# setup bundle
set( BITMAP2COMPONENT_RESOURCES bitmap2component.icns )
set_source_files_properties( "${CMAKE_CURRENT_SOURCE_DIR}/bitmap2component.icns" PROPERTIES
MACOSX_PACKAGE_LOCATION Resources
)
set( MACOSX_BUNDLE_ICON_FILE bitmap2component.icns )
set( MACOSX_BUNDLE_GUI_IDENTIFIER org.kicad-pcb.kicad )
set( MACOSX_BUNDLE_NAME bitmap2component )
endif()
add_executable( bitmap2component WIN32 MACOSX_BUNDLE
${BITMAP2COMPONENT_SRCS}
${BITMAP2COMPONENT_RESOURCES}
@@ -45,35 +33,10 @@ target_link_libraries( bitmap2component
potrace
)
if( APPLE )
set_target_properties( bitmap2component PROPERTIES
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist
)
# put individual bundle outside of main bundle as a first step
# will be pulled into the main bundle when creating main bundle
install( TARGETS bitmap2component
DESTINATION ${KICAD_BIN}
COMPONENT binary
)
install( CODE "
# override default embedded path settings
${OSX_BUNDLE_OVERRIDE_PATHS}
# do all the work
include( BundleUtilities )
fixup_bundle( ${KICAD_BIN}/bitmap2component.app/Contents/MacOS/bitmap2component
\"\"
\"\"
)
" COMPONENT Runtime
)
else()
install( TARGETS bitmap2component
DESTINATION ${KICAD_BIN}
COMPONENT binary
)
endif()
install( TARGETS bitmap2component
DESTINATION ${KICAD_BIN}
COMPONENT binary
)
if( false ) # linker map with cross reference
@@ -89,3 +52,17 @@ if( MINGW )
else()
set( BITMAP2COMPONENT_RESOURCES bitmap2component.rc )
endif()
if( APPLE )
set( BITMAP2COMPONENT_RESOURCES bitmap2component.icns )
set_source_files_properties( "${CMAKE_CURRENT_SOURCE_DIR}/bitmap2component.icns" PROPERTIES
MACOSX_PACKAGE_LOCATION Resources
)
set( MACOSX_BUNDLE_ICON_FILE bitmap2component.icns )
set( MACOSX_BUNDLE_GUI_IDENTIFIER org.kicad-eda.bitmap2component )
set_target_properties( bitmap2component PROPERTIES
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist
)
endif()
+1 -1
View File
@@ -13,7 +13,7 @@
<key>CFBundleIconFile</key>
<string>bitmap2component.icns</string>
<key>CFBundleIdentifier</key>
<string>org.kicad-pcb.bitmap2component</string>
<string>org.kicad-eda.bitmap2component</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLongVersionString</key>
+84 -122
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 1992-2010 jean-pierre.charras
* Copyright (C) 1992-2015 Kicad Developers, see change_log.txt for contributors.
* Copyright (C) 1992-2010 Kicad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -29,10 +29,8 @@
#include <wxstruct.h>
#include <confirm.h>
#include <gestfich.h>
#include <wildcards_and_files_ext.h>
#include <bitmap2cmp_gui_base.h>
#include <bitmap2component.h>
#include <potracelib.h>
#include <bitmap_io.h>
@@ -43,7 +41,6 @@
#include <kiway.h>
#include <kiface_i.h>
#define KEYWORD_FRAME_POSX wxT( "Bmconverter_Pos_x" )
#define KEYWORD_FRAME_POSY wxT( "Bmconverter_Pos_y" )
#define KEYWORD_FRAME_SIZEX wxT( "Bmconverter_Size_x" )
@@ -51,15 +48,13 @@
#define KEYWORD_LAST_INPUT_FILE wxT( "Last_input" )
#define KEYWORD_LAST_OUTPUT_FILE wxT( "Last_output" )
#define KEYWORD_LAST_FORMAT wxT( "Last_format" )
#define KEYWORD_LAST_MODLAYER wxT( "Last_modlayer" )
#define KEYWORD_BINARY_THRESHOLD wxT( "Threshold" )
#define KEYWORD_BW_NEGATIVE wxT( "Negative_choice" )
#define DEFAULT_DPI 300 // Default resolution in Bit per inches
extern int bitmap2component( potrace_bitmap_t* aPotrace_bitmap, FILE* aOutfile,
OUTPUT_FMT_ID aFormat, int aDpi_X, int aDpi_Y,
BMP2CMP_MOD_LAYER aModLayer );
int aFormat, int aDpi_X, int aDpi_Y );
/**
* Class BM2CMP_FRAME_BASE
@@ -68,19 +63,19 @@ extern int bitmap2component( potrace_bitmap_t* aPotrace_bitmap, FILE* aOutfile,
class BM2CMP_FRAME : public BM2CMP_FRAME_BASE
{
private:
wxImage m_Pict_Image;
wxBitmap m_Pict_Bitmap;
wxImage m_Greyscale_Image;
wxBitmap m_Greyscale_Bitmap;
wxImage m_NB_Image;
wxBitmap m_BN_Bitmap;
wxSize m_imageDPI; // The initial image resolution. When unknown,
wxImage m_Pict_Image;
wxBitmap m_Pict_Bitmap;
wxImage m_Greyscale_Image;
wxBitmap m_Greyscale_Bitmap;
wxImage m_NB_Image;
wxBitmap m_BN_Bitmap;
wxSize m_imageDPI; // The initial image resolution. When unknown,
// set to DEFAULT_DPI x DEFAULT_DPI per Inch
wxString m_BitmapFileName;
wxString m_ConvertedFileName;
wxSize m_frameSize;
wxPoint m_framePos;
wxConfigBase* m_config;
wxString m_BitmapFileName;
wxString m_ConvertedFileName;
wxSize m_frameSize;
wxPoint m_framePos;
wxConfig* m_config;
public:
BM2CMP_FRAME( KIWAY* aKiway, wxWindow* aParent );
@@ -97,15 +92,17 @@ private:
void OnExport( wxCommandEvent& event );
/**
* Generate a schematic library which contains one component:
* Generate a schematic library which comtains one component:
* the logo
*/
void OnExportEeschema();
/**
* Generate a module in S expr format
* Depending on the option:
* Legacy format: generate a module library which comtains one component
* New kicad_mod format: generate a module in S expr format
*/
void OnExportPcbnew();
void OnExportPcbnew( bool aLegacyFormat );
/**
* Generate a postscript file
@@ -124,24 +121,22 @@ private:
void OnResolutionChange( wxCommandEvent& event );
// called when texts controls which handle the image resolution
// lose the focus, to ensure the right values are displayed
// lose the focus, to ensure the rigyht vaules are displayed
// because the m_imageDPI are clipped to acceptable values, and
// the text displayed could be differ during text edition
// the text displayed could be differ duringa text edition
// We are using ChangeValue here to avoid generating a wxEVT_TEXT event.
void UpdateDPITextValueX( wxMouseEvent& event )
{
m_DPIValueX->ChangeValue( wxString::Format( wxT( "%d" ), m_imageDPI.x ) );
}
void UpdateDPITextValueY( wxMouseEvent& event )
{
m_DPIValueY->ChangeValue( wxString::Format( wxT( "%d" ), m_imageDPI.y ) );
}
void NegateGreyscaleImage( );
void ExportFile( FILE* aOutfile, OUTPUT_FMT_ID aFormat );
void ExportFile( FILE* aOutfile, int aFormat );
void updateImageInfo();
void OnFormatChange( wxCommandEvent& event );
};
@@ -151,7 +146,7 @@ BM2CMP_FRAME::BM2CMP_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
SetKiway( this, aKiway );
int tmp;
m_config = GetNewConfig( Pgm().App().GetAppName() );
m_config = new wxConfig();
m_config->Read( KEYWORD_FRAME_POSX, & m_framePos.x, -1 );
m_config->Read( KEYWORD_FRAME_POSY, & m_framePos.y, -1 );
m_config->Read( KEYWORD_FRAME_SIZEX, & m_frameSize.x, -1 );
@@ -165,26 +160,8 @@ BM2CMP_FRAME::BM2CMP_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
if( m_config->Read( KEYWORD_BW_NEGATIVE, &tmp ) )
m_rbOptions->SetSelection( tmp ? 1 : 0 );
if( m_config->Read( KEYWORD_LAST_FORMAT, &tmp ) )
{
if( tmp < 0 || tmp > FINAL_FMT )
tmp = PCBNEW_KICAD_MOD;
m_radioBoxFormat->SetSelection( tmp );
}
if( tmp == PCBNEW_KICAD_MOD )
m_radio_PCBLayer->Enable( true );
else
m_radio_PCBLayer->Enable( false );
if( m_config->Read( KEYWORD_LAST_MODLAYER, &tmp ) )
{
if( (unsigned) tmp > MOD_LYR_FINAL ) // Out of range
m_radio_PCBLayer->SetSelection( MOD_LYR_FSILKS );
else
m_radio_PCBLayer->SetSelection( tmp );
}
m_config->Read( KEYWORD_LAST_FORMAT, &tmp );
m_radioBoxFormat->SetSelection( tmp );
// Give an icon
wxIcon icon;
@@ -221,7 +198,6 @@ BM2CMP_FRAME::~BM2CMP_FRAME()
m_config->Write( KEYWORD_BINARY_THRESHOLD, m_sliderThreshold->GetValue() );
m_config->Write( KEYWORD_BW_NEGATIVE, m_rbOptions->GetSelection() );
m_config->Write( KEYWORD_LAST_FORMAT, m_radioBoxFormat->GetSelection() );
m_config->Write( KEYWORD_LAST_MODLAYER, m_radio_PCBLayer->GetSelection() );
delete m_config;
@@ -250,7 +226,7 @@ void BM2CMP_FRAME::OnPaint( wxPaintEvent& event )
m_BNPicturePanel->PrepareDC( nb_dc );
// OSX crashes with empty bitmaps (on initial refreshes)
if( m_Pict_Bitmap.IsOk() && m_Greyscale_Bitmap.IsOk() && m_BN_Bitmap.IsOk() )
if(m_Pict_Bitmap.IsOk() && m_Greyscale_Bitmap.IsOk() && m_BN_Bitmap.IsOk())
{
pict_dc.DrawBitmap( m_Pict_Bitmap, 0, 0, false );
greyscale_dc.DrawBitmap( m_Greyscale_Bitmap, 0, 0, false );
@@ -259,17 +235,19 @@ void BM2CMP_FRAME::OnPaint( wxPaintEvent& event )
}
/* Called to load a bitmap file
*/
void BM2CMP_FRAME::OnLoadFile( wxCommandEvent& event )
{
wxFileName fn( m_BitmapFileName );
wxString path = fn.GetPath();
if( path.IsEmpty() || !wxDirExists( path ) )
path = m_mruPath;
if( path.IsEmpty() || !wxDirExists(path) )
path = wxGetCwd();
wxFileDialog fileDlg( this, _( "Choose Image" ), path, wxEmptyString,
_( "Image Files " ) + wxImage::GetImageExtWildcard(),
wxFD_OPEN | wxFD_FILE_MUST_EXIST );
wxFD_OPEN );
int diag = fileDlg.ShowModal();
@@ -281,8 +259,6 @@ void BM2CMP_FRAME::OnLoadFile( wxCommandEvent& event )
if( !OpenProjectFiles( std::vector<wxString>( 1, fullFilename ) ) )
return;
fn = fullFilename;
m_mruPath = fn.GetPath();
m_buttonExport->Enable( true );
SetStatusText( fullFilename );
Refresh();
@@ -297,7 +273,14 @@ bool BM2CMP_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, int
if( !m_Pict_Image.LoadFile( m_BitmapFileName ) )
{
// LoadFile has its own UI, no need for further failure notification here
/* LoadFile has its own UI, no need for further failure notification here
wxString msg = wxString::Format(
_( "Could not load image '%s'" ),
GetChars( aFilename )
);
wxMessageBox( msg );
*/
return false;
}
@@ -350,12 +333,11 @@ bool BM2CMP_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, int
return true;
}
void BM2CMP_FRAME::updateImageInfo()
{
// Note: the image resolution text controls are not modified
// here, to avoid a race between text change when entered by user and
// a text change if it is modified here.
// a text change if it is modifed here.
int h = m_Pict_Bitmap.GetHeight();
int w = m_Pict_Bitmap.GetWidth();
int nb = m_Pict_Bitmap.GetDepth();
@@ -370,7 +352,6 @@ void BM2CMP_FRAME::updateImageInfo()
(double) h / m_imageDPI.y * 25.4 ) );
}
void BM2CMP_FRAME::OnResolutionChange( wxCommandEvent& event )
{
long tmp;
@@ -390,7 +371,6 @@ void BM2CMP_FRAME::OnResolutionChange( wxCommandEvent& event )
updateImageInfo();
}
void BM2CMP_FRAME::Binarize( double aThreshold )
{
unsigned int pixin;
@@ -431,10 +411,10 @@ void BM2CMP_FRAME::NegateGreyscaleImage( )
}
}
/* Called on Normal/Negative change option */
void BM2CMP_FRAME::OnOptionsSelection( wxCommandEvent& event )
{
NegateGreyscaleImage();
NegateGreyscaleImage( );
m_Greyscale_Bitmap = wxBitmap( m_Greyscale_Image );
Binarize( (double)m_sliderThreshold->GetValue()/m_sliderThreshold->GetMax() );
Refresh();
@@ -450,25 +430,27 @@ void BM2CMP_FRAME::OnThresholdChange( wxScrollEvent& event )
void BM2CMP_FRAME::OnExport( wxCommandEvent& event )
{
// choices of m_radioBoxFormat are expected to be in same order as
// OUTPUT_FMT_ID. See bitmap2component.h
OUTPUT_FMT_ID sel = (OUTPUT_FMT_ID) m_radioBoxFormat->GetSelection();
int sel = m_radioBoxFormat->GetSelection();
switch( sel )
{
case EESCHEMA_FMT:
case 0:
OnExportEeschema();
break;
case PCBNEW_KICAD_MOD:
OnExportPcbnew();
case 1:
OnExportPcbnew( true );
break;
case POSTSCRIPT_FMT:
case 2:
OnExportPcbnew( false );
break;
case 3:
OnExportPostScript();
break;
case KICAD_LOGO:
case 4:
OnExportLogo();
break;
}
@@ -483,18 +465,16 @@ void BM2CMP_FRAME::OnExportLogo()
if( path.IsEmpty() || !wxDirExists(path) )
path = ::wxGetCwd();
wxFileDialog fileDlg( this, _( "Create a logo file" ),
path, wxEmptyString,
wxGetTranslation( PageLayoutDescrFileWildcard ),
wxString msg = _( "Logo file (*.kicad_wks)|*.kicad_wks" );
wxFileDialog fileDlg( this, _( "Create a logo file" ), path, wxEmptyString,
msg,
wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
int diag = fileDlg.ShowModal();
if( diag != wxID_OK )
return;
fn = fileDlg.GetPath();
fn.SetExt( PageLayoutDescrFileExtension );
m_ConvertedFileName = fn.GetFullPath();
m_ConvertedFileName = fileDlg.GetPath();
FILE* outfile;
outfile = wxFopen( m_ConvertedFileName, wxT( "w" ) );
@@ -502,12 +482,12 @@ void BM2CMP_FRAME::OnExportLogo()
if( outfile == NULL )
{
wxString msg;
msg.Printf( _( "File '%s' could not be created." ), GetChars( m_ConvertedFileName ) );
msg.Printf( _( "File %s could not be created" ), m_ConvertedFileName.c_str() );
wxMessageBox( msg );
return;
}
ExportFile( outfile, KICAD_LOGO );
ExportFile( outfile, 4 );
fclose( outfile );
}
@@ -520,9 +500,9 @@ void BM2CMP_FRAME::OnExportPostScript()
if( path.IsEmpty() || !wxDirExists( path ) )
path = ::wxGetCwd();
wxFileDialog fileDlg( this, _( "Create a Postscript file" ),
path, wxEmptyString,
wxGetTranslation( PSFileWildcard ),
wxString msg = _( "Postscript file (*.ps)|*.ps" );
wxFileDialog fileDlg( this, _( "Create a Postscript file" ), path, wxEmptyString,
msg,
wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
int diag = fileDlg.ShowModal();
@@ -530,9 +510,7 @@ void BM2CMP_FRAME::OnExportPostScript()
if( diag != wxID_OK )
return;
fn = fileDlg.GetPath();
fn.SetExt( wxT( "ps" ) );
m_ConvertedFileName = fn.GetFullPath();
m_ConvertedFileName = fileDlg.GetPath();
FILE* outfile;
outfile = wxFopen( m_ConvertedFileName, wxT( "w" ) );
@@ -540,12 +518,12 @@ void BM2CMP_FRAME::OnExportPostScript()
if( outfile == NULL )
{
wxString msg;
msg.Printf( _( "File '%s' could not be created." ), GetChars( m_ConvertedFileName ) );
msg.Printf( _( "File %s could not be created" ), m_ConvertedFileName.c_str() );
wxMessageBox( msg );
return;
}
ExportFile( outfile, POSTSCRIPT_FMT );
ExportFile( outfile, 3 );
fclose( outfile );
}
@@ -558,9 +536,10 @@ void BM2CMP_FRAME::OnExportEeschema()
if( path.IsEmpty() || !wxDirExists(path) )
path = ::wxGetCwd();
wxFileDialog fileDlg( this, _( "Create a component library file for Eeschema" ),
path, wxEmptyString,
wxGetTranslation( SchematicLibraryFileWildcard ),
wxString msg = _( "Schematic lib file (*.lib)|*.lib" );
wxFileDialog fileDlg( this, _( "Create a lib file for Eeschema" ), path, wxEmptyString,
msg,
wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
int diag = fileDlg.ShowModal();
@@ -568,36 +547,38 @@ void BM2CMP_FRAME::OnExportEeschema()
if( diag != wxID_OK )
return;
fn = fileDlg.GetPath();
fn.SetExt( SchematicLibraryFileExtension );
m_ConvertedFileName = fn.GetFullPath();
m_ConvertedFileName = fileDlg.GetPath();
FILE* outfile = wxFopen( m_ConvertedFileName, wxT( "w" ) );
if( outfile == NULL )
{
wxString msg;
msg.Printf( _( "File '%s' could not be created." ), GetChars( m_ConvertedFileName ) );
msg.Printf( _( "File %s could not be created" ), m_ConvertedFileName.c_str() );
wxMessageBox( msg );
return;
}
ExportFile( outfile, EESCHEMA_FMT );
ExportFile( outfile, 2 );
fclose( outfile );
}
void BM2CMP_FRAME::OnExportPcbnew()
void BM2CMP_FRAME::OnExportPcbnew( bool aLegacyFormat )
{
wxFileName fn( m_ConvertedFileName );
wxString path = fn.GetPath();
if( path.IsEmpty() || !wxDirExists( path ) )
path = m_mruPath;
path = ::wxGetCwd();
wxFileDialog fileDlg( this, _( "Create a footprint file for Pcbnew" ),
wxString msg = aLegacyFormat ?
_( "Footprint file (*.emp)|*.emp" ) :
_( "Footprint file (*.kicad_mod)|*.kicad_mod" );
wxFileDialog fileDlg( this, _( "Create a footprint file for PcbNew" ),
path, wxEmptyString,
wxGetTranslation( KiCadFootprintLibFileWildcard ),
msg,
wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
int diag = fileDlg.ShowModal();
@@ -605,27 +586,24 @@ void BM2CMP_FRAME::OnExportPcbnew()
if( diag != wxID_OK )
return;
fn = fileDlg.GetPath();
fn.SetExt( KiCadFootprintFileExtension );
m_ConvertedFileName = fn.GetFullPath();
m_ConvertedFileName = fileDlg.GetPath();
FILE* outfile = wxFopen( m_ConvertedFileName, wxT( "w" ) );
if( outfile == NULL )
{
wxString msg;
msg.Printf( _( "File '%s' could not be created." ), GetChars( m_ConvertedFileName ) );
msg.Printf( _( "File %s could not be created" ), m_ConvertedFileName.c_str() );
wxMessageBox( msg );
return;
}
ExportFile( outfile, PCBNEW_KICAD_MOD );
ExportFile( outfile, aLegacyFormat ? 0 : 1 );
fclose( outfile );
m_mruPath = fn.GetPath();
}
void BM2CMP_FRAME::ExportFile( FILE* aOutfile, OUTPUT_FMT_ID aFormat )
void BM2CMP_FRAME::ExportFile( FILE* aOutfile, int aFormat )
{
// Create a potrace bitmap
int h = m_NB_Image.GetHeight();
@@ -650,14 +628,7 @@ void BM2CMP_FRAME::ExportFile( FILE* aOutfile, OUTPUT_FMT_ID aFormat )
}
}
// choices of m_radio_PCBLayer are expected to be in same order as
// BMP2CMP_MOD_LAYER. See bitmap2component.h
BMP2CMP_MOD_LAYER modLayer = MOD_LYR_FSILKS;
if( aFormat == PCBNEW_KICAD_MOD )
modLayer = (BMP2CMP_MOD_LAYER) m_radio_PCBLayer->GetSelection();
bitmap2component( potrace_bitmap, aOutfile, aFormat, m_imageDPI.x, m_imageDPI.y, modLayer );
bitmap2component( potrace_bitmap, aOutfile, aFormat, m_imageDPI.x, m_imageDPI.y );
}
@@ -740,12 +711,3 @@ bool IFACE::OnKifaceStart( PGM_BASE* aProgram, int aCtlBits )
return start_common( aCtlBits );
}
void BM2CMP_FRAME::OnFormatChange( wxCommandEvent& event )
{
if( m_radioBoxFormat->GetSelection() == PCBNEW_KICAD_MOD )
m_radio_PCBLayer->Enable( true );
else
m_radio_PCBLayer->Enable( false );
event.Skip();
}
+11 -21
View File
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jun 5 2014)
// C++ code generated with wxFormBuilder (version Nov 5 2013)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@@ -16,22 +16,22 @@ BM2CMP_FRAME_BASE::BM2CMP_FRAME_BASE( wxWindow* parent, wxWindowID id, const wxS
wxBoxSizer* bMainSizer;
bMainSizer = new wxBoxSizer( wxHORIZONTAL );
m_Notebook = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
m_InitialPicturePanel = new wxScrolledWindow( m_Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL );
m_notebook1 = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
m_InitialPicturePanel = new wxScrolledWindow( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL );
m_InitialPicturePanel->SetScrollRate( 5, 5 );
m_InitialPicturePanel->SetMinSize( wxSize( 400,300 ) );
m_Notebook->AddPage( m_InitialPicturePanel, _("Original Picture"), true );
m_GreyscalePicturePanel = new wxScrolledWindow( m_Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL );
m_notebook1->AddPage( m_InitialPicturePanel, _("Original Picture"), true );
m_GreyscalePicturePanel = new wxScrolledWindow( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL );
m_GreyscalePicturePanel->SetScrollRate( 5, 5 );
m_GreyscalePicturePanel->SetMinSize( wxSize( 400,300 ) );
m_Notebook->AddPage( m_GreyscalePicturePanel, _("Greyscale Picture"), false );
m_BNPicturePanel = new wxScrolledWindow( m_Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL );
m_notebook1->AddPage( m_GreyscalePicturePanel, _("Greyscale Picture"), false );
m_BNPicturePanel = new wxScrolledWindow( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL );
m_BNPicturePanel->SetScrollRate( 5, 5 );
m_Notebook->AddPage( m_BNPicturePanel, _("Black&&White Picture"), false );
m_notebook1->AddPage( m_BNPicturePanel, _("Black&&White Picture"), false );
bMainSizer->Add( m_Notebook, 1, wxEXPAND, 5 );
bMainSizer->Add( m_notebook1, 1, wxEXPAND, 5 );
m_panelRight = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* brightSizer;
@@ -126,10 +126,10 @@ BM2CMP_FRAME_BASE::BM2CMP_FRAME_BASE( wxWindow* parent, wxWindowID id, const wxS
brightSizer->Add( m_buttonExport, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
wxString m_radioBoxFormatChoices[] = { _("Eeschema (.lib file)"), _("Pcbnew (.kicad_mod file)"), _("Postscript (.ps file)"), _("Logo for title block (.kicad_wks file)") };
wxString m_radioBoxFormatChoices[] = { _("Eeschema"), _("Pcbnew old fmt (.emp)"), _("Pcbnew kicad_mod"), _("Postscript"), _("Logo for title block") };
int m_radioBoxFormatNChoices = sizeof( m_radioBoxFormatChoices ) / sizeof( wxString );
m_radioBoxFormat = new wxRadioBox( m_panelRight, wxID_ANY, _("Format"), wxDefaultPosition, wxDefaultSize, m_radioBoxFormatNChoices, m_radioBoxFormatChoices, 1, wxRA_SPECIFY_COLS );
m_radioBoxFormat->SetSelection( 1 );
m_radioBoxFormat->SetSelection( 2 );
brightSizer->Add( m_radioBoxFormat, 0, wxEXPAND|wxALL, 5 );
wxString m_rbOptionsChoices[] = { _("Normal"), _("Negative") };
@@ -147,14 +147,6 @@ BM2CMP_FRAME_BASE::BM2CMP_FRAME_BASE( wxWindow* parent, wxWindowID id, const wxS
brightSizer->Add( m_sliderThreshold, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
wxString m_radio_PCBLayerChoices[] = { _("Front silk screen"), _("Front solder mask"), _("User layer Eco1"), _("User Layer Eco2") };
int m_radio_PCBLayerNChoices = sizeof( m_radio_PCBLayerChoices ) / sizeof( wxString );
m_radio_PCBLayer = new wxRadioBox( m_panelRight, wxID_ANY, _("Board Layer for Outline:"), wxDefaultPosition, wxDefaultSize, m_radio_PCBLayerNChoices, m_radio_PCBLayerChoices, 1, wxRA_SPECIFY_COLS );
m_radio_PCBLayer->SetSelection( 0 );
m_radio_PCBLayer->SetToolTip( _("Choose the board layer to place the outline.\nThe 2 invisible fields reference and value are always placed on the silk screen layer.") );
brightSizer->Add( m_radio_PCBLayer, 0, wxALL|wxEXPAND, 5 );
m_panelRight->SetSizer( brightSizer );
m_panelRight->Layout();
@@ -176,7 +168,6 @@ BM2CMP_FRAME_BASE::BM2CMP_FRAME_BASE( wxWindow* parent, wxWindowID id, const wxS
m_DPIValueY->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnResolutionChange ), NULL, this );
m_buttonLoad->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnLoadFile ), NULL, this );
m_buttonExport->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnExport ), NULL, this );
m_radioBoxFormat->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnFormatChange ), NULL, this );
m_rbOptions->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnOptionsSelection ), NULL, this );
m_sliderThreshold->Connect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( BM2CMP_FRAME_BASE::OnThresholdChange ), NULL, this );
}
@@ -193,7 +184,6 @@ BM2CMP_FRAME_BASE::~BM2CMP_FRAME_BASE()
m_DPIValueY->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnResolutionChange ), NULL, this );
m_buttonLoad->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnLoadFile ), NULL, this );
m_buttonExport->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnExport ), NULL, this );
m_radioBoxFormat->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnFormatChange ), NULL, this );
m_rbOptions->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnOptionsSelection ), NULL, this );
m_sliderThreshold->Disconnect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( BM2CMP_FRAME_BASE::OnThresholdChange ), NULL, this );
+39 -129
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="13" />
<FileVersion major="1" minor="11" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
@@ -44,7 +44,7 @@
<property name="minimum_size"></property>
<property name="name">BM2CMP_FRAME_BASE</property>
<property name="pos"></property>
<property name="size">733,634</property>
<property name="size">527,470</property>
<property name="style">wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER</property>
<property name="subclass">KIWAY_PLAYER; kiway_player.h</property>
<property name="title">Bitmap to Component Converter</property>
@@ -133,7 +133,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_Notebook</property>
<property name="name">m_notebook1</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@@ -522,7 +522,7 @@
<property name="border">5</property>
<property name="flag">wxEXPAND|wxBOTTOM</property>
<property name="proportion">0</property>
<object class="wxFlexGridSizer" expanded="0">
<object class="wxFlexGridSizer" expanded="1">
<property name="cols">4</property>
<property name="flexible_direction">wxBOTH</property>
<property name="growablecols">1,2</property>
@@ -534,11 +534,11 @@
<property name="permission">none</property>
<property name="rows">0</property>
<property name="vgap">0</property>
<object class="sizeritem" expanded="0">
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_RIGHT|wxALL|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@@ -617,11 +617,11 @@
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="0">
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@@ -700,11 +700,11 @@
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="0">
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@@ -783,11 +783,11 @@
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="0">
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@@ -866,11 +866,11 @@
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="0">
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_RIGHT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@@ -949,11 +949,11 @@
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="0">
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@@ -1032,11 +1032,11 @@
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="0">
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@@ -1115,11 +1115,11 @@
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="0">
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@@ -1198,11 +1198,11 @@
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="0">
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_RIGHT|wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@@ -1281,11 +1281,11 @@
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="0">
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@@ -1364,11 +1364,11 @@
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="0">
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@@ -1447,21 +1447,21 @@
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="0">
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="spacer" expanded="0">
<object class="spacer" expanded="1">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">0</property>
</object>
</object>
<object class="sizeritem" expanded="0">
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_RIGHT|wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@@ -1540,11 +1540,11 @@
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="0">
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="0">
<object class="wxTextCtrl" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@@ -1631,11 +1631,11 @@
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="0">
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="0">
<object class="wxTextCtrl" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@@ -1722,11 +1722,11 @@
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="0">
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@@ -2003,7 +2003,7 @@
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="choices">&quot;Eeschema (.lib file)&quot; &quot;Pcbnew (.kicad_mod file)&quot; &quot;Postscript (.ps file)&quot; &quot;Logo for title block (.kicad_wks file)&quot;</property>
<property name="choices">&quot;Eeschema&quot; &quot;Pcbnew old fmt (.emp)&quot; &quot;Pcbnew kicad_mod&quot; &quot;Postscript&quot; &quot;Logo for title block&quot;</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
@@ -2035,7 +2035,7 @@
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="selection">1</property>
<property name="selection">2</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxRA_SPECIFY_COLS</property>
@@ -2066,7 +2066,7 @@
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRadioBox">OnFormatChange</event>
<event name="OnRadioBox"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
@@ -2356,96 +2356,6 @@
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxRadioBox" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="choices">&quot;Front silk screen&quot; &quot;Front solder mask&quot; &quot;User layer Eco1&quot; &quot;User Layer Eco2&quot;</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Board Layer for Outline:</property>
<property name="majorDimension">1</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_radio_PCBLayer</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="selection">0</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxRA_SPECIFY_COLS</property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip">Choose the board layer to place the outline.&#x0A;The 2 invisible fields reference and value are always placed on the silk screen layer.</property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRadioBox"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
</object>
+3 -5
View File
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jun 5 2014)
// C++ code generated with wxFormBuilder (version Nov 5 2013)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@@ -46,7 +46,7 @@ class BM2CMP_FRAME_BASE : public KIWAY_PLAYER
private:
protected:
wxNotebook* m_Notebook;
wxNotebook* m_notebook1;
wxScrolledWindow* m_InitialPicturePanel;
wxScrolledWindow* m_GreyscalePicturePanel;
wxScrolledWindow* m_BNPicturePanel;
@@ -72,7 +72,6 @@ class BM2CMP_FRAME_BASE : public KIWAY_PLAYER
wxRadioBox* m_rbOptions;
wxStaticText* m_ThresholdText;
wxSlider* m_sliderThreshold;
wxRadioBox* m_radio_PCBLayer;
wxStatusBar* m_statusBar;
// Virtual event handlers, overide them in your derived class
@@ -82,14 +81,13 @@ class BM2CMP_FRAME_BASE : public KIWAY_PLAYER
virtual void UpdatePPITextValueY( wxMouseEvent& event ) { event.Skip(); }
virtual void OnLoadFile( wxCommandEvent& event ) { event.Skip(); }
virtual void OnExport( wxCommandEvent& event ) { event.Skip(); }
virtual void OnFormatChange( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOptionsSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void OnThresholdChange( wxScrollEvent& event ) { event.Skip(); }
public:
BM2CMP_FRAME_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Bitmap to Component Converter"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 733,634 ), long style = wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER|wxTAB_TRAVERSAL );
BM2CMP_FRAME_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Bitmap to Component Converter"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 527,470 ), long style = wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER|wxTAB_TRAVERSAL );
~BM2CMP_FRAME_BASE();
+147 -112
View File
@@ -35,15 +35,29 @@
#include <cmath>
#include <vector>
#include <layers_id_colors_and_visibility.h>
#include <common.h>
#include <bitmap2component.h>
#include <geometry/shape_poly_set.h>
// include this after shape_poly_set.h to avoid redefinition of min, max ...
#include <potracelib.h>
#include <auxiliary.h>
// Define some types used here from boost::polygon
namespace bpl = boost::polygon; // bpl = boost polygon library
using namespace bpl::operators; // +, -, =, ...
typedef int coordinate_type;
typedef bpl::polygon_data<coordinate_type> KPolygon; // define a basic polygon
typedef std::vector<KPolygon> KPolygonSet; // define a set of polygons
typedef bpl::point_data<coordinate_type> KPolyPoint; // define a corner of a polygon
enum output_format {
POSTSCRIPT_FMT = 1,
PCBNEW_LEGACY_EMP,
PCBNEW_KICAD_MOD,
EESCHEMA_FMT,
KICAD_LOGO
};
/* free a potrace bitmap */
static void bm_free( potrace_bitmap_t* bm )
{
@@ -61,7 +75,7 @@ static void bm_free( potrace_bitmap_t* bm )
class BITMAPCONV_INFO
{
public:
enum OUTPUT_FMT_ID m_Format; // File format
enum output_format m_Format; // File format
int m_PixmapWidth;
int m_PixmapHeight; // the bitmap size in pixels
double m_ScaleX;
@@ -78,7 +92,7 @@ public:
* Creates the output file specified by m_Outfile,
* depending on file format given by m_Format
*/
void CreateOutputFile( BMP2CMP_MOD_LAYER aModLayer = (BMP2CMP_MOD_LAYER) 0 );
void CreateOutputFile();
private:
@@ -86,7 +100,7 @@ private:
* Function OuputFileHeader
* write to file the header depending on file format
*/
void OuputFileHeader( const char * aBrdLayerName );
void OuputFileHeader();
/**
* Function OuputFileEnd
@@ -95,18 +109,12 @@ private:
void OuputFileEnd();
/**
* @return the board layer name depending on the board layer selected
* @param aChoice = the choice (MOD_LYR_FSILKS to MOD_LYR_FINAL)
*/
const char * getBrdLayerName( BMP2CMP_MOD_LAYER aChoice );
/**
* Function OuputOnePolygon
* write one polygon to output file.
* Polygon coordinates are expected scaled by the polugon extraction function
*/
void OuputOnePolygon( SHAPE_LINE_CHAIN & aPolygon, const char* aBrdLayerName );
void OuputOnePolygon( KPolygon & aPolygon );
};
@@ -131,8 +139,7 @@ BITMAPCONV_INFO::BITMAPCONV_INFO()
int bitmap2component( potrace_bitmap_t* aPotrace_bitmap, FILE* aOutfile,
OUTPUT_FMT_ID aFormat, int aDpi_X, int aDpi_Y,
BMP2CMP_MOD_LAYER aModLayer )
int aFormat, int aDpi_X, int aDpi_Y )
{
potrace_param_t* param;
potrace_state_t* st;
@@ -150,12 +157,6 @@ int bitmap2component( potrace_bitmap_t* aPotrace_bitmap, FILE* aOutfile,
st = potrace_trace( param, aPotrace_bitmap );
if( !st || st->status != POTRACE_STATUS_OK )
{
if( st )
{
potrace_state_free( st );
}
potrace_param_free( param );
fprintf( stderr, "Error tracing bitmap: %s\n", strerror( errno ) );
return 1;
}
@@ -168,14 +169,14 @@ int bitmap2component( potrace_bitmap_t* aPotrace_bitmap, FILE* aOutfile,
switch( aFormat )
{
case KICAD_LOGO:
case 4:
info.m_Format = KICAD_LOGO;
info.m_ScaleX = 1e3 * 25.4 / aDpi_X; // the conversion scale from PPI to micro
info.m_ScaleY = 1e3 * 25.4 / aDpi_Y; // Y axis is top to bottom
info.CreateOutputFile();
break;
case POSTSCRIPT_FMT:
case 3:
info.m_Format = POSTSCRIPT_FMT;
info.m_ScaleX = 1.0; // the conversion scale
info.m_ScaleY = info.m_ScaleX;
@@ -183,18 +184,25 @@ int bitmap2component( potrace_bitmap_t* aPotrace_bitmap, FILE* aOutfile,
info.CreateOutputFile();
break;
case EESCHEMA_FMT:
case 2:
info.m_Format = EESCHEMA_FMT;
info.m_ScaleX = 1000.0 / aDpi_X; // the conversion scale from PPI to UI
info.m_ScaleY = -1000.0 / aDpi_Y; // Y axis is bottom to Top for components in libs
info.CreateOutputFile();
break;
case PCBNEW_KICAD_MOD:
case 1:
info.m_Format = PCBNEW_KICAD_MOD;
info.m_ScaleX = 1e6 * 25.4 / aDpi_X; // the conversion scale from PPI to UI
info.m_ScaleY = 1e6 * 25.4 / aDpi_Y; // Y axis is top to bottom in modedit
info.CreateOutputFile( aModLayer );
info.CreateOutputFile();
break;
case 0:
info.m_Format = PCBNEW_LEGACY_EMP;
info.m_ScaleX = 10000.0 / aDpi_X; // the conversion scale
info.m_ScaleY = 10000.0 / aDpi_Y; // Y axis is top to bottom in modedit
info.CreateOutputFile();
break;
default:
@@ -209,33 +217,8 @@ int bitmap2component( potrace_bitmap_t* aPotrace_bitmap, FILE* aOutfile,
return 0;
}
const char* BITMAPCONV_INFO::getBrdLayerName( BMP2CMP_MOD_LAYER aChoice )
{
const char * layerName = "F.SilkS";
switch( aChoice )
{
case MOD_LYR_FSOLDERMASK:
layerName = "F.Mask";
break;
case MOD_LYR_ECO1:
layerName = "Eco1.User";
break;
case MOD_LYR_ECO2:
layerName = "Eco2.User";
break;
case MOD_LYR_FSILKS:
default: // case MOD_LYR_FSILKS only unless there is a bug
break;
}
return layerName;
}
void BITMAPCONV_INFO::OuputFileHeader( const char * aBrdLayerName )
void BITMAPCONV_INFO::OuputFileHeader()
{
int Ypos = (int) ( m_PixmapHeight / 2 * m_ScaleY );
int fieldSize; // fields text size = 60 mils
@@ -250,15 +233,35 @@ void BITMAPCONV_INFO::OuputFileHeader( const char * aBrdLayerName )
fprintf( m_Outfile, "gsave\n" );
break;
case PCBNEW_LEGACY_EMP:
#define FIELD_LAYER 21
fieldSize = 600; // fields text size = 60 mils
Ypos += fieldSize / 2;
fprintf( m_Outfile, "PCBNEW-LibModule-V1\n" );
fprintf( m_Outfile, "$INDEX\n%s\n$EndINDEX\n", m_CmpName );
fprintf( m_Outfile, "#\n# %s\n", m_CmpName );
fprintf( m_Outfile, "# pixmap w = %d, h = %d\n#\n",
m_PixmapWidth, m_PixmapHeight );
fprintf( m_Outfile, "$MODULE %s\n", m_CmpName );
fprintf( m_Outfile, "Po 0 0 0 15 00000000 00000000 ~~\n" );
fprintf( m_Outfile, "Li %s\n", m_CmpName );
fprintf( m_Outfile, "T0 0 %d %d %d 0 %d N I %d \"G***\"\n",
Ypos, fieldSize, fieldSize, fieldSize / 5, FIELD_LAYER );
fprintf( m_Outfile, "T1 0 %d %d %d 0 %d N I %d \"%s\"\n",
-Ypos, fieldSize, fieldSize, fieldSize / 5, FIELD_LAYER, m_CmpName );
break;
case PCBNEW_KICAD_MOD:
// fields text size = 1.5 mm
// fields text thickness = 1.5 / 5 = 0.3mm
fprintf( m_Outfile, "(module %s (layer F.Cu)\n (at 0 0)\n",
m_CmpName );
fprintf( m_Outfile, " (fp_text reference \"G***\" (at 0 0) (layer %s) hide\n"
" (effects (font (thickness 0.3)))\n )\n", aBrdLayerName );
fprintf( m_Outfile, " (fp_text value \"%s\" (at 0.75 0) (layer %s) hide\n"
" (effects (font (thickness 0.3)))\n )\n", m_CmpName, aBrdLayerName );
fprintf( m_Outfile, " (fp_text reference \"G***\" (at 0 0) (layer F.SilkS) hide\n"
" (effects (font (thickness 0.3)))\n )\n" );
fprintf( m_Outfile, " (fp_text value \"%s\" (at 0.75 0) (layer F.SilkS) hide\n"
" (effects (font (thickness 0.3)))\n )\n",
m_CmpName );
break;
case KICAD_LOGO:
@@ -292,6 +295,11 @@ void BITMAPCONV_INFO::OuputFileEnd()
fprintf( m_Outfile, "%%EOF\n" );
break;
case PCBNEW_LEGACY_EMP:
fprintf( m_Outfile, "$EndMODULE %s\n", m_CmpName );
fprintf( m_Outfile, "$EndLIBRARY\n" );
break;
case PCBNEW_KICAD_MOD:
fprintf( m_Outfile, ")\n" );
break;
@@ -312,28 +320,28 @@ void BITMAPCONV_INFO::OuputFileEnd()
* write one polygon to output file.
* Polygon coordinates are expected scaled by the polygon extraction function
*/
void BITMAPCONV_INFO::OuputOnePolygon( SHAPE_LINE_CHAIN & aPolygon, const char* aBrdLayerName )
void BITMAPCONV_INFO::OuputOnePolygon( KPolygon & aPolygon )
{
int ii, jj;
VECTOR2I currpoint;
unsigned ii, jj;
KPolyPoint currpoint;
int offsetX = (int)( m_PixmapWidth / 2 * m_ScaleX );
int offsetY = (int)( m_PixmapHeight / 2 * m_ScaleY );
const VECTOR2I startpoint = aPolygon.CPoint( 0 );
KPolyPoint startpoint = *aPolygon.begin();
switch( m_Format )
{
case POSTSCRIPT_FMT:
offsetY = (int)( m_PixmapHeight * m_ScaleY );
fprintf( m_Outfile, "newpath\n%d %d moveto\n",
startpoint.x, offsetY - startpoint.y );
startpoint.x(), offsetY - startpoint.y() );
jj = 0;
for( ii = 1; ii < aPolygon.PointCount(); ii++ )
for( ii = 1; ii < aPolygon.size(); ii++ )
{
currpoint = aPolygon.CPoint( ii );
currpoint = *(aPolygon.begin() + ii);
fprintf( m_Outfile, " %d %d lineto",
currpoint.x, offsetY - currpoint.y );
currpoint.x(), offsetY - currpoint.y() );
if( jj++ > 6 )
{
@@ -345,18 +353,39 @@ void BITMAPCONV_INFO::OuputOnePolygon( SHAPE_LINE_CHAIN & aPolygon, const char*
fprintf( m_Outfile, "\nclosepath fill\n" );
break;
case PCBNEW_LEGACY_EMP:
{
LAYER_NUM layer = SILKSCREEN_N_FRONT;
int width = 1;
fprintf( m_Outfile, "DP %d %d %d %d %d %d %d\n",
0, 0, 0, 0,
(int) aPolygon.size() + 1, width, layer );
for( ii = 0; ii < aPolygon.size(); ii++ )
{
currpoint = *( aPolygon.begin() + ii );
fprintf( m_Outfile, "Dl %d %d\n",
currpoint.x() - offsetX, currpoint.y() - offsetY );
}
// Close polygon
fprintf( m_Outfile, "Dl %d %d\n",
startpoint.x() - offsetX, startpoint.y() - offsetY );
}
break;
case PCBNEW_KICAD_MOD:
{
double width = 0.01; // outline thickness in mm
double width = 0.1;
fprintf( m_Outfile, " (fp_poly (pts" );
jj = 0;
for( ii = 0; ii < aPolygon.PointCount(); ii++ )
for( ii = 0; ii < aPolygon.size(); ii++ )
{
currpoint = aPolygon.CPoint( ii );
currpoint = *( aPolygon.begin() + ii );
fprintf( m_Outfile, " (xy %f %f)",
( currpoint.x - offsetX ) / 1e6,
( currpoint.y - offsetY ) / 1e6 );
(currpoint.x() - offsetX) / 1e6,
(currpoint.y() - offsetY) / 1e6 );
if( jj++ > 6 )
{
@@ -366,10 +395,8 @@ void BITMAPCONV_INFO::OuputOnePolygon( SHAPE_LINE_CHAIN & aPolygon, const char*
}
// Close polygon
fprintf( m_Outfile, " (xy %f %f) )",
( startpoint.x - offsetX ) / 1e6, ( startpoint.y - offsetY ) / 1e6 );
fprintf( m_Outfile, "(layer %s) (width %f)\n )\n", aBrdLayerName, width );
(startpoint.x() - offsetX) / 1e6, (startpoint.y() - offsetY) / 1e6 );
fprintf( m_Outfile, "(layer F.SilkS) (width %f)\n )\n", width );
}
break;
@@ -377,12 +404,12 @@ void BITMAPCONV_INFO::OuputOnePolygon( SHAPE_LINE_CHAIN & aPolygon, const char*
fprintf( m_Outfile, " (pts" );
// Internal units = micron, file unit = mm
jj = 0;
for( ii = 0; ii < aPolygon.PointCount(); ii++ )
for( ii = 0; ii < aPolygon.size(); ii++ )
{
currpoint = aPolygon.CPoint( ii );
currpoint = *( aPolygon.begin() + ii );
fprintf( m_Outfile, " (xy %.3f %.3f)",
( currpoint.x - offsetX ) / 1e3,
( currpoint.y - offsetY ) / 1e3 );
(currpoint.x() - offsetX) / 1e3,
(currpoint.y() - offsetY) / 1e3 );
if( jj++ > 4 )
{
@@ -392,21 +419,21 @@ void BITMAPCONV_INFO::OuputOnePolygon( SHAPE_LINE_CHAIN & aPolygon, const char*
}
// Close polygon
fprintf( m_Outfile, " (xy %.3f %.3f) )\n",
( startpoint.x - offsetX ) / 1e3, ( startpoint.y - offsetY ) / 1e3 );
(startpoint.x() - offsetX) / 1e3, (startpoint.y() - offsetY) / 1e3 );
break;
case EESCHEMA_FMT:
fprintf( m_Outfile, "P %d 0 0 1", (int) aPolygon.PointCount() + 1 );
for( ii = 0; ii < aPolygon.PointCount(); ii++ )
fprintf( m_Outfile, "P %d 0 0 1", (int) aPolygon.size() + 1 );
for( ii = 0; ii < aPolygon.size(); ii++ )
{
currpoint = aPolygon.CPoint( ii );
currpoint = *(aPolygon.begin() + ii);
fprintf( m_Outfile, " %d %d",
currpoint.x - offsetX, currpoint.y - offsetY );
currpoint.x() - offsetX, currpoint.y() - offsetY );
}
// Close polygon
fprintf( m_Outfile, " %d %d",
startpoint.x - offsetX, startpoint.y - offsetY );
startpoint.x() - offsetX, startpoint.y() - offsetY );
fprintf( m_Outfile, " F\n" );
break;
@@ -414,24 +441,24 @@ void BITMAPCONV_INFO::OuputOnePolygon( SHAPE_LINE_CHAIN & aPolygon, const char*
}
void BITMAPCONV_INFO::CreateOutputFile( BMP2CMP_MOD_LAYER aModLayer )
void BITMAPCONV_INFO::CreateOutputFile()
{
KPolyPoint currpoint;
std::vector <potrace_dpoint_t> cornersBuffer;
// polyset_areas is a set of polygon to draw
SHAPE_POLY_SET polyset_areas;
// This KPolygonSet polyset_areas is a complex polygon to draw
// and can be complex depending on holes inside this polygon
KPolygonSet polyset_areas;
// polyset_holes is the set of holes inside polyset_areas outlines
SHAPE_POLY_SET polyset_holes;
// This KPolygonSet polyset_holes is the set of holes inside polyset_areas
KPolygonSet polyset_holes;
potrace_dpoint_t( *c )[3];
LOCALE_IO toggle; // Temporary switch the locale to standard C to r/w floats
setlocale( LC_NUMERIC, "C" ); // Switch the locale to standard C
// The layer name has meaning only for .kicad_mod files.
// For these files the header creates 2 invisible texts: value and ref
// (needed but not usefull) on silk screen layer
OuputFileHeader( getBrdLayerName( MOD_LYR_FSILKS ) );
OuputFileHeader();
bool main_outline = true;
@@ -468,24 +495,33 @@ void BITMAPCONV_INFO::CreateOutputFile( BMP2CMP_MOD_LAYER aModLayer )
main_outline = false;
// build the current main polygon
polyset_areas.NewOutline();
std::vector<KPolyPoint> cornerslist; // a simple boost polygon
for( unsigned int i = 0; i < cornersBuffer.size(); i++ )
{
polyset_areas.Append( int( cornersBuffer[i].x * m_ScaleX ),
int( cornersBuffer[i].y * m_ScaleY ) );
currpoint.x( (coordinate_type) (cornersBuffer[i].x * m_ScaleX) );
currpoint.y( (coordinate_type) (cornersBuffer[i].y * m_ScaleY) );
cornerslist.push_back( currpoint );
}
KPolygon poly;
bpl::set_points( poly, cornerslist.begin(), cornerslist.end() );
polyset_areas.push_back( poly );
}
else
{
// Add current hole in polyset_holes
polyset_holes.NewOutline();
std::vector<KPolyPoint> cornerslist; // a simple boost polygon
for( unsigned int i = 0; i < cornersBuffer.size(); i++ )
{
polyset_holes.Append( int( cornersBuffer[i].x * m_ScaleX ),
int( cornersBuffer[i].y * m_ScaleY ) );
currpoint.x( (coordinate_type) (cornersBuffer[i].x * m_ScaleX) );
currpoint.y( (coordinate_type) (cornersBuffer[i].y * m_ScaleY) );
cornerslist.push_back( currpoint );
}
}
KPolygon poly;
bpl::set_points( poly, cornerslist.begin(), cornerslist.end() );
polyset_holes.push_back( poly );
}
cornersBuffer.clear();
/* at the end of a group of a positive path and its negative children, fill.
@@ -493,26 +529,25 @@ void BITMAPCONV_INFO::CreateOutputFile( BMP2CMP_MOD_LAYER aModLayer )
if( paths->next == NULL || paths->next->sign == '+' )
{
// Substract holes to main polygon:
polyset_areas.Simplify();
polyset_holes.Simplify();
polyset_areas.BooleanSubtract( polyset_holes );
polyset_areas.Fracture();
polyset_areas -= polyset_holes;
// Output current resulting polygon(s)
for( int ii = 0; ii < polyset_areas.OutlineCount(); ii++ )
for( unsigned ii = 0; ii < polyset_areas.size(); ii++ )
{
SHAPE_LINE_CHAIN& poly = polyset_areas.Outline( ii );
OuputOnePolygon(poly, getBrdLayerName( aModLayer ) );
KPolygon& poly = polyset_areas[ii];
OuputOnePolygon(poly );
}
polyset_areas.RemoveAllContours();
polyset_holes.RemoveAllContours();
polyset_areas.clear();
polyset_holes.clear();
main_outline = true;
}
paths = paths->next;
}
OuputFileEnd();
setlocale( LC_NUMERIC, "" ); // revert to the current locale
}
-47
View File
@@ -1,47 +0,0 @@
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 1992-2014 Kicad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef BITMAP2COMPONENT_H
#define BITMAP2COMPONENT_H
// for consistency this enum should conform to the
// indices in m_radioBoxFormat from bitmap2cmp_gui.cpp
enum OUTPUT_FMT_ID
{
EESCHEMA_FMT = 0,
PCBNEW_KICAD_MOD,
POSTSCRIPT_FMT,
KICAD_LOGO,
FINAL_FMT = KICAD_LOGO
};
enum BMP2CMP_MOD_LAYER
{
MOD_LYR_FSILKS = 0,
MOD_LYR_FSOLDERMASK,
MOD_LYR_ECO1,
MOD_LYR_ECO2,
MOD_LYR_FINAL = MOD_LYR_ECO2
};
#endif // BITMAP2COMPONENT_H
+4 -48
View File
@@ -151,12 +151,6 @@ set( BMAPS_MID
annotate_down_right
annotate_right_down
annotate
array_line
array_module
array_pad
array_text
array_target
array_zone
auto_associe
auto_delete_track
auto_track_width
@@ -174,7 +168,6 @@ set( BMAPS_MID
browse_files
cancel
change_entry_orient
contrast_mode
create_cmp_file
checked_ok
component_select_unit
@@ -223,12 +216,6 @@ set( BMAPS_MID
drag_track_segment
drc_off
drc
duplicate_line
duplicate_module
duplicate_pad
duplicate_target
duplicate_text
duplicate_zone
edges_sketch
edit_comp_footprint
edit_component
@@ -266,9 +253,11 @@ set( BMAPS_MID
gbr_select_mode2
gerber_file
gerber_recent_files
gerber_open_dcode_file
gerbview_show_negative_objects
gerbview_drill_file
gerbview_clear_layers
gerber_open_dcode_file
gerbview_open_recent_drill_files
general_deletions
general_ratsnest
@@ -286,7 +275,6 @@ set( BMAPS_MID
hierarchy_cursor
hierarchy_nav
hotkeys
html
icon_cvpcb_small
icon_gerbview_small
icon_txt
@@ -338,7 +326,6 @@ set( BMAPS_MID
library_table
libview
lines90
list_nets
load_module_board
load_module_lib
local_ratsnest
@@ -377,11 +364,9 @@ set( BMAPS_MID
move_polygon
move_rectangle
move_sheet
move_target
move_text
move_track_segment
move_track
move_zone
move
mw_add_gap
mw_add_line
@@ -401,6 +386,8 @@ set( BMAPS_MID
new_project
new_project_with_template
new_sch
new_txt
new
noconn
normal
online_help
@@ -430,7 +417,6 @@ set( BMAPS_MID
pad_sketch
pad
pad_dimensions
pad_enumerate
pads_mask_layers
pagelayout_load
pagelayout_load_default
@@ -447,7 +433,6 @@ set( BMAPS_MID
pin_name_to
pin_number_to
pin_size_to
pin_table
pin_to
pin
plot
@@ -463,12 +448,6 @@ set( BMAPS_MID
preference
print_button
ps_router
ps_diff_pair
ps_diff_pair_gap
ps_diff_pair_tune_length
ps_diff_pair_tune_phase
ps_diff_pair_via_gap
ps_tune_length
py_script
ratsnest
read_setup
@@ -478,8 +457,6 @@ set( BMAPS_MID
reload
reset_text
resize_sheet
rescue_pcbnew
revert_pcbnew
right
rotate_field
rotate_glabel
@@ -507,12 +484,6 @@ set( BMAPS_MID
select_w_layer
shape_3d
sheetset
setcolor_3d_bg
setcolor_silkscreen
setcolor_soldermask
setcolor_solderpaste
setcolor_copper
setcolor_board_body
show_dcodenumber
show_footprint
show_mod_edge
@@ -541,8 +512,6 @@ set( BMAPS_MID
up
use_3D_copper_thickness
via
via_buried
via_microvia
via_sketch
warning
web_support
@@ -552,7 +521,6 @@ set( BMAPS_MID
width_track
width_vias
window_close
wizard_add_fplib_small
zip_tool
zip
zone_duplicate
@@ -583,13 +551,6 @@ set( BMAPS_BIG
libedit_icon
viewlibs_icon
icon_pagelayout_editor
wizard_add_fplib_icon
)
set( BMAPS_OTHER
tune_diff_pair_length_legend
tune_diff_pair_skew_legend
tune_single_track_length_legend
)
@@ -765,10 +726,5 @@ foreach( bmn ${BMAPS_BIG} )
list( APPEND CPP_LIST cpp_48/${bmn}.cpp )
endforeach()
foreach( bmn ${BMAPS_OTHER} )
#message( "library add cpp_other/${bmn}.cpp" )
list( APPEND CPP_LIST cpp_other/${bmn}.cpp )
endforeach()
#add_library( bitmaps SHARED ${CPP_LIST} )
add_library( bitmaps STATIC ${CPP_LIST} )
@@ -8,86 +8,55 @@
static const unsigned char png[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c,
0xce, 0x00, 0x00, 0x04, 0xde, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xad, 0x96, 0x5f, 0x48, 0x5b,
0x57, 0x1c, 0xc7, 0x03, 0x7b, 0x19, 0x53, 0xc6, 0xc6, 0xf0, 0x41, 0x06, 0x7b, 0xd8, 0x60, 0x08,
0xdd, 0xc3, 0xc0, 0x81, 0x30, 0x99, 0xe0, 0xc3, 0xd8, 0x1f, 0xca, 0x1e, 0x5a, 0xd8, 0x60, 0xb5,
0xeb, 0xa8, 0x7d, 0xe9, 0xa8, 0xad, 0xb5, 0x50, 0x10, 0x62, 0x15, 0x59, 0x19, 0x2d, 0x9b, 0x56,
0x23, 0xfb, 0xe3, 0x9c, 0xb6, 0x0a, 0xda, 0x6a, 0xe2, 0x9f, 0x68, 0xab, 0xcb, 0xd4, 0x32, 0x35,
0x06, 0xd4, 0xb4, 0x9a, 0xc4, 0x3f, 0x49, 0x6a, 0x8c, 0xab, 0x89, 0x9a, 0xff, 0x31, 0x31, 0xc6,
0x44, 0xfd, 0xee, 0xfc, 0x8e, 0xb9, 0x97, 0x24, 0x5e, 0x59, 0x1f, 0x76, 0xe1, 0xcb, 0xb9, 0xf7,
0xdc, 0x9b, 0xdf, 0xe7, 0xf7, 0xef, 0x9c, 0x13, 0x59, 0x66, 0x66, 0xe6, 0x89, 0xc2, 0xc2, 0xc2,
0x6f, 0xfe, 0x0f, 0xe5, 0xe6, 0xe6, 0x7e, 0x2d, 0x93, 0xc9, 0x5e, 0x07, 0x20, 0x4b, 0x97, 0xac,
0xa0, 0xa0, 0xe0, 0x7c, 0x28, 0x14, 0x86, 0xcf, 0xe7, 0x83, 0xcf, 0xef, 0x47, 0x20, 0x18, 0x44,
0x50, 0xd0, 0xd6, 0x16, 0xb6, 0x42, 0x21, 0x84, 0xc2, 0x61, 0x84, 0x93, 0xb5, 0xbd, 0x2d, 0x6a,
0x3b, 0x21, 0xba, 0x5f, 0xb6, 0xd9, 0xbc, 0x0c, 0xf4, 0xf6, 0xb1, 0x20, 0x7f, 0x20, 0x08, 0x97,
0xdb, 0x8d, 0x35, 0x87, 0x03, 0xcf, 0xd7, 0xd6, 0xf8, 0xe8, 0x70, 0x3a, 0xe1, 0x5c, 0x5f, 0xc7,
0xfa, 0xc6, 0x06, 0x36, 0x48, 0x9b, 0x9b, 0xd8, 0x4c, 0x96, 0xcb, 0xc5, 0xe5, 0x4a, 0x88, 0xee,
0x97, 0xcc, 0xe6, 0x00, 0x03, 0x9d, 0x60, 0x7a, 0x85, 0xe9, 0xe5, 0x23, 0x20, 0xf2, 0xdc, 0xe3,
0xf5, 0xa2, 0xb1, 0xb1, 0x11, 0x73, 0x06, 0x03, 0x0c, 0x46, 0x23, 0x8c, 0x26, 0x13, 0x4c, 0x82,
0xe6, 0xe7, 0x31, 0x9f, 0xac, 0x85, 0x05, 0xae, 0x85, 0x34, 0xb1, 0x6f, 0xf7, 0x67, 0x67, 0x67,
0x5d, 0x06, 0x83, 0x61, 0xbd, 0xa4, 0xa4, 0x44, 0x75, 0x04, 0x44, 0xe9, 0xf1, 0xb2, 0xd4, 0xa9,
0x54, 0x2a, 0xee, 0xb9, 0x75, 0x6a, 0x0a, 0xed, 0xa7, 0x4e, 0x61, 0x79, 0x66, 0x86, 0xcf, 0x53,
0x4a, 0xfd, 0x81, 0x00, 0x02, 0xa4, 0xe4, 0xb4, 0x26, 0x52, 0xcb, 0xd3, 0x9b, 0xa6, 0xe6, 0xe6,
0xe6, 0x31, 0x89, 0x1a, 0x85, 0xb8, 0xa1, 0xee, 0xee, 0x6e, 0x9e, 0x42, 0xd3, 0xd0, 0x10, 0xfa,
0x2a, 0x2a, 0xd0, 0x70, 0xe6, 0x0c, 0x14, 0x45, 0x45, 0x18, 0x19, 0x1c, 0xc4, 0xc4, 0xc4, 0xc4,
0xa1, 0xb4, 0x5a, 0x68, 0x49, 0x93, 0x93, 0x98, 0x24, 0xe9, 0x74, 0x5c, 0xba, 0x34, 0x95, 0x97,
0x97, 0xeb, 0x59, 0xfa, 0xde, 0x17, 0x45, 0x20, 0x2a, 0x24, 0x79, 0x4a, 0xa0, 0x79, 0x8d, 0x06,
0x43, 0xe5, 0xe5, 0xa8, 0x2d, 0x29, 0xe1, 0xd1, 0xb8, 0xdc, 0x1e, 0x78, 0x58, 0xfe, 0x3d, 0x1e,
0x8f, 0xd8, 0x30, 0x7e, 0xa9, 0x08, 0xd3, 0x9a, 0x88, 0xcd, 0x1f, 0xb0, 0x31, 0x4e, 0x32, 0x9b,
0xcd, 0x2e, 0x0e, 0xa2, 0xae, 0xa1, 0x97, 0x3d, 0x3d, 0x3d, 0xb0, 0xe9, 0xf5, 0x18, 0xaf, 0xab,
0x43, 0xdd, 0x95, 0x2b, 0xdc, 0x08, 0x45, 0xe8, 0x66, 0x10, 0xaa, 0xa1, 0x64, 0x1a, 0x93, 0x52,
0x98, 0x92, 0x3e, 0xd6, 0x9d, 0x82, 0x58, 0xf3, 0x84, 0x0f, 0x41, 0x91, 0x08, 0x7f, 0x49, 0x20,
0xf2, 0x76, 0x71, 0x78, 0x18, 0xf5, 0x57, 0xaf, 0x72, 0x23, 0x04, 0x49, 0x07, 0x90, 0xd7, 0x82,
0x71, 0xa5, 0xe6, 0x09, 0xae, 0xd7, 0xf6, 0x8b, 0xba, 0xdd, 0x32, 0x0a, 0x3d, 0x4b, 0xbb, 0xd7,
0x66, 0x03, 0xd9, 0xa5, 0x20, 0x58, 0x57, 0x1e, 0x82, 0x22, 0x3b, 0x3b, 0x7c, 0x7d, 0x10, 0xe8,
0x69, 0x67, 0x27, 0xba, 0x2f, 0x5c, 0x40, 0xed, 0xa5, 0x4b, 0x10, 0x9a, 0x44, 0x84, 0xa4, 0xad,
0xad, 0x25, 0xa7, 0x1e, 0xdf, 0x29, 0x2a, 0xa0, 0xb7, 0x8f, 0x20, 0xc2, 0x8c, 0x92, 0x9d, 0x1d,
0x09, 0xb9, 0xdd, 0xee, 0x43, 0x10, 0x3d, 0x10, 0xb9, 0xb7, 0xb7, 0x17, 0x6e, 0xb6, 0x8e, 0xe6,
0x94, 0x4a, 0xd4, 0x97, 0x96, 0x72, 0x63, 0x7c, 0x11, 0x27, 0xa2, 0x38, 0x5d, 0xfd, 0x33, 0xbe,
0xa8, 0x6c, 0xc0, 0xc5, 0xfa, 0x36, 0xfe, 0xfd, 0xe5, 0xae, 0x0f, 0xa0, 0x78, 0x5c, 0x8a, 0xb3,
0xad, 0x6f, 0x22, 0x1a, 0x8d, 0x22, 0xba, 0xbb, 0x8b, 0x5d, 0x09, 0xb1, 0xfa, 0x26, 0x40, 0xec,
0x23, 0xf2, 0x88, 0x40, 0xe4, 0xad, 0x65, 0x74, 0x14, 0x95, 0x27, 0x4f, 0xf2, 0x28, 0x93, 0xa3,
0xb8, 0x75, 0xff, 0x11, 0xaa, 0xdb, 0xd4, 0x68, 0x19, 0x1a, 0xe7, 0x9e, 0x5e, 0x56, 0xe6, 0x22,
0x14, 0x09, 0xf2, 0x31, 0x16, 0x8b, 0xa5, 0x28, 0x1e, 0x8f, 0x73, 0xd1, 0xbd, 0x08, 0x22, 0x4f,
0xe8, 0x87, 0x04, 0x22, 0xe3, 0x9e, 0xd5, 0x55, 0xdc, 0x61, 0xa9, 0xa3, 0x1c, 0x13, 0x84, 0xea,
0x47, 0xf3, 0x5a, 0xa3, 0x19, 0x63, 0x06, 0x33, 0xe6, 0x9e, 0xad, 0x72, 0xef, 0x09, 0x60, 0xdd,
0x7c, 0x82, 0x8b, 0x0f, 0xde, 0x13, 0x0d, 0x4b, 0x49, 0x04, 0x51, 0x78, 0x14, 0x3a, 0x81, 0x28,
0x25, 0x42, 0x74, 0x34, 0x6e, 0x25, 0x20, 0x04, 0x25, 0x67, 0xe8, 0x3b, 0xfa, 0x9e, 0x3c, 0xed,
0xd4, 0xdf, 0x42, 0x71, 0x73, 0x21, 0xda, 0xa6, 0x6e, 0x70, 0x83, 0x7b, 0x7b, 0x7b, 0x92, 0xf2,
0x7a, 0xbd, 0xa9, 0xa0, 0xbe, 0xbe, 0x3e, 0xd1, 0x20, 0xdd, 0x0b, 0x4d, 0x42, 0xf0, 0x74, 0x88,
0xe0, 0xed, 0x39, 0xf9, 0x7d, 0x54, 0xfd, 0xaa, 0xe1, 0xaa, 0xbe, 0xd3, 0x8b, 0xfe, 0xa2, 0x62,
0xec, 0xef, 0xef, 0xa7, 0x28, 0x05, 0x44, 0xe2, 0xc6, 0x19, 0x88, 0x0c, 0xaa, 0xd5, 0x6a, 0x50,
0xed, 0x78, 0x84, 0x69, 0x10, 0xa7, 0xdf, 0x06, 0x7f, 0xd8, 0x85, 0xf8, 0x5e, 0x1c, 0x65, 0x75,
0xf7, 0x8e, 0x18, 0x3e, 0x38, 0x38, 0x48, 0x11, 0x5b, 0xe8, 0x09, 0x10, 0xfb, 0xb1, 0x00, 0x22,
0xcf, 0xe9, 0x9e, 0x40, 0xd1, 0x44, 0x93, 0x08, 0x73, 0x42, 0x24, 0x9a, 0xc5, 0x16, 0xa8, 0x9e,
0xfe, 0x88, 0x1f, 0x34, 0x5f, 0x61, 0xd2, 0xd6, 0x2b, 0x69, 0x5c, 0xb8, 0x52, 0x40, 0xb1, 0x64,
0x50, 0xc2, 0x73, 0x01, 0xc4, 0xd7, 0x01, 0xdb, 0xd1, 0x4d, 0xed, 0x5d, 0x68, 0xed, 0x9f, 0xe1,
0xba, 0xa9, 0xac, 0xe4, 0x75, 0x89, 0xc5, 0x77, 0x45, 0x48, 0xeb, 0x5f, 0x93, 0xf8, 0x49, 0xa9,
0x41, 0x8b, 0x46, 0x2b, 0x46, 0x46, 0xf5, 0xa1, 0x51, 0x12, 0x44, 0xc6, 0xe9, 0x99, 0x40, 0x34,
0xc7, 0xd3, 0xc7, 0xd6, 0xd2, 0xa6, 0xc5, 0x0a, 0x83, 0xc5, 0x01, 0xa3, 0xd5, 0x89, 0xd6, 0xf1,
0x7a, 0x18, 0x1d, 0x7f, 0x8b, 0x10, 0xba, 0x6e, 0x77, 0xfe, 0x89, 0xd2, 0x5f, 0x1e, 0xe0, 0xfb,
0xf6, 0x01, 0xde, 0xa5, 0xb4, 0xc3, 0xd0, 0xde, 0x48, 0xeb, 0x6f, 0x7d, 0x23, 0xb1, 0x05, 0xc5,
0x58, 0x3a, 0x24, 0x41, 0x6c, 0x14, 0x9e, 0x85, 0xe2, 0x93, 0x97, 0x8f, 0xe6, 0x7f, 0x83, 0x7c,
0xe0, 0x13, 0x96, 0xba, 0x2f, 0xf1, 0x8f, 0x6f, 0x91, 0x83, 0xe8, 0x1d, 0x19, 0x75, 0xb2, 0x03,
0xd3, 0xc6, 0xb6, 0x1f, 0xb6, 0x91, 0x62, 0x69, 0x69, 0x89, 0x9f, 0x6d, 0x9a, 0x91, 0xc7, 0x1b,
0xb2, 0xec, 0xec, 0xec, 0x8f, 0xe4, 0x72, 0x79, 0x03, 0xa9, 0xa6, 0xa6, 0xc6, 0x9e, 0x0c, 0x12,
0x22, 0x15, 0x40, 0x42, 0xbb, 0x06, 0x23, 0x6e, 0x04, 0x22, 0x2e, 0x5c, 0xeb, 0xf9, 0x10, 0x72,
0xd5, 0xb7, 0xfc, 0x1d, 0xed, 0x1e, 0xab, 0x6c, 0xfd, 0x8d, 0x8d, 0x8d, 0x61, 0x7a, 0x7a, 0x9a,
0x1f, 0x90, 0xab, 0xab, 0x76, 0x0c, 0x8f, 0x8e, 0x44, 0xdf, 0xc9, 0xc9, 0xc9, 0x4d, 0x39, 0xd7,
0x15, 0x0a, 0xc5, 0xc3, 0x17, 0x01, 0x09, 0x29, 0x73, 0x04, 0xac, 0xb8, 0xfe, 0xc7, 0x4d, 0x98,
0x9e, 0x6b, 0xb1, 0x46, 0x5b, 0xd7, 0xdc, 0x1c, 0xac, 0x56, 0x2b, 0x7f, 0xbf, 0xb3, 0x13, 0x41,
0x8f, 0x5a, 0xbd, 0x93, 0x93, 0x93, 0xf3, 0x2e, 0x3f, 0xf8, 0x92, 0x41, 0x65, 0x65, 0x65, 0xed,
0x2b, 0x2b, 0x2b, 0x5e, 0xbb, 0xdd, 0xee, 0x6b, 0x6a, 0x6a, 0x0a, 0x49, 0x81, 0x92, 0x5b, 0x78,
0x63, 0x6b, 0x05, 0xd3, 0xf6, 0x41, 0x18, 0xec, 0x5a, 0x2c, 0x2f, 0x2f, 0x63, 0x88, 0x1d, 0x98,
0xd4, 0xa5, 0x94, 0xc2, 0xe6, 0xd6, 0x7b, 0xa1, 0xfc, 0xfc, 0xfc, 0xb7, 0xc4, 0x13, 0x36, 0xe5,
0xb8, 0x95, 0xc9, 0x5e, 0x63, 0x7a, 0x83, 0x94, 0x95, 0x95, 0x75, 0xee, 0xbf, 0x40, 0x74, 0xd1,
0x1c, 0x15, 0xdd, 0x62, 0xb1, 0xf0, 0xdd, 0x84, 0x0e, 0x48, 0x79, 0x55, 0xd5, 0xb3, 0xbc, 0xbc,
0xbc, 0x57, 0x53, 0x6c, 0x4b, 0xfd, 0x35, 0x22, 0xb1, 0xda, 0x9d, 0x7e, 0x51, 0x10, 0xd5, 0x87,
0x22, 0x52, 0x0f, 0x3c, 0xdc, 0x3f, 0x5b, 0x7c, 0xbe, 0x8f, 0x39, 0xfa, 0xd2, 0x91, 0xbf, 0x5b,
0xc7, 0x81, 0x32, 0x32, 0x32, 0x3e, 0xee, 0xe8, 0xe8, 0x18, 0x67, 0xc7, 0xbb, 0x4e, 0x10, 0x3b,
0xaf, 0x24, 0xd5, 0xa5, 0x54, 0xe9, 0x7e, 0xbf, 0x7b, 0x57, 0xf7, 0xe9, 0xe7, 0x9f, 0x5d, 0x3b,
0xce, 0xde, 0xbf, 0xf0, 0x98, 0xa8, 0x79, 0x89, 0xa3, 0xb6, 0xe9, 0x00, 0x00, 0x00, 0x00, 0x49,
0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
0xce, 0x00, 0x00, 0x02, 0xef, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xbd, 0x96, 0x4f, 0x48, 0x14,
0x51, 0x1c, 0xc7, 0xbf, 0xbf, 0xa7, 0xa6, 0xe9, 0xe6, 0x29, 0x3c, 0x25, 0x44, 0xe0, 0x41, 0xaa,
0x53, 0xeb, 0xea, 0x55, 0xf3, 0xde, 0xa1, 0x53, 0x97, 0xee, 0x9d, 0xa4, 0x4b, 0x48, 0x50, 0x50,
0x90, 0x50, 0x74, 0xe9, 0x90, 0x07, 0x8f, 0xae, 0xee, 0xc1, 0x43, 0x20, 0x94, 0x45, 0xe6, 0xa1,
0x5b, 0x2e, 0x2a, 0x0a, 0xfe, 0x01, 0x09, 0x9d, 0xdd, 0x6d, 0x51, 0x07, 0x2a, 0x91, 0x26, 0xa7,
0x79, 0x33, 0xef, 0xd7, 0x61, 0x77, 0xb6, 0x37, 0x6f, 0x77, 0x47, 0x2d, 0xf2, 0x07, 0x8f, 0x19,
0x66, 0xde, 0x7c, 0x3f, 0xf3, 0xfd, 0xce, 0x6f, 0xde, 0x0c, 0x31, 0x33, 0x4e, 0xa3, 0x04, 0x4e,
0xa9, 0x1a, 0xc3, 0x1d, 0x22, 0x3a, 0x3f, 0x34, 0x34, 0x74, 0xbf, 0xa3, 0xa3, 0xa3, 0xed, 0x6f,
0xc5, 0x36, 0x36, 0x36, 0xf6, 0xd2, 0xe9, 0xf4, 0xc3, 0x5a, 0xe7, 0x28, 0x8c, 0x8e, 0x88, 0x3a,
0xad, 0x5c, 0x6e, 0xad, 0xa5, 0xe5, 0xec, 0x39, 0x21, 0x08, 0x44, 0x04, 0x41, 0xa5, 0x2d, 0x11,
0x01, 0xe1, 0x7e, 0x69, 0x72, 0x65, 0xab, 0xd7, 0xda, 0xea, 0xea, 0x76, 0x5f, 0x5f, 0xdf, 0xa5,
0x58, 0x47, 0x65, 0x18, 0x35, 0x34, 0x08, 0x64, 0xb3, 0x59, 0x28, 0xa5, 0x2a, 0x20, 0x6d, 0x02,
0x28, 0x7a, 0x41, 0x44, 0xec, 0x4b, 0xa1, 0xd0, 0x3e, 0x36, 0x36, 0x76, 0x47, 0x4a, 0xa9, 0x26,
0x26, 0x26, 0xa6, 0x99, 0x79, 0xb7, 0xa6, 0xa3, 0x7c, 0xa1, 0xb0, 0xde, 0xd6, 0xda, 0x9a, 0xf8,
0x34, 0x3f, 0x8f, 0x54, 0x2a, 0x55, 0x72, 0x25, 0x44, 0xc5, 0x95, 0xe9, 0x86, 0x6a, 0xc1, 0x4b,
0x15, 0x24, 0x12, 0x89, 0x24, 0x33, 0x2f, 0xd7, 0x73, 0x04, 0x12, 0x02, 0x82, 0x08, 0xcc, 0x8c,
0xdd, 0xdd, 0x5d, 0xec, 0xed, 0xed, 0xfd, 0x11, 0x2c, 0x8b, 0xc6, 0xba, 0x2c, 0x27, 0x03, 0xe0,
0x32, 0x11, 0x35, 0x01, 0xf8, 0xca, 0xcc, 0x5b, 0x51, 0x10, 0x00, 0x51, 0x7e, 0x1e, 0x42, 0x08,
0x6c, 0x6e, 0x6e, 0x62, 0xf0, 0xfa, 0x20, 0x02, 0x15, 0x54, 0x8e, 0x47, 0x9c, 0xd5, 0x8f, 0x52,
0xfc, 0x70, 0x9c, 0x34, 0x01, 0x18, 0x19, 0x19, 0x79, 0x01, 0xe0, 0x6e, 0x4d, 0x47, 0xe1, 0x5d,
0x0b, 0x21, 0x10, 0xa8, 0x00, 0x41, 0x10, 0x40, 0x69, 0x8d, 0x11, 0x19, 0x86, 0x2b, 0xdd, 0x2b,
0x88, 0xd0, 0xd4, 0xd4, 0x44, 0x55, 0xd1, 0xc1, 0x70, 0x44, 0x00, 0x84, 0x10, 0xa5, 0xc6, 0xd0,
0x9f, 0x95, 0x01, 0xaa, 0x44, 0x69, 0x38, 0xd4, 0x23, 0x6e, 0x34, 0xc2, 0x8d, 0xb6, 0x75, 0x59,
0x3c, 0x84, 0x08, 0xed, 0x98, 0x0e, 0x09, 0x05, 0x89, 0xe8, 0xe8, 0x17, 0x36, 0xb4, 0x1d, 0x4e,
0x16, 0x9a, 0x90, 0x0e, 0x10, 0x75, 0x22, 0x3c, 0x11, 0x08, 0xfa, 0x45, 0x9a, 0x30, 0x97, 0x3b,
0x31, 0xec, 0xc8, 0x93, 0x42, 0x62, 0x1d, 0xe9, 0x2b, 0x82, 0x09, 0x09, 0xa3, 0x84, 0x31, 0xff,
0xd8, 0x20, 0x1d, 0x10, 0x11, 0xd0, 0x22, 0xd3, 0x9b, 0xc2, 0x04, 0x1c, 0xff, 0x19, 0x95, 0x45,
0x75, 0xa0, 0x20, 0x82, 0x32, 0x9a, 0x22, 0xce, 0x4d, 0x3d, 0x58, 0xb5, 0xa3, 0x98, 0x18, 0x4d,
0xc8, 0x3f, 0x81, 0x62, 0x23, 0x34, 0xce, 0x99, 0xae, 0x98, 0x19, 0x41, 0x10, 0x40, 0x5b, 0x3f,
0x8f, 0x06, 0x45, 0x3a, 0x91, 0xb9, 0x0a, 0x6c, 0x42, 0x7c, 0xdf, 0x87, 0xeb, 0xba, 0x38, 0x3c,
0x3c, 0x84, 0x94, 0x12, 0x00, 0x70, 0xa6, 0xb9, 0x19, 0xae, 0xe7, 0x57, 0x7f, 0x61, 0xa5, 0x94,
0x81, 0x10, 0x22, 0xb2, 0x6e, 0x51, 0x8d, 0x38, 0x4c, 0x98, 0xef, 0xfb, 0x38, 0x38, 0x38, 0x80,
0x6d, 0xdb, 0xb0, 0x2c, 0x0b, 0x5b, 0x5b, 0x5b, 0xc8, 0xe5, 0x72, 0xc8, 0x2e, 0x2e, 0x3a, 0x33,
0xaf, 0xdf, 0x8e, 0x9b, 0xa0, 0x6f, 0x3d, 0x3d, 0x3d, 0x37, 0xba, 0xba, 0xba, 0xfa, 0xad, 0x5c,
0x6e, 0x99, 0x8c, 0x85, 0xb2, 0x16, 0x8c, 0x88, 0xa0, 0x94, 0x82, 0xe3, 0x38, 0xd8, 0xdf, 0xdf,
0x47, 0xb1, 0x58, 0x44, 0x32, 0x99, 0x44, 0x6f, 0x6f, 0x0a, 0x3f, 0x5d, 0x57, 0xde, 0x1b, 0x1e,
0x4e, 0xad, 0xac, 0x2c, 0x2c, 0x45, 0xa2, 0x63, 0x66, 0x07, 0xc0, 0x47, 0x00, 0x48, 0x4f, 0x4e,
0x7e, 0x8f, 0x34, 0x47, 0xcc, 0xbb, 0xa2, 0x94, 0x82, 0xeb, 0xba, 0x70, 0x1c, 0x07, 0xed, 0xed,
0xed, 0xf0, 0xbc, 0x5f, 0x78, 0x37, 0x3b, 0xeb, 0x3d, 0x7f, 0xfa, 0xec, 0xea, 0xea, 0xd2, 0xd2,
0x66, 0xd5, 0x87, 0x4f, 0xaf, 0x81, 0x81, 0x81, 0x9b, 0xdd, 0xdd, 0xdd, 0x17, 0x6d, 0xdb, 0xbe,
0x96, 0xc9, 0x64, 0x6e, 0xd5, 0x6a, 0x80, 0x70, 0x48, 0x29, 0x61, 0xdb, 0x36, 0xf2, 0xf9, 0x3c,
0x3a, 0x3b, 0x2f, 0x60, 0xfa, 0xcd, 0xcc, 0xfe, 0xab, 0xa9, 0xa9, 0x2b, 0x73, 0x73, 0x73, 0xc5,
0x88, 0x28, 0x33, 0xd7, 0x1d, 0xfd, 0xfd, 0xfd, 0xb7, 0x3d, 0xcf, 0x63, 0xcf, 0xf3, 0x58, 0x4a,
0xc9, 0xbe, 0xef, 0xb3, 0xef, 0xfb, 0x1c, 0x04, 0x01, 0x2b, 0xa5, 0x98, 0x99, 0x59, 0x4a, 0xc9,
0x3b, 0x3b, 0x3b, 0xfc, 0xfe, 0xc3, 0x1c, 0x3f, 0x78, 0xf4, 0x78, 0x1d, 0x40, 0x4b, 0x2d, 0xad,
0xd8, 0xae, 0xb3, 0x2c, 0x6b, 0xfb, 0xe5, 0xe8, 0xe8, 0xb8, 0x20, 0xaa, 0xfb, 0x5b, 0xc6, 0x00,
0x3c, 0x3f, 0xc0, 0xc2, 0xe2, 0xf2, 0xe7, 0xa9, 0xcc, 0xf8, 0x13, 0x66, 0xf6, 0x63, 0xff, 0x82,
0xfe, 0x77, 0xfd, 0x06, 0x86, 0xd4, 0x50, 0x62, 0x0e, 0x3a, 0xfd, 0x94, 0x00, 0x00, 0x00, 0x00,
0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
};
const BITMAP_OPAQUE add_hierarchical_subsheet_xpm[1] = {{ png, sizeof( png ), "add_hierarchical_subsheet_xpm" }};
-25
View File
@@ -1,25 +0,0 @@
/* Do not modify this file, it was automatically generated by the
* PNG2cpp CMake script, using a *.png file as input.
*/
#include <bitmaps.h>
static const unsigned char png[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c,
0xce, 0x00, 0x00, 0x00, 0x79, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xdd, 0x94, 0x41, 0x0a, 0x00,
0x31, 0x08, 0x03, 0xfd, 0x4a, 0xff, 0x94, 0xff, 0xf6, 0xdc, 0xfd, 0x94, 0x7b, 0xda, 0x43, 0x65,
0x41, 0xad, 0x90, 0x82, 0x07, 0xc1, 0x8b, 0x0e, 0xc4, 0x18, 0x51, 0x55, 0x61, 0x94, 0xd0, 0x41,
0x00, 0xd4, 0x2b, 0x3b, 0x0c, 0x60, 0x7a, 0xb5, 0x81, 0xbe, 0x45, 0xb2, 0x86, 0x7a, 0xbd, 0x85,
0xc8, 0x33, 0xa6, 0xd7, 0xdf, 0x03, 0x65, 0xe4, 0x8b, 0xc8, 0xf6, 0x0b, 0x8a, 0x1c, 0xd4, 0x82,
0x82, 0x33, 0x97, 0x40, 0x34, 0xe9, 0x7a, 0xb9, 0x8e, 0xf6, 0xb0, 0x6d, 0xb3, 0x2e, 0x2c, 0x43,
0x25, 0xeb, 0x52, 0x87, 0xad, 0xb8, 0x8e, 0x0b, 0xca, 0x48, 0x71, 0xfa, 0xb0, 0xa9, 0x38, 0xa9,
0x44, 0x10, 0x0f, 0x44, 0x93, 0xae, 0x97, 0xeb, 0x68, 0x0f, 0xdb, 0x2a, 0xeb, 0x5e, 0x8c, 0x95,
0x3c, 0x73, 0x5c, 0xe2, 0x55, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42,
0x60, 0x82,
};
const BITMAP_OPAQUE array_footprint_xpm[1] = {{ png, sizeof( png ), "array_footprint_xpm" }};
//EOF
-53
View File
@@ -1,53 +0,0 @@
/* Do not modify this file, it was automatically generated by the
* PNG2cpp CMake script, using a *.png file as input.
*/
#include <bitmaps.h>
static const unsigned char png[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c,
0xce, 0x00, 0x00, 0x02, 0x47, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xa5, 0x96, 0x3b, 0x68, 0x14,
0x51, 0x14, 0x86, 0xbf, 0x35, 0x2f, 0x51, 0x13, 0x91, 0x10, 0x0b, 0x25, 0xac, 0x58, 0xc8, 0xfa,
0x48, 0xe9, 0x62, 0x10, 0x04, 0xc5, 0x07, 0x62, 0x40, 0x10, 0x14, 0x15, 0xb4, 0xb1, 0x50, 0x9b,
0x60, 0x63, 0x44, 0xf0, 0xd5, 0xa8, 0x20, 0xb1, 0x70, 0x35, 0xbb, 0x99, 0x7b, 0xee, 0x64, 0x4d,
0x70, 0x31, 0x24, 0x11, 0x93, 0xc1, 0x4a, 0x0b, 0xed, 0xac, 0xad, 0x6c, 0x6d, 0xec, 0x2c, 0x6c,
0x04, 0x0b, 0xe5, 0x5a, 0x78, 0x9c, 0x8c, 0x71, 0x77, 0xee, 0x5d, 0x2c, 0x06, 0x06, 0xe6, 0x3f,
0x7c, 0xe7, 0x7d, 0x06, 0xe7, 0x1c, 0xa1, 0x0f, 0x77, 0x58, 0xd5, 0x96, 0x1e, 0x0a, 0xe9, 0x7b,
0xb0, 0x91, 0x70, 0x19, 0xe1, 0x0d, 0x31, 0xbd, 0x41, 0x7a, 0xcb, 0x59, 0x2c, 0x63, 0xbc, 0xa5,
0x33, 0x18, 0x84, 0x70, 0x02, 0xe1, 0x27, 0x82, 0x43, 0xb8, 0xea, 0xd5, 0x1b, 0x8e, 0x22, 0x24,
0x08, 0x09, 0x11, 0xfb, 0x83, 0x40, 0x58, 0xf6, 0x21, 0x7c, 0x57, 0xc8, 0xbc, 0x2f, 0x7d, 0x4c,
0x32, 0x8c, 0x61, 0x09, 0x21, 0xc1, 0x70, 0x29, 0x28, 0x75, 0x44, 0x0c, 0x21, 0x7c, 0x55, 0xc8,
0x3b, 0x2a, 0xf4, 0x78, 0x22, 0xd9, 0x89, 0x65, 0x41, 0x21, 0xd7, 0x71, 0x01, 0x35, 0xc2, 0x52,
0x44, 0xf8, 0xac, 0x90, 0x0f, 0x44, 0xac, 0xf7, 0x44, 0x5e, 0xc4, 0xf0, 0x5c, 0x53, 0x76, 0x9f,
0x88, 0xae, 0xbf, 0xbe, 0x37, 0x35, 0x9a, 0xa6, 0x1f, 0xe1, 0xa3, 0x42, 0x3e, 0x11, 0xb3, 0x29,
0x17, 0x32, 0xc5, 0x00, 0x96, 0x3a, 0x42, 0x82, 0xe5, 0x31, 0x33, 0xac, 0xfd, 0x47, 0xd3, 0x24,
0x5d, 0x6b, 0x10, 0xde, 0x2b, 0xe4, 0x0b, 0x11, 0xa5, 0x5c, 0x48, 0x4c, 0x2f, 0x42, 0x55, 0xd3,
0x15, 0xf3, 0x84, 0xfe, 0xa6, 0xba, 0x15, 0x73, 0xd2, 0x89, 0xe1, 0x95, 0x42, 0xbe, 0x11, 0x33,
0x9c, 0x0b, 0xa9, 0xd0, 0x83, 0xf0, 0x40, 0x23, 0x69, 0x30, 0xc1, 0x60, 0x4b, 0xed, 0x8a, 0x3c,
0xd7, 0x15, 0xf2, 0x03, 0xc3, 0x48, 0x2e, 0x64, 0x8e, 0x0e, 0x84, 0x9b, 0x1a, 0xc9, 0x02, 0x75,
0x4f, 0xe4, 0x99, 0x8e, 0xb9, 0xa7, 0x10, 0x87, 0x70, 0x21, 0x60, 0xb6, 0x46, 0xb5, 0xf0, 0x8b,
0x58, 0xca, 0x5e, 0xbd, 0x1a, 0x9d, 0x49, 0x21, 0x86, 0x1b, 0x01, 0x90, 0xe3, 0x99, 0x81, 0x3c,
0x1c, 0x34, 0xf4, 0xce, 0x39, 0x98, 0x60, 0x1d, 0xc2, 0x6b, 0x84, 0x6a, 0x4b, 0x61, 0x8d, 0xcd,
0x08, 0x07, 0xb4, 0x36, 0x7d, 0x58, 0x1e, 0x62, 0x38, 0x9d, 0x33, 0x53, 0xdb, 0xb2, 0x91, 0x66,
0x73, 0xde, 0xdd, 0x6a, 0xea, 0x69, 0xb0, 0x01, 0xc1, 0x6a, 0x3d, 0x8e, 0x68, 0xe3, 0x74, 0x7b,
0x9c, 0x7a, 0x86, 0xb0, 0x88, 0xb0, 0x27, 0x6c, 0x05, 0xfd, 0x6e, 0xf7, 0x8a, 0xa6, 0xea, 0x29,
0x53, 0x0c, 0xe4, 0xea, 0xb3, 0x4e, 0x09, 0xb5, 0x3f, 0x4b, 0xd8, 0x07, 0xe9, 0x42, 0xb8, 0xab,
0x46, 0xb3, 0x58, 0x8a, 0x01, 0x4e, 0x3d, 0x52, 0xfd, 0x34, 0x35, 0x36, 0xfa, 0x57, 0x90, 0xa3,
0x80, 0xe5, 0x9a, 0x1a, 0xbd, 0xc0, 0xb2, 0xab, 0x2d, 0xa7, 0xea, 0x6c, 0xf1, 0xae, 0x20, 0x9d,
0xa9, 0x8b, 0x5a, 0x93, 0x25, 0x2c, 0x7b, 0xf3, 0x3b, 0x8a, 0x02, 0x26, 0xe3, 0x54, 0xc4, 0x90,
0x77, 0x05, 0x69, 0xc7, 0x9c, 0xca, 0xb4, 0xef, 0xb1, 0x80, 0x3a, 0x7a, 0x9d, 0x6a, 0x36, 0x23,
0x87, 0x52, 0x88, 0xe1, 0x5c, 0xc0, 0xbd, 0x3a, 0x99, 0xd1, 0x8f, 0x84, 0xae, 0xa0, 0xb2, 0xb6,
0x64, 0x82, 0x30, 0x1a, 0x70, 0x49, 0x0f, 0xa6, 0x10, 0xe1, 0x7c, 0xd8, 0x0a, 0x8a, 0x28, 0x61,
0xd2, 0xa3, 0x75, 0x8b, 0x39, 0x3a, 0x3c, 0x90, 0xdd, 0x18, 0x5e, 0x2a, 0xe4, 0x4a, 0xe8, 0x66,
0x18, 0xc4, 0xd2, 0x50, 0xa3, 0x71, 0xef, 0x25, 0x8d, 0x28, 0x21, 0xcc, 0xab, 0xfe, 0xb6, 0xcf,
0xa9, 0x65, 0xd0, 0x24, 0x3b, 0x10, 0x66, 0xb3, 0x03, 0xe6, 0xa9, 0x4b, 0x59, 0x4f, 0xf6, 0x38,
0x75, 0x56, 0x07, 0xef, 0x3a, 0xe7, 0x1c, 0x54, 0xd9, 0xca, 0xcc, 0xf2, 0x80, 0x05, 0x2c, 0xd6,
0xed, 0x54, 0xe8, 0x0b, 0xd6, 0xb7, 0xf3, 0x43, 0xf8, 0x3f, 0xcf, 0x2f, 0x78, 0xbb, 0x45, 0x34,
0xcd, 0x8e, 0xb0, 0xa7, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
};
const BITMAP_OPAQUE array_line_xpm[1] = {{ png, sizeof( png ), "array_line_xpm" }};
//EOF
-25
View File
@@ -1,25 +0,0 @@
/* Do not modify this file, it was automatically generated by the
* PNG2cpp CMake script, using a *.png file as input.
*/
#include <bitmaps.h>
static const unsigned char png[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c,
0xce, 0x00, 0x00, 0x00, 0x79, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xdd, 0x94, 0x41, 0x0a, 0x00,
0x31, 0x08, 0x03, 0xfd, 0x4a, 0xff, 0x94, 0xff, 0xf6, 0xdc, 0xfd, 0x94, 0x7b, 0xda, 0x43, 0x65,
0x41, 0xad, 0x90, 0x82, 0x07, 0xc1, 0x8b, 0x0e, 0xc4, 0x18, 0x51, 0x55, 0x61, 0x94, 0xd0, 0x41,
0x00, 0xd4, 0x2b, 0x3b, 0x0c, 0x60, 0x7a, 0xb5, 0x81, 0xbe, 0x45, 0xb2, 0x86, 0x7a, 0xbd, 0x85,
0xc8, 0x33, 0xa6, 0xd7, 0xdf, 0x03, 0x65, 0xe4, 0x8b, 0xc8, 0xf6, 0x0b, 0x8a, 0x1c, 0xd4, 0x82,
0x82, 0x33, 0x97, 0x40, 0x34, 0xe9, 0x7a, 0xb9, 0x8e, 0xf6, 0xb0, 0x6d, 0xb3, 0x2e, 0x2c, 0x43,
0x25, 0xeb, 0x52, 0x87, 0xad, 0xb8, 0x8e, 0x0b, 0xca, 0x48, 0x71, 0xfa, 0xb0, 0xa9, 0x38, 0xa9,
0x44, 0x10, 0x0f, 0x44, 0x93, 0xae, 0x97, 0xeb, 0x68, 0x0f, 0xdb, 0x2a, 0xeb, 0x5e, 0x8c, 0x95,
0x3c, 0x73, 0x5c, 0xe2, 0x55, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42,
0x60, 0x82,
};
const BITMAP_OPAQUE array_module_xpm[1] = {{ png, sizeof( png ), "array_module_xpm" }};
//EOF
-77
View File
@@ -1,77 +0,0 @@
/* Do not modify this file, it was automatically generated by the
* PNG2cpp CMake script, using a *.png file as input.
*/
#include <bitmaps.h>
static const unsigned char png[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c,
0xce, 0x00, 0x00, 0x03, 0xbe, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xbd, 0x96, 0xdd, 0x4b, 0x54,
0x41, 0x18, 0xc6, 0x67, 0x3f, 0xda, 0x2b, 0x53, 0x28, 0x93, 0xa0, 0x08, 0xef, 0x14, 0x8a, 0x4c,
0x44, 0x2c, 0x8c, 0x2d, 0xcb, 0x4a, 0xc1, 0x7f, 0xa0, 0x8b, 0xfe, 0x82, 0xa0, 0x8b, 0x8a, 0x22,
0xf2, 0x63, 0x3d, 0x47, 0x57, 0x4b, 0xca, 0x42, 0xd4, 0xf5, 0xb3, 0x34, 0xf3, 0x83, 0x5c, 0x95,
0x45, 0x02, 0x15, 0x0c, 0xfb, 0x07, 0x8a, 0x84, 0x10, 0x45, 0x23, 0x24, 0x24, 0xa2, 0x8b, 0x6e,
0x82, 0xbc, 0xc8, 0xde, 0xdf, 0x38, 0x47, 0x8f, 0xeb, 0x6e, 0x7a, 0x61, 0x5d, 0x3c, 0x9c, 0x61,
0xce, 0xcc, 0x3c, 0xf3, 0x3e, 0xef, 0x33, 0xef, 0x8c, 0x5a, 0x5b, 0x5b, 0x53, 0xff, 0x03, 0x89,
0x3b, 0x43, 0xea, 0x80, 0xa0, 0x44, 0x50, 0xa6, 0xc2, 0xea, 0xd0, 0x8e, 0x8b, 0xd4, 0xab, 0x34,
0x65, 0xa9, 0x7c, 0x55, 0xa1, 0xf2, 0xd4, 0x1d, 0xb5, 0x7f, 0x47, 0x22, 0x59, 0x38, 0x5d, 0x30,
0xa6, 0xaa, 0xd5, 0x6f, 0xf9, 0x7e, 0xd7, 0x58, 0x6f, 0x4f, 0xab, 0x1a, 0x75, 0x64, 0xdb, 0xe4,
0xb0, 0x3a, 0x18, 0xa8, 0x09, 0xd4, 0xca, 0x98, 0x58, 0xca, 0x83, 0x94, 0xfe, 0x94, 0xba, 0x94,
0x7e, 0xda, 0x7e, 0xcb, 0x5f, 0x2e, 0x73, 0x52, 0x13, 0x12, 0x19, 0x92, 0xaf, 0x82, 0xcf, 0x82,
0x49, 0x41, 0x4c, 0xa3, 0x4a, 0x4d, 0xc8, 0xf7, 0x93, 0xe0, 0x87, 0x20, 0xd3, 0x35, 0x3e, 0xc3,
0x67, 0xfb, 0x06, 0x73, 0x9e, 0x9d, 0xec, 0x6c, 0x5e, 0x7a, 0x64, 0x0d, 0x7d, 0xeb, 0xa9, 0x00,
0x4f, 0xe6, 0x1f, 0xda, 0xd9, 0x6d, 0x59, 0xdd, 0xf2, 0xaf, 0xcf, 0x4d, 0xe6, 0x26, 0x1a, 0x33,
0x24, 0x31, 0x43, 0xf4, 0x51, 0x30, 0x27, 0x98, 0x32, 0x7d, 0x8b, 0xb2, 0xdb, 0xb7, 0xce, 0xf8,
0x80, 0x1d, 0xa8, 0x2f, 0xec, 0x2b, 0x88, 0xb0, 0xf8, 0xe3, 0xf9, 0xb0, 0x7d, 0x71, 0xe8, 0x7c,
0xa4, 0x34, 0x7a, 0xb9, 0xa5, 0x69, 0xa9, 0x41, 0x93, 0x42, 0x46, 0x64, 0x5b, 0x88, 0x74, 0x4e,
0xd6, 0x25, 0x9a, 0x34, 0xf8, 0x65, 0xbe, 0x51, 0xc1, 0xaa, 0xe0, 0x8d, 0xe0, 0xb5, 0x6e, 0xdb,
0x2a, 0x0b, 0x19, 0x7d, 0x96, 0x6f, 0xb4, 0xe7, 0x4b, 0x5b, 0x95, 0x3d, 0x5b, 0x19, 0xa6, 0xed,
0xb7, 0xfd, 0x15, 0xb2, 0x70, 0xad, 0x60, 0x04, 0x32, 0x22, 0x43, 0x46, 0x27, 0x67, 0x0e, 0x51,
0x89, 0xc9, 0x49, 0xcc, 0x44, 0x32, 0xe1, 0x8a, 0x14, 0x09, 0x16, 0xcc, 0xbf, 0x15, 0x99, 0x7c,
0x55, 0x88, 0x82, 0x19, 0x8d, 0xe9, 0xbd, 0xec, 0xfc, 0x74, 0x6f, 0x7e, 0xbb, 0xd7, 0xf2, 0xde,
0x74, 0xc6, 0x43, 0x46, 0x64, 0xfc, 0xd3, 0x39, 0x13, 0x83, 0xb8, 0x89, 0xca, 0x5c, 0x44, 0xc8,
0x15, 0x75, 0x11, 0x45, 0xb4, 0x6c, 0x9b, 0x44, 0xd7, 0x04, 0x45, 0x87, 0x1b, 0x33, 0x34, 0x51,
0xde, 0xf3, 0x53, 0x1d, 0x5e, 0xdb, 0x7b, 0x7d, 0x83, 0x48, 0x22, 0x43, 0x46, 0x4d, 0x24, 0x06,
0xc1, 0x8d, 0x9b, 0x44, 0x62, 0x61, 0x2d, 0xdd, 0x7a, 0xe2, 0xa7, 0x8c, 0x5c, 0x2f, 0x0c, 0x09,
0x32, 0xce, 0x08, 0xc6, 0x75, 0xbf, 0xa5, 0x8e, 0xcb, 0xf7, 0x98, 0xcf, 0xf2, 0x8c, 0xf6, 0xad,
0x74, 0x56, 0x56, 0xbc, 0xbf, 0x5b, 0x47, 0x1b, 0x32, 0xc1, 0x2d, 0x64, 0x24, 0x67, 0x18, 0x44,
0x4b, 0x27, 0xd6, 0x8f, 0x37, 0xc3, 0xb4, 0x71, 0x57, 0xcc, 0xe4, 0x64, 0xc1, 0x44, 0x32, 0xa3,
0xfb, 0xaa, 0xd5, 0xbc, 0x7c, 0xdf, 0xa9, 0x35, 0xe5, 0x01, 0xfb, 0x6a, 0xf6, 0x3d, 0x2d, 0x1a,
0x0c, 0xea, 0x9d, 0x43, 0x46, 0x64, 0xc8, 0x48, 0xce, 0xe8, 0xc3, 0x8d, 0x58, 0x7f, 0xbb, 0xeb,
0x24, 0xc1, 0xc6, 0xc2, 0x8b, 0x26, 0xf1, 0x31, 0x83, 0x71, 0x4d, 0x52, 0xad, 0x7e, 0x4a, 0x3b,
0xdb, 0xb5, 0xb1, 0xa3, 0x9e, 0x6a, 0xcf, 0x30, 0x64, 0x44, 0xe6, 0xd8, 0x1b, 0x83, 0xe0, 0x46,
0xac, 0xcf, 0x39, 0x4b, 0x76, 0x60, 0x33, 0xb1, 0xb0, 0x91, 0x6e, 0xc5, 0x60, 0x55, 0x47, 0xe2,
0x22, 0x71, 0x93, 0x11, 0x19, 0xd2, 0x91, 0x33, 0x0c, 0x82, 0x74, 0x58, 0x9f, 0x73, 0xb6, 0x73,
0x09, 0xc2, 0xc2, 0xb8, 0x8b, 0xc4, 0x93, 0x13, 0x91, 0x2a, 0x79, 0x0d, 0x13, 0x29, 0x25, 0x67,
0x18, 0x04, 0x37, 0x26, 0xaa, 0x20, 0xc9, 0x89, 0x90, 0x91, 0x49, 0x4c, 0x66, 0x91, 0xbd, 0x26,
0x22, 0x5c, 0xc2, 0xf6, 0x88, 0x14, 0xc8, 0x80, 0x1c, 0xc8, 0x82, 0x3c, 0xc8, 0xb4, 0x1b, 0xe9,
0x98, 0xfb, 0x57, 0xe9, 0x48, 0x9c, 0xe8, 0x3b, 0x94, 0xdf, 0x93, 0xdb, 0xd1, 0xb5, 0xdc, 0x1c,
0x72, 0x92, 0xdb, 0xbb, 0xd2, 0x5e, 0x19, 0x1c, 0x38, 0xd3, 0x26, 0x0b, 0x44, 0xdd, 0x64, 0xda,
0x0c, 0x96, 0x67, 0x38, 0x38, 0x58, 0x18, 0x61, 0x8c, 0x33, 0x9e, 0xb9, 0xac, 0xc1, 0x5a, 0x09,
0xcd, 0x80, 0x15, 0x73, 0xba, 0x4f, 0x74, 0x31, 0xd8, 0x9e, 0x2d, 0x0f, 0x17, 0x88, 0x55, 0xb1,
0x2c, 0xd6, 0xa5, 0x0f, 0x32, 0x1d, 0x99, 0xcb, 0xde, 0x17, 0x86, 0x82, 0xad, 0x49, 0xed, 0x2d,
0x6b, 0x6d, 0xb3, 0xb7, 0xbe, 0x4f, 0xe4, 0x70, 0x71, 0xc8, 0x38, 0x6c, 0xfa, 0x00, 0x4a, 0x59,
0xe1, 0x10, 0xd2, 0x66, 0x21, 0x76, 0x4d, 0x5b, 0xe7, 0x23, 0xee, 0xc0, 0x7a, 0x9c, 0x03, 0x6b,
0x79, 0x6f, 0xd3, 0x4e, 0x7a, 0x60, 0x29, 0x13, 0x94, 0x0b, 0x76, 0x42, 0xf9, 0x90, 0x32, 0x72,
0xcf, 0xd9, 0x09, 0x0b, 0xb0, 0x5b, 0xfe, 0x91, 0x07, 0x9d, 0xf4, 0xf8, 0x12, 0x64, 0x79, 0x6f,
0xb8, 0x4a, 0x50, 0x28, 0x79, 0x09, 0x92, 0xc2, 0x47, 0x01, 0xe4, 0x67, 0x69, 0xb4, 0xb8, 0x45,
0x92, 0x69, 0xb9, 0x88, 0x6e, 0x21, 0x23, 0xff, 0x48, 0xb6, 0x71, 0xd6, 0x46, 0x51, 0x2d, 0xe8,
0xcd, 0x8b, 0x2f, 0xaa, 0xf6, 0x95, 0xe1, 0xe2, 0xd6, 0xc4, 0x45, 0x55, 0x4a, 0x39, 0x61, 0x52,
0xda, 0x81, 0x3e, 0x74, 0x56, 0xc0, 0x26, 0x32, 0x24, 0x22, 0x67, 0x24, 0x19, 0x59, 0x8c, 0xf5,
0x37, 0xae, 0x89, 0xd0, 0x87, 0xfb, 0xba, 0xd6, 0x31, 0x96, 0x0d, 0xfa, 0x2d, 0xdf, 0x88, 0xb3,
0xce, 0xb6, 0x6b, 0xc2, 0xec, 0xa4, 0x9c, 0xcb, 0xca, 0xb9, 0x25, 0x89, 0x0c, 0x09, 0xd0, 0x9b,
0x3e, 0x9c, 0x84, 0x6d, 0x13, 0x5d, 0x7c, 0x0d, 0x73, 0xb5, 0x35, 0xe7, 0x06, 0xce, 0xb6, 0x5d,
0x7a, 0x55, 0x14, 0x61, 0x6e, 0xd2, 0x8b, 0xcf, 0xd8, 0x35, 0x95, 0xeb, 0x97, 0x01, 0xce, 0x60,
0x40, 0x52, 0x71, 0x90, 0xb6, 0xab, 0xeb, 0x6c, 0x38, 0x57, 0x79, 0xae, 0xe4, 0xa8, 0x63, 0xb9,
0x29, 0xb4, 0xeb, 0xab, 0xdc, 0x21, 0xd3, 0x0f, 0x0b, 0x1e, 0x1b, 0xa2, 0xaf, 0x4e, 0xa6, 0xb4,
0xf5, 0x03, 0xc4, 0x75, 0x26, 0xe2, 0x1f, 0x27, 0x52, 0x5c, 0x63, 0x69, 0xf5, 0xa9, 0x2f, 0x77,
0xf5, 0x38, 0xd9, 0xd2, 0x49, 0xce, 0x78, 0x3a, 0xf1, 0x84, 0x32, 0xf6, 0xdc, 0xd3, 0xe7, 0xd6,
0xbf, 0xc4, 0x1f, 0x25, 0x18, 0x28, 0x89, 0x49, 0x82, 0xc8, 0xc4, 0x00, 0x00, 0x00, 0x00, 0x49,
0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
};
const BITMAP_OPAQUE array_pad_xpm[1] = {{ png, sizeof( png ), "array_pad_xpm" }};
//EOF
-51
View File
@@ -1,51 +0,0 @@
/* Do not modify this file, it was automatically generated by the
* PNG2cpp CMake script, using a *.png file as input.
*/
#include <bitmaps.h>
static const unsigned char png[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c,
0xce, 0x00, 0x00, 0x02, 0x22, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xbd, 0x94, 0x4f, 0x4b, 0x1b,
0x41, 0x18, 0x87, 0x67, 0xc1, 0x59, 0xdd, 0x4d, 0xb6, 0x69, 0x24, 0xb6, 0xb6, 0x62, 0xbd, 0x0a,
0x31, 0x15, 0x94, 0x5d, 0x12, 0x6a, 0xbd, 0xd9, 0xcf, 0xe1, 0xb9, 0x58, 0xe8, 0x27, 0x29, 0x3d,
0xf5, 0xd8, 0x4b, 0xa1, 0xe0, 0x45, 0xb1, 0xc1, 0x4b, 0xa1, 0x9d, 0x0f, 0xe0, 0xd5, 0x8b, 0x8a,
0x87, 0xf6, 0xa4, 0xa0, 0x87, 0xf6, 0x94, 0x16, 0xe9, 0x74, 0x9e, 0x25, 0x23, 0x13, 0x49, 0xc2,
0xfe, 0x09, 0x2e, 0xbc, 0x2c, 0x3b, 0xb3, 0xef, 0x3e, 0xf3, 0xbe, 0xbf, 0x77, 0x7f, 0x42, 0x6b,
0x2d, 0x86, 0x85, 0xb9, 0xf4, 0xa8, 0xbd, 0x31, 0x39, 0x6a, 0xe4, 0xde, 0x9d, 0x17, 0xa3, 0xa8,
0x22, 0xde, 0x35, 0x1e, 0xca, 0x73, 0x40, 0x73, 0xb3, 0xf2, 0x84, 0x67, 0xd6, 0xc7, 0x7c, 0x3c,
0xac, 0x86, 0xe2, 0x75, 0xa3, 0x26, 0x3f, 0x03, 0x6a, 0xd4, 0xe5, 0x27, 0x9e, 0x59, 0x1f, 0x0a,
0x32, 0x57, 0x1c, 0xcc, 0x78, 0x57, 0xeb, 0xab, 0xf3, 0x37, 0x9d, 0x76, 0xc2, 0x82, 0x3e, 0xea,
0x6e, 0xea, 0x37, 0xdb, 0x8b, 0xbd, 0x30, 0xf0, 0x2e, 0xd9, 0x1f, 0x02, 0x59, 0x0e, 0xa6, 0xbd,
0x83, 0xb5, 0xe7, 0xf3, 0xdf, 0x3a, 0xed, 0x58, 0x01, 0x3a, 0xea, 0xbe, 0x54, 0x3b, 0xdb, 0x8b,
0x5f, 0x4d, 0xce, 0x3e, 0xfb, 0x03, 0x20, 0x4e, 0x3c, 0xe3, 0x7b, 0xd7, 0xed, 0x64, 0x45, 0xb7,
0x5a, 0x2d, 0xbd, 0xb1, 0xf1, 0x22, 0x05, 0xf5, 0xce, 0x5e, 0xe9, 0x3f, 0x27, 0x1d, 0xdd, 0xfd,
0xb8, 0xae, 0xfb, 0xb0, 0xc8, 0xad, 0x64, 0xda, 0xf7, 0xbe, 0xb4, 0xe3, 0x15, 0x65, 0x72, 0x94,
0xc9, 0x49, 0x41, 0xbd, 0xb3, 0x2d, 0xf5, 0xf7, 0xb4, 0xa3, 0x4c, 0x8e, 0xea, 0xc3, 0xc2, 0x5b,
0x10, 0xed, 0x59, 0x7a, 0xf6, 0xf8, 0x1f, 0x10, 0x00, 0x2e, 0xe8, 0xe6, 0xb8, 0x96, 0xc2, 0xa8,
0x8c, 0xf7, 0x2c, 0x88, 0xf6, 0x98, 0x9c, 0xef, 0x40, 0x00, 0xb8, 0x20, 0x93, 0x93, 0xc2, 0xa8,
0x8c, 0xf7, 0x6e, 0x41, 0xf5, 0x9a, 0xfc, 0x91, 0x24, 0x49, 0x0a, 0xb0, 0x61, 0x41, 0x36, 0x68,
0x23, 0x9a, 0x59, 0x90, 0xc9, 0xd9, 0x8d, 0xe3, 0x38, 0x05, 0xd8, 0xb0, 0x20, 0x1b, 0xb4, 0x11,
0xcd, 0xfa, 0x1d, 0x10, 0xba, 0x40, 0xa8, 0xdc, 0x01, 0x8d, 0x93, 0x72, 0x62, 0xb7, 0x02, 0xdb,
0x42, 0x1b, 0x54, 0x1c, 0x55, 0xa6, 0x2e, 0x6c, 0x45, 0x9c, 0x94, 0x13, 0xbb, 0x15, 0xd8, 0x16,
0xda, 0xa0, 0xe2, 0x28, 0x9c, 0xda, 0x1b, 0xd0, 0x08, 0x0d, 0xd0, 0x02, 0x4d, 0x5c, 0x10, 0x77,
0xb4, 0x5b, 0x78, 0xfa, 0x48, 0x87, 0xa1, 0xf8, 0xe0, 0x6a, 0x84, 0x06, 0x68, 0x81, 0x26, 0x2e,
0x88, 0x3b, 0xda, 0x2d, 0x3c, 0x99, 0x53, 0x41, 0x20, 0xde, 0x0e, 0x4c, 0x1d, 0x53, 0xc5, 0x74,
0x01, 0x73, 0x41, 0x40, 0x9a, 0xcd, 0xa6, 0x96, 0xd2, 0xfb, 0x7d, 0x77, 0xea, 0x98, 0x2a, 0xa6,
0x0b, 0x98, 0x0b, 0x02, 0x62, 0x72, 0x94, 0xef, 0x7b, 0x87, 0x03, 0x53, 0x67, 0xff, 0x23, 0x60,
0x54, 0x46, 0x1b, 0x01, 0xd1, 0x2e, 0x2a, 0xf1, 0xa5, 0xf7, 0x6b, 0xd4, 0x7f, 0x04, 0x8c, 0xca,
0x68, 0x23, 0x20, 0xda, 0x45, 0x25, 0x7d, 0xc8, 0xf2, 0x58, 0x67, 0x40, 0x33, 0x40, 0xf5, 0x07,
0xf2, 0x67, 0xb5, 0x22, 0xde, 0x67, 0x72, 0x06, 0xa3, 0x19, 0x20, 0x93, 0xb3, 0x5b, 0x0d, 0xc4,
0xce, 0x48, 0x67, 0xb8, 0x57, 0xaf, 0xcb, 0x9a, 0x34, 0x09, 0x53, 0xcd, 0x64, 0x90, 0x65, 0x4d,
0x35, 0xb3, 0x41, 0x96, 0x31, 0xd5, 0x5c, 0x06, 0x59, 0xd8, 0x54, 0xf3, 0x1a, 0x64, 0x19, 0x53,
0xcd, 0x65, 0x90, 0x45, 0x4d, 0x55, 0xdd, 0x4b, 0x14, 0x31, 0xc8, 0xc2, 0xa6, 0x9a, 0xd7, 0x20,
0xcb, 0x98, 0x6a, 0x2e, 0x83, 0x2c, 0x6b, 0xaa, 0x99, 0x0d, 0x72, 0x12, 0xa6, 0x9a, 0xc9, 0x20,
0x27, 0x6d, 0xaa, 0x13, 0xf5, 0xba, 0xff, 0x0c, 0x96, 0xd3, 0x5f, 0x78, 0x1d, 0xd5, 0x5b, 0x00,
0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
};
const BITMAP_OPAQUE array_target_xpm[1] = {{ png, sizeof( png ), "array_target_xpm" }};
//EOF
-39
View File
@@ -1,39 +0,0 @@
/* Do not modify this file, it was automatically generated by the
* PNG2cpp CMake script, using a *.png file as input.
*/
#include <bitmaps.h>
static const unsigned char png[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c,
0xce, 0x00, 0x00, 0x01, 0x5a, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xed, 0x96, 0xbf, 0x6a, 0xc2,
0x50, 0x14, 0x87, 0x3f, 0xf0, 0x19, 0x74, 0xaa, 0xe0, 0x22, 0xd2, 0x41, 0x9c, 0x9c, 0x25, 0xe0,
0xe6, 0xe2, 0xe0, 0x24, 0xf8, 0x06, 0x4e, 0x4e, 0xe9, 0xe6, 0xe6, 0x13, 0x88, 0xc9, 0xbd, 0x37,
0x06, 0x1c, 0x5d, 0x2c, 0x9d, 0xba, 0xfa, 0x2e, 0x0e, 0x7d, 0x07, 0x0b, 0xe9, 0x70, 0xae, 0xb1,
0x49, 0x73, 0x6d, 0x1a, 0x4a, 0xa1, 0xe0, 0xf0, 0x1b, 0xce, 0x9f, 0x1f, 0x1f, 0xc9, 0xe1, 0x1c,
0x2e, 0x49, 0x92, 0xf0, 0x17, 0x02, 0xcc, 0x1c, 0xf4, 0x5b, 0x79, 0x99, 0x39, 0x98, 0x11, 0xa8,
0x5d, 0x79, 0x99, 0x11, 0xa0, 0x7d, 0xd0, 0x09, 0xe8, 0x13, 0xe8, 0x57, 0xd0, 0x47, 0x1b, 0x5f,
0x74, 0xb4, 0xf9, 0x93, 0x8d, 0x7d, 0xd0, 0x13, 0xd0, 0x2f, 0x60, 0x62, 0xd0, 0x4b, 0xd0, 0x2b,
0x89, 0x53, 0xad, 0x24, 0x6f, 0x62, 0x1b, 0x4f, 0x2e, 0xa0, 0x77, 0x50, 0x7d, 0xf9, 0xc4, 0x4d,
0x2b, 0x0b, 0xda, 0xb4, 0x24, 0xaf, 0xfa, 0xd2, 0x97, 0x82, 0x9e, 0x21, 0x68, 0x4b, 0x6d, 0xd7,
0xc8, 0x82, 0x76, 0x0d, 0xc9, 0x07, 0x6d, 0xe9, 0x13, 0xd0, 0x23, 0x44, 0xde, 0xf5, 0x5f, 0x16,
0x83, 0xa4, 0x16, 0x79, 0xd2, 0xbf, 0x6e, 0x42, 0xdc, 0xbd, 0xe6, 0x8b, 0x41, 0x52, 0x8b, 0xbb,
0xb0, 0x6e, 0x16, 0x0c, 0xcd, 0x0d, 0x72, 0x0f, 0xda, 0x0d, 0x4a, 0x7b, 0xee, 0xa0, 0xff, 0x08,
0x52, 0xc3, 0x2c, 0x48, 0x0d, 0xbf, 0x07, 0x45, 0xbd, 0x2c, 0x28, 0xea, 0xdd, 0x04, 0x81, 0x5a,
0x80, 0x3e, 0xe7, 0x16, 0xf6, 0x0c, 0x6a, 0xe1, 0x86, 0x84, 0x63, 0x50, 0x87, 0x2c, 0x48, 0x1d,
0x20, 0x1c, 0xdf, 0x00, 0x99, 0xa9, 0x5d, 0xc8, 0x9c, 0xcc, 0xd4, 0x0d, 0x52, 0x03, 0xbb, 0xc0,
0x39, 0xa9, 0x41, 0xee, 0xd6, 0x45, 0x9d, 0xe2, 0x46, 0x97, 0xa2, 0x4e, 0x35, 0x4f, 0x7a, 0xb7,
0x4a, 0x6b, 0x52, 0xcd, 0x93, 0x9a, 0xd4, 0x0c, 0xf4, 0x03, 0x04, 0xb9, 0xc1, 0x06, 0x3d, 0xc9,
0xab, 0xd9, 0x57, 0xd0, 0x4f, 0x3c, 0x84, 0x1e, 0xa8, 0x27, 0xd8, 0xd7, 0x6e, 0x1f, 0xc8, 0x7d,
0x4d, 0xfa, 0x42, 0xaf, 0x92, 0xa7, 0xca, 0x4e, 0xfc, 0xd2, 0x1e, 0xdd, 0x41, 0x77, 0x50, 0x92,
0x00, 0xdb, 0xba, 0x7d, 0x6c, 0x7c, 0x5e, 0xb6, 0x25, 0x6c, 0xeb, 0x6e, 0x48, 0x39, 0x4f, 0xce,
0xa4, 0xfd, 0xe2, 0xe7, 0x92, 0xf6, 0xdd, 0xa0, 0x72, 0x1e, 0xfe, 0xea, 0x01, 0xf9, 0x01, 0xbd,
0x5c, 0x34, 0x23, 0x26, 0x7e, 0x75, 0xbb, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae,
0x42, 0x60, 0x82,
};
const BITMAP_OPAQUE array_text_xpm[1] = {{ png, sizeof( png ), "array_text_xpm" }};
//EOF
-51
View File
@@ -1,51 +0,0 @@
/* Do not modify this file, it was automatically generated by the
* PNG2cpp CMake script, using a *.png file as input.
*/
#include <bitmaps.h>
static const unsigned char png[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c,
0xce, 0x00, 0x00, 0x02, 0x1a, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xcd, 0x94, 0x3d, 0x88, 0x13,
0x41, 0x18, 0x86, 0xe7, 0x40, 0xbb, 0x20, 0xe1, 0x1a, 0x13, 0x3b, 0xb1, 0xb3, 0xb0, 0xbf, 0x43,
0x0e, 0xe5, 0x38, 0xbd, 0xd2, 0x46, 0x10, 0x04, 0x0b, 0x0b, 0x4b, 0xb9, 0xce, 0x9f, 0xc2, 0xcc,
0x9a, 0x9d, 0x9d, 0x9f, 0x6c, 0x22, 0xc1, 0x22, 0x6a, 0x27, 0x07, 0x5a, 0x18, 0xb2, 0xe4, 0xe4,
0x20, 0x46, 0x4c, 0x8a, 0x6b, 0x6c, 0xc5, 0xeb, 0x4e, 0x2c, 0x6c, 0x44, 0x39, 0x72, 0x57, 0xa8,
0xa0, 0x98, 0x1b, 0xdf, 0xec, 0xae, 0x49, 0x30, 0xeb, 0xdd, 0x8e, 0x03, 0xc1, 0xe2, 0xdd, 0x6f,
0x77, 0x66, 0xbe, 0x79, 0xe7, 0xe7, 0xdb, 0x87, 0x68, 0xad, 0xc9, 0x34, 0x14, 0x3d, 0x1c, 0xf2,
0x93, 0x50, 0xa2, 0x0f, 0x14, 0xc6, 0x0d, 0x13, 0x29, 0xa9, 0x43, 0xdd, 0x14, 0xaa, 0x8f, 0x8c,
0xa2, 0x89, 0xde, 0x61, 0xa2, 0xf7, 0x88, 0x3b, 0xd0, 0xd7, 0x38, 0x7e, 0x08, 0xdb, 0x47, 0xd2,
0x63, 0x46, 0x83, 0x49, 0x6e, 0x42, 0xb7, 0xa1, 0x0a, 0x29, 0x90, 0x87, 0x61, 0xa4, 0xe4, 0x4e,
0xdc, 0xfe, 0x5b, 0xdd, 0x3f, 0x8d, 0x3e, 0x42, 0x7d, 0x98, 0xed, 0x22, 0x6e, 0x86, 0xd1, 0x21,
0x7b, 0x78, 0xff, 0x1c, 0x2f, 0x60, 0xd2, 0xa8, 0x40, 0x18, 0x62, 0x00, 0x55, 0xa1, 0x95, 0x38,
0xae, 0x43, 0x22, 0x5c, 0x80, 0x43, 0x6e, 0x25, 0x19, 0xf5, 0xa1, 0xfb, 0x9e, 0xef, 0x5d, 0x10,
0x92, 0xb5, 0xa5, 0x64, 0x67, 0xf1, 0xcd, 0x63, 0xb3, 0x41, 0xff, 0x5e, 0xc2, 0x8e, 0x02, 0xf4,
0x2f, 0x16, 0x4b, 0xc5, 0xe3, 0x52, 0xf2, 0xcb, 0x52, 0xd2, 0x63, 0x68, 0x3b, 0x1d, 0x9b, 0xbd,
0x84, 0xd6, 0x26, 0x8d, 0xb0, 0x03, 0xae, 0xf8, 0xc5, 0x52, 0x59, 0xe8, 0x46, 0xf0, 0x4c, 0x2b,
0x9f, 0x6b, 0xe1, 0xbb, 0x0b, 0x63, 0x13, 0xef, 0x26, 0x18, 0x55, 0x95, 0x52, 0x27, 0x54, 0x59,
0xb4, 0x91, 0xf3, 0x42, 0xfa, 0x5e, 0x9b, 0x31, 0x96, 0x1f, 0x1b, 0x53, 0x4d, 0xda, 0xd1, 0x5b,
0xe9, 0xf3, 0x8d, 0xe6, 0x5a, 0xa0, 0x7b, 0xbd, 0x6d, 0xfd, 0xe4, 0xe9, 0xaa, 0x16, 0x8a, 0x0d,
0x95, 0xbf, 0x7b, 0xf4, 0x5e, 0x82, 0xd1, 0x8a, 0x2a, 0xf3, 0xab, 0xcd, 0xe7, 0x8d, 0x0e, 0x72,
0xba, 0xc8, 0xe9, 0x0a, 0xe5, 0x45, 0x2a, 0xb1, 0x56, 0xae, 0x98, 0x3b, 0x93, 0x7a, 0x47, 0xe8,
0x3b, 0x82, 0xa3, 0xdc, 0x12, 0xca, 0x7d, 0x85, 0xf7, 0x53, 0x69, 0x76, 0x84, 0xb2, 0x38, 0x8c,
0xa3, 0xbf, 0x81, 0x05, 0x5e, 0xc1, 0x98, 0xd9, 0x34, 0x77, 0x34, 0x38, 0x6b, 0x7d, 0xde, 0x5b,
0x72, 0x90, 0xd4, 0xa7, 0x94, 0x66, 0x52, 0xdc, 0xd1, 0x25, 0xa8, 0xb3, 0xec, 0x2d, 0xcf, 0x21,
0xa7, 0x8e, 0x9c, 0x43, 0xc9, 0x55, 0x17, 0xdd, 0xc5, 0x1b, 0xe8, 0x7b, 0x5c, 0x85, 0x3f, 0x10,
0x5f, 0x23, 0xa9, 0x87, 0x23, 0x79, 0xb0, 0x4f, 0xd5, 0x5d, 0x87, 0x1e, 0xc7, 0xdf, 0xab, 0xd0,
0x35, 0x21, 0x58, 0x85, 0x73, 0x7e, 0x6e, 0xbf, 0xff, 0xe8, 0x0b, 0xf4, 0x29, 0x6c, 0x2b, 0x44,
0x0b, 0x28, 0x96, 0x1c, 0x17, 0x66, 0xdf, 0xfe, 0xfa, 0x1f, 0x51, 0x52, 0x0b, 0xcb, 0x3a, 0x2a,
0x69, 0x77, 0x60, 0x28, 0x84, 0x3b, 0x2f, 0xa4, 0xfb, 0xc8, 0x88, 0x0c, 0x19, 0x9a, 0x39, 0xc9,
0x15, 0xab, 0x0d, 0x8f, 0xe2, 0x20, 0x32, 0x38, 0xa4, 0x95, 0xa5, 0xd9, 0x2c, 0xae, 0x60, 0x09,
0xe3, 0x67, 0xc8, 0x54, 0x59, 0x37, 0x3d, 0xa8, 0x1a, 0x02, 0xd2, 0x06, 0xaa, 0x46, 0x80, 0xb4,
0x81, 0xaa, 0x11, 0x20, 0x6d, 0xa0, 0x6a, 0x04, 0x48, 0x1b, 0xa8, 0x1a, 0x01, 0xd2, 0x06, 0xaa,
0x46, 0x80, 0xb4, 0x81, 0xaa, 0x11, 0x20, 0x6d, 0xa0, 0x6a, 0x04, 0x48, 0x1b, 0xa8, 0x1a, 0x01,
0xd2, 0x06, 0xaa, 0x46, 0x80, 0xfc, 0x77, 0xa8, 0x1a, 0x02, 0xf2, 0xbf, 0x86, 0xea, 0x2f, 0x73,
0x29, 0x07, 0xb2, 0xe7, 0xc3, 0x61, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae,
0x42, 0x60, 0x82,
};
const BITMAP_OPAQUE array_zone_xpm[1] = {{ png, sizeof( png ), "array_zone_xpm" }};
//EOF

Some files were not shown because too many files have changed in this diff Show More