Commit Graph

46 Commits

Author SHA1 Message Date
Tomasz Włostowski 6cb0d0cbfc VIEW: added CalculateExtents() method 2014-05-14 13:48:29 +02: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
Maciej Suminski 3e50e00f89 Moved panning boundaries and scale limits from VIEW to VIEW_CONTROL. 2014-03-12 17:09:53 +01:00
Maciej Suminski 21d2c19333 Merged selection_tool branch. 2014-03-06 10:43:40 +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
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 a8bdd44cd1 Overridden ViewUpdate() for MODULE class, so it handles its pads, drawings and texts. 2013-12-02 14:35:05 +01:00
Maciej Suminski f9f23806ed Mainly case changes. 2013-10-14 20:40:36 +02: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 8223f9742e Fixed memory leak caused by ViewUpdate() with VIEW_ITEM::GEOMETRY/LAYER parameters. 2013-10-02 13:57:21 +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 04cdb15ceb Changed the way of refreshing canvases (both standard & GAL). 2013-09-20 17:29:32 +02:00
Maciej Suminski fcd3bbecdf Added limits for VIEW scale values & panning area. 2013-09-18 17:36:54 +02:00
tomasz.wlostowski@cern.ch 0e23e23a7c VIEW: added GetTopLayer() method 2013-09-18 13:14:57 +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 c1e1502d35 Merged Tom's branch 2013-09-12 17:42:28 +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
Maciej Suminski 7e73dad7b0 Some more spots where the GAL refresh was required. 2013-09-06 17:06:02 +02:00
Maciej Suminski 345e97f296 Solved refreshing issues. 2013-09-06 11:31:16 +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 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
Maciej Suminski eca53baf6f Fixed linking errors for apps other than pcbnew. 2013-08-26 10:43:22 +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 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 6268fe957a Functions for direct item drawing. 2013-08-19 09:44:50 +02:00
Maciej Suminski eefc79b5b2 Reformatting. 2013-08-08 19:41:20 +02:00
Maciej Suminski 3f1b9a6b4a Different approach to item recaching. 2013-08-07 17:20:01 +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 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
unknown 24cab0eabd View: various fixes, added VIEW::IsDirty() 2013-08-02 16:51:38 +02:00
Maciej Suminski d41ea73765 Fixed top layer pads netnames issue. 2013-07-29 14:20:40 +02:00
Maciej Suminski e644f5be05 OpenGL multitarget rendering (compositing). 2013-07-23 18:39:07 +02:00
Maciej Suminski af26e17fa7 Fixed comments. 2013-07-19 09:35:25 +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 85131e359e Added 'required layers' option for drawn items. 2013-07-08 09:28:58 +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 603029b106 High contrast mode with showing the selected layer on the top. 2013-06-26 16:31:52 +02: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 7b426e8103 Fixed memleak, removed excessive recaching, still there is a problem with Cairo caching 2013-05-10 16:05:40 +02: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
Maciej Suminski 8663a6c7a0 Added caching of multilayer items (storing multiple group ids for items). 2013-04-24 11:28:11 +02:00
Maciej Suminski 2b0c4ba215 Turned on group recaching on GAL change. 2013-04-18 17:10:02 +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
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