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 701 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::PIN_NUM_LABEL_LOC, CADSTAR_SCH_ARCHIVE_PARSER::SIGNALREFERENCELINK, and CADSTAR_SCH_ARCHIVE_PARSER::SIGLOC.

Definition at line 1142 of file cadstar_archive_parser.cpp.

1143{
1144 wxASSERT( aNode->GetName() == wxT( "ATTRLOC" ) );
1145
1146 ParseIdentifiers( aNode, aContext );
1147
1148 //Parse child nodes
1149 XNODE* cNode = aNode->GetChildren();
1150
1151 for( ; cNode; cNode = cNode->GetNext() )
1152 {
1153 if( ParseSubNode( cNode, aContext ) )
1154 continue;
1155 else
1156 THROW_UNKNOWN_NODE_IO_ERROR( cNode->GetName(), wxT( "ATTRLOC" ) );
1157 }
1158
1160 THROW_MISSING_NODE_IO_ERROR( wxT( "PT" ), wxT( "ATTRLOC" ) );
1161}
#define THROW_MISSING_NODE_IO_ERROR(nodename, location)
#define THROW_UNKNOWN_NODE_IO_ERROR(nodename, location)
static const long UNDEFINED_VALUE
Hold an XML or S-expression element.
Definition: xnode.h:44
XNODE * GetChildren() const
Definition: xnode.h:62
XNODE * GetNext() const
Definition: xnode.h:67
void ParseIdentifiers(XNODE *aNode, PARSER_CONTEXT *aContext)
bool ParseSubNode(XNODE *aChildNode, PARSER_CONTEXT *aContext)

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

◆ ParseIdentifiers()

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

Definition at line 1110 of file cadstar_archive_parser.cpp.

1112{
1113 TextCodeID = GetXmlAttributeIDString( aNode, 0 );
1114 LayerID = GetXmlAttributeIDString( aNode, 1 );
1115}
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 1118 of file cadstar_archive_parser.cpp.

1120{
1121 wxString cNodeName = aChildNode->GetName();
1122
1123 if( cNodeName == wxT( "PT" ) )
1124 Position.Parse( aChildNode, aContext );
1125 else if( cNodeName == wxT( "ORIENT" ) )
1126 OrientAngle = GetXmlAttributeIDLong( aChildNode, 0 );
1127 else if( cNodeName == wxT( "MIRROR" ) )
1128 Mirror = true;
1129 else if( cNodeName == wxT( "FIX" ) )
1130 Fixed = true;
1131 else if( cNodeName == wxT( "ALIGN" ) )
1132 Alignment = ParseAlignment( aChildNode );
1133 else if( cNodeName == wxT( "JUSTIFICATION" ) )
1134 Justification = ParseJustification( aChildNode );
1135 else
1136 return false;
1137
1138 return true;
1139}
static ALIGNMENT ParseAlignment(XNODE *aNode)
static JUSTIFICATION ParseJustification(XNODE *aNode)
static long GetXmlAttributeIDLong(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
JUSTIFICATION Justification
Note: Justification has no effect on single lines of text.
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

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

◆ Justification

◆ LayerID

LAYER_ID CADSTAR_ARCHIVE_PARSER::ATTRIBUTE_LOCATION::LayerID

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