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

1038 {
1039  wxASSERT( aNode->GetName() == wxT( "ATTRLOC" ) );
1040 
1041  ParseIdentifiers( aNode, aContext );
1042 
1043  //Parse child nodes
1044  XNODE* cNode = aNode->GetChildren();
1045 
1046  for( ; cNode; cNode = cNode->GetNext() )
1047  {
1048  if( ParseSubNode( cNode, aContext ) )
1049  continue;
1050  else
1051  THROW_UNKNOWN_NODE_IO_ERROR( cNode->GetName(), wxT( "ATTRLOC" ) );
1052  }
1053 
1054  if( !Position.IsFullySpecified() )
1055  THROW_MISSING_NODE_IO_ERROR( wxT( "PT" ), wxT( "ATTRLOC" ) );
1056 }
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 1005 of file cadstar_archive_parser.cpp.

1007 {
1008  TextCodeID = GetXmlAttributeIDString( aNode, 0 );
1009  LayerID = GetXmlAttributeIDString( aNode, 1 );
1010 }
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 1013 of file cadstar_archive_parser.cpp.

1015 {
1016  wxString cNodeName = aChildNode->GetName();
1017 
1018  if( cNodeName == wxT( "PT" ) )
1019  Position.Parse( aChildNode, aContext );
1020  else if( cNodeName == wxT( "ORIENT" ) )
1021  OrientAngle = GetXmlAttributeIDLong( aChildNode, 0 );
1022  else if( cNodeName == wxT( "MIRROR" ) )
1023  Mirror = true;
1024  else if( cNodeName == wxT( "FIX" ) )
1025  Fixed = true;
1026  else if( cNodeName == wxT( "ALIGN" ) )
1027  Alignment = ParseAlignment( aChildNode );
1028  else if( cNodeName == wxT( "JUSTIFICATION" ) )
1029  Justification = ParseJustification( aChildNode );
1030  else
1031  return false;
1032 
1033  return true;
1034 }
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 679 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::loadSchematicSymbolInstances(), 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 676 of file cadstar_archive_parser.h.

◆ Justification

◆ LayerID

LAYER_ID CADSTAR_ARCHIVE_PARSER::ATTRIBUTE_LOCATION::LayerID

Definition at line 672 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: