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

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

References LT_JUMPER, LT_MIXED, LT_POWER, and LT_SIGNAL.

Referenced by PCB_IO::format().

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

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: