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

Constructor & Destructor Documentation

LAYER::LAYER ( )
inline

Definition at line 84 of file class_board.h.

References clear().

85  {
86  clear();
87  }
void clear()
Definition: class_board.h:89

Member Function Documentation

void LAYER::clear ( )
inline

Definition at line 89 of file class_board.h.

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

Referenced by LAYER().

90  {
91  m_type = LT_SIGNAL;
92  m_visible = true;
93  m_number = 0;
94  m_name.clear();
95  }
wxString m_name
The name of the layer, there should be no spaces in this name.
Definition: class_board.h:108
LAYER_T m_type
The type of the layer.
Definition: class_board.h:110
bool m_visible
Definition: class_board.h:112
int m_number
Definition: class_board.h:114
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 664 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().

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

References LT_JUMPER, LT_MIXED, LT_POWER, and LT_SIGNAL.

Referenced by PCB_IO::format().

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

Member Data Documentation

wxString LAYER::m_name

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

Definition at line 108 of file class_board.h.

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

int LAYER::m_number

Definition at line 114 of file class_board.h.

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

LAYER_T LAYER::m_type

The type of the layer.

Definition at line 110 of file class_board.h.

Referenced by BOARD::BOARD(), clear(), BOARD::GetLayerType(), PCB_PARSER::parseLayers(), and BOARD::SetLayerType().

bool LAYER::m_visible

Definition at line 112 of file class_board.h.

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


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