KiCad PCB EDA Suite
Loading...
Searching...
No Matches
diff_scene.h File Reference
#include <kicommon.h>
#include <diff_merge/kicad_diff_types.h>
#include <diff_merge/diff_doc_kind.h>
#include <base_units.h>
#include <gal/color4d.h>
#include <lset.h>
#include <math/box2.h>
#include <wx/string.h>
#include <array>
#include <map>
#include <optional>

Go to the source code of this file.

Classes

struct  KICAD_DIFF::SCENE_SHAPE
 Shared rendering model consumed by both the GAL renderer (interactive widget) and the plotter renderer (headless PNG/SVG output). More...
 
struct  KICAD_DIFF::DOCUMENT_SEGMENT
 Stroked line segment from one of the source documents. More...
 
struct  KICAD_DIFF::DOCUMENT_POLYGON
 Closed polygon outline from a source document. More...
 
struct  KICAD_DIFF::DOCUMENT_CIRCLE
 Filled or stroked circle. More...
 
struct  KICAD_DIFF::DOCUMENT_GEOMETRY
 Aggregate of background geometry extracted from one source document. More...
 
struct  KICAD_DIFF::GEOMETRY_SINK
 Sink for the shared DOCUMENT_GEOMETRY walk. More...
 
struct  KICAD_DIFF::DIFF_SCENE
 
struct  KICAD_DIFF::DIFF_COLOR_THEME
 Color theme. More...
 

Namespaces

namespace  KICAD_DIFF
 

Enumerations

enum class  KICAD_DIFF::CATEGORY { KICAD_DIFF::ADDED , KICAD_DIFF::REMOVED , KICAD_DIFF::MODIFIED , KICAD_DIFF::CONFLICT }
 Visual category each ITEM_CHANGE belongs to in the scene. More...
 

Functions

void KICAD_DIFF::IterateDocumentGeometry (const DOCUMENT_GEOMETRY &aGeometry, GEOMETRY_SINK &aSink)
 Walk a DOCUMENT_GEOMETRY in the canonical render order shared by the GAL and plotter renderers: every polygon fill pass, every polygon stroke pass, then segments, then circles.
 
const EDA_IU_SCALEKICAD_DIFF::IuScaleForDocKind (DOC_KIND aKind)
 Internal-unit scale a document kind's coordinates are expressed in.
 
DIFF_SCENE KICAD_DIFF::BuildScene (const DOCUMENT_DIFF &aDiff, const DIFF_COLOR_THEME &aTheme)
 Build a DIFF_SCENE from a DOCUMENT_DIFF, populating the shape lists and computing the union bbox.
 
CATEGORY KICAD_DIFF::CategoryFor (CHANGE_KIND aKind)
 Map a CHANGE_KIND to the visual category it belongs to.
 
void KICAD_DIFF::ExpandBBoxToGeometry (DIFF_SCENE &aScene)
 Grow the scene's documentBBox to also include the extent of any background geometry.
 
std::optional< BOX2IKICAD_DIFF::BBoxFromGeometry (const DOCUMENT_GEOMETRY &aGeometry)
 Compute the tight bounding box of a DOCUMENT_GEOMETRY, inflating each primitive by half its stroke so the bbox actually contains the rendered pixels.
 
LSET KICAD_DIFF::GeometryLayerSet (const DOCUMENT_GEOMETRY &aGeometry)
 Return the union of every non-empty layer set carried by the geometry.
 
DOCUMENT_GEOMETRY KICAD_DIFF::FilterGeometryByVisibleLayers (const DOCUMENT_GEOMETRY &aGeometry, const LSET &aVisibleLayers)
 Copy geometry primitives whose layer set intersects aVisibleLayers.
 
void KICAD_DIFF::AppendGeometry (DOCUMENT_GEOMETRY &aDst, DOCUMENT_GEOMETRY &&aSrc)
 Move all primitives from aSrc into aDst.
 
bool KICAD_DIFF::IsRoutingNetChange (const ITEM_CHANGE &aChange)
 Presentation predicate for PCB routing changes that should be displayed as one net-level entry/shape.
 
wxString KICAD_DIFF::ChangeDisplayLabel (const ITEM_CHANGE &aChange)
 User-facing item label used consistently by scene tooltips and change tree entries.
 
KIGFX::COLOR4D KICAD_DIFF::ThemeColorFor (const DIFF_COLOR_THEME &aTheme, CATEGORY aCategory)
 Map a CATEGORY to its color in a DIFF_COLOR_THEME.
 
DOCUMENT_POLYGON KICAD_DIFF::MakeBBoxOutline (const BOX2I &aBBox, const KIGFX::COLOR4D &aColor, int aLineWidth=0)
 Build a DOCUMENT_POLYGON outlining a bounding box.
 
SHAPE_POLY_SET KICAD_DIFF::PolySetFromPolygonList (const SCENE_SHAPE::PolygonList &aPolygons)
 Build a SHAPE_POLY_SET from a SCENE_SHAPE::PolygonList.
 
void KICAD_DIFF::CollectChangeBBoxes (const DOCUMENT_DIFF &aDiff, std::map< KIID_PATH, BOX2I > &aOut)
 Walk a DOCUMENT_DIFF and populate a (KIID_PATHBOX2I) map with each changed item's bbox, recursing into nested children.
 
const std::vector< SCENE_SHAPE > & KICAD_DIFF::ShapesFor (const DIFF_SCENE &aScene, CATEGORY aCategory)
 Read-only access to a DIFF_SCENE's shape list for a given category.
 
std::optional< BOX2IKICAD_DIFF::HighlightedBBox (const DIFF_SCENE &aScene, const KIID_PATH &aChangeId, const std::array< bool, CATEGORY_COUNT > &aCategoryVisible)
 Union bbox of every visible SCENE_SHAPE whose changeId matches aChangeId.
 

Variables

constexpr std::array< CATEGORY, 4 > KICAD_DIFF::PAINT_ORDER
 Paint order.
 
constexpr std::size_t KICAD_DIFF::CATEGORY_COUNT = PAINT_ORDER.size()