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 447 of file cadstar_archive_parser.h.

Member Function Documentation

◆ IsShape()

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

Definition at line 486 of file cadstar_archive_parser.cpp.

487 {
488  wxString aNodeName = aNode->GetName();
489 
490  if( aNodeName == wxT( "OPENSHAPE" ) || aNodeName == wxT( "OUTLINE" )
491  || aNodeName == wxT( "SOLID" ) || aNodeName == wxT( "HATCHED" ) )
492  {
493  return true;
494  }
495  else
496  {
497  return false;
498  }
499 }

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 502 of file cadstar_archive_parser.cpp.

503 {
504  wxASSERT( IsShape( aNode ) );
505 
506  wxString aNodeName = aNode->GetName();
507 
508  if( aNodeName == wxT( "OPENSHAPE" ) )
509  {
511  Vertices = ParseAllChildVertices( aNode, aContext, true );
512  Cutouts.clear();
513  HatchCodeID = wxEmptyString;
514  }
515  else if( aNodeName == wxT( "OUTLINE" ) )
516  {
518  Vertices = ParseAllChildVertices( aNode, aContext, false );
519  Cutouts = ParseAllChildCutouts( aNode, aContext, false );
520  HatchCodeID = wxEmptyString;
521  }
522  else if( aNodeName == wxT( "SOLID" ) )
523  {
525  Vertices = ParseAllChildVertices( aNode, aContext, false );
526  Cutouts = ParseAllChildCutouts( aNode, aContext, false );
527  HatchCodeID = wxEmptyString;
528  }
529  else if( aNodeName == wxT( "HATCHED" ) )
530  {
532  Vertices = ParseAllChildVertices( aNode, aContext, false );
533  Cutouts = ParseAllChildCutouts( aNode, aContext, false );
534  HatchCodeID = GetXmlAttributeIDString( aNode, 0 );
535  }
536  else
537  {
538  wxASSERT_MSG( true, wxT( "Unknown SHAPE type" ) );
539  }
540 }
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 452 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: