KiCad PCB EDA Suite
ATEXT6 Struct Reference

#include <altium_parser_pcb.h>

Public Member Functions

 ATEXT6 (ALTIUM_PARSER &aReader, std::map< uint32_t, wxString > &aStringTable)
 

Public Attributes

ALTIUM_LAYER layer
 
uint16_t component
 
wxPoint position
 
uint32_t height
 
double rotation
 
uint32_t strokewidth
 
ALTIUM_TEXT_POSITION textposition
 
bool isBold
 
bool isItalic
 
bool isMirrored
 
bool isInverted
 
bool isComment
 
bool isDesignator
 
ALTIUM_TEXT_TYPE fonttype
 
wxString text
 

Detailed Description

Definition at line 641 of file altium_parser_pcb.h.

Constructor & Destructor Documentation

◆ ATEXT6()

ATEXT6::ATEXT6 ( ALTIUM_PARSER aReader,
std::map< uint32_t, wxString > &  aStringTable 
)
explicit

In Altium 14 (subrecord1 == 230) only left bottom is valid? I think there is a bit missing. https://gitlab.com/kicad/code/kicad/merge_requests/60#note_274913397

Definition at line 782 of file altium_parser_pcb.cpp.

783 {
784  ALTIUM_RECORD recordtype = static_cast<ALTIUM_RECORD>( aReader.Read<uint8_t>() );
785 
786  if( recordtype != ALTIUM_RECORD::TEXT )
787  THROW_IO_ERROR( "Texts6 stream has invalid recordtype" );
788 
789  // Subrecord 1 - Properties
790  size_t subrecord1 = aReader.ReadAndSetSubrecordLength();
791 
792  layer = static_cast<ALTIUM_LAYER>( aReader.Read<uint8_t>() );
793  aReader.Skip( 6 );
794  component = aReader.Read<uint16_t>();
795  aReader.Skip( 4 );
796  position = aReader.ReadWxPoint();
797  height = aReader.ReadKicadUnit();
798  aReader.Skip( 2 );
799  rotation = aReader.Read<double>();
800  isMirrored = aReader.Read<uint8_t>() != 0;
801  strokewidth = aReader.ReadKicadUnit();
802  isComment = aReader.Read<uint8_t>() != 0;
803  isDesignator = aReader.Read<uint8_t>() != 0;
804  aReader.Skip( 2 );
805  isBold = aReader.Read<uint8_t>() != 0;
806  isItalic = aReader.Read<uint8_t>() != 0;
807  aReader.Skip( 64 ); // font_name
808  isInverted = aReader.Read<uint8_t>() != 0;
809  aReader.Skip( 4 );
810  uint32_t stringIndex = aReader.Read<uint32_t>();
811  aReader.Skip( 13 );
812  textposition = static_cast<ALTIUM_TEXT_POSITION>( aReader.Read<uint8_t>() );
817  if( subrecord1 <= 230 )
819 
820  aReader.Skip( 27 );
821  fonttype = static_cast<ALTIUM_TEXT_TYPE>( aReader.Read<uint8_t>() );
822 
823  aReader.SkipSubrecord();
824 
825  // Subrecord 2 - Legacy 8bit string, max 255 chars, unknown codepage
826  aReader.ReadAndSetSubrecordLength();
827 
828  auto entry = aStringTable.find( stringIndex );
829 
830  if( entry != aStringTable.end() )
831  text = entry->second;
832  else
833  text = aReader.ReadWxString();
834 
835  // Normalize Windows line endings
836  text.Replace( "\r\n", "\n" );
837 
838  aReader.SkipSubrecord();
839 
840  if( aReader.HasParsingError() )
841  THROW_IO_ERROR( "Texts6 stream was not parsed correctly" );
842 }
bool isDesignator
ALTIUM_LAYER layer
ALTIUM_RECORD
wxString text
uint32_t height
void Skip(size_t aLength)
size_t ReadAndSetSubrecordLength()
wxPoint position
wxPoint ReadWxPoint()
int32_t ReadKicadUnit()
double rotation
ALTIUM_TEXT_POSITION textposition
wxString ReadWxString()
Definition: altium_parser.h:69
void SkipSubrecord()
uint32_t strokewidth
uint16_t component
#define THROW_IO_ERROR(msg)
Definition: ki_exception.h:38
bool HasParsingError()
ALTIUM_TEXT_TYPE fonttype

References component, fonttype, ALTIUM_PARSER::HasParsingError(), height, isBold, isComment, isDesignator, isInverted, isItalic, isMirrored, layer, LEFT_BOTTOM, position, ALTIUM_PARSER::Read(), ALTIUM_PARSER::ReadAndSetSubrecordLength(), ALTIUM_PARSER::ReadKicadUnit(), ALTIUM_PARSER::ReadWxPoint(), ALTIUM_PARSER::ReadWxString(), rotation, ALTIUM_PARSER::Skip(), ALTIUM_PARSER::SkipSubrecord(), strokewidth, TEXT, text, textposition, and THROW_IO_ERROR.

Member Data Documentation

◆ component

uint16_t ATEXT6::component

Definition at line 644 of file altium_parser_pcb.h.

Referenced by ATEXT6(), and ALTIUM_PCB::ParseTexts6Data().

◆ fonttype

ALTIUM_TEXT_TYPE ATEXT6::fonttype

Definition at line 660 of file altium_parser_pcb.h.

Referenced by ATEXT6(), and ALTIUM_PCB::ParseTexts6Data().

◆ height

uint32_t ATEXT6::height

Definition at line 647 of file altium_parser_pcb.h.

Referenced by ATEXT6(), and ALTIUM_PCB::ParseTexts6Data().

◆ isBold

bool ATEXT6::isBold

Definition at line 652 of file altium_parser_pcb.h.

Referenced by ATEXT6(), and ALTIUM_PCB::ParseTexts6Data().

◆ isComment

bool ATEXT6::isComment

Definition at line 657 of file altium_parser_pcb.h.

Referenced by ATEXT6(), and ALTIUM_PCB::ParseTexts6Data().

◆ isDesignator

bool ATEXT6::isDesignator

Definition at line 658 of file altium_parser_pcb.h.

Referenced by ATEXT6(), and ALTIUM_PCB::ParseTexts6Data().

◆ isInverted

bool ATEXT6::isInverted

Definition at line 655 of file altium_parser_pcb.h.

Referenced by ATEXT6().

◆ isItalic

bool ATEXT6::isItalic

Definition at line 653 of file altium_parser_pcb.h.

Referenced by ATEXT6(), and ALTIUM_PCB::ParseTexts6Data().

◆ isMirrored

bool ATEXT6::isMirrored

Definition at line 654 of file altium_parser_pcb.h.

Referenced by ATEXT6(), and ALTIUM_PCB::ParseTexts6Data().

◆ layer

ALTIUM_LAYER ATEXT6::layer

Definition at line 643 of file altium_parser_pcb.h.

Referenced by ATEXT6(), and ALTIUM_PCB::ParseTexts6Data().

◆ position

wxPoint ATEXT6::position

Definition at line 646 of file altium_parser_pcb.h.

Referenced by ATEXT6(), and ALTIUM_PCB::ParseTexts6Data().

◆ rotation

double ATEXT6::rotation

Definition at line 648 of file altium_parser_pcb.h.

Referenced by ATEXT6(), and ALTIUM_PCB::ParseTexts6Data().

◆ strokewidth

uint32_t ATEXT6::strokewidth

Definition at line 649 of file altium_parser_pcb.h.

Referenced by ATEXT6(), and ALTIUM_PCB::ParseTexts6Data().

◆ text

wxString ATEXT6::text

Definition at line 662 of file altium_parser_pcb.h.

Referenced by ATEXT6(), and ALTIUM_PCB::ParseTexts6Data().

◆ textposition

ALTIUM_TEXT_POSITION ATEXT6::textposition

Definition at line 650 of file altium_parser_pcb.h.

Referenced by ATEXT6(), and ALTIUM_PCB::ParseTexts6Data().


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