KiCad PCB EDA Suite
Loading...
Searching...
No Matches
LAYER_PAIR_SETTINGS Class Reference

Management class for layer pairs in a PCB. More...

#include <layer_pairs.h>

Inheritance diagram for LAYER_PAIR_SETTINGS:

Public Member Functions

 LAYER_PAIR_SETTINGS ()
 Construct a new layer pair manager.
 
 LAYER_PAIR_SETTINGS (const LAYER_PAIR_SETTINGS &aOther)
 
bool AddLayerPair (LAYER_PAIR_INFO aPair)
 
bool RemoveLayerPair (const LAYER_PAIR &aPair)
 Remove the matching layer pair from the store, if present.
 
std::span< const LAYER_PAIR_INFOGetLayerPairs () const
 Returns a span of all stored layer pairs.
 
std::span< LAYER_PAIR_INFOGetLayerPairs ()
 
std::vector< LAYER_PAIR_INFOGetEnabledLayerPairs (int &aCurrentIndex) const
 Get a vector of all enabled layer pairs, in order.
 
void SetLayerPairs (std::span< const LAYER_PAIR_INFO > aPairs)
 Replace the stored layer pairs with the given list.
 
const LAYER_PAIRGetCurrentLayerPair () const
 
void SetCurrentLayerPair (const LAYER_PAIR &aPair)
 Set the "active" layer pair.
 

Private Member Functions

bool addLayerPairInternal (LAYER_PAIR_INFO aPair)
 
bool removeLayerPairInternal (const LAYER_PAIR &aPair)
 

Private Attributes

std::vector< LAYER_PAIR_INFOm_pairs
 
std::optional< LAYER_PAIRm_lastManualPair
 
LAYER_PAIR m_currentPair
 

Detailed Description

Management class for layer pairs in a PCB.

Definition at line 46 of file layer_pairs.h.

Constructor & Destructor Documentation

◆ LAYER_PAIR_SETTINGS() [1/2]

LAYER_PAIR_SETTINGS::LAYER_PAIR_SETTINGS ( )
inline

Construct a new layer pair manager.

Definition at line 52 of file layer_pairs.h.

◆ LAYER_PAIR_SETTINGS() [2/2]

LAYER_PAIR_SETTINGS::LAYER_PAIR_SETTINGS ( const LAYER_PAIR_SETTINGS aOther)

Definition at line 44 of file layer_pairs.cpp.

References m_currentPair, and m_pairs.

Member Function Documentation

◆ AddLayerPair()

bool LAYER_PAIR_SETTINGS::AddLayerPair ( LAYER_PAIR_INFO  aPair)

Definition at line 78 of file layer_pairs.cpp.

References addLayerPairInternal().

Referenced by COPPER_LAYERS_PAIR_PRESETS_UI::OnLayerPairAdded().

◆ addLayerPairInternal()

bool LAYER_PAIR_SETTINGS::addLayerPairInternal ( LAYER_PAIR_INFO  aPair)
private

◆ GetCurrentLayerPair()

◆ GetEnabledLayerPairs()

std::vector< LAYER_PAIR_INFO > LAYER_PAIR_SETTINGS::GetEnabledLayerPairs ( int &  aCurrentIndex) const

Get a vector of all enabled layer pairs, in order.

This includes a "manual" pair, if one is set and isn't in the list of presets.

Definition at line 127 of file layer_pairs.cpp.

References _, LAYER_PAIR::HasSameLayers(), m_currentPair, m_lastManualPair, and m_pairs.

Referenced by PCB_CONTROL::CycleLayerPresets(), and PCB_CONTROL::LayerPresetFeedback().

◆ GetLayerPairs() [1/2]

std::span< LAYER_PAIR_INFO > LAYER_PAIR_SETTINGS::GetLayerPairs ( )

Definition at line 122 of file layer_pairs.cpp.

References m_pairs.

◆ GetLayerPairs() [2/2]

◆ RemoveLayerPair()

bool LAYER_PAIR_SETTINGS::RemoveLayerPair ( const LAYER_PAIR aPair)

Remove the matching layer pair from the store, if present.

Definition at line 107 of file layer_pairs.cpp.

References removeLayerPairInternal().

Referenced by COPPER_LAYERS_PAIR_PRESETS_UI::OnDeleteSelectedLayerPairs().

◆ removeLayerPairInternal()

bool LAYER_PAIR_SETTINGS::removeLayerPairInternal ( const LAYER_PAIR aPair)
private

Definition at line 88 of file layer_pairs.cpp.

References m_pairs.

Referenced by RemoveLayerPair().

◆ SetCurrentLayerPair()

◆ SetLayerPairs()

void LAYER_PAIR_SETTINGS::SetLayerPairs ( std::span< const LAYER_PAIR_INFO aPairs)

Replace the stored layer pairs with the given list.

The same conditions are maintained as for AddLayerPair

Definition at line 163 of file layer_pairs.cpp.

References addLayerPairInternal(), and m_pairs.

Referenced by SELECT_COPPER_LAYERS_PAIR_DIALOG::TransferDataFromWindow().

Member Data Documentation

◆ m_currentPair

LAYER_PAIR LAYER_PAIR_SETTINGS::m_currentPair
private

◆ m_lastManualPair

std::optional<LAYER_PAIR> LAYER_PAIR_SETTINGS::m_lastManualPair
private

Definition at line 103 of file layer_pairs.h.

Referenced by addLayerPairInternal(), GetEnabledLayerPairs(), and SetCurrentLayerPair().

◆ m_pairs

std::vector<LAYER_PAIR_INFO> LAYER_PAIR_SETTINGS::m_pairs
private

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