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:

Public Types

enum  STYLE { STYLE::INSIDE, STYLE::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,
627  OUTSIDE
629  };
Text appears outside the dimension line (default)

Member Function Documentation

◆ Parse()

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

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" ) )
1275  Style = STYLE::INSIDE;
1276  else if( styleStr == wxT( "DIMENSION_EXTERNAL" ) )
1278  else
1279  THROW_UNKNOWN_PARAMETER_IO_ERROR( styleStr, wxT( "TXTSTYLE" ) );
1280 
1281  CheckNoNextNodes( cNode );
1282 }
Embedded with the line (the Gap parameter specifies the gap between the text and the end of the line)...
Above the line (the Offset parameter specifies how far above the line the text is) DIMENSION_EXTERNAL...
long TextGap
Specifies the gap between the text and the end of the line.
XNODE * GetChildren() const
Definition: xnode.h:62
long TextOffset
Specifies how far above the line the text is (doesn't have an effect on actual position!...
static long GetXmlAttributeIDLong(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
Hold an XML or S-expression element.
Definition: xnode.h:43
static void CheckNoNextNodes(XNODE *aNode)
#define THROW_UNKNOWN_NODE_IO_ERROR(nodename, location)
static wxString GetXmlAttributeIDString(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
#define THROW_UNKNOWN_PARAMETER_IO_ERROR(param, location)

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: