KiCad PCB EDA Suite
Loading...
Searching...
No Matches
KIGFX::SCH_PAINTER Class Reference

Contains methods for drawing schematic-specific items. More...

#include <sch_painter.h>

Inheritance diagram for KIGFX::SCH_PAINTER:
KIGFX::PAINTER

Public Member Functions

 SCH_PAINTER (GAL *aGal)
 
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. More...
 
virtual SCH_RENDER_SETTINGSGetSettings () override
 Return a pointer to current settings that are going to be used when drawing items. More...
 
void SetSchematic (SCHEMATIC *aSchematic)
 
void SetGAL (GAL *aGal)
 Changes Graphics Abstraction Layer used for drawing items for a new one. More...
 

Static Public Attributes

static std::vector< KICAD_Tg_ScaledSelectionTypes
 

Protected Attributes

GALm_gal
 Instance of graphic abstraction layer that gives an interface to call commands used to draw (eg. More...
 

Private Member Functions

void draw (const EDA_ITEM *, int, bool aDimmed)
 
void draw (const LIB_PIN *aPin, int aLayer, bool aDimmed)
 
void draw (const LIB_SHAPE *aCircle, int aLayer, bool aDimmed)
 
void draw (const LIB_SYMBOL *aSymbol, int, bool aDrawFields=true, int aUnit=0, int aConvert=0, bool aDimmed=false)
 
void draw (const LIB_FIELD *aField, int aLayer, bool aDimmed)
 
void draw (const LIB_TEXT *aText, int aLayer, bool aDimmed)
 
void draw (const LIB_TEXTBOX *aTextBox, int aLayer, bool aDimmed)
 
void draw (const SCH_SYMBOL *aSymbol, int aLayer)
 
void draw (const SCH_JUNCTION *aJct, int aLayer)
 
void draw (const SCH_FIELD *aField, int aLayer, bool aDimmed)
 
void draw (const SCH_SHAPE *aShape, int aLayer)
 
void draw (const SCH_TEXTBOX *aTextBox, int aLayer)
 
void draw (const SCH_TEXT *aText, int aLayer)
 
void draw (const SCH_LABEL *aText, int aLayer)
 
void draw (const SCH_DIRECTIVE_LABEL *aLabel, int aLayer)
 
void draw (const SCH_HIERLABEL *aLabel, int aLayer)
 
void draw (const SCH_GLOBALLABEL *aLabel, int aLayer)
 
void draw (const SCH_SHEET *aSheet, int aLayer)
 
void draw (const SCH_NO_CONNECT *aNC, int aLayer)
 
void draw (const SCH_MARKER *aMarker, int aLayer)
 
void draw (const SCH_BITMAP *aBitmap, int aLayer)
 
void draw (const SCH_LINE *aLine, int aLayer)
 
void draw (const SCH_BUS_ENTRY_BASE *aEntry, int aLayer)
 
void drawPinDanglingSymbol (const VECTOR2I &aPos, const COLOR4D &aColor, bool aDrawingShadows, bool aBrightened)
 
void drawDanglingSymbol (const VECTOR2I &aPos, const COLOR4D &aColor, int aWidth, bool aDangling, bool aDrawingShadows, bool aBrightened)
 
int internalPinDecoSize (const LIB_PIN &aPin)
 
int externalPinDecoSize (const LIB_PIN &aPin)
 
bool nonCached (const EDA_ITEM *aItem)
 
bool isUnitAndConversionShown (const LIB_ITEM *aItem) const
 
float getShadowWidth (bool aForHighlight) const
 
COLOR4D getRenderColor (const EDA_ITEM *aItem, int aLayer, bool aDrawingShadows, bool aDimmed=false) const
 
KIFONT::FONTgetFont (const EDA_TEXT *aText) const
 
float getLineWidth (const EDA_ITEM *aItem, bool aDrawingShadows) const
 
float getTextThickness (const EDA_ITEM *aItem) const
 
int getOperatingPointTextSize () const
 
bool setDeviceColors (const LIB_ITEM *aItem, int aLayer, bool aDimmed)
 
void triLine (const VECTOR2D &a, const VECTOR2D &b, const VECTOR2D &c)
 
void strokeText (const wxString &aText, const VECTOR2D &aPosition, const TEXT_ATTRIBUTES &aAttributes, const KIFONT::METRICS &aFontMetrics)
 
void bitmapText (const wxString &aText, const VECTOR2D &aPosition, const TEXT_ATTRIBUTES &aAttributes)
 
void knockoutText (const wxString &aText, const VECTOR2D &aPosition, const TEXT_ATTRIBUTES &aAttrs, const KIFONT::METRICS &aFontMetrics)
 
void boxText (const wxString &aText, const VECTOR2D &aPosition, const TEXT_ATTRIBUTES &aAttrs, const KIFONT::METRICS &aFontMetrics)
 
wxString expandLibItemTextVars (const wxString &aSourceText, const SCH_SYMBOL *aSymbolContext)
 

Private Attributes

SCH_RENDER_SETTINGS m_schSettings
 
SCHEMATICm_schematic
 

Detailed Description

Contains methods for drawing schematic-specific items.

Definition at line 133 of file sch_painter.h.

Constructor & Destructor Documentation

◆ SCH_PAINTER()

KIGFX::SCH_PAINTER::SCH_PAINTER ( GAL aGal)

Definition at line 190 of file sch_painter.cpp.

Member Function Documentation

◆ bitmapText()

void KIGFX::SCH_PAINTER::bitmapText ( const wxString &  aText,
const VECTOR2D aPosition,
const TEXT_ATTRIBUTES aAttributes 
)
private

◆ boxText()

◆ draw() [1/23]

◆ draw() [2/23]

◆ draw() [3/23]

void KIGFX::SCH_PAINTER::draw ( const LIB_PIN aPin,
int  aLayer,
bool  aDimmed 
)
private

Definition at line 1340 of file sch_painter.cpp.

References ANGLE_HORIZONTAL, ANGLE_VERTICAL, BITMAP_FONT_SIZE_THRESHOLD, Clamp_Text_PenSize(), CLOCK, CLOCK_LOW, color, KIGFX::eeconfig(), externalPinDecoSize(), FALLING_EDGE_CLOCK, LIB_PIN::GetElectricalTypeName(), KIFONT::FONT::GetFont(), LIB_ITEM::GetFontMetrics(), LIB_PIN::GetLength(), LIB_PIN::GetNameTextSize(), LIB_PIN::GetNumberTextSize(), LIB_PIN::GetOperatingPoint(), LIB_PIN::GetOrientation(), LIB_ITEM::GetParent(), GetPenSizeForDemiBold(), LIB_SYMBOL::GetPinNameOffset(), LIB_PIN::GetPosition(), LIB_PIN::GetShape(), LIB_PIN::GetShownName(), LIB_PIN::GetShownNumber(), LIB_PIN::GetType(), GR_TEXT_H_ALIGN_CENTER, GR_TEXT_H_ALIGN_LEFT, GR_TEXT_H_ALIGN_RIGHT, GR_TEXT_V_ALIGN_BOTTOM, GR_TEXT_V_ALIGN_CENTER, GR_TEXT_V_ALIGN_TOP, EDA_ITEM::HasFlag(), INPUT_LOW, internalPinDecoSize(), INVERTED, INVERTED_CLOCK, IS_DANGLING, IS_SHOWN_AS_BITMAP, EDA_ITEM::IsBrightened(), KIFONT::FONT::IsOutline(), EDA_ITEM::IsSelected(), LIB_PIN::IsVisible(), KiROUND(), LAYER_DANGLING, LAYER_HIDDEN, LAYER_OP_CURRENTS, LAYER_PIN, LAYER_PINNAM, LAYER_PINNUM, LAYER_PRIVATE_NOTES, LAYER_SELECTION_SHADOWS, LIB_SYMBOL_T, LINE, TEXT_ATTRIBUTES::m_Angle, TEXT_ATTRIBUTES::m_Color, TEXT_ATTRIBUTES::m_Font, TEXT_ATTRIBUTES::m_Halign, TEXT_ATTRIBUTES::m_Size, TEXT_ATTRIBUTES::m_StrokeWidth, TEXT_ATTRIBUTES::m_Valign, mapCoords(), EDA_IU_SCALE::MilsToIU(), EDA_IU_SCALE::mmToIU(), NONLOGIC, OUTPUT_LOW, OUTSIDE, PIN_DOWN, PIN_LEFT, PIN_RIGHT, PIN_TEXT_MARGIN, PIN_UP, PT_NC, schIUScale, LIB_SYMBOL::ShowPinNames(), LIB_SYMBOL::ShowPinNumbers(), TARGET_PIN_RADIUS, text, EDA_ITEM::Type(), VECTOR2< T >::x, and VECTOR2< T >::y.

◆ draw() [4/23]

◆ draw() [5/23]

void KIGFX::SCH_PAINTER::draw ( const LIB_SYMBOL aSymbol,
int  aLayer,
bool  aDrawFields = true,
int  aUnit = 0,
int  aConvert = 0,
bool  aDimmed = false 
)
private

◆ draw() [6/23]

◆ draw() [7/23]

◆ draw() [8/23]

◆ draw() [9/23]

◆ draw() [10/23]

◆ draw() [11/23]

◆ draw() [12/23]

◆ draw() [13/23]

◆ draw() [14/23]

void KIGFX::SCH_PAINTER::draw ( const SCH_JUNCTION aJct,
int  aLayer 
)
private

◆ draw() [15/23]

◆ draw() [16/23]

◆ draw() [17/23]

void KIGFX::SCH_PAINTER::draw ( const SCH_MARKER aMarker,
int  aLayer 
)
private

◆ draw() [18/23]

void KIGFX::SCH_PAINTER::draw ( const SCH_NO_CONNECT aNC,
int  aLayer 
)
private

◆ draw() [19/23]

◆ draw() [20/23]

void KIGFX::SCH_PAINTER::draw ( const SCH_SHEET aSheet,
int  aLayer 
)
private

◆ draw() [21/23]

◆ draw() [22/23]

◆ draw() [23/23]

◆ Draw()

bool KIGFX::SCH_PAINTER::Draw ( const VIEW_ITEM aItem,
int  aLayer 
)
overridevirtual

Takes an instance of VIEW_ITEM and passes it to a function that knows how to draw the item.

Parameters
aItemis an item to be drawn.
aLayertells which layer is currently rendered so that draw functions may know what to draw (eg. for pads there are separate layers for holes, because they have other dimensions then the pad itself.

Implements KIGFX::PAINTER.

Definition at line 195 of file sch_painter.cpp.

References draw().

◆ drawDanglingSymbol()

void KIGFX::SCH_PAINTER::drawDanglingSymbol ( const VECTOR2I aPos,
const COLOR4D aColor,
int  aWidth,
bool  aDangling,
bool  aDrawingShadows,
bool  aBrightened 
)
private

◆ drawPinDanglingSymbol()

void KIGFX::SCH_PAINTER::drawPinDanglingSymbol ( const VECTOR2I aPos,
const COLOR4D aColor,
bool  aDrawingShadows,
bool  aBrightened 
)
private

Definition at line 1324 of file sch_painter.cpp.

References KIGFX::COLOR4D::Brightened(), and TARGET_PIN_RADIUS.

◆ expandLibItemTextVars()

wxString KIGFX::SCH_PAINTER::expandLibItemTextVars ( const wxString &  aSourceText,
const SCH_SYMBOL aSymbolContext 
)
private

Definition at line 2408 of file sch_painter.cpp.

References ExpandTextVars(), and SCH_SYMBOL::ResolveTextVar().

◆ externalPinDecoSize()

int KIGFX::SCH_PAINTER::externalPinDecoSize ( const LIB_PIN aPin)
private

Definition at line 1314 of file sch_painter.cpp.

References LIB_PIN::GetNumberTextSize().

◆ getFont()

KIFONT::FONT * KIGFX::SCH_PAINTER::getFont ( const EDA_TEXT aText) const
private

◆ getLineWidth()

float KIGFX::SCH_PAINTER::getLineWidth ( const EDA_ITEM aItem,
bool  aDrawingShadows 
) const
private

◆ getOperatingPointTextSize()

int KIGFX::SCH_PAINTER::getOperatingPointTextSize ( ) const
private

Definition at line 582 of file sch_painter.cpp.

References std::abs(), KiROUND(), EDA_IU_SCALE::MilsToIU(), and schIUScale.

◆ getRenderColor()

◆ GetSettings()

virtual SCH_RENDER_SETTINGS * KIGFX::SCH_PAINTER::GetSettings ( )
inlineoverridevirtual

Return a pointer to current settings that are going to be used when drawing items.

Returns
Current rendering settings.

Implements KIGFX::PAINTER.

Definition at line 142 of file sch_painter.h.

References m_schSettings.

◆ getShadowWidth()

◆ getTextThickness()

◆ internalPinDecoSize()

int KIGFX::SCH_PAINTER::internalPinDecoSize ( const LIB_PIN aPin)
private

Definition at line 1303 of file sch_painter.cpp.

References LIB_PIN::GetNameTextSize(), and LIB_PIN::GetNumberTextSize().

◆ isUnitAndConversionShown()

bool KIGFX::SCH_PAINTER::isUnitAndConversionShown ( const LIB_ITEM aItem) const
private

◆ knockoutText()

◆ nonCached()

bool KIGFX::SCH_PAINTER::nonCached ( const EDA_ITEM aItem)
private

Definition at line 325 of file sch_painter.cpp.

References EDA_ITEM::IsSelected().

◆ setDeviceColors()

◆ SetGAL()

void KIGFX::PAINTER::SetGAL ( GAL aGal)
inlineinherited

Changes Graphics Abstraction Layer used for drawing items for a new one.

Parameters
aGalis the new GAL instance.

Definition at line 75 of file painter.h.

References KIGFX::PAINTER::m_gal.

◆ SetSchematic()

void KIGFX::SCH_PAINTER::SetSchematic ( SCHEMATIC aSchematic)
inline

Definition at line 144 of file sch_painter.h.

References m_schematic.

◆ strokeText()

void KIGFX::SCH_PAINTER::strokeText ( const wxString &  aText,
const VECTOR2D aPosition,
const TEXT_ATTRIBUTES aAttributes,
const KIFONT::METRICS aFontMetrics 
)
private

◆ triLine()

void KIGFX::SCH_PAINTER::triLine ( const VECTOR2D a,
const VECTOR2D b,
const VECTOR2D c 
)
private

Definition at line 732 of file sch_painter.cpp.

Member Data Documentation

◆ g_ScaledSelectionTypes

std::vector< KICAD_T > KIGFX::SCH_PAINTER::g_ScaledSelectionTypes
static
Initial value:
= {
}
@ SCH_LINE_T
Definition: typeinfo.h:145
@ LIB_SYMBOL_T
Definition: typeinfo.h:197
@ SCH_NO_CONNECT_T
Definition: typeinfo.h:142
@ SCH_SYMBOL_T
Definition: typeinfo.h:155
@ SCH_FIELD_T
Definition: typeinfo.h:154
@ SCH_DIRECTIVE_LABEL_T
Definition: typeinfo.h:153
@ SCH_SHEET_T
Definition: typeinfo.h:157
@ LIB_SHAPE_T
Definition: typeinfo.h:198
@ SCH_MARKER_T
Definition: typeinfo.h:140
@ SCH_SHAPE_T
Definition: typeinfo.h:146
@ SCH_HIER_LABEL_T
Definition: typeinfo.h:152
@ SCH_BUS_BUS_ENTRY_T
Definition: typeinfo.h:144
@ LIB_PIN_T
Definition: typeinfo.h:201
@ SCH_SHEET_PIN_T
Definition: typeinfo.h:156
@ SCH_TEXT_T
Definition: typeinfo.h:149
@ SCH_BUS_WIRE_ENTRY_T
Definition: typeinfo.h:143
@ SCH_BITMAP_T
Definition: typeinfo.h:147
@ SCH_GLOBAL_LABEL_T
Definition: typeinfo.h:151
@ SCH_JUNCTION_T
Definition: typeinfo.h:141
@ SCH_PIN_T
Definition: typeinfo.h:158

Definition at line 209 of file sch_painter.h.

Referenced by SCH_BASE_FRAME::RefreshZoomDependentItems().

◆ m_gal

GAL* KIGFX::PAINTER::m_gal
protectedinherited

◆ m_schematic

SCHEMATIC* KIGFX::SCH_PAINTER::m_schematic
private

Definition at line 213 of file sch_painter.h.

Referenced by SetSchematic().

◆ m_schSettings

SCH_RENDER_SETTINGS KIGFX::SCH_PAINTER::m_schSettings
private

Definition at line 212 of file sch_painter.h.

Referenced by draw(), getFont(), getRenderColor(), GetSettings(), and isUnitAndConversionShown().


The documentation for this class was generated from the following files: