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

Contains formatting specific for a CADSTAR_PCB_ARCHIVE_PARSER::DIMENSION object. More...

#include <cadstar_pcb_archive_parser.h>

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

Public Types

enum class  STYLE { INSIDE , OUTSIDE }
 < Token "TXTSTYLE" More...
 

Public Member Functions

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

Public Attributes

STYLE Style
 
long TextGap
 Specifies the gap between the text and the end of the line. More...
 
long TextOffset
 Specifies how far above the line the text is (doesn't have an effect on actual position!) More...
 

Detailed Description

Contains formatting specific for a CADSTAR_PCB_ARCHIVE_PARSER::DIMENSION object.

Note that none of the parameters has any effect on the position of the dimension text - it is more of an "intention" of where it should be placed. The user can manually drag the location of the dimension text. Therefore, the actual position of the dimension text is as defined in the Text object within CADSTAR_PCB_ARCHIVE_PARSER::DIMENSION.

However, TEXTFORMAT does specifify TextGap (i.e. how far to pull back the dimension line from the dimension text which does get used when the dimension text is placed on top of the dimension line, if the dimension line is STYLE::INTERNAL).

Note: the token is "DIMTEXT" in the CADSTAR format, but this has been renamed to TEXTFORMAT in the cadstar2kicadplugin for ease of understanding.

Definition at line 622 of file cadstar_pcb_archive_parser.h.

Member Enumeration Documentation

◆ STYLE

< Token "TXTSTYLE"

Enumerator
INSIDE 

Embedded with the line (the Gap parameter specifies the gap between the text and the end of the line) DIMENSION_INTERNAL.

OUTSIDE 

Above the line (the Offset parameter specifies how far above the line the text is) DIMENSION_EXTERNAL.

Definition at line 624 of file cadstar_pcb_archive_parser.h.

625 {
626 INSIDE,
628 OUTSIDE
630 };
@ OUTSIDE
Text appears outside the dimension line (default)

Member Function Documentation

◆ Parse()

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

Implements CADSTAR_ARCHIVE_PARSER::PARSER.

Definition at line 1259 of file cadstar_pcb_archive_parser.cpp.

1261{
1262 wxASSERT( aNode->GetName() == wxT( "DIMTEXT" ) );
1263
1264 TextGap = GetXmlAttributeIDLong( aNode, 1 );
1265 TextOffset = GetXmlAttributeIDLong( aNode, 2 );
1266
1267 XNODE* cNode = aNode->GetChildren();
1268
1269 if( cNode->GetName() != wxT( "TXTSTYLE" ) )
1270 THROW_UNKNOWN_NODE_IO_ERROR( cNode->GetName(), wxT( "DIMTEXT" ) );
1271
1272 wxString styleStr = GetXmlAttributeIDString( cNode, 0 );
1273
1274 if( styleStr == wxT( "DIMENSION_INTERNAL" ) )
1276 else if( styleStr == wxT( "DIMENSION_EXTERNAL" ) )
1278 else
1279 THROW_UNKNOWN_PARAMETER_IO_ERROR( styleStr, wxT( "TXTSTYLE" ) );
1280
1281 CheckNoNextNodes( cNode );
1282}
#define THROW_UNKNOWN_NODE_IO_ERROR(nodename, location)
#define THROW_UNKNOWN_PARAMETER_IO_ERROR(param, location)
static void CheckNoNextNodes(XNODE *aNode)
static wxString GetXmlAttributeIDString(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
static long GetXmlAttributeIDLong(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
Hold an XML or S-expression element.
Definition: xnode.h:44
XNODE * GetChildren() const
Definition: xnode.h:62
long TextGap
Specifies the gap between the text and the end of the line.
long TextOffset
Specifies how far above the line the text is (doesn't have an effect on actual position!...
@ INSIDE
Embedded with the line (the Gap parameter specifies the gap between the text and the end of the line)...
@ OUTSIDE
Above the line (the Offset parameter specifies how far above the line the text is) DIMENSION_EXTERNAL...

References CADSTAR_ARCHIVE_PARSER::CheckNoNextNodes(), XNODE::GetChildren(), CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDLong(), CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDString(), THROW_UNKNOWN_NODE_IO_ERROR, and THROW_UNKNOWN_PARAMETER_IO_ERROR.

Member Data Documentation

◆ Style

STYLE CADSTAR_PCB_ARCHIVE_PARSER::DIMENSION::TEXTFORMAT::Style

Definition at line 632 of file cadstar_pcb_archive_parser.h.

◆ TextGap

long CADSTAR_PCB_ARCHIVE_PARSER::DIMENSION::TEXTFORMAT::TextGap

Specifies the gap between the text and the end of the line.

Definition at line 633 of file cadstar_pcb_archive_parser.h.

◆ TextOffset

long CADSTAR_PCB_ARCHIVE_PARSER::DIMENSION::TEXTFORMAT::TextOffset

Specifies how far above the line the text is (doesn't have an effect on actual position!)

Definition at line 634 of file cadstar_pcb_archive_parser.h.


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