KiCad PCB EDA Suite
CADSTAR_PCB_ARCHIVE_PARSER::DIMENSION::ARROW Struct Reference

#include <cadstar_pcb_archive_parser.h>

Inheritance diagram for CADSTAR_PCB_ARCHIVE_PARSER::DIMENSION::ARROW:
CADSTAR_ARCHIVE_PARSER::PARSER

Public Types

enum  STYLE { STYLE::OPEN, STYLE::CLOSED, STYLE::CLEAR, STYLE::CLOSED_FILLED }
 

Public Member Functions

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

Public Attributes

STYLE ArrowStyle
 Subnode="ARROWSTYLE". More...
 
long UpperAngle
 token="ARROWANGLEA" More...
 
long LowerAngle
 token="ARROWANGLEB" More...
 
long ArrowLength
 The length of the angled lines that make up the arrow head. More...
 

Detailed Description

Definition at line 583 of file cadstar_pcb_archive_parser.h.

Member Enumeration Documentation

◆ STYLE

Enumerator
OPEN 

The arrow head is made up of two angled lines either side of main line.

"DIMENSION_ARROWOPEN"

CLOSED 

The arrow head is made up of two angled lines either side of main line plus two other lines perpendicular to the main line finishing at the end of each of the two angled lines, with the main line still reaching tip of the arrow.

"DIMENSION_ARROWCLOSED"

CLEAR 

Same as closed but the main line finishes at the start of the perpendicular lines.

"DIMENSION_ARROWCLEAR"

CLOSED_FILLED 

The same as CLOSED or CLEAR arrows, but with a solid fill "DIMENSION_ARROWCLOSEDFILLED".

Definition at line 585 of file cadstar_pcb_archive_parser.h.

586  {
587  OPEN,
588  CLOSED,
590  CLEAR,
595  CLOSED_FILLED
597  };

Member Function Documentation

◆ Parse()

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

Implements CADSTAR_ARCHIVE_PARSER::PARSER.

Definition at line 1200 of file cadstar_pcb_archive_parser.cpp.

1201 {
1202  wxASSERT( aNode->GetName() == wxT( "DIMARROW" ) );
1203  bool arrowStyleInitialised = false;
1204  bool upperAngleInitialised = false;
1205  bool lowerAngleInitialised = false;
1206 
1207  ArrowLength = GetXmlAttributeIDLong( aNode, 3 );
1208 
1209  XNODE* cNode = aNode->GetChildren();
1210 
1211 
1212  for( ; cNode; cNode = cNode->GetNext() )
1213  {
1214  wxString cNodeName = cNode->GetName();
1215 
1216  if( cNodeName == wxT( "ARROWSTYLE" ) )
1217  {
1218  wxString arrowStyleStr = GetXmlAttributeIDString( cNode, 0 );
1219  arrowStyleInitialised = true;
1220 
1221  if( arrowStyleStr == wxT( "DIMENSION_ARROWOPEN" ) )
1223  else if( arrowStyleStr == wxT( "DIMENSION_ARROWCLOSED" ) )
1225  else if( arrowStyleStr == wxT( "DIMENSION_ARROWCLEAR" ) )
1227  else if( arrowStyleStr == wxT( "DIMENSION_ARROWCLOSEDFILLED" ) )
1229  else
1230  THROW_UNKNOWN_PARAMETER_IO_ERROR( arrowStyleStr, cNodeName );
1231  }
1232  else if( cNodeName == wxT( "ARROWANGLEA" ) )
1233  {
1234  UpperAngle = GetXmlAttributeIDLong( cNode, 0 );
1235  upperAngleInitialised = true;
1236  }
1237  else if( cNodeName == wxT( "ARROWANGLEB" ) )
1238  {
1239  UpperAngle = GetXmlAttributeIDLong( cNode, 0 );
1240  lowerAngleInitialised = true;
1241  }
1242  else
1243  {
1244  THROW_UNKNOWN_PARAMETER_IO_ERROR( cNodeName, wxT( "DIMARROW" ) );
1245  }
1246  }
1247 
1248  if( !arrowStyleInitialised )
1249  THROW_MISSING_PARAMETER_IO_ERROR( wxT( "ARROWSTYLE" ), wxT( "DIMARROW" ) );
1250 
1251  if( !upperAngleInitialised )
1252  THROW_MISSING_PARAMETER_IO_ERROR( wxT( "ARROWANGLEA" ), wxT( "DIMARROW" ) );
1253 
1254  if( !lowerAngleInitialised )
1255  THROW_MISSING_PARAMETER_IO_ERROR( wxT( "ARROWANGLEB" ), wxT( "DIMARROW" ) );
1256 }
long ArrowLength
The length of the angled lines that make up the arrow head.
#define THROW_MISSING_PARAMETER_IO_ERROR(param, location)
The arrow head is made up of two angled lines either side of main line.
XNODE * GetChildren() const
Definition: xnode.h:62
The same as CLOSED or CLEAR arrows, but with a solid fill "DIMENSION_ARROWCLOSEDFILLED".
Same as closed but the main line finishes at the start of the perpendicular lines.
static long GetXmlAttributeIDLong(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
Hold an XML or S-expression element.
Definition: xnode.h:43
XNODE * GetNext() const
Definition: xnode.h:67
static wxString GetXmlAttributeIDString(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
#define THROW_UNKNOWN_PARAMETER_IO_ERROR(param, location)
The arrow head is made up of two angled lines either side of main line plus two other lines perpendic...

References CLEAR, XNODE::GetChildren(), XNODE::GetNext(), CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDLong(), CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDString(), THROW_MISSING_PARAMETER_IO_ERROR, and THROW_UNKNOWN_PARAMETER_IO_ERROR.

Member Data Documentation

◆ ArrowLength

long CADSTAR_PCB_ARCHIVE_PARSER::DIMENSION::ARROW::ArrowLength

The length of the angled lines that make up the arrow head.

Definition at line 603 of file cadstar_pcb_archive_parser.h.

◆ ArrowStyle

STYLE CADSTAR_PCB_ARCHIVE_PARSER::DIMENSION::ARROW::ArrowStyle

Subnode="ARROWSTYLE".

Definition at line 600 of file cadstar_pcb_archive_parser.h.

◆ LowerAngle

long CADSTAR_PCB_ARCHIVE_PARSER::DIMENSION::ARROW::LowerAngle

token="ARROWANGLEB"

Definition at line 602 of file cadstar_pcb_archive_parser.h.

◆ UpperAngle

long CADSTAR_PCB_ARCHIVE_PARSER::DIMENSION::ARROW::UpperAngle

token="ARROWANGLEA"

Definition at line 601 of file cadstar_pcb_archive_parser.h.


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