KiCad PCB EDA Suite
GAL_SET Class Reference

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

#include <layers_id_colors_and_visibility.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 283 of file layers_id_colors_and_visibility.h.

Constructor & Destructor Documentation

◆ GAL_SET() [1/3]

GAL_SET::GAL_SET ( )
inline

Definition at line 289 of file layers_id_colors_and_visibility.h.

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

◆ GAL_SET() [2/3]

GAL_SET::GAL_SET ( const GAL_SET aOther)
inline

Definition at line 293 of file layers_id_colors_and_visibility.h.

293  : std::bitset<GAL_LAYER_ID_COUNT>( aOther )
294  {
295  }

◆ 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 }

References set().

Member Function Documentation

◆ Contains()

◆ 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 }
to draw blind/buried vias
show a marker on pads with no nets
multilayer pads, usually with holes
to handle and draw images bitmaps
to draw via holes (pad holes do not use this layer)
handle color for not plated holes (holes, not pads)
anchor of items having an anchor point (texts, footprints)
Control for copper zone opacity/visibility (color ignored)
show footprints on back
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
show footprints values (when texts are visibles)
show footprints on front
Auxiliary items (guides, rule, etc)
Meta control for all pads opacity/visibility (color ignored)
to draw usual through hole vias
Helper for storing and iterating over GAL_LAYER_IDs.
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Returns # of elements in an array.
Definition: arraydim.h:31
layer for drc markers with SEVERITY_WARNING
smd pads, front layer
Meta control for all vias opacity/visibility.
currently selected items overlay
drawingsheet frame and titleblock
show footprints references (when texts are visibles)
layer for drc markers with SEVERITY_ERROR

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 305 of file layers_id_colors_and_visibility.h.

306  {
307  GAL_BASE_SET::set( aPos, aVal );
308  return *this;
309  }

◆ set() [3/3]

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

Definition at line 311 of file layers_id_colors_and_visibility.h.

312  {
313  GAL_BASE_SET::set( static_cast<std::size_t>( aPos ) - start, aVal );
314  return *this;
315  }
static constexpr int start

References start.

Member Data Documentation

◆ start

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

Definition at line 286 of file layers_id_colors_and_visibility.h.

Referenced by Contains(), and set().


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