KiCad PCB EDA Suite
AMODEL Struct Reference

#include <altium_parser_pcb.h>

Public Member Functions

 AMODEL (ALTIUM_PARSER &aReader)
 

Public Attributes

wxString name
 
wxString id
 
bool isEmbedded
 
FP_3DMODEL::VECTOR3D rotation
 

Detailed Description

Definition at line 423 of file altium_parser_pcb.h.

Constructor & Destructor Documentation

◆ AMODEL()

AMODEL::AMODEL ( ALTIUM_PARSER aReader)
explicit

Definition at line 336 of file altium_parser_pcb.cpp.

337 {
338  std::map<wxString, wxString> properties = aReader.ReadProperties();
339 
340  if( properties.empty() )
341  THROW_IO_ERROR( "Classes6 stream has no properties!" );
342 
343  name = ALTIUM_PARSER::ReadString( properties, "NAME", "" );
344  id = ALTIUM_PARSER::ReadString( properties, "ID", "" );
345  isEmbedded = ALTIUM_PARSER::ReadBool( properties, "EMBED", false );
346 
347  rotation.x = ALTIUM_PARSER::ReadDouble( properties, "ROTX", 0. );
348  rotation.y = ALTIUM_PARSER::ReadDouble( properties, "ROTY", 0. );
349  rotation.z = ALTIUM_PARSER::ReadDouble( properties, "ROTZ", 0. );
350 
351  if( aReader.HasParsingError() )
352  THROW_IO_ERROR( "Classes6 stream was not parsed correctly" );
353 }
FP_3DMODEL::VECTOR3D rotation
static double ReadDouble(const std::map< wxString, wxString > &aProps, const wxString &aKey, double aDefault)
std::map< wxString, wxString > ReadProperties()
static bool ReadBool(const std::map< wxString, wxString > &aProps, const wxString &aKey, bool aDefault)
static wxString ReadString(const std::map< wxString, wxString > &aProps, const wxString &aKey, const wxString &aDefault)
#define THROW_IO_ERROR(msg)
Definition: ki_exception.h:38
bool HasParsingError()
wxString name

References ALTIUM_PARSER::HasParsingError(), isEmbedded, name, ALTIUM_PARSER::ReadBool(), ALTIUM_PARSER::ReadDouble(), ALTIUM_PARSER::ReadProperties(), ALTIUM_PARSER::ReadString(), rotation, THROW_IO_ERROR, FP_3DMODEL::VECTOR3D::x, FP_3DMODEL::VECTOR3D::y, and FP_3DMODEL::VECTOR3D::z.

Member Data Documentation

◆ id

wxString AMODEL::id

Definition at line 426 of file altium_parser_pcb.h.

Referenced by ALTIUM_PCB::ParseModelsData().

◆ isEmbedded

bool AMODEL::isEmbedded

Definition at line 427 of file altium_parser_pcb.h.

Referenced by AMODEL().

◆ name

wxString AMODEL::name

Definition at line 425 of file altium_parser_pcb.h.

Referenced by AMODEL(), and ALTIUM_PCB::ParseModelsData().

◆ rotation

FP_3DMODEL::VECTOR3D AMODEL::rotation

Definition at line 429 of file altium_parser_pcb.h.

Referenced by AMODEL().


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