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 279 of file layer_ids.h.

Constructor & Destructor Documentation

◆ GAL_SET() [1/3]

GAL_SET::GAL_SET ( )
inline

Definition at line 285 of file layer_ids.h.

285  : std::bitset<GAL_LAYER_ID_COUNT>()
286  {
287  }

◆ GAL_SET() [2/3]

GAL_SET::GAL_SET ( const GAL_SET aOther)
inline

Definition at line 289 of file layer_ids.h.

289  : std::bitset<GAL_LAYER_ID_COUNT>( aOther )
290  {
291  }

◆ GAL_SET() [3/3]

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

Definition at line 912 of file lset.cpp.

912  : GAL_SET()
913 {
914  for( unsigned i = 0; i < aCount; ++i )
915  set( aArray[i] );
916 }
GAL_SET()
Definition: layer_ids.h:285
GAL_SET & set()
Definition: layer_ids.h:295

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 933 of file lset.cpp.

934 {
935  static const GAL_LAYER_ID visible[] = {
936  LAYER_VIAS,
943  // LAYER_MOD_TEXT_INVISIBLE, // Invisible text hidden by default
944  LAYER_ANCHOR,
945  LAYER_PAD_FR,
946  LAYER_PAD_BK,
948  LAYER_GRID,
951  LAYER_MOD_FR,
952  LAYER_MOD_BK,
955  LAYER_TRACKS,
963  // LAYER_DRC_EXCLUSION, // DRC exclusions hidden by default
968  LAYER_CURSOR,
971  LAYER_PADS,
972  LAYER_ZONES,
973  };
974 
975  static const GAL_SET saved( visible, arrayDim( visible ) );
976  return saved;
977 }
currently selected items overlay
Definition: layer_ids.h:215
smd pads, front layer
Definition: layer_ids.h:198
to draw micro vias
Definition: layer_ids.h:190
Auxiliary items (guides, rule, etc)
Definition: layer_ids.h:218
layer for drc markers with SEVERITY_ERROR
Definition: layer_ids.h:212
Meta control for all pads opacity/visibility (color ignored)
Definition: layer_ids.h:226
PCB cursor.
Definition: layer_ids.h:217
show footprints values (when texts are visible)
Definition: layer_ids.h:206
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
Definition: layer_ids.h:185
smd pads, back layer
Definition: layer_ids.h:199
anchor of items having an anchor point (texts, footprints)
Definition: layer_ids.h:197
show footprints on back
Definition: layer_ids.h:205
to draw via holes (pad holes do not use this layer)
Definition: layer_ids.h:211
Control for copper zone opacity/visibility (color ignored)
Definition: layer_ids.h:227
to draw usual through hole vias
Definition: layer_ids.h:192
handle color for not plated holes (holes, not pads)
Definition: layer_ids.h:193
Meta control for all vias opacity/visibility.
Definition: layer_ids.h:189
show footprints on front
Definition: layer_ids.h:204
Helper for storing and iterating over GAL_LAYER_IDs.
Definition: layer_ids.h:279
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Returns # of elements in an array.
Definition: arraydim.h:31
to handle and draw images bitmaps
Definition: layer_ids.h:219
drawingsheet frame and titleblock
Definition: layer_ids.h:213
show a marker on pads with no nets
Definition: layer_ids.h:203
show footprints references (when texts are visible)
Definition: layer_ids.h:207
multilayer pads, usually with holes
Definition: layer_ids.h:209
to draw blind/buried vias
Definition: layer_ids.h:191
general purpose overlay
Definition: layer_ids.h:214
layer for drc markers with SEVERITY_WARNING
Definition: layer_ids.h:231
PCB background color.
Definition: layer_ids.h:216
to draw pad holes (plated)
Definition: layer_ids.h:210

References arrayDim(), LAYER_ANCHOR, LAYER_AUX_ITEMS, LAYER_CURSOR, LAYER_DRAW_BITMAPS, LAYER_DRAWINGSHEET, LAYER_DRC_ERROR, LAYER_DRC_WARNING, LAYER_GP_OVERLAY, LAYER_GRID, LAYER_GRID_AXES, LAYER_MOD_BK, LAYER_MOD_FR, LAYER_MOD_REFERENCES, LAYER_MOD_TEXT_BK, LAYER_MOD_TEXT_FR, LAYER_MOD_VALUES, LAYER_NO_CONNECTS, 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 919 of file lset.cpp.

920 {
921  std::vector<GAL_LAYER_ID> ret;
922 
923  for( size_t i = 0; i < size(); ++i )
924  {
925  if( test( i ) )
926  ret.push_back( static_cast<GAL_LAYER_ID>( i + GAL_LAYER_ID_START ) );
927  }
928 
929  return ret;
930 }

References GAL_LAYER_ID_START.

◆ set() [1/3]

◆ set() [2/3]

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

Definition at line 301 of file layer_ids.h.

302  {
303  GAL_BASE_SET::set( aPos, aVal );
304  return *this;
305  }

◆ set() [3/3]

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

Definition at line 307 of file layer_ids.h.

308  {
309  GAL_BASE_SET::set( static_cast<std::size_t>( aPos ) - start, aVal );
310  return *this;
311  }
static constexpr int start
Definition: layer_ids.h:282

References start.

Member Data Documentation

◆ start

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

Definition at line 282 of file layer_ids.h.

Referenced by Contains(), and set().


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