KiCad PCB EDA Suite
Loading...
Searching...
No Matches
altium_pcb.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2019-2020 Thomas Pointhuber <[email protected]>
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
21#ifndef ALTIUM_PCB_H
22#define ALTIUM_PCB_H
23
24#include <core/utf8.h>
26#include <embedded_files.h>
27#include <functional>
28#include <layer_ids.h>
29#include <map>
30#include <set>
31#include <memory>
32#include <vector>
34
35
36#include <altium_parser_pcb.h>
37
38
87
88
89class BOARD;
90class BOARD_ITEM;
91class EDA_TEXT;
92class FP_SHAPE;
93class PAD;
94class PCB_SHAPE;
95class PCB_TEXTBOX;
96class FOOTPRINT;
97class ZONE;
98class PCB_DIM_RADIAL;
100class NET_SETTINGS;
101
102namespace CFB
103{
104struct COMPOUND_FILE_ENTRY;
105} // namespace CFB
106
109
110// Structure for storing embedded model data
112{
113 wxString m_modelname;
116 std::vector<char> m_data;
117
118 // Constructor
119 ALTIUM_EMBEDDED_MODEL_DATA(const wxString& name, const VECTOR3D& rotation, double z_offset, std::vector<char>&& data)
120 : m_modelname(name), m_rotation(rotation), m_z_offset(z_offset), m_data(std::move(data)) {}
121};
122
130wxString AltiumUnnamedNetName( const BOARD& aBoard, int& aCounter );
131
132
144void ApplyAltiumNetclassRules( const std::map<ALTIUM_RULE_KIND, std::vector<ARULE6>>& aRulesByKind,
145 NET_SETTINGS& aNetSettings,
146 std::vector<const ARULE6*>* aUnresolved = nullptr );
147
148
149// type declaration required for a helper method
150class ALTIUM_PCB;
151typedef std::function<void( const ALTIUM_PCB_COMPOUND_FILE&, const CFB::COMPOUND_FILE_ENTRY* )>
153
155{
157
158public:
159 explicit ALTIUM_PCB( BOARD* aBoard, PROGRESS_REPORTER* aProgressReporter,
160 LAYER_MAPPING_HANDLER& aLayerMappingHandler,
161 REPORTER* aReporter = nullptr,
162 const wxString& aLibrary = wxEmptyString,
163 const wxString& aFootprintName = wxEmptyString);
164 ~ALTIUM_PCB();
165
166 void Parse( const ALTIUM_PCB_COMPOUND_FILE& aAltiumPcbFile,
167 const std::map<ALTIUM_PCB_DIR, std::string>& aFileMapping,
168 const std::map<std::string, UTF8>* aProperties = nullptr );
169
170 std::unique_ptr<FOOTPRINT> ParseFootprint( ALTIUM_PCB_COMPOUND_FILE& altiumLibFile,
171 const wxString& aFootprintName );
172
174 const std::set<wxString>& GetSpecialStrings() const { return m_specialStrings; }
175
176private:
177 void checkpoint();
178
179 PCB_LAYER_ID GetKicadLayer( ALTIUM_LAYER aAltiumLayer ) const;
180 std::vector<PCB_LAYER_ID> GetKicadLayersToIterate( ALTIUM_LAYER aAltiumLayer ) const;
181 int GetNetCode( uint16_t aId ) const;
182 const ARULE6* GetRule( ALTIUM_RULE_KIND aKind, const wxString& aName ) const;
183 const ARULE6* GetRuleDefault( ALTIUM_RULE_KIND aKind ) const;
184 const ARULE6* GetRuleForPolygon( ALTIUM_RULE_KIND aKind ) const;
185
186 void ParseFileHeader( const ALTIUM_PCB_COMPOUND_FILE& aAltiumPcbFile,
187 const CFB::COMPOUND_FILE_ENTRY* aEntry );
188
189 // Text Format
190 void ParseBoard6Data( const ALTIUM_PCB_COMPOUND_FILE& aAltiumPcbFile,
191 const CFB::COMPOUND_FILE_ENTRY* aEntry );
192 void ParseClasses6Data( const ALTIUM_PCB_COMPOUND_FILE& aAltiumPcbFile,
193 const CFB::COMPOUND_FILE_ENTRY* aEntry );
194 void ParseComponents6Data( const ALTIUM_PCB_COMPOUND_FILE& aAltiumPcbFile,
195 const CFB::COMPOUND_FILE_ENTRY* aEntry );
196 void ParseDimensions6Data( const ALTIUM_PCB_COMPOUND_FILE& aAltiumPcbFile,
197 const CFB::COMPOUND_FILE_ENTRY* aEntry );
198 void ParseModelsData( const ALTIUM_PCB_COMPOUND_FILE& aAltiumPcbFile,
199 const CFB::COMPOUND_FILE_ENTRY* aEntry,
200 const std::vector<std::string>& aRootDir );
201 void ParseNets6Data( const ALTIUM_PCB_COMPOUND_FILE& aAltiumPcbFile,
202 const CFB::COMPOUND_FILE_ENTRY* aEntry );
203 void ParsePolygons6Data( const ALTIUM_PCB_COMPOUND_FILE& aAltiumPcbFile,
204 const CFB::COMPOUND_FILE_ENTRY* aEntry );
205 void ParseRules6Data( const ALTIUM_PCB_COMPOUND_FILE& aAltiumPcbFile,
206 const CFB::COMPOUND_FILE_ENTRY* aEntry );
207
208 // Binary Format
209 void ParseArcs6Data( const ALTIUM_PCB_COMPOUND_FILE& aAltiumPcbFile,
210 const CFB::COMPOUND_FILE_ENTRY* aEntry );
211 void ConvertArcs6ToPcbShape( const AARC6& aElem, PCB_SHAPE* aShape );
212 void ConvertArcs6ToBoardItem( const AARC6& aElem, const int aPrimitiveIndex );
213 void ConvertArcs6ToFootprintItem( FOOTPRINT* aFootprint, const AARC6& aElem,
214 const int aPrimitiveIndex, const bool aIsBoardImport );
215 void ConvertArcs6ToBoardItemOnLayer( const AARC6& aElem, PCB_LAYER_ID aLayer );
216 void ConvertArcs6ToFootprintItemOnLayer( FOOTPRINT* aFootprint, const AARC6& aElem,
217 PCB_LAYER_ID aLayer );
218 void ParseComponentsBodies6Data( const ALTIUM_PCB_COMPOUND_FILE& aAltiumPcbFile,
219 const CFB::COMPOUND_FILE_ENTRY* aEntry );
221 FOOTPRINT* aFootprint,
222 const ACOMPONENTBODY6& aElem );
223 void ParsePads6Data( const ALTIUM_PCB_COMPOUND_FILE& aAltiumPcbFile,
224 const CFB::COMPOUND_FILE_ENTRY* aEntry );
225 void ConvertPads6ToBoardItem( const APAD6& aElem );
226 void ConvertPads6ToFootprintItem( FOOTPRINT* aFootprint, const APAD6& aElem );
227 void ConvertPads6ToBoardItemOnNonCopper( const APAD6& aElem );
228 void ConvertPads6ToFootprintItemOnCopper( FOOTPRINT* aFootprint, const APAD6& aElem );
229 void ConvertPads6ToFootprintItemOnNonCopper( FOOTPRINT* aFootprint, const APAD6& aElem );
230 void ParseVias6Data( const ALTIUM_PCB_COMPOUND_FILE& aAltiumPcbFile,
231 const CFB::COMPOUND_FILE_ENTRY* aEntry );
232 void ConvertVias6ToBoardItem( const AVIA6& aElem );
233 PAD* ConvertVias6ToFootprintItem( FOOTPRINT* aFootprint, const AVIA6& aElem );
234 void ParseTracks6Data( const ALTIUM_PCB_COMPOUND_FILE& aAltiumPcbFile,
235 const CFB::COMPOUND_FILE_ENTRY* aEntry );
236 void ConvertTracks6ToBoardItem( const ATRACK6& aElem, const int aPrimitiveIndex );
237 void ConvertTracks6ToFootprintItem( FOOTPRINT* aFootprint, const ATRACK6& aElem,
238 const int aPrimitiveIndex, const bool aIsBoardImport );
239 void ConvertTracks6ToBoardItemOnLayer( const ATRACK6& aElem, PCB_LAYER_ID aLayer );
240 void ConvertTracks6ToFootprintItemOnLayer( FOOTPRINT* aFootprint, const ATRACK6& aElem,
241 PCB_LAYER_ID aLayer );
242 void ParseSmartUnions6Data( const ALTIUM_PCB_COMPOUND_FILE& aAltiumPcbFile,
243 const CFB::COMPOUND_FILE_ENTRY* aEntry );
244 void ParseUnionNamesData( const ALTIUM_PCB_COMPOUND_FILE& aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY* aEntry );
248
254 void HelperDeferComponentCopper( FOOTPRINT* aFootprint, PCB_LAYER_ID aLayer, uint16_t aNet,
255 std::unique_ptr<PCB_SHAPE> aShape, std::function<void()> aFallback );
256
263 bool HelperFoldPendingCopper( const LSET& aCopper, int aMaxError, std::set<PAD*>& aExtensionPads );
264
267
270
273
274 void MapSchematicNetNames( const std::map<std::string, UTF8>& aProperties );
275 wxString SchematicCasedNetName( const wxString& aNetName ) const;
276
277 void ParseTexts6Data( const ALTIUM_PCB_COMPOUND_FILE& aAltiumPcbFile,
278 const CFB::COMPOUND_FILE_ENTRY* aEntry );
279 void ConvertTexts6ToBoardItem( const ATEXT6& aElem );
280 void ConvertTexts6ToFootprintItem( FOOTPRINT* aFootprint, const ATEXT6& aElem );
281 void ConvertTexts6ToBoardItemOnLayer( const ATEXT6& aElem, PCB_LAYER_ID aLayer );
282 void ConvertTexts6ToFootprintItemOnLayer( FOOTPRINT* aFootprint, const ATEXT6& aElem,
283 PCB_LAYER_ID aLayer );
284 void ConvertBarcodes6ToBoardItemOnLayer( const ATEXT6& aElem, PCB_LAYER_ID aLayer );
285 void ConvertBarcodes6ToFootprintItemOnLayer( FOOTPRINT* aFootprint, const ATEXT6& aElem,
286 PCB_LAYER_ID aLayer );
287 void ConvertTexts6ToEdaTextSettings( const ATEXT6& aElem, EDA_TEXT& aEdaText );
288 void ParseFills6Data( const ALTIUM_PCB_COMPOUND_FILE& aAltiumPcbFile,
289 const CFB::COMPOUND_FILE_ENTRY* aEntry );
290 void ConvertFills6ToBoardItem( const AFILL6& aElem );
291 void ConvertFills6ToFootprintItem( FOOTPRINT* aFootprint, const AFILL6& aElem,
292 const bool aIsBoardImport );
293 void ConvertFills6ToPcbShape( const AFILL6& aElem, PCB_SHAPE* aShape );
294 void ConvertFills6ToBoardItemOnLayer( const AFILL6& aElem, PCB_LAYER_ID aLayer );
295 void ConvertFills6ToFootprintItemOnLayer( FOOTPRINT* aFootprint, const AFILL6& aElem,
296 PCB_LAYER_ID aLayer );
297 void ParseBoardRegionsData( const ALTIUM_PCB_COMPOUND_FILE& aAltiumPcbFile,
298 const CFB::COMPOUND_FILE_ENTRY* aEntry );
299 void ParseShapeBasedRegions6Data( const ALTIUM_PCB_COMPOUND_FILE& aAltiumPcbFile,
300 const CFB::COMPOUND_FILE_ENTRY* aEntry );
301 void ConvertShapeBasedRegions6ToBoardItem( const AREGION6& aElem, const int aPrimitiveIndex );
302 void ConvertShapeBasedRegions6ToFootprintItem( FOOTPRINT* aFootprint, const AREGION6& aElem,
303 const int aPrimitiveIndex );
304
306 void ConvertShapeBasedRegions6ToFootprintCopper( FOOTPRINT* aFootprint, const AREGION6& aElem,
307 const int aPrimitiveIndex, uint16_t aNet );
309 const int aPrimitiveIndex );
311 const AREGION6& aElem,
312 PCB_LAYER_ID aLayer,
313 const int aPrimitiveIndex );
315 const CFB::COMPOUND_FILE_ENTRY* aEntry );
316 void ParseRegions6Data( const ALTIUM_PCB_COMPOUND_FILE& aAltiumPcbFile,
317 const CFB::COMPOUND_FILE_ENTRY* aEntry );
318 void ParseWideStrings6Data( const ALTIUM_PCB_COMPOUND_FILE& aAltiumPcbFile,
319 const CFB::COMPOUND_FILE_ENTRY* aEntry );
320
321 // Helper Functions
322 void HelperParseDimensions6Linear( const ADIMENSION6& aElem );
323 void HelperParseDimensions6Radial( const ADIMENSION6& aElem );
324 void HelperParseDimensions6Leader( const ADIMENSION6& aElem );
325 void HelperParseDimensions6Datum( const ADIMENSION6& aElem );
326 void HelperParseDimensions6Center( const ADIMENSION6& aElem );
327
328 void HelperParsePad6NonCopper( const APAD6& aElem, PCB_LAYER_ID aLayer, PCB_SHAPE* aShape );
329
330 void HelperFillMechanicalLayerAssignments( const std::vector<ABOARD6_LAYER_STACKUP>& aStackup );
331
332 void HelperCreateBoardOutline( const std::vector<ALTIUM_VERTICE>& aVertices );
333 void HelperCreateBoardOutline( const SHAPE_LINE_CHAIN& aOutline );
335
336 void HelperSetZoneLayers( ZONE& aZone, const ALTIUM_LAYER aAltiumLayer );
337 void HelperSetZoneKeepoutRestrictions( ZONE& aZone, const uint8_t aKeepoutRestrictions );
338
345 uint8_t HelperGetKeepoutRestrictions( const uint8_t aKeepoutRestrictions, const ALTIUM_LAYER aAltiumLayer );
346
347 void HelperFootprintZoneToLibFrame( ZONE& aZone, const FOOTPRINT& aFootprint );
349 const ALTIUM_LAYER aAltiumLayer,
350 const uint8_t aKeepoutRestrictions );
351 void HelperPcpShapeAsFootprintKeepoutRegion( FOOTPRINT* aFootprint, const PCB_SHAPE& aShape,
352 const ALTIUM_LAYER aAltiumLayer,
353 const uint8_t aKeepoutRestrictions );
354
355 void HelperSetTextboxAlignmentAndPos( const ATEXT6& aElem, PCB_TEXTBOX* aPcbTextbox );
356 void HelperSetTextAlignmentAndPos( const ATEXT6& aElem, EDA_TEXT* aEdaText );
357
358 std::vector<std::pair<PCB_LAYER_ID, int>>
359 HelperGetSolderAndPasteMaskExpansions( const ALTIUM_RECORD aType, const int aPrimitiveIndex,
360 const ALTIUM_LAYER aAltiumLayer );
361
362 FOOTPRINT* HelperGetFootprint( uint16_t aComponent ) const;
363
365
374 int HelperGetPadstackLayerIndex( PCB_LAYER_ID aLayer ) const;
375
386 std::shared_ptr<EMBEDDED_FILES::EMBEDDED_FILE>
387 HelperEmbedModel( FOOTPRINT* aFootprint, const wxString& aModelName,
388 const std::vector<char>& aCompressedData, bool& aIsNew );
389
390 void remapUnsureLayers( std::vector<ABOARD6_LAYER_STACKUP>& aStackup );
391
393 std::vector<FOOTPRINT*> m_components;
394 std::vector<ZONE*> m_polygons;
395 std::vector<PCB_DIM_RADIAL*> m_radialDimensions;
396
397 // The outline waits for every board cutout, since a cutout can run over the board edge
399 std::vector<SHAPE_LINE_CHAIN> m_boardCutouts;
402 std::map<uint32_t, wxString> m_unicodeStrings;
403 std::vector<int> m_altiumToKicadNetcodes;
404 std::map<wxString, wxString> m_schematicNetNames; // upper cased name to schematic casing
405 std::map<ALTIUM_LAYER, PCB_LAYER_ID> m_layermap; // used to correctly map layers
406 std::map<ALTIUM_LAYER, wxString> m_layerNames;
407 std::map<PCB_LAYER_ID, int> m_padstackLayerIndex;
408
409 std::map<wxString, ALTIUM_EMBEDDED_MODEL_DATA> m_EmbeddedModels;
410 std::map<ALTIUM_RULE_KIND, std::vector<ARULE6>> m_rules;
411 std::map<ALTIUM_RECORD, std::multimap<int, const AEXTENDED_PRIMITIVE_INFORMATION>>
413
414 std::vector<ASMARTUNION6> m_tuningUnions;
415 std::map<uint32_t, wxString> m_unionNames;
416 std::map<int, std::vector<BOARD_ITEM*>> m_unionToBoardItems;
417
419 {
423 std::unique_ptr<PCB_SHAPE> shape;
424 std::function<void()> fallback;
425 };
426
427 std::vector<PENDING_COMPONENT_COPPER> m_pendingComponentCopper;
428 std::vector<std::pair<FOOTPRINT*, AVIA6>> m_pendingComponentVias;
429
430 std::map<ALTIUM_LAYER, ZONE*> m_outer_plane;
431
433
436 std::set<wxString> m_specialStrings;
437 unsigned m_doneCount;
439 unsigned m_totalCount;
440
441 wxString m_library;
443
446};
447
448
449#endif //ALTIUM_PCB_H
const char * name
ALTIUM_RULE_KIND
ALTIUM_RECORD
void ApplyAltiumNetclassRules(const std::map< ALTIUM_RULE_KIND, std::vector< ARULE6 > > &aRulesByKind, NET_SETTINGS &aNetSettings, std::vector< const ARULE6 * > *aUnresolved=nullptr)
Copy the values of Altium rules scoped to a single netclass onto that netclass.
wxString AltiumUnnamedNetName(const BOARD &aBoard, int &aCounter)
Invent a placeholder name for an Altium net that has none.
ALTIUM_PCB_DIR
Definition altium_pcb.h:40
@ UNIQUEIDPRIMITIVEINFORMATION
Definition altium_pcb.h:83
@ SHAPEBASEDCOMPONENTBODIES6
Definition altium_pcb.h:74
@ DESIGNRULECHECKEROPTIONS6
Definition altium_pcb.h:52
@ EXTENDPRIMITIVEINFORMATION
Definition altium_pcb.h:58
std::function< void(const ALTIUM_PCB_COMPOUND_FILE &, const CFB::COMPOUND_FILE_ENTRY *)> PARSE_FUNCTION_POINTER_fp
Definition altium_pcb.h:152
PROGRESS_REPORTER * m_progressReporter
optional; may be nullptr
Definition altium_pcb.h:434
std::shared_ptr< EMBEDDED_FILES::EMBEDDED_FILE > HelperEmbedModel(FOOTPRINT *aFootprint, const wxString &aModelName, const std::vector< char > &aCompressedData, bool &aIsNew)
Return the 3D model aModelName embedded in aFootprint, inflating and embedding aCompressedData first ...
void ParseClasses6Data(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
std::vector< PCB_DIM_RADIAL * > m_radialDimensions
Definition altium_pcb.h:395
const ARULE6 * GetRuleForPolygon(ALTIUM_RULE_KIND aKind) const
void ConvertArcs6ToFootprintItemOnLayer(FOOTPRINT *aFootprint, const AARC6 &aElem, PCB_LAYER_ID aLayer)
void ConvertTracks6ToBoardItem(const ATRACK6 &aElem, const int aPrimitiveIndex)
void ConvertTracks6ToFootprintItem(FOOTPRINT *aFootprint, const ATRACK6 &aElem, const int aPrimitiveIndex, const bool aIsBoardImport)
int m_highest_pour_index
Altium stores pour order across all layers.
Definition altium_pcb.h:445
void HelperCreateTuningPatterns()
void ConvertTexts6ToFootprintItemOnLayer(FOOTPRINT *aFootprint, const ATEXT6 &aElem, PCB_LAYER_ID aLayer)
std::map< ALTIUM_LAYER, PCB_LAYER_ID > m_layermap
Definition altium_pcb.h:405
void ParseVias6Data(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
void HelperParseDimensions6Leader(const ADIMENSION6 &aElem)
wxString m_footprintName
for footprint library loading error reporting
Definition altium_pcb.h:442
const std::set< wxString > & GetSpecialStrings() const
Special strings in the parsed text that KiCad has no variable for.
Definition altium_pcb.h:174
std::vector< FOOTPRINT * > m_components
Definition altium_pcb.h:393
void HelperFillMechanicalLayerAssignments(const std::vector< ABOARD6_LAYER_STACKUP > &aStackup)
void ParseShapeBasedRegions6Data(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
const ARULE6 * GetRuleDefault(ALTIUM_RULE_KIND aKind) const
void HelperParsePad6NonCopper(const APAD6 &aElem, PCB_LAYER_ID aLayer, PCB_SHAPE *aShape)
void ConvertShapeBasedRegions6ToFootprintCopper(FOOTPRINT *aFootprint, const AREGION6 &aElem, const int aPrimitiveIndex, uint16_t aNet)
Plain copper region of a footprint; inner layers wait to join the pad they touch.
void ParseRegions6Data(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
std::vector< PCB_LAYER_ID > GetKicadLayersToIterate(ALTIUM_LAYER aAltiumLayer) const
int m_outlineJogCount
Definition altium_pcb.h:400
void ConvertShapeBasedRegions6ToFootprintItem(FOOTPRINT *aFootprint, const AREGION6 &aElem, const int aPrimitiveIndex)
void HelperPcpShapeAsFootprintKeepoutRegion(FOOTPRINT *aFootprint, const PCB_SHAPE &aShape, const ALTIUM_LAYER aAltiumLayer, const uint8_t aKeepoutRestrictions)
void ConvertArcs6ToBoardItem(const AARC6 &aElem, const int aPrimitiveIndex)
SHAPE_LINE_CHAIN m_boardOutline
Definition altium_pcb.h:398
void ConvertShapeBasedRegions6ToFootprintItemOnLayer(FOOTPRINT *aFootprint, const AREGION6 &aElem, PCB_LAYER_ID aLayer, const int aPrimitiveIndex)
std::map< ALTIUM_LAYER, ZONE * > m_outer_plane
Definition altium_pcb.h:430
std::vector< int > m_altiumToKicadNetcodes
Definition altium_pcb.h:403
std::map< uint32_t, wxString > m_unionNames
Definition altium_pcb.h:415
void HelperFinishBoardOutline()
void ConvertFills6ToPcbShape(const AFILL6 &aElem, PCB_SHAPE *aShape)
unsigned m_totalCount
for progress reporting
Definition altium_pcb.h:439
void ParseComponents6Data(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
void HelperPcpShapeAsBoardKeepoutRegion(const PCB_SHAPE &aShape, const ALTIUM_LAYER aAltiumLayer, const uint8_t aKeepoutRestrictions)
void HelperDeferComponentCopper(FOOTPRINT *aFootprint, PCB_LAYER_ID aLayer, uint16_t aNet, std::unique_ptr< PCB_SHAPE > aShape, std::function< void()> aFallback)
Hold copper a footprint draws until its pads exist.
std::map< wxString, ALTIUM_EMBEDDED_MODEL_DATA > m_EmbeddedModels
Definition altium_pcb.h:409
void ConvertFills6ToBoardItemOnLayer(const AFILL6 &aElem, PCB_LAYER_ID aLayer)
std::vector< std::pair< PCB_LAYER_ID, int > > HelperGetSolderAndPasteMaskExpansions(const ALTIUM_RECORD aType, const int aPrimitiveIndex, const ALTIUM_LAYER aAltiumLayer)
void ConvertBarcodes6ToBoardItemOnLayer(const ATEXT6 &aElem, PCB_LAYER_ID aLayer)
void ConvertComponentBody6ToFootprintItem(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, FOOTPRINT *aFootprint, const ACOMPONENTBODY6 &aElem)
void HelperSetTextAlignmentAndPos(const ATEXT6 &aElem, EDA_TEXT *aEdaText)
void ParseBoard6Data(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
void ConvertFills6ToFootprintItem(FOOTPRINT *aFootprint, const AFILL6 &aElem, const bool aIsBoardImport)
void ParseExtendedPrimitiveInformationData(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
void ParseFileHeader(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
std::vector< PENDING_COMPONENT_COPPER > m_pendingComponentCopper
Definition altium_pcb.h:427
std::set< wxString > m_specialStrings
special strings in text that KiCad has no variable for
Definition altium_pcb.h:436
void HelperCreateBoardOutline(const std::vector< ALTIUM_VERTICE > &aVertices)
int m_outlineJogLargest
Definition altium_pcb.h:401
std::map< int, std::vector< BOARD_ITEM * > > m_unionToBoardItems
Definition altium_pcb.h:416
void HelperAssignNetclassesToNets()
Rebuild the composite netclasses and point every net at its effective netclass.
std::map< ALTIUM_RULE_KIND, std::vector< ARULE6 > > m_rules
Definition altium_pcb.h:410
void ParseRules6Data(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
PAD * ConvertVias6ToFootprintItem(FOOTPRINT *aFootprint, const AVIA6 &aElem)
void MapSchematicNetNames(const std::map< std::string, UTF8 > &aProperties)
void HelperSetZoneKeepoutRestrictions(ZONE &aZone, const uint8_t aKeepoutRestrictions)
unsigned m_doneCount
Definition altium_pcb.h:437
void HelperParseDimensions6Linear(const ADIMENSION6 &aElem)
void ParseTracks6Data(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
std::map< uint32_t, wxString > m_unicodeStrings
Definition altium_pcb.h:402
void ConvertTexts6ToBoardItem(const ATEXT6 &aElem)
void HelperParseDimensions6Center(const ADIMENSION6 &aElem)
void HelperParseDimensions6Radial(const ADIMENSION6 &aElem)
void ParseUnionNamesData(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
bool HelperFoldPendingCopper(const LSET &aCopper, int aMaxError, std::set< PAD * > &aExtensionPads)
Join each deferred copper shape on aCopper to the same-net numbered pad it touches.
BOARD * m_board
Definition altium_pcb.h:392
void ParseBoardRegionsData(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
void ParseArcs6Data(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
void ConvertTexts6ToBoardItemOnLayer(const ATEXT6 &aElem, PCB_LAYER_ID aLayer)
void ConvertPads6ToFootprintItemOnCopper(FOOTPRINT *aFootprint, const APAD6 &aElem)
std::unique_ptr< FOOTPRINT > ParseFootprint(ALTIUM_PCB_COMPOUND_FILE &altiumLibFile, const wxString &aFootprintName)
REPORTER * m_reporter
optional; may be nullptr
Definition altium_pcb.h:435
int GetNetCode(uint16_t aId) const
void ConvertTexts6ToEdaTextSettings(const ATEXT6 &aElem, EDA_TEXT &aEdaText)
void HelperBuildPadstackLayerIndex()
wxString m_library
for footprint library loading error reporting
Definition altium_pcb.h:441
std::vector< SHAPE_LINE_CHAIN > m_boardCutouts
Definition altium_pcb.h:399
void ConvertPads6ToFootprintItemOnNonCopper(FOOTPRINT *aFootprint, const APAD6 &aElem)
std::map< wxString, wxString > m_schematicNetNames
Definition altium_pcb.h:404
void ConvertShapeBasedRegions6ToBoardItemOnLayer(const AREGION6 &aElem, PCB_LAYER_ID aLayer, const int aPrimitiveIndex)
void ConvertTexts6ToFootprintItem(FOOTPRINT *aFootprint, const ATEXT6 &aElem)
unsigned m_lastProgressCount
Definition altium_pcb.h:438
void ParseFills6Data(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
uint8_t HelperGetKeepoutRestrictions(const uint8_t aKeepoutRestrictions, const ALTIUM_LAYER aAltiumLayer)
Resolve an Altium keepout restriction mask, substituting the restrictions implied by the layer when t...
void ConvertArcs6ToFootprintItem(FOOTPRINT *aFootprint, const AARC6 &aElem, const int aPrimitiveIndex, const bool aIsBoardImport)
void HelperParseDimensions6Datum(const ADIMENSION6 &aElem)
void ConvertPads6ToBoardItem(const APAD6 &aElem)
void ConvertFills6ToFootprintItemOnLayer(FOOTPRINT *aFootprint, const AFILL6 &aElem, PCB_LAYER_ID aLayer)
void ParseWideStrings6Data(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
void remapUnsureLayers(std::vector< ABOARD6_LAYER_STACKUP > &aStackup)
std::vector< ASMARTUNION6 > m_tuningUnions
Definition altium_pcb.h:414
void HelperSetFootprintMountingStyles()
std::vector< ZONE * > m_polygons
Definition altium_pcb.h:394
void ParsePads6Data(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
void HelperFoldComponentCopperIntoPads()
Join deferred component copper and vias to the same-net pads they touch.
void ConvertArcs6ToPcbShape(const AARC6 &aElem, PCB_SHAPE *aShape)
void ConvertTracks6ToBoardItemOnLayer(const ATRACK6 &aElem, PCB_LAYER_ID aLayer)
void ConvertFills6ToBoardItem(const AFILL6 &aElem)
void HelperSetFootprintStackups()
std::map< PCB_LAYER_ID, int > m_padstackLayerIndex
Definition altium_pcb.h:407
void Parse(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const std::map< ALTIUM_PCB_DIR, std::string > &aFileMapping, const std::map< std::string, UTF8 > *aProperties=nullptr)
void ConvertVias6ToBoardItem(const AVIA6 &aElem)
FOOTPRINT * HelperGetFootprint(uint16_t aComponent) const
friend struct ALTIUM_PCB_IMPORT_FIXTURE
Definition altium_pcb.h:156
void HelperFootprintZoneToLibFrame(ZONE &aZone, const FOOTPRINT &aFootprint)
LAYER_MAPPING_HANDLER m_layerMappingHandler
Definition altium_pcb.h:432
void ConvertShapeBasedRegions6ToBoardItem(const AREGION6 &aElem, const int aPrimitiveIndex)
std::vector< std::pair< FOOTPRINT *, AVIA6 > > m_pendingComponentVias
Definition altium_pcb.h:428
void ParsePolygons6Data(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
PCB_LAYER_ID GetKicadLayer(ALTIUM_LAYER aAltiumLayer) const
int HelperGetPadstackLayerIndex(PCB_LAYER_ID aLayer) const
Return the slot aLayer occupies in an Altium padstack's per-layer arrays.
void checkpoint()
void ParseComponentsBodies6Data(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
void ConvertTracks6ToFootprintItemOnLayer(FOOTPRINT *aFootprint, const ATRACK6 &aElem, PCB_LAYER_ID aLayer)
void ParseSmartUnions6Data(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
wxString SchematicCasedNetName(const wxString &aNetName) const
ALTIUM_PCB(BOARD *aBoard, PROGRESS_REPORTER *aProgressReporter, LAYER_MAPPING_HANDLER &aLayerMappingHandler, REPORTER *aReporter=nullptr, const wxString &aLibrary=wxEmptyString, const wxString &aFootprintName=wxEmptyString)
void ConvertArcs6ToBoardItemOnLayer(const AARC6 &aElem, PCB_LAYER_ID aLayer)
void ParseTexts6Data(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
std::map< ALTIUM_RECORD, std::multimap< int, const AEXTENDED_PRIMITIVE_INFORMATION > > m_extendedPrimitiveInformationMaps
Definition altium_pcb.h:412
void ParseModelsData(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry, const std::vector< std::string > &aRootDir)
std::map< ALTIUM_LAYER, wxString > m_layerNames
Definition altium_pcb.h:406
void ConvertPads6ToBoardItemOnNonCopper(const APAD6 &aElem)
void HelperSetTextboxAlignmentAndPos(const ATEXT6 &aElem, PCB_TEXTBOX *aPcbTextbox)
void ConvertBarcodes6ToFootprintItemOnLayer(FOOTPRINT *aFootprint, const ATEXT6 &aElem, PCB_LAYER_ID aLayer)
void ParseNets6Data(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
void ConvertPads6ToFootprintItem(FOOTPRINT *aFootprint, const APAD6 &aElem)
const ARULE6 * GetRule(ALTIUM_RULE_KIND aKind, const wxString &aName) const
void ParseDimensions6Data(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
void HelperPlaceUnfoldedCopper()
Run the fallback of every deferred copper shape no pad took.
void HelperSetZoneLayers(ZONE &aZone, const ALTIUM_LAYER aAltiumLayer)
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition board_item.h:85
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:411
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Definition eda_text.h:94
LSET is a set of PCB_LAYER_IDs.
Definition lset.h:37
NET_SETTINGS stores various net-related settings in a project context.
Definition pad.h:61
A radial dimension indicates either the radius or diameter of an arc or circle.
A progress reporter interface for use in multi-threaded environments.
A pure virtual class used to derive REPORTER objects from.
Definition reporter.h:73
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
Handle a list of polygons defining a copper zone.
Definition zone.h:70
PCB_LAYER_ID
A quick note on layer IDs:
Definition layer_ids.h:56
STL namespace.
std::function< std::map< wxString, PCB_LAYER_ID >(const std::vector< INPUT_LAYER_DESC > &)> LAYER_MAPPING_HANDLER
Pointer to a function that takes a map of source and KiCad layers and returns a re-mapped version.
std::vector< char > m_data
Definition altium_pcb.h:116
ALTIUM_EMBEDDED_MODEL_DATA(const wxString &name, const VECTOR3D &rotation, double z_offset, std::vector< char > &&data)
Definition altium_pcb.h:119
std::unique_ptr< PCB_SHAPE > shape
Board coordinates, released once folded.
Definition altium_pcb.h:423
std::function< void()> fallback
Definition altium_pcb.h:424
VECTOR3< double > VECTOR3D
Definition vector3.h:230