KiCad PCB EDA Suite
Loading...
Searching...
No Matches
altium_parser_pcb.cpp File Reference
#include <map>
#include <unordered_map>
#include <ki_exception.h>
#include <math/util.h>
#include <wx/log.h>
#include <wx/translation.h>
#include "altium_parser_pcb.h"
#include "io/altium/altium_binary_parser.h"
#include "io/altium/altium_props_utils.h"

Go to the source code of this file.

Functions

ALTIUM_LAYER altium_versioned_layer (ALTIUM_LAYER aV6Layer, ALTIUM_LAYER aV7Layer)
 
bool altiumScopeExprMatchesPolygon (const wxString &aExpr)
 Return true if an Altium rule scope expression targets polygon pour primitives (matches InPolygon, InPoly, IsPolygon, or IsPoly).
 
const ARULE6selectAltiumPolygonRule (const std::vector< ARULE6 > &aRulesByPriorityAsc)
 Select the highest Altium-priority rule whose scope references polygons.
 
ALTIUM_LAYER altium_layer_from_name (const wxString &aName)
 
ALTIUM_MECHKIND altium_mechkind_from_name (const wxString &aName)
 
void altium_parse_polygons (std::map< wxString, wxString > &aProps, std::vector< ALTIUM_VERTICE > &aVertices)
 
static ALTIUM_MODE ReadAltiumModeFromProperties (const std::map< wxString, wxString > &aProps, wxString aKey)
 
static ALTIUM_RECORD ReadAltiumRecordFromProperties (const std::map< wxString, wxString > &aProps, wxString aKey)
 
static AEXTENDED_PRIMITIVE_INFORMATION_TYPE ReadAltiumExtendedPrimitiveInformationTypeFromProperties (const std::map< wxString, wxString > &aProps, wxString aKey)
 
static void ExpectSubrecordLengthAtLeast (const std::string &aStreamType, const std::string &aSubrecordName, size_t aExpectedLength, size_t aActualLength)
 Throw an IO_ERROR if the actual length is less than the expected length.
 
static std::vector< ABOARD6_LAYER_STACKUPReadAltiumStackupFromProperties (const std::map< wxString, wxString > &aProps)
 

Variables

static const wxChar * traceAltiumImport = wxT( "KICAD_ALTIUM_IMPORT" )
 Flag to enable Altium importer logging.
 

Function Documentation

◆ altium_layer_from_name()

◆ altium_mechkind_from_name()

◆ altium_parse_polygons()

void altium_parse_polygons ( std::map< wxString, wxString > & aProps,
std::vector< ALTIUM_VERTICE > & aVertices )

◆ altium_versioned_layer()

◆ altiumScopeExprMatchesPolygon()

bool altiumScopeExprMatchesPolygon ( const wxString & aExpr)

Return true if an Altium rule scope expression targets polygon pour primitives (matches InPolygon, InPoly, IsPolygon, or IsPoly).

Definition at line 61 of file altium_parser_pcb.cpp.

Referenced by BOOST_AUTO_TEST_CASE(), and selectAltiumPolygonRule().

◆ ExpectSubrecordLengthAtLeast()

static void ExpectSubrecordLengthAtLeast ( const std::string & aStreamType,
const std::string & aSubrecordName,
size_t aExpectedLength,
size_t aActualLength )
static

Throw an IO_ERROR if the actual length is less than the expected length.

Parameters
aStreamTypethe current stream type (e.g. 'Pads6')
aSubrecordNamethe current subrecord name (e.g. 'subrecord5')
aExpectedLengththe expected length needed to parse the stream
aActualLengththe actual length of the subrecord encountered

Definition at line 361 of file altium_parser_pcb.cpp.

References THROW_IO_ERROR.

Referenced by APAD6::APAD6().

◆ ReadAltiumExtendedPrimitiveInformationTypeFromProperties()

static AEXTENDED_PRIMITIVE_INFORMATION_TYPE ReadAltiumExtendedPrimitiveInformationTypeFromProperties ( const std::map< wxString, wxString > & aProps,
wxString aKey )
static

◆ ReadAltiumModeFromProperties()

static ALTIUM_MODE ReadAltiumModeFromProperties ( const std::map< wxString, wxString > & aProps,
wxString aKey )
static

◆ ReadAltiumRecordFromProperties()

static ALTIUM_RECORD ReadAltiumRecordFromProperties ( const std::map< wxString, wxString > & aProps,
wxString aKey )
static

◆ ReadAltiumStackupFromProperties()

static std::vector< ABOARD6_LAYER_STACKUP > ReadAltiumStackupFromProperties ( const std::map< wxString, wxString > & aProps)
static

Definition at line 427 of file altium_parser_pcb.cpp.

Referenced by ABOARD6::ABOARD6(), and ALIBRARY::ALIBRARY().

◆ selectAltiumPolygonRule()

const ARULE6 * selectAltiumPolygonRule ( const std::vector< ARULE6 > & aRulesByPriorityAsc)

Select the highest Altium-priority rule whose scope references polygons.

Altium priority 1 is the most specific; larger numeric values are more general. aRulesByPriorityAsc must be sorted by ARULE6::priority in ascending numeric order so the first polygon-scoped match is also the highest Altium priority.

Returns nullptr if no rule references polygons.

Definition at line 69 of file altium_parser_pcb.cpp.

References altiumScopeExprMatchesPolygon().

Referenced by BOOST_AUTO_TEST_CASE(), and ALTIUM_PCB::GetRuleForPolygon().