Commit Graph

21 Commits

Author SHA1 Message Date
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 8253899a70 Converted tabs to spaces. Removed trailing whitespaces. 2013-10-14 13:43:57 +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 a384290356 EDA_DRAWPANEL_GAL: set focus on mouse enter to catch all key events 2013-09-09 17:07:03 +02:00
Maciej Suminski b518569674 Added handling keyboard events for the Tool framework. 2013-08-21 17:37:27 +02:00
Maciej Suminski ae3c02abae Build fix. 2013-08-15 16:23:54 +02:00
Maciej Suminski eb290bf362 Added some comments. 2013-08-09 15:21:31 +02:00
Maciej Suminski c928bc8ce3 Fixed layers caching settings. Added some comments. 2013-08-07 10:52:50 +02:00
unknown 0c6e180937 Merged Orson's changes 2013-08-02 17:28:09 +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
Maciej Suminski 2331742384 Removed shaderless OpenGL backend. 2013-07-29 16:38:07 +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 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
Maciej Suminski 198052358e Added GAL_TYPE_NONE as an indicator of GAL uninitialized state. 2013-06-18 16:19:30 +02: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 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 ec9e283d34 Fixed resize issue (moved GAL panel into pane).
Tidied up event handlers.
2013-04-18 11:20:19 +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 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 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