KiCad PCB EDA Suite
CADSTAR_PCB_ARCHIVE_PARSER::COPPER Struct Reference

#include <cadstar_pcb_archive_parser.h>

Inheritance diagram for CADSTAR_PCB_ARCHIVE_PARSER::COPPER:
CADSTAR_ARCHIVE_PARSER::PARSER

Classes

struct  NETREF
 

Public Member Functions

void Parse (XNODE *aNode, PARSER_CONTEXT *aContext) override
 

Public Attributes

COPPER_ID ID
 
COPPERCODE_ID CopperCodeID
 
LAYER_ID LayerID
 
NETREF NetRef
 
SHAPE Shape
 
TEMPLATE_ID PouredTemplateID = wxEmptyString
 If not empty, it means this COPPER is part of a poured template. More...
 
bool Fixed = false
 
GROUP_ID GroupID = wxEmptyString
 If not empty, this COPPER is part of a group. More...
 
REUSEBLOCKREF ReuseBlockRef
 
std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUEAttributeValues
 

Detailed Description

Definition at line 1120 of file cadstar_pcb_archive_parser.h.

Member Function Documentation

◆ Parse()

void CADSTAR_PCB_ARCHIVE_PARSER::COPPER::Parse ( XNODE aNode,
PARSER_CONTEXT aContext 
)
overridevirtual

Implements CADSTAR_ARCHIVE_PARSER::PARSER.

Definition at line 2388 of file cadstar_pcb_archive_parser.cpp.

2389{
2390 wxASSERT( aNode->GetName() == wxT( "COPPER" ) );
2391
2392 ID = GetXmlAttributeIDString( aNode, 0 );
2394 LayerID = GetXmlAttributeIDString( aNode, 2 );
2395
2396 XNODE* cNode = aNode->GetChildren();
2397 bool shapeParsed = false;
2398 bool netRefParsed = false;
2399
2400 for( ; cNode; cNode = cNode->GetNext() )
2401 {
2402 wxString cNodeName = cNode->GetName();
2403
2404 if( !shapeParsed && SHAPE::IsShape( cNode ) )
2405 {
2406 Shape.Parse( cNode, aContext );
2407 shapeParsed = true;
2408 }
2409 else if( !netRefParsed && cNodeName == wxT( "NETREF" ) )
2410 {
2411 NetRef.Parse( cNode, aContext );
2412 netRefParsed = true;
2413 }
2414 else if( cNodeName == wxT( "FIX" ) )
2415 {
2416 Fixed = true;
2417 }
2418 else if( cNodeName == wxT( "GROUPREF" ) )
2419 {
2420 GroupID = GetXmlAttributeIDString( cNode, 0 );
2421 }
2422 else if( cNodeName == wxT( "REUSEBLOCKREF" ) )
2423 {
2424 ReuseBlockRef.Parse( cNode, aContext );
2425 }
2426 else if( cNodeName == wxT( "POURED" ) )
2427 {
2429 }
2430 else if( cNodeName == wxT( "ATTR" ) )
2431 {
2432 ATTRIBUTE_VALUE attr;
2433 attr.Parse( cNode, aContext );
2434 AttributeValues.insert( std::make_pair( attr.AttributeID, attr ) );
2435 }
2436 else
2437 {
2438 THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, wxT( "TEMPLATE" ) );
2439 }
2440 }
2441}
#define THROW_UNKNOWN_NODE_IO_ERROR(nodename, location)
static wxString GetXmlAttributeIDString(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
Hold an XML or S-expression element.
Definition: xnode.h:44
XNODE * GetChildren() const
Definition: xnode.h:62
XNODE * GetNext() const
Definition: xnode.h:67
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
GROUP_ID GroupID
If not empty, this COPPER is part of a group.
TEMPLATE_ID PouredTemplateID
If not empty, it means this COPPER is part of a poured template.
std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUE > AttributeValues

References CADSTAR_ARCHIVE_PARSER::ATTRIBUTE_VALUE::AttributeID, XNODE::GetChildren(), XNODE::GetNext(), CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDString(), CADSTAR_ARCHIVE_PARSER::SHAPE::IsShape(), CADSTAR_ARCHIVE_PARSER::ATTRIBUTE_VALUE::Parse(), and THROW_UNKNOWN_NODE_IO_ERROR.

Referenced by CADSTAR_PCB_ARCHIVE_PARSER::LAYOUT::Parse().

Member Data Documentation

◆ AttributeValues

std::map<ATTRIBUTE_ID, ATTRIBUTE_VALUE> CADSTAR_PCB_ARCHIVE_PARSER::COPPER::AttributeValues

Definition at line 1151 of file cadstar_pcb_archive_parser.h.

◆ CopperCodeID

COPPERCODE_ID CADSTAR_PCB_ARCHIVE_PARSER::COPPER::CopperCodeID

◆ Fixed

bool CADSTAR_PCB_ARCHIVE_PARSER::COPPER::Fixed = false

Definition at line 1147 of file cadstar_pcb_archive_parser.h.

◆ GroupID

GROUP_ID CADSTAR_PCB_ARCHIVE_PARSER::COPPER::GroupID = wxEmptyString

If not empty, this COPPER is part of a group.

Definition at line 1148 of file cadstar_pcb_archive_parser.h.

◆ ID

COPPER_ID CADSTAR_PCB_ARCHIVE_PARSER::COPPER::ID

◆ LayerID

LAYER_ID CADSTAR_PCB_ARCHIVE_PARSER::COPPER::LayerID

◆ NetRef

NETREF CADSTAR_PCB_ARCHIVE_PARSER::COPPER::NetRef

◆ PouredTemplateID

TEMPLATE_ID CADSTAR_PCB_ARCHIVE_PARSER::COPPER::PouredTemplateID = wxEmptyString

If not empty, it means this COPPER is part of a poured template.

Definition at line 1145 of file cadstar_pcb_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::loadCoppers().

◆ ReuseBlockRef

REUSEBLOCKREF CADSTAR_PCB_ARCHIVE_PARSER::COPPER::ReuseBlockRef

Definition at line 1149 of file cadstar_pcb_archive_parser.h.

◆ Shape

SHAPE CADSTAR_PCB_ARCHIVE_PARSER::COPPER::Shape

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