KiCad PCB EDA Suite
ACOMPONENTBODY6 Struct Reference

#include <altium_parser_pcb.h>

Public Member Functions

 ACOMPONENTBODY6 (ALTIUM_PARSER &aReader)
 

Public Attributes

uint16_t component
 
wxString modelName
 
wxString modelId
 
bool modelIsEmbedded
 
FP_3DMODEL::VECTOR3D modelPosition
 
FP_3DMODEL::VECTOR3D modelRotation
 
double rotation
 
double bodyOpacity
 

Detailed Description

Definition at line 531 of file altium_parser_pcb.h.

Constructor & Destructor Documentation

◆ ACOMPONENTBODY6()

ACOMPONENTBODY6::ACOMPONENTBODY6 ( ALTIUM_PARSER aReader)
explicit

Definition at line 523 of file altium_parser_pcb.cpp.

524 {
525  ALTIUM_RECORD recordtype = static_cast<ALTIUM_RECORD>( aReader.Read<uint8_t>() );
526 
527  if( recordtype != ALTIUM_RECORD::MODEL )
528  THROW_IO_ERROR( "ComponentsBodies6 stream has invalid recordtype" );
529 
530  aReader.ReadAndSetSubrecordLength();
531 
532  aReader.Skip( 7 );
533  component = aReader.Read<uint16_t>();
534  aReader.Skip( 9 );
535 
536  std::map<wxString, wxString> properties = aReader.ReadProperties();
537 
538  if( properties.empty() )
539  THROW_IO_ERROR( "ComponentsBodies6 stream has no properties" );
540 
541  modelName = ALTIUM_PARSER::ReadString( properties, "MODEL.NAME", "" );
542  modelId = ALTIUM_PARSER::ReadString( properties, "MODELID", "" );
543  modelIsEmbedded = ALTIUM_PARSER::ReadBool( properties, "MODEL.EMBED", false );
544 
545  modelPosition.x = ALTIUM_PARSER::ReadKicadUnit( properties, "MODEL.2D.X", "0mil" );
546  modelPosition.y = -ALTIUM_PARSER::ReadKicadUnit( properties, "MODEL.2D.Y", "0mil" );
547  modelPosition.z = ALTIUM_PARSER::ReadKicadUnit( properties, "MODEL.3D.DZ", "0mil" );
548 
549  modelRotation.x = ALTIUM_PARSER::ReadDouble( properties, "MODEL.3D.ROTX", 0. );
550  modelRotation.y = ALTIUM_PARSER::ReadDouble( properties, "MODEL.3D.ROTY", 0. );
551  modelRotation.z = ALTIUM_PARSER::ReadDouble( properties, "MODEL.3D.ROTZ", 0. );
552 
553  rotation = ALTIUM_PARSER::ReadDouble( properties, "MODEL.2D.ROTATION", 0. );
554 
555  bodyOpacity = ALTIUM_PARSER::ReadDouble( properties, "BODYOPACITY3D", 1. );
556 
557  aReader.SkipSubrecord();
558 
559  if( aReader.HasParsingError() )
560  THROW_IO_ERROR( "Components6 stream was not parsed correctly" );
561 }
FP_3DMODEL::VECTOR3D modelPosition
ALTIUM_RECORD
void Skip(size_t aLength)
static double ReadDouble(const std::map< wxString, wxString > &aProps, const wxString &aKey, double aDefault)
size_t ReadAndSetSubrecordLength()
std::map< wxString, wxString > ReadProperties()
static bool ReadBool(const std::map< wxString, wxString > &aProps, const wxString &aKey, bool aDefault)
int32_t ReadKicadUnit()
FP_3DMODEL::VECTOR3D modelRotation
static wxString ReadString(const std::map< wxString, wxString > &aProps, const wxString &aKey, const wxString &aDefault)
void SkipSubrecord()
#define THROW_IO_ERROR(msg)
Definition: ki_exception.h:38
bool HasParsingError()

References bodyOpacity, component, ALTIUM_PARSER::HasParsingError(), MODEL, modelId, modelIsEmbedded, modelName, modelPosition, modelRotation, ALTIUM_PARSER::Read(), ALTIUM_PARSER::ReadAndSetSubrecordLength(), ALTIUM_PARSER::ReadBool(), ALTIUM_PARSER::ReadDouble(), ALTIUM_PARSER::ReadKicadUnit(), ALTIUM_PARSER::ReadProperties(), ALTIUM_PARSER::ReadString(), rotation, ALTIUM_PARSER::Skip(), ALTIUM_PARSER::SkipSubrecord(), THROW_IO_ERROR, FP_3DMODEL::VECTOR3D::x, FP_3DMODEL::VECTOR3D::y, and FP_3DMODEL::VECTOR3D::z.

Member Data Documentation

◆ bodyOpacity

double ACOMPONENTBODY6::bodyOpacity

Definition at line 542 of file altium_parser_pcb.h.

Referenced by ACOMPONENTBODY6(), and ALTIUM_PCB::ParseComponentsBodies6Data().

◆ component

uint16_t ACOMPONENTBODY6::component

Definition at line 533 of file altium_parser_pcb.h.

Referenced by ACOMPONENTBODY6(), and ALTIUM_PCB::ParseComponentsBodies6Data().

◆ modelId

wxString ACOMPONENTBODY6::modelId

Definition at line 536 of file altium_parser_pcb.h.

Referenced by ACOMPONENTBODY6(), and ALTIUM_PCB::ParseComponentsBodies6Data().

◆ modelIsEmbedded

bool ACOMPONENTBODY6::modelIsEmbedded

Definition at line 537 of file altium_parser_pcb.h.

Referenced by ACOMPONENTBODY6(), and ALTIUM_PCB::ParseComponentsBodies6Data().

◆ modelName

wxString ACOMPONENTBODY6::modelName

Definition at line 535 of file altium_parser_pcb.h.

Referenced by ACOMPONENTBODY6().

◆ modelPosition

FP_3DMODEL::VECTOR3D ACOMPONENTBODY6::modelPosition

Definition at line 539 of file altium_parser_pcb.h.

Referenced by ACOMPONENTBODY6(), and ALTIUM_PCB::ParseComponentsBodies6Data().

◆ modelRotation

FP_3DMODEL::VECTOR3D ACOMPONENTBODY6::modelRotation

Definition at line 540 of file altium_parser_pcb.h.

Referenced by ACOMPONENTBODY6(), and ALTIUM_PCB::ParseComponentsBodies6Data().

◆ rotation

double ACOMPONENTBODY6::rotation

Definition at line 541 of file altium_parser_pcb.h.

Referenced by ACOMPONENTBODY6(), and ALTIUM_PCB::ParseComponentsBodies6Data().


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