37#include <unordered_map>
112 BLOCK( uint8_t aBlockType,
size_t aOffset ) :
152 return static_cast<uint32_t
>( lhs ) >=
static_cast<uint32_t
>( rhs );
162 { p( v ) }->std::convertible_to<
bool>;
170template <FMT_VER_PREDICATE auto Pred,
typename T>
210template <FMT_VER Min>
216template <FMT_VER Max>
222template <FMT_VER Min, FMT_VER Max>
232template <FMT_VER Min,
typename T>
236template <FMT_VER Max,
typename T>
240template <FMT_VER Min, FMT_VER Max,
typename T>
249 { T::exists( v ) }->std::convertible_to<
bool>;
250 typename T::value_type;
1368 using HEADER = std::variant<HEADER_v16x, HEADER_v17x>;
1462 return std::visit( Visitor{},
m_Header );
1472 return std::visit( Visitor{},
m_Header );
1488 return std::visit( Visitor{},
m_Header );
2350 using SubstructVariant = std::variant<X02, X03, X05, X06, FontDef_X08, X0B, X0C, X0D, X0F, X10, X12>;
2483template <
typename T>
2486 { T::BLOCK_TYPE_CODE }->std::convertible_to<uint8_t>;
2488|| std::is_same_v<T, BLK_0x15_16_17_SEGMENT>;
void SetNext(uint32_t aNext)
virtual ~BLOCK_BASE()=default
uint8_t GetBlockType() const
This is the actual type code as read from the file.
BLOCK_BASE(uint8_t aBlockType, size_t aOffset)
void SetKey(uint32_t aKey)
BLOCK(uint8_t aBlockType, size_t aOffset)
Explicit type code for multi-code types (e.g. segments 0x15/0x16/0x17)
BLOCK(size_t aOffset)
Deduce the type code from T::BLOCK_TYPE_CODE (single-code types only)
const T & GetData() const
Satisfied by any Allegro block data structs that can be used with BLOCK_REF.
A constexpr predicate that decides whether a field exists for a given FMT_VER.
Concept that is statisfied by any struct that has a block tpye code.
Satisfied by any COND_FIELD instantiation (COND_GE, COND_LT, COND_GE_LT, ...)
COND_FIELD< VER_GE< Min >{}, T > COND_GE
Exists for all versions greater than or equal to Min.
COND_FIELD< VER_LT< Max >{}, T > COND_LT
Exists for all versions less than (and not equal to) Max.
FIELD_KEYS
Hdr1 keys for field roles.
@ PHYS_CONSTRAINT_SET
Physical Constraint Set assignment.
@ NET_SCHEDULE
Net class/schedule assignment.
PAD_TYPE
The type of the padstack.
constexpr bool operator>=(FMT_VER lhs, FMT_VER rhs)
FMT_VER
The format of an Allegro file.
COND_FIELD< VER_GE_LT< Min, Max >{}, T > COND_GE_LT
Exists for all versions greater than or equal to Min and less than Max.
Arc segment used in tracks, zone outlines, and shape boundaries.
std::array< int32_t, 4 > m_BoundingBoxCoords
uint8_t m_SubType
Bit 6 (0x40) = clockwise direction.
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown6
static constexpr uint8_t BLOCK_TYPE_CODE
std::vector< uint32_t > m_Entries
std::vector< uint32_t > m_Entries
std::array< uint32_t, 20 > m_Entries
Field/property references with variable-typed substructs.
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown1
static constexpr uint8_t BLOCK_TYPE_CODE
std::variant< uint32_t, std::array< uint32_t, 2 >, std::string, SUB_0x6C, SUB_0x70_0x74, SUB_0xF6 > m_Substruct
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown2
Net assignment linking a net (0x1B) to its member objects.
static constexpr uint8_t BLOCK_TYPE_CODE
COND_GE< FMT_VER::V_174, uint32_t > m_Unknown
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown5b
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown5a
static constexpr uint8_t BLOCK_TYPE_CODE
Component/symbol definitions.
static constexpr uint8_t BLOCK_TYPE_CODE
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown1
uint32_t m_CompDeviceType
uint32_t m_PtrFunctionSlot
Component instance reference data.
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown2
COND_LT< FMT_VER::V_172, uint32_t > m_Unknown4
static constexpr uint8_t BLOCK_TYPE_CODE
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown3
COND_GE< FMT_VER::V_172, uint32_t > m_UnknownPtr1
uint32_t m_FunctionInstPtr
Pin number within a component.
static constexpr uint8_t BLOCK_TYPE_CODE
COND_GE< FMT_VER::V_172, uint32_t > m_Previous
COND_LT< FMT_VER::V_172, uint32_t > m_StrPtr16x
uint32_t GetStrPtr() const
COND_GE< FMT_VER::V_172, uint32_t > m_StrPtr
Pointer to 0x11 PIN_NAME object.
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown1
Intermediate link between copper fills and their parent shapes.
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown1
static constexpr uint8_t BLOCK_TYPE_CODE
COND_GE< FMT_VER::V_174, uint32_t > m_Unknown3
std::array< uint32_t, 4 > m_UnknownArray
0x0A objects represent DRC (Design Rule Check) elements.
static constexpr uint8_t BLOCK_TYPE_CODE
std::array< uint32_t, 4 > m_Unknown4
std::array< int32_t, 4 > m_Coords
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown2
COND_GE< FMT_VER::V_174, uint32_t > m_Unknown6
std::array< uint32_t, 5 > m_Unknown5
Pin definition with shape type, drill character, coordinates, and size.
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown_16x
COND_GE< FMT_VER::V_180, uint32_t > m_Unknown5
COND_LT< FMT_VER::V_172, uint8_t > m_DrillChar
COND_GE_LT< FMT_VER::V_174, FMT_VER::V_180, uint32_t > m_Unknown8
COND_LT< FMT_VER::V_172, uint8_t > m_Shape
static constexpr uint8_t BLOCK_TYPE_CODE
std::array< int32_t, 2 > m_Size
COND_GE< FMT_VER::V_172, uint32_t > m_DrillChars
COND_GE< FMT_VER::V_172, uint32_t > m_Shape16x
uint32_t GetShape() const
std::array< int32_t, 2 > m_Coords
COND_LT< FMT_VER::V_172, uint16_t > m_UnknownPadding
Pad geometry and placement in board-absolute coordinates.
static constexpr uint8_t BLOCK_TYPE_CODE
uint32_t m_Rotation
Board-absolute millidegrees. Subtract footprint rotation for FP-local orientation.
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown3
int32_t m_CoordsX
Board coordinates. Use SetFPRelativePosition() for KiCad FP-local space.
COND_GE< FMT_VER::V_174, uint32_t > m_Unknown1
int32_t m_CoordsY
Board coordinates. Use SetFPRelativePosition() for KiCad FP-local space.
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown5
std::array< uint32_t, 3 > m_UnknownArr
uint32_t m_Rotation
Rotation in millidegrees.
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown4
static constexpr uint8_t BLOCK_TYPE_CODE
std::array< int32_t, 4 > m_Coords
Function slot in a multi-slot component (e.g.
COND_GE< FMT_VER::V_172, uint32_t > m_Next
std::array< char, 32 > m_CompDeviceType
std::string GetCompDeviceTypeStr() const
COND_GE< FMT_VER::V_174, uint32_t > m_Unknown1
static constexpr uint8_t BLOCK_TYPE_CODE
Function instance linking a component instance (0x07) to its schematic function, pin cross-references...
COND_GE< FMT_VER::V_174, uint32_t > m_Unknown2
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown1
static constexpr uint8_t BLOCK_TYPE_CODE
uint32_t m_ComponentInstPtr
Pin name within a component, linked from function slots (0x0F).
uint32_t m_Key
Pointer to pin name string.
uint32_t m_PinNameStrPtr
Pointer to next 0x11 PIN_NAME object or 0x0F SLOT.
COND_GE< FMT_VER::V_174, uint32_t > m_Unknown2
uint32_t m_Next
Pointer to 0x08 PIN_NUMBER object.
static constexpr uint8_t BLOCK_TYPE_CODE
Cross-reference between objects.
COND_GE< FMT_VER::V_165, uint32_t > m_Unknown2
static constexpr uint8_t BLOCK_TYPE_CODE
COND_GE< FMT_VER::V_174, uint32_t > m_Unknown3
Graphics container holding a chain of line segments and arcs.
static constexpr uint8_t BLOCK_TYPE_CODE
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown2
0x15 , 0x16, 0x17 are segments:
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown2
uint32_t m_Ratline
Pointer to first 0x03 FIELD object or null.
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown2
static constexpr uint8_t BLOCK_TYPE_CODE
uint32_t m_MatchGroupPtr
Diff pair / match group pointer (0x26 or 0x2C)
Padstack definition containing drill dimensions and a table of per-layer pad/antipad/thermal componen...
std::variant< HEADER_v16x, HEADER_v17x > HEADER
size_t m_NumCompsPerLayer
LAYER_COMP_SLOT
Component table layer offsets In the component table's layer section, each layer has 3 or 4 slots,...
static constexpr uint8_t BLOCK_TYPE_CODE
uint32_t GetDrillSize() const
std::vector< uint32_t > m_UnknownArrN
Some structure of m_N * 8 or 10:
size_t m_NumFixedCompEntries
How many of the entries are fixed roles (after this is n*layers)
uint8_t m_N
The number of something.
std::vector< PADSTACK_COMPONENT > m_Components
Collection of components that make up the padstack.
uint32_t GetLayerCount() const
SLOTS
Fixed slot indices in the component table.
Physical constraint sets containing trace width, clearance, and routing rules.
static constexpr uint8_t BLOCK_TYPE_CODE
uint32_t m_FieldPtr
Pointer to 0x03 FIELD with CS name (fallback when m_NameStrKey fails)
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown4
uint32_t m_NameStrKey
String table key for constraint set name.
std::vector< std::array< uint8_t, 256 > > m_DataA
Records contain ASCII padstack/via name strings (null-terminated at offset 4) and file path reference...
std::vector< std::array< uint8_t, 56 > > m_DataB
Per-copper-layer dimension values, 14 x int32 per record.
uint32_t m_Next
Linked list next pointer (used by LL_WALKER)
Signal integrity and simulation model data (IBIS netlists).
static constexpr uint8_t BLOCK_TYPE_CODE
COND_GE< FMT_VER::V_164, uint16_t > m_Unknown3
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown4
uint32_t m_Next
Linked list next pointer (used by LL_WALKER)
COND_GE< FMT_VER::V_164, uint16_t > m_Unknown2
Per-padstack dimension records with name and value.
std::vector< uint8_t > m_Substruct
Version-dependent substruct holding padstack dimension name and value.
static constexpr uint8_t BLOCK_TYPE_CODE
uint32_t m_Next
Linked list next pointer (used by LL_WALKER)
static constexpr uint8_t BLOCK_TYPE_CODE
COND_GE< FMT_VER::V_174, std::array< uint32_t, 10 > > m_UnknownArray2
std::array< uint32_t, 7 > m_UnknownArray1
Headered data blob containing structured board data such as layer stackup definitions,...
static constexpr uint8_t BLOCK_TYPE_CODE
std::vector< uint8_t > m_Data
An array of bytes that seems to be a variable length.
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown1
static constexpr uint8_t BLOCK_TYPE_CODE
std::array< uint32_t, 8 > m_UnknownArray
0x23 objects represent ratlines.
COND_GE< FMT_VER::V_164, std::array< uint32_t, 4 > > m_Unknown2
std::array< uint32_t, 4 > m_Unknown1
COND_GE< FMT_VER::V_174, uint32_t > m_Unknown3
static constexpr uint8_t BLOCK_TYPE_CODE
std::array< uint32_t, 2 > m_Flags
std::array< int32_t, 5 > m_Coords
Rectangle defined by four coordinates.
uint32_t m_Rotation
Rotation in millidegrees.
static constexpr uint8_t BLOCK_TYPE_CODE
std::array< int32_t, 4 > m_Coords
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown2
Match group indirection for differential pairs and match groups.
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown1
uint32_t m_ConstPtr
Points to timing/delay constraints (field type 0x63), not physical constraints.
COND_GE< FMT_VER::V_174, uint32_t > m_Unknown2
static constexpr uint8_t BLOCK_TYPE_CODE
Serialized Constraint Manager database containing secondary name table (V172+), material stackup,...
std::vector< uint32_t > m_Refs
static constexpr uint8_t BLOCK_TYPE_CODE
Polygon shape defined by a linked list of segments starting at m_FirstSegmentPtr (0x15/0x16/0x17 line...
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown3
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown2
std::array< int32_t, 4 > m_Coords
COND_LT< FMT_VER::V_172, uint32_t > m_TablePtr_16x
uint32_t m_FirstSegmentPtr
uint32_t m_FirstKeepoutPtr
static constexpr uint8_t BLOCK_TYPE_CODE
uint32_t GetTablePtr() const
COND_GE< FMT_VER::V_172, uint32_t > m_TablePtr
0x29 objects may represent pins in .dra files.
static constexpr uint8_t BLOCK_TYPE_CODE
Represents a list of layers.
COND_GE< FMT_VER::V_165, std::vector< REF_ENTRY > > m_RefEntries
static constexpr uint8_t BLOCK_TYPE_CODE
COND_GE< FMT_VER::V_174, uint32_t > m_Unknown
COND_LT< FMT_VER::V_165, std::vector< NONREF_ENTRY > > m_NonRefEntries
Lookup table used for named associations.
COND_LT< FMT_VER::V_172, uint32_t > m_Unknown4
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown3
SUBTYPE
The subtype of a table.
@ SUBTYPE_0x103
Diff pair.
@ SUBTYPE_0x102
Some kind of net match group.
@ SUBTYPE_GRAPHICAL_GROUP
Used for drill charts and x-section charts.
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown2
static constexpr uint8_t BLOCK_TYPE_CODE
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown1
Connection point at a track junction or pad-to-track transition.
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown3
static constexpr uint8_t BLOCK_TYPE_CODE
static constexpr uint8_t BLOCK_TYPE_CODE
std::array< uint32_t, 6 > m_UnknownArray
TEXT_ALIGNMENT m_Alignment
Text object with position, rotation, layer, font properties, and alignment.
uint32_t GetGroupPtr() const
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown2
COND_GE< FMT_VER::V_172, TEXT_PROPERTIES > m_Font
uint32_t m_Rotation
Millidegrees.
COND_LT< FMT_VER::V_172, uint32_t > m_PtrGroup_16x
COND_GE< FMT_VER::V_172, uint32_t > m_PtrGroup_17x
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown1
COND_GE< FMT_VER::V_172, uint32_t > m_Ptr2
COND_LT< FMT_VER::V_172, uint32_t > m_Unknown4
COND_GE< FMT_VER::V_172, uint32_t > m_Ptr1
COND_GE< FMT_VER::V_174, uint32_t > m_Unknown3
COND_LT< FMT_VER::V_172, TEXT_PROPERTIES > m_Font16x
static constexpr uint8_t BLOCK_TYPE_CODE
String graphic content holding the actual text value and its display layer category.
COND_GE< FMT_VER::V_174, uint32_t > m_Un2
static constexpr uint8_t BLOCK_TYPE_CODE
uint32_t m_StrGraphicWrapperPtr
Placed pad instance linking a pad definition (0x0D via m_PadPtr) to its parent footprint (m_ParentFp)...
uint32_t m_NextInCompInst
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown2
static constexpr uint8_t BLOCK_TYPE_CODE
std::array< int32_t, 4 > m_Coords
COND_GE< FMT_VER::V_172, uint32_t > m_Prev
Via instance with board position, padstack reference (m_Padstack for drill/annular ring definitions),...
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown3
COND_GE< FMT_VER::V_172, uint32_t > m_UnknownPtr2
static constexpr uint8_t BLOCK_TYPE_CODE
std::array< int32_t, 4 > m_BoundingBoxCoords
0x34 objects represent keepouts.
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown1
static constexpr uint8_t BLOCK_TYPE_CODE
uint32_t m_FirstSegmentPtr
File path references to Allegro log and report files (terminator.log, eclrpt.txt).
static constexpr uint8_t BLOCK_TYPE_CODE
std::array< uint8_t, 120 > m_Content
COND_GE< FMT_VER::V_172, std::array< uint32_t, 8 > > m_Ys
uint32_t m_CharacterSpace
COND_GE< FMT_VER::V_174, uint32_t > m_Unknown2
std::array< uint32_t, 14 > m_Xs
COND_GE< FMT_VER::V_172, std::array< uint32_t, 2 > > m_Zs
COND_GE< FMT_VER::V_164, std::array< uint32_t, 3 > > m_Ys
COND_GE< FMT_VER::V_172, std::string > m_Str
COND_GE< FMT_VER::V_174, uint32_t > m_Unknown1
COND_LT< FMT_VER::V_172, std::string > m_Str16x
std::array< uint8_t, 28 > m_Unknown
COND_GE< FMT_VER::V_174, uint32_t > m_Unknown2
COND_LT< FMT_VER::V_172, std::array< uint32_t, 50 > > m_Unknown2
std::array< uint8_t, 1016 > m_Unknown
std::array< uint8_t, 232 > m_Unknown
std::array< uint8_t, 200 > m_Unknown
std::array< uint32_t, 3 > m_Ptrs
std::array< uint8_t, 108 > m_Unknown
COND_GE< FMT_VER::V_180, uint32_t > m_Unknown2
Heterogeneous definition table containing font metrics (FontDef_X08), layer name definitions (X03),...
std::variant< X02, X03, X05, X06, FontDef_X08, X0B, X0C, X0D, X0F, X10, X12 > SubstructVariant
COND_GE< FMT_VER::V_174, uint32_t > m_Unknown3
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown1
std::vector< SubstructVariant > m_Items
static constexpr uint8_t BLOCK_TYPE_CODE
Fixed-capacity pointer array (100 entries).
static constexpr uint8_t BLOCK_TYPE_CODE
COND_GE< FMT_VER::V_174, uint32_t > m_Unknown3
std::array< uint32_t, 100 > m_Ptrs
0x38 objects represent films.
COND_GE< FMT_VER::V_166, uint32_t > m_Unknown2
std::array< uint32_t, 7 > m_UnknownArray1
COND_GE< FMT_VER::V_174, uint32_t > m_Unknown3
COND_GE< FMT_VER::V_166, uint32_t > m_LayerNameStr
static constexpr uint8_t BLOCK_TYPE_CODE
COND_LT< FMT_VER::V_166, std::string > m_FilmName
0x39 objects represent a film layer list.
std::array< uint16_t, 22 > m_X
static constexpr uint8_t BLOCK_TYPE_CODE
0x3A objects represent a list of films
static constexpr uint8_t BLOCK_TYPE_CODE
COND_GE< FMT_VER::V_174, uint32_t > m_Unknown1
Named property with type and value strings.
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown3
static constexpr uint8_t BLOCK_TYPE_CODE
Ordered list of block keys.
COND_GE< FMT_VER::V_174, uint32_t > m_Unknown
std::vector< uint32_t > m_Entries
static constexpr uint8_t BLOCK_TYPE_CODE
Version-conditional field.
static constexpr bool exists(FMT_VER aVer)
COND_FIELD & operator=(const T &aValue)
std::optional< T > m_Value
const T & operator*() const
const T & value_or(const T &aDefault) const
COND_FIELD & operator=(T &&aValue)
const T * operator->() const
SUBCLASS
The second byte in a CLASS:SUBCLASS pair.
@ ANALYSIS_MEDIUM1_ISOCONTOUR
@ ANALYSIS_PCB_TEMPERATURE
@ BGEOM_SILKSCREEN_BOTTOM
@ PGEOM_SILKSCREEN_BOTTOM
@ ANALYSIS_LOW_ISOCONTOUR
@ BGEOM_SWITCH_AREA_BOTTOM
@ BGEOM_SOLDERMASK_BOTTOM
@ ANALYSIS_MEDIUM3_ISOCONTOUR
@ PGEOM_PLACE_BOUND_BOTTOM
@ ANALYSIS_MEDIUM2_ISOCONTOUR
@ PGEOM_SOLDERMASK_BOTTOM
@ ANALYSIS_HIGH_ISOCONTOUR
@ BGEOM_PLACE_GRID_BOTTOM
bool operator==(const LAYER_INFO &) const =default
Substruct in a padstack object.
uint32_t m_StrPtr
Seems to point to various things:
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown1
@ TYPE_CHAMFERED_RECTANGLE
COND_GE< FMT_VER::V_172, int32_t > m_Z1
std::optional< uint32_t > m_Z2
constexpr bool operator()(FMT_VER v) const
constexpr bool operator()(FMT_VER v) const
constexpr bool operator()(FMT_VER v) const