You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2804 lines
86 KiB

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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
10 years ago
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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
13 years ago
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
13 years ago
13 years ago
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
13 years ago
13 years ago
13 years ago
10 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
10 years ago
13 years ago
13 years ago
13 years ago
13 years ago
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
13 years ago
13 years ago
13 years ago
13 years ago
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
13 years ago
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
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
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
13 years ago
4 years ago
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
8 years ago
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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
13 years ago
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
13 years ago
13 years ago
13 years ago
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
13 years ago
13 years ago
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
13 years ago
13 years ago
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
13 years ago
13 years ago
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
13 years ago
13 years ago
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
13 years ago
13 years ago
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
13 years ago
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
13 years ago
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
13 years ago
13 years ago
13 years ago
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
13 years ago
13 years ago
13 years ago
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
13 years ago
13 years ago
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
13 years ago
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
13 years ago
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
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
10 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
10 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
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
13 years ago
  1. /*
  2. * This program source code file is part of KICAD, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2012 Torsten Hueter, torstenhtr <at> gmx.de
  5. * Copyright (C) 2012-2021 Kicad Developers, see AUTHORS.txt for contributors.
  6. * Copyright (C) 2013-2017 CERN
  7. * @author Maciej Suminski <maciej.suminski@cern.ch>
  8. *
  9. * Graphics Abstraction Layer (GAL) for OpenGL
  10. *
  11. * This program is free software; you can redistribute it and/or
  12. * modify it under the terms of the GNU General Public License
  13. * as published by the Free Software Foundation; either version 2
  14. * of the License, or (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program; if not, you may find one here:
  23. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  24. * or you may search the http://www.gnu.org website for the version 2 license,
  25. * or you may write to the Free Software Foundation, Inc.,
  26. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  27. */
  28. // Apple, in their infinite wisdom, has decided to mark OpenGL as deprecated.
  29. // Luckily we can silence warnings about its deprecation.
  30. #ifdef __APPLE__
  31. #define GL_SILENCE_DEPRECATION 1
  32. #endif
  33. #include <advanced_config.h>
  34. #include <gal/opengl/opengl_gal.h>
  35. #include <gal/opengl/utils.h>
  36. #include <gal/definitions.h>
  37. #include <gl_context_mgr.h>
  38. #include <geometry/shape_poly_set.h>
  39. #include <bitmap_base.h>
  40. #include <bezier_curves.h>
  41. #include <math/util.h> // for KiROUND
  42. #include <trace_helpers.h>
  43. #include <wx/frame.h>
  44. #include <macros.h>
  45. #include <geometry/geometry_utils.h>
  46. #include <profile.h>
  47. #include <trace_helpers.h>
  48. #include <gl_utils.h>
  49. #include <functional>
  50. #include <limits>
  51. #include <memory>
  52. using namespace std::placeholders;
  53. using namespace KIGFX;
  54. // Currently the bitmap cache is disabled because the code has serious issues and
  55. // work fine does not work fine:
  56. // created GL textures are never deleted when a bitmap is deleted
  57. // the key to retrieve a CACHED_BITMAP is the BITMAP_BASE items* pointer.
  58. // Because in code many BITMAP_BASE items are temporary cloned for drawing purposes,
  59. // it creates a lot of CACHED_BITMAP never deleted thus created memory leak
  60. // So to reenable the bitmaps cache, serious changes in code are needed:
  61. // At least:
  62. // - use a key that works on cloned BITMAP_BASE items
  63. // - handle rotated bitmaps without create a new cached item
  64. // - add a "garbage collector" to delete not existing BITMAP_BASE items
  65. // After tests, caching bitmaps do not speedup significantly drawings.
  66. #define DISABLE_BITMAP_CACHE
  67. // The current font is "Ubuntu Mono" available under Ubuntu Font Licence 1.0
  68. // (see ubuntu-font-licence-1.0.txt for details)
  69. #include "gl_resources.h"
  70. #include <glsl_kicad_frag.h>
  71. #include <glsl_kicad_vert.h>
  72. using namespace KIGFX::BUILTIN_FONT;
  73. static void InitTesselatorCallbacks( GLUtesselator* aTesselator );
  74. static const int glAttributes[] = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, WX_GL_DEPTH_SIZE, 8, 0 };
  75. wxGLContext* OPENGL_GAL::m_glMainContext = nullptr;
  76. int OPENGL_GAL::m_instanceCounter = 0;
  77. GLuint OPENGL_GAL::g_fontTexture = 0;
  78. bool OPENGL_GAL::m_isBitmapFontLoaded = false;
  79. namespace KIGFX
  80. {
  81. class GL_BITMAP_CACHE
  82. {
  83. public:
  84. GL_BITMAP_CACHE() {}
  85. ~GL_BITMAP_CACHE();
  86. GLuint RequestBitmap( const BITMAP_BASE* aBitmap );
  87. private:
  88. struct CACHED_BITMAP
  89. {
  90. GLuint id;
  91. int w, h;
  92. };
  93. GLuint cacheBitmap( const BITMAP_BASE* aBitmap );
  94. std::map< const BITMAP_BASE*, CACHED_BITMAP> m_bitmaps;
  95. };
  96. }; // namespace KIGFX
  97. GL_BITMAP_CACHE::~GL_BITMAP_CACHE()
  98. {
  99. for( auto& bitmap : m_bitmaps )
  100. glDeleteTextures( 1, &bitmap.second.id );
  101. }
  102. GLuint GL_BITMAP_CACHE::RequestBitmap( const BITMAP_BASE* aBitmap )
  103. {
  104. #ifndef DISABLE_BITMAP_CACHE
  105. auto it = m_bitmaps.find( aBitmap );
  106. if( it != m_bitmaps.end() )
  107. {
  108. // A bitmap is found in cache bitmap. Ensure the associated texture
  109. // is still valid.
  110. // It can be destroyed somewhere or the corresponding bitmap can be
  111. // modifed (rotated)
  112. if( ( it->second.w == aBitmap->GetSizePixels().x ) &&
  113. ( it->second.h == aBitmap->GetSizePixels().y ) &&
  114. glIsTexture( it->second.id ) )
  115. {
  116. return it->second.id;
  117. }
  118. else
  119. {
  120. // Delete the invalid bitmap cache and its data
  121. glDeleteTextures( 1, &it->second.id );
  122. m_bitmaps.erase( it );
  123. }
  124. // the cached bitmap is not valid and deleted, it will be recreated.
  125. }
  126. #endif
  127. return cacheBitmap( aBitmap );
  128. }
  129. GLuint GL_BITMAP_CACHE::cacheBitmap( const BITMAP_BASE* aBitmap )
  130. {
  131. CACHED_BITMAP bmp;
  132. bmp.w = aBitmap->GetSizePixels().x;
  133. bmp.h = aBitmap->GetSizePixels().y;
  134. // The bitmap size needs to be a multiple of 4.
  135. // This is easiest to achieve by ensuring that each row
  136. // has a multiple of 4 pixels
  137. int extra_w = bmp.w % 4;
  138. if( extra_w )
  139. extra_w = 4 - extra_w;
  140. GLuint textureID;
  141. glGenTextures( 1, &textureID );
  142. // make_unique initializes this to 0, so extra pixels are transparent
  143. auto buf = std::make_unique<uint8_t[]>( ( bmp.w + extra_w ) * bmp.h * 4 );
  144. const wxImage& imgData = *aBitmap->GetImageData();
  145. for( int y = 0; y < bmp.h; y++ )
  146. {
  147. for( int x = 0; x < bmp.w; x++ )
  148. {
  149. uint8_t* p = buf.get() + ( ( bmp.w + extra_w ) * y + x ) * 4;
  150. p[0] = imgData.GetRed( x, y );
  151. p[1] = imgData.GetGreen( x, y );
  152. p[2] = imgData.GetBlue( x, y );
  153. if( imgData.HasAlpha() )
  154. p[3] = imgData.GetAlpha( x, y );
  155. else if( imgData.HasMask() && p[0] == imgData.GetMaskRed()
  156. && p[1] == imgData.GetMaskGreen() && p[2] == imgData.GetMaskBlue() )
  157. p[3] = wxALPHA_TRANSPARENT;
  158. else
  159. p[3] = wxALPHA_OPAQUE;
  160. }
  161. }
  162. glBindTexture( GL_TEXTURE_2D, textureID );
  163. glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA8, bmp.w + extra_w, bmp.h, 0, GL_RGBA, GL_UNSIGNED_BYTE,
  164. buf.get() );
  165. glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
  166. glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
  167. bmp.id = textureID;
  168. #ifndef DISABLE_BITMAP_CACHE
  169. m_bitmaps[aBitmap] = bmp;
  170. #endif
  171. return textureID;
  172. }
  173. OPENGL_GAL::OPENGL_GAL( GAL_DISPLAY_OPTIONS& aDisplayOptions, wxWindow* aParent,
  174. wxEvtHandler* aMouseListener, wxEvtHandler* aPaintListener,
  175. const wxString& aName ) :
  176. GAL( aDisplayOptions ),
  177. HIDPI_GL_CANVAS( aParent, wxID_ANY, (int*) glAttributes, wxDefaultPosition, wxDefaultSize,
  178. wxEXPAND, aName ),
  179. m_mouseListener( aMouseListener ),
  180. m_paintListener( aPaintListener ),
  181. m_currentManager( nullptr ),
  182. m_cachedManager( nullptr ),
  183. m_nonCachedManager( nullptr ),
  184. m_overlayManager( nullptr ),
  185. m_tempManager( nullptr ),
  186. m_mainBuffer( 0 ),
  187. m_overlayBuffer( 0 ),
  188. m_tempBuffer( 0 ),
  189. m_isContextLocked( false ),
  190. m_lockClientCookie( 0 )
  191. {
  192. if( m_glMainContext == nullptr )
  193. {
  194. m_glMainContext = GL_CONTEXT_MANAGER::Get().CreateCtx( this );
  195. m_glPrivContext = m_glMainContext;
  196. }
  197. else
  198. {
  199. m_glPrivContext = GL_CONTEXT_MANAGER::Get().CreateCtx( this, m_glMainContext );
  200. }
  201. m_shader = new SHADER();
  202. ++m_instanceCounter;
  203. m_bitmapCache = std::make_unique<GL_BITMAP_CACHE>();
  204. m_compositor = new OPENGL_COMPOSITOR;
  205. m_compositor->SetAntialiasingMode( m_options.gl_antialiasing_mode );
  206. // Initialize the flags
  207. m_isFramebufferInitialized = false;
  208. m_isBitmapFontInitialized = false;
  209. m_isInitialized = false;
  210. m_isGrouping = false;
  211. m_groupCounter = 0;
  212. // Connect the native cursor handler
  213. Connect( wxEVT_SET_CURSOR, wxSetCursorEventHandler( OPENGL_GAL::onSetNativeCursor ), nullptr,
  214. this );
  215. // Connecting the event handlers
  216. Connect( wxEVT_PAINT, wxPaintEventHandler( OPENGL_GAL::onPaint ) );
  217. // Mouse events are skipped to the parent
  218. Connect( wxEVT_MOTION, wxMouseEventHandler( OPENGL_GAL::skipMouseEvent ) );
  219. Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( OPENGL_GAL::skipMouseEvent ) );
  220. Connect( wxEVT_LEFT_UP, wxMouseEventHandler( OPENGL_GAL::skipMouseEvent ) );
  221. Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( OPENGL_GAL::skipMouseEvent ) );
  222. Connect( wxEVT_MIDDLE_DOWN, wxMouseEventHandler( OPENGL_GAL::skipMouseEvent ) );
  223. Connect( wxEVT_MIDDLE_UP, wxMouseEventHandler( OPENGL_GAL::skipMouseEvent ) );
  224. Connect( wxEVT_MIDDLE_DCLICK, wxMouseEventHandler( OPENGL_GAL::skipMouseEvent ) );
  225. Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( OPENGL_GAL::skipMouseEvent ) );
  226. Connect( wxEVT_RIGHT_UP, wxMouseEventHandler( OPENGL_GAL::skipMouseEvent ) );
  227. Connect( wxEVT_RIGHT_DCLICK, wxMouseEventHandler( OPENGL_GAL::skipMouseEvent ) );
  228. Connect( wxEVT_AUX1_DOWN, wxMouseEventHandler( OPENGL_GAL::skipMouseEvent ) );
  229. Connect( wxEVT_AUX1_UP, wxMouseEventHandler( OPENGL_GAL::skipMouseEvent ) );
  230. Connect( wxEVT_AUX1_DCLICK, wxMouseEventHandler( OPENGL_GAL::skipMouseEvent ) );
  231. Connect( wxEVT_AUX2_DOWN, wxMouseEventHandler( OPENGL_GAL::skipMouseEvent ) );
  232. Connect( wxEVT_AUX2_UP, wxMouseEventHandler( OPENGL_GAL::skipMouseEvent ) );
  233. Connect( wxEVT_AUX2_DCLICK, wxMouseEventHandler( OPENGL_GAL::skipMouseEvent ) );
  234. Connect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( OPENGL_GAL::skipMouseEvent ) );
  235. #if wxCHECK_VERSION( 3, 1, 0 ) || defined( USE_OSX_MAGNIFY_EVENT )
  236. Connect( wxEVT_MAGNIFY, wxMouseEventHandler( OPENGL_GAL::skipMouseEvent ) );
  237. #endif
  238. #if defined _WIN32 || defined _WIN64
  239. Connect( wxEVT_ENTER_WINDOW, wxMouseEventHandler( OPENGL_GAL::skipMouseEvent ) );
  240. #endif
  241. SetSize( aParent->GetClientSize() );
  242. m_screenSize = VECTOR2I( GetNativePixelSize() );
  243. // Grid color settings are different in Cairo and OpenGL
  244. SetGridColor( COLOR4D( 0.8, 0.8, 0.8, 0.1 ) );
  245. SetAxesColor( COLOR4D( BLUE ) );
  246. // Tesselator initialization
  247. m_tesselator = gluNewTess();
  248. InitTesselatorCallbacks( m_tesselator );
  249. gluTessProperty( m_tesselator, GLU_TESS_WINDING_RULE, GLU_TESS_WINDING_POSITIVE );
  250. SetTarget( TARGET_NONCACHED );
  251. // Avoid uninitialized variables:
  252. ufm_worldPixelSize = 1;
  253. ufm_screenPixelSize = 1;
  254. ufm_pixelSizeMultiplier = 1;
  255. ufm_antialiasingOffset = 1;
  256. }
  257. OPENGL_GAL::~OPENGL_GAL()
  258. {
  259. GL_CONTEXT_MANAGER::Get().LockCtx( m_glPrivContext, this );
  260. --m_instanceCounter;
  261. glFlush();
  262. gluDeleteTess( m_tesselator );
  263. ClearCache();
  264. delete m_compositor;
  265. if( m_isInitialized )
  266. {
  267. delete m_cachedManager;
  268. delete m_nonCachedManager;
  269. delete m_overlayManager;
  270. delete m_tempManager;
  271. }
  272. GL_CONTEXT_MANAGER::Get().UnlockCtx( m_glPrivContext );
  273. // If it was the main context, then it will be deleted
  274. // when the last OpenGL GAL instance is destroyed (a few lines below)
  275. if( m_glPrivContext != m_glMainContext )
  276. GL_CONTEXT_MANAGER::Get().DestroyCtx( m_glPrivContext );
  277. delete m_shader;
  278. // Are we destroying the last GAL instance?
  279. if( m_instanceCounter == 0 )
  280. {
  281. GL_CONTEXT_MANAGER::Get().LockCtx( m_glMainContext, this );
  282. if( m_isBitmapFontLoaded )
  283. {
  284. glDeleteTextures( 1, &g_fontTexture );
  285. m_isBitmapFontLoaded = false;
  286. }
  287. GL_CONTEXT_MANAGER::Get().UnlockCtx( m_glMainContext );
  288. GL_CONTEXT_MANAGER::Get().DestroyCtx( m_glMainContext );
  289. m_glMainContext = nullptr;
  290. }
  291. }
  292. wxString OPENGL_GAL::CheckFeatures( GAL_DISPLAY_OPTIONS& aOptions )
  293. {
  294. wxString retVal = wxEmptyString;
  295. wxFrame* testFrame = new wxFrame( nullptr, wxID_ANY, wxT( "" ), wxDefaultPosition,
  296. wxSize( 1, 1 ), wxFRAME_TOOL_WINDOW | wxNO_BORDER );
  297. KIGFX::OPENGL_GAL* opengl_gal = nullptr;
  298. try
  299. {
  300. opengl_gal = new KIGFX::OPENGL_GAL( aOptions, testFrame );
  301. testFrame->Raise();
  302. testFrame->Show();
  303. GAL_CONTEXT_LOCKER lock( opengl_gal );
  304. opengl_gal->init();
  305. }
  306. catch( std::runtime_error& err )
  307. {
  308. //Test failed
  309. retVal = wxString( err.what() );
  310. }
  311. delete opengl_gal;
  312. delete testFrame;
  313. return retVal;
  314. }
  315. void OPENGL_GAL::PostPaint( wxPaintEvent& aEvent )
  316. {
  317. // posts an event to m_paint_listener to ask for redraw the canvas.
  318. if( m_paintListener )
  319. wxPostEvent( m_paintListener, aEvent );
  320. }
  321. bool OPENGL_GAL::updatedGalDisplayOptions( const GAL_DISPLAY_OPTIONS& aOptions )
  322. {
  323. GAL_CONTEXT_LOCKER lock( this );
  324. bool refresh = false;
  325. if( m_options.gl_antialiasing_mode != m_compositor->GetAntialiasingMode() )
  326. {
  327. m_compositor->SetAntialiasingMode( m_options.gl_antialiasing_mode );
  328. m_isFramebufferInitialized = false;
  329. refresh = true;
  330. }
  331. if( m_options.m_scaleFactor != GetScaleFactor() )
  332. {
  333. SetScaleFactor( m_options.m_scaleFactor );
  334. refresh = true;
  335. }
  336. if( super::updatedGalDisplayOptions( aOptions ) || refresh )
  337. {
  338. Refresh();
  339. refresh = true;
  340. }
  341. return refresh;
  342. }
  343. double OPENGL_GAL::getWorldPixelSize() const
  344. {
  345. MATRIX3x3D matrix = GetScreenWorldMatrix();
  346. return std::min( std::abs( matrix.GetScale().x ), std::abs( matrix.GetScale().y ) );
  347. }
  348. VECTOR2D OPENGL_GAL::getScreenPixelSize() const
  349. {
  350. double sf = GetScaleFactor();
  351. return VECTOR2D( 2.0 / (double) ( m_screenSize.x * sf ), 2.0 /
  352. (double) ( m_screenSize.y * sf ) );
  353. }
  354. void OPENGL_GAL::BeginDrawing()
  355. {
  356. #ifdef KICAD_GAL_PROFILE
  357. PROF_TIMER totalRealTime( "OPENGL_GAL::beginDrawing()", true );
  358. #endif /* KICAD_GAL_PROFILE */
  359. wxASSERT_MSG( m_isContextLocked, "GAL_DRAWING_CONTEXT RAII object should have locked context. "
  360. "Calling GAL::beginDrawing() directly is not allowed." );
  361. wxASSERT_MSG( IsVisible(), "GAL::beginDrawing() must not be entered when GAL is not visible. "
  362. "Other drawing routines will expect everything to be initialized "
  363. "which will not be the case." );
  364. if( !m_isInitialized )
  365. init();
  366. // Set up the view port
  367. glMatrixMode( GL_PROJECTION );
  368. glLoadIdentity();
  369. // Create the screen transformation (Do the RH-LH conversion here)
  370. glOrtho( 0, (GLint) m_screenSize.x, (GLsizei) m_screenSize.y, 0,
  371. -m_depthRange.x, -m_depthRange.y );
  372. if( !m_isFramebufferInitialized )
  373. {
  374. // Prepare rendering target buffers
  375. m_compositor->Initialize();
  376. m_mainBuffer = m_compositor->CreateBuffer();
  377. m_tempBuffer = m_compositor->CreateBuffer();
  378. try
  379. {
  380. m_overlayBuffer = m_compositor->CreateBuffer();
  381. }
  382. catch( const std::runtime_error& )
  383. {
  384. wxLogVerbose( "Could not create a framebuffer for overlays.\n" );
  385. m_overlayBuffer = 0;
  386. }
  387. m_isFramebufferInitialized = true;
  388. }
  389. m_compositor->Begin();
  390. // Disable 2D Textures
  391. glDisable( GL_TEXTURE_2D );
  392. glShadeModel( GL_FLAT );
  393. // Enable the depth buffer
  394. glEnable( GL_DEPTH_TEST );
  395. glDepthFunc( GL_LESS );
  396. // Setup blending, required for transparent objects
  397. glEnable( GL_BLEND );
  398. glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
  399. glMatrixMode( GL_MODELVIEW );
  400. // Set up the world <-> screen transformation
  401. ComputeWorldScreenMatrix();
  402. GLdouble matrixData[16] = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 };
  403. matrixData[0] = m_worldScreenMatrix.m_data[0][0];
  404. matrixData[1] = m_worldScreenMatrix.m_data[1][0];
  405. matrixData[2] = m_worldScreenMatrix.m_data[2][0];
  406. matrixData[4] = m_worldScreenMatrix.m_data[0][1];
  407. matrixData[5] = m_worldScreenMatrix.m_data[1][1];
  408. matrixData[6] = m_worldScreenMatrix.m_data[2][1];
  409. matrixData[12] = m_worldScreenMatrix.m_data[0][2];
  410. matrixData[13] = m_worldScreenMatrix.m_data[1][2];
  411. matrixData[14] = m_worldScreenMatrix.m_data[2][2];
  412. glLoadMatrixd( matrixData );
  413. // Set defaults
  414. SetFillColor( m_fillColor );
  415. SetStrokeColor( m_strokeColor );
  416. // Remove all previously stored items
  417. m_nonCachedManager->Clear();
  418. m_overlayManager->Clear();
  419. m_tempManager->Clear();
  420. m_cachedManager->BeginDrawing();
  421. m_nonCachedManager->BeginDrawing();
  422. m_overlayManager->BeginDrawing();
  423. m_tempManager->BeginDrawing();
  424. if( !m_isBitmapFontInitialized )
  425. {
  426. // Keep bitmap font texture always bound to the second texturing unit
  427. const GLint FONT_TEXTURE_UNIT = 2;
  428. // Either load the font atlas to video memory, or simply bind it to a texture unit
  429. if( !m_isBitmapFontLoaded )
  430. {
  431. glActiveTexture( GL_TEXTURE0 + FONT_TEXTURE_UNIT );
  432. glGenTextures( 1, &g_fontTexture );
  433. glBindTexture( GL_TEXTURE_2D, g_fontTexture );
  434. glTexImage2D( GL_TEXTURE_2D, 0, GL_RGB8, font_image.width, font_image.height, 0, GL_RGB,
  435. GL_UNSIGNED_BYTE, font_image.pixels );
  436. glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
  437. glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
  438. checkGlError( "loading bitmap font", __FILE__, __LINE__ );
  439. glActiveTexture( GL_TEXTURE0 );
  440. m_isBitmapFontLoaded = true;
  441. }
  442. else
  443. {
  444. glActiveTexture( GL_TEXTURE0 + FONT_TEXTURE_UNIT );
  445. glBindTexture( GL_TEXTURE_2D, g_fontTexture );
  446. glActiveTexture( GL_TEXTURE0 );
  447. }
  448. // Set shader parameter
  449. GLint ufm_fontTexture = m_shader->AddParameter( "u_fontTexture" );
  450. GLint ufm_fontTextureWidth = m_shader->AddParameter( "u_fontTextureWidth" );
  451. ufm_worldPixelSize = m_shader->AddParameter( "u_worldPixelSize" );
  452. ufm_screenPixelSize = m_shader->AddParameter( "u_screenPixelSize" );
  453. ufm_pixelSizeMultiplier = m_shader->AddParameter( "u_pixelSizeMultiplier" );
  454. ufm_antialiasingOffset = m_shader->AddParameter( "u_antialiasingOffset" );
  455. m_shader->Use();
  456. m_shader->SetParameter( ufm_fontTexture, (int) FONT_TEXTURE_UNIT );
  457. m_shader->SetParameter( ufm_fontTextureWidth, (int) font_image.width );
  458. m_shader->Deactivate();
  459. checkGlError( "setting bitmap font sampler as shader parameter", __FILE__, __LINE__ );
  460. m_isBitmapFontInitialized = true;
  461. }
  462. m_shader->Use();
  463. m_shader->SetParameter( ufm_worldPixelSize,
  464. (float) ( getWorldPixelSize() / GetScaleFactor() ) );
  465. const VECTOR2D& screenPixelSize = getScreenPixelSize();
  466. m_shader->SetParameter( ufm_screenPixelSize, screenPixelSize );
  467. double pixelSizeMultiplier = m_compositor->GetAntialiasSupersamplingFactor();
  468. m_shader->SetParameter( ufm_pixelSizeMultiplier, (float) pixelSizeMultiplier );
  469. VECTOR2D renderingOffset = m_compositor->GetAntialiasRenderingOffset();
  470. renderingOffset.x *= screenPixelSize.x;
  471. renderingOffset.y *= screenPixelSize.y;
  472. m_shader->SetParameter( ufm_antialiasingOffset, renderingOffset );
  473. m_shader->Deactivate();
  474. // Something betreen BeginDrawing and EndDrawing seems to depend on
  475. // this texture unit being active, but it does not assure it itself.
  476. glActiveTexture( GL_TEXTURE0 );
  477. // Unbind buffers - set compositor for direct drawing
  478. m_compositor->SetBuffer( OPENGL_COMPOSITOR::DIRECT_RENDERING );
  479. #ifdef KICAD_GAL_PROFILE
  480. totalRealTime.Stop();
  481. wxLogTrace( traceGalProfile, wxT( "OPENGL_GAL::beginDrawing(): %.1f ms" ),
  482. totalRealTime.msecs() );
  483. #endif /* KICAD_GAL_PROFILE */
  484. }
  485. void OPENGL_GAL::EndDrawing()
  486. {
  487. wxASSERT_MSG( m_isContextLocked, "What happened to the context lock?" );
  488. PROF_TIMER cntTotal("gl-end-total");
  489. PROF_TIMER cntEndCached("gl-end-cached");
  490. PROF_TIMER cntEndNoncached("gl-end-noncached");
  491. PROF_TIMER cntEndOverlay("gl-end-overlay");
  492. PROF_TIMER cntComposite("gl-composite");
  493. PROF_TIMER cntSwap("gl-swap");
  494. cntTotal.Start();
  495. // Cached & non-cached containers are rendered to the same buffer
  496. m_compositor->SetBuffer( m_mainBuffer );
  497. cntEndNoncached.Start();
  498. m_nonCachedManager->EndDrawing();
  499. cntEndNoncached.Stop();
  500. cntEndCached.Start();
  501. m_cachedManager->EndDrawing();
  502. cntEndCached.Stop();
  503. cntEndOverlay.Start();
  504. // Overlay container is rendered to a different buffer
  505. if( m_overlayBuffer )
  506. m_compositor->SetBuffer( m_overlayBuffer );
  507. m_overlayManager->EndDrawing();
  508. cntEndOverlay.Stop();
  509. cntComposite.Start();
  510. // Be sure that the framebuffer is not colorized (happens on specific GPU&drivers combinations)
  511. glColor4d( 1.0, 1.0, 1.0, 1.0 );
  512. // Draw the remaining contents, blit the rendering targets to the screen, swap the buffers
  513. m_compositor->DrawBuffer( m_mainBuffer );
  514. if( m_overlayBuffer )
  515. m_compositor->DrawBuffer( m_overlayBuffer );
  516. m_compositor->Present();
  517. blitCursor();
  518. cntComposite.Stop();
  519. cntSwap.Start();
  520. SwapBuffers();
  521. cntSwap.Stop();
  522. cntTotal.Stop();
  523. KI_TRACE( traceGalProfile, "Timing: %s %s %s %s %s %s\n", cntTotal.to_string(),
  524. cntEndCached.to_string(), cntEndNoncached.to_string(), cntEndOverlay.to_string(),
  525. cntComposite.to_string(), cntSwap.to_string() );
  526. }
  527. void OPENGL_GAL::LockContext( int aClientCookie )
  528. {
  529. wxASSERT_MSG( !m_isContextLocked, "Context already locked." );
  530. m_isContextLocked = true;
  531. m_lockClientCookie = aClientCookie;
  532. GL_CONTEXT_MANAGER::Get().LockCtx( m_glPrivContext, this );
  533. }
  534. void OPENGL_GAL::UnlockContext( int aClientCookie )
  535. {
  536. wxASSERT_MSG( m_isContextLocked, "Context not locked. A GAL_CONTEXT_LOCKER RAII object must "
  537. "be stacked rather than making separate lock/unlock calls." );
  538. wxASSERT_MSG( m_lockClientCookie == aClientCookie, "Context was locked by a different client. "
  539. "Should not be possible with RAII objects." );
  540. m_isContextLocked = false;
  541. GL_CONTEXT_MANAGER::Get().UnlockCtx( m_glPrivContext );
  542. }
  543. void OPENGL_GAL::beginUpdate()
  544. {
  545. wxASSERT_MSG( m_isContextLocked, "GAL_UPDATE_CONTEXT RAII object should have locked context. "
  546. "Calling this from anywhere else is not allowed." );
  547. wxASSERT_MSG( IsVisible(), "GAL::beginUpdate() must not be entered when GAL is not visible. "
  548. "Other update routines will expect everything to be initialized "
  549. "which will not be the case." );
  550. if( !m_isInitialized )
  551. init();
  552. m_cachedManager->Map();
  553. }
  554. void OPENGL_GAL::endUpdate()
  555. {
  556. if( !m_isInitialized )
  557. return;
  558. m_cachedManager->Unmap();
  559. }
  560. void OPENGL_GAL::DrawLine( const VECTOR2D& aStartPoint, const VECTOR2D& aEndPoint )
  561. {
  562. m_currentManager->Color( m_strokeColor.r, m_strokeColor.g, m_strokeColor.b, m_strokeColor.a );
  563. drawLineQuad( aStartPoint, aEndPoint );
  564. }
  565. void OPENGL_GAL::DrawSegment( const VECTOR2D& aStartPoint, const VECTOR2D& aEndPoint,
  566. double aWidth )
  567. {
  568. drawSegment( aStartPoint, aEndPoint, aWidth );
  569. }
  570. void OPENGL_GAL::drawSegment( const VECTOR2D& aStartPoint, const VECTOR2D& aEndPoint, double aWidth,
  571. bool aReserve )
  572. {
  573. VECTOR2D startEndVector = aEndPoint - aStartPoint;
  574. double lineLength = startEndVector.EuclideanNorm();
  575. float startx = aStartPoint.x;
  576. float starty = aStartPoint.y;
  577. float endx = aStartPoint.x + lineLength;
  578. float endy = aStartPoint.y + lineLength;
  579. // Be careful about floating point rounding. As we draw segments in larger and larger
  580. // coordinates, the shader (which uses floats) will lose precision and stop drawing small
  581. // segments. In this case, we need to draw a circle for the minimal segment.
  582. if( startx == endx || starty == endy )
  583. {
  584. drawCircle( aStartPoint, aWidth / 2, aReserve );
  585. return;
  586. }
  587. if( m_isFillEnabled || aWidth == 1.0 )
  588. {
  589. m_currentManager->Color( m_fillColor.r, m_fillColor.g, m_fillColor.b, m_fillColor.a );
  590. SetLineWidth( aWidth );
  591. drawLineQuad( aStartPoint, aEndPoint, aReserve );
  592. }
  593. else
  594. {
  595. EDA_ANGLE lineAngle( startEndVector );
  596. // Outlined tracks
  597. SetLineWidth( 1.0 );
  598. m_currentManager->Color( m_strokeColor.r, m_strokeColor.g, m_strokeColor.b,
  599. m_strokeColor.a );
  600. Save();
  601. if( aReserve )
  602. m_currentManager->Reserve( 6 + 6 + 3 + 3 ); // Two line quads and two semicircles
  603. m_currentManager->Translate( aStartPoint.x, aStartPoint.y, 0.0 );
  604. m_currentManager->Rotate( lineAngle.AsRadians(), 0.0f, 0.0f, 1.0f );
  605. drawLineQuad( VECTOR2D( 0.0, aWidth / 2.0 ), VECTOR2D( lineLength, aWidth / 2.0 ), false );
  606. drawLineQuad( VECTOR2D( 0.0, -aWidth / 2.0 ), VECTOR2D( lineLength, -aWidth / 2.0 ),
  607. false );
  608. // Draw line caps
  609. drawStrokedSemiCircle( VECTOR2D( 0.0, 0.0 ), aWidth / 2, M_PI / 2, false );
  610. drawStrokedSemiCircle( VECTOR2D( lineLength, 0.0 ), aWidth / 2, -M_PI / 2, false );
  611. Restore();
  612. }
  613. }
  614. void OPENGL_GAL::DrawCircle( const VECTOR2D& aCenterPoint, double aRadius )
  615. {
  616. drawCircle( aCenterPoint, aRadius );
  617. }
  618. void OPENGL_GAL::drawCircle( const VECTOR2D& aCenterPoint, double aRadius, bool aReserve )
  619. {
  620. if( m_isFillEnabled )
  621. {
  622. if( aReserve )
  623. m_currentManager->Reserve( 3 );
  624. m_currentManager->Color( m_fillColor.r, m_fillColor.g, m_fillColor.b, m_fillColor.a );
  625. /* Draw a triangle that contains the circle, then shade it leaving only the circle.
  626. * Parameters given to Shader() are indices of the triangle's vertices
  627. * (if you want to understand more, check the vertex shader source [shader.vert]).
  628. * Shader uses this coordinates to determine if fragments are inside the circle or not.
  629. * Does the calculations in the vertex shader now (pixel alignment)
  630. * v2
  631. * /\
  632. * //\\
  633. * v0 /_\/_\ v1
  634. */
  635. m_currentManager->Shader( SHADER_FILLED_CIRCLE, 1.0, aRadius );
  636. m_currentManager->Vertex( aCenterPoint.x, aCenterPoint.y, m_layerDepth );
  637. m_currentManager->Shader( SHADER_FILLED_CIRCLE, 2.0, aRadius );
  638. m_currentManager->Vertex( aCenterPoint.x, aCenterPoint.y, m_layerDepth );
  639. m_currentManager->Shader( SHADER_FILLED_CIRCLE, 3.0, aRadius );
  640. m_currentManager->Vertex( aCenterPoint.x, aCenterPoint.y, m_layerDepth );
  641. }
  642. if( m_isStrokeEnabled )
  643. {
  644. if( aReserve )
  645. m_currentManager->Reserve( 3 );
  646. m_currentManager->Color( m_strokeColor.r, m_strokeColor.g, m_strokeColor.b,
  647. m_strokeColor.a );
  648. /* Draw a triangle that contains the circle, then shade it leaving only the circle.
  649. * Parameters given to Shader() are indices of the triangle's vertices
  650. * (if you want to understand more, check the vertex shader source [shader.vert]).
  651. * and the line width. Shader uses this coordinates to determine if fragments are
  652. * inside the circle or not.
  653. * v2
  654. * /\
  655. * //\\
  656. * v0 /_\/_\ v1
  657. */
  658. m_currentManager->Shader( SHADER_STROKED_CIRCLE, 1.0, aRadius, m_lineWidth );
  659. m_currentManager->Vertex( aCenterPoint.x, // v0
  660. aCenterPoint.y, m_layerDepth );
  661. m_currentManager->Shader( SHADER_STROKED_CIRCLE, 2.0, aRadius, m_lineWidth );
  662. m_currentManager->Vertex( aCenterPoint.x, // v1
  663. aCenterPoint.y, m_layerDepth );
  664. m_currentManager->Shader( SHADER_STROKED_CIRCLE, 3.0, aRadius, m_lineWidth );
  665. m_currentManager->Vertex( aCenterPoint.x, aCenterPoint.y, // v2
  666. m_layerDepth );
  667. }
  668. }
  669. void OPENGL_GAL::DrawArc( const VECTOR2D& aCenterPoint, double aRadius,
  670. const EDA_ANGLE& aStartAngle, const EDA_ANGLE& aEndAngle )
  671. {
  672. if( aRadius <= 0 )
  673. return;
  674. double startAngle = aStartAngle.AsRadians();
  675. double endAngle = aEndAngle.AsRadians();
  676. // Swap the angles, if start angle is greater than end angle
  677. SWAP( startAngle, >, endAngle );
  678. const double alphaIncrement = calcAngleStep( aRadius );
  679. Save();
  680. m_currentManager->Translate( aCenterPoint.x, aCenterPoint.y, 0.0 );
  681. if( m_isFillEnabled )
  682. {
  683. double alpha;
  684. m_currentManager->Color( m_fillColor.r, m_fillColor.g, m_fillColor.b, m_fillColor.a );
  685. m_currentManager->Shader( SHADER_NONE );
  686. // Triangle fan
  687. for( alpha = startAngle; ( alpha + alphaIncrement ) < endAngle; )
  688. {
  689. m_currentManager->Reserve( 3 );
  690. m_currentManager->Vertex( 0.0, 0.0, m_layerDepth );
  691. m_currentManager->Vertex( cos( alpha ) * aRadius, sin( alpha ) * aRadius,
  692. m_layerDepth );
  693. alpha += alphaIncrement;
  694. m_currentManager->Vertex( cos( alpha ) * aRadius, sin( alpha ) * aRadius,
  695. m_layerDepth );
  696. }
  697. // The last missing triangle
  698. const VECTOR2D endPoint( cos( endAngle ) * aRadius, sin( endAngle ) * aRadius );
  699. m_currentManager->Reserve( 3 );
  700. m_currentManager->Vertex( 0.0, 0.0, m_layerDepth );
  701. m_currentManager->Vertex( cos( alpha ) * aRadius, sin( alpha ) * aRadius, m_layerDepth );
  702. m_currentManager->Vertex( endPoint.x, endPoint.y, m_layerDepth );
  703. }
  704. if( m_isStrokeEnabled )
  705. {
  706. m_currentManager->Color( m_strokeColor.r, m_strokeColor.g, m_strokeColor.b,
  707. m_strokeColor.a );
  708. VECTOR2D p( cos( startAngle ) * aRadius, sin( startAngle ) * aRadius );
  709. double alpha;
  710. for( alpha = startAngle + alphaIncrement; alpha <= endAngle; alpha += alphaIncrement )
  711. {
  712. VECTOR2D p_next( cos( alpha ) * aRadius, sin( alpha ) * aRadius );
  713. DrawLine( p, p_next );
  714. p = p_next;
  715. }
  716. // Draw the last missing part
  717. if( alpha != endAngle )
  718. {
  719. VECTOR2D p_last( cos( endAngle ) * aRadius, sin( endAngle ) * aRadius );
  720. DrawLine( p, p_last );
  721. }
  722. }
  723. Restore();
  724. }
  725. void OPENGL_GAL::DrawArcSegment( const VECTOR2D& aCenterPoint, double aRadius,
  726. const EDA_ANGLE& aStartAngle, const EDA_ANGLE& aEndAngle,
  727. double aWidth, double aMaxError )
  728. {
  729. if( aRadius <= 0 )
  730. {
  731. // Arcs of zero radius are a circle of aWidth diameter
  732. if( aWidth > 0 )
  733. DrawCircle( aCenterPoint, aWidth / 2.0 );
  734. return;
  735. }
  736. double startAngle = aStartAngle.AsRadians();
  737. double endAngle = aEndAngle.AsRadians();
  738. // Swap the angles, if start angle is greater than end angle
  739. SWAP( startAngle, >, endAngle );
  740. // Calculate the seg count to approximate the arc with aMaxError or less
  741. int segCount360 = GetArcToSegmentCount( aRadius, aMaxError, FULL_CIRCLE );
  742. segCount360 = std::max( SEG_PER_CIRCLE_COUNT, segCount360 );
  743. double alphaIncrement = 2.0 * M_PI / segCount360;
  744. // Refinement: Use a segment count multiple of 2, because we have a control point
  745. // on the middle of the arc, and the look is better if it is on a segment junction
  746. // because there is no approx error
  747. int seg_count = KiROUND( ( endAngle - startAngle ) / alphaIncrement );
  748. if( seg_count % 2 != 0 )
  749. seg_count += 1;
  750. // Recalculate alphaIncrement with a even integer number of segment
  751. if( seg_count )
  752. alphaIncrement = ( endAngle - startAngle ) / seg_count;
  753. Save();
  754. m_currentManager->Translate( aCenterPoint.x, aCenterPoint.y, 0.0 );
  755. if( m_isStrokeEnabled )
  756. {
  757. m_currentManager->Color( m_strokeColor.r, m_strokeColor.g, m_strokeColor.b,
  758. m_strokeColor.a );
  759. double width = aWidth / 2.0;
  760. VECTOR2D startPoint( cos( startAngle ) * aRadius, sin( startAngle ) * aRadius );
  761. VECTOR2D endPoint( cos( endAngle ) * aRadius, sin( endAngle ) * aRadius );
  762. drawStrokedSemiCircle( startPoint, width, startAngle + M_PI );
  763. drawStrokedSemiCircle( endPoint, width, endAngle );
  764. VECTOR2D pOuter( cos( startAngle ) * ( aRadius + width ),
  765. sin( startAngle ) * ( aRadius + width ) );
  766. VECTOR2D pInner( cos( startAngle ) * ( aRadius - width ),
  767. sin( startAngle ) * ( aRadius - width ) );
  768. double alpha;
  769. for( alpha = startAngle + alphaIncrement; alpha <= endAngle; alpha += alphaIncrement )
  770. {
  771. VECTOR2D pNextOuter( cos( alpha ) * ( aRadius + width ),
  772. sin( alpha ) * ( aRadius + width ) );
  773. VECTOR2D pNextInner( cos( alpha ) * ( aRadius - width ),
  774. sin( alpha ) * ( aRadius - width ) );
  775. DrawLine( pOuter, pNextOuter );
  776. DrawLine( pInner, pNextInner );
  777. pOuter = pNextOuter;
  778. pInner = pNextInner;
  779. }
  780. // Draw the last missing part
  781. if( alpha != endAngle )
  782. {
  783. VECTOR2D pLastOuter( cos( endAngle ) * ( aRadius + width ),
  784. sin( endAngle ) * ( aRadius + width ) );
  785. VECTOR2D pLastInner( cos( endAngle ) * ( aRadius - width ),
  786. sin( endAngle ) * ( aRadius - width ) );
  787. DrawLine( pOuter, pLastOuter );
  788. DrawLine( pInner, pLastInner );
  789. }
  790. }
  791. if( m_isFillEnabled )
  792. {
  793. m_currentManager->Color( m_fillColor.r, m_fillColor.g, m_fillColor.b, m_fillColor.a );
  794. SetLineWidth( aWidth );
  795. VECTOR2D p( cos( startAngle ) * aRadius, sin( startAngle ) * aRadius );
  796. double alpha;
  797. int lineCount = 0;
  798. for( alpha = startAngle + alphaIncrement; alpha <= endAngle; alpha += alphaIncrement )
  799. {
  800. lineCount++;
  801. }
  802. // The last missing part
  803. if( alpha != endAngle )
  804. {
  805. lineCount++;
  806. }
  807. reserveLineQuads( lineCount );
  808. for( alpha = startAngle + alphaIncrement; alpha <= endAngle; alpha += alphaIncrement )
  809. {
  810. VECTOR2D p_next( cos( alpha ) * aRadius, sin( alpha ) * aRadius );
  811. drawLineQuad( p, p_next, false );
  812. p = p_next;
  813. }
  814. // Draw the last missing part
  815. if( alpha != endAngle )
  816. {
  817. VECTOR2D p_last( cos( endAngle ) * aRadius, sin( endAngle ) * aRadius );
  818. drawLineQuad( p, p_last, false );
  819. }
  820. }
  821. Restore();
  822. }
  823. void OPENGL_GAL::DrawRectangle( const VECTOR2D& aStartPoint, const VECTOR2D& aEndPoint )
  824. {
  825. // Compute the diagonal points of the rectangle
  826. VECTOR2D diagonalPointA( aEndPoint.x, aStartPoint.y );
  827. VECTOR2D diagonalPointB( aStartPoint.x, aEndPoint.y );
  828. // Fill the rectangle
  829. if( m_isFillEnabled )
  830. {
  831. m_currentManager->Reserve( 6 );
  832. m_currentManager->Shader( SHADER_NONE );
  833. m_currentManager->Color( m_fillColor.r, m_fillColor.g, m_fillColor.b, m_fillColor.a );
  834. m_currentManager->Vertex( aStartPoint.x, aStartPoint.y, m_layerDepth );
  835. m_currentManager->Vertex( diagonalPointA.x, diagonalPointA.y, m_layerDepth );
  836. m_currentManager->Vertex( aEndPoint.x, aEndPoint.y, m_layerDepth );
  837. m_currentManager->Vertex( aStartPoint.x, aStartPoint.y, m_layerDepth );
  838. m_currentManager->Vertex( aEndPoint.x, aEndPoint.y, m_layerDepth );
  839. m_currentManager->Vertex( diagonalPointB.x, diagonalPointB.y, m_layerDepth );
  840. }
  841. // Stroke the outline
  842. if( m_isStrokeEnabled )
  843. {
  844. m_currentManager->Color( m_strokeColor.r, m_strokeColor.g, m_strokeColor.b,
  845. m_strokeColor.a );
  846. std::deque<VECTOR2D> pointList;
  847. pointList.push_back( aStartPoint );
  848. pointList.push_back( diagonalPointA );
  849. pointList.push_back( aEndPoint );
  850. pointList.push_back( diagonalPointB );
  851. pointList.push_back( aStartPoint );
  852. DrawPolyline( pointList );
  853. }
  854. }
  855. void OPENGL_GAL::DrawSegmentChain( const std::vector<VECTOR2D>& aPointList, double aWidth )
  856. {
  857. drawSegmentChain(
  858. [&]( int idx )
  859. {
  860. return aPointList[idx];
  861. },
  862. aPointList.size(), aWidth );
  863. }
  864. void OPENGL_GAL::DrawSegmentChain( const SHAPE_LINE_CHAIN& aLineChain, double aWidth )
  865. {
  866. auto numPoints = aLineChain.PointCount();
  867. if( aLineChain.IsClosed() )
  868. numPoints += 1;
  869. drawSegmentChain(
  870. [&]( int idx )
  871. {
  872. return aLineChain.CPoint( idx );
  873. },
  874. numPoints, aWidth );
  875. }
  876. void OPENGL_GAL::DrawPolyline( const std::deque<VECTOR2D>& aPointList )
  877. {
  878. drawPolyline(
  879. [&]( int idx )
  880. {
  881. return aPointList[idx];
  882. },
  883. aPointList.size() );
  884. }
  885. void OPENGL_GAL::DrawPolyline( const std::vector<VECTOR2D>& aPointList )
  886. {
  887. drawPolyline(
  888. [&]( int idx )
  889. {
  890. return aPointList[idx];
  891. },
  892. aPointList.size() );
  893. }
  894. void OPENGL_GAL::DrawPolyline( const VECTOR2D aPointList[], int aListSize )
  895. {
  896. drawPolyline(
  897. [&]( int idx )
  898. {
  899. return aPointList[idx];
  900. },
  901. aListSize );
  902. }
  903. void OPENGL_GAL::DrawPolyline( const SHAPE_LINE_CHAIN& aLineChain )
  904. {
  905. auto numPoints = aLineChain.PointCount();
  906. if( aLineChain.IsClosed() )
  907. numPoints += 1;
  908. drawPolyline(
  909. [&]( int idx )
  910. {
  911. return aLineChain.CPoint( idx );
  912. },
  913. numPoints );
  914. }
  915. void OPENGL_GAL::DrawPolylines( const std::vector<std::vector<VECTOR2D>>& aPointList )
  916. {
  917. int lineQuadCount = 0;
  918. for( const std::vector<VECTOR2D>& points : aPointList )
  919. lineQuadCount += points.size() - 1;
  920. reserveLineQuads( lineQuadCount );
  921. for( const std::vector<VECTOR2D>& points : aPointList )
  922. {
  923. drawPolyline(
  924. [&]( int idx )
  925. {
  926. return points[idx];
  927. },
  928. points.size(), false );
  929. }
  930. }
  931. void OPENGL_GAL::DrawPolygon( const std::deque<VECTOR2D>& aPointList )
  932. {
  933. wxCHECK( aPointList.size() >= 2, /* void */ );
  934. auto points = std::unique_ptr<GLdouble[]>( new GLdouble[3 * aPointList.size()] );
  935. GLdouble* ptr = points.get();
  936. for( const VECTOR2D& p : aPointList )
  937. {
  938. *ptr++ = p.x;
  939. *ptr++ = p.y;
  940. *ptr++ = m_layerDepth;
  941. }
  942. drawPolygon( points.get(), aPointList.size() );
  943. }
  944. void OPENGL_GAL::DrawPolygon( const VECTOR2D aPointList[], int aListSize )
  945. {
  946. wxCHECK( aListSize >= 2, /* void */ );
  947. auto points = std::unique_ptr<GLdouble[]>( new GLdouble[3 * aListSize] );
  948. GLdouble* target = points.get();
  949. const VECTOR2D* src = aPointList;
  950. for( int i = 0; i < aListSize; ++i )
  951. {
  952. *target++ = src->x;
  953. *target++ = src->y;
  954. *target++ = m_layerDepth;
  955. ++src;
  956. }
  957. drawPolygon( points.get(), aListSize );
  958. }
  959. void OPENGL_GAL::drawTriangulatedPolyset( const SHAPE_POLY_SET& aPolySet,
  960. bool aStrokeTriangulation )
  961. {
  962. m_currentManager->Shader( SHADER_NONE );
  963. m_currentManager->Color( m_fillColor.r, m_fillColor.g, m_fillColor.b, m_fillColor.a );
  964. if( m_isFillEnabled )
  965. {
  966. int totalTriangleCount = 0;
  967. for( unsigned int j = 0; j < aPolySet.TriangulatedPolyCount(); ++j )
  968. {
  969. auto triPoly = aPolySet.TriangulatedPolygon( j );
  970. totalTriangleCount += triPoly->GetTriangleCount();
  971. }
  972. m_currentManager->Reserve( 3 * totalTriangleCount );
  973. for( unsigned int j = 0; j < aPolySet.TriangulatedPolyCount(); ++j )
  974. {
  975. auto triPoly = aPolySet.TriangulatedPolygon( j );
  976. for( size_t i = 0; i < triPoly->GetTriangleCount(); i++ )
  977. {
  978. VECTOR2I a, b, c;
  979. triPoly->GetTriangle( i, a, b, c );
  980. m_currentManager->Vertex( a.x, a.y, m_layerDepth );
  981. m_currentManager->Vertex( b.x, b.y, m_layerDepth );
  982. m_currentManager->Vertex( c.x, c.y, m_layerDepth );
  983. }
  984. }
  985. }
  986. if( m_isStrokeEnabled )
  987. {
  988. for( int j = 0; j < aPolySet.OutlineCount(); ++j )
  989. {
  990. const auto& poly = aPolySet.Polygon( j );
  991. for( const auto& lc : poly )
  992. {
  993. DrawPolyline( lc );
  994. }
  995. }
  996. }
  997. if( ADVANCED_CFG::GetCfg().m_DrawTriangulationOutlines )
  998. {
  999. aStrokeTriangulation = true;
  1000. SetStrokeColor( COLOR4D( 0.0, 1.0, 0.2, 1.0 ) );
  1001. }
  1002. if( aStrokeTriangulation )
  1003. {
  1004. COLOR4D oldStrokeColor = m_strokeColor;
  1005. double oldLayerDepth = m_layerDepth;
  1006. SetLayerDepth( m_layerDepth - 1 );
  1007. for( unsigned int j = 0; j < aPolySet.TriangulatedPolyCount(); ++j )
  1008. {
  1009. auto triPoly = aPolySet.TriangulatedPolygon( j );
  1010. for( size_t i = 0; i < triPoly->GetTriangleCount(); i++ )
  1011. {
  1012. VECTOR2I a, b, c;
  1013. triPoly->GetTriangle( i, a, b, c );
  1014. DrawLine( a, b );
  1015. DrawLine( b, c );
  1016. DrawLine( c, a );
  1017. }
  1018. }
  1019. SetStrokeColor( oldStrokeColor );
  1020. SetLayerDepth( oldLayerDepth );
  1021. }
  1022. }
  1023. void OPENGL_GAL::DrawPolygon( const SHAPE_POLY_SET& aPolySet, bool aStrokeTriangulation )
  1024. {
  1025. if( aPolySet.IsTriangulationUpToDate() )
  1026. {
  1027. drawTriangulatedPolyset( aPolySet, aStrokeTriangulation );
  1028. return;
  1029. }
  1030. for( int j = 0; j < aPolySet.OutlineCount(); ++j )
  1031. {
  1032. const SHAPE_LINE_CHAIN& outline = aPolySet.COutline( j );
  1033. DrawPolygon( outline );
  1034. }
  1035. }
  1036. void OPENGL_GAL::DrawPolygon( const SHAPE_LINE_CHAIN& aPolygon )
  1037. {
  1038. wxCHECK( aPolygon.PointCount() >= 2, /* void */ );
  1039. const int pointCount = aPolygon.SegmentCount() + 1;
  1040. std::unique_ptr<GLdouble[]> points( new GLdouble[3 * pointCount] );
  1041. GLdouble* ptr = points.get();
  1042. for( int i = 0; i < pointCount; ++i )
  1043. {
  1044. const VECTOR2I& p = aPolygon.CPoint( i );
  1045. *ptr++ = p.x;
  1046. *ptr++ = p.y;
  1047. *ptr++ = m_layerDepth;
  1048. }
  1049. drawPolygon( points.get(), pointCount );
  1050. }
  1051. void OPENGL_GAL::DrawCurve( const VECTOR2D& aStartPoint, const VECTOR2D& aControlPointA,
  1052. const VECTOR2D& aControlPointB, const VECTOR2D& aEndPoint,
  1053. double aFilterValue )
  1054. {
  1055. std::vector<VECTOR2D> output;
  1056. std::vector<VECTOR2D> pointCtrl;
  1057. pointCtrl.push_back( aStartPoint );
  1058. pointCtrl.push_back( aControlPointA );
  1059. pointCtrl.push_back( aControlPointB );
  1060. pointCtrl.push_back( aEndPoint );
  1061. BEZIER_POLY converter( pointCtrl );
  1062. converter.GetPoly( output, aFilterValue );
  1063. DrawPolyline( &output[0], output.size() );
  1064. }
  1065. void OPENGL_GAL::DrawBitmap( const BITMAP_BASE& aBitmap, double alphaBlend )
  1066. {
  1067. GLfloat alpha = std::clamp( alphaBlend, 0.0, 1.0 );
  1068. // We have to calculate the pixel size in users units to draw the image.
  1069. // m_worldUnitLength is a factor used for converting IU to inches
  1070. double scale = 1.0 / ( aBitmap.GetPPI() * m_worldUnitLength );
  1071. double w = (double) aBitmap.GetSizePixels().x * scale;
  1072. double h = (double) aBitmap.GetSizePixels().y * scale;
  1073. auto xform = m_currentManager->GetTransformation();
  1074. glm::vec4 v0 = xform * glm::vec4( -w / 2, -h / 2, 0.0, 0.0 );
  1075. glm::vec4 v1 = xform * glm::vec4( w / 2, h / 2, 0.0, 0.0 );
  1076. glm::vec4 trans = xform[3];
  1077. auto texture_id = m_bitmapCache->RequestBitmap( &aBitmap );
  1078. if( !glIsTexture( texture_id ) ) // ensure the bitmap texture is still valid
  1079. return;
  1080. glPushMatrix();
  1081. glTranslated( trans.x, trans.y, trans.z );
  1082. glEnable( GL_TEXTURE_2D );
  1083. glActiveTexture( GL_TEXTURE0 );
  1084. glBindTexture( GL_TEXTURE_2D, texture_id );
  1085. glBegin( GL_QUADS );
  1086. glColor4f( 1.0, 1.0, 1.0, alpha );
  1087. glTexCoord2f( 0.0, 0.0 );
  1088. glVertex3f( v0.x, v0.y, m_layerDepth );
  1089. glColor4f( 1.0, 1.0, 1.0, alpha );
  1090. glTexCoord2f( 1.0, 0.0 );
  1091. glVertex3f( v1.x, v0.y, m_layerDepth );
  1092. glColor4f( 1.0, 1.0, 1.0, alpha );
  1093. glTexCoord2f( 1.0, 1.0 );
  1094. glVertex3f( v1.x, v1.y, m_layerDepth );
  1095. glColor4f( 1.0, 1.0, 1.0, alpha );
  1096. glTexCoord2f( 0.0, 1.0 );
  1097. glVertex3f( v0.x, v1.y, m_layerDepth );
  1098. glEnd();
  1099. glBindTexture( GL_TEXTURE_2D, 0 );
  1100. #ifdef DISABLE_BITMAP_CACHE
  1101. glDeleteTextures( 1, &texture_id );
  1102. #endif
  1103. glPopMatrix();
  1104. }
  1105. void OPENGL_GAL::BitmapText( const wxString& aText, const VECTOR2I& aPosition,
  1106. const EDA_ANGLE& aAngle )
  1107. {
  1108. // Fallback to generic impl (which uses the stroke font) on cases we don't handle
  1109. if( IsTextMirrored()
  1110. || aText.Contains( wxT( "^{" ) )
  1111. || aText.Contains( wxT( "_{" ) )
  1112. || aText.Contains( wxT( "\n" ) ) )
  1113. {
  1114. return GAL::BitmapText( aText, aPosition, aAngle );
  1115. }
  1116. const UTF8 text( aText );
  1117. VECTOR2D textSize;
  1118. float commonOffset;
  1119. std::tie( textSize, commonOffset ) = computeBitmapTextSize( text );
  1120. const double SCALE = 1.4 * GetGlyphSize().y / textSize.y;
  1121. double overbarHeight = textSize.y;
  1122. Save();
  1123. m_currentManager->Color( m_strokeColor.r, m_strokeColor.g, m_strokeColor.b, m_strokeColor.a );
  1124. m_currentManager->Translate( aPosition.x, aPosition.y, m_layerDepth );
  1125. m_currentManager->Rotate( aAngle.AsRadians(), 0.0f, 0.0f, -1.0f );
  1126. double sx = SCALE * ( m_globalFlipX ? -1.0 : 1.0 );
  1127. double sy = SCALE * ( m_globalFlipY ? -1.0 : 1.0 );
  1128. m_currentManager->Scale( sx, sy, 0 );
  1129. m_currentManager->Translate( 0, -commonOffset, 0 );
  1130. switch( GetHorizontalJustify() )
  1131. {
  1132. case GR_TEXT_H_ALIGN_CENTER:
  1133. Translate( VECTOR2D( -textSize.x / 2.0, 0 ) );
  1134. break;
  1135. case GR_TEXT_H_ALIGN_RIGHT:
  1136. //if( !IsTextMirrored() )
  1137. Translate( VECTOR2D( -textSize.x, 0 ) );
  1138. break;
  1139. case GR_TEXT_H_ALIGN_LEFT:
  1140. //if( IsTextMirrored() )
  1141. //Translate( VECTOR2D( -textSize.x, 0 ) );
  1142. break;
  1143. }
  1144. switch( GetVerticalJustify() )
  1145. {
  1146. case GR_TEXT_V_ALIGN_TOP:
  1147. break;
  1148. case GR_TEXT_V_ALIGN_CENTER:
  1149. Translate( VECTOR2D( 0, -textSize.y / 2.0 ) );
  1150. overbarHeight = 0;
  1151. break;
  1152. case GR_TEXT_V_ALIGN_BOTTOM:
  1153. Translate( VECTOR2D( 0, -textSize.y ) );
  1154. overbarHeight = -textSize.y / 2.0;
  1155. break;
  1156. }
  1157. int overbarLength = 0;
  1158. int overbarDepth = -1;
  1159. int braceNesting = 0;
  1160. auto iterateString =
  1161. [&]( std::function<void( int aOverbarLength, int aOverbarHeight )> overbarFn,
  1162. std::function<int( unsigned long aChar )> bitmapCharFn )
  1163. {
  1164. for( UTF8::uni_iter chIt = text.ubegin(), end = text.uend(); chIt < end; ++chIt )
  1165. {
  1166. wxASSERT_MSG( *chIt != '\n' && *chIt != '\r',
  1167. "No support for multiline bitmap text yet" );
  1168. if( *chIt == '~' && overbarDepth == -1 )
  1169. {
  1170. UTF8::uni_iter lookahead = chIt;
  1171. if( ++lookahead != end && *lookahead == '{' )
  1172. {
  1173. chIt = lookahead;
  1174. overbarDepth = braceNesting;
  1175. braceNesting++;
  1176. continue;
  1177. }
  1178. }
  1179. else if( *chIt == '{' )
  1180. {
  1181. braceNesting++;
  1182. }
  1183. else if( *chIt == '}' )
  1184. {
  1185. if( braceNesting > 0 )
  1186. braceNesting--;
  1187. if( braceNesting == overbarDepth )
  1188. {
  1189. overbarFn( overbarLength, overbarHeight );
  1190. overbarLength = 0;
  1191. overbarDepth = -1;
  1192. continue;
  1193. }
  1194. }
  1195. if( overbarDepth != -1 )
  1196. overbarLength += bitmapCharFn( *chIt );
  1197. else
  1198. bitmapCharFn( *chIt );
  1199. }
  1200. };
  1201. // First, calculate the amount of characters and overbars to reserve
  1202. int charsCount = 0;
  1203. int overbarsCount = 0;
  1204. iterateString(
  1205. [&overbarsCount]( int aOverbarLength, int aOverbarHeight )
  1206. {
  1207. overbarsCount++;
  1208. },
  1209. [&charsCount]( unsigned long aChar ) -> int
  1210. {
  1211. if( aChar != ' ' )
  1212. charsCount++;
  1213. return 0;
  1214. } );
  1215. m_currentManager->Reserve( 6 * charsCount + 6 * overbarsCount );
  1216. // Now reset the state and actually draw the characters and overbars
  1217. overbarLength = 0;
  1218. overbarDepth = -1;
  1219. braceNesting = 0;
  1220. iterateString(
  1221. [&]( int aOverbarLength, int aOverbarHeight )
  1222. {
  1223. drawBitmapOverbar( aOverbarLength, aOverbarHeight, false );
  1224. },
  1225. [&]( unsigned long aChar ) -> int
  1226. {
  1227. return drawBitmapChar( aChar, false );
  1228. } );
  1229. // Handle the case when overbar is active till the end of the drawn text
  1230. m_currentManager->Translate( 0, commonOffset, 0 );
  1231. if( overbarDepth != -1 && overbarLength > 0 )
  1232. drawBitmapOverbar( overbarLength, overbarHeight );
  1233. Restore();
  1234. }
  1235. void OPENGL_GAL::DrawGrid()
  1236. {
  1237. SetTarget( TARGET_NONCACHED );
  1238. m_compositor->SetBuffer( m_mainBuffer );
  1239. m_nonCachedManager->EnableDepthTest( false );
  1240. // sub-pixel lines all render the same
  1241. float minorLineWidth = std::fmax( 1.0f,
  1242. m_gridLineWidth ) * getWorldPixelSize() / GetScaleFactor();
  1243. float majorLineWidth = minorLineWidth * 2.0f;
  1244. // Draw the axis and grid
  1245. // For the drawing the start points, end points and increments have
  1246. // to be calculated in world coordinates
  1247. VECTOR2D worldStartPoint = m_screenWorldMatrix * VECTOR2D( 0.0, 0.0 );
  1248. VECTOR2D worldEndPoint = m_screenWorldMatrix * VECTOR2D( m_screenSize );
  1249. // Draw axes if desired
  1250. if( m_axesEnabled )
  1251. {
  1252. SetLineWidth( minorLineWidth );
  1253. SetStrokeColor( m_axesColor );
  1254. DrawLine( VECTOR2D( worldStartPoint.x, 0 ), VECTOR2D( worldEndPoint.x, 0 ) );
  1255. DrawLine( VECTOR2D( 0, worldStartPoint.y ), VECTOR2D( 0, worldEndPoint.y ) );
  1256. }
  1257. // force flush
  1258. m_nonCachedManager->EndDrawing();
  1259. if( !m_gridVisibility || m_gridSize.x == 0 || m_gridSize.y == 0 )
  1260. return;
  1261. VECTOR2D gridScreenSize( m_gridSize );
  1262. double gridThreshold = computeMinGridSpacing() / m_worldScale;
  1263. if( m_gridStyle == GRID_STYLE::SMALL_CROSS )
  1264. gridThreshold *= 2.0;
  1265. // If we cannot display the grid density, scale down by a tick size and
  1266. // try again. Eventually, we get some representation of the grid
  1267. while( std::min( gridScreenSize.x, gridScreenSize.y ) <= gridThreshold )
  1268. {
  1269. gridScreenSize = gridScreenSize * static_cast<double>( m_gridTick );
  1270. }
  1271. // Compute grid starting and ending indexes to draw grid points on the
  1272. // visible screen area
  1273. // Note: later any point coordinate will be offsetted by m_gridOrigin
  1274. int gridStartX = KiROUND( ( worldStartPoint.x - m_gridOrigin.x ) / gridScreenSize.x );
  1275. int gridEndX = KiROUND( ( worldEndPoint.x - m_gridOrigin.x ) / gridScreenSize.x );
  1276. int gridStartY = KiROUND( ( worldStartPoint.y - m_gridOrigin.y ) / gridScreenSize.y );
  1277. int gridEndY = KiROUND( ( worldEndPoint.y - m_gridOrigin.y ) / gridScreenSize.y );
  1278. // Ensure start coordinate > end coordinate
  1279. SWAP( gridStartX, >, gridEndX );
  1280. SWAP( gridStartY, >, gridEndY );
  1281. // Ensure the grid fills the screen
  1282. --gridStartX;
  1283. ++gridEndX;
  1284. --gridStartY;
  1285. ++gridEndY;
  1286. glDisable( GL_DEPTH_TEST );
  1287. glDisable( GL_TEXTURE_2D );
  1288. if( m_gridStyle == GRID_STYLE::DOTS )
  1289. {
  1290. glEnable( GL_STENCIL_TEST );
  1291. glStencilFunc( GL_ALWAYS, 1, 1 );
  1292. glStencilOp( GL_KEEP, GL_KEEP, GL_INCR );
  1293. glColor4d( 0.0, 0.0, 0.0, 0.0 );
  1294. SetStrokeColor( COLOR4D( 0.0, 0.0, 0.0, 0.0 ) );
  1295. }
  1296. else
  1297. {
  1298. glColor4d( m_gridColor.r, m_gridColor.g, m_gridColor.b, m_gridColor.a );
  1299. SetStrokeColor( m_gridColor );
  1300. }
  1301. if( m_gridStyle == GRID_STYLE::SMALL_CROSS )
  1302. {
  1303. // Vertical positions
  1304. for( int j = gridStartY; j <= gridEndY; j++ )
  1305. {
  1306. bool tickY = ( j % m_gridTick == 0 );
  1307. const double posY = j * gridScreenSize.y + m_gridOrigin.y;
  1308. // Horizontal positions
  1309. for( int i = gridStartX; i <= gridEndX; i++ )
  1310. {
  1311. bool tickX = ( i % m_gridTick == 0 );
  1312. SetLineWidth( ( ( tickX && tickY ) ? majorLineWidth : minorLineWidth ) );
  1313. auto lineLen = 2.0 * GetLineWidth();
  1314. auto posX = i * gridScreenSize.x + m_gridOrigin.x;
  1315. DrawLine( VECTOR2D( posX - lineLen, posY ), VECTOR2D( posX + lineLen, posY ) );
  1316. DrawLine( VECTOR2D( posX, posY - lineLen ), VECTOR2D( posX, posY + lineLen ) );
  1317. }
  1318. }
  1319. m_nonCachedManager->EndDrawing();
  1320. }
  1321. else
  1322. {
  1323. // Vertical lines
  1324. for( int j = gridStartY; j <= gridEndY; j++ )
  1325. {
  1326. const double y = j * gridScreenSize.y + m_gridOrigin.y;
  1327. // If axes are drawn, skip the lines that would cover them
  1328. if( m_axesEnabled && y == 0.0 )
  1329. continue;
  1330. SetLineWidth( ( j % m_gridTick == 0 ) ? majorLineWidth : minorLineWidth );
  1331. VECTOR2D a( gridStartX * gridScreenSize.x + m_gridOrigin.x, y );
  1332. VECTOR2D b( gridEndX * gridScreenSize.x + m_gridOrigin.x, y );
  1333. DrawLine( a, b );
  1334. }
  1335. m_nonCachedManager->EndDrawing();
  1336. if( m_gridStyle == GRID_STYLE::DOTS )
  1337. {
  1338. glStencilFunc( GL_NOTEQUAL, 0, 1 );
  1339. glColor4d( m_gridColor.r, m_gridColor.g, m_gridColor.b, m_gridColor.a );
  1340. SetStrokeColor( m_gridColor );
  1341. }
  1342. // Horizontal lines
  1343. for( int i = gridStartX; i <= gridEndX; i++ )
  1344. {
  1345. const double x = i * gridScreenSize.x + m_gridOrigin.x;
  1346. // If axes are drawn, skip the lines that would cover them
  1347. if( m_axesEnabled && x == 0.0 )
  1348. continue;
  1349. SetLineWidth( ( i % m_gridTick == 0 ) ? majorLineWidth : minorLineWidth );
  1350. VECTOR2D a( x, gridStartY * gridScreenSize.y + m_gridOrigin.y );
  1351. VECTOR2D b( x, gridEndY * gridScreenSize.y + m_gridOrigin.y );
  1352. DrawLine( a, b );
  1353. }
  1354. m_nonCachedManager->EndDrawing();
  1355. if( m_gridStyle == GRID_STYLE::DOTS )
  1356. glDisable( GL_STENCIL_TEST );
  1357. }
  1358. glEnable( GL_DEPTH_TEST );
  1359. glEnable( GL_TEXTURE_2D );
  1360. }
  1361. void OPENGL_GAL::ResizeScreen( int aWidth, int aHeight )
  1362. {
  1363. m_screenSize = VECTOR2I( aWidth, aHeight );
  1364. // Resize framebuffers
  1365. const float scaleFactor = GetScaleFactor();
  1366. m_compositor->Resize( aWidth * scaleFactor, aHeight * scaleFactor );
  1367. m_isFramebufferInitialized = false;
  1368. wxGLCanvas::SetSize( aWidth, aHeight );
  1369. }
  1370. bool OPENGL_GAL::Show( bool aShow )
  1371. {
  1372. bool s = wxGLCanvas::Show( aShow );
  1373. if( aShow )
  1374. wxGLCanvas::Raise();
  1375. return s;
  1376. }
  1377. void OPENGL_GAL::Flush()
  1378. {
  1379. glFlush();
  1380. }
  1381. void OPENGL_GAL::ClearScreen()
  1382. {
  1383. // Clear screen
  1384. m_compositor->SetBuffer( OPENGL_COMPOSITOR::DIRECT_RENDERING );
  1385. // NOTE: Black used here instead of m_clearColor; it will be composited later
  1386. glClearColor( 0, 0, 0, 1 );
  1387. glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT );
  1388. }
  1389. void OPENGL_GAL::Transform( const MATRIX3x3D& aTransformation )
  1390. {
  1391. GLdouble matrixData[16] = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 };
  1392. matrixData[0] = aTransformation.m_data[0][0];
  1393. matrixData[1] = aTransformation.m_data[1][0];
  1394. matrixData[2] = aTransformation.m_data[2][0];
  1395. matrixData[4] = aTransformation.m_data[0][1];
  1396. matrixData[5] = aTransformation.m_data[1][1];
  1397. matrixData[6] = aTransformation.m_data[2][1];
  1398. matrixData[12] = aTransformation.m_data[0][2];
  1399. matrixData[13] = aTransformation.m_data[1][2];
  1400. matrixData[14] = aTransformation.m_data[2][2];
  1401. glMultMatrixd( matrixData );
  1402. }
  1403. void OPENGL_GAL::Rotate( double aAngle )
  1404. {
  1405. m_currentManager->Rotate( aAngle, 0.0f, 0.0f, 1.0f );
  1406. }
  1407. void OPENGL_GAL::Translate( const VECTOR2D& aVector )
  1408. {
  1409. m_currentManager->Translate( aVector.x, aVector.y, 0.0f );
  1410. }
  1411. void OPENGL_GAL::Scale( const VECTOR2D& aScale )
  1412. {
  1413. m_currentManager->Scale( aScale.x, aScale.y, 0.0f );
  1414. }
  1415. void OPENGL_GAL::Save()
  1416. {
  1417. m_currentManager->PushMatrix();
  1418. }
  1419. void OPENGL_GAL::Restore()
  1420. {
  1421. m_currentManager->PopMatrix();
  1422. }
  1423. int OPENGL_GAL::BeginGroup()
  1424. {
  1425. m_isGrouping = true;
  1426. std::shared_ptr<VERTEX_ITEM> newItem = std::make_shared<VERTEX_ITEM>( *m_cachedManager );
  1427. int groupNumber = getNewGroupNumber();
  1428. m_groups.insert( std::make_pair( groupNumber, newItem ) );
  1429. return groupNumber;
  1430. }
  1431. void OPENGL_GAL::EndGroup()
  1432. {
  1433. m_cachedManager->FinishItem();
  1434. m_isGrouping = false;
  1435. }
  1436. void OPENGL_GAL::DrawGroup( int aGroupNumber )
  1437. {
  1438. auto group = m_groups.find( aGroupNumber );
  1439. if( group != m_groups.end() )
  1440. m_cachedManager->DrawItem( *group->second );
  1441. }
  1442. void OPENGL_GAL::ChangeGroupColor( int aGroupNumber, const COLOR4D& aNewColor )
  1443. {
  1444. auto group = m_groups.find( aGroupNumber );
  1445. if( group != m_groups.end() )
  1446. m_cachedManager->ChangeItemColor( *group->second, aNewColor );
  1447. }
  1448. void OPENGL_GAL::ChangeGroupDepth( int aGroupNumber, int aDepth )
  1449. {
  1450. auto group = m_groups.find( aGroupNumber );
  1451. if( group != m_groups.end() )
  1452. m_cachedManager->ChangeItemDepth( *group->second, aDepth );
  1453. }
  1454. void OPENGL_GAL::DeleteGroup( int aGroupNumber )
  1455. {
  1456. // Frees memory in the container as well
  1457. m_groups.erase( aGroupNumber );
  1458. }
  1459. void OPENGL_GAL::ClearCache()
  1460. {
  1461. m_bitmapCache = std::make_unique<GL_BITMAP_CACHE>();
  1462. m_groups.clear();
  1463. if( m_isInitialized )
  1464. m_cachedManager->Clear();
  1465. }
  1466. void OPENGL_GAL::SetTarget( RENDER_TARGET aTarget )
  1467. {
  1468. switch( aTarget )
  1469. {
  1470. default:
  1471. case TARGET_CACHED: m_currentManager = m_cachedManager; break;
  1472. case TARGET_NONCACHED: m_currentManager = m_nonCachedManager; break;
  1473. case TARGET_OVERLAY: m_currentManager = m_overlayManager; break;
  1474. case TARGET_TEMP: m_currentManager = m_tempManager; break;
  1475. }
  1476. m_currentTarget = aTarget;
  1477. }
  1478. RENDER_TARGET OPENGL_GAL::GetTarget() const
  1479. {
  1480. return m_currentTarget;
  1481. }
  1482. void OPENGL_GAL::ClearTarget( RENDER_TARGET aTarget )
  1483. {
  1484. // Save the current state
  1485. unsigned int oldTarget = m_compositor->GetBuffer();
  1486. switch( aTarget )
  1487. {
  1488. // Cached and noncached items are rendered to the same buffer
  1489. default:
  1490. case TARGET_CACHED:
  1491. case TARGET_NONCACHED:
  1492. m_compositor->SetBuffer( m_mainBuffer );
  1493. break;
  1494. case TARGET_TEMP:
  1495. m_compositor->SetBuffer( m_tempBuffer );
  1496. break;
  1497. case TARGET_OVERLAY:
  1498. if( m_overlayBuffer )
  1499. m_compositor->SetBuffer( m_overlayBuffer );
  1500. break;
  1501. }
  1502. if( aTarget != TARGET_OVERLAY )
  1503. m_compositor->ClearBuffer( m_clearColor );
  1504. else if( m_overlayBuffer )
  1505. m_compositor->ClearBuffer( COLOR4D::BLACK );
  1506. // Restore the previous state
  1507. m_compositor->SetBuffer( oldTarget );
  1508. }
  1509. bool OPENGL_GAL::HasTarget( RENDER_TARGET aTarget )
  1510. {
  1511. switch( aTarget )
  1512. {
  1513. default:
  1514. case TARGET_TEMP:
  1515. case TARGET_CACHED:
  1516. case TARGET_NONCACHED: return true;
  1517. case TARGET_OVERLAY: return ( m_overlayBuffer != 0 );
  1518. }
  1519. }
  1520. void OPENGL_GAL::StartDiffLayer()
  1521. {
  1522. m_currentManager->EndDrawing();
  1523. SetTarget( TARGET_TEMP );
  1524. ClearTarget( TARGET_TEMP );
  1525. }
  1526. void OPENGL_GAL::EndDiffLayer()
  1527. {
  1528. glBlendEquation( GL_MAX );
  1529. m_currentManager->EndDrawing();
  1530. glBlendEquation( GL_FUNC_ADD );
  1531. m_compositor->DrawBuffer( m_tempBuffer, m_mainBuffer );
  1532. }
  1533. bool OPENGL_GAL::SetNativeCursorStyle( KICURSOR aCursor )
  1534. {
  1535. // Store the current cursor type and get the wxCursor for it
  1536. if( !GAL::SetNativeCursorStyle( aCursor ) )
  1537. return false;
  1538. m_currentwxCursor = CURSOR_STORE::GetCursor( m_currentNativeCursor );
  1539. // Update the cursor in the wx control
  1540. HIDPI_GL_CANVAS::SetCursor( m_currentwxCursor );
  1541. return true;
  1542. }
  1543. void OPENGL_GAL::onSetNativeCursor( wxSetCursorEvent& aEvent )
  1544. {
  1545. aEvent.SetCursor( m_currentwxCursor );
  1546. }
  1547. void OPENGL_GAL::DrawCursor( const VECTOR2D& aCursorPosition )
  1548. {
  1549. // Now we should only store the position of the mouse cursor
  1550. // The real drawing routines are in blitCursor()
  1551. //VECTOR2D screenCursor = m_worldScreenMatrix * aCursorPosition;
  1552. //m_cursorPosition = m_screenWorldMatrix * VECTOR2D( screenCursor.x, screenCursor.y );
  1553. m_cursorPosition = aCursorPosition;
  1554. }
  1555. void OPENGL_GAL::drawLineQuad( const VECTOR2D& aStartPoint, const VECTOR2D& aEndPoint,
  1556. const bool aReserve )
  1557. {
  1558. /* Helper drawing: ____--- v3 ^
  1559. * ____---- ... \ \
  1560. * ____---- ... \ end \
  1561. * v1 ____---- ... ____---- \ width
  1562. * ---- ...___---- \ \
  1563. * \ ___...-- \ v
  1564. * \ ____----... ____---- v2
  1565. * ---- ... ____----
  1566. * start \ ... ____----
  1567. * \... ____----
  1568. * ----
  1569. * v0
  1570. * dots mark triangles' hypotenuses
  1571. */
  1572. auto v1 = m_currentManager->GetTransformation()
  1573. * glm::vec4( aStartPoint.x, aStartPoint.y, 0.0, 0.0 );
  1574. auto v2 = m_currentManager->GetTransformation()
  1575. * glm::vec4( aEndPoint.x, aEndPoint.y, 0.0, 0.0 );
  1576. VECTOR2D vs( v2.x - v1.x, v2.y - v1.y );
  1577. if( aReserve )
  1578. reserveLineQuads( 1 );
  1579. // Line width is maintained by the vertex shader
  1580. m_currentManager->Shader( SHADER_LINE_A, m_lineWidth, vs.x, vs.y );
  1581. m_currentManager->Vertex( aStartPoint, m_layerDepth );
  1582. m_currentManager->Shader( SHADER_LINE_B, m_lineWidth, vs.x, vs.y );
  1583. m_currentManager->Vertex( aStartPoint, m_layerDepth );
  1584. m_currentManager->Shader( SHADER_LINE_C, m_lineWidth, vs.x, vs.y );
  1585. m_currentManager->Vertex( aEndPoint, m_layerDepth );
  1586. m_currentManager->Shader( SHADER_LINE_D, m_lineWidth, vs.x, vs.y );
  1587. m_currentManager->Vertex( aEndPoint, m_layerDepth );
  1588. m_currentManager->Shader( SHADER_LINE_E, m_lineWidth, vs.x, vs.y );
  1589. m_currentManager->Vertex( aEndPoint, m_layerDepth );
  1590. m_currentManager->Shader( SHADER_LINE_F, m_lineWidth, vs.x, vs.y );
  1591. m_currentManager->Vertex( aStartPoint, m_layerDepth );
  1592. }
  1593. void OPENGL_GAL::reserveLineQuads( const int aLineCount )
  1594. {
  1595. m_currentManager->Reserve( 6 * aLineCount );
  1596. }
  1597. void OPENGL_GAL::drawSemiCircle( const VECTOR2D& aCenterPoint, double aRadius, double aAngle )
  1598. {
  1599. if( m_isFillEnabled )
  1600. {
  1601. m_currentManager->Color( m_fillColor.r, m_fillColor.g, m_fillColor.b, m_fillColor.a );
  1602. drawFilledSemiCircle( aCenterPoint, aRadius, aAngle );
  1603. }
  1604. if( m_isStrokeEnabled )
  1605. {
  1606. m_currentManager->Color( m_strokeColor.r, m_strokeColor.g, m_strokeColor.b,
  1607. m_strokeColor.a );
  1608. drawStrokedSemiCircle( aCenterPoint, aRadius, aAngle );
  1609. }
  1610. }
  1611. void OPENGL_GAL::drawFilledSemiCircle( const VECTOR2D& aCenterPoint, double aRadius, double aAngle )
  1612. {
  1613. Save();
  1614. m_currentManager->Reserve( 3 );
  1615. m_currentManager->Translate( aCenterPoint.x, aCenterPoint.y, 0.0f );
  1616. m_currentManager->Rotate( aAngle, 0.0f, 0.0f, 1.0f );
  1617. /* Draw a triangle that contains the semicircle, then shade it to leave only
  1618. * the semicircle. Parameters given to Shader() are indices of the triangle's vertices
  1619. * (if you want to understand more, check the vertex shader source [shader.vert]).
  1620. * Shader uses these coordinates to determine if fragments are inside the semicircle or not.
  1621. * v2
  1622. * /\
  1623. * /__\
  1624. * v0 //__\\ v1
  1625. */
  1626. m_currentManager->Shader( SHADER_FILLED_CIRCLE, 4.0f );
  1627. m_currentManager->Vertex( -aRadius * 3.0f / sqrt( 3.0f ), 0.0f, m_layerDepth ); // v0
  1628. m_currentManager->Shader( SHADER_FILLED_CIRCLE, 5.0f );
  1629. m_currentManager->Vertex( aRadius * 3.0f / sqrt( 3.0f ), 0.0f, m_layerDepth ); // v1
  1630. m_currentManager->Shader( SHADER_FILLED_CIRCLE, 6.0f );
  1631. m_currentManager->Vertex( 0.0f, aRadius * 2.0f, m_layerDepth ); // v2
  1632. Restore();
  1633. }
  1634. void OPENGL_GAL::drawStrokedSemiCircle( const VECTOR2D& aCenterPoint, double aRadius, double aAngle,
  1635. bool aReserve )
  1636. {
  1637. double outerRadius = aRadius + ( m_lineWidth / 2 );
  1638. Save();
  1639. if( aReserve )
  1640. m_currentManager->Reserve( 3 );
  1641. m_currentManager->Translate( aCenterPoint.x, aCenterPoint.y, 0.0f );
  1642. m_currentManager->Rotate( aAngle, 0.0f, 0.0f, 1.0f );
  1643. /* Draw a triangle that contains the semicircle, then shade it to leave only
  1644. * the semicircle. Parameters given to Shader() are indices of the triangle's vertices
  1645. * (if you want to understand more, check the vertex shader source [shader.vert]), the
  1646. * radius and the line width. Shader uses these coordinates to determine if fragments are
  1647. * inside the semicircle or not.
  1648. * v2
  1649. * /\
  1650. * /__\
  1651. * v0 //__\\ v1
  1652. */
  1653. m_currentManager->Shader( SHADER_STROKED_CIRCLE, 4.0f, aRadius, m_lineWidth );
  1654. m_currentManager->Vertex( -outerRadius * 3.0f / sqrt( 3.0f ), 0.0f, m_layerDepth ); // v0
  1655. m_currentManager->Shader( SHADER_STROKED_CIRCLE, 5.0f, aRadius, m_lineWidth );
  1656. m_currentManager->Vertex( outerRadius * 3.0f / sqrt( 3.0f ), 0.0f, m_layerDepth ); // v1
  1657. m_currentManager->Shader( SHADER_STROKED_CIRCLE, 6.0f, aRadius, m_lineWidth );
  1658. m_currentManager->Vertex( 0.0f, outerRadius * 2.0f, m_layerDepth ); // v2
  1659. Restore();
  1660. }
  1661. void OPENGL_GAL::drawPolygon( GLdouble* aPoints, int aPointCount )
  1662. {
  1663. if( m_isFillEnabled )
  1664. {
  1665. m_currentManager->Shader( SHADER_NONE );
  1666. m_currentManager->Color( m_fillColor.r, m_fillColor.g, m_fillColor.b, m_fillColor.a );
  1667. // Any non convex polygon needs to be tesselated
  1668. // for this purpose the GLU standard functions are used
  1669. TessParams params = { m_currentManager, m_tessIntersects };
  1670. gluTessBeginPolygon( m_tesselator, &params );
  1671. gluTessBeginContour( m_tesselator );
  1672. GLdouble* point = aPoints;
  1673. for( int i = 0; i < aPointCount; ++i )
  1674. {
  1675. gluTessVertex( m_tesselator, point, point );
  1676. point += 3; // 3 coordinates
  1677. }
  1678. gluTessEndContour( m_tesselator );
  1679. gluTessEndPolygon( m_tesselator );
  1680. // Free allocated intersecting points
  1681. m_tessIntersects.clear();
  1682. }
  1683. if( m_isStrokeEnabled )
  1684. {
  1685. drawPolyline(
  1686. [&]( int idx )
  1687. {
  1688. return VECTOR2D( aPoints[idx * 3], aPoints[idx * 3 + 1] );
  1689. },
  1690. aPointCount );
  1691. }
  1692. }
  1693. void OPENGL_GAL::drawPolyline( const std::function<VECTOR2D( int )>& aPointGetter, int aPointCount,
  1694. bool aReserve )
  1695. {
  1696. wxCHECK( aPointCount > 0, /* return */ );
  1697. m_currentManager->Color( m_strokeColor.r, m_strokeColor.g, m_strokeColor.b, m_strokeColor.a );
  1698. if( aPointCount == 1 )
  1699. {
  1700. drawLineQuad( aPointGetter( 0 ), aPointGetter( 0 ), aReserve );
  1701. return;
  1702. }
  1703. if( aReserve )
  1704. {
  1705. reserveLineQuads( aPointCount - 1 );
  1706. }
  1707. for( int i = 1; i < aPointCount; ++i )
  1708. {
  1709. auto start = aPointGetter( i - 1 );
  1710. auto end = aPointGetter( i );
  1711. drawLineQuad( start, end, false );
  1712. }
  1713. }
  1714. void OPENGL_GAL::drawSegmentChain( const std::function<VECTOR2D( int )>& aPointGetter,
  1715. int aPointCount, double aWidth, bool aReserve )
  1716. {
  1717. wxCHECK( aPointCount >= 2, /* return */ );
  1718. m_currentManager->Color( m_strokeColor.r, m_strokeColor.g, m_strokeColor.b, m_strokeColor.a );
  1719. int vertices = 0;
  1720. for( int i = 1; i < aPointCount; ++i )
  1721. {
  1722. auto start = aPointGetter( i - 1 );
  1723. auto end = aPointGetter( i );
  1724. VECTOR2D startEndVector = start - end;
  1725. double lineLength = startEndVector.EuclideanNorm();
  1726. float startx = start.x;
  1727. float starty = end.y;
  1728. float endx = start.x + lineLength;
  1729. float endy = end.y + lineLength;
  1730. // Be careful about floating point rounding. As we draw segments in larger and larger
  1731. // coordinates, the shader (which uses floats) will lose precision and stop drawing small
  1732. // segments. In this case, we need to draw a circle for the minimal segment.
  1733. if( startx == endx || starty == endy )
  1734. {
  1735. vertices += 3; // One circle
  1736. continue;
  1737. }
  1738. if( m_isFillEnabled || aWidth == 1.0 )
  1739. {
  1740. vertices += 6; // One line
  1741. }
  1742. else
  1743. {
  1744. vertices += 6 + 6 + 3 + 3; // Two lines and two half-circles
  1745. }
  1746. }
  1747. m_currentManager->Reserve( vertices );
  1748. for( int i = 1; i < aPointCount; ++i )
  1749. {
  1750. auto start = aPointGetter( i - 1 );
  1751. auto end = aPointGetter( i );
  1752. drawSegment( start, end, aWidth, false );
  1753. }
  1754. }
  1755. int OPENGL_GAL::drawBitmapChar( unsigned long aChar, bool aReserve )
  1756. {
  1757. const float TEX_X = font_image.width;
  1758. const float TEX_Y = font_image.height;
  1759. // handle space
  1760. if( aChar == ' ' )
  1761. {
  1762. const FONT_GLYPH_TYPE* g = LookupGlyph( 'x' );
  1763. wxCHECK( g, 0 );
  1764. // Match stroke font as well as possible
  1765. double spaceWidth = g->advance * 0.74;
  1766. Translate( VECTOR2D( spaceWidth, 0 ) );
  1767. return KiROUND( spaceWidth );
  1768. }
  1769. const FONT_GLYPH_TYPE* glyph = LookupGlyph( aChar );
  1770. // If the glyph is not found (happens for many esoteric unicode chars)
  1771. // shows a '?' instead.
  1772. if( !glyph )
  1773. glyph = LookupGlyph( '?' );
  1774. if( !glyph ) // Should not happen.
  1775. return 0;
  1776. const float X = glyph->atlas_x + font_information.smooth_pixels;
  1777. const float Y = glyph->atlas_y + font_information.smooth_pixels;
  1778. const float XOFF = glyph->minx;
  1779. // adjust for height rounding
  1780. const float round_adjust = ( glyph->maxy - glyph->miny )
  1781. - float( glyph->atlas_h - font_information.smooth_pixels * 2 );
  1782. const float top_adjust = font_information.max_y - glyph->maxy;
  1783. const float YOFF = round_adjust + top_adjust;
  1784. const float W = glyph->atlas_w - font_information.smooth_pixels * 2;
  1785. const float H = glyph->atlas_h - font_information.smooth_pixels * 2;
  1786. const float B = 0;
  1787. if( aReserve )
  1788. m_currentManager->Reserve( 6 );
  1789. Translate( VECTOR2D( XOFF, YOFF ) );
  1790. /* Glyph:
  1791. * v0 v1
  1792. * +--+
  1793. * | /|
  1794. * |/ |
  1795. * +--+
  1796. * v2 v3
  1797. */
  1798. m_currentManager->Shader( SHADER_FONT, X / TEX_X, ( Y + H ) / TEX_Y );
  1799. m_currentManager->Vertex( -B, -B, 0 ); // v0
  1800. m_currentManager->Shader( SHADER_FONT, ( X + W ) / TEX_X, ( Y + H ) / TEX_Y );
  1801. m_currentManager->Vertex( W + B, -B, 0 ); // v1
  1802. m_currentManager->Shader( SHADER_FONT, X / TEX_X, Y / TEX_Y );
  1803. m_currentManager->Vertex( -B, H + B, 0 ); // v2
  1804. m_currentManager->Shader( SHADER_FONT, ( X + W ) / TEX_X, ( Y + H ) / TEX_Y );
  1805. m_currentManager->Vertex( W + B, -B, 0 ); // v1
  1806. m_currentManager->Shader( SHADER_FONT, X / TEX_X, Y / TEX_Y );
  1807. m_currentManager->Vertex( -B, H + B, 0 ); // v2
  1808. m_currentManager->Shader( SHADER_FONT, ( X + W ) / TEX_X, Y / TEX_Y );
  1809. m_currentManager->Vertex( W + B, H + B, 0 ); // v3
  1810. Translate( VECTOR2D( -XOFF + glyph->advance, -YOFF ) );
  1811. return glyph->advance;
  1812. }
  1813. void OPENGL_GAL::drawBitmapOverbar( double aLength, double aHeight, bool aReserve )
  1814. {
  1815. // To draw an overbar, simply draw an overbar
  1816. const FONT_GLYPH_TYPE* glyph = LookupGlyph( '_' );
  1817. wxCHECK( glyph, /* void */ );
  1818. const float H = glyph->maxy - glyph->miny;
  1819. Save();
  1820. Translate( VECTOR2D( -aLength, -aHeight ) );
  1821. if( aReserve )
  1822. m_currentManager->Reserve( 6 );
  1823. m_currentManager->Color( m_strokeColor.r, m_strokeColor.g, m_strokeColor.b, m_strokeColor.a );
  1824. m_currentManager->Shader( 0 );
  1825. m_currentManager->Vertex( 0, 0, 0 ); // v0
  1826. m_currentManager->Vertex( aLength, 0, 0 ); // v1
  1827. m_currentManager->Vertex( 0, H, 0 ); // v2
  1828. m_currentManager->Vertex( aLength, 0, 0 ); // v1
  1829. m_currentManager->Vertex( 0, H, 0 ); // v2
  1830. m_currentManager->Vertex( aLength, H, 0 ); // v3
  1831. Restore();
  1832. }
  1833. std::pair<VECTOR2D, float> OPENGL_GAL::computeBitmapTextSize( const UTF8& aText ) const
  1834. {
  1835. static const FONT_GLYPH_TYPE* defaultGlyph = LookupGlyph( '(' ); // for strange chars
  1836. VECTOR2D textSize( 0, 0 );
  1837. float commonOffset = std::numeric_limits<float>::max();
  1838. float charHeight = font_information.max_y - defaultGlyph->miny;
  1839. int overbarDepth = -1;
  1840. int braceNesting = 0;
  1841. for( UTF8::uni_iter chIt = aText.ubegin(), end = aText.uend(); chIt < end; ++chIt )
  1842. {
  1843. if( *chIt == '~' && overbarDepth == -1 )
  1844. {
  1845. UTF8::uni_iter lookahead = chIt;
  1846. if( ++lookahead != end && *lookahead == '{' )
  1847. {
  1848. chIt = lookahead;
  1849. overbarDepth = braceNesting;
  1850. braceNesting++;
  1851. continue;
  1852. }
  1853. }
  1854. else if( *chIt == '{' )
  1855. {
  1856. braceNesting++;
  1857. }
  1858. else if( *chIt == '}' )
  1859. {
  1860. if( braceNesting > 0 )
  1861. braceNesting--;
  1862. if( braceNesting == overbarDepth )
  1863. {
  1864. overbarDepth = -1;
  1865. continue;
  1866. }
  1867. }
  1868. const FONT_GLYPH_TYPE* glyph = LookupGlyph( *chIt );
  1869. if( !glyph // Not coded in font
  1870. || *chIt == '-' || *chIt == '_' ) // Strange size of these 2 chars
  1871. {
  1872. glyph = defaultGlyph;
  1873. }
  1874. if( glyph )
  1875. textSize.x += glyph->advance;
  1876. }
  1877. textSize.y = std::max<float>( textSize.y, charHeight );
  1878. commonOffset = std::min<float>( font_information.max_y - defaultGlyph->maxy, commonOffset );
  1879. textSize.y -= commonOffset;
  1880. return std::make_pair( textSize, commonOffset );
  1881. }
  1882. void OPENGL_GAL::onPaint( wxPaintEvent& aEvent )
  1883. {
  1884. PostPaint( aEvent );
  1885. }
  1886. void OPENGL_GAL::skipMouseEvent( wxMouseEvent& aEvent )
  1887. {
  1888. // Post the mouse event to the event listener registered in constructor, if any
  1889. if( m_mouseListener )
  1890. wxPostEvent( m_mouseListener, aEvent );
  1891. }
  1892. void OPENGL_GAL::blitCursor()
  1893. {
  1894. if( !IsCursorEnabled() )
  1895. return;
  1896. m_compositor->SetBuffer( OPENGL_COMPOSITOR::DIRECT_RENDERING );
  1897. const int cursorSize = m_fullscreenCursor ? 8000 : 80;
  1898. VECTOR2D cursorBegin = m_cursorPosition - cursorSize / ( 2 * m_worldScale );
  1899. VECTOR2D cursorEnd = m_cursorPosition + cursorSize / ( 2 * m_worldScale );
  1900. VECTOR2D cursorCenter = ( cursorBegin + cursorEnd ) / 2;
  1901. const COLOR4D cColor = getCursorColor();
  1902. const COLOR4D color( cColor.r * cColor.a, cColor.g * cColor.a, cColor.b * cColor.a, 1.0 );
  1903. glActiveTexture( GL_TEXTURE0 );
  1904. glDisable( GL_TEXTURE_2D );
  1905. glLineWidth( 1.0 );
  1906. glColor4d( color.r, color.g, color.b, color.a );
  1907. glBegin( GL_LINES );
  1908. glVertex2d( cursorCenter.x, cursorBegin.y );
  1909. glVertex2d( cursorCenter.x, cursorEnd.y );
  1910. glVertex2d( cursorBegin.x, cursorCenter.y );
  1911. glVertex2d( cursorEnd.x, cursorCenter.y );
  1912. glEnd();
  1913. }
  1914. unsigned int OPENGL_GAL::getNewGroupNumber()
  1915. {
  1916. wxASSERT_MSG( m_groups.size() < std::numeric_limits<unsigned int>::max(),
  1917. wxT( "There are no free slots to store a group" ) );
  1918. while( m_groups.find( m_groupCounter ) != m_groups.end() )
  1919. m_groupCounter++;
  1920. return m_groupCounter++;
  1921. }
  1922. void OPENGL_GAL::init()
  1923. {
  1924. wxASSERT( IsShownOnScreen() );
  1925. wxASSERT_MSG( m_isContextLocked, "This should only be called from within a locked context." );
  1926. // IsDisplayAttr() handles WX_GL_{MAJOR,MINOR}_VERSION correctly only in 3.0.4
  1927. // starting with 3.1.0 one should use wxGLContext::IsOk() (done by GL_CONTEXT_MANAGER)
  1928. #if wxCHECK_VERSION( 3, 0, 3 ) and !wxCHECK_VERSION( 3, 1, 0 )
  1929. const int attr[] = { WX_GL_MAJOR_VERSION, 2, WX_GL_MINOR_VERSION, 1, 0 };
  1930. if( !IsDisplaySupported( attr ) )
  1931. throw std::runtime_error( "OpenGL 2.1 or higher is required!" );
  1932. #endif /* wxCHECK_VERSION( 3, 0, 3 ) */
  1933. // Check correct initialization from the constructor
  1934. if( !m_glMainContext )
  1935. throw std::runtime_error( "Could not create the main OpenGL context" );
  1936. if( !m_glPrivContext )
  1937. throw std::runtime_error( "Could not create a private OpenGL context" );
  1938. if( m_tesselator == nullptr )
  1939. throw std::runtime_error( "Could not create the m_tesselator" );
  1940. // End initialization checks
  1941. GLenum err = glewInit();
  1942. if( GLEW_OK != err )
  1943. throw std::runtime_error( (const char*) glewGetErrorString( err ) );
  1944. // Check the OpenGL version (minimum 2.1 is required)
  1945. if( !GLEW_VERSION_2_1 )
  1946. throw std::runtime_error( "OpenGL 2.1 or higher is required!" );
  1947. #if defined( __LINUX__ ) // calling enableGlDebug crashes opengl on some OS (OSX and some Windows)
  1948. #ifdef DEBUG
  1949. if( GLEW_ARB_debug_output )
  1950. enableGlDebug( true );
  1951. #endif
  1952. #endif
  1953. // Framebuffers have to be supported
  1954. if( !GLEW_EXT_framebuffer_object )
  1955. throw std::runtime_error( "Framebuffer objects are not supported!" );
  1956. // Vertex buffer has to be supported
  1957. if( !GLEW_ARB_vertex_buffer_object )
  1958. throw std::runtime_error( "Vertex buffer objects are not supported!" );
  1959. // Prepare shaders
  1960. if( !m_shader->IsLinked()
  1961. && !m_shader->LoadShaderFromStrings( SHADER_TYPE_VERTEX,
  1962. BUILTIN_SHADERS::glsl_kicad_vert ) )
  1963. {
  1964. throw std::runtime_error( "Cannot compile vertex shader!" );
  1965. }
  1966. if( !m_shader->IsLinked()
  1967. && !m_shader->LoadShaderFromStrings( SHADER_TYPE_FRAGMENT,
  1968. BUILTIN_SHADERS::glsl_kicad_frag ) )
  1969. {
  1970. throw std::runtime_error( "Cannot compile fragment shader!" );
  1971. }
  1972. if( !m_shader->IsLinked() && !m_shader->Link() )
  1973. throw std::runtime_error( "Cannot link the shaders!" );
  1974. // Check if video card supports textures big enough to fit the font atlas
  1975. int maxTextureSize;
  1976. glGetIntegerv( GL_MAX_TEXTURE_SIZE, &maxTextureSize );
  1977. if( maxTextureSize < (int) font_image.width || maxTextureSize < (int) font_image.height )
  1978. {
  1979. // TODO implement software texture scaling
  1980. // for bitmap fonts and use a higher resolution texture?
  1981. throw std::runtime_error( "Requested texture size is not supported" );
  1982. }
  1983. m_swapInterval = GL_UTILS::SetSwapInterval( -1 );
  1984. m_cachedManager = new VERTEX_MANAGER( true );
  1985. m_nonCachedManager = new VERTEX_MANAGER( false );
  1986. m_overlayManager = new VERTEX_MANAGER( false );
  1987. m_tempManager = new VERTEX_MANAGER( false );
  1988. // Make VBOs use shaders
  1989. m_cachedManager->SetShader( *m_shader );
  1990. m_nonCachedManager->SetShader( *m_shader );
  1991. m_overlayManager->SetShader( *m_shader );
  1992. m_tempManager->SetShader( *m_shader );
  1993. m_isInitialized = true;
  1994. }
  1995. // Callback functions for the tesselator. Compare Redbook Chapter 11.
  1996. void CALLBACK VertexCallback( GLvoid* aVertexPtr, void* aData )
  1997. {
  1998. GLdouble* vertex = static_cast<GLdouble*>( aVertexPtr );
  1999. OPENGL_GAL::TessParams* param = static_cast<OPENGL_GAL::TessParams*>( aData );
  2000. VERTEX_MANAGER* vboManager = param->vboManager;
  2001. assert( vboManager );
  2002. vboManager->Vertex( vertex[0], vertex[1], vertex[2] );
  2003. }
  2004. void CALLBACK CombineCallback( GLdouble coords[3], GLdouble* vertex_data[4], GLfloat weight[4],
  2005. GLdouble** dataOut, void* aData )
  2006. {
  2007. GLdouble* vertex = new GLdouble[3];
  2008. OPENGL_GAL::TessParams* param = static_cast<OPENGL_GAL::TessParams*>( aData );
  2009. // Save the pointer so we can delete it later
  2010. // Note, we use the default_delete for an array because macOS
  2011. // decides to bundle an ancient libc++ that mismatches the C++17 support of clang
  2012. param->intersectPoints.emplace_back( vertex, std::default_delete<GLdouble[]>() );
  2013. memcpy( vertex, coords, 3 * sizeof( GLdouble ) );
  2014. *dataOut = vertex;
  2015. }
  2016. void CALLBACK EdgeCallback( GLboolean aEdgeFlag )
  2017. {
  2018. // This callback is needed to force GLU tesselator to use triangles only
  2019. }
  2020. void CALLBACK ErrorCallback( GLenum aErrorCode )
  2021. {
  2022. //throw std::runtime_error( std::string( "Tessellation error: " ) +
  2023. //std::string( (const char*) gluErrorString( aErrorCode ) );
  2024. }
  2025. static void InitTesselatorCallbacks( GLUtesselator* aTesselator )
  2026. {
  2027. gluTessCallback( aTesselator, GLU_TESS_VERTEX_DATA, (void( CALLBACK* )()) VertexCallback );
  2028. gluTessCallback( aTesselator, GLU_TESS_COMBINE_DATA, (void( CALLBACK* )()) CombineCallback );
  2029. gluTessCallback( aTesselator, GLU_TESS_EDGE_FLAG, (void( CALLBACK* )()) EdgeCallback );
  2030. gluTessCallback( aTesselator, GLU_TESS_ERROR, (void( CALLBACK* )()) ErrorCallback );
  2031. }
  2032. void OPENGL_GAL::EnableDepthTest( bool aEnabled )
  2033. {
  2034. m_cachedManager->EnableDepthTest( aEnabled );
  2035. m_nonCachedManager->EnableDepthTest( aEnabled );
  2036. m_overlayManager->EnableDepthTest( aEnabled );
  2037. }
  2038. inline double round_to_half_pixel( double f, double r )
  2039. {
  2040. return ( ceil( f / r ) - 0.5 ) * r;
  2041. }
  2042. void OPENGL_GAL::ComputeWorldScreenMatrix()
  2043. {
  2044. computeWorldScale();
  2045. auto pixelSize = m_worldScale;
  2046. // we need -m_lookAtPoint == -k * pixelSize + 0.5 * pixelSize for OpenGL
  2047. // meaning m_lookAtPoint = (k-0.5)*pixelSize with integer k
  2048. m_lookAtPoint.x = round_to_half_pixel( m_lookAtPoint.x, pixelSize );
  2049. m_lookAtPoint.y = round_to_half_pixel( m_lookAtPoint.y, pixelSize );
  2050. GAL::ComputeWorldScreenMatrix();
  2051. }
  2052. void OPENGL_GAL::DrawGlyph( const KIFONT::GLYPH& aGlyph, int aNth, int aTotal )
  2053. {
  2054. if( aGlyph.IsStroke() )
  2055. {
  2056. const auto& strokeGlyph = static_cast<const KIFONT::STROKE_GLYPH&>( aGlyph );
  2057. DrawPolylines( strokeGlyph );
  2058. }
  2059. else if( aGlyph.IsOutline() )
  2060. {
  2061. const auto& outlineGlyph = static_cast<const KIFONT::OUTLINE_GLYPH&>( aGlyph );
  2062. m_currentManager->Shader( SHADER_NONE );
  2063. m_currentManager->Color( m_fillColor );
  2064. outlineGlyph.Triangulate(
  2065. [&]( const VECTOR2D& aPt1, const VECTOR2D& aPt2, const VECTOR2D& aPt3 )
  2066. {
  2067. m_currentManager->Reserve( 3 );
  2068. m_currentManager->Vertex( aPt1.x, aPt1.y, m_layerDepth );
  2069. m_currentManager->Vertex( aPt2.x, aPt2.y, m_layerDepth );
  2070. m_currentManager->Vertex( aPt3.x, aPt3.y, m_layerDepth );
  2071. } );
  2072. }
  2073. }
  2074. void OPENGL_GAL::DrawGlyphs( const std::vector<std::unique_ptr<KIFONT::GLYPH>>& aGlyphs )
  2075. {
  2076. if( aGlyphs.empty() )
  2077. return;
  2078. bool allGlyphsAreStroke = true;
  2079. bool allGlyphsAreOutline = true;
  2080. for( const std::unique_ptr<KIFONT::GLYPH>& glyph : aGlyphs )
  2081. {
  2082. if( !glyph->IsStroke() )
  2083. {
  2084. allGlyphsAreStroke = false;
  2085. break;
  2086. }
  2087. }
  2088. for( const std::unique_ptr<KIFONT::GLYPH>& glyph : aGlyphs )
  2089. {
  2090. if( !glyph->IsOutline() )
  2091. {
  2092. allGlyphsAreOutline = false;
  2093. break;
  2094. }
  2095. }
  2096. if( allGlyphsAreStroke )
  2097. {
  2098. // Optimized path for stroke fonts that pre-reserves line quads.
  2099. int lineQuadCount = 0;
  2100. for( const std::unique_ptr<KIFONT::GLYPH>& glyph : aGlyphs )
  2101. {
  2102. const auto& strokeGlyph = static_cast<const KIFONT::STROKE_GLYPH&>( *glyph );
  2103. for( const std::vector<VECTOR2D>& points : strokeGlyph )
  2104. lineQuadCount += points.size() - 1;
  2105. }
  2106. reserveLineQuads( lineQuadCount );
  2107. for( const std::unique_ptr<KIFONT::GLYPH>& glyph : aGlyphs )
  2108. {
  2109. const auto& strokeGlyph = static_cast<const KIFONT::STROKE_GLYPH&>( *glyph );
  2110. for( const std::vector<VECTOR2D>& points : strokeGlyph )
  2111. {
  2112. drawPolyline(
  2113. [&]( int idx )
  2114. {
  2115. return points[idx];
  2116. },
  2117. points.size(), false );
  2118. }
  2119. }
  2120. return;
  2121. }
  2122. else if( allGlyphsAreOutline )
  2123. {
  2124. // Optimized path for stroke fonts that pre-reserves glyph triangles.
  2125. int triangleCount = 0;
  2126. for( const std::unique_ptr<KIFONT::GLYPH>& glyph : aGlyphs )
  2127. {
  2128. const auto& outlineGlyph = static_cast<const KIFONT::OUTLINE_GLYPH&>( *glyph );
  2129. // Only call CacheTriangulation if it has never been done before. Otherwise we'll hash
  2130. // the triangulation to see if it has been edited, and glyphs after creation are read-only.
  2131. if( outlineGlyph.TriangulatedPolyCount() == 0 )
  2132. const_cast<KIFONT::OUTLINE_GLYPH&>( outlineGlyph ).CacheTriangulation( false );
  2133. for( unsigned int i = 0; i < outlineGlyph.TriangulatedPolyCount(); i++ )
  2134. {
  2135. const SHAPE_POLY_SET::TRIANGULATED_POLYGON* polygon =
  2136. outlineGlyph.TriangulatedPolygon( i );
  2137. triangleCount += polygon->GetTriangleCount();
  2138. }
  2139. }
  2140. m_currentManager->Shader( SHADER_NONE );
  2141. m_currentManager->Color( m_fillColor );
  2142. m_currentManager->Reserve( 3 * triangleCount );
  2143. for( const std::unique_ptr<KIFONT::GLYPH>& glyph : aGlyphs )
  2144. {
  2145. const auto& outlineGlyph = static_cast<const KIFONT::OUTLINE_GLYPH&>( *glyph );
  2146. for( unsigned int i = 0; i < outlineGlyph.TriangulatedPolyCount(); i++ )
  2147. {
  2148. const SHAPE_POLY_SET::TRIANGULATED_POLYGON* polygon =
  2149. outlineGlyph.TriangulatedPolygon( i );
  2150. for( size_t j = 0; j < polygon->GetTriangleCount(); j++ )
  2151. {
  2152. VECTOR2I a, b, c;
  2153. polygon->GetTriangle( j, a, b, c );
  2154. m_currentManager->Vertex( a.x, a.y, m_layerDepth );
  2155. m_currentManager->Vertex( b.x, b.y, m_layerDepth );
  2156. m_currentManager->Vertex( c.x, c.y, m_layerDepth );
  2157. }
  2158. }
  2159. }
  2160. }
  2161. else
  2162. {
  2163. // Regular path
  2164. for( size_t i = 0; i < aGlyphs.size(); i++ )
  2165. DrawGlyph( *aGlyphs[i], i, aGlyphs.size() );
  2166. }
  2167. }