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.

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