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.

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