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 1176 of file cadstar_pcb_archive_parser.cpp.

1177 {
1178  wxASSERT( aNode->GetName() == wxT( "DIMARROW" ) );
1179  bool arrowStyleInitialised = false;
1180  bool upperAngleInitialised = false;
1181  bool lowerAngleInitialised = false;
1182 
1183  ArrowLength = GetXmlAttributeIDLong( aNode, 3 );
1184 
1185  XNODE* cNode = aNode->GetChildren();
1186 
1187 
1188  for( ; cNode; cNode = cNode->GetNext() )
1189  {
1190  wxString cNodeName = cNode->GetName();
1191 
1192  if( cNodeName == wxT( "ARROWSTYLE" ) )
1193  {
1194  wxString arrowStyleStr = GetXmlAttributeIDString( cNode, 0 );
1195  arrowStyleInitialised = true;
1196 
1197  if( arrowStyleStr == wxT( "DIMENSION_ARROWOPEN" ) )
1199  else if( arrowStyleStr == wxT( "DIMENSION_ARROWCLOSED" ) )
1201  else if( arrowStyleStr == wxT( "DIMENSION_ARROWCLEAR" ) )
1203  else if( arrowStyleStr == wxT( "DIMENSION_ARROWCLOSEDFILLED" ) )
1205  else
1206  THROW_UNKNOWN_PARAMETER_IO_ERROR( arrowStyleStr, cNodeName );
1207  }
1208  else if( cNodeName == wxT( "ARROWANGLEA" ) )
1209  {
1210  UpperAngle = GetXmlAttributeIDLong( cNode, 0 );
1211  upperAngleInitialised = true;
1212  }
1213  else if( cNodeName == wxT( "ARROWANGLEB" ) )
1214  {
1215  UpperAngle = GetXmlAttributeIDLong( cNode, 0 );
1216  lowerAngleInitialised = true;
1217  }
1218  else
1219  {
1220  THROW_UNKNOWN_PARAMETER_IO_ERROR( cNodeName, wxT( "DIMARROW" ) );
1221  }
1222  }
1223 
1224  if( !arrowStyleInitialised )
1225  THROW_MISSING_PARAMETER_IO_ERROR( wxT( "ARROWSTYLE" ), wxT( "DIMARROW" ) );
1226 
1227  if( !upperAngleInitialised )
1228  THROW_MISSING_PARAMETER_IO_ERROR( wxT( "ARROWANGLEA" ), wxT( "DIMARROW" ) );
1229 
1230  if( !lowerAngleInitialised )
1231  THROW_MISSING_PARAMETER_IO_ERROR( wxT( "ARROWANGLEB" ), wxT( "DIMARROW" ) );
1232 }
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: