KiCad PCB EDA Suite
CADSTAR_ARCHIVE_PARSER::ATTRIBUTE_LOCATION Struct Reference

#include <cadstar_archive_parser.h>

Inheritance diagram for CADSTAR_ARCHIVE_PARSER::ATTRIBUTE_LOCATION:
CADSTAR_ARCHIVE_PARSER::PARSER CADSTAR_ARCHIVE_PARSER::TEXT_LOCATION CADSTAR_SCH_ARCHIVE_PARSER::PIN_NUM_LABEL_LOC CADSTAR_SCH_ARCHIVE_PARSER::SIGLOC CADSTAR_SCH_ARCHIVE_PARSER::SIGNALREFERENCELINK

Public Member Functions

void ParseIdentifiers (XNODE *aNode, PARSER_CONTEXT *aContext)
 
bool ParseSubNode (XNODE *aChildNode, PARSER_CONTEXT *aContext)
 
virtual void Parse (XNODE *aNode, PARSER_CONTEXT *aContext) override
 

Public Attributes

TEXTCODE_ID TextCodeID
 
LAYER_ID LayerID
 
POINT Position
 
long OrientAngle = 0
 
bool Mirror = false
 
bool Fixed = false
 
JUSTIFICATION Justification
 Note: Justification has no effect on single lines of text. More...
 
ALIGNMENT Alignment
 In CADSTAR The default alignment for a TEXT object (when "(No Alignment()" is selected) Bottom Left of the first line. More...
 

Detailed Description

Definition at line 657 of file cadstar_archive_parser.h.

Member Function Documentation

◆ Parse()

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

Implements CADSTAR_ARCHIVE_PARSER::PARSER.

Reimplemented in CADSTAR_ARCHIVE_PARSER::TEXT_LOCATION, CADSTAR_SCH_ARCHIVE_PARSER::SIGLOC, CADSTAR_SCH_ARCHIVE_PARSER::SIGNALREFERENCELINK, and CADSTAR_SCH_ARCHIVE_PARSER::PIN_NUM_LABEL_LOC.

Definition at line 1029 of file cadstar_archive_parser.cpp.

1030 {
1031  wxASSERT( aNode->GetName() == wxT( "ATTRLOC" ) );
1032 
1033  ParseIdentifiers( aNode, aContext );
1034 
1035  //Parse child nodes
1036  XNODE* cNode = aNode->GetChildren();
1037 
1038  for( ; cNode; cNode = cNode->GetNext() )
1039  {
1040  if( ParseSubNode( cNode, aContext ) )
1041  continue;
1042  else
1043  THROW_UNKNOWN_NODE_IO_ERROR( cNode->GetName(), wxT( "ATTRLOC" ) );
1044  }
1045 
1046  if( !Position.IsFullySpecified() )
1047  THROW_MISSING_NODE_IO_ERROR( wxT( "PT" ), wxT( "ATTRLOC" ) );
1048 }
XNODE * GetChildren() const
Definition: xnode.h:62
#define THROW_MISSING_NODE_IO_ERROR(nodename, location)
Hold an XML or S-expression element.
Definition: xnode.h:43
XNODE * GetNext() const
Definition: xnode.h:67
bool ParseSubNode(XNODE *aChildNode, PARSER_CONTEXT *aContext)
void ParseIdentifiers(XNODE *aNode, PARSER_CONTEXT *aContext)
#define THROW_UNKNOWN_NODE_IO_ERROR(nodename, location)

References XNODE::GetChildren(), XNODE::GetNext(), THROW_MISSING_NODE_IO_ERROR, and THROW_UNKNOWN_NODE_IO_ERROR.

◆ ParseIdentifiers()

void CADSTAR_ARCHIVE_PARSER::ATTRIBUTE_LOCATION::ParseIdentifiers ( XNODE aNode,
PARSER_CONTEXT aContext 
)

Definition at line 999 of file cadstar_archive_parser.cpp.

1000 {
1001  TextCodeID = GetXmlAttributeIDString( aNode, 0 );
1002  LayerID = GetXmlAttributeIDString( aNode, 1 );
1003 }
static wxString GetXmlAttributeIDString(XNODE *aNode, unsigned int aID, bool aIsRequired=true)

References CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDString().

◆ ParseSubNode()

bool CADSTAR_ARCHIVE_PARSER::ATTRIBUTE_LOCATION::ParseSubNode ( XNODE aChildNode,
PARSER_CONTEXT aContext 
)

Definition at line 1006 of file cadstar_archive_parser.cpp.

1007 {
1008  wxString cNodeName = aChildNode->GetName();
1009 
1010  if( cNodeName == wxT( "PT" ) )
1011  Position.Parse( aChildNode, aContext );
1012  else if( cNodeName == wxT( "ORIENT" ) )
1013  OrientAngle = GetXmlAttributeIDLong( aChildNode, 0 );
1014  else if( cNodeName == wxT( "MIRROR" ) )
1015  Mirror = true;
1016  else if( cNodeName == wxT( "FIX" ) )
1017  Fixed = true;
1018  else if( cNodeName == wxT( "ALIGN" ) )
1019  Alignment = ParseAlignment( aChildNode );
1020  else if( cNodeName == wxT( "JUSTIFICATION" ) )
1021  Justification = ParseJustification( aChildNode );
1022  else
1023  return false;
1024 
1025  return true;
1026 }
static JUSTIFICATION ParseJustification(XNODE *aNode)
ALIGNMENT Alignment
In CADSTAR The default alignment for a TEXT object (when "(No Alignment()" is selected) Bottom Left o...
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
static long GetXmlAttributeIDLong(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
JUSTIFICATION Justification
Note: Justification has no effect on single lines of text.
static ALIGNMENT ParseAlignment(XNODE *aNode)

References CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDLong(), CADSTAR_ARCHIVE_PARSER::ParseAlignment(), and CADSTAR_ARCHIVE_PARSER::ParseJustification().

Member Data Documentation

◆ Alignment

ALIGNMENT CADSTAR_ARCHIVE_PARSER::ATTRIBUTE_LOCATION::Alignment
Initial value:
= ALIGNMENT::
NO_ALIGNMENT

In CADSTAR The default alignment for a TEXT object (when "(No Alignment()" is selected) Bottom Left of the first line.

Note that this is different from BOTTOM_LEFT (which is bottom left of the whole text block)

Definition at line 667 of file cadstar_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::addAttribute(), CADSTAR_SCH_ARCHIVE_LOADER::applyToLibraryFieldAttribute(), CADSTAR_SCH_ARCHIVE_LOADER::loadBusses(), CADSTAR_SCH_ARCHIVE_LOADER::loadChildSheets(), CADSTAR_SCH_ARCHIVE_LOADER::loadSymbolFieldAttribute(), and CADSTAR_ARCHIVE_PARSER::TEXT_LOCATION::TEXT_LOCATION().

◆ Fixed

bool CADSTAR_ARCHIVE_PARSER::ATTRIBUTE_LOCATION::Fixed = false

Definition at line 664 of file cadstar_archive_parser.h.

◆ Justification

JUSTIFICATION CADSTAR_ARCHIVE_PARSER::ATTRIBUTE_LOCATION::Justification

◆ LayerID

LAYER_ID CADSTAR_ARCHIVE_PARSER::ATTRIBUTE_LOCATION::LayerID

Definition at line 660 of file cadstar_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::addAttribute().

◆ Mirror

◆ OrientAngle

◆ Position

◆ TextCodeID


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