KiCad PCB EDA Suite
LAYER Struct Reference

Container to hold information pertinent to a layer of a BOARD. More...

#include <board.h>

Public Member Functions

 LAYER ()
 
void clear ()
 

Static Public Member Functions

static const char * ShowType (LAYER_T aType)
 Convert a LAYER_T enum to a string representation of the layer type. More...
 
static LAYER_T ParseType (const char *aType)
 Convert a string to a LAYER_T. More...
 

Public Attributes

wxString m_name
 The canonical name of the layer. More...
 
wxString m_userName
 The user defined name of the layer. More...
 
LAYER_T m_type
 The type of the layer. More...
 
bool m_visible
 
int m_number
 The layer ID. More...
 

Detailed Description

Container to hold information pertinent to a layer of a BOARD.

Definition at line 155 of file board.h.

Constructor & Destructor Documentation

◆ LAYER()

LAYER::LAYER ( )
inline

Definition at line 157 of file board.h.

158 {
159 clear();
160 }
void clear()
Definition: board.h:162

References clear().

Member Function Documentation

◆ clear()

void LAYER::clear ( )
inline

Definition at line 162 of file board.h.

163 {
165 m_visible = true;
166 m_number = 0;
167 m_name.clear();
168 m_userName.clear();
169 }
@ LT_SIGNAL
Definition: board.h:145
LAYER_T m_type
The type of the layer.
Definition: board.h:184
wxString m_name
The canonical name of the layer.
Definition: board.h:182
wxString m_userName
The user defined name of the layer.
Definition: board.h:183
bool m_visible
Definition: board.h:185
int m_number
The layer ID.
Definition: board.h:186

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

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

◆ ParseType()

LAYER_T LAYER::ParseType ( const char *  aType)
static

Convert a string to a LAYER_T.

Parameters
aTypeThe layer name to convert.
Returns
The binary representation of the layer type, or LAYER_T(-1) if the string is invalid.

Definition at line 484 of file board.cpp.

485{
486 if( strcmp( aType, "signal" ) == 0 )
487 return LT_SIGNAL;
488 else if( strcmp( aType, "power" ) == 0 )
489 return LT_POWER;
490 else if( strcmp( aType, "mixed" ) == 0 )
491 return LT_MIXED;
492 else if( strcmp( aType, "jumper" ) == 0 )
493 return LT_JUMPER;
494 else
495 return LT_UNDEFINED;
496}
@ LT_POWER
Definition: board.h:146
@ LT_MIXED
Definition: board.h:147
@ LT_UNDEFINED
Definition: board.h:144
@ LT_JUMPER
Definition: board.h:148

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

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

◆ ShowType()

const char * LAYER::ShowType ( LAYER_T  aType)
static

Convert a LAYER_T enum to a string representation of the layer type.

Parameters
aTypeThe LAYER_T to convert
Returns
The string representation of the layer type.

Definition at line 471 of file board.cpp.

472{
473 switch( aType )
474 {
475 default:
476 case LT_SIGNAL: return "signal";
477 case LT_POWER: return "power";
478 case LT_MIXED: return "mixed";
479 case LT_JUMPER: return "jumper";
480 }
481}

References LT_JUMPER, LT_MIXED, LT_POWER, and LT_SIGNAL.

Referenced by PCB_PLUGIN::formatBoardLayers().

Member Data Documentation

◆ m_name

wxString LAYER::m_name

The canonical name of the layer.

See also
LSET::Name

Definition at line 182 of file board.h.

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

◆ m_number

int LAYER::m_number

The layer ID.

See also
PCB_LAYER_ID

Definition at line 186 of file board.h.

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

◆ m_type

LAYER_T LAYER::m_type

The type of the layer.

See also
LAYER_T

Definition at line 184 of file board.h.

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

◆ m_userName

wxString LAYER::m_userName

The user defined name of the layer.

Definition at line 183 of file board.h.

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

◆ m_visible

bool LAYER::m_visible

Definition at line 185 of file board.h.

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


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