KiCad PCB EDA Suite
CADSTAR_ARCHIVE_PARSER::SHAPE Struct Reference

#include <cadstar_archive_parser.h>

Inheritance diagram for CADSTAR_ARCHIVE_PARSER::SHAPE:
CADSTAR_ARCHIVE_PARSER::PARSER

Public Member Functions

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

Static Public Member Functions

static bool IsShape (XNODE *aNode)
 

Public Attributes

SHAPE_TYPE Type
 
std::vector< VERTEXVertices
 
std::vector< CUTOUTCutouts
 Not Applicable to OPENSHAPE Type. More...
 
wxString HatchCodeID
 Only Applicable for HATCHED Type. More...
 

Detailed Description

Definition at line 459 of file cadstar_archive_parser.h.

Member Function Documentation

◆ IsShape()

bool CADSTAR_ARCHIVE_PARSER::SHAPE::IsShape ( XNODE aNode)
static

Definition at line 492 of file cadstar_archive_parser.cpp.

493 {
494  wxString aNodeName = aNode->GetName();
495 
496  if( aNodeName == wxT( "OPENSHAPE" ) || aNodeName == wxT( "OUTLINE" )
497  || aNodeName == wxT( "SOLID" ) || aNodeName == wxT( "HATCHED" ) )
498  {
499  return true;
500  }
501  else
502  {
503  return false;
504  }
505 }

Referenced by CADSTAR_SCH_ARCHIVE_PARSER::BUS::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT_AREA::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::CADSTAR_BOARD::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::AREA::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::TEMPLATE::Parse(), and CADSTAR_PCB_ARCHIVE_PARSER::COPPER::Parse().

◆ Parse()

void CADSTAR_ARCHIVE_PARSER::SHAPE::Parse ( XNODE aNode,
PARSER_CONTEXT aContext 
)
overridevirtual

Implements CADSTAR_ARCHIVE_PARSER::PARSER.

Definition at line 508 of file cadstar_archive_parser.cpp.

509 {
510  wxASSERT( IsShape( aNode ) );
511 
512  wxString aNodeName = aNode->GetName();
513 
514  if( aNodeName == wxT( "OPENSHAPE" ) )
515  {
517  Vertices = ParseAllChildVertices( aNode, aContext, true );
518  Cutouts.clear();
519  HatchCodeID = wxEmptyString;
520  }
521  else if( aNodeName == wxT( "OUTLINE" ) )
522  {
524  Vertices = ParseAllChildVertices( aNode, aContext, false );
525  Cutouts = ParseAllChildCutouts( aNode, aContext, false );
526  HatchCodeID = wxEmptyString;
527  }
528  else if( aNodeName == wxT( "SOLID" ) )
529  {
531  Vertices = ParseAllChildVertices( aNode, aContext, false );
532  Cutouts = ParseAllChildCutouts( aNode, aContext, false );
533  HatchCodeID = wxEmptyString;
534  }
535  else if( aNodeName == wxT( "HATCHED" ) )
536  {
538  Vertices = ParseAllChildVertices( aNode, aContext, false );
539  Cutouts = ParseAllChildCutouts( aNode, aContext, false );
540  HatchCodeID = GetXmlAttributeIDString( aNode, 0 );
541  }
542  else
543  {
544  wxASSERT_MSG( true, wxT( "Unknown SHAPE type" ) );
545  }
546 }
Filled closed shape (hatch fill).
wxString HatchCodeID
Only Applicable for HATCHED Type.
static std::vector< VERTEX > ParseAllChildVertices(XNODE *aNode, PARSER_CONTEXT *aContext, bool aTestAllChildNodes=false)
if no children are present, it just returns an empty vector (without throwing an exception)
static std::vector< CUTOUT > ParseAllChildCutouts(XNODE *aNode, PARSER_CONTEXT *aContext, bool aTestAllChildNodes=false)
if no children are present, it just returns an empty vector (without throwing an exception)
std::vector< CUTOUT > Cutouts
Not Applicable to OPENSHAPE Type.
Unfilled open shape. Cannot have cutouts.
static wxString GetXmlAttributeIDString(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
Filled closed shape (solid fill).

References CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDString(), CADSTAR_ARCHIVE_PARSER::HATCHED, CADSTAR_ARCHIVE_PARSER::OPENSHAPE, CADSTAR_ARCHIVE_PARSER::OUTLINE, CADSTAR_ARCHIVE_PARSER::ParseAllChildCutouts(), CADSTAR_ARCHIVE_PARSER::ParseAllChildVertices(), and CADSTAR_ARCHIVE_PARSER::SOLID.

Member Data Documentation

◆ Cutouts

◆ HatchCodeID

wxString CADSTAR_ARCHIVE_PARSER::SHAPE::HatchCodeID

Only Applicable for HATCHED Type.

Definition at line 464 of file cadstar_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::loadCoppers().

◆ Type

◆ Vertices


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