KiCad PCB EDA Suite
Loading...
Searching...
No Matches
ALLEGRO::BOARD_BUILDER Class Reference

Class that builds a KiCad board from a BRD_DB (= FILE_HEADER + STRINGS + OBJECTS + bookkeeping) More...

#include <allegro_builder.h>

Classes

class  GRAPHIC_DEDUP
 Rejects graphics that repeat one already accepted into the same container. More...
 
struct  GRAPHIC_KEY_EQ
 
struct  GRAPHIC_KEY_HASH
 
class  ZONE_FILL_HANDLER
 Filled zones have their own outline and the fill itself comes from a bunch of "related" spaces. More...
 
struct  ZoneFillEntry
 

Public Member Functions

 BOARD_BUILDER (const BRD_DB &aBrdDb, BOARD &aBoard, REPORTER &aReporter, PROGRESS_REPORTER *aProgressReporter, const LAYER_MAPPING_HANDLER &aLayerMappingHandler)
 
 ~BOARD_BUILDER ()
 
bool BuildBoard ()
 

Private Member Functions

VECTOR2I scale (const VECTOR2I &aVector) const
 
VECTOR2I scaleSize (const VECTOR2I &aSize) const
 
int scale (int aVal) const
 
template<ALLEGRO_BLOCK_DATA T>
const TexpectBlockByKey (uint32_t aKey) const
 Get a block by its key, and check that it is of the expected type.
 
void reportMissingBlock (uint32_t aKey, uint8_t aType) const
 
void reportUnexpectedBlockType (uint8_t aGot, uint8_t aExpected, uint32_t aKey=0, size_t aOffset=0, const wxString &aName=wxEmptyString) const
 
PCB_LAYER_ID getLayer (const LAYER_INFO &aLayerInfo) const
 
wxString get0x30StringValue (uint32_t a0x30Key) const
 Get just the string value from a 0x31 STRING WRAPPER -> 0x30 STRING GRAPHIC pair.
 
std::unique_ptr< PCB_SHAPEbuildLineSegment (const BLK_0x15_16_17_SEGMENT &aSegment, const LAYER_INFO &aLayerInfo, PCB_LAYER_ID aLayer, BOARD_ITEM_CONTAINER &aParent)
 Build a single line segment.
 
std::unique_ptr< PCB_SHAPEbuildArc (const BLK_0x01_ARC &aArc, const LAYER_INFO &aLayerInfo, PCB_LAYER_ID aLayer, BOARD_ITEM_CONTAINER &aParent)
 
std::vector< std::unique_ptr< PCB_SHAPE > > buildShapes (const BLK_0x14_GRAPHIC &aGraphicList, BOARD_ITEM_CONTAINER &aParent)
 Build the shapes from an 0x14 shape list.
 
std::unique_ptr< PCB_TEXTbuildPcbText (const BLK_0x30_STR_WRAPPER &aStrWrapper, BOARD_ITEM_CONTAINER &aParent)
 
std::unique_ptr< PCB_SHAPEbuildRect (const BLK_0x24_RECT &aRect, BOARD_ITEM_CONTAINER &aParent)
 Build a rectangular shape from a 0x24 RECT block.
 
std::unique_ptr< PCB_SHAPEbuildRect (const BLK_0x0E_RECT &aShape, BOARD_ITEM_CONTAINER &aParent)
 Build a graphic polygon from a 0x0E RECT block.
 
std::unique_ptr< PCB_SHAPEbuildPolygon (const BLK_0x28_SHAPE &aShape, BOARD_ITEM_CONTAINER &aParent)
 Build a graphic polygon from a 0x28 SHAPE block.
 
std::vector< std::unique_ptr< PCB_SHAPE > > buildPolygonShapes (const BLK_0x28_SHAPE &aShape, BOARD_ITEM_CONTAINER &aParent)
 Build graphics from an 0x28 SHAPE, with separate items per segment/arc.
 
std::vector< std::unique_ptr< BOARD_ITEM > > buildDrillMarker (const BLK_0x0C_PIN_DEF &aPinDef, BOARD_ITEM_CONTAINER &aParent)
 Build a drill marker from a 0x0C PIN_DEF block.
 
std::vector< std::unique_ptr< BOARD_ITEM > > buildGraphicItems (const BLOCK_BASE &aBlock, BOARD_ITEM_CONTAINER &aParent)
 Build a list of graphic items, e.g.
 
std::vector< std::unique_ptr< BOARD_ITEM > > buildPadItems (const BLK_0x1C_PADSTACK &aPadstack, FOOTPRINT &aFp, const wxString &aPadName, int aNetcode)
 Construct "pad" items for a given 0x1C PADSTACK block.
 
std::unique_ptr< FOOTPRINTbuildFootprint (const BLK_0x2D_FOOTPRINT_INST &aFpInstance)
 
std::vector< std::unique_ptr< BOARD_ITEM > > buildTrack (const BLK_0x05_TRACK &aBlock, int aNetcode)
 
std::unique_ptr< BOARD_ITEMbuildVia (const BLK_0x33_VIA &aBlock, int aNetcode)
 
std::unique_ptr< ZONEbuildZone (const BLOCK_BASE &aBoundaryBlock, const std::vector< const BLOCK_BASE * > &aRelatedBlocks, ZONE_FILL_HANDLER &aZoneFillHandler, BOARD_ITEM_CONTAINER &aParent)
 Build a ZONE from an 0x0E, 0x24 or 0x28 block.
 
SHAPE_LINE_CHAIN buildOutline (const BLK_0x0E_RECT &aRect, const TRANSFORM_TRS &aXform=TRANSFORM_TRS()) const
 
SHAPE_LINE_CHAIN buildOutline (const BLK_0x24_RECT &aRect, const TRANSFORM_TRS &aXform=TRANSFORM_TRS()) const
 
SHAPE_LINE_CHAIN buildOutline (const BLK_0x28_SHAPE &aShape, const TRANSFORM_TRS &aXform=TRANSFORM_TRS()) const
 
SHAPE_POLY_SET shapeToPolySet (const BLK_0x28_SHAPE &aShape, const TRANSFORM_TRS &aXform=TRANSFORM_TRS()) const
 
SHAPE_POLY_SET tryBuildZoneShape (const BLOCK_BASE &aBlock, const TRANSFORM_TRS &aXform=TRANSFORM_TRS()) const
 Try to build a zone shape for the given block, with holes.
 
SHAPE_LINE_CHAIN buildSegmentChain (uint32_t aStartKey, const TRANSFORM_TRS &aXform=TRANSFORM_TRS()) const
 Walk a geometry chain (0x01 arcs and 0x15-17 segments) starting from the given key, following m_Next links.
 
std::vector< const BLOCK_BASE * > getShapeRelatedBlocks (const BLK_0x28_SHAPE &aShape) const
 Get blocks that are related to the BOUNDARY shape, i.e.
 
wxString resolveMatchGroupName (const BLK_0x1B_NET &aNet) const
 Follow m_MatchGroupPtr through the 0x26/0x2C pointer chain to get the match group name for a NET.
 
wxString resolveConstraintSetNameFromField (uint32_t aFieldKey) const
 Extract constraint set name from a 0x03 FIELD block pointer.
 
void cacheFontDefs ()
 
void setupLayers ()
 
void createNets ()
 
void createTracks ()
 
void createBoardShapes ()
 
void createBoardText ()
 
void createZones ()
 
void createTables ()
 
void applyZoneFills ()
 
void enablePadTeardrops ()
 
void applyConstraintSets ()
 
void applyNetConstraints ()
 
void applyMatchGroups ()
 
const BLK_0x36_DEF_TABLE::FontDef_X08getFontDef (unsigned aIndex) const
 Get the font definition for a given index in a 0x30, etc.
 
const BLK_0x07_COMPONENT_INSTgetFpInstRef (const BLK_0x2D_FOOTPRINT_INST &aFpInstance) const
 Look up 0x07 FP instance data (0x07) for a given 0x2D FP instance.
 

Static Private Member Functions

static void stampIds (BOARD_ITEM &aItem, uint32_t aKey, uint32_t &aSeq)
 Give aItem and its children ids derived from the Allegro block they came from.
 
static void stampIds (BOARD_ITEM &aItem, uint32_t aKey)
 

Private Attributes

GRAPHIC_DEDUP m_boardGraphics
 Coincidence filter for everything added straight to the board, which is one container.
 
const BRD_DBm_brdDb
 
BOARDm_board
 
REPORTERm_reporter
 
PROGRESS_REPORTERm_progressReporter
 
LAYER_MAPPING_HANDLER m_layerMappingHandler
 
std::vector< const BLK_0x36_DEF_TABLE::FontDef_X08 * > m_fontDefList
 
std::unordered_map< uint32_t, NETINFO_ITEM * > m_netCache
 
std::unordered_map< uint32_t, ZoneFillEntrym_zoneFillShapes
 
std::unordered_set< uint32_t > m_usedZoneFillShapes
 
std::unique_ptr< LAYER_MAPPERm_layerMapper
 
std::unordered_map< uint32_t, SHAPE_LINE_CHAINm_outlineCache
 
std::unordered_map< uint32_t, SHAPE_LINE_CHAINm_segChainCache
 
double m_scale
 

Detailed Description

Class that builds a KiCad board from a BRD_DB (= FILE_HEADER + STRINGS + OBJECTS + bookkeeping)

Definition at line 56 of file allegro_builder.h.

Constructor & Destructor Documentation

◆ BOARD_BUILDER()

BOARD_BUILDER::BOARD_BUILDER ( const BRD_DB & aBrdDb,
BOARD & aBoard,
REPORTER & aReporter,
PROGRESS_REPORTER * aProgressReporter,
const LAYER_MAPPING_HANDLER & aLayerMappingHandler )

◆ ~BOARD_BUILDER()

BOARD_BUILDER::~BOARD_BUILDER ( )

Definition at line 1071 of file allegro_builder.cpp.

Member Function Documentation

◆ applyConstraintSets()

◆ applyMatchGroups()

◆ applyNetConstraints()

◆ applyZoneFills()

◆ buildArc()

◆ BuildBoard()

◆ buildDrillMarker()

◆ buildFootprint()

std::unique_ptr< FOOTPRINT > BOARD_BUILDER::buildFootprint ( const BLK_0x2D_FOOTPRINT_INST & aFpInstance)
private

Definition at line 3070 of file allegro_builder.cpp.

References APPEND, ALLEGRO::LAYER_INFO::ASSEMBLY_BOTTOM, ALLEGRO::LAYER_INFO::ASSEMBLY_TOP, B_CrtYd, buildGraphicItems(), buildPadItems(), buildPcbText(), buildShapes(), buildZone(), ALLEGRO::LAYER_INFO::COMPONENT_VALUE, ALLEGRO::LAYER_INFO::DEVICE_TYPE, expectBlockByKey(), F_CrtYd, fromMillidegrees(), getFpInstRef(), PCB_SHAPE::GetLayer(), ALLEGRO::BOARD_BUILDER::GRAPHIC_DEDUP::IsFirst(), layerIsZone(), LEFT_RIGHT, ALLEGRO::LOG_TRACE, ALLEGRO::BLK_0x2D_FOOTPRINT_INST::m_AreasPtr, ALLEGRO::BLK_0x2D_FOOTPRINT_INST::m_AssemblyPtr, m_board, m_brdDb, ALLEGRO::BLK_0x0D_PAD::m_CoordsX, ALLEGRO::BLK_0x0D_PAD::m_CoordsY, ALLEGRO::BLK_0x2D_FOOTPRINT_INST::m_CoordX, ALLEGRO::BLK_0x2D_FOOTPRINT_INST::m_CoordY, ALLEGRO::BLK_0x2D_FOOTPRINT_INST::m_FirstPadPtr, ALLEGRO::BLK_0x2D_FOOTPRINT_INST::m_GraphicPtr, ALLEGRO::BLK_0x2D_FOOTPRINT_INST::m_Key, ALLEGRO::BLK_0x2D_FOOTPRINT_INST::m_Layer, ALLEGRO::BLK_0x0D_PAD::m_NameStrId, ALLEGRO::BLK_0x04_NET_ASSIGNMENT::m_Net, m_netCache, ALLEGRO::BLK_0x0D_PAD::m_PadStack, ALLEGRO::BLK_0x07_COMPONENT_INST::m_RefDesStrPtr, m_reporter, ALLEGRO::BLK_0x0D_PAD::m_Rotation, ALLEGRO::BLK_0x2D_FOOTPRINT_INST::m_Rotation, ALLEGRO::BLK_0x2D_FOOTPRINT_INST::m_TextPtr, pad, PadGetNextInFootprint(), PCB_PAD_T, PCB_SHAPE_T, ALLEGRO::LAYER_INFO::REF_DES, REFERENCE, ALLEGRO::REPORT, RPT_SEVERITY_WARNING, scale, EDA_SHAPE::SetFilled(), ALLEGRO::TYPED_LL_WALKER< T >::SetMismatchReporter(), EDA_TEXT::SetText(), PCB_TEXT::SetTextAngle(), EDA_TEXT::SetVisible(), ALLEGRO::LAYER_INFO::SILKSCREEN_BOTTOM, ALLEGRO::LAYER_INFO::SILKSCREEN_TOP, text, ALLEGRO::THROW, ALLEGRO::LAYER_INFO::TOLERANCE, traceAllegroBuilder, tryLayerFromBlock(), NETINFO_LIST::UNCONNECTED, USER, ALLEGRO::LAYER_INFO::USER_PART_NUMBER, and VALUE.

Referenced by BuildBoard().

◆ buildGraphicItems()

std::vector< std::unique_ptr< BOARD_ITEM > > BOARD_BUILDER::buildGraphicItems ( const BLOCK_BASE & aBlock,
BOARD_ITEM_CONTAINER & aParent )
private

Build a list of graphic items, e.g.

from a table's pointer list.

Definition at line 2107 of file allegro_builder.cpp.

References ALLEGRO::BlockDataAs(), buildDrillMarker(), buildPcbText(), buildPolygon(), buildRect(), buildShapes(), ALLEGRO::BLOCK_BASE::GetBlockType(), and traceAllegroBuilder.

Referenced by buildFootprint(), and createTables().

◆ buildLineSegment()

◆ buildOutline() [1/3]

◆ buildOutline() [2/3]

◆ buildOutline() [3/3]

SHAPE_LINE_CHAIN BOARD_BUILDER::buildOutline ( const BLK_0x28_SHAPE & aShape,
const TRANSFORM_TRS & aXform = TRANSFORM_TRS() ) const
private

◆ buildPadItems()

std::vector< std::unique_ptr< BOARD_ITEM > > BOARD_BUILDER::buildPadItems ( const BLK_0x1C_PADSTACK & aPadstack,
FOOTPRINT & aFp,
const wxString & aPadName,
int aNetcode )
private

Construct "pad" items for a given 0x1C PADSTACK block.

Definition at line 2504 of file allegro_builder.cpp.

References std::abs(), ALLEGRO::BLK_0x1C_PADSTACK::ANTIPAD, SHAPE_LINE_CHAIN::Append(), B_Cu, B_Mask, B_Paste, SHAPE_LINE_CHAIN::BBox(), buildSegmentChain(), CHAMFERED_RECT, CIRCLE, PADSTACK::CopperLayer(), CUSTOM, PADSTACK::CUSTOM, PADSTACK::Drill(), expectBlockByKey(), F_Cu, F_Mask, F_Paste, PADSTACK::FRONT_INNER_BACK, ALLEGRO::BLK_0x1C_PADSTACK::GetDrillSize(), BOX2< Vec >::GetHeight(), ALLEGRO::BLK_0x1C_PADSTACK::GetLayerCount(), BOX2< Vec >::GetWidth(), In1_Cu, ALLEGRO::BLK_0x1C_PADSTACK::IsPlated(), m_brdDb, ALLEGRO::BLK_0x1C_PADSTACK::m_Components, ALLEGRO::BLK_0x28_SHAPE::m_FirstSegmentPtr, ALLEGRO::PADSTACK_COMPONENT::m_H, ALLEGRO::BLK_0x1C_PADSTACK::m_Header, ALLEGRO::BLK_0x1C_PADSTACK::m_NumCompsPerLayer, ALLEGRO::BLK_0x1C_PADSTACK::m_NumFixedCompEntries, ALLEGRO::PADSTACK_COMPONENT::m_OffsetX, ALLEGRO::PADSTACK_COMPONENT::m_OffsetY, ALLEGRO::BLK_0x1C_PADSTACK::m_PadStr, m_reporter, ALLEGRO::PADSTACK_COMPONENT::m_ShapePtr, ALLEGRO::PADSTACK_COMPONENT::m_Type, ALLEGRO::PADSTACK_COMPONENT::m_W, ALLEGRO::PADSTACK_COMPONENT::m_Z1, PADSTACK::NORMAL, NPTH, nthCopperLayerId(), OBLONG, OVAL, ALLEGRO::BLK_0x1C_PADSTACK::PAD, pad, ALLEGRO::BLK_0x1C_PADSTACK::PASTEMASK_BOT_V17X, ALLEGRO::BLK_0x1C_PADSTACK::PASTEMASK_TOP_V165, ALLEGRO::BLK_0x1C_PADSTACK::PASTEMASK_TOP_V16X, ALLEGRO::BLK_0x1C_PADSTACK::PASTEMASK_TOP_V17X, SHAPE_LINE_CHAIN::PointCount(), POLY, PTH, PAD::PTHMask(), RECT_CHAMFER_ALL, RECTANGLE, ROUNDRECT, RPT_SEVERITY_WARNING, S, scale, scaleSize(), SHAPE_LINE_CHAIN::SetClosed(), PADSTACK::SetLayerSet(), PADSTACK::SetMode(), PADSTACK::DRILL_PROPS::shape, PADSTACK::DRILL_PROPS::size, SMD, PAD::SMDMask(), ALLEGRO::BLK_0x1C_PADSTACK::SOLDERMASK_BOT_V17X, ALLEGRO::BLK_0x1C_PADSTACK::SOLDERMASK_TOP_V165, ALLEGRO::BLK_0x1C_PADSTACK::SOLDERMASK_TOP_V16X, ALLEGRO::BLK_0x1C_PADSTACK::SOLDERMASK_TOP_V17X, ALLEGRO::BLK_0x1C_PADSTACK::THERMAL_RELIEF, traceAllegroBuilder, ALLEGRO::PADSTACK_COMPONENT::TYPE_CHAMFERED_RECTANGLE, ALLEGRO::PADSTACK_COMPONENT::TYPE_CIRCLE, ALLEGRO::PADSTACK_COMPONENT::TYPE_NULL, ALLEGRO::PADSTACK_COMPONENT::TYPE_OBLONG_X, ALLEGRO::PADSTACK_COMPONENT::TYPE_OBLONG_Y, ALLEGRO::PADSTACK_COMPONENT::TYPE_OCTAGON, ALLEGRO::PADSTACK_COMPONENT::TYPE_PENTAGON, ALLEGRO::PADSTACK_COMPONENT::TYPE_RECTANGLE, ALLEGRO::PADSTACK_COMPONENT::TYPE_ROUNDED_RECTANGLE, ALLEGRO::PADSTACK_COMPONENT::TYPE_SHAPE_SYMBOL, ALLEGRO::PADSTACK_COMPONENT::TYPE_SQUARE, PAD::UnplatedHoleMask(), ALLEGRO::V_165, and ALLEGRO::V_172.

Referenced by buildFootprint().

◆ buildPcbText()

◆ buildPolygon()

std::unique_ptr< PCB_SHAPE > BOARD_BUILDER::buildPolygon ( const BLK_0x28_SHAPE & aShape,
BOARD_ITEM_CONTAINER & aParent )
private

Build a graphic polygon from a 0x28 SHAPE block.

Definition at line 2371 of file allegro_builder.cpp.

References buildOutline(), chain, getLayer(), ALLEGRO::BLK_0x28_SHAPE::m_Key, ALLEGRO::BLK_0x28_SHAPE::m_Layer, POLY, and traceAllegroBuilder.

Referenced by buildGraphicItems().

◆ buildPolygonShapes()

std::vector< std::unique_ptr< PCB_SHAPE > > BOARD_BUILDER::buildPolygonShapes ( const BLK_0x28_SHAPE & aShape,
BOARD_ITEM_CONTAINER & aParent )
private

◆ buildRect() [1/2]

std::unique_ptr< PCB_SHAPE > BOARD_BUILDER::buildRect ( const BLK_0x0E_RECT & aShape,
BOARD_ITEM_CONTAINER & aParent )
private

Build a graphic polygon from a 0x0E RECT block.

Definition at line 2346 of file allegro_builder.cpp.

References fromMillidegrees(), getLayer(), ALLEGRO::BLK_0x0E_RECT::m_Coords, ALLEGRO::BLK_0x0E_RECT::m_Layer, ALLEGRO::BLK_0x0E_RECT::m_Rotation, RECTANGLE, and scale.

◆ buildRect() [2/2]

std::unique_ptr< PCB_SHAPE > BOARD_BUILDER::buildRect ( const BLK_0x24_RECT & aRect,
BOARD_ITEM_CONTAINER & aParent )
private

◆ buildSegmentChain()

SHAPE_LINE_CHAIN BOARD_BUILDER::buildSegmentChain ( uint32_t aStartKey,
const TRANSFORM_TRS & aXform = TRANSFORM_TRS() ) const
private

Walk a geometry chain (0x01 arcs and 0x15-17 segments) starting from the given key, following m_Next links.

Used for building hole outlines from 0x34 KEEPOUT blocks. Identity transforms are cached by start key; non-identity transforms are built fresh.

Definition at line 3775 of file allegro_builder.cpp.

References ANGLE_0, ANGLE_360, SHAPE_LINE_CHAIN::Append(), TRANSFORM_TRS::Apply(), ALLEGRO::BlockDataAs(), center, SHAPE_LINE_CHAIN::CLastPoint(), end, ALLEGRO::BLOCK_BASE::GetBlockType(), TRANSFORM_TRS::IsIdentity(), KiROUND(), m_brdDb, m_segChainCache, EDA_ANGLE::Normalize(), SHAPE_LINE_CHAIN::PointCount(), RotatePoint(), and scale.

Referenced by buildOutline(), buildPadItems(), shapeToPolySet(), and tryBuildZoneShape().

◆ buildShapes()

std::vector< std::unique_ptr< PCB_SHAPE > > BOARD_BUILDER::buildShapes ( const BLK_0x14_GRAPHIC & aGraphicList,
BOARD_ITEM_CONTAINER & aParent )
private

◆ buildTrack()

◆ buildVia()

◆ buildZone()

◆ cacheFontDefs()

void BOARD_BUILDER::cacheFontDefs ( )
private

Definition at line 1156 of file allegro_builder.cpp.

References m_brdDb, m_fontDefList, m_reporter, and RPT_SEVERITY_WARNING.

Referenced by BuildBoard().

◆ createBoardShapes()

◆ createBoardText()

void BOARD_BUILDER::createBoardText ( )
private

Definition at line 4216 of file allegro_builder.cpp.

References APPEND, buildPcbText(), m_board, m_boardGraphics, m_brdDb, stampIds(), text, and traceAllegroBuilder.

Referenced by BuildBoard().

◆ createNets()

void BOARD_BUILDER::createNets ( )
private

Definition at line 1187 of file allegro_builder.cpp.

References BULK_APPEND, ALLEGRO::LOG_TRACE, m_board, m_brdDb, m_netCache, and traceAllegroBuilder.

Referenced by BuildBoard().

◆ createTables()

◆ createTracks()

◆ createZones()

◆ enablePadTeardrops()

void BOARD_BUILDER::enablePadTeardrops ( )
private

◆ expectBlockByKey()

template<ALLEGRO_BLOCK_DATA T>
const T * ALLEGRO::BOARD_BUILDER::expectBlockByKey ( uint32_t aKey) const
inlineprivate

Get a block by its key, and check that it is of the expected type.

Template Parameters
Tmust be a BLOCK_DATA struct with a BLOCK_TYPE_CODE member

Definition at line 77 of file allegro_builder.h.

References ALLEGRO::BLOCK_BASE::GetBlockType(), ALLEGRO::BLOCK< T >::GetData(), ALLEGRO::BLOCK_BASE::GetOffset(), m_brdDb, reportMissingBlock(), reportUnexpectedBlockType(), and T.

Referenced by buildFootprint(), buildPadItems(), buildPcbText(), buildVia(), get0x30StringValue(), getFpInstRef(), getShapeRelatedBlocks(), resolveMatchGroupName(), and setupLayers().

◆ get0x30StringValue()

wxString BOARD_BUILDER::get0x30StringValue ( uint32_t a0x30Key) const
private

Get just the string value from a 0x31 STRING WRAPPER -> 0x30 STRING GRAPHIC pair.

Throws away all the other string data like pos/size/etc.

Definition at line 1140 of file allegro_builder.cpp.

References expectBlockByKey(), ALLEGRO::BLK_0x30_STR_WRAPPER::m_StrGraphicPtr, ALLEGRO::BLK_0x31_SGRAPHIC::m_Value, and THROW_IO_ERROR.

◆ getFontDef()

const BLK_0x36_DEF_TABLE::FontDef_X08 * BOARD_BUILDER::getFontDef ( unsigned aIndex) const
private

Get the font definition for a given index in a 0x30, etc.

Returns
the definition if it exists, else nullptr (which is probably an error in the importer logic)

Definition at line 1773 of file allegro_builder.cpp.

References m_fontDefList, m_reporter, and RPT_SEVERITY_WARNING.

Referenced by buildPcbText().

◆ getFpInstRef()

const BLK_0x07_COMPONENT_INST * BOARD_BUILDER::getFpInstRef ( const BLK_0x2D_FOOTPRINT_INST & aFpInstance) const
private

Look up 0x07 FP instance data (0x07) for a given 0x2D FP instance.

Definition at line 2485 of file allegro_builder.cpp.

References expectBlockByKey(), ALLEGRO::BLK_0x2D_FOOTPRINT_INST::m_InstRef, and ALLEGRO::BLK_0x2D_FOOTPRINT_INST::m_InstRef16x.

Referenced by buildFootprint().

◆ getLayer()

PCB_LAYER_ID BOARD_BUILDER::getLayer ( const LAYER_INFO & aLayerInfo) const
private

◆ getShapeRelatedBlocks()

std::vector< const BLOCK_BASE * > BOARD_BUILDER::getShapeRelatedBlocks ( const BLK_0x28_SHAPE & aShape) const
private

◆ reportMissingBlock()

void BOARD_BUILDER::reportMissingBlock ( uint32_t aKey,
uint8_t aType ) const
private

Definition at line 1119 of file allegro_builder.cpp.

References m_reporter, and RPT_SEVERITY_WARNING.

Referenced by expectBlockByKey().

◆ reportUnexpectedBlockType()

void BOARD_BUILDER::reportUnexpectedBlockType ( uint8_t aGot,
uint8_t aExpected,
uint32_t aKey = 0,
size_t aOffset = 0,
const wxString & aName = wxEmptyString ) const
private

Definition at line 1126 of file allegro_builder.cpp.

References m_reporter, name, and RPT_SEVERITY_WARNING.

Referenced by createTracks(), and expectBlockByKey().

◆ resolveConstraintSetNameFromField()

wxString BOARD_BUILDER::resolveConstraintSetNameFromField ( uint32_t aFieldKey) const
private

Extract constraint set name from a 0x03 FIELD block pointer.

Some boards store the constraint set name in a FIELD block referenced by m_FieldPtr in the 0x1D block instead of the main string table. The FIELD string is a schematic cross-reference like "@lib.xxx(view):\CONSTRAINT_SET_NAME\".

Definition at line 1226 of file allegro_builder.cpp.

References ALLEGRO::BlockDataAs(), ALLEGRO::BLOCK_BASE::GetBlockType(), m_brdDb, and ALLEGRO::BLK_0x03_FIELD::m_Substruct.

Referenced by applyConstraintSets().

◆ resolveMatchGroupName()

wxString BOARD_BUILDER::resolveMatchGroupName ( const BLK_0x1B_NET & aNet) const
private

Follow m_MatchGroupPtr through the 0x26/0x2C pointer chain to get the match group name for a NET.

V172+: NET.m_MatchGroupPtr -> 0x26 -> m_GroupPtr -> 0x2C TABLE -> string Pre-V172: NET.m_MatchGroupPtr -> 0x2C TABLE -> string

Returns
the group name, or empty string if none

Definition at line 1510 of file allegro_builder.cpp.

References ALLEGRO::BlockDataAs(), expectBlockByKey(), ALLEGRO::BLOCK_BASE::GetBlockType(), m_brdDb, ALLEGRO::BLK_0x1B_NET::m_MatchGroupPtr, ALLEGRO::BLK_0x1B_NET::m_NetName, ALLEGRO::BLK_0x2C_TABLE::m_StringPtr, ALLEGRO::BLK_0x2C_TABLE::m_SubType, name, next(), and traceAllegroBuilder.

Referenced by applyMatchGroups().

◆ scale() [1/2]

VECTOR2I BOARD_BUILDER::scale ( const VECTOR2I & aVector) const
private

Definition at line 1090 of file allegro_builder.cpp.

References clampForScale(), m_scale, VECTOR2< T >::x, and VECTOR2< T >::y.

◆ scale() [2/2]

int BOARD_BUILDER::scale ( int aVal) const
private

Definition at line 1098 of file allegro_builder.cpp.

References clampForScale(), and m_scale.

◆ scaleSize()

VECTOR2I BOARD_BUILDER::scaleSize ( const VECTOR2I & aSize) const
private

◆ setupLayers()

◆ shapeToPolySet()

◆ stampIds() [1/2]

static void ALLEGRO::BOARD_BUILDER::stampIds ( BOARD_ITEM & aItem,
uint32_t aKey )
inlinestaticprivate

Definition at line 148 of file allegro_builder.h.

References stampIds().

◆ stampIds() [2/2]

void BOARD_BUILDER::stampIds ( BOARD_ITEM & aItem,
uint32_t aKey,
uint32_t & aSeq )
staticprivate

Give aItem and its children ids derived from the Allegro block they came from.

Parameters
aSeqis advanced once per item stamped, so several items sharing one source block still get distinct ids.

Definition at line 2249 of file allegro_builder.cpp.

References KIID::FromName(), NO_RECURSE, PCB_GROUP_T, BOARD_ITEM::RunOnChildren(), BOARD_ITEM::SetUuidDirect(), stampIds(), and EDA_ITEM::Type().

Referenced by applyZoneFills(), BuildBoard(), createBoardShapes(), createBoardText(), createTables(), createTracks(), createZones(), stampIds(), and stampIds().

◆ tryBuildZoneShape()

SHAPE_POLY_SET ALLEGRO::BOARD_BUILDER::tryBuildZoneShape ( const BLOCK_BASE & aBlock,
const TRANSFORM_TRS & aXform = TRANSFORM_TRS() ) const
private

Try to build a zone shape for the given block, with holes.

Definition at line 3972 of file allegro_builder.cpp.

References ALLEGRO::BlockDataAs(), buildOutline(), buildSegmentChain(), chain, ALLEGRO::BLOCK_BASE::GetBlockType(), shapeToPolySet(), and traceAllegroBuilder.

Referenced by buildZone().

Member Data Documentation

◆ m_board

◆ m_boardGraphics

GRAPHIC_DEDUP ALLEGRO::BOARD_BUILDER::m_boardGraphics
private

Coincidence filter for everything added straight to the board, which is one container.

Definition at line 137 of file allegro_builder.h.

Referenced by applyZoneFills(), createBoardShapes(), createBoardText(), and createTables().

◆ m_brdDb

◆ m_fontDefList

std::vector<const BLK_0x36_DEF_TABLE::FontDef_X08*> ALLEGRO::BOARD_BUILDER::m_fontDefList
private

Definition at line 310 of file allegro_builder.h.

Referenced by cacheFontDefs(), and getFontDef().

◆ m_layerMapper

std::unique_ptr<LAYER_MAPPER> ALLEGRO::BOARD_BUILDER::m_layerMapper
private

◆ m_layerMappingHandler

LAYER_MAPPING_HANDLER ALLEGRO::BOARD_BUILDER::m_layerMappingHandler
private

Definition at line 307 of file allegro_builder.h.

Referenced by BOARD_BUILDER().

◆ m_netCache

std::unordered_map<uint32_t, NETINFO_ITEM*> ALLEGRO::BOARD_BUILDER::m_netCache
private

◆ m_outlineCache

std::unordered_map<uint32_t, SHAPE_LINE_CHAIN> ALLEGRO::BOARD_BUILDER::m_outlineCache
mutableprivate

Definition at line 330 of file allegro_builder.h.

◆ m_progressReporter

PROGRESS_REPORTER* ALLEGRO::BOARD_BUILDER::m_progressReporter
private

Definition at line 306 of file allegro_builder.h.

Referenced by BOARD_BUILDER(), and BuildBoard().

◆ m_reporter

◆ m_scale

double ALLEGRO::BOARD_BUILDER::m_scale
private

Definition at line 336 of file allegro_builder.h.

Referenced by BOARD_BUILDER(), scale(), scale(), and scaleSize().

◆ m_segChainCache

std::unordered_map<uint32_t, SHAPE_LINE_CHAIN> ALLEGRO::BOARD_BUILDER::m_segChainCache
mutableprivate

Definition at line 333 of file allegro_builder.h.

Referenced by buildSegmentChain().

◆ m_usedZoneFillShapes

std::unordered_set<uint32_t> ALLEGRO::BOARD_BUILDER::m_usedZoneFillShapes
private

Definition at line 325 of file allegro_builder.h.

Referenced by applyZoneFills(), and buildZone().

◆ m_zoneFillShapes

std::unordered_map<uint32_t, ZoneFillEntry> ALLEGRO::BOARD_BUILDER::m_zoneFillShapes
private

Definition at line 322 of file allegro_builder.h.

Referenced by applyZoneFills(), and createTracks().


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