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 656 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().

657 {
658  if( strcmp( aType, "signal" ) == 0 )
659  return LT_SIGNAL;
660  else if( strcmp( aType, "power" ) == 0 )
661  return LT_POWER;
662  else if( strcmp( aType, "mixed" ) == 0 )
663  return LT_MIXED;
664  else if( strcmp( aType, "jumper" ) == 0 )
665  return LT_JUMPER;
666  else
667  return LT_UNDEFINED;
668 }
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 628 of file class_board.cpp.

References LT_JUMPER, LT_MIXED, LT_POWER, and LT_SIGNAL.

Referenced by PCB_IO::format().

629 {
630  const char* cp;
631 
632  switch( aType )
633  {
634  default:
635  case LT_SIGNAL:
636  cp = "signal";
637  break;
638 
639  case LT_POWER:
640  cp = "power";
641  break;
642 
643  case LT_MIXED:
644  cp = "mixed";
645  break;
646 
647  case LT_JUMPER:
648  cp = "jumper";
649  break;
650  }
651 
652  return cp;
653 }

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: