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

Constructor & Destructor Documentation

LAYER::LAYER ( )
inline

Definition at line 87 of file class_board.h.

References clear().

88  {
89  clear();
90  }
void clear()
Definition: class_board.h:92

Member Function Documentation

void LAYER::clear ( )
inline

Definition at line 92 of file class_board.h.

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

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

93  {
94  m_type = LT_SIGNAL;
95  m_visible = true;
96  m_number = 0;
97  m_name.clear();
98  }
wxString m_name
The name of the layer, there should be no spaces in this name.
Definition: class_board.h:111
LAYER_T m_type
The type of the layer.
Definition: class_board.h:113
bool m_visible
Definition: class_board.h:115
int m_number
Definition: class_board.h:117
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 668 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().

669 {
670  if( strcmp( aType, "signal" ) == 0 )
671  return LT_SIGNAL;
672  else if( strcmp( aType, "power" ) == 0 )
673  return LT_POWER;
674  else if( strcmp( aType, "mixed" ) == 0 )
675  return LT_MIXED;
676  else if( strcmp( aType, "jumper" ) == 0 )
677  return LT_JUMPER;
678  else
679  return LT_UNDEFINED;
680 }
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 640 of file class_board.cpp.

References LT_JUMPER, LT_MIXED, LT_POWER, and LT_SIGNAL.

Referenced by PCB_IO::formatBoardLayers().

641 {
642  const char* cp;
643 
644  switch( aType )
645  {
646  default:
647  case LT_SIGNAL:
648  cp = "signal";
649  break;
650 
651  case LT_POWER:
652  cp = "power";
653  break;
654 
655  case LT_MIXED:
656  cp = "mixed";
657  break;
658 
659  case LT_JUMPER:
660  cp = "jumper";
661  break;
662  }
663 
664  return cp;
665 }

Member Data Documentation

wxString LAYER::m_name

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

Definition at line 111 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 117 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 115 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: