KiCad PCB EDA Suite
LAYER Struct Reference

Class LAYER holds information pertinent to a layer of a BOARD. More...

#include <class_board.h>

Public Member Functions

 LAYER ()
 
void clear ()
 

Static Public Member Functions

static const char * ShowType (LAYER_T aType)
 Function ShowType converts a LAYER_T enum to a const char*. More...
 
static LAYER_T ParseType (const char *aType)
 Function ParseType converts a string to a LAYER_T. More...
 

Public Attributes

wxString m_name
 The name of the layer, there should be no spaces in this name. More...
 
LAYER_T m_type
 The type of the layer. More...
 
bool m_visible
 
int m_number
 

Detailed Description

Class LAYER holds information pertinent to a layer of a BOARD.

Definition at line 87 of file class_board.h.

Constructor & Destructor Documentation

◆ LAYER()

LAYER::LAYER ( )
inline

Definition at line 89 of file class_board.h.

90  {
91  clear();
92  }
void clear()
Definition: class_board.h:94

References clear().

Member Function Documentation

◆ clear()

void LAYER::clear ( )
inline

Definition at line 94 of file class_board.h.

95  {
96  m_type = LT_SIGNAL;
97  m_visible = true;
98  m_number = 0;
99  m_name.clear();
100  }
wxString m_name
The name of the layer, there should be no spaces in this name.
Definition: class_board.h:113
LAYER_T m_type
The type of the layer.
Definition: class_board.h:115
bool m_visible
Definition: class_board.h:117
int m_number
Definition: class_board.h:119

References LT_SIGNAL, m_name, m_number, m_type, and m_visible.

Referenced by LAYER(), and PCB_PARSER::parseLayer().

◆ ParseType()

LAYER_T LAYER::ParseType ( const char *  aType)
static

Function ParseType converts a string to a LAYER_T.

Parameters
aTypeThe const char* to convert
Returns
LAYER_T - The binary representation of the layer type, or LAYER_T(-1) if the string is invalid

Definition at line 717 of file class_board.cpp.

718 {
719  if( strcmp( aType, "signal" ) == 0 )
720  return LT_SIGNAL;
721  else if( strcmp( aType, "power" ) == 0 )
722  return LT_POWER;
723  else if( strcmp( aType, "mixed" ) == 0 )
724  return LT_MIXED;
725  else if( strcmp( aType, "jumper" ) == 0 )
726  return LT_JUMPER;
727  else
728  return LT_UNDEFINED;
729 }

References LT_JUMPER, LT_MIXED, LT_POWER, LT_SIGNAL, and LT_UNDEFINED.

Referenced by LEGACY_PLUGIN::loadSETUP(), and PCB_PARSER::parseLayer().

◆ ShowType()

const char * LAYER::ShowType ( LAYER_T  aType)
static

Function ShowType converts a LAYER_T enum to a const char*.

Parameters
aTypeThe LAYER_T to convert
Returns
const char* - The string representation of the layer type.

Definition at line 689 of file class_board.cpp.

690 {
691  const char* cp;
692 
693  switch( aType )
694  {
695  default:
696  case LT_SIGNAL:
697  cp = "signal";
698  break;
699 
700  case LT_POWER:
701  cp = "power";
702  break;
703 
704  case LT_MIXED:
705  cp = "mixed";
706  break;
707 
708  case LT_JUMPER:
709  cp = "jumper";
710  break;
711  }
712 
713  return cp;
714 }

References LT_JUMPER, LT_MIXED, LT_POWER, and LT_SIGNAL.

Referenced by PCB_IO::formatBoardLayers().

Member Data Documentation

◆ m_name

wxString LAYER::m_name

The name of the layer, there should be no spaces in this name.

Definition at line 113 of file class_board.h.

Referenced by BOARD::BOARD(), clear(), BOARD::GetLayerName(), PCB_PARSER::parseLayer(), PCB_PARSER::parseLayers(), and BOARD::SetLayerName().

◆ m_number

int LAYER::m_number

Definition at line 119 of file class_board.h.

Referenced by clear(), PCB_PARSER::parseLayer(), and PCB_PARSER::parseLayers().

◆ m_type

LAYER_T LAYER::m_type

◆ m_visible

bool LAYER::m_visible

Definition at line 117 of file class_board.h.

Referenced by clear(), PCB_PARSER::parseLayer(), and PCB_PARSER::parseLayers().


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