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.

2401 lines
80 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
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
5 years ago
5 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
5 years ago
5 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
5 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
4 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
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
4 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
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
5 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
4 years ago
4 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
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
  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2013-2019 CERN
  5. * Copyright (C) 2021-2022 KiCad Developers, see AUTHORS.txt for contributors.
  6. *
  7. * @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
  8. * @author Maciej Suminski <maciej.suminski@cern.ch>
  9. *
  10. * This program is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public License
  12. * as published by the Free Software Foundation; either version 2
  13. * of the License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, you may find one here:
  22. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  23. * or you may search the http://www.gnu.org website for the version 2 license,
  24. * or you may write to the Free Software Foundation, Inc.,
  25. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  26. */
  27. #include <board.h>
  28. #include <board_design_settings.h>
  29. #include <pcb_track.h>
  30. #include <pcb_group.h>
  31. #include <footprint.h>
  32. #include <fp_textbox.h>
  33. #include <pad.h>
  34. #include <pcb_shape.h>
  35. #include <string_utils.h>
  36. #include <zone.h>
  37. #include <pcb_bitmap.h>
  38. #include <pcb_text.h>
  39. #include <pcb_textbox.h>
  40. #include <pcb_marker.h>
  41. #include <pcb_dimension.h>
  42. #include <pcb_target.h>
  43. #include <layer_ids.h>
  44. #include <pcb_painter.h>
  45. #include <pcb_display_options.h>
  46. #include <project/net_settings.h>
  47. #include <settings/color_settings.h>
  48. #include <settings/common_settings.h>
  49. #include <settings/settings_manager.h>
  50. #include <pcbnew_settings.h>
  51. #include <convert_basic_shapes_to_polygon.h>
  52. #include <gal/graphics_abstraction_layer.h>
  53. #include <callback_gal.h>
  54. #include <geometry/geometry_utils.h>
  55. #include <geometry/shape_line_chain.h>
  56. #include <geometry/shape_rect.h>
  57. #include <geometry/shape_segment.h>
  58. #include <geometry/shape_simple.h>
  59. #include <geometry/shape_circle.h>
  60. #include <bezier_curves.h>
  61. #include <kiface_base.h>
  62. #include <gr_text.h>
  63. #include <pgm_base.h>
  64. using namespace KIGFX;
  65. PCBNEW_SETTINGS* pcbconfig()
  66. {
  67. return dynamic_cast<PCBNEW_SETTINGS*>( Kiface().KifaceSettings() );
  68. }
  69. // Helpers for display options existing in Cvpcb and Pcbnew
  70. // Note, when running Cvpcb, pcbconfig() returns nullptr and viewer_settings()
  71. // returns the viewer options existing to Cvpcb and Pcbnew
  72. static PCB_VIEWERS_SETTINGS_BASE* viewer_settings()
  73. {
  74. if( pcbconfig() )
  75. return Pgm().GetSettingsManager().GetAppSettings<PCBNEW_SETTINGS>();
  76. else
  77. return dynamic_cast<PCB_VIEWERS_SETTINGS_BASE*>( Kiface().KifaceSettings() );
  78. }
  79. static bool displayPadFill()
  80. {
  81. return viewer_settings()->m_ViewersDisplay.m_DisplayPadFill;
  82. }
  83. static bool displayGraphicsFill()
  84. {
  85. return viewer_settings()->m_ViewersDisplay.m_DisplayGraphicsFill;
  86. }
  87. static bool displayTextFill()
  88. {
  89. return viewer_settings()->m_ViewersDisplay.m_DisplayTextFill;
  90. }
  91. static bool displayPadNumbers()
  92. {
  93. return viewer_settings()->m_ViewersDisplay.m_DisplayPadNumbers;
  94. }
  95. PCB_RENDER_SETTINGS::PCB_RENDER_SETTINGS()
  96. {
  97. m_backgroundColor = COLOR4D( 0.0, 0.0, 0.0, 1.0 );
  98. m_ZoneDisplayMode = ZONE_DISPLAY_MODE::SHOW_FILLED;
  99. m_netColorMode = NET_COLOR_MODE::RATSNEST;
  100. m_ContrastModeDisplay = HIGH_CONTRAST_MODE::NORMAL;
  101. m_trackOpacity = 1.0;
  102. m_viaOpacity = 1.0;
  103. m_padOpacity = 1.0;
  104. m_zoneOpacity = 1.0;
  105. m_imageOpacity = 1.0;
  106. m_ForcePadSketchModeOff = false;
  107. m_ForcePadSketchModeOn = false;
  108. SetDashLengthRatio( 12 ); // From ISO 128-2
  109. SetGapLengthRatio( 3 ); // From ISO 128-2
  110. update();
  111. }
  112. void PCB_RENDER_SETTINGS::LoadColors( const COLOR_SETTINGS* aSettings )
  113. {
  114. SetBackgroundColor( aSettings->GetColor( LAYER_PCB_BACKGROUND ) );
  115. // Init board layers colors:
  116. for( int i = 0; i < PCB_LAYER_ID_COUNT; i++ )
  117. {
  118. m_layerColors[i] = aSettings->GetColor( i );
  119. // Guard: if the alpha channel is too small, the layer is not visible.
  120. if( m_layerColors[i].a < 0.2 )
  121. m_layerColors[i].a = 0.2;
  122. }
  123. // Init specific graphic layers colors:
  124. for( int i = GAL_LAYER_ID_START; i < GAL_LAYER_ID_END; i++ )
  125. m_layerColors[i] = aSettings->GetColor( i );
  126. // Colors for layers that aren't theme-able
  127. m_layerColors[LAYER_PAD_PLATEDHOLES] = aSettings->GetColor( LAYER_PCB_BACKGROUND );
  128. m_layerColors[LAYER_VIA_NETNAMES] = COLOR4D( 0.2, 0.2, 0.2, 0.9 );
  129. m_layerColors[LAYER_PAD_NETNAMES] = COLOR4D( 1.0, 1.0, 1.0, 0.9 );
  130. m_layerColors[LAYER_PAD_FR] = aSettings->GetColor( F_Cu );
  131. m_layerColors[LAYER_PAD_BK] = aSettings->GetColor( B_Cu );
  132. m_layerColors[LAYER_PAD_FR_NETNAMES] = COLOR4D( 1.0, 1.0, 1.0, 0.9 );
  133. m_layerColors[LAYER_PAD_BK_NETNAMES] = COLOR4D( 1.0, 1.0, 1.0, 0.9 );
  134. // Netnames for copper layers
  135. for( LSEQ cu = LSET::AllCuMask().CuStack(); cu; ++cu )
  136. {
  137. const COLOR4D lightLabel( 1.0, 1.0, 1.0, 0.7 );
  138. const COLOR4D darkLabel = lightLabel.Inverted();
  139. PCB_LAYER_ID layer = *cu;
  140. if( m_layerColors[layer].GetBrightness() > 0.5 )
  141. m_layerColors[GetNetnameLayer( layer )] = darkLabel;
  142. else
  143. m_layerColors[GetNetnameLayer( layer )] = lightLabel;
  144. }
  145. if( PgmOrNull() ) // can be null if used without project (i.e. from python script)
  146. m_hiContrastFactor = 1.0f - Pgm().GetCommonSettings()->m_Appearance.hicontrast_dimming_factor;
  147. else
  148. m_hiContrastFactor = 1.0f - 0.8f; // default value
  149. update();
  150. }
  151. void PCB_RENDER_SETTINGS::LoadDisplayOptions( const PCB_DISPLAY_OPTIONS& aOptions )
  152. {
  153. m_hiContrastEnabled = aOptions.m_ContrastModeDisplay != HIGH_CONTRAST_MODE::NORMAL;
  154. m_ZoneDisplayMode = aOptions.m_ZoneDisplayMode;
  155. m_ContrastModeDisplay = aOptions.m_ContrastModeDisplay;
  156. m_netColorMode = aOptions.m_NetColorMode;
  157. m_trackOpacity = aOptions.m_TrackOpacity;
  158. m_viaOpacity = aOptions.m_ViaOpacity;
  159. m_padOpacity = aOptions.m_PadOpacity;
  160. m_zoneOpacity = aOptions.m_ZoneOpacity;
  161. m_imageOpacity = aOptions.m_ImageOpacity;
  162. }
  163. COLOR4D PCB_RENDER_SETTINGS::GetColor( const VIEW_ITEM* aItem, int aLayer ) const
  164. {
  165. const EDA_ITEM* item = dynamic_cast<const EDA_ITEM*>( aItem );
  166. const BOARD_CONNECTED_ITEM* conItem = dynamic_cast<const BOARD_CONNECTED_ITEM*> ( aItem );
  167. int netCode = -1;
  168. int originalLayer = aLayer;
  169. // Marker shadows
  170. if( aLayer == LAYER_MARKER_SHADOWS )
  171. return m_backgroundColor.WithAlpha( 0.6 );
  172. if( IsHoleLayer( aLayer ) && m_isPrinting )
  173. {
  174. // Careful that we don't end up with the same colour for the annular ring and the hole
  175. // when printing in B&W.
  176. const PAD* pad = dynamic_cast<const PAD*>( item );
  177. const PCB_VIA* via = dynamic_cast<const PCB_VIA*>( item );
  178. int holeLayer = aLayer;
  179. int annularRingLayer = UNDEFINED_LAYER;
  180. if( pad && pad->GetAttribute() == PAD_ATTRIB::PTH )
  181. annularRingLayer = LAYER_PADS_TH;
  182. else if( via && via->GetViaType() == VIATYPE::MICROVIA )
  183. annularRingLayer = LAYER_VIA_MICROVIA;
  184. else if( via && via->GetViaType() == VIATYPE::BLIND_BURIED )
  185. annularRingLayer = LAYER_VIA_BBLIND;
  186. else if( via && via->GetViaType() == VIATYPE::THROUGH )
  187. annularRingLayer = LAYER_VIA_THROUGH;
  188. if( annularRingLayer != UNDEFINED_LAYER
  189. && m_layerColors[ holeLayer ] == m_layerColors[ annularRingLayer ] )
  190. {
  191. aLayer = LAYER_PCB_BACKGROUND;
  192. }
  193. }
  194. // Zones should pull from the copper layer
  195. if( item && ( item->Type() == PCB_ZONE_T || item->Type() == PCB_FP_ZONE_T ) )
  196. {
  197. if( IsZoneLayer( aLayer ) )
  198. aLayer = aLayer - LAYER_ZONE_START;
  199. }
  200. // Hole walls should pull from the copper layer
  201. if( aLayer == LAYER_PAD_HOLEWALLS )
  202. aLayer = LAYER_PADS_TH;
  203. else if( aLayer == LAYER_VIA_HOLEWALLS )
  204. aLayer = LAYER_VIA_THROUGH;
  205. // Normal path: get the layer base color
  206. COLOR4D color = m_layerColors[aLayer];
  207. if( !item )
  208. return m_layerColors[aLayer];
  209. // Selection disambiguation
  210. if( item->IsBrightened() )
  211. return color.Brightened( m_selectFactor ).WithAlpha( 0.8 );
  212. // Normal selection
  213. if( item->IsSelected() )
  214. color = m_layerColorsSel[aLayer];
  215. // Try to obtain the netcode for the item
  216. if( conItem )
  217. netCode = conItem->GetNetCode();
  218. bool highlighted = m_highlightEnabled && m_highlightNetcodes.count( netCode );
  219. bool selected = item->IsSelected();
  220. // Apply net color overrides
  221. if( conItem && m_netColorMode == NET_COLOR_MODE::ALL && IsNetCopperLayer( aLayer ) )
  222. {
  223. COLOR4D netColor = COLOR4D::UNSPECIFIED;
  224. auto ii = m_netColors.find( netCode );
  225. if( ii != m_netColors.end() )
  226. netColor = ii->second;
  227. if( netColor == COLOR4D::UNSPECIFIED )
  228. {
  229. auto jj = m_netclassColors.find( conItem->GetNetClassName() );
  230. if( jj != m_netclassColors.end() )
  231. netColor = jj->second;
  232. }
  233. if( netColor == COLOR4D::UNSPECIFIED )
  234. netColor = color;
  235. if( selected )
  236. {
  237. // Selection brightening overrides highlighting
  238. netColor.Brighten( m_selectFactor );
  239. }
  240. else if( m_highlightEnabled )
  241. {
  242. // Highlight brightens objects on all layers and darkens everything else for contrast
  243. if( highlighted )
  244. netColor.Brighten( m_highlightFactor );
  245. else
  246. netColor.Darken( 1.0 - m_highlightFactor );
  247. }
  248. color = netColor;
  249. }
  250. else if( !selected && m_highlightEnabled )
  251. {
  252. // Single net highlight mode
  253. color = m_highlightNetcodes.count( netCode ) ? m_layerColorsHi[aLayer]
  254. : m_layerColorsDark[aLayer];
  255. }
  256. // Apply high-contrast dimming
  257. if( m_hiContrastEnabled && m_highContrastLayers.size() && !highlighted && !selected )
  258. {
  259. PCB_LAYER_ID primary = GetPrimaryHighContrastLayer();
  260. bool isActive = m_highContrastLayers.count( aLayer );
  261. switch( originalLayer )
  262. {
  263. case LAYER_PADS_TH:
  264. if( !static_cast<const PAD*>( item )->FlashLayer( primary ) )
  265. isActive = false;
  266. break;
  267. case LAYER_VIA_BBLIND:
  268. case LAYER_VIA_MICROVIA:
  269. // Target graphic is active if the via crosses the primary layer
  270. if( static_cast<const PCB_VIA*>( item )->GetLayerSet().test( primary ) == 0 )
  271. isActive = false;
  272. break;
  273. case LAYER_VIA_THROUGH:
  274. if( !static_cast<const PCB_VIA*>( item )->FlashLayer( primary ) )
  275. isActive = false;
  276. break;
  277. case LAYER_PAD_PLATEDHOLES:
  278. case LAYER_PAD_HOLEWALLS:
  279. case LAYER_NON_PLATEDHOLES:
  280. // Pad holes are active is any physical layer is active
  281. if( LSET::PhysicalLayersMask().test( primary ) == 0 )
  282. isActive = false;
  283. break;
  284. case LAYER_VIA_HOLES:
  285. case LAYER_VIA_HOLEWALLS:
  286. if( static_cast<const PCB_VIA*>( item )->GetViaType() == VIATYPE::BLIND_BURIED
  287. || static_cast<const PCB_VIA*>( item )->GetViaType() == VIATYPE::MICROVIA )
  288. {
  289. // A blind or micro via's hole is active if it crosses the primary layer
  290. if( static_cast<const PCB_VIA*>( item )->GetLayerSet().test( primary ) == 0 )
  291. isActive = false;
  292. }
  293. else
  294. {
  295. // A through via's hole is active if any physical layer is active
  296. if( LSET::PhysicalLayersMask().test( primary ) == 0 )
  297. isActive = false;
  298. }
  299. break;
  300. default:
  301. break;
  302. }
  303. if( !isActive )
  304. {
  305. if( m_ContrastModeDisplay == HIGH_CONTRAST_MODE::HIDDEN || IsNetnameLayer( aLayer ) )
  306. color = COLOR4D::CLEAR;
  307. else
  308. {
  309. color = color.Mix( m_layerColors[LAYER_PCB_BACKGROUND], m_hiContrastFactor );
  310. // Bitmaps can't have their color mixed so just reduce the opacity a bit so they
  311. // show through less
  312. if( item->Type() == PCB_BITMAP_T )
  313. color.a *= m_hiContrastFactor;
  314. }
  315. }
  316. }
  317. // Apply per-type opacity overrides
  318. if( item->Type() == PCB_TRACE_T || item->Type() == PCB_ARC_T )
  319. color.a *= m_trackOpacity;
  320. else if( item->Type() == PCB_VIA_T )
  321. color.a *= m_viaOpacity;
  322. else if( item->Type() == PCB_PAD_T )
  323. color.a *= m_padOpacity;
  324. else if( item->Type() == PCB_ZONE_T || item->Type() == PCB_FP_ZONE_T )
  325. color.a *= m_zoneOpacity;
  326. else if( item->Type() == PCB_BITMAP_T )
  327. color.a *= m_imageOpacity;
  328. // No special modifiers enabled
  329. return color;
  330. }
  331. bool PCB_RENDER_SETTINGS::GetShowPageLimits() const
  332. {
  333. return pcbconfig() && pcbconfig()->m_ShowPageLimits;
  334. }
  335. PCB_PAINTER::PCB_PAINTER( GAL* aGal ) :
  336. PAINTER( aGal ),
  337. m_maxError( ARC_HIGH_DEF ),
  338. m_holePlatingThickness( 0 )
  339. {
  340. }
  341. int PCB_PAINTER::getLineThickness( int aActualThickness ) const
  342. {
  343. // if items have 0 thickness, draw them with the outline
  344. // width, otherwise respect the set value (which, no matter
  345. // how small will produce something)
  346. if( aActualThickness == 0 )
  347. return m_pcbSettings.m_outlineWidth;
  348. return aActualThickness;
  349. }
  350. int PCB_PAINTER::getDrillShape( const PAD* aPad ) const
  351. {
  352. return aPad->GetDrillShape();
  353. }
  354. VECTOR2D PCB_PAINTER::getDrillSize( const PAD* aPad ) const
  355. {
  356. return VECTOR2D( aPad->GetDrillSize() );
  357. }
  358. int PCB_PAINTER::getDrillSize( const PCB_VIA* aVia ) const
  359. {
  360. return aVia->GetDrillValue();
  361. }
  362. bool PCB_PAINTER::Draw( const VIEW_ITEM* aItem, int aLayer )
  363. {
  364. const BOARD_ITEM* item = dynamic_cast<const BOARD_ITEM*>( aItem );
  365. if( !item )
  366. return false;
  367. if( const BOARD* board = item->GetBoard() )
  368. {
  369. BOARD_DESIGN_SETTINGS& bds = board->GetDesignSettings();
  370. m_maxError = bds.m_MaxError;
  371. m_holePlatingThickness = bds.GetHolePlatingThickness();
  372. if( item->GetParentFootprint() && !board->IsFootprintHolder() )
  373. {
  374. FOOTPRINT* parentFP = static_cast<FOOTPRINT*>( item->GetParentFootprint() );
  375. // Never draw footprint bitmaps on board
  376. if( item->Type() == PCB_BITMAP_T )
  377. return false;
  378. else if( item->GetLayerSet().count() > 1 )
  379. {
  380. // For multi-layer objects, exclude only those layers that are private
  381. if( IsPcbLayer( aLayer ) && parentFP->GetPrivateLayers().test( aLayer ) )
  382. return false;
  383. }
  384. else if( item->GetLayerSet().count() == 1 )
  385. {
  386. // For single-layer objects, exclude all layers including ancillary layers
  387. // such as holes, netnames, etc.
  388. PCB_LAYER_ID singleLayer = item->GetLayerSet().Seq()[0];
  389. if( parentFP->GetPrivateLayers().test( singleLayer ) )
  390. return false;
  391. }
  392. }
  393. }
  394. else
  395. {
  396. m_maxError = ARC_HIGH_DEF;
  397. m_holePlatingThickness = 0;
  398. }
  399. // the "cast" applied in here clarifies which overloaded draw() is called
  400. switch( item->Type() )
  401. {
  402. case PCB_TRACE_T:
  403. draw( static_cast<const PCB_TRACK*>( item ), aLayer );
  404. break;
  405. case PCB_ARC_T:
  406. draw( static_cast<const PCB_ARC*>( item ), aLayer );
  407. break;
  408. case PCB_VIA_T:
  409. draw( static_cast<const PCB_VIA*>( item ), aLayer );
  410. break;
  411. case PCB_PAD_T:
  412. draw( static_cast<const PAD*>( item ), aLayer );
  413. break;
  414. case PCB_SHAPE_T:
  415. case PCB_FP_SHAPE_T:
  416. draw( static_cast<const PCB_SHAPE*>( item ), aLayer );
  417. break;
  418. case PCB_BITMAP_T:
  419. draw( static_cast<const PCB_BITMAP*>( item ), aLayer );
  420. break;
  421. case PCB_TEXT_T:
  422. draw( static_cast<const PCB_TEXT*>( item ), aLayer );
  423. break;
  424. case PCB_TEXTBOX_T:
  425. draw( static_cast<const PCB_TEXTBOX*>( item ), aLayer );
  426. break;
  427. case PCB_FP_TEXT_T:
  428. draw( static_cast<const FP_TEXT*>( item ), aLayer );
  429. break;
  430. case PCB_FP_TEXTBOX_T:
  431. draw( static_cast<const FP_TEXTBOX*>( item ), aLayer );
  432. break;
  433. case PCB_FOOTPRINT_T:
  434. draw( static_cast<const FOOTPRINT*>( item ), aLayer );
  435. break;
  436. case PCB_GROUP_T:
  437. draw( static_cast<const PCB_GROUP*>( item ), aLayer );
  438. break;
  439. case PCB_ZONE_T:
  440. case PCB_FP_ZONE_T:
  441. draw( static_cast<const ZONE*>( item ), aLayer );
  442. break;
  443. case PCB_DIM_ALIGNED_T:
  444. case PCB_DIM_CENTER_T:
  445. case PCB_DIM_RADIAL_T:
  446. case PCB_DIM_ORTHOGONAL_T:
  447. case PCB_DIM_LEADER_T:
  448. case PCB_FP_DIM_ALIGNED_T:
  449. case PCB_FP_DIM_CENTER_T:
  450. case PCB_FP_DIM_RADIAL_T:
  451. case PCB_FP_DIM_ORTHOGONAL_T:
  452. case PCB_FP_DIM_LEADER_T:
  453. draw( static_cast<const PCB_DIMENSION_BASE*>( item ), aLayer );
  454. break;
  455. case PCB_TARGET_T:
  456. draw( static_cast<const PCB_TARGET*>( item ) );
  457. break;
  458. case PCB_MARKER_T:
  459. draw( static_cast<const PCB_MARKER*>( item ), aLayer );
  460. break;
  461. default:
  462. // Painter does not know how to draw the object
  463. return false;
  464. }
  465. // Draw bounding boxes after drawing objects so they can be seen.
  466. if( m_pcbSettings.GetDrawBoundingBoxes() )
  467. {
  468. // Show bounding boxes of painted objects for debugging.
  469. EDA_RECT box = item->GetBoundingBox();
  470. m_gal->SetIsFill( false );
  471. m_gal->SetIsStroke( true );
  472. if( item->Type() == PCB_FOOTPRINT_T )
  473. {
  474. m_gal->SetStrokeColor( item->IsSelected() ? COLOR4D( 1.0, 0.2, 0.2, 1 ) :
  475. COLOR4D( MAGENTA ) );
  476. }
  477. else
  478. {
  479. m_gal->SetStrokeColor( item->IsSelected() ? COLOR4D( 1.0, 0.2, 0.2, 1 ) :
  480. COLOR4D( 0.4, 0.4, 0.4, 1 ) );
  481. }
  482. m_gal->SetLineWidth( 1 );
  483. m_gal->DrawRectangle( box.GetOrigin(), box.GetEnd() );
  484. if( item->Type() == PCB_FOOTPRINT_T )
  485. {
  486. m_gal->SetStrokeColor( item->IsSelected() ? COLOR4D( 1.0, 0.2, 0.2, 1 ) :
  487. COLOR4D( CYAN ) );
  488. const FOOTPRINT* fp = static_cast<const FOOTPRINT*>( item );
  489. if( fp )
  490. {
  491. const SHAPE_POLY_SET& convex = fp->GetBoundingHull();
  492. m_gal->DrawPolyline( convex.COutline( 0 ) );
  493. }
  494. }
  495. }
  496. return true;
  497. }
  498. void PCB_PAINTER::draw( const PCB_TRACK* aTrack, int aLayer )
  499. {
  500. VECTOR2I start( aTrack->GetStart() );
  501. VECTOR2I end( aTrack->GetEnd() );
  502. int track_width = aTrack->GetWidth();
  503. COLOR4D color = m_pcbSettings.GetColor( aTrack, aLayer );
  504. if( IsNetnameLayer( aLayer ) )
  505. {
  506. if( !pcbconfig() || pcbconfig()->m_Display.m_NetNames < 2 )
  507. return;
  508. if( aTrack->GetNetCode() <= NETINFO_LIST::UNCONNECTED )
  509. return;
  510. // When drawing netnames, clip the track to the viewport
  511. BOX2D viewport;
  512. VECTOR2D screenSize = m_gal->GetScreenPixelSize();
  513. const MATRIX3x3D& matrix = m_gal->GetScreenWorldMatrix();
  514. viewport.SetOrigin( VECTOR2D( matrix * VECTOR2D( 0, 0 ) ) );
  515. viewport.SetEnd( VECTOR2D( matrix * screenSize ) );
  516. EDA_RECT clipBox( viewport.Normalize() );
  517. SEG visibleSeg( start, end );
  518. ClipLine( &clipBox, visibleSeg.A.x, visibleSeg.A.y, visibleSeg.B.x, visibleSeg.B.y );
  519. // Check if the track is long enough to have a netname displayed
  520. int seg_minlenght = track_width * 6; // min lenght of the visible segment to draw the net name
  521. if( visibleSeg.Length() < seg_minlenght )
  522. return;
  523. const wxString& netName = UnescapeString( aTrack->GetShortNetname() );
  524. double textSize = track_width;
  525. double penWidth = textSize / 12.0;
  526. VECTOR2D textPosition = ( visibleSeg.A + visibleSeg.B ) / 2.0; // center of the track
  527. EDA_ANGLE textOrientation;
  528. // If the last position is still on the track, and it's some reasonable distance inside
  529. // the viewport then don't move the netname; just use the last position.
  530. if( visibleSeg.Distance( aTrack->m_LastNetnamePosition ) < penWidth
  531. && clipBox.Inflate( -seg_minlenght ).Contains( aTrack->m_LastNetnamePosition ) )
  532. {
  533. textPosition = aTrack->m_LastNetnamePosition;
  534. }
  535. else
  536. {
  537. aTrack->m_LastNetnamePosition = textPosition;
  538. }
  539. if( end.y == start.y ) // horizontal
  540. {
  541. textOrientation = ANGLE_HORIZONTAL;
  542. }
  543. else if( end.x == start.x ) // vertical
  544. {
  545. textOrientation = ANGLE_VERTICAL;
  546. }
  547. else
  548. {
  549. textOrientation = EDA_ANGLE( visibleSeg.B - visibleSeg.A ) + ANGLE_90;
  550. textOrientation.Normalize90();
  551. }
  552. m_gal->SetIsStroke( true );
  553. m_gal->SetIsFill( false );
  554. m_gal->SetStrokeColor( color );
  555. m_gal->SetLineWidth( penWidth );
  556. m_gal->SetFontBold( false );
  557. m_gal->SetFontItalic( false );
  558. m_gal->SetFontUnderlined( false );
  559. m_gal->SetTextMirrored( false );
  560. m_gal->SetGlyphSize( VECTOR2D( textSize * 0.55, textSize * 0.55 ) );
  561. m_gal->SetHorizontalJustify( GR_TEXT_H_ALIGN_CENTER );
  562. m_gal->SetVerticalJustify( GR_TEXT_V_ALIGN_CENTER );
  563. m_gal->BitmapText( netName, textPosition, textOrientation );
  564. return;
  565. }
  566. else if( IsCopperLayer( aLayer ) || aLayer == LAYER_LOCKED_ITEM_SHADOW )
  567. {
  568. // Draw a regular track
  569. bool outline_mode = pcbconfig()
  570. && !pcbconfig()->m_Display.m_DisplayPcbTrackFill
  571. && aLayer != LAYER_LOCKED_ITEM_SHADOW;
  572. m_gal->SetStrokeColor( color );
  573. m_gal->SetFillColor( color );
  574. m_gal->SetIsStroke( outline_mode );
  575. m_gal->SetIsFill( not outline_mode );
  576. m_gal->SetLineWidth( m_pcbSettings.m_outlineWidth );
  577. if( aLayer == LAYER_LOCKED_ITEM_SHADOW )
  578. track_width = track_width * 1.5;
  579. m_gal->DrawSegment( start, end, track_width );
  580. }
  581. // Clearance lines
  582. if( pcbconfig() && pcbconfig()->m_Display.m_TrackClearance == SHOW_WITH_VIA_ALWAYS
  583. && !m_pcbSettings.m_isPrinting && aLayer != LAYER_LOCKED_ITEM_SHADOW )
  584. {
  585. int clearance = aTrack->GetOwnClearance( m_pcbSettings.GetActiveLayer() );
  586. m_gal->SetLineWidth( m_pcbSettings.m_outlineWidth );
  587. m_gal->SetIsFill( false );
  588. m_gal->SetIsStroke( true );
  589. m_gal->SetStrokeColor( color );
  590. m_gal->DrawSegment( start, end, track_width + clearance * 2 );
  591. }
  592. }
  593. void PCB_PAINTER::draw( const PCB_ARC* aArc, int aLayer )
  594. {
  595. VECTOR2D center( aArc->GetCenter() );
  596. int width = aArc->GetWidth();
  597. COLOR4D color = m_pcbSettings.GetColor( aArc, aLayer );
  598. double radius = aArc->GetRadius();
  599. EDA_ANGLE start_angle = aArc->GetArcAngleStart();
  600. EDA_ANGLE angle = aArc->GetAngle();
  601. if( IsNetnameLayer( aLayer ) )
  602. {
  603. // Ummm, yeah. Anyone fancy implementing text on a path?
  604. return;
  605. }
  606. else if( IsCopperLayer( aLayer ) || aLayer == LAYER_LOCKED_ITEM_SHADOW )
  607. {
  608. // Draw a regular track
  609. bool outline_mode = pcbconfig()
  610. && !pcbconfig()->m_Display.m_DisplayPcbTrackFill
  611. && aLayer != LAYER_LOCKED_ITEM_SHADOW;
  612. m_gal->SetStrokeColor( color );
  613. m_gal->SetFillColor( color );
  614. m_gal->SetIsStroke( outline_mode );
  615. m_gal->SetIsFill( not outline_mode );
  616. m_gal->SetLineWidth( m_pcbSettings.m_outlineWidth );
  617. if( aLayer == LAYER_LOCKED_ITEM_SHADOW )
  618. width = width * 1.5;
  619. m_gal->DrawArcSegment( center, radius, start_angle, start_angle + angle, width,
  620. m_maxError );
  621. }
  622. // Clearance lines
  623. if( pcbconfig() && pcbconfig()->m_Display.m_TrackClearance == SHOW_WITH_VIA_ALWAYS
  624. && !m_pcbSettings.m_isPrinting && aLayer != LAYER_LOCKED_ITEM_SHADOW )
  625. {
  626. int clearance = aArc->GetOwnClearance( m_pcbSettings.GetActiveLayer() );
  627. m_gal->SetLineWidth( m_pcbSettings.m_outlineWidth );
  628. m_gal->SetIsFill( false );
  629. m_gal->SetIsStroke( true );
  630. m_gal->SetStrokeColor( color );
  631. m_gal->DrawArcSegment( center, radius, start_angle, start_angle + angle,
  632. width + clearance * 2, m_maxError );
  633. }
  634. // Debug only: enable this code only to test the TransformArcToPolygon function
  635. // and display the polygon outline created by it.
  636. // arcs on F_Cu are approximated with ERROR_INSIDE, others with ERROR_OUTSIDE
  637. #if 0
  638. SHAPE_POLY_SET cornerBuffer;
  639. ERROR_LOC errorloc = aLayer == F_Cu ? ERROR_LOC::ERROR_INSIDE : ERROR_LOC::ERROR_OUTSIDE;
  640. TransformArcToPolygon( cornerBuffer, aArc->GetStart(), aArc->GetMid(), aArc->GetEnd(), width,
  641. m_maxError, errorloc );
  642. m_gal->SetLineWidth( m_pcbSettings.m_outlineWidth );
  643. m_gal->SetIsFill( false );
  644. m_gal->SetIsStroke( true );
  645. m_gal->SetStrokeColor( COLOR4D( 0, 0, 1.0, 1.0 ) );
  646. m_gal->DrawPolygon( cornerBuffer );
  647. #endif
  648. // Debug only: enable this code only to test the SHAPE_ARC::ConvertToPolyline function
  649. // and display the polyline created by it.
  650. #if 0
  651. SHAPE_ARC arc( aArc->GetCenter(), aArc->GetStart(), aArc->GetAngle() / 10.0, aArc->GetWidth() );
  652. SHAPE_LINE_CHAIN arcSpine = arc.ConvertToPolyline( m_maxError );
  653. m_gal->SetLineWidth( m_pcbSettings.m_outlineWidth );
  654. m_gal->SetIsFill( false );
  655. m_gal->SetIsStroke( true );
  656. m_gal->SetStrokeColor( COLOR4D( 0.3, 0.2, 0.5, 1.0 ) );
  657. for( int idx = 1; idx < arcSpine.PointCount(); idx++ )
  658. m_gal->DrawSegment( arcSpine.CPoint( idx-1 ), arcSpine.CPoint( idx ), aArc->GetWidth() );
  659. #endif
  660. }
  661. void PCB_PAINTER::draw( const PCB_VIA* aVia, int aLayer )
  662. {
  663. COLOR4D color = m_pcbSettings.GetColor( aVia, aLayer );
  664. VECTOR2D center( aVia->GetStart() );
  665. if( color == COLOR4D::CLEAR )
  666. return;
  667. // Draw description layer
  668. if( IsNetnameLayer( aLayer ) )
  669. {
  670. VECTOR2D position( center );
  671. // Is anything that we can display enabled?
  672. if( !pcbconfig() )
  673. return;
  674. if( pcbconfig()->m_Display.m_NetNames == 0
  675. || pcbconfig()->m_Display.m_NetNames == 2
  676. || aVia->GetNetname().empty() )
  677. {
  678. return;
  679. }
  680. double maxSize = PCB_RENDER_SETTINGS::MAX_FONT_SIZE;
  681. double size = aVia->GetWidth();
  682. // Font size limits
  683. if( size > maxSize )
  684. size = maxSize;
  685. m_gal->Save();
  686. m_gal->Translate( position );
  687. // Default font settings
  688. m_gal->ResetTextAttributes();
  689. m_gal->SetHorizontalJustify( GR_TEXT_H_ALIGN_CENTER );
  690. m_gal->SetVerticalJustify( GR_TEXT_V_ALIGN_CENTER );
  691. m_gal->SetFontBold( false );
  692. m_gal->SetFontItalic( false );
  693. m_gal->SetFontUnderlined( false );
  694. m_gal->SetTextMirrored( false );
  695. m_gal->SetStrokeColor( m_pcbSettings.GetColor( nullptr, aLayer ) );
  696. m_gal->SetIsStroke( true );
  697. m_gal->SetIsFill( false );
  698. // Set the text position to the pad shape position (the pad position is not the best place)
  699. VECTOR2D textpos( 0.0, 0.0 );
  700. wxString netname = UnescapeString( aVia->GetShortNetname() );
  701. // approximate the size of net name text:
  702. double tsize = 1.5 * size / std::max( PrintableCharCount( netname ), 1 );
  703. tsize = std::min( tsize, size );
  704. // Use a smaller text size to handle interline, pen size..
  705. tsize *= 0.75;
  706. VECTOR2D namesize( tsize, tsize );
  707. m_gal->SetGlyphSize( namesize );
  708. m_gal->SetLineWidth( namesize.x / 12.0 );
  709. m_gal->BitmapText( netname, textpos, ANGLE_HORIZONTAL );
  710. m_gal->Restore();
  711. return;
  712. }
  713. bool outline_mode = pcbconfig() && !pcbconfig()->m_Display.m_DisplayViaFill;
  714. m_gal->SetStrokeColor( color );
  715. m_gal->SetFillColor( color );
  716. m_gal->SetIsStroke( true );
  717. m_gal->SetIsFill( false );
  718. if( outline_mode )
  719. m_gal->SetLineWidth( m_pcbSettings.m_outlineWidth );
  720. if( aLayer == LAYER_VIA_HOLEWALLS )
  721. {
  722. double radius = ( getDrillSize( aVia ) / 2.0 ) + m_holePlatingThickness;
  723. if( !outline_mode )
  724. {
  725. m_gal->SetLineWidth( m_holePlatingThickness );
  726. radius -= m_holePlatingThickness / 2.0;
  727. }
  728. m_gal->DrawCircle( center, radius );
  729. }
  730. else if( aLayer == LAYER_VIA_HOLES )
  731. {
  732. m_gal->SetIsStroke( false );
  733. m_gal->SetIsFill( true );
  734. m_gal->DrawCircle( center, getDrillSize( aVia ) / 2.0 );
  735. }
  736. else if( aLayer == LAYER_VIA_THROUGH || m_pcbSettings.IsPrinting() )
  737. {
  738. int annular_width = ( aVia->GetWidth() - getDrillSize( aVia ) ) / 2.0;
  739. double radius = aVia->GetWidth() / 2.0;
  740. bool draw = aLayer == LAYER_VIA_THROUGH;
  741. if( m_pcbSettings.IsPrinting() )
  742. draw = aVia->FlashLayer( m_pcbSettings.GetPrintLayers() );
  743. if( !outline_mode )
  744. {
  745. m_gal->SetLineWidth( annular_width );
  746. radius -= annular_width / 2.0;
  747. }
  748. if( draw )
  749. m_gal->DrawCircle( center, radius );
  750. }
  751. else if( aLayer == LAYER_VIA_BBLIND || aLayer == LAYER_VIA_MICROVIA )
  752. {
  753. int annular_width = ( aVia->GetWidth() - getDrillSize( aVia ) ) / 2.0;
  754. double radius = aVia->GetWidth() / 2.0;
  755. // Outer circles of blind/buried and micro-vias are drawn in a special way to indicate the
  756. // top and bottom layers
  757. PCB_LAYER_ID layerTop, layerBottom;
  758. aVia->LayerPair( &layerTop, &layerBottom );
  759. if( !outline_mode )
  760. {
  761. m_gal->SetIsStroke( false );
  762. m_gal->SetIsFill( true );
  763. }
  764. m_gal->SetStrokeColor( m_pcbSettings.GetColor( aVia, layerTop ) );
  765. m_gal->SetFillColor( m_pcbSettings.GetColor( aVia, layerTop ) );
  766. m_gal->DrawArc( center, radius, EDA_ANGLE( 240, DEGREES_T ), EDA_ANGLE( 300, DEGREES_T ) );
  767. m_gal->SetStrokeColor( m_pcbSettings.GetColor( aVia, layerBottom ) );
  768. m_gal->SetFillColor( m_pcbSettings.GetColor( aVia, layerBottom ) );
  769. m_gal->DrawArc( center, radius, EDA_ANGLE( 60, DEGREES_T ), EDA_ANGLE( 120, DEGREES_T ) );
  770. m_gal->SetStrokeColor( color );
  771. m_gal->SetFillColor( color );
  772. m_gal->SetIsStroke( true );
  773. m_gal->SetIsFill( false );
  774. if( !outline_mode )
  775. {
  776. m_gal->SetLineWidth( annular_width );
  777. radius -= annular_width / 2.0;
  778. }
  779. m_gal->DrawCircle( center, radius );
  780. }
  781. else if( aLayer == LAYER_LOCKED_ITEM_SHADOW ) // draw a ring around the via
  782. {
  783. int ring_width = aVia->GetWidth() * 0.2;
  784. m_gal->SetLineWidth( ring_width );
  785. m_gal->DrawCircle( center, ( aVia->GetWidth() + ring_width ) / 2.0 );
  786. }
  787. // Clearance lines
  788. if( pcbconfig() && pcbconfig()->m_Display.m_TrackClearance == SHOW_WITH_VIA_ALWAYS
  789. && aLayer != LAYER_VIA_HOLES
  790. && !m_pcbSettings.m_isPrinting )
  791. {
  792. PCB_LAYER_ID activeLayer = m_pcbSettings.GetActiveLayer();
  793. double radius;
  794. if( aVia->FlashLayer( activeLayer ) )
  795. radius = aVia->GetWidth() / 2.0;
  796. else
  797. radius = getDrillSize( aVia ) / 2.0 + m_holePlatingThickness;
  798. m_gal->SetLineWidth( m_pcbSettings.m_outlineWidth );
  799. m_gal->SetIsFill( false );
  800. m_gal->SetIsStroke( true );
  801. m_gal->SetStrokeColor( color );
  802. m_gal->DrawCircle( center, radius + aVia->GetOwnClearance( activeLayer ) );
  803. }
  804. }
  805. void PCB_PAINTER::draw( const PAD* aPad, int aLayer )
  806. {
  807. COLOR4D color = m_pcbSettings.GetColor( aPad, aLayer );
  808. if( IsNetnameLayer( aLayer ) )
  809. {
  810. PCBNEW_SETTINGS::DISPLAY_OPTIONS* displayOpts = pcbconfig() ? &pcbconfig()->m_Display : nullptr;
  811. wxString netname;
  812. wxString padNumber;
  813. if( displayPadNumbers() )
  814. {
  815. padNumber = UnescapeString( aPad->GetNumber() );
  816. if( !displayOpts )
  817. netname = UnescapeString( aPad->GetShortNetname() );
  818. }
  819. if( displayOpts )
  820. {
  821. if( displayOpts->m_NetNames == 1 || displayOpts->m_NetNames == 3 )
  822. netname = UnescapeString( aPad->GetShortNetname() );
  823. if( displayOpts->m_PadNoConnects
  824. && aPad->GetShortNetname().StartsWith( wxT( "unconnected-(" ) ) )
  825. {
  826. wxString pinType = aPad->GetPinType();
  827. if( pinType == wxT( "no_connect" ) || pinType.EndsWith( wxT( "+no_connect" ) ) )
  828. netname = wxT( "x" );
  829. else if( pinType == wxT( "free" ) )
  830. netname = wxT( "*" );
  831. }
  832. }
  833. if( netname.IsEmpty() && padNumber.IsEmpty() )
  834. return;
  835. EDA_RECT padBBox = aPad->GetBoundingBox();
  836. VECTOR2D position = padBBox.Centre();
  837. VECTOR2D padsize = VECTOR2D( padBBox.GetSize() );
  838. if( aPad->GetShape() != PAD_SHAPE::CUSTOM )
  839. {
  840. // Don't allow a 45° rotation to bloat a pad's bounding box unnecessarily
  841. double limit = std::min( aPad->GetSize().x, aPad->GetSize().y ) * 1.1;
  842. if( padsize.x > limit && padsize.y > limit )
  843. {
  844. padsize.x = limit;
  845. padsize.y = limit;
  846. }
  847. }
  848. double maxSize = PCB_RENDER_SETTINGS::MAX_FONT_SIZE;
  849. double size = padsize.y;
  850. m_gal->Save();
  851. m_gal->Translate( position );
  852. // Keep the size ratio for the font, but make it smaller
  853. if( padsize.x < padsize.y )
  854. {
  855. m_gal->Rotate( -ANGLE_90.AsRadians() );
  856. size = padsize.x;
  857. std::swap( padsize.x, padsize.y );
  858. }
  859. // Font size limits
  860. if( size > maxSize )
  861. size = maxSize;
  862. // Default font settings
  863. m_gal->ResetTextAttributes();
  864. m_gal->SetHorizontalJustify( GR_TEXT_H_ALIGN_CENTER );
  865. m_gal->SetVerticalJustify( GR_TEXT_V_ALIGN_CENTER );
  866. m_gal->SetFontBold( false );
  867. m_gal->SetFontItalic( false );
  868. m_gal->SetFontUnderlined( false );
  869. m_gal->SetTextMirrored( false );
  870. m_gal->SetStrokeColor( m_pcbSettings.GetColor( aPad, aLayer ) );
  871. m_gal->SetIsStroke( true );
  872. m_gal->SetIsFill( false );
  873. // We have already translated the GAL to be centered at the center of the pad's
  874. // bounding box
  875. VECTOR2I textpos( 0, 0 );
  876. // Divide the space, to display both pad numbers and netnames and set the Y text
  877. // position to display 2 lines
  878. if( !netname.IsEmpty() && !padNumber.IsEmpty() )
  879. {
  880. size = size / 2.5;
  881. textpos.y = size / 1.7;
  882. }
  883. if( !netname.IsEmpty() )
  884. {
  885. // approximate the size of net name text:
  886. double tsize = 1.5 * padsize.x / std::max( PrintableCharCount( netname ), 1 );
  887. tsize = std::min( tsize, size );
  888. // Use a smaller text size to handle interline, pen size...
  889. tsize *= 0.75;
  890. VECTOR2D namesize( tsize, tsize );
  891. m_gal->SetGlyphSize( namesize );
  892. m_gal->SetLineWidth( namesize.x / 12.0 );
  893. m_gal->BitmapText( netname, textpos, ANGLE_HORIZONTAL );
  894. }
  895. if( !padNumber.IsEmpty() )
  896. {
  897. textpos.y = -textpos.y;
  898. // approximate the size of the pad number text:
  899. double tsize = 1.5 * padsize.x / std::max( PrintableCharCount( padNumber ), 1 );
  900. tsize = std::min( tsize, size );
  901. // Use a smaller text size to handle interline, pen size...
  902. tsize *= 0.75;
  903. tsize = std::min( tsize, size );
  904. VECTOR2D numsize( tsize, tsize );
  905. m_gal->SetGlyphSize( numsize );
  906. m_gal->SetLineWidth( numsize.x / 12.0 );
  907. m_gal->BitmapText( padNumber, textpos, ANGLE_HORIZONTAL );
  908. }
  909. m_gal->Restore();
  910. return;
  911. }
  912. else if( aLayer == LAYER_PAD_HOLEWALLS )
  913. {
  914. m_gal->SetIsFill( false );
  915. m_gal->SetIsStroke( true );
  916. m_gal->SetLineWidth( m_holePlatingThickness );
  917. m_gal->SetStrokeColor( color );
  918. std::shared_ptr<SHAPE_SEGMENT> slot = aPad->GetEffectiveHoleShape();
  919. int holeSize = slot->GetWidth() + m_holePlatingThickness;
  920. if( slot->GetSeg().A == slot->GetSeg().B ) // Circular hole
  921. m_gal->DrawCircle( slot->GetSeg().A, KiROUND( holeSize / 2.0 ) );
  922. else
  923. m_gal->DrawSegment( slot->GetSeg().A, slot->GetSeg().B, holeSize );
  924. return;
  925. }
  926. bool outline_mode = !displayPadFill();
  927. if( m_pcbSettings.m_ForcePadSketchModeOff )
  928. outline_mode = false;
  929. else if( m_pcbSettings.m_ForcePadSketchModeOn )
  930. outline_mode = true;
  931. if( outline_mode )
  932. {
  933. // Outline mode
  934. m_gal->SetIsFill( false );
  935. m_gal->SetIsStroke( true );
  936. m_gal->SetLineWidth( m_pcbSettings.m_outlineWidth );
  937. m_gal->SetStrokeColor( color );
  938. }
  939. else
  940. {
  941. // Filled mode
  942. m_gal->SetIsFill( true );
  943. m_gal->SetIsStroke( false );
  944. m_gal->SetFillColor( color );
  945. }
  946. if( aLayer == LAYER_PAD_PLATEDHOLES || aLayer == LAYER_NON_PLATEDHOLES )
  947. {
  948. std::shared_ptr<SHAPE_SEGMENT> slot = aPad->GetEffectiveHoleShape();
  949. if( slot->GetSeg().A == slot->GetSeg().B ) // Circular hole
  950. m_gal->DrawCircle( slot->GetSeg().A, slot->GetWidth() / 2 );
  951. else
  952. m_gal->DrawSegment( slot->GetSeg().A, slot->GetSeg().B, slot->GetWidth() );
  953. }
  954. else
  955. {
  956. VECTOR2I pad_size = aPad->GetSize();
  957. VECTOR2I margin;
  958. switch( aLayer )
  959. {
  960. case F_Mask:
  961. case B_Mask:
  962. margin.x = margin.y = aPad->GetSolderMaskExpansion();
  963. break;
  964. case F_Paste:
  965. case B_Paste:
  966. margin = aPad->GetSolderPasteMargin();
  967. break;
  968. default:
  969. margin.x = margin.y = 0;
  970. break;
  971. }
  972. std::unique_ptr<PAD> dummyPad;
  973. std::shared_ptr<SHAPE_COMPOUND> shapes;
  974. // Drawing components of compound shapes in outline mode produces a mess.
  975. bool simpleShapes = !outline_mode;
  976. if( simpleShapes )
  977. {
  978. if( ( margin.x != margin.y && aPad->GetShape() != PAD_SHAPE::CUSTOM )
  979. || ( aPad->GetShape() == PAD_SHAPE::ROUNDRECT && ( margin.x < 0 || margin.y < 0 ) ) )
  980. {
  981. // Our algorithms below (polygon inflation in particular) can't handle differential
  982. // inflation along separate axes. So for those cases we build a dummy pad instead,
  983. // and inflate it.
  984. // Margin is added to both sides. If the total margin is larger than the pad
  985. // then don't display this layer
  986. if( pad_size.x + 2 * margin.x <= 0 || pad_size.y + 2 * margin.y <= 0 )
  987. return;
  988. dummyPad.reset( static_cast<PAD*>( aPad->Duplicate() ) );
  989. int initial_radius = dummyPad->GetRoundRectCornerRadius();
  990. dummyPad->SetSize( pad_size + margin + margin );
  991. if( dummyPad->GetShape() == PAD_SHAPE::ROUNDRECT )
  992. {
  993. // To keep the right margin around the corners, we need to modify the corner radius.
  994. // We must have only one radius correction, so use the smallest absolute margin.
  995. int radius_margin = std::max( margin.x, margin.y ); // radius_margin is < 0
  996. dummyPad->SetRoundRectCornerRadius( std::max( initial_radius + radius_margin, 0 ) );
  997. }
  998. shapes = std::dynamic_pointer_cast<SHAPE_COMPOUND>( dummyPad->GetEffectiveShape() );
  999. margin.x = margin.y = 0;
  1000. }
  1001. else
  1002. {
  1003. shapes = std::dynamic_pointer_cast<SHAPE_COMPOUND>( aPad->GetEffectiveShape() );
  1004. }
  1005. if( aPad->GetShape() == PAD_SHAPE::CUSTOM && ( margin.x || margin.y ) )
  1006. {
  1007. // We can't draw as shapes because we don't know which edges are internal and which
  1008. // are external (so we don't know when to apply the margin and when not to).
  1009. simpleShapes = false;
  1010. }
  1011. for( const SHAPE* shape : shapes->Shapes() )
  1012. {
  1013. if( !simpleShapes )
  1014. break;
  1015. switch( shape->Type() )
  1016. {
  1017. case SH_SEGMENT:
  1018. case SH_CIRCLE:
  1019. case SH_RECT:
  1020. case SH_SIMPLE:
  1021. // OK so far
  1022. break;
  1023. default:
  1024. // Not OK
  1025. simpleShapes = false;
  1026. break;
  1027. }
  1028. }
  1029. }
  1030. if( simpleShapes )
  1031. {
  1032. for( const SHAPE* shape : shapes->Shapes() )
  1033. {
  1034. switch( shape->Type() )
  1035. {
  1036. case SH_SEGMENT:
  1037. {
  1038. const SHAPE_SEGMENT* seg = (const SHAPE_SEGMENT*) shape;
  1039. int effectiveWidth = seg->GetWidth() + 2 * margin.x;
  1040. if( effectiveWidth > 0 )
  1041. m_gal->DrawSegment( seg->GetSeg().A, seg->GetSeg().B, effectiveWidth );
  1042. break;
  1043. }
  1044. case SH_CIRCLE:
  1045. {
  1046. const SHAPE_CIRCLE* circle = (const SHAPE_CIRCLE*) shape;
  1047. int effectiveRadius = circle->GetRadius() + margin.x;
  1048. if( effectiveRadius > 0 )
  1049. m_gal->DrawCircle( circle->GetCenter(), effectiveRadius );
  1050. break;
  1051. }
  1052. case SH_RECT:
  1053. {
  1054. const SHAPE_RECT* r = (const SHAPE_RECT*) shape;
  1055. VECTOR2I pos = r->GetPosition();
  1056. VECTOR2I effectiveMargin = margin;
  1057. if( effectiveMargin.x < 0 )
  1058. {
  1059. // A negative margin just produces a smaller rect.
  1060. VECTOR2I effectiveSize = r->GetSize() + effectiveMargin;
  1061. if( effectiveSize.x > 0 && effectiveSize.y > 0 )
  1062. m_gal->DrawRectangle( pos - effectiveMargin, pos + effectiveSize );
  1063. }
  1064. else if( effectiveMargin.x > 0 )
  1065. {
  1066. // A positive margin produces a larger rect, but with rounded corners
  1067. m_gal->DrawRectangle( r->GetPosition(), r->GetPosition() + r->GetSize() );
  1068. // Use segments to produce the margin with rounded corners
  1069. m_gal->DrawSegment( pos,
  1070. pos + VECTOR2I( r->GetWidth(), 0 ),
  1071. effectiveMargin.x * 2 );
  1072. m_gal->DrawSegment( pos + VECTOR2I( r->GetWidth(), 0 ),
  1073. pos + r->GetSize(),
  1074. effectiveMargin.x * 2 );
  1075. m_gal->DrawSegment( pos + r->GetSize(),
  1076. pos + VECTOR2I( 0, r->GetHeight() ),
  1077. effectiveMargin.x * 2 );
  1078. m_gal->DrawSegment( pos + VECTOR2I( 0, r->GetHeight() ),
  1079. pos,
  1080. effectiveMargin.x * 2 );
  1081. }
  1082. else
  1083. {
  1084. m_gal->DrawRectangle( r->GetPosition(), r->GetPosition() + r->GetSize() );
  1085. }
  1086. break;
  1087. }
  1088. case SH_SIMPLE:
  1089. {
  1090. const SHAPE_SIMPLE* poly = static_cast<const SHAPE_SIMPLE*>( shape );
  1091. if( margin.x < 0 ) // The poly shape must be deflated
  1092. {
  1093. int numSegs = GetArcToSegmentCount( -margin.x, m_maxError, FULL_CIRCLE );
  1094. SHAPE_POLY_SET outline;
  1095. outline.NewOutline();
  1096. for( int ii = 0; ii < poly->PointCount(); ++ii )
  1097. outline.Append( poly->CPoint( ii ) );
  1098. outline.Deflate( -margin.x, numSegs );
  1099. m_gal->DrawPolygon( outline );
  1100. }
  1101. else
  1102. {
  1103. m_gal->DrawPolygon( poly->Vertices() );
  1104. }
  1105. // Now add on a rounded margin (using segments) if the margin > 0
  1106. if( margin.x > 0 )
  1107. {
  1108. for( size_t ii = 0; ii < poly->GetSegmentCount(); ++ii )
  1109. {
  1110. SEG seg = poly->GetSegment( ii );
  1111. m_gal->DrawSegment( seg.A, seg.B, margin.x * 2 );
  1112. }
  1113. }
  1114. break;
  1115. }
  1116. default:
  1117. // Better not get here; we already pre-flighted the shapes...
  1118. break;
  1119. }
  1120. }
  1121. }
  1122. else
  1123. {
  1124. // This is expensive. Avoid if possible.
  1125. SHAPE_POLY_SET polySet;
  1126. aPad->TransformShapeWithClearanceToPolygon( polySet, ToLAYER_ID( aLayer ), margin.x,
  1127. m_maxError, ERROR_INSIDE );
  1128. m_gal->DrawPolygon( polySet );
  1129. }
  1130. }
  1131. if( pcbconfig() && pcbconfig()->m_Display.m_PadClearance
  1132. && ( aLayer == LAYER_PAD_FR || aLayer == LAYER_PAD_BK || aLayer == LAYER_PADS_TH )
  1133. && !m_pcbSettings.m_isPrinting )
  1134. {
  1135. /* Showing the clearance area is not obvious.
  1136. * - A pad can be removed from some copper layers.
  1137. * - For non copper layers, what is the clearance area?
  1138. * So for copper layers, the clearance area is the shape if the pad is flashed on this
  1139. * layer and the hole clearance area for other copper layers.
  1140. * For other layers, use the pad shape, although one can use an other criteria,
  1141. * depending on the non copper layer.
  1142. */
  1143. int activeLayer = m_pcbSettings.GetActiveLayer();
  1144. bool flashActiveLayer = true;
  1145. if( IsCopperLayer( activeLayer ) )
  1146. flashActiveLayer = aPad->FlashLayer( activeLayer );
  1147. if( flashActiveLayer || aPad->GetDrillSize().x )
  1148. {
  1149. if( aPad->GetAttribute() == PAD_ATTRIB::NPTH )
  1150. color = m_pcbSettings.GetLayerColor( LAYER_NON_PLATEDHOLES );
  1151. m_gal->SetLineWidth( m_pcbSettings.m_outlineWidth );
  1152. m_gal->SetIsStroke( true );
  1153. m_gal->SetIsFill( false );
  1154. m_gal->SetStrokeColor( color );
  1155. int clearance = aPad->GetOwnClearance( m_pcbSettings.GetActiveLayer() );
  1156. if( flashActiveLayer && clearance > 0 )
  1157. {
  1158. auto shape = std::dynamic_pointer_cast<SHAPE_COMPOUND>( aPad->GetEffectiveShape() );
  1159. if( shape && shape->Size() == 1 && shape->Shapes()[0]->Type() == SH_SEGMENT )
  1160. {
  1161. const SHAPE_SEGMENT* seg = (SHAPE_SEGMENT*) shape->Shapes()[0];
  1162. m_gal->DrawSegment( seg->GetSeg().A, seg->GetSeg().B,
  1163. seg->GetWidth() + 2 * clearance );
  1164. }
  1165. else if( shape && shape->Size() == 1 && shape->Shapes()[0]->Type() == SH_CIRCLE )
  1166. {
  1167. const SHAPE_CIRCLE* circle = (SHAPE_CIRCLE*) shape->Shapes()[0];
  1168. m_gal->DrawCircle( circle->GetCenter(), circle->GetRadius() + clearance );
  1169. }
  1170. else
  1171. {
  1172. SHAPE_POLY_SET polySet;
  1173. // Use ERROR_INSIDE because it avoids Clipper and is therefore much faster.
  1174. aPad->TransformShapeWithClearanceToPolygon( polySet, ToLAYER_ID( aLayer ),
  1175. clearance, m_maxError, ERROR_INSIDE );
  1176. m_gal->DrawPolygon( polySet );
  1177. }
  1178. }
  1179. else if( aPad->GetEffectiveHoleShape() && clearance > 0 )
  1180. {
  1181. clearance += m_holePlatingThickness;
  1182. std::shared_ptr<SHAPE_SEGMENT> slot = aPad->GetEffectiveHoleShape();
  1183. m_gal->DrawSegment( slot->GetSeg().A, slot->GetSeg().B,
  1184. slot->GetWidth() + 2 * clearance );
  1185. }
  1186. }
  1187. }
  1188. }
  1189. void PCB_PAINTER::draw( const PCB_SHAPE* aShape, int aLayer )
  1190. {
  1191. COLOR4D color = m_pcbSettings.GetColor( aShape, aShape->GetLayer() );
  1192. bool outline_mode = !displayGraphicsFill();
  1193. int thickness = getLineThickness( aShape->GetWidth() );
  1194. PLOT_DASH_TYPE lineStyle = aShape->GetStroke().GetPlotStyle();
  1195. if( aLayer == LAYER_LOCKED_ITEM_SHADOW )
  1196. {
  1197. color = m_pcbSettings.GetColor( aShape, aLayer );
  1198. thickness = std::max( thickness * 3, Millimeter2iu( 0.2 ) );
  1199. }
  1200. if( outline_mode )
  1201. {
  1202. m_gal->SetIsFill( false );
  1203. m_gal->SetIsStroke( true );
  1204. m_gal->SetLineWidth( m_pcbSettings.m_outlineWidth );
  1205. }
  1206. m_gal->SetFillColor( color );
  1207. m_gal->SetStrokeColor( color );
  1208. if( lineStyle <= PLOT_DASH_TYPE::FIRST_TYPE )
  1209. {
  1210. switch( aShape->GetShape() )
  1211. {
  1212. case SHAPE_T::SEGMENT:
  1213. if( outline_mode )
  1214. {
  1215. m_gal->DrawSegment( aShape->GetStart(), aShape->GetEnd(), thickness );
  1216. }
  1217. else
  1218. {
  1219. m_gal->SetIsFill( true );
  1220. m_gal->SetIsStroke( false );
  1221. m_gal->DrawSegment( aShape->GetStart(), aShape->GetEnd(), thickness );
  1222. }
  1223. break;
  1224. case SHAPE_T::RECT:
  1225. {
  1226. std::vector<VECTOR2I> pts = aShape->GetRectCorners();
  1227. if( outline_mode )
  1228. {
  1229. m_gal->DrawSegment( pts[0], pts[1], thickness );
  1230. m_gal->DrawSegment( pts[1], pts[2], thickness );
  1231. m_gal->DrawSegment( pts[2], pts[3], thickness );
  1232. m_gal->DrawSegment( pts[3], pts[0], thickness );
  1233. }
  1234. else
  1235. {
  1236. m_gal->SetIsFill( true );
  1237. m_gal->SetIsStroke( false );
  1238. if( thickness > 0 )
  1239. {
  1240. m_gal->DrawSegment( pts[0], pts[1], thickness );
  1241. m_gal->DrawSegment( pts[1], pts[2], thickness );
  1242. m_gal->DrawSegment( pts[2], pts[3], thickness );
  1243. m_gal->DrawSegment( pts[3], pts[0], thickness );
  1244. }
  1245. if( aShape->IsFilled() )
  1246. {
  1247. SHAPE_POLY_SET poly;
  1248. poly.NewOutline();
  1249. for( const VECTOR2I& pt : pts )
  1250. poly.Append( pt );
  1251. m_gal->DrawPolygon( poly );
  1252. }
  1253. }
  1254. break;
  1255. }
  1256. case SHAPE_T::ARC:
  1257. {
  1258. EDA_ANGLE startAngle;
  1259. EDA_ANGLE endAngle;
  1260. aShape->CalcArcAngles( startAngle, endAngle );
  1261. if( outline_mode )
  1262. {
  1263. m_gal->DrawArcSegment( aShape->GetCenter(), aShape->GetRadius(), startAngle,
  1264. endAngle, thickness, m_maxError );
  1265. }
  1266. else
  1267. {
  1268. m_gal->SetIsFill( true );
  1269. m_gal->SetIsStroke( false );
  1270. m_gal->DrawArcSegment( aShape->GetCenter(), aShape->GetRadius(), startAngle,
  1271. endAngle, thickness, m_maxError );
  1272. }
  1273. break;
  1274. }
  1275. case SHAPE_T::CIRCLE:
  1276. if( outline_mode )
  1277. {
  1278. m_gal->DrawCircle( aShape->GetStart(), aShape->GetRadius() - thickness / 2 );
  1279. m_gal->DrawCircle( aShape->GetStart(), aShape->GetRadius() + thickness / 2 );
  1280. }
  1281. else
  1282. {
  1283. m_gal->SetIsFill( aShape->IsFilled() );
  1284. m_gal->SetIsStroke( thickness > 0 );
  1285. m_gal->SetLineWidth( thickness );
  1286. m_gal->DrawCircle( aShape->GetStart(), aShape->GetRadius() );
  1287. }
  1288. break;
  1289. case SHAPE_T::POLY:
  1290. {
  1291. SHAPE_POLY_SET& shape = const_cast<PCB_SHAPE*>( aShape )->GetPolyShape();
  1292. const FOOTPRINT* parentFootprint = aShape->GetParentFootprint();
  1293. if( shape.OutlineCount() == 0 )
  1294. break;
  1295. if( parentFootprint )
  1296. {
  1297. m_gal->Save();
  1298. m_gal->Translate( parentFootprint->GetPosition() );
  1299. m_gal->Rotate( -parentFootprint->GetOrientation().AsRadians() );
  1300. }
  1301. if( outline_mode )
  1302. {
  1303. for( int ii = 0; ii < shape.Outline( 0 ).SegmentCount(); ++ii )
  1304. {
  1305. SEG seg = shape.Outline( 0 ).Segment( ii );
  1306. m_gal->DrawSegment( seg.A, seg.B, thickness );
  1307. }
  1308. }
  1309. else
  1310. {
  1311. m_gal->SetIsFill( true );
  1312. m_gal->SetIsStroke( false );
  1313. if( thickness > 0 )
  1314. {
  1315. for( int ii = 0; ii < shape.Outline( 0 ).SegmentCount(); ++ii )
  1316. {
  1317. SEG seg = shape.Outline( 0 ).Segment( ii );
  1318. m_gal->DrawSegment( seg.A, seg.B, thickness );
  1319. }
  1320. }
  1321. if( aShape->IsFilled() )
  1322. {
  1323. // On Opengl, a not convex filled polygon is usually drawn by using triangles
  1324. // as primitives. CacheTriangulation() can create basic triangle primitives to
  1325. // draw the polygon solid shape on Opengl. GLU tessellation is much slower,
  1326. // so currently we are using our tessellation.
  1327. if( m_gal->IsOpenGlEngine() && !shape.IsTriangulationUpToDate() )
  1328. shape.CacheTriangulation();
  1329. m_gal->DrawPolygon( shape );
  1330. }
  1331. }
  1332. if( parentFootprint )
  1333. m_gal->Restore();
  1334. break;
  1335. }
  1336. case SHAPE_T::BEZIER:
  1337. if( outline_mode )
  1338. {
  1339. std::vector<VECTOR2D> output;
  1340. std::vector<VECTOR2D> pointCtrl;
  1341. pointCtrl.push_back( aShape->GetStart() );
  1342. pointCtrl.push_back( aShape->GetBezierC1() );
  1343. pointCtrl.push_back( aShape->GetBezierC2() );
  1344. pointCtrl.push_back( aShape->GetEnd() );
  1345. BEZIER_POLY converter( pointCtrl );
  1346. converter.GetPoly( output, thickness );
  1347. for( unsigned ii = 0; ii + 1 < output.size(); ++ii )
  1348. m_gal->DrawSegment( output[ii], output[ii+1], thickness );
  1349. }
  1350. else
  1351. {
  1352. m_gal->SetIsFill( aShape->IsFilled() );
  1353. m_gal->SetIsStroke( thickness > 0 );
  1354. m_gal->SetLineWidth( thickness );
  1355. // Use thickness as filter value to convert the curve to polyline when the curve
  1356. // is not supported
  1357. m_gal->DrawCurve( VECTOR2D( aShape->GetStart() ),
  1358. VECTOR2D( aShape->GetBezierC1() ),
  1359. VECTOR2D( aShape->GetBezierC2() ),
  1360. VECTOR2D( aShape->GetEnd() ), thickness );
  1361. }
  1362. break;
  1363. case SHAPE_T::LAST:
  1364. break;
  1365. }
  1366. }
  1367. else
  1368. {
  1369. if( !outline_mode )
  1370. {
  1371. m_gal->SetIsFill( true );
  1372. m_gal->SetIsStroke( false );
  1373. }
  1374. std::vector<SHAPE*> shapes = aShape->MakeEffectiveShapes( true );
  1375. for( SHAPE* shape : shapes )
  1376. {
  1377. STROKE_PARAMS::Stroke( shape, lineStyle, thickness, &m_pcbSettings,
  1378. [&]( const VECTOR2I& a, const VECTOR2I& b )
  1379. {
  1380. m_gal->DrawSegment( a, b, thickness );
  1381. } );
  1382. }
  1383. for( SHAPE* shape : shapes )
  1384. delete shape;
  1385. }
  1386. }
  1387. void PCB_PAINTER::strokeText( const wxString& aText, const VECTOR2I& aPosition,
  1388. const TEXT_ATTRIBUTES& aAttrs )
  1389. {
  1390. KIFONT::FONT* font = aAttrs.m_Font;
  1391. if( !font )
  1392. font = KIFONT::FONT::GetFont( wxEmptyString, aAttrs.m_Bold, aAttrs.m_Italic );
  1393. m_gal->SetIsFill( font->IsOutline() );
  1394. m_gal->SetIsStroke( font->IsStroke() );
  1395. font->Draw( m_gal, aText, aPosition, aAttrs );
  1396. }
  1397. void PCB_PAINTER::draw( const PCB_BITMAP* aBitmap, int aLayer )
  1398. {
  1399. m_gal->Save();
  1400. m_gal->Translate( aBitmap->GetPosition() );
  1401. // When the image scale factor is not 1.0, we need to modify the actual as the image scale
  1402. // factor is similar to a local zoom
  1403. double img_scale = aBitmap->GetImageScale();
  1404. if( img_scale != 1.0 )
  1405. m_gal->Scale( VECTOR2D( img_scale, img_scale ) );
  1406. if( aBitmap->IsSelected() || aBitmap->IsBrightened() )
  1407. {
  1408. COLOR4D color = m_pcbSettings.GetColor( aBitmap, LAYER_ANCHOR );
  1409. m_gal->SetIsStroke( true );
  1410. m_gal->SetStrokeColor( color );
  1411. m_gal->SetLineWidth( m_pcbSettings.m_outlineWidth * 2.0f );
  1412. m_gal->SetIsFill( false );
  1413. // Draws a bounding box.
  1414. VECTOR2D bm_size( aBitmap->GetSize() );
  1415. // bm_size is the actual image size in UI.
  1416. // but m_gal scale was previously set to img_scale
  1417. // so recalculate size relative to this image size.
  1418. bm_size.x /= img_scale;
  1419. bm_size.y /= img_scale;
  1420. VECTOR2D origin( -bm_size.x / 2.0, -bm_size.y / 2.0 );
  1421. VECTOR2D end = origin + bm_size;
  1422. m_gal->DrawRectangle( origin, end );
  1423. // Hard code bitmaps as opaque when selected. Otherwise cached layers
  1424. // will not be rendered under the selected bitmap because cached layers
  1425. // are rendered after non-cached layers (e.g. bitmaps), which will have
  1426. // a closer Z order.
  1427. m_gal->DrawBitmap( *aBitmap->GetImage(), 1.0 );
  1428. }
  1429. else
  1430. m_gal->DrawBitmap( *aBitmap->GetImage(),
  1431. m_pcbSettings.GetColor( aBitmap, aBitmap->GetLayer() ).a );
  1432. m_gal->Restore();
  1433. }
  1434. void PCB_PAINTER::draw( const PCB_TEXT* aText, int aLayer )
  1435. {
  1436. wxString resolvedText( aText->GetShownText() );
  1437. if( resolvedText.Length() == 0 )
  1438. return;
  1439. if( aLayer == LAYER_LOCKED_ITEM_SHADOW ) // happens only if locked
  1440. {
  1441. const COLOR4D color = m_pcbSettings.GetColor( aText, aLayer );
  1442. m_gal->SetIsFill( true );
  1443. m_gal->SetIsStroke( false );
  1444. m_gal->SetFillColor( color );
  1445. SHAPE_POLY_SET poly;
  1446. aText->TransformShapeWithClearanceToPolygon( poly, aText->GetLayer(), 0, m_maxError,
  1447. ERROR_OUTSIDE );
  1448. m_gal->DrawPolygon( poly );
  1449. return;
  1450. }
  1451. TEXT_ATTRIBUTES attrs = aText->GetAttributes();
  1452. const COLOR4D& color = m_pcbSettings.GetColor( aText, aText->GetLayer() );
  1453. bool outline_mode = !displayTextFill();
  1454. m_gal->SetStrokeColor( color );
  1455. m_gal->SetFillColor( color );
  1456. if( aText->IsKnockout() )
  1457. {
  1458. KIGFX::GAL_DISPLAY_OPTIONS empty_opts;
  1459. SHAPE_POLY_SET knockouts;
  1460. CALLBACK_GAL callback_gal( empty_opts,
  1461. // Polygon callback
  1462. [&]( const SHAPE_LINE_CHAIN& aPoly )
  1463. {
  1464. knockouts.AddOutline( aPoly );
  1465. } );
  1466. KIFONT::FONT* font = aText->GetDrawFont();
  1467. attrs.m_StrokeWidth = getLineThickness( aText->GetEffectiveTextPenWidth() );
  1468. callback_gal.SetIsFill( font->IsOutline() );
  1469. callback_gal.SetIsStroke( font->IsStroke() );
  1470. callback_gal.SetLineWidth( attrs.m_StrokeWidth );
  1471. font->Draw( &callback_gal, resolvedText, aText->GetDrawPos(), attrs );
  1472. SHAPE_POLY_SET finalPoly;
  1473. int margin = attrs.m_StrokeWidth * 1.5
  1474. + GetKnockoutTextMargin( attrs.m_Size, attrs.m_StrokeWidth );
  1475. aText->TransformBoundingBoxWithClearanceToPolygon( &finalPoly, margin );
  1476. finalPoly.BooleanSubtract( knockouts, SHAPE_POLY_SET::PM_FAST );
  1477. finalPoly.Fracture( SHAPE_POLY_SET::PM_FAST );
  1478. m_gal->SetIsStroke( false );
  1479. m_gal->SetIsFill( true );
  1480. m_gal->DrawPolygon( finalPoly );
  1481. }
  1482. else
  1483. {
  1484. if( outline_mode )
  1485. attrs.m_StrokeWidth = m_pcbSettings.m_outlineWidth;
  1486. else
  1487. attrs.m_StrokeWidth = getLineThickness( aText->GetEffectiveTextPenWidth() );
  1488. std::vector<std::unique_ptr<KIFONT::GLYPH>>* cache = aText->GetRenderCache( resolvedText );
  1489. if( cache )
  1490. {
  1491. for( const std::unique_ptr<KIFONT::GLYPH>& glyph : *cache )
  1492. m_gal->DrawGlyph( *glyph.get() );
  1493. }
  1494. else
  1495. {
  1496. strokeText( resolvedText, aText->GetTextPos(), attrs );
  1497. }
  1498. }
  1499. }
  1500. void PCB_PAINTER::draw( const PCB_TEXTBOX* aTextBox, int aLayer )
  1501. {
  1502. const COLOR4D& color = m_pcbSettings.GetColor( aTextBox, aLayer );
  1503. int thickness = getLineThickness( aTextBox->GetWidth() );
  1504. PLOT_DASH_TYPE lineStyle = aTextBox->GetStroke().GetPlotStyle();
  1505. wxString resolvedText( aTextBox->GetShownText() );
  1506. if( aLayer == LAYER_LOCKED_ITEM_SHADOW ) // happens only if locked
  1507. {
  1508. const COLOR4D sh_color = m_pcbSettings.GetColor( aTextBox, aLayer );
  1509. m_gal->SetIsFill( true );
  1510. m_gal->SetIsStroke( false );
  1511. m_gal->SetFillColor( sh_color );
  1512. m_gal->SetStrokeColor( sh_color );
  1513. // Draw the box with a larger thickness than box thickness to show
  1514. // the shadow mask
  1515. std::vector<VECTOR2I> pts = aTextBox->GetCorners();
  1516. int line_thickness = std::max( thickness*3, Millimeter2iu( 0.2 ) );
  1517. for( size_t ii = 0; ii < pts.size(); ++ii )
  1518. m_gal->DrawSegment( pts[ ii ], pts[ (ii + 1) % pts.size() ], line_thickness );
  1519. }
  1520. m_gal->SetFillColor( color );
  1521. m_gal->SetStrokeColor( color );
  1522. m_gal->SetIsFill( true );
  1523. m_gal->SetIsStroke( false );
  1524. if( lineStyle <= PLOT_DASH_TYPE::FIRST_TYPE )
  1525. {
  1526. if( thickness > 0 )
  1527. {
  1528. std::vector<VECTOR2I> pts = aTextBox->GetCorners();
  1529. for( size_t ii = 0; ii < pts.size(); ++ii )
  1530. m_gal->DrawSegment( pts[ ii ], pts[ (ii + 1) % pts.size() ], thickness );
  1531. }
  1532. }
  1533. else
  1534. {
  1535. std::vector<SHAPE*> shapes = aTextBox->MakeEffectiveShapes( true );
  1536. for( SHAPE* shape : shapes )
  1537. {
  1538. STROKE_PARAMS::Stroke( shape, lineStyle, thickness, &m_pcbSettings,
  1539. [&]( const VECTOR2I& a, const VECTOR2I& b )
  1540. {
  1541. m_gal->DrawSegment( a, b, thickness );
  1542. } );
  1543. }
  1544. for( SHAPE* shape : shapes )
  1545. delete shape;
  1546. }
  1547. if( resolvedText.Length() == 0 )
  1548. return;
  1549. TEXT_ATTRIBUTES attrs = aTextBox->GetAttributes();
  1550. attrs.m_StrokeWidth = getLineThickness( aTextBox->GetEffectiveTextPenWidth() );
  1551. std::vector<std::unique_ptr<KIFONT::GLYPH>>* cache = aTextBox->GetRenderCache( resolvedText );
  1552. if( aLayer == LAYER_LOCKED_ITEM_SHADOW )
  1553. {
  1554. const COLOR4D sh_color = m_pcbSettings.GetColor( aTextBox, aLayer );
  1555. m_gal->SetFillColor( sh_color );
  1556. m_gal->SetStrokeColor( sh_color );
  1557. attrs.m_StrokeWidth *= 3;
  1558. }
  1559. if( cache )
  1560. {
  1561. for( const std::unique_ptr<KIFONT::GLYPH>& glyph : *cache )
  1562. m_gal->DrawGlyph( *glyph.get() );
  1563. }
  1564. else
  1565. {
  1566. strokeText( resolvedText, aTextBox->GetDrawPos(), attrs );
  1567. }
  1568. }
  1569. void PCB_PAINTER::draw( const FP_TEXT* aText, int aLayer )
  1570. {
  1571. wxString resolvedText( aText->GetShownText() );
  1572. if( resolvedText.Length() == 0 )
  1573. return;
  1574. const COLOR4D& color = m_pcbSettings.GetColor( aText, aLayer );
  1575. bool outline_mode = !displayTextFill();
  1576. TEXT_ATTRIBUTES attrs = aText->GetAttributes();
  1577. m_gal->SetStrokeColor( color );
  1578. m_gal->SetFillColor( color );
  1579. attrs.m_Angle = aText->GetDrawRotation();
  1580. if( aText->IsKnockout() )
  1581. {
  1582. KIGFX::GAL_DISPLAY_OPTIONS empty_opts;
  1583. SHAPE_POLY_SET knockouts;
  1584. CALLBACK_GAL callback_gal( empty_opts,
  1585. // Polygon callback
  1586. [&]( const SHAPE_LINE_CHAIN& aPoly )
  1587. {
  1588. knockouts.AddOutline( aPoly );
  1589. } );
  1590. KIFONT::FONT* font = aText->GetDrawFont();
  1591. attrs.m_StrokeWidth = getLineThickness( aText->GetEffectiveTextPenWidth() );
  1592. callback_gal.SetIsFill( font->IsOutline() );
  1593. callback_gal.SetIsStroke( font->IsStroke() );
  1594. callback_gal.SetLineWidth( attrs.m_StrokeWidth );
  1595. font->Draw( &callback_gal, resolvedText, aText->GetDrawPos(), attrs );
  1596. SHAPE_POLY_SET finalPoly;
  1597. int margin = attrs.m_StrokeWidth * 1.5
  1598. + GetKnockoutTextMargin( attrs.m_Size, attrs.m_StrokeWidth );
  1599. aText->TransformBoundingBoxWithClearanceToPolygon( &finalPoly, margin );
  1600. finalPoly.BooleanSubtract( knockouts, SHAPE_POLY_SET::PM_FAST );
  1601. finalPoly.Fracture( SHAPE_POLY_SET::PM_FAST );
  1602. m_gal->SetIsStroke( false );
  1603. m_gal->SetIsFill( true );
  1604. m_gal->DrawPolygon( finalPoly );
  1605. }
  1606. else
  1607. {
  1608. if( outline_mode )
  1609. attrs.m_StrokeWidth = m_pcbSettings.m_outlineWidth;
  1610. else
  1611. attrs.m_StrokeWidth = getLineThickness( aText->GetEffectiveTextPenWidth() );
  1612. std::vector<std::unique_ptr<KIFONT::GLYPH>>* cache = aText->GetRenderCache( resolvedText );
  1613. if( cache )
  1614. {
  1615. for( const std::unique_ptr<KIFONT::GLYPH>& glyph : *cache )
  1616. m_gal->DrawGlyph( *glyph.get() );
  1617. }
  1618. else
  1619. {
  1620. strokeText( resolvedText, aText->GetTextPos(), attrs );
  1621. }
  1622. }
  1623. // Draw the umbilical line
  1624. if( aText->IsSelected() )
  1625. {
  1626. m_gal->SetLineWidth( m_pcbSettings.m_outlineWidth );
  1627. m_gal->SetStrokeColor( m_pcbSettings.GetColor( nullptr, LAYER_ANCHOR ) );
  1628. m_gal->DrawLine( aText->GetTextPos(), aText->GetParent()->GetPosition() );
  1629. }
  1630. }
  1631. void PCB_PAINTER::draw( const FP_TEXTBOX* aTextBox, int aLayer )
  1632. {
  1633. const COLOR4D& color = m_pcbSettings.GetColor( aTextBox, aTextBox->GetLayer() );
  1634. int thickness = getLineThickness( aTextBox->GetWidth() );
  1635. PLOT_DASH_TYPE lineStyle = aTextBox->GetStroke().GetPlotStyle();
  1636. m_gal->SetFillColor( color );
  1637. m_gal->SetStrokeColor( color );
  1638. m_gal->SetIsFill( true );
  1639. m_gal->SetIsStroke( false );
  1640. if( lineStyle <= PLOT_DASH_TYPE::FIRST_TYPE )
  1641. {
  1642. if( thickness > 0 )
  1643. {
  1644. std::vector<VECTOR2I> pts = aTextBox->GetCorners();
  1645. for( size_t ii = 0; ii < pts.size(); ++ii )
  1646. m_gal->DrawSegment( pts[ ii ], pts[ (ii + 1) % pts.size() ], thickness );
  1647. }
  1648. }
  1649. else
  1650. {
  1651. std::vector<SHAPE*> shapes = aTextBox->MakeEffectiveShapes( true );
  1652. for( SHAPE* shape : shapes )
  1653. {
  1654. STROKE_PARAMS::Stroke( shape, lineStyle, thickness, &m_pcbSettings,
  1655. [&]( const VECTOR2I& a, const VECTOR2I& b )
  1656. {
  1657. m_gal->DrawSegment( a, b, thickness );
  1658. } );
  1659. }
  1660. for( SHAPE* shape : shapes )
  1661. delete shape;
  1662. }
  1663. wxString resolvedText( aTextBox->GetShownText() );
  1664. if( resolvedText.Length() == 0 )
  1665. return;
  1666. TEXT_ATTRIBUTES attrs = aTextBox->GetAttributes();
  1667. attrs.m_Angle = aTextBox->GetDrawRotation();
  1668. attrs.m_StrokeWidth = getLineThickness( aTextBox->GetEffectiveTextPenWidth() );
  1669. std::vector<std::unique_ptr<KIFONT::GLYPH>>* cache = aTextBox->GetRenderCache( resolvedText );
  1670. if( cache )
  1671. {
  1672. for( const std::unique_ptr<KIFONT::GLYPH>& glyph : *cache )
  1673. m_gal->DrawGlyph( *glyph.get() );
  1674. }
  1675. else
  1676. {
  1677. strokeText( resolvedText, aTextBox->GetDrawPos(), attrs );
  1678. }
  1679. }
  1680. void PCB_PAINTER::draw( const FOOTPRINT* aFootprint, int aLayer )
  1681. {
  1682. if( aLayer == LAYER_ANCHOR )
  1683. {
  1684. const COLOR4D color = m_pcbSettings.GetColor( aFootprint, aLayer );
  1685. // Keep the size and width constant, not related to the scale because the anchor
  1686. // is just a marker on screen
  1687. double anchorSize = 5.0 / m_gal->GetWorldScale(); // 5 pixels size
  1688. double anchorThickness = 1.0 / m_gal->GetWorldScale(); // 1 pixels width
  1689. // Draw anchor
  1690. m_gal->SetIsFill( false );
  1691. m_gal->SetIsStroke( true );
  1692. m_gal->SetStrokeColor( color );
  1693. m_gal->SetLineWidth( anchorThickness );
  1694. VECTOR2D center = aFootprint->GetPosition();
  1695. m_gal->DrawLine( center - VECTOR2D( anchorSize, 0 ), center + VECTOR2D( anchorSize, 0 ) );
  1696. m_gal->DrawLine( center - VECTOR2D( 0, anchorSize ), center + VECTOR2D( 0, anchorSize ) );
  1697. }
  1698. if( aLayer == LAYER_LOCKED_ITEM_SHADOW ) // happens only if locked
  1699. {
  1700. const COLOR4D color = m_pcbSettings.GetColor( aFootprint, aLayer );
  1701. m_gal->SetIsFill( true );
  1702. m_gal->SetIsStroke( false );
  1703. m_gal->SetFillColor( color );
  1704. const SHAPE_POLY_SET& poly = aFootprint->GetBoundingHull();
  1705. m_gal->DrawPolygon( poly );
  1706. }
  1707. if( aLayer == LAYER_CONFLICTS_SHADOW ) // happens only if locked
  1708. {
  1709. const SHAPE_POLY_SET& frontpoly = aFootprint->GetPolyCourtyard( F_CrtYd );
  1710. const SHAPE_POLY_SET& backpoly = aFootprint->GetPolyCourtyard( B_CrtYd );
  1711. const COLOR4D color = m_pcbSettings.GetColor( aFootprint, aLayer );
  1712. m_gal->SetIsFill( true );
  1713. m_gal->SetIsStroke( false );
  1714. m_gal->SetFillColor( color );
  1715. if( frontpoly.OutlineCount() > 0 )
  1716. m_gal->DrawPolygon( frontpoly );
  1717. if( backpoly.OutlineCount() > 0 )
  1718. m_gal->DrawPolygon( backpoly );
  1719. }
  1720. }
  1721. void PCB_PAINTER::draw( const PCB_GROUP* aGroup, int aLayer )
  1722. {
  1723. if( aLayer == LAYER_ANCHOR )
  1724. {
  1725. if( aGroup->IsSelected() && !( aGroup->GetParent() && aGroup->GetParent()->IsSelected() ) )
  1726. {
  1727. // Selected on our own; draw enclosing box
  1728. }
  1729. else if( aGroup->IsEntered() )
  1730. {
  1731. // Entered group; draw enclosing box
  1732. }
  1733. else
  1734. {
  1735. // Neither selected nor entered; draw nothing at the group level (ie: only draw
  1736. // its members)
  1737. return;
  1738. }
  1739. const COLOR4D color = m_pcbSettings.GetColor( aGroup, LAYER_ANCHOR );
  1740. EDA_RECT bbox = aGroup->GetBoundingBox();
  1741. m_gal->SetStrokeColor( color );
  1742. m_gal->SetLineWidth( m_pcbSettings.m_outlineWidth * 2.0f );
  1743. VECTOR2I topLeft = bbox.GetPosition();
  1744. VECTOR2I width = VECTOR2I( bbox.GetWidth(), 0 );
  1745. VECTOR2I height = VECTOR2I( 0, bbox.GetHeight() );
  1746. m_gal->DrawLine( topLeft, topLeft + width );
  1747. m_gal->DrawLine( topLeft + width, topLeft + width + height );
  1748. m_gal->DrawLine( topLeft + width + height, topLeft + height );
  1749. m_gal->DrawLine( topLeft + height, topLeft );
  1750. wxString name = aGroup->GetName();
  1751. if( name.IsEmpty() )
  1752. return;
  1753. int ptSize = 12;
  1754. int scaledSize = abs( KiROUND( m_gal->GetScreenWorldMatrix().GetScale().x * ptSize ) );
  1755. int unscaledSize = Mils2iu( ptSize );
  1756. // Scale by zoom a bit, but not too much
  1757. int textSize = ( scaledSize + ( unscaledSize * 2 ) ) / 3;
  1758. VECTOR2I textOffset = VECTOR2I( width.x / 2, -KiROUND( textSize * 0.5 ) );
  1759. VECTOR2I titleHeight = VECTOR2I( 0, KiROUND( textSize * 2.0 ) );
  1760. if( PrintableCharCount( name ) * textSize < bbox.GetWidth() )
  1761. {
  1762. m_gal->DrawLine( topLeft, topLeft - titleHeight );
  1763. m_gal->DrawLine( topLeft - titleHeight, topLeft + width - titleHeight );
  1764. m_gal->DrawLine( topLeft + width - titleHeight, topLeft + width );
  1765. TEXT_ATTRIBUTES attrs;
  1766. attrs.m_Italic = true;
  1767. attrs.m_Halign = GR_TEXT_H_ALIGN_CENTER;
  1768. attrs.m_Valign = GR_TEXT_V_ALIGN_BOTTOM;
  1769. attrs.m_Size = VECTOR2I( textSize, textSize );
  1770. attrs.m_StrokeWidth = GetPenSizeForNormal( textSize );
  1771. KIFONT::FONT::GetFont()->Draw( m_gal, aGroup->GetName(), topLeft + textOffset, attrs );
  1772. }
  1773. }
  1774. }
  1775. void PCB_PAINTER::draw( const ZONE* aZone, int aLayer )
  1776. {
  1777. /*
  1778. * aLayer will be the virtual zone layer (LAYER_ZONE_START, ... in GAL_LAYER_ID)
  1779. * This is used for draw ordering in the GAL.
  1780. * The color for the zone comes from the associated copper layer ( aLayer - LAYER_ZONE_START )
  1781. * and the visibility comes from the combination of that copper layer and LAYER_ZONES
  1782. */
  1783. wxASSERT( IsZoneLayer( aLayer ) );
  1784. PCB_LAYER_ID layer = static_cast<PCB_LAYER_ID>( aLayer - LAYER_ZONE_START );
  1785. if( !aZone->IsOnLayer( layer ) )
  1786. return;
  1787. COLOR4D color = m_pcbSettings.GetColor( aZone, layer );
  1788. std::deque<VECTOR2D> corners;
  1789. ZONE_DISPLAY_MODE displayMode = m_pcbSettings.m_ZoneDisplayMode;
  1790. // Draw the outline
  1791. const SHAPE_POLY_SET* outline = aZone->Outline();
  1792. if( !m_pcbSettings.m_isPrinting && outline && outline->OutlineCount() > 0 )
  1793. {
  1794. m_gal->SetStrokeColor( color.a > 0.0 ? color.WithAlpha( 1.0 ) : color );
  1795. m_gal->SetIsFill( false );
  1796. m_gal->SetIsStroke( true );
  1797. m_gal->SetLineWidth( m_pcbSettings.m_outlineWidth );
  1798. // Draw each contour (main contour and holes)
  1799. /*
  1800. * m_gal->DrawPolygon( *outline );
  1801. * should be enough, but currently does not work to draw holes contours in a complex
  1802. * polygon so each contour is draw as a simple polygon
  1803. */
  1804. // Draw the main contour
  1805. m_gal->DrawPolyline( outline->COutline( 0 ) );
  1806. // Draw holes
  1807. int holes_count = outline->HoleCount( 0 );
  1808. for( int ii = 0; ii < holes_count; ++ii )
  1809. m_gal->DrawPolyline( outline->CHole( 0, ii ) );
  1810. // Draw hatch lines
  1811. for( const SEG& hatchLine : aZone->GetHatchLines() )
  1812. m_gal->DrawLine( hatchLine.A, hatchLine.B );
  1813. }
  1814. // Draw the filling
  1815. if( displayMode == ZONE_DISPLAY_MODE::SHOW_FILLED
  1816. || displayMode == ZONE_DISPLAY_MODE::SHOW_FRACTURE_BORDERS
  1817. || displayMode == ZONE_DISPLAY_MODE::SHOW_TRIANGULATION )
  1818. {
  1819. const std::shared_ptr<SHAPE_POLY_SET>& polySet = aZone->GetFilledPolysList( layer );
  1820. if( polySet->OutlineCount() == 0 ) // Nothing to draw
  1821. return;
  1822. m_gal->SetStrokeColor( color );
  1823. m_gal->SetFillColor( color );
  1824. m_gal->SetLineWidth( 0 );
  1825. if( displayMode == ZONE_DISPLAY_MODE::SHOW_FILLED )
  1826. {
  1827. m_gal->SetIsFill( true );
  1828. m_gal->SetIsStroke( false );
  1829. }
  1830. else
  1831. {
  1832. m_gal->SetIsFill( false );
  1833. m_gal->SetIsStroke( true );
  1834. }
  1835. m_gal->DrawPolygon( *polySet, displayMode == ZONE_DISPLAY_MODE::SHOW_TRIANGULATION );
  1836. }
  1837. }
  1838. void PCB_PAINTER::draw( const PCB_DIMENSION_BASE* aDimension, int aLayer )
  1839. {
  1840. const COLOR4D& color = m_pcbSettings.GetColor( aDimension, aLayer );
  1841. m_gal->SetStrokeColor( color );
  1842. m_gal->SetFillColor( color );
  1843. m_gal->SetIsFill( false );
  1844. m_gal->SetIsStroke( true );
  1845. bool outline_mode = !displayGraphicsFill();
  1846. if( outline_mode )
  1847. m_gal->SetLineWidth( m_pcbSettings.m_outlineWidth );
  1848. else
  1849. m_gal->SetLineWidth( getLineThickness( aDimension->GetLineThickness() ) );
  1850. // Draw dimension shapes
  1851. // TODO(JE) lift this out
  1852. for( const std::shared_ptr<SHAPE>& shape : aDimension->GetShapes() )
  1853. {
  1854. switch( shape->Type() )
  1855. {
  1856. case SH_SEGMENT:
  1857. {
  1858. const SEG& seg = static_cast<const SHAPE_SEGMENT*>( shape.get() )->GetSeg();
  1859. m_gal->DrawLine( seg.A, seg.B );
  1860. break;
  1861. }
  1862. case SH_CIRCLE:
  1863. {
  1864. int radius = static_cast<const SHAPE_CIRCLE*>( shape.get() )->GetRadius();
  1865. m_gal->DrawCircle( shape->Centre(), radius );
  1866. break;
  1867. }
  1868. default:
  1869. break;
  1870. }
  1871. }
  1872. // Draw text
  1873. const PCB_TEXT& text = aDimension->Text();
  1874. wxString resolvedText = text.GetShownText();
  1875. TEXT_ATTRIBUTES attrs = text.GetAttributes();
  1876. if( outline_mode )
  1877. attrs.m_StrokeWidth = m_pcbSettings.m_outlineWidth;
  1878. else
  1879. attrs.m_StrokeWidth = getLineThickness( text.GetEffectiveTextPenWidth() );
  1880. std::vector<std::unique_ptr<KIFONT::GLYPH>>* cache = text.GetRenderCache( resolvedText );
  1881. if( cache )
  1882. {
  1883. for( const std::unique_ptr<KIFONT::GLYPH>& glyph : *cache )
  1884. m_gal->DrawGlyph( *glyph.get() );
  1885. }
  1886. else
  1887. {
  1888. strokeText( resolvedText, text.GetTextPos(), attrs );
  1889. }
  1890. }
  1891. void PCB_PAINTER::draw( const PCB_TARGET* aTarget )
  1892. {
  1893. const COLOR4D& strokeColor = m_pcbSettings.GetColor( aTarget, aTarget->GetLayer() );
  1894. VECTOR2D position( aTarget->GetPosition() );
  1895. double size, radius;
  1896. m_gal->SetLineWidth( getLineThickness( aTarget->GetWidth() ) );
  1897. m_gal->SetStrokeColor( strokeColor );
  1898. m_gal->SetIsFill( false );
  1899. m_gal->SetIsStroke( true );
  1900. m_gal->Save();
  1901. m_gal->Translate( position );
  1902. if( aTarget->GetShape() )
  1903. {
  1904. // shape x
  1905. m_gal->Rotate( M_PI / 4.0 );
  1906. size = 2.0 * aTarget->GetSize() / 3.0;
  1907. radius = aTarget->GetSize() / 2.0;
  1908. }
  1909. else
  1910. {
  1911. // shape +
  1912. size = aTarget->GetSize() / 2.0;
  1913. radius = aTarget->GetSize() / 3.0;
  1914. }
  1915. m_gal->DrawLine( VECTOR2D( -size, 0.0 ), VECTOR2D( size, 0.0 ) );
  1916. m_gal->DrawLine( VECTOR2D( 0.0, -size ), VECTOR2D( 0.0, size ) );
  1917. m_gal->DrawCircle( VECTOR2D( 0.0, 0.0 ), radius );
  1918. m_gal->Restore();
  1919. }
  1920. void PCB_PAINTER::draw( const PCB_MARKER* aMarker, int aLayer )
  1921. {
  1922. bool isShadow = aLayer == LAYER_MARKER_SHADOWS;
  1923. // Don't paint shadows for invisible markers.
  1924. // It would be nice to do this through layer dependencies but we can't do an "or" there today
  1925. if( isShadow && aMarker->GetBoard()
  1926. && !aMarker->GetBoard()->IsElementVisible( aMarker->GetColorLayer() ) )
  1927. {
  1928. return;
  1929. }
  1930. const_cast<PCB_MARKER*>( aMarker )->SetZoom( 1.0 / sqrt( m_gal->GetZoomFactor() ) );
  1931. SHAPE_LINE_CHAIN polygon;
  1932. aMarker->ShapeToPolygon( polygon );
  1933. COLOR4D color = m_pcbSettings.GetColor( aMarker, isShadow ? LAYER_MARKER_SHADOWS
  1934. : aMarker->GetColorLayer() );
  1935. m_gal->Save();
  1936. m_gal->Translate( aMarker->GetPosition() );
  1937. if( isShadow )
  1938. {
  1939. m_gal->SetStrokeColor( color );
  1940. m_gal->SetIsStroke( true );
  1941. m_gal->SetLineWidth( aMarker->MarkerScale() );
  1942. }
  1943. else
  1944. {
  1945. m_gal->SetFillColor( color );
  1946. m_gal->SetIsFill( true );
  1947. }
  1948. m_gal->DrawPolygon( polygon );
  1949. m_gal->Restore();
  1950. }
  1951. const double PCB_RENDER_SETTINGS::MAX_FONT_SIZE = Millimeter2iu( 10.0 );