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

Helper class to gather logic relating to the positioning of text in the four pin "slots": More...

Classes

struct  SLOT
 
struct  TEXT_PLACEMENT
 

Public Types

enum  SLOT_ID { INSIDE = 0 , OUTSIDE , ABOVE , BELOW }
 
enum class  SLOT_ROLE { NAME = 0 , NUMBER , ELECTRICAL_TYPE }
 
using const_iterator = std::array< SLOT, 4 >::const_iterator
 

Public Member Functions

 PIN_TEXTS (const SCH_PIN &aPin, float aPenWidth, float aPinTextMargin)
 
const_iterator begin () const
 
const_iterator end () const
 
SLOTGetSlot (SLOT_ID aSlot)
 
const SLOTGetSlot (SLOT_ID aSlot) const
 
void ComputeOffsets ()
 
bool SlotRendersAsBitmap (const SLOT &aSlot, KIGFX::GAL &aGal) const
 
void SetColorOverride (const COLOR4D &aColor)
 Replace all slot colours with a new colour.
 
TEXT_PLACEMENT GetTextPlacement (const PIN_TEXTS::SLOT &aSlot, PIN_ORIENTATION aPinOrientation) const
 

Private Attributes

const SCH_PINm_pin
 
std::array< SLOT, 4 > m_slots
 
std::array< int, 4 > m_offsets
 
const float m_penWidth
 
const float m_pinTextMargin
 

Detailed Description

Helper class to gather logic relating to the positioning of text in the four pin "slots":

       above

inside |-----—x outside below

Definition at line 985 of file sch_painter.cpp.

Member Typedef Documentation

◆ const_iterator

using KIGFX::PIN_TEXTS::const_iterator = std::array<SLOT, 4>::const_iterator

Definition at line 1047 of file sch_painter.cpp.

Member Enumeration Documentation

◆ SLOT_ID

Enumerator
INSIDE 
OUTSIDE 
ABOVE 
BELOW 

Definition at line 988 of file sch_painter.cpp.

◆ SLOT_ROLE

enum class KIGFX::PIN_TEXTS::SLOT_ROLE
strong
Enumerator
NAME 
NUMBER 
ELECTRICAL_TYPE 

Definition at line 996 of file sch_painter.cpp.

Constructor & Destructor Documentation

◆ PIN_TEXTS()

KIGFX::PIN_TEXTS::PIN_TEXTS ( const SCH_PIN aPin,
float  aPenWidth,
float  aPinTextMargin 
)
inline

Definition at line 1040 of file sch_painter.cpp.

Member Function Documentation

◆ begin()

const_iterator KIGFX::PIN_TEXTS::begin ( ) const
inline

Definition at line 1049 of file sch_painter.cpp.

◆ ComputeOffsets()

void KIGFX::PIN_TEXTS::ComputeOffsets ( )
inline

Definition at line 1056 of file sch_painter.cpp.

References INSIDE, OUTSIDE, and TARGET_PIN_RADIUS.

Referenced by KIGFX::SCH_PAINTER::draw().

◆ end()

const_iterator KIGFX::PIN_TEXTS::end ( ) const
inline

Definition at line 1051 of file sch_painter.cpp.

◆ GetSlot() [1/2]

SLOT & KIGFX::PIN_TEXTS::GetSlot ( SLOT_ID  aSlot)
inline

Definition at line 1053 of file sch_painter.cpp.

Referenced by KIGFX::SCH_PAINTER::draw().

◆ GetSlot() [2/2]

const SLOT & KIGFX::PIN_TEXTS::GetSlot ( SLOT_ID  aSlot) const
inline

Definition at line 1054 of file sch_painter.cpp.

◆ GetTextPlacement()

◆ SetColorOverride()

void KIGFX::PIN_TEXTS::SetColorOverride ( const COLOR4D aColor)
inline

Replace all slot colours with a new colour.

Definition at line 1084 of file sch_painter.cpp.

Referenced by KIGFX::SCH_PAINTER::draw().

◆ SlotRendersAsBitmap()

bool KIGFX::PIN_TEXTS::SlotRendersAsBitmap ( const SLOT aSlot,
KIGFX::GAL aGal 
) const
inline

Member Data Documentation

◆ m_offsets

std::array<int, 4> KIGFX::PIN_TEXTS::m_offsets
private

Definition at line 1183 of file sch_painter.cpp.

◆ m_penWidth

const float KIGFX::PIN_TEXTS::m_penWidth
private

Definition at line 1184 of file sch_painter.cpp.

◆ m_pin

const SCH_PIN& KIGFX::PIN_TEXTS::m_pin
private

Definition at line 1181 of file sch_painter.cpp.

◆ m_pinTextMargin

const float KIGFX::PIN_TEXTS::m_pinTextMargin
private

Definition at line 1185 of file sch_painter.cpp.

◆ m_slots

std::array<SLOT, 4> KIGFX::PIN_TEXTS::m_slots
private

Definition at line 1182 of file sch_painter.cpp.


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