KiCad PCB EDA Suite
GAL_SET Class Reference

Helper for storing and iterating over GAL_LAYER_IDs. More...

#include <layer_ids.h>

Inheritance diagram for GAL_SET:

Public Member Functions

 GAL_SET ()
 
 GAL_SET (const GAL_SET &aOther)
 
 GAL_SET (const GAL_LAYER_ID *aArray, unsigned aCount)
 
GAL_SETset ()
 
GAL_SETset (int aPos, bool aVal=true)
 
GAL_SETset (GAL_LAYER_ID aPos, bool aVal=true)
 
bool Contains (GAL_LAYER_ID aPos)
 
std::vector< GAL_LAYER_IDSeq () const
 

Static Public Member Functions

static GAL_SET DefaultVisible ()
 

Static Private Attributes

static constexpr int start = static_cast<int>( GAL_LAYER_ID_START )
 

Detailed Description

Helper for storing and iterating over GAL_LAYER_IDs.

Definition at line 295 of file layer_ids.h.

Constructor & Destructor Documentation

◆ GAL_SET() [1/3]

GAL_SET::GAL_SET ( )
inline

Definition at line 301 of file layer_ids.h.

301 : std::bitset<GAL_LAYER_ID_COUNT>()
302 {
303 }

◆ GAL_SET() [2/3]

GAL_SET::GAL_SET ( const GAL_SET aOther)
inline

Definition at line 305 of file layer_ids.h.

305 : std::bitset<GAL_LAYER_ID_COUNT>( aOther )
306 {
307 }

◆ GAL_SET() [3/3]

GAL_SET::GAL_SET ( const GAL_LAYER_ID aArray,
unsigned  aCount 
)

Definition at line 939 of file lset.cpp.

939 : GAL_SET()
940{
941 for( unsigned i = 0; i < aCount; ++i )
942 set( aArray[i] );
943}
GAL_SET()
Definition: layer_ids.h:301
GAL_SET & set()
Definition: layer_ids.h:311

References set().

Member Function Documentation

◆ Contains()

bool GAL_SET::Contains ( GAL_LAYER_ID  aPos)
inline

◆ DefaultVisible()

GAL_SET GAL_SET::DefaultVisible ( )
static

Definition at line 960 of file lset.cpp.

961{
962 static const GAL_LAYER_ID visible[] = {
969 // LAYER_MOD_TEXT_INVISIBLE, // Invisible text hidden by default
988 // LAYER_DRC_EXCLUSION, // DRC exclusions hidden by default
1000 };
1001
1002 static const GAL_SET saved( visible, arrayDim( visible ) );
1003 return saved;
1004}
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Returns # of elements in an array.
Definition: arraydim.h:31
Helper for storing and iterating over GAL_LAYER_IDs.
Definition: layer_ids.h:296
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
Definition: layer_ids.h:190
@ LAYER_GRID
Definition: layer_ids.h:205
@ LAYER_LOCKED_ITEM_SHADOW
shadow layer for locked items
Definition: layer_ids.h:239
@ LAYER_VIA_HOLEWALLS
Definition: layer_ids.h:234
@ LAYER_GRID_AXES
Definition: layer_ids.h:206
@ LAYER_CONFLICTS_SHADOW
shadow layer for items flagged conficting
Definition: layer_ids.h:241
@ LAYER_NON_PLATEDHOLES
handle color for not plated holes (holes, not pads)
Definition: layer_ids.h:197
@ LAYER_PAD_FR
smd pads, front layer
Definition: layer_ids.h:202
@ LAYER_DRAWINGSHEET
drawingsheet frame and titleblock
Definition: layer_ids.h:217
@ LAYER_DRAW_BITMAPS
to handle and draw images bitmaps
Definition: layer_ids.h:223
@ LAYER_MOD_TEXT
Definition: layer_ids.h:198
@ LAYER_PCB_BACKGROUND
PCB background color.
Definition: layer_ids.h:220
@ LAYER_ZONES
Control for copper zone opacity/visibility (color ignored)
Definition: layer_ids.h:231
@ LAYER_PADS
Meta control for all pads opacity/visibility (color ignored)
Definition: layer_ids.h:230
@ LAYER_DRC_WARNING
layer for drc markers with SEVERITY_WARNING
Definition: layer_ids.h:235
@ LAYER_PAD_PLATEDHOLES
to draw pad holes (plated)
Definition: layer_ids.h:214
@ LAYER_GP_OVERLAY
general purpose overlay
Definition: layer_ids.h:218
@ LAYER_TRACKS
Definition: layer_ids.h:212
@ LAYER_CURSOR
PCB cursor.
Definition: layer_ids.h:221
@ LAYER_AUX_ITEMS
Auxiliary items (guides, rule, etc)
Definition: layer_ids.h:222
@ LAYER_RATSNEST
Definition: layer_ids.h:204
@ LAYER_MOD_FR
show footprints on front
Definition: layer_ids.h:208
@ LAYER_ANCHOR
anchor of items having an anchor point (texts, footprints)
Definition: layer_ids.h:201
@ LAYER_PAD_BK
smd pads, back layer
Definition: layer_ids.h:203
@ LAYER_MOD_VALUES
show footprints values (when texts are visible)
Definition: layer_ids.h:210
@ LAYER_PADS_TH
multilayer pads, usually with holes
Definition: layer_ids.h:213
@ LAYER_VIA_HOLES
to draw via holes (pad holes do not use this layer)
Definition: layer_ids.h:215
@ LAYER_VIA_MICROVIA
to draw micro vias
Definition: layer_ids.h:194
@ LAYER_SELECT_OVERLAY
currently selected items overlay
Definition: layer_ids.h:219
@ LAYER_VIA_THROUGH
to draw usual through hole vias
Definition: layer_ids.h:196
@ LAYER_DRC_ERROR
layer for drc markers with SEVERITY_ERROR
Definition: layer_ids.h:216
@ LAYER_VIAS
Meta control for all vias opacity/visibility.
Definition: layer_ids.h:193
@ LAYER_MOD_BK
show footprints on back
Definition: layer_ids.h:209
@ LAYER_MOD_REFERENCES
show footprints references (when texts are visible)
Definition: layer_ids.h:211
@ LAYER_VIA_BBLIND
to draw blind/buried vias
Definition: layer_ids.h:195
@ LAYER_PAD_HOLEWALLS
Definition: layer_ids.h:233

References arrayDim(), LAYER_ANCHOR, LAYER_AUX_ITEMS, LAYER_CONFLICTS_SHADOW, LAYER_CURSOR, LAYER_DRAW_BITMAPS, LAYER_DRAWINGSHEET, LAYER_DRC_ERROR, LAYER_DRC_WARNING, LAYER_GP_OVERLAY, LAYER_GRID, LAYER_GRID_AXES, LAYER_LOCKED_ITEM_SHADOW, LAYER_MOD_BK, LAYER_MOD_FR, LAYER_MOD_REFERENCES, LAYER_MOD_TEXT, LAYER_MOD_VALUES, LAYER_NON_PLATEDHOLES, LAYER_PAD_BK, LAYER_PAD_FR, LAYER_PAD_HOLEWALLS, LAYER_PAD_PLATEDHOLES, LAYER_PADS, LAYER_PADS_TH, LAYER_PCB_BACKGROUND, LAYER_RATSNEST, LAYER_SELECT_OVERLAY, LAYER_TRACKS, LAYER_VIA_BBLIND, LAYER_VIA_HOLES, LAYER_VIA_HOLEWALLS, LAYER_VIA_MICROVIA, LAYER_VIA_THROUGH, LAYER_VIAS, and LAYER_ZONES.

Referenced by LAYER_PRESET::LAYER_PRESET(), PCB_PARSER::parseSetup(), and PROJECT_LOCAL_SETTINGS::PROJECT_LOCAL_SETTINGS().

◆ Seq()

std::vector< GAL_LAYER_ID > GAL_SET::Seq ( ) const

Definition at line 946 of file lset.cpp.

947{
948 std::vector<GAL_LAYER_ID> ret;
949
950 for( size_t i = 0; i < size(); ++i )
951 {
952 if( test( i ) )
953 ret.push_back( static_cast<GAL_LAYER_ID>( i + GAL_LAYER_ID_START ) );
954 }
955
956 return ret;
957}
@ GAL_LAYER_ID_START
Definition: layer_ids.h:191

References GAL_LAYER_ID_START.

◆ set() [1/3]

◆ set() [2/3]

GAL_SET & GAL_SET::set ( GAL_LAYER_ID  aPos,
bool  aVal = true 
)
inline

Definition at line 323 of file layer_ids.h.

324 {
325 GAL_BASE_SET::set( static_cast<std::size_t>( aPos ) - start, aVal );
326 return *this;
327 }

References start.

◆ set() [3/3]

GAL_SET & GAL_SET::set ( int  aPos,
bool  aVal = true 
)
inline

Definition at line 317 of file layer_ids.h.

318 {
319 GAL_BASE_SET::set( aPos, aVal );
320 return *this;
321 }

Member Data Documentation

◆ start

constexpr int GAL_SET::start = static_cast<int>( GAL_LAYER_ID_START )
staticconstexprprivate

Definition at line 298 of file layer_ids.h.

Referenced by Contains(), and set().


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