KiCad PCB EDA Suite
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
LENGTH_CALCULATION_ITEM Class Reference

Lightweight class which holds a pad, via, or a routed trace outline. More...

#include <length_calculation.h>

Public Types

enum class  TYPE { UNKNOWN , PAD , LINE , VIA }
 The type of routing object this item proxies. More...
 
enum class  MERGE_STATUS { UNMERGED , MERGED_IN_USE , MERGED_RETIRED }
 Whether this item is UNMERGED, it has been merged and should be used (MERGED_IN_USE), or it has been merged and has been retired from use (MERGED_RETIRED). More...
 

Public Member Functions

TYPE Type () const
 Gets the routing item type.
 
void SetPad (PAD *aPad)
 Sets the parent PAD associated with this item.
 
PADGetPad () const
 Gets the parent PAD associated with this item.
 
void SetLine (const SHAPE_LINE_CHAIN &aLine)
 Sets the source SHAPE_LINE_CHAIN of this item.
 
SHAPE_LINE_CHAINGetLine () const
 Gets the SHAPE_LINE_CHAIN associated with this item.
 
void SetVia (PCB_VIA *aVia)
 Sets the VIA associated with this item.
 
PCB_VIAGetVia () const
 Gets the VIA associated with this item.
 
void SetLayers (const PCB_LAYER_ID aStart, const PCB_LAYER_ID aEnd=PCB_LAYER_ID::UNDEFINED_LAYER)
 Sets the first and last layers associated with this item.
 
void SetMergeStatus (const MERGE_STATUS aStatus)
 Sets the MERGE_STATUS of this item.
 
MERGE_STATUS GetMergeStatus () const
 Gets the MERGE_STATUS of this item.
 
std::tuple< PCB_LAYER_ID, PCB_LAYER_IDGetLayers () const
 Gets the upper and lower layers for the proxied item.
 
PCB_LAYER_ID GetStartLayer () const
 Gets the start board layer for the proxied item.
 
PCB_LAYER_ID GetEndLayer () const
 Gets the end board layer for the proxied item.
 
void CalculateViaLayers (const BOARD *aBoard)
 Calculates active via payers for a proxied VIA object.
 

Protected Attributes

PADm_pad { nullptr }
 A proxied PAD object. Set to nullptr if not proxying a PAD.
 
SHAPE_LINE_CHAIN m_line
 A proxied SHAPE_LINE_CHAIN object. Line is empty if not proxying a SHAPE_LINE_CHAIN.
 
PCB_VIAm_via { nullptr }
 A proxied PVIAAD object. Set to nullptr if not proxying a VIA.
 
PCB_LAYER_ID m_layerStart { PCB_LAYER_ID::UNDEFINED_LAYER }
 The start board layer for the proxied object.
 
PCB_LAYER_ID m_layerEnd { PCB_LAYER_ID::UNDEFINED_LAYER }
 The end board layer for the proxied object.
 
MERGE_STATUS m_mergeStatus { MERGE_STATUS::UNMERGED }
 Flags whether this item has already been merged with another.
 
TYPE m_type { TYPE::UNKNOWN }
 The routing object type of the proxied parent.
 

Detailed Description

Lightweight class which holds a pad, via, or a routed trace outline.

Proxied objects passed by pointer are not owned by this container.

Definition at line 41 of file length_calculation.h.

Member Enumeration Documentation

◆ MERGE_STATUS

Whether this item is UNMERGED, it has been merged and should be used (MERGED_IN_USE), or it has been merged and has been retired from use (MERGED_RETIRED).

MERGED_RETIRED essentially means the object has been merged in to a MERGED_IN_USE item.

Enumerator
UNMERGED 
MERGED_IN_USE 
MERGED_RETIRED 

Definition at line 56 of file length_calculation.h.

◆ TYPE

enum class LENGTH_CALCULATION_ITEM::TYPE
strong

The type of routing object this item proxies.

Enumerator
UNKNOWN 
PAD 
LINE 
VIA 

Definition at line 45 of file length_calculation.h.

Member Function Documentation

◆ CalculateViaLayers()

void LENGTH_CALCULATION_ITEM::CalculateViaLayers ( const BOARD aBoard)

◆ GetEndLayer()

PCB_LAYER_ID LENGTH_CALCULATION_ITEM::GetEndLayer ( ) const
inline

Gets the end board layer for the proxied item.

Definition at line 117 of file length_calculation.h.

References m_layerEnd.

◆ GetLayers()

std::tuple< PCB_LAYER_ID, PCB_LAYER_ID > LENGTH_CALCULATION_ITEM::GetLayers ( ) const
inline

Gets the upper and lower layers for the proxied item.

Definition at line 111 of file length_calculation.h.

References m_layerEnd, and m_layerStart.

◆ GetLine()

SHAPE_LINE_CHAIN & LENGTH_CALCULATION_ITEM::GetLine ( ) const
inline

Gets the SHAPE_LINE_CHAIN associated with this item.

Definition at line 84 of file length_calculation.h.

References m_line.

Referenced by LENGTH_CALCULATION::mergeLines().

◆ GetMergeStatus()

MERGE_STATUS LENGTH_CALCULATION_ITEM::GetMergeStatus ( ) const
inline

Gets the MERGE_STATUS of this item.

Definition at line 108 of file length_calculation.h.

References m_mergeStatus.

◆ GetPad()

PAD * LENGTH_CALCULATION_ITEM::GetPad ( ) const
inline

Gets the parent PAD associated with this item.

Definition at line 74 of file length_calculation.h.

References m_pad.

Referenced by LENGTH_CALCULATION::optimiseViaLayers().

◆ GetStartLayer()

PCB_LAYER_ID LENGTH_CALCULATION_ITEM::GetStartLayer ( ) const
inline

Gets the start board layer for the proxied item.

Definition at line 114 of file length_calculation.h.

References m_layerStart.

Referenced by LENGTH_CALCULATION::inferViaInPad(), LENGTH_CALCULATION::mergeLines(), and LENGTH_CALCULATION::optimiseViaLayers().

◆ GetVia()

PCB_VIA * LENGTH_CALCULATION_ITEM::GetVia ( ) const
inline

Gets the VIA associated with this item.

Definition at line 94 of file length_calculation.h.

References m_via.

◆ SetLayers()

void LENGTH_CALCULATION_ITEM::SetLayers ( const PCB_LAYER_ID  aStart,
const PCB_LAYER_ID  aEnd = PCB_LAYER_ID::UNDEFINED_LAYER 
)
inline

◆ SetLine()

void LENGTH_CALCULATION_ITEM::SetLine ( const SHAPE_LINE_CHAIN aLine)
inline

◆ SetMergeStatus()

void LENGTH_CALCULATION_ITEM::SetMergeStatus ( const MERGE_STATUS  aStatus)
inline

Sets the MERGE_STATUS of this item.

MERGED_RETIRED essentially means the object has been merged in to a MERGED_IN_USE item.

Definition at line 105 of file length_calculation.h.

References m_mergeStatus.

Referenced by LENGTH_CALCULATION::mergeLines().

◆ SetPad()

void LENGTH_CALCULATION_ITEM::SetPad ( PAD aPad)
inline

Sets the parent PAD associated with this item.

Definition at line 67 of file length_calculation.h.

References m_pad, and m_type.

Referenced by LENGTH_CALCULATION::GetLengthCalculationItem().

◆ SetVia()

void LENGTH_CALCULATION_ITEM::SetVia ( PCB_VIA aVia)
inline

◆ Type()

TYPE LENGTH_CALCULATION_ITEM::Type ( ) const
inline

Gets the routing item type.

Definition at line 64 of file length_calculation.h.

References m_type.

Referenced by BOARD::GetTrackLength(), LENGTH_CALCULATION::inferViaInPad(), and DRC_TEST_PROVIDER_MATCHED_LENGTH::runInternal().

Member Data Documentation

◆ m_layerEnd

PCB_LAYER_ID LENGTH_CALCULATION_ITEM::m_layerEnd { PCB_LAYER_ID::UNDEFINED_LAYER }
protected

The end board layer for the proxied object.

Definition at line 136 of file length_calculation.h.

Referenced by GetEndLayer(), GetLayers(), and SetLayers().

◆ m_layerStart

PCB_LAYER_ID LENGTH_CALCULATION_ITEM::m_layerStart { PCB_LAYER_ID::UNDEFINED_LAYER }
protected

The start board layer for the proxied object.

Definition at line 133 of file length_calculation.h.

Referenced by GetLayers(), GetStartLayer(), and SetLayers().

◆ m_line

SHAPE_LINE_CHAIN LENGTH_CALCULATION_ITEM::m_line
mutableprotected

A proxied SHAPE_LINE_CHAIN object. Line is empty if not proxying a SHAPE_LINE_CHAIN.

Definition at line 127 of file length_calculation.h.

Referenced by GetLine(), and SetLine().

◆ m_mergeStatus

MERGE_STATUS LENGTH_CALCULATION_ITEM::m_mergeStatus { MERGE_STATUS::UNMERGED }
protected

Flags whether this item has already been merged with another.

Definition at line 139 of file length_calculation.h.

Referenced by GetMergeStatus(), and SetMergeStatus().

◆ m_pad

PAD* LENGTH_CALCULATION_ITEM::m_pad { nullptr }
protected

A proxied PAD object. Set to nullptr if not proxying a PAD.

Definition at line 124 of file length_calculation.h.

Referenced by GetPad(), and SetPad().

◆ m_type

TYPE LENGTH_CALCULATION_ITEM::m_type { TYPE::UNKNOWN }
protected

The routing object type of the proxied parent.

Definition at line 142 of file length_calculation.h.

Referenced by SetLine(), SetPad(), SetVia(), and Type().

◆ m_via

PCB_VIA* LENGTH_CALCULATION_ITEM::m_via { nullptr }
protected

A proxied PVIAAD object. Set to nullptr if not proxying a VIA.

Definition at line 130 of file length_calculation.h.

Referenced by CalculateViaLayers(), GetVia(), and SetVia().


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