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

Constructor & Destructor Documentation

◆ GAL_SET() [1/3]

GAL_SET::GAL_SET ( )
inline

Definition at line 273 of file layers_id_colors_and_visibility.h.

273  : std::bitset<GAL_LAYER_ID_COUNT>()
274  {
275  }

◆ GAL_SET() [2/3]

GAL_SET::GAL_SET ( const GAL_SET aOther)
inline

Definition at line 277 of file layers_id_colors_and_visibility.h.

277  : std::bitset<GAL_LAYER_ID_COUNT>( aOther )
278  {
279  }

◆ GAL_SET() [3/3]

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

Definition at line 905 of file lset.cpp.

905  : GAL_SET()
906 {
907  for( unsigned i = 0; i < aCount; ++i )
908  set( aArray[i] );
909 }

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

927 {
928  static const GAL_LAYER_ID visible[] = {
929  LAYER_VIAS,
936  // LAYER_MOD_TEXT_INVISIBLE, // Invisible text hidden by default
937  LAYER_ANCHOR,
938  LAYER_PAD_FR,
939  LAYER_PAD_BK,
941  LAYER_GRID,
944  LAYER_MOD_FR,
945  LAYER_MOD_BK,
948  LAYER_TRACKS,
954  // LAYER_DRC_EXCLUSION, // DRC exclusions hidden by default
959  LAYER_CURSOR,
962  LAYER_PADS,
963  LAYER_ZONES,
964  };
965 
966  static const GAL_SET saved( visible, arrayDim( visible ) );
967  return saved;
968 }
to draw blind/buried vias
show a marker on pads with no nets
multilayer pads, usually with holes
to handle and draw images bitmaps
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.
to draw via holes (pad holes do not use this layer)
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
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_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_PADS, LAYER_PADS_PLATEDHOLES, LAYER_PADS_TH, LAYER_PCB_BACKGROUND, LAYER_RATSNEST, LAYER_SELECT_OVERLAY, LAYER_TRACKS, LAYER_VIA_BBLIND, LAYER_VIA_MICROVIA, LAYER_VIA_THROUGH, LAYER_VIAS, LAYER_VIAS_HOLES, LAYER_WORKSHEET, and LAYER_ZONES.

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

◆ Seq()

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

Definition at line 912 of file lset.cpp.

913 {
914  std::vector<GAL_LAYER_ID> ret;
915 
916  for( size_t i = 0; i < size(); ++i )
917  {
918  if( test( i ) )
919  ret.push_back( static_cast<GAL_LAYER_ID>( i + GAL_LAYER_ID_START ) );
920  }
921 
922  return ret;
923 }

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

290  {
291  GAL_BASE_SET::set( aPos, aVal );
292  return *this;
293  }

◆ set() [3/3]

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

Definition at line 295 of file layers_id_colors_and_visibility.h.

296  {
297  GAL_BASE_SET::set( static_cast<std::size_t>( aPos ) - start, aVal );
298  return *this;
299  }
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 270 of file layers_id_colors_and_visibility.h.

Referenced by Contains(), and set().


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