34 SCH_DIFF_PAINTER( KIGFX::GAL* aGal, std::map<KIID, KIGFX::COLOR4D> aOverrides ) :
35 KIGFX::SCH_PAINTER( aGal ),
36 m_overrides( std::
move( aOverrides ) )
40 bool Draw(
const KIGFX::VIEW_ITEM* aItem,
int aLayer )
override
42 const EDA_ITEM* edaItem =
dynamic_cast<const EDA_ITEM*
>( aItem );
46 auto it = m_overrides.find( edaItem->
m_Uuid );
48 if( it != m_overrides.end() )
50 SCH_RENDER_SETTINGS* settings = GetSettings();
65 std::map<KIID, KIGFX::COLOR4D> m_overrides;
76 std::vector<KIGFX::VIEW_ITEM*> items;
83 items.push_back( item );
112 std::map<KIID, KIGFX::COLOR4D> aOverrides )
114 auto painter = std::make_unique<SCH_DIFF_PAINTER>( aGal, std::move( aOverrides ) );
115 painter->SetSchematic( aSchematic );
123 const KIGFX::COLOR4D& aColor,
const std::map<KIID, KIGFX::COLOR4D>& aOverrides,
124 const std::vector<KIGFX::VIEW_ITEM*>& aExtraItems,
125 const std::map<KIID, KICAD_DIFF::CATEGORY>& aCategories,
131 std::vector<KIGFX::VIEW_ITEM*> items;
136 items.insert( items.end(), refItems.begin(), refItems.end() );
142 items.insert( items.end(), compItems.begin(), compItems.end() );
145 items.insert( items.end(), aExtraItems.begin(), aExtraItems.end() );
154 const bool brighten = aOverrides.count( schItem->
m_Uuid ) > 0;
171 pin->SetBrightened();
173 pin->ClearBrightened();
176 for(
SCH_FIELD& field : sym->GetFields() )
179 field.SetBrightened();
181 field.ClearBrightened();
196 const bool inOverride = overrides.count( sch->
m_Uuid ) > 0;
197 const bool brighten = !aDim && inOverride;
199 auto apply = [brighten](
EDA_ITEM* aEdaItem )
202 aEdaItem->SetBrightened();
204 aEdaItem->ClearBrightened();
217 for(
SCH_FIELD& field : sym->GetFields() )
222 std::map<KIGFX::VIEW_ITEM*, KICAD_DIFF::CATEGORY> itemCategories;
231 auto it = aCategories.find( schItem->
m_Uuid );
233 if( it != aCategories.end() )
234 itemCategories[viewItem] = it->second;
KIGFX::GAL * GetGAL() const
Return a pointer to the GAL instance used in the panel.
A base class for most all the KiCad significant classes used in schematics and boards.
A color representation with 4 components: red, green, blue, alpha.
Abstract interface for drawing on a 2D-surface.
void SetLayerColor(int aLayer, const COLOR4D &aColor)
Change the color used to draw a layer.
void SetHighContrast(bool aEnabled)
Turns on/off high contrast display mode.
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
void SetHighlight(bool aEnabled, int aNetcode=-1, bool aMulti=false)
Turns on/off highlighting.
Contains methods for drawing schematic-specific items.
virtual bool Draw(const VIEW_ITEM *, int) override
Takes an instance of VIEW_ITEM and passes it to a function that knows how to draw the item.
An abstract base class for deriving all objects that can be added to a VIEW.
Holds all the data relating to one schematic.
SCH_SCREEN * RootScreen() const
Helper to retrieve the screen of the root sheet.
Base class for any item which can be embedded within the SCHEMATIC container class,...
bool m_OverrideItemColors
void SetBackgroundColor(const COLOR4D &aColor) override
Set the background color.
bool m_ShowPinsElectricalType
EE_RTREE & Items()
Get the full RTree, usually for iterating.
#define LAYER_ID_COUNT
Must update this if you add any enums after Gerbview!
void ConfigureSchDiffCanvasContext(WIDGET_DIFF_CANVAS &aCanvas, SCHEMATIC *aReference, SCHEMATIC *aComparison, const KIGFX::COLOR4D &aColor, const std::map< KIID, KIGFX::COLOR4D > &aOverrides, const std::vector< KIGFX::VIEW_ITEM * > &aExtraItems, const std::map< KIID, KICAD_DIFF::CATEGORY > &aCategories, SCH_SCREEN *aReferenceScreen, SCH_SCREEN *aComparisonScreen)
void ConfigureSchDiffContextRenderSettings(SCH_RENDER_SETTINGS &aSettings, const KIGFX::COLOR4D &aColor)
std::vector< KIGFX::VIEW_ITEM * > CollectSchematicDiffContextItems(SCHEMATIC &aSchematic, SCH_SCREEN *aScreen)
std::unique_ptr< KIGFX::PAINTER > MakeSchDiffContextPainter(KIGFX::GAL *aGal, SCHEMATIC *aSchematic, const KIGFX::COLOR4D &aColor, std::map< KIID, KIGFX::COLOR4D > aOverrides)
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
wxString result
Test unit parsing edge cases and error handling.