|
KiCad PCB EDA Suite
|
Class that builds a KiCad board from a BRD_DB (= FILE_HEADER + STRINGS + OBJECTS + bookkeeping) More...
#include <allegro_builder.h>
Classes | |
| 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 T * | expectBlockByKey (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_SHAPE > | buildLineSegment (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_SHAPE > | buildArc (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_TEXT > | buildPcbText (const BLK_0x30_STR_WRAPPER &aStrWrapper, BOARD_ITEM_CONTAINER &aParent) |
| std::unique_ptr< PCB_SHAPE > | buildRect (const BLK_0x24_RECT &aRect, BOARD_ITEM_CONTAINER &aParent) |
| Build a rectangular shape from a 0x24 RECT block. | |
| std::unique_ptr< PCB_SHAPE > | buildRect (const BLK_0x0E_RECT &aShape, BOARD_ITEM_CONTAINER &aParent) |
| Build a graphic polygon from a 0x0E RECT block. | |
| std::unique_ptr< PCB_SHAPE > | buildPolygon (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< FOOTPRINT > | buildFootprint (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_ITEM > | buildVia (const BLK_0x33_VIA &aBlock, int aNetcode) |
| std::optional< std::pair< int, int > > | resolveViaSpan (const BLK_0x1C_PADSTACK &aPadstack, const VECTOR2I &aViaCenterRaw, int aTotalCu, bool &aResolved) |
| Resolve a via padstack's copper span (0-based first/last copper index), or nullopt for a through via, from the padstack name or the tracks meeting at the via centre. | |
| void | collectTrackEndpointCopper () |
| Populate m_trackEndpointCopper, mapping each copper track segment endpoint to the copper layers terminating there. | |
| std::unique_ptr< ZONE > | buildZone (const BLOCK_BASE &aBoundaryBlock, const std::vector< const BLOCK_BASE * > &aRelatedBlocks, ZONE_FILL_HANDLER &aZoneFillHandler) |
| Build a ZONE from an 0x0E, 0x24 or 0x28 block. | |
| SHAPE_LINE_CHAIN | buildOutline (const BLK_0x0E_RECT &aRect) const |
| SHAPE_LINE_CHAIN | buildOutline (const BLK_0x24_RECT &aRect) const |
| SHAPE_LINE_CHAIN | buildOutline (const BLK_0x28_SHAPE &aShape) const |
| SHAPE_POLY_SET | shapeToPolySet (const BLK_0x28_SHAPE &aShape) const |
| SHAPE_POLY_SET | tryBuildZoneShape (const BLOCK_BASE &aBlock) |
| Try to build a zone shape for the given block, with holes. | |
| const SHAPE_LINE_CHAIN & | buildSegmentChain (uint32_t aStartKey) 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_X08 * | getFontDef (unsigned aIndex) const |
| Get the font definition for a given index in a 0x30, etc. | |
| const BLK_0x07_COMPONENT_INST * | getFpInstRef (const BLK_0x2D_FOOTPRINT_INST &aFpInstance) const |
| Look up 0x07 FP instance data (0x07) for a given 0x2D FP instance. | |
Private Attributes | |
| const BRD_DB & | m_brdDb |
| BOARD & | m_board |
| REPORTER & | m_reporter |
| PROGRESS_REPORTER * | m_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, ZoneFillEntry > | m_zoneFillShapes |
| std::unordered_set< uint32_t > | m_usedZoneFillShapes |
| std::unique_ptr< LAYER_MAPPER > | m_layerMapper |
| std::unordered_map< uint32_t, SHAPE_LINE_CHAIN > | m_outlineCache |
| std::unordered_map< uint32_t, SHAPE_LINE_CHAIN > | m_segChainCache |
| std::unordered_map< uint32_t, std::optional< std::pair< int, int > > > | m_viaSpanCache |
| std::unordered_map< int64_t, std::pair< int, int > > | m_trackEndpointCopper |
| bool | m_trackEndpointsCollected = false |
| double | m_scale |
Class that builds a KiCad board from a BRD_DB (= FILE_HEADER + STRINGS + OBJECTS + bookkeeping)
Definition at line 59 of file allegro_builder.h.
| BOARD_BUILDER::BOARD_BUILDER | ( | const BRD_DB & | aBrdDb, |
| BOARD & | aBoard, | ||
| REPORTER & | aReporter, | ||
| PROGRESS_REPORTER * | aProgressReporter, | ||
| const LAYER_MAPPING_HANDLER & | aLayerMappingHandler ) |
Definition at line 956 of file allegro_builder.cpp.
References ALLEGRO::CENTIMETERS, ALLEGRO::INCHES, m_board, m_brdDb, m_layerMapper, m_layerMappingHandler, m_progressReporter, m_reporter, m_scale, ALLEGRO::MICROMETERS, ALLEGRO::MILLIMETERS, ALLEGRO::MILS, pcbIUScale, and THROW_IO_ERROR.
| BOARD_BUILDER::~BOARD_BUILDER | ( | ) |
Definition at line 1078 of file allegro_builder.cpp.
|
private |
Definition at line 1262 of file allegro_builder.cpp.
References clearance, NETCLASS::Default, ALLEGRO::GetFirstFieldOfType(), NETINFO_ITEM::GetNetname(), m_board, m_brdDb, m_netCache, BOARD_DESIGN_SETTINGS::m_NetSettings, name, ALLEGRO::PHYS_CONSTRAINT_SET, resolveConstraintSetNameFromField(), scale, NETINFO_ITEM::SetNetClass(), traceAllegroBuilder, and ALLEGRO::V_172.
Referenced by BuildBoard().
|
private |
Definition at line 1581 of file allegro_builder.cpp.
References NETCLASS::Default, NETCLASS::GetClearance(), NETCLASS::GetDiffPairGap(), NETCLASS::GetDiffPairWidth(), NETCLASS::GetName(), NETINFO_ITEM::GetNetname(), NETCLASS::GetTrackWidth(), NETCLASS::HasClearance(), NETCLASS::HasDiffPairGap(), NETCLASS::HasDiffPairWidth(), NETCLASS::HasTrackWidth(), m_board, m_brdDb, m_netCache, BOARD_DESIGN_SETTINGS::m_NetSettings, resolveMatchGroupName(), NETINFO_ITEM::SetNetClass(), and traceAllegroBuilder.
Referenced by BuildBoard().
|
private |
Definition at line 1453 of file allegro_builder.cpp.
References ALLEGRO::GetFirstFieldOfTypeInt(), NETINFO_ITEM::GetNetname(), m_board, m_brdDb, m_netCache, BOARD_DESIGN_SETTINGS::m_NetSettings, ALLEGRO::MIN_LINE_WIDTH, scale, NETINFO_ITEM::SetNetClass(), and traceAllegroBuilder.
Referenced by BuildBoard().
|
private |
Definition at line 4528 of file allegro_builder.cpp.
References APPEND, chain, SHAPE_POLY_SET::CPolygons(), SHAPE_POLY_SET::Fracture(), FULL, INVISIBLE_BORDER, m_board, m_usedZoneFillShapes, m_zoneFillShapes, PROF_TIMER::msecs(), NEVER, POLY, shapeToPolySet(), SHAPE_POLY_SET::Simplify(), SOLID, TD_VIAPAD, traceAllegroBuilder, and traceAllegroPerf.
Referenced by BuildBoard().
|
private |
Definition at line 1827 of file allegro_builder.cpp.
References ANGLE_0, ANGLE_360, ARC, CIRCLE, end, KiROUND(), m_board, ALLEGRO::BLK_0x01_ARC::m_CenterX, ALLEGRO::BLK_0x01_ARC::m_CenterY, ALLEGRO::LAYER_INFO::m_Class, ALLEGRO::BLK_0x01_ARC::m_EndX, ALLEGRO::BLK_0x01_ARC::m_EndY, m_layerMapper, ALLEGRO::BLK_0x01_ARC::m_Radius, ALLEGRO::BLK_0x01_ARC::m_StartX, ALLEGRO::BLK_0x01_ARC::m_StartY, ALLEGRO::LAYER_INFO::m_Subclass, ALLEGRO::BLK_0x01_ARC::m_SubType, ALLEGRO::BLK_0x01_ARC::m_Width, EDA_ANGLE::Normalize(), radius, RotatePoint(), scale, and traceAllegroBuilder.
Referenced by buildShapes().
| bool BOARD_BUILDER::BuildBoard | ( | ) |
Definition at line 4673 of file allegro_builder.cpp.
References _, applyConstraintSets(), applyMatchGroups(), applyNetConstraints(), applyZoneFills(), buildFootprint(), BULK_APPEND, cacheFontDefs(), createBoardShapes(), createBoardText(), createNets(), createTables(), createTracks(), createZones(), enablePadTeardrops(), m_board, m_brdDb, m_progressReporter, m_reporter, PROF_TIMER::msecs(), THROTTLE::Ready(), ALLEGRO::REPORT, RPT_SEVERITY_ERROR, ALLEGRO::TYPED_LL_WALKER< T >::SetMismatchReporter(), setupLayers(), traceAllegroBuilder, traceAllegroPerf, and ALLEGRO::V_172.
Referenced by PCB_IO_ALLEGRO::LoadBoardFromData().
|
private |
Build a drill marker from a 0x0C PIN_DEF block.
Definition at line 1976 of file allegro_builder.cpp.
References ANGLE_0, ANGLE_90, center, CIRCLE, FULL_CIRCLE, getLayer(), ALLEGRO::BLK_0x0C_PIN_DEF::GetShape(), ALLEGRO::BLK_0x0C_PIN_DEF::m_Coords, ALLEGRO::BLK_0x0C_PIN_DEF::m_Key, ALLEGRO::BLK_0x0C_PIN_DEF::m_Layer, ALLEGRO::BLK_0x0C_PIN_DEF::m_Size, KIGEOM::MakeCrossSegments(), KIGEOM::MakeRegularPolygonPoints(), minSize, MS, POLY, RECTANGLE, scale, scaleSize(), SEGMENT, and traceAllegroBuilder.
Referenced by buildGraphicItems().
|
private |
Definition at line 2869 of file allegro_builder.cpp.
References ANGLE_180, 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(), 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, RotatePoint(), RPT_SEVERITY_WARNING, scale, EDA_SHAPE::SetFilled(), ALLEGRO::TYPED_LL_WALKER< T >::SetMismatchReporter(), EDA_TEXT::SetText(), 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().
|
private |
Build a list of graphic items, e.g.
from a table's pointer list.
Definition at line 2104 of file allegro_builder.cpp.
References ALLEGRO::BlockDataAs(), buildDrillMarker(), buildPcbText(), buildPolygon(), buildRect(), buildShapes(), ALLEGRO::BLOCK_BASE::GetBlockType(), and traceAllegroBuilder.
Referenced by buildFootprint(), and createTables().
|
private |
Build a single line segment.
Definition at line 1795 of file allegro_builder.cpp.
References end, VECTOR2< T >::Format(), m_board, ALLEGRO::LAYER_INFO::m_Class, ALLEGRO::BLK_0x15_16_17_SEGMENT::m_EndX, ALLEGRO::BLK_0x15_16_17_SEGMENT::m_EndY, m_layerMapper, ALLEGRO::BLK_0x15_16_17_SEGMENT::m_StartX, ALLEGRO::BLK_0x15_16_17_SEGMENT::m_StartY, ALLEGRO::LAYER_INFO::m_Subclass, ALLEGRO::BLK_0x15_16_17_SEGMENT::m_Width, scale, SEGMENT, and traceAllegroBuilder.
Referenced by buildShapes().
|
private |
Definition at line 3843 of file allegro_builder.cpp.
References SHAPE_LINE_CHAIN::Append(), fromMillidegrees(), ALLEGRO::BLK_0x0E_RECT::m_Coords, ALLEGRO::BLK_0x0E_RECT::m_Rotation, SHAPE_LINE_CHAIN::Rotate(), scale, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by buildPolygon(), and tryBuildZoneShape().
|
private |
Definition at line 3864 of file allegro_builder.cpp.
References SHAPE_LINE_CHAIN::Append(), fromMillidegrees(), ALLEGRO::BLK_0x24_RECT::m_Coords, ALLEGRO::BLK_0x24_RECT::m_Rotation, SHAPE_LINE_CHAIN::Rotate(), scale, VECTOR2< T >::x, and VECTOR2< T >::y.
|
private |
Definition at line 3885 of file allegro_builder.cpp.
References ANGLE_0, ANGLE_360, SHAPE_LINE_CHAIN::Append(), ALLEGRO::BlockDataAs(), center, SHAPE_LINE_CHAIN::CLastPoint(), end, KiROUND(), m_brdDb, ALLEGRO::BLK_0x28_SHAPE::m_FirstSegmentPtr, ALLEGRO::BLK_0x28_SHAPE::m_Key, EDA_ANGLE::Normalize(), SHAPE_LINE_CHAIN::PointCount(), RotatePoint(), scale, and traceAllegroBuilder.
|
private |
Construct "pad" items for a given 0x1C PADSTACK block.
If this is zero just skip entirely
Definition at line 2414 of file allegro_builder.cpp.
References std::abs(), ALLEGRO::BLK_0x1C_PADSTACK::ANTIPAD, SHAPE_LINE_CHAIN::Append(), B_Cu, SHAPE_LINE_CHAIN::BBox(), buildSegmentChain(), CHAMFERED_RECT, CIRCLE, PADSTACK::CopperLayer(), CUSTOM, PADSTACK::CUSTOM, PADSTACK::Drill(), expectBlockByKey(), F_Cu, 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::BLK_0x1C_PADSTACK::m_PadStr, m_reporter, ALLEGRO::PADSTACK_COMPONENT::m_StrPtr, ALLEGRO::PADSTACK_COMPONENT::m_Type, ALLEGRO::PADSTACK_COMPONENT::m_W, ALLEGRO::PADSTACK_COMPONENT::m_X3, ALLEGRO::PADSTACK_COMPONENT::m_X4, ALLEGRO::PADSTACK_COMPONENT::m_Z1, PADSTACK::NORMAL, NPTH, nthCopperLayerId(), OBLONG, OVAL, ALLEGRO::BLK_0x1C_PADSTACK::PAD, pad, 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::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, and PAD::UnplatedHoleMask().
Referenced by buildFootprint().
|
private |
Definition at line 1896 of file allegro_builder.cpp.
References ALLEGRO::BLK_0x30_STR_WRAPPER::CENTER, expectBlockByKey(), fromMillidegrees(), getFontDef(), getLayer(), GR_TEXT_H_ALIGN_CENTER, GR_TEXT_H_ALIGN_LEFT, GR_TEXT_H_ALIGN_RIGHT, ALLEGRO::BLK_0x30_STR_WRAPPER::LEFT, ALLEGRO::BLK_0x30_STR_WRAPPER::TEXT_PROPERTIES::m_Alignment, ALLEGRO::BLK_0x36_DEF_TABLE::FontDef_X08::m_CharHeight, ALLEGRO::BLK_0x36_DEF_TABLE::FontDef_X08::m_CharWidth, ALLEGRO::BLK_0x30_STR_WRAPPER::m_CoordsX, ALLEGRO::BLK_0x30_STR_WRAPPER::m_CoordsY, ALLEGRO::BLK_0x30_STR_WRAPPER::m_Font, ALLEGRO::BLK_0x30_STR_WRAPPER::m_Font16x, ALLEGRO::BLK_0x30_STR_WRAPPER::m_Key, ALLEGRO::BLK_0x30_STR_WRAPPER::TEXT_PROPERTIES::m_Key, ALLEGRO::BLK_0x30_STR_WRAPPER::m_Layer, m_reporter, ALLEGRO::BLK_0x30_STR_WRAPPER::TEXT_PROPERTIES::m_Reversal, ALLEGRO::BLK_0x30_STR_WRAPPER::m_Rotation, ALLEGRO::BLK_0x30_STR_WRAPPER::m_StrGraphicPtr, ALLEGRO::BLK_0x36_DEF_TABLE::FontDef_X08::m_StrokeWidth, ALLEGRO::BLK_0x31_SGRAPHIC::m_Value, ALLEGRO::BLK_0x30_STR_WRAPPER::REVERSED, ALLEGRO::BLK_0x30_STR_WRAPPER::RIGHT, RotatePoint(), RPT_SEVERITY_WARNING, scale, and text.
Referenced by buildFootprint(), buildGraphicItems(), and createBoardText().
|
private |
Build a graphic polygon from a 0x28 SHAPE block.
Definition at line 2281 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().
|
private |
Build graphics from an 0x28 SHAPE, with separate items per segment/arc.
Definition at line 2309 of file allegro_builder.cpp.
References ANGLE_0, ANGLE_360, ARC, ALLEGRO::BlockDataAs(), CIRCLE, end, getLayer(), KiROUND(), m_board, m_brdDb, ALLEGRO::BLK_0x28_SHAPE::m_FirstSegmentPtr, ALLEGRO::BLK_0x28_SHAPE::m_Key, ALLEGRO::BLK_0x28_SHAPE::m_Layer, EDA_ANGLE::Normalize(), radius, RotatePoint(), scale, SEGMENT, and traceAllegroBuilder.
Referenced by createBoardShapes().
|
private |
Build a graphic polygon from a 0x0E RECT block.
Definition at line 2256 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.
|
private |
Build a rectangular shape from a 0x24 RECT block.
Definition at line 2231 of file allegro_builder.cpp.
References fromMillidegrees(), getLayer(), ALLEGRO::BLK_0x24_RECT::m_Coords, ALLEGRO::BLK_0x24_RECT::m_Layer, ALLEGRO::BLK_0x24_RECT::m_Rotation, RECTANGLE, and scale.
Referenced by buildGraphicItems(), and createBoardShapes().
|
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.
Definition at line 3754 of file allegro_builder.cpp.
References ANGLE_0, ANGLE_360, SHAPE_LINE_CHAIN::Append(), ALLEGRO::BlockDataAs(), center, SHAPE_LINE_CHAIN::CLastPoint(), end, ALLEGRO::BLOCK_BASE::GetBlockType(), KiROUND(), m_brdDb, m_segChainCache, EDA_ANGLE::Normalize(), SHAPE_LINE_CHAIN::PointCount(), RotatePoint(), and scale.
Referenced by buildPadItems(), shapeToPolySet(), and tryBuildZoneShape().
|
private |
Build the shapes from an 0x14 shape list.
Definition at line 2178 of file allegro_builder.cpp.
References B_CrtYd, ALLEGRO::BlockDataAs(), buildArc(), buildLineSegment(), F_CrtYd, getLayer(), m_brdDb, ALLEGRO::BLK_0x14_GRAPHIC::m_Key, ALLEGRO::BLK_0x14_GRAPHIC::m_Layer, m_layerMapper, ALLEGRO::BLK_0x14_GRAPHIC::m_SegmentPtr, and traceAllegroBuilder.
Referenced by buildFootprint(), buildGraphicItems(), and createBoardShapes().
|
private |
Definition at line 3167 of file allegro_builder.cpp.
References ANGLE_0, ANGLE_360, ALLEGRO::LAYER_INFO::ANTI_ETCH, ALLEGRO::BlockDataAs(), end, getLayer(), KiROUND(), m_board, m_brdDb, ALLEGRO::BLK_0x01_ARC::m_CenterX, ALLEGRO::BLK_0x01_ARC::m_CenterY, ALLEGRO::LAYER_INFO::m_Class, ALLEGRO::BLK_0x01_ARC::m_EndX, ALLEGRO::BLK_0x15_16_17_SEGMENT::m_EndX, ALLEGRO::BLK_0x01_ARC::m_EndY, ALLEGRO::BLK_0x15_16_17_SEGMENT::m_EndY, ALLEGRO::BLK_0x05_TRACK::m_FirstSegPtr, ALLEGRO::BLK_0x05_TRACK::m_Key, ALLEGRO::BLK_0x05_TRACK::m_Layer, ALLEGRO::BLK_0x01_ARC::m_StartX, ALLEGRO::BLK_0x15_16_17_SEGMENT::m_StartX, ALLEGRO::BLK_0x01_ARC::m_StartY, ALLEGRO::BLK_0x15_16_17_SEGMENT::m_StartY, ALLEGRO::LAYER_INFO::m_Subclass, ALLEGRO::BLK_0x01_ARC::m_SubType, ALLEGRO::BLK_0x01_ARC::m_Width, ALLEGRO::BLK_0x15_16_17_SEGMENT::m_Width, EDA_ANGLE::Normalize(), RotatePoint(), scale, and traceAllegroBuilder.
Referenced by createTracks().
|
private |
Definition at line 3426 of file allegro_builder.cpp.
References B_Cu, BLIND, BURIED, expectBlockByKey(), F_Cu, ALLEGRO::BLK_0x1C_PADSTACK::GetDrillSize(), ALLEGRO::BLK_0x1C_PADSTACK::GetLayerCount(), m_board, m_brdDb, ALLEGRO::BLK_0x1C_PADSTACK::m_Components, ALLEGRO::BLK_0x33_VIA::m_CoordsX, ALLEGRO::BLK_0x33_VIA::m_CoordsY, ALLEGRO::BLK_0x1C_PADSTACK::m_Key, ALLEGRO::BLK_0x1C_PADSTACK::m_NumFixedCompEntries, ALLEGRO::BLK_0x33_VIA::m_Padstack, ALLEGRO::BLK_0x1C_PADSTACK::m_PadStr, ALLEGRO::PADSTACK_COMPONENT::m_Type, m_viaSpanCache, ALLEGRO::PADSTACK_COMPONENT::m_W, nthCopperLayerId(), ALLEGRO::BLK_0x1C_PADSTACK::PAD, resolveViaSpan(), scale, THROUGH, traceAllegroBuilder, ALLEGRO::PADSTACK_COMPONENT::TYPE_NULL, and via.
Referenced by createTracks().
|
private |
Build a ZONE from an 0x0E, 0x24 or 0x28 block.
| aRelatedBlocks | are blocks to get net (0x1B) and fill (0x28) info from |
| aZoneFillHandler | is a management object for efficiently dealing with filled zones |
Definition at line 4048 of file allegro_builder.cpp.
References SHAPE_POLY_SET::AddPolygon(), SHAPE_POLY_SET::Append(), ALLEGRO::BlockDataAs(), ALLEGRO::LAYER_INFO::BOUNDARY, chain, SHAPE_POLY_SET::CPolygon(), ALLEGRO::LAYER_INFO::ETCH, expectLayerFromBlock(), F_Cu, ALLEGRO::BLOCK_BASE::GetBlockType(), ALLEGRO::BLOCK_BASE::GetKey(), getLayer(), SHAPE_POLY_SET::IsEmpty(), m_board, ALLEGRO::LAYER_INFO::m_Class, m_layerMapper, m_netCache, m_reporter, ALLEGRO::LAYER_INFO::m_Subclass, m_usedZoneFillShapes, NO_HATCH, SHAPE_POLY_SET::OutlineCount(), ALLEGRO::LAYER_INFO::PACKAGE_KEEPIN, ALLEGRO::LAYER_INFO::PACKAGE_KEEPOUT, POLYGONS, ALLEGRO::BOARD_BUILDER::ZONE_FILL_HANDLER::QueuePolygonForZone(), ALLEGRO::LAYER_INFO::ROUTE_KEEPIN, ALLEGRO::LAYER_INFO::ROUTE_KEEPOUT, RPT_SEVERITY_WARNING, shapeToPolySet(), traceAllegroBuilder, tryBuildZoneShape(), NETINFO_LIST::UNCONNECTED, UNDEFINED_LAYER, and ALLEGRO::LAYER_INFO::VIA_KEEPOUT.
Referenced by buildFootprint(), and createZones().
|
private |
Definition at line 1163 of file allegro_builder.cpp.
References m_brdDb, m_fontDefList, m_reporter, and RPT_SEVERITY_WARNING.
Referenced by BuildBoard().
|
private |
Populate m_trackEndpointCopper, mapping each copper track segment endpoint to the copper layers terminating there.
Built lazily the first time a name-less blind/buried via needs it.
Definition at line 3347 of file allegro_builder.cpp.
References ALLEGRO::BlockDataAs(), ALLEGRO::LAYER_INFO::ETCH, m_board, m_brdDb, ALLEGRO::LAYER_INFO::m_Class, ALLEGRO::BLK_0x05_TRACK::m_FirstSegPtr, ALLEGRO::BLK_0x05_TRACK::m_Key, ALLEGRO::BLK_0x05_TRACK::m_Layer, ALLEGRO::LAYER_INFO::m_Subclass, m_trackEndpointCopper, packPoint(), ALLEGRO::SKIP, and traceAllegroBuilder.
Referenced by resolveViaSpan().
|
private |
Definition at line 3618 of file allegro_builder.cpp.
References ALLEGRO::BlockDataAs(), buildPolygonShapes(), buildRect(), buildShapes(), BULK_APPEND, layerIsZone(), ALLEGRO::LOG_TRACE, m_board, m_brdDb, ALLEGRO::BLK_0x0E_RECT::m_Layer, ALLEGRO::BLK_0x24_RECT::m_Layer, ALLEGRO::BLK_0x28_SHAPE::m_Layer, and traceAllegroBuilder.
Referenced by BuildBoard().
|
private |
Definition at line 4234 of file allegro_builder.cpp.
References APPEND, buildPcbText(), m_board, m_brdDb, text, and traceAllegroBuilder.
Referenced by BuildBoard().
|
private |
Definition at line 1194 of file allegro_builder.cpp.
References BULK_APPEND, ALLEGRO::LOG_TRACE, m_board, m_brdDb, m_netCache, and traceAllegroBuilder.
Referenced by BuildBoard().
|
private |
Definition at line 4430 of file allegro_builder.cpp.
References ALLEGRO::BlockDataAs(), buildGraphicItems(), BulkAddToBoard(), group, m_board, m_brdDb, ALLEGRO::BLK_0x37_PTR_ARRAY::m_Count, ALLEGRO::BLK_0x3C_KEY_LIST::m_NumEntries, ALLEGRO::BLK_0x37_PTR_ARRAY::m_Ptrs, ALLEGRO::BLK_0x2C_TABLE::SUBTYPE_GRAPHICAL_GROUP, and traceAllegroBuilder.
Referenced by BuildBoard().
|
private |
Definition at line 3516 of file allegro_builder.cpp.
References ALLEGRO::BLK_0x1B_NET::BLOCK_TYPE_CODE, ALLEGRO::BlockDataAs(), buildTrack(), buildVia(), BULK_APPEND, getLayer(), ALLEGRO::BLOCK_BASE::GetOffset(), m_board, m_brdDb, ALLEGRO::BLK_0x28_SHAPE::m_Key, ALLEGRO::BLK_0x28_SHAPE::m_Layer, m_netCache, m_trackEndpointCopper, m_zoneFillShapes, ALLEGRO::REPORT, reportUnexpectedBlockType(), ALLEGRO::TYPED_LL_WALKER< T >::SetMismatchReporter(), traceAllegroBuilder, and UNDEFINED_LAYER.
Referenced by BuildBoard().
|
private |
Definition at line 4282 of file allegro_builder.cpp.
References ALLEGRO::BlockDataAs(), buildZone(), BulkAddToBoard(), getShapeRelatedBlocks(), layerInfoDisplayName(), layerIsZone(), m_board, m_brdDb, ALLEGRO::BLK_0x24_RECT::m_Key, ALLEGRO::BLK_0x28_SHAPE::m_Key, ALLEGRO::BLK_0x0E_RECT::m_Layer, ALLEGRO::BLK_0x24_RECT::m_Layer, ALLEGRO::BLK_0x28_SHAPE::m_Layer, MergeZonesWithSameOutline(), ALLEGRO::BOARD_BUILDER::ZONE_FILL_HANDLER::ProcessPolygons(), and traceAllegroBuilder.
Referenced by BuildBoard().
|
private |
Definition at line 4604 of file allegro_builder.cpp.
References SHAPE_POLY_SET::Contains(), ZONE::GetLayer(), m_board, ZONE::Outline(), pad, PCB_VIA_T, traceAllegroBuilder, and via.
Referenced by BuildBoard().
|
inlineprivate |
Get a block by its key, and check that it is of the expected type.
| T | must be a BLOCK_DATA struct with a BLOCK_TYPE_CODE member |
Definition at line 80 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().
|
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 1147 of file allegro_builder.cpp.
References expectBlockByKey(), ALLEGRO::BLK_0x30_STR_WRAPPER::m_StrGraphicPtr, ALLEGRO::BLK_0x31_SGRAPHIC::m_Value, and THROW_IO_ERROR.
|
private |
Get the font definition for a given index in a 0x30, etc.
Definition at line 1778 of file allegro_builder.cpp.
References m_fontDefList, m_reporter, and RPT_SEVERITY_WARNING.
Referenced by buildPcbText().
|
private |
Look up 0x07 FP instance data (0x07) for a given 0x2D FP instance.
Definition at line 2395 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().
|
private |
Definition at line 2172 of file allegro_builder.cpp.
References m_layerMapper.
Referenced by buildDrillMarker(), buildPcbText(), buildPolygon(), buildPolygonShapes(), buildRect(), buildRect(), buildShapes(), buildTrack(), buildZone(), and createTracks().
|
private |
Get blocks that are related to the BOUNDARY shape, i.e.
NET and SHAPE (fill) info.
Definition at line 4205 of file allegro_builder.cpp.
References expectBlockByKey(), ALLEGRO::BLK_0x28_SHAPE::GetTablePtr(), m_brdDb, ALLEGRO::BLK_0x37_PTR_ARRAY::m_Capacity, ALLEGRO::BLK_0x37_PTR_ARRAY::m_Count, ALLEGRO::BLK_0x2C_TABLE::m_Ptr1, and ALLEGRO::BLK_0x37_PTR_ARRAY::m_Ptrs.
Referenced by createZones().
|
private |
Definition at line 1126 of file allegro_builder.cpp.
References m_reporter, and RPT_SEVERITY_WARNING.
Referenced by expectBlockByKey().
|
private |
Definition at line 1133 of file allegro_builder.cpp.
References m_reporter, name, and RPT_SEVERITY_WARNING.
Referenced by createTracks(), and expectBlockByKey().
|
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 1233 of file allegro_builder.cpp.
References ALLEGRO::BlockDataAs(), ALLEGRO::BLOCK_BASE::GetBlockType(), m_brdDb, and ALLEGRO::BLK_0x03_FIELD::m_Substruct.
Referenced by applyConstraintSets().
|
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
Definition at line 1517 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().
|
private |
Resolve a via padstack's copper span (0-based first/last copper index), or nullopt for a through via, from the padstack name or the tracks meeting at the via centre.
aResolved is false when the span could not be determined, so the result is not cached.
Definition at line 3291 of file allegro_builder.cpp.
References collectTrackEndpointCopper(), end, ALLEGRO::BLK_0x1C_PADSTACK::GetLayerCount(), m_brdDb, ALLEGRO::BLK_0x1C_PADSTACK::m_PadStr, m_reporter, m_trackEndpointCopper, m_trackEndpointsCollected, name, packPoint(), parseViaSpanFromName(), RPT_SEVERITY_WARNING, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by buildVia().
Definition at line 1097 of file allegro_builder.cpp.
References clampForScale(), m_scale, VECTOR2< T >::x, and VECTOR2< T >::y.
|
private |
Definition at line 1105 of file allegro_builder.cpp.
References clampForScale(), and m_scale.
Definition at line 1111 of file allegro_builder.cpp.
References std::abs(), clampForScale(), m_scale, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by buildDrillMarker(), and buildPadItems().
|
private |
Definition at line 1727 of file allegro_builder.cpp.
References ALLEGRO::LAYER_INFO::BGEOM_DESIGN_OUTLINE, ALLEGRO::LAYER_INFO::BGEOM_OUTLINE, ALLEGRO::LAYER_INFO::BOARD_GEOMETRY, expectBlockByKey(), info, layerInfoDisplayName(), m_brdDb, m_layerMapper, ScanForLayers(), and traceAllegroBuilder.
Referenced by BuildBoard().
|
private |
Definition at line 3957 of file allegro_builder.cpp.
References SHAPE_POLY_SET::AddHole(), SHAPE_POLY_SET::AddOutline(), ALLEGRO::BlockDataAs(), buildSegmentChain(), ALLEGRO::BLOCK_BASE::GetBlockType(), m_brdDb, ALLEGRO::BLK_0x28_SHAPE::m_FirstKeepoutPtr, ALLEGRO::BLK_0x28_SHAPE::m_FirstSegmentPtr, SHAPE_LINE_CHAIN::PointCount(), SHAPE_LINE_CHAIN::SetClosed(), and traceAllegroBuilder.
Referenced by applyZoneFills(), buildZone(), and tryBuildZoneShape().
|
private |
Try to build a zone shape for the given block, with holes.
Definition at line 3998 of file allegro_builder.cpp.
References ALLEGRO::BlockDataAs(), buildOutline(), buildSegmentChain(), chain, ALLEGRO::BLOCK_BASE::GetBlockType(), shapeToPolySet(), and traceAllegroBuilder.
Referenced by buildZone().
|
private |
Definition at line 269 of file allegro_builder.h.
Referenced by applyConstraintSets(), applyMatchGroups(), applyNetConstraints(), applyZoneFills(), BOARD_BUILDER(), buildArc(), BuildBoard(), buildFootprint(), buildLineSegment(), buildPolygonShapes(), buildTrack(), buildVia(), buildZone(), collectTrackEndpointCopper(), createBoardShapes(), createBoardText(), createNets(), createTables(), createTracks(), createZones(), and enablePadTeardrops().
|
private |
Definition at line 268 of file allegro_builder.h.
Referenced by applyConstraintSets(), applyMatchGroups(), applyNetConstraints(), BOARD_BUILDER(), BuildBoard(), buildFootprint(), buildOutline(), buildPadItems(), buildPolygonShapes(), buildSegmentChain(), buildShapes(), buildTrack(), buildVia(), cacheFontDefs(), collectTrackEndpointCopper(), createBoardShapes(), createBoardText(), createNets(), createTables(), createTracks(), createZones(), expectBlockByKey(), getShapeRelatedBlocks(), resolveConstraintSetNameFromField(), resolveMatchGroupName(), resolveViaSpan(), setupLayers(), and shapeToPolySet().
|
private |
Definition at line 275 of file allegro_builder.h.
Referenced by cacheFontDefs(), and getFontDef().
|
private |
Definition at line 292 of file allegro_builder.h.
Referenced by BOARD_BUILDER(), buildArc(), buildLineSegment(), buildShapes(), buildZone(), getLayer(), and setupLayers().
|
private |
Definition at line 272 of file allegro_builder.h.
Referenced by BOARD_BUILDER().
|
private |
Definition at line 278 of file allegro_builder.h.
Referenced by applyConstraintSets(), applyMatchGroups(), applyNetConstraints(), buildFootprint(), buildZone(), createNets(), and createTracks().
|
mutableprivate |
Definition at line 295 of file allegro_builder.h.
|
private |
Definition at line 271 of file allegro_builder.h.
Referenced by BOARD_BUILDER(), and BuildBoard().
|
private |
Definition at line 270 of file allegro_builder.h.
Referenced by BOARD_BUILDER(), BuildBoard(), buildFootprint(), buildPadItems(), buildPcbText(), buildZone(), cacheFontDefs(), getFontDef(), reportMissingBlock(), reportUnexpectedBlockType(), and resolveViaSpan().
|
private |
Definition at line 310 of file allegro_builder.h.
Referenced by BOARD_BUILDER(), scale(), scale(), and scaleSize().
|
mutableprivate |
Definition at line 298 of file allegro_builder.h.
Referenced by buildSegmentChain().
|
private |
Definition at line 304 of file allegro_builder.h.
Referenced by collectTrackEndpointCopper(), createTracks(), and resolveViaSpan().
|
private |
Definition at line 307 of file allegro_builder.h.
Referenced by resolveViaSpan().
|
private |
Definition at line 290 of file allegro_builder.h.
Referenced by applyZoneFills(), and buildZone().
|
private |
Definition at line 301 of file allegro_builder.h.
Referenced by buildVia().
|
private |
Definition at line 287 of file allegro_builder.h.
Referenced by applyZoneFills(), and createTracks().