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 86 of file class_board.h.

Constructor & Destructor Documentation

LAYER::LAYER ( )
inline

Definition at line 88 of file class_board.h.

References clear().

89  {
90  clear();
91  }
void clear()
Definition: class_board.h:93

Member Function Documentation

void LAYER::clear ( )
inline

Definition at line 93 of file class_board.h.

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

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

94  {
95  m_type = LT_SIGNAL;
96  m_visible = true;
97  m_number = 0;
98  m_name.clear();
99  }
wxString m_name
The name of the layer, there should be no spaces in this name.
Definition: class_board.h:112
LAYER_T m_type
The type of the layer.
Definition: class_board.h:114
bool m_visible
Definition: class_board.h:116
int m_number
Definition: class_board.h:118
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 719 of file class_board.cpp.

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

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

720 {
721  if( strcmp( aType, "signal" ) == 0 )
722  return LT_SIGNAL;
723  else if( strcmp( aType, "power" ) == 0 )
724  return LT_POWER;
725  else if( strcmp( aType, "mixed" ) == 0 )
726  return LT_MIXED;
727  else if( strcmp( aType, "jumper" ) == 0 )
728  return LT_JUMPER;
729  else
730  return LT_UNDEFINED;
731 }
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 691 of file class_board.cpp.

References LT_JUMPER, LT_MIXED, LT_POWER, and LT_SIGNAL.

Referenced by PCB_IO::formatBoardLayers().

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

Member Data Documentation

wxString LAYER::m_name

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

Definition at line 112 of file class_board.h.

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

int LAYER::m_number

Definition at line 118 of file class_board.h.

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

LAYER_T LAYER::m_type
bool LAYER::m_visible

Definition at line 116 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: