|
KiCad PCB EDA Suite
|
Render-time projection of a grid: GRID_GEOMETRY (kind/origin/pitch/orientation/extent) plus rendering and interaction flags. More...
#include <graphics_abstraction_layer.h>
Public Types | |
| enum class | KIND { CARTESIAN , POLAR } |
Public Member Functions | |
| VECTOR2D | Snap (const VECTOR2D &aPoint) const |
| Snap a point to the nearest on-grid position. | |
| bool | Contains (const VECTOR2D &aPoint, double aTolerance=0.0) const |
| double | Area () const |
| bool | TakesPrecedenceOver (const GRID_GEOMETRY &aOther) const |
Public Attributes | |
| bool | unbounded = false |
| No extent; visible range derived from screen corners. | |
| bool | axesEnabled = false |
| Skip grid lines coincident with the world axes (only meaningful for unbounded cartesian). | |
| bool | snapCursor = false |
| Participate in the cursor snap (GAL::GetGridPoint). | |
| bool | highlighted = false |
| Render with edit-mode emphasis (selected grid). | |
| unsigned | tick = 0 |
| Major-tick interval (0 = inherit default). | |
| COLOR4D | color |
| GRID_STYLE | style = GRID_STYLE::LINES |
| KIND | kind = KIND::CARTESIAN |
| VECTOR2D | origin |
| VECTOR2D | pitch |
| Cartesian: (dx, dy); polar: (dr, dPhi rad). | |
| double | orientation = 0.0 |
| Rotation about origin, radians CCW. | |
| VECTOR2D | extent |
| Cartesian: (dx, dy) = size/2 from origin. | |
| unsigned | priority = 0 |
| Higher wins where grids overlap. | |
Render-time projection of a grid: GRID_GEOMETRY (kind/origin/pitch/orientation/extent) plus rendering and interaction flags.
SetGridSources keeps the list in precedence order, so consumers may simply take the first source that applies.
Definition at line 73 of file graphics_abstraction_layer.h.
|
stronginherited |
| Enumerator | |
|---|---|
| CARTESIAN | |
| POLAR | |
Definition at line 32 of file grid_geometry.h.
|
inherited |
Definition at line 124 of file grid_geometry.cpp.
References std::abs(), CARTESIAN, extent, kind, and POLAR.
Referenced by PCB_GRID_ITEM::GetCoverageArea(), and TakesPrecedenceOver().
|
inherited |
Definition at line 93 of file grid_geometry.cpp.
References std::abs(), CARTESIAN, extent, GetRotated(), kind, M_PI, orientation, origin, POLAR, RADIANS_T, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by PCB_GRID_ITEM::HitTest(), and PCB_GRID_ITEM::HitTestArea().
Snap a point to the nearest on-grid position.
Definition at line 29 of file grid_geometry.cpp.
References CARTESIAN, extent, GetRotated(), kind, M_PI, orientation, origin, pitch, POLAR, RADIANS_T, VECTOR2< T >::x, and VECTOR2< T >::y.
|
inlineinherited |
The Compare for std::stable_sort - the winner sorts FIRST, ties keep document order. The background grid is the only one at priority 0, so it always sorts last.
Definition at line 72 of file grid_geometry.h.
References Area(), and priority.
Referenced by FindActiveGridAt().
| bool KIGFX::GRID_SOURCE::axesEnabled = false |
Skip grid lines coincident with the world axes (only meaningful for unbounded cartesian).
Definition at line 77 of file graphics_abstraction_layer.h.
Referenced by KIGFX::CAIRO_GAL_BASE::DrawGrid(), KIGFX::OPENGL_GAL::DrawGrid(), KIGFX::CAIRO_GAL_BASE::drawGridSource(), and KIGFX::OPENGL_GAL::drawGridSources().
| COLOR4D KIGFX::GRID_SOURCE::color |
Definition at line 84 of file graphics_abstraction_layer.h.
Referenced by KIGFX::CAIRO_GAL_BASE::DrawGrid(), KIGFX::OPENGL_GAL::DrawGrid(), KIGFX::CAIRO_GAL_BASE::drawGridSource(), KIGFX::OPENGL_GAL::drawGridSources(), and PCB_DRAW_PANEL_GAL::prepareGridSources().
|
inherited |
Cartesian: (dx, dy) = size/2 from origin.
Polar: (rMax, phiMax rad).
Definition at line 42 of file grid_geometry.h.
Referenced by Area(), PCB_GRID_ITEM::AsGridGeometry(), Contains(), KIGFX::CAIRO_GAL_BASE::drawGridCoverageShape(), KIGFX::OPENGL_GAL::drawGridCoverageShape(), KIGFX::CAIRO_GAL_BASE::drawGridSource(), KIGFX::OPENGL_GAL::drawGridSources(), and Snap().
| bool KIGFX::GRID_SOURCE::highlighted = false |
Render with edit-mode emphasis (selected grid).
Definition at line 80 of file graphics_abstraction_layer.h.
Referenced by KIGFX::CAIRO_GAL_BASE::drawGridSource(), KIGFX::OPENGL_GAL::drawGridSources(), and PCB_DRAW_PANEL_GAL::prepareGridSources().
|
inherited |
Definition at line 38 of file grid_geometry.h.
Referenced by Area(), PCB_GRID_ITEM::AsGridGeometry(), Contains(), KIGFX::CAIRO_GAL_BASE::DrawGrid(), KIGFX::OPENGL_GAL::DrawGrid(), KIGFX::CAIRO_GAL_BASE::drawGridCoverageShape(), KIGFX::OPENGL_GAL::drawGridCoverageShape(), KIGFX::CAIRO_GAL_BASE::drawGridSource(), KIGFX::OPENGL_GAL::drawGridSources(), and Snap().
|
inherited |
Rotation about origin, radians CCW.
Definition at line 41 of file grid_geometry.h.
Referenced by PCB_GRID_ITEM::AsGridGeometry(), Contains(), KIGFX::CAIRO_GAL_BASE::drawGridCoverageShape(), KIGFX::OPENGL_GAL::drawGridCoverageShape(), KIGFX::CAIRO_GAL_BASE::drawGridSource(), KIGFX::OPENGL_GAL::drawGridSources(), KIGFX::GAL::gridScreenBBox(), and Snap().
|
inherited |
Definition at line 39 of file grid_geometry.h.
Referenced by PCB_GRID_ITEM::AsGridGeometry(), Contains(), KIGFX::CAIRO_GAL_BASE::DrawGrid(), KIGFX::OPENGL_GAL::DrawGrid(), KIGFX::CAIRO_GAL_BASE::drawGridCoverageShape(), KIGFX::OPENGL_GAL::drawGridCoverageShape(), KIGFX::CAIRO_GAL_BASE::drawGridSource(), KIGFX::OPENGL_GAL::drawGridSources(), KIGFX::GAL::gridScreenBBox(), and Snap().
|
inherited |
Cartesian: (dx, dy); polar: (dr, dPhi rad).
Definition at line 40 of file grid_geometry.h.
Referenced by PCB_GRID_ITEM::AsGridGeometry(), KIGFX::CAIRO_GAL_BASE::DrawGrid(), KIGFX::OPENGL_GAL::DrawGrid(), KIGFX::CAIRO_GAL_BASE::drawGridSource(), KIGFX::OPENGL_GAL::drawGridSources(), PCB_DRAW_PANEL_GAL::prepareGridSources(), and Snap().
|
inherited |
Higher wins where grids overlap.
0 is reserved for the background grid; see TakesPrecedenceOver.
Definition at line 44 of file grid_geometry.h.
Referenced by PCB_GRID_ITEM::AsGridGeometry(), KIGFX::CAIRO_GAL_BASE::DrawGrid(), KIGFX::OPENGL_GAL::DrawGrid(), and TakesPrecedenceOver().
| bool KIGFX::GRID_SOURCE::snapCursor = false |
Participate in the cursor snap (GAL::GetGridPoint).
Definition at line 79 of file graphics_abstraction_layer.h.
Referenced by PCB_DRAW_PANEL_GAL::prepareGridSources().
| GRID_STYLE KIGFX::GRID_SOURCE::style = GRID_STYLE::LINES |
Definition at line 85 of file graphics_abstraction_layer.h.
Referenced by KIGFX::CAIRO_GAL_BASE::DrawGrid(), KIGFX::OPENGL_GAL::DrawGrid(), KIGFX::CAIRO_GAL_BASE::drawGridSource(), KIGFX::OPENGL_GAL::drawGridSources(), and PCB_DRAW_PANEL_GAL::prepareGridSources().
| unsigned KIGFX::GRID_SOURCE::tick = 0 |
Major-tick interval (0 = inherit default).
Definition at line 82 of file graphics_abstraction_layer.h.
Referenced by KIGFX::CAIRO_GAL_BASE::DrawGrid(), KIGFX::OPENGL_GAL::DrawGrid(), KIGFX::CAIRO_GAL_BASE::drawGridSource(), KIGFX::OPENGL_GAL::drawGridSources(), and PCB_DRAW_PANEL_GAL::prepareGridSources().
| bool KIGFX::GRID_SOURCE::unbounded = false |
No extent; visible range derived from screen corners.
Used by the synthesised display grid.
Definition at line 75 of file graphics_abstraction_layer.h.
Referenced by KIGFX::CAIRO_GAL_BASE::DrawGrid(), KIGFX::OPENGL_GAL::DrawGrid(), KIGFX::CAIRO_GAL_BASE::drawGridCoverageShape(), KIGFX::OPENGL_GAL::drawGridCoverageShape(), KIGFX::CAIRO_GAL_BASE::drawGridSource(), and KIGFX::OPENGL_GAL::drawGridSources().