KiCad PCB EDA Suite
Loading...
Searching...
No Matches
board.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) 2007 Jean-Pierre Charras, [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 CLASS_BOARD_H_
22#define CLASS_BOARD_H_
23
24#include <atomic>
27#include <core/mirror.h>
28#include <embedded_files.h>
29#include <convert_shape_list_to_polygon.h> // for OUTLINE_ERROR_HANDLER
31#include <hash.h>
32#include <layer_ids.h>
33#include <lset.h>
34#include <netinfo.h>
35#include <pcb_item_containers.h>
36#include <pcb_plot_params.h>
37#include <title_block.h>
38#include <zone_settings.h>
39#include <shared_mutex>
40#include <sharded_cache.h>
41#include <unordered_set>
42#include <project.h>
43#include <list>
44
48class BOARD_COMMIT;
50class DRC_RTREE;
51class PCB_BASE_FRAME;
52class PCB_EDIT_FRAME;
55class BOARD;
56class FOOTPRINT;
58class ZONE;
59class PCB_TRACK;
60class PAD;
61class PCB_GROUP;
62class PCB_GENERATOR;
63class PCB_MARKER;
64class MSG_PANEL_ITEM;
65class NETLIST;
66class REPORTER;
68class COMPONENT;
69class PROJECT;
72
73namespace KIGFX
74{
75class RENDER_SETTINGS;
76};
77
78
79namespace KIFONT
80{
81 class OUTLINE_FONT;
82}
83
84struct ISOLATED_ISLANDS;
85
86// The default value for m_outlinesChainingEpsilon to convert a board outlines to polygons
87// It is the max dist between 2 end points to see them connected
88#define DEFAULT_CHAINING_EPSILON_MM 0.01
89
90// Forward declare endpoint from class_track.h
91enum ENDPOINT_T : int;
92
93
95{
98
99 bool operator==(const PTR_PTR_CACHE_KEY& other) const
100 {
101 return A == other.A && B == other.B;
102 }
103};
104
106{
109
110 bool operator==(const PTR_LAYER_CACHE_KEY& other) const
111 {
112 return A == other.A && Layer == other.Layer;
113 }
114};
115
117{
121
122 bool operator==(const PTR_PTR_LAYER_CACHE_KEY& other) const
123 {
124 return A == other.A && B == other.B && Layer == other.Layer;
125 }
126};
127
128// Caches the whole-predicate result of a footprint-selector query (e.g. intersectsCourtyard)
129// for one item, so a rule set that repeats the same condition does not re-scan every footprint.
131{
132 const BOARD_ITEM* A;
133 wxString Selector; // the selector argument string, compared verbatim
135 int Constraint; // some predicates (intersectsArea) branch on the constraint
136
137 bool operator==( const ITEM_SELECTOR_LAYER_CACHE_KEY& other ) const
138 {
139 return A == other.A && Selector == other.Selector && Layer == other.Layer
140 && Constraint == other.Constraint;
141 }
142};
143
144// Caches getField('x') text per (item, field name)
146{
147 const BOARD_ITEM* A;
148 std::size_t FieldHash;
149
150 bool operator==( const ITEM_FIELD_CACHE_KEY& other ) const
151 {
152 return A == other.A && FieldHash == other.FieldHash;
153 }
154};
155
157{
159 layers(),
160 has_error( false )
161 {}
162
164 layers( { aLayer } ),
165 has_error( false )
166 {}
167
170};
171
172
173namespace std
174{
175 template <>
176 struct hash<PTR_PTR_CACHE_KEY>
177 {
178 std::size_t operator()( const PTR_PTR_CACHE_KEY& k ) const
179 {
180 std::size_t seed = 0xa82de1c0;
181 hash_combine( seed, k.A, k.B );
182 return seed;
183 }
184 };
185
186 template <>
188 {
189 std::size_t operator()( const PTR_LAYER_CACHE_KEY& k ) const
190 {
191 std::size_t seed = 0xa82de1c0;
192 hash_combine( seed, k.A, k.Layer );
193 return seed;
194 }
195 };
196
197 template <>
199 {
200 std::size_t operator()( const PTR_PTR_LAYER_CACHE_KEY& k ) const
201 {
202 std::size_t seed = 0xa82de1c0;
203 hash_combine( seed, k.A, k.B, k.Layer );
204 return seed;
205 }
206 };
207
208 template <>
210 {
211 std::size_t operator()( const ITEM_SELECTOR_LAYER_CACHE_KEY& k ) const
212 {
213 std::size_t seed = 0xa82de1c0;
214 hash_combine( seed, k.A, k.Selector, k.Layer, k.Constraint );
215 return seed;
216 }
217 };
218
219 template <>
221 {
222 std::size_t operator()( const ITEM_FIELD_CACHE_KEY& k ) const
223 {
224 std::size_t seed = 0xa82de1c0;
225 hash_combine( seed, k.A, k.FieldHash );
226 return seed;
227 }
228 };
229}
230
231
246
247
251struct LAYER
252{
254 {
255 clear();
256 }
257
258 void clear()
259 {
261 m_visible = true;
262 m_number = 0;
263 m_name.clear();
264 m_userName.clear();
266 }
267
268 /*
269 LAYER( const wxString& aName = wxEmptyString,
270 LAYER_T aType = LT_SIGNAL, bool aVisible = true, int aNumber = -1 ) :
271 m_name( aName ),
272 m_type( aType ),
273 m_visible( aVisible ),
274 m_number( aNumber )
275 {
276 }
277 */
278
279 wxString m_name;
280 wxString m_userName;
285
292 static const char* ShowType( LAYER_T aType );
293
301 static LAYER_T ParseType( const char* aType );
302};
303
304
305// Helper class to handle high light nets
307{
308protected:
309 std::set<int> m_netCodes; // net(s) selected for highlight (-1 when no net selected )
310 bool m_highLightOn; // highlight active
311
312 void Clear()
313 {
314 m_netCodes.clear();
315 m_highLightOn = false;
316 }
317
319 {
320 Clear();
321 }
322
323private:
324 friend class BOARD;
325};
326
332class BOARD;
333
335{
336public:
337 virtual ~BOARD_LISTENER() { }
338 virtual void OnBoardItemAdded( BOARD& aBoard, BOARD_ITEM* aBoardItem ) { }
339 virtual void OnBoardItemsAdded( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItems ) { }
340 virtual void OnBoardItemRemoved( BOARD& aBoard, BOARD_ITEM* aBoardItem ) { }
341 virtual void OnBoardItemsRemoved( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItems ) { }
342 virtual void OnBoardNetSettingsChanged( BOARD& aBoard ) { }
343 virtual void OnBoardItemChanged( BOARD& aBoard, BOARD_ITEM* aBoardItem ) { }
344 virtual void OnBoardItemsChanged( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItems ) { }
345 virtual void OnBoardHighlightNetChanged( BOARD& aBoard ) { }
346 virtual void OnBoardRatsnestChanged( BOARD& aBoard ) { }
347 virtual void OnBoardCompositeUpdate( BOARD& aBoard, std::vector<BOARD_ITEM*>& aAddedItems,
348 std::vector<BOARD_ITEM*>& aRemovedItems,
349 std::vector<BOARD_ITEM*>& aChangedItems )
350 {
351 }
352};
353
357typedef std::set<BOARD_ITEM*, CompareByUuid> BOARD_ITEM_SET;
358
362enum class BOARD_USE
363{
364 NORMAL, // A normal board
365 FPHOLDER // A board that holds a single footprint
366};
367
368
373{
374public:
375 static inline bool ClassOf( const EDA_ITEM* aItem )
376 {
377 return aItem && PCB_T == aItem->Type();
378 }
379
385 void SetBoardUse( BOARD_USE aUse ) { m_boardUse = aUse; }
386
392 BOARD_USE GetBoardUse() const { return m_boardUse; }
393
394 void IncrementTimeStamp();
395
396 int GetTimeStamp() const { return m_timeStamp.load( std::memory_order_acquire ); }
397
403 bool IsFootprintHolder() const
404 {
406 }
407
408 void SetFileName( const wxString& aFileName ) { m_fileName = aFileName; }
409
410 const wxString &GetFileName() const { return m_fileName; }
411
417 wxString GetDesignRulesPath() const;
418
419 const TRACKS& Tracks() const { return m_tracks; }
420
421 const FOOTPRINTS& Footprints() const { return m_footprints; }
422
423 const DRAWINGS& Drawings() const { return m_drawings; }
424
425 const ZONES& Zones() const { return m_zones; }
426
432 wxString GetUniqueZoneName( const wxString& aBaseName, const ZONE* aExclude = nullptr ) const;
433
434 const GENERATORS& Generators() const { return m_generators; }
435
438 void UpdateBoardOutline();
439
440 const MARKERS& Markers() const { return m_markers; }
441
442 const PCB_POINTS& Points() const { return m_points; }
443
447
451 const BOARD_ITEM_SET GetItemSet() const;
452
461 const GROUPS& Groups() const { return m_groups; }
462
465 const CONSTRAINTS& Constraints() const { return m_constraints; }
466
467 const std::vector<BOARD_CONNECTED_ITEM*> AllConnectedItems();
468
469 const std::map<wxString, wxString>& GetProperties() const { return m_properties; }
470 void SetProperties( const std::map<wxString, wxString>& aProps ) { m_properties = aProps; }
471
472 // Variant system
473 wxString GetCurrentVariant() const { return m_currentVariant; }
474 void SetCurrentVariant( const wxString& aVariant );
475
476 const std::vector<wxString>& GetVariantNames() const { return m_variantNames; }
477 void SetVariantNames( const std::vector<wxString>& aNames ) { m_variantNames = aNames; }
478
479 bool HasVariant( const wxString& aVariantName ) const;
480 void AddVariant( const wxString& aVariantName );
481 void DeleteVariant( const wxString& aVariantName );
482 void RenameVariant( const wxString& aOldName, const wxString& aNewName );
483
484 wxString GetVariantDescription( const wxString& aVariantName ) const;
485 void SetVariantDescription( const wxString& aVariantName, const wxString& aDescription );
486
495 wxArrayString GetVariantNamesForUI() const;
496
497 void GetContextualTextVars( wxArrayString* aVars ) const;
498 bool ResolveTextVar( wxString* token, int aDepth ) const;
499
503
507
510
511 BOARD();
512 ~BOARD();
513
514 VECTOR2I GetPosition() const override;
515 void SetPosition( const VECTOR2I& aPos ) override;
516 const VECTOR2I GetFocusPosition() const override { return GetBoundingBox().GetCenter(); }
517
518 bool IsEmpty() const;
519
520 void Move( const VECTOR2I& aMoveVector ) override;
521
522 void RunOnChildren( const std::function<void( BOARD_ITEM* )>& aFunction, RECURSE_MODE aMode ) const override;
523
524 void SetFileFormatVersionAtLoad( int aVersion ) { m_fileFormatVersionAtLoad = aVersion; }
526
527 void SetGenerator( const wxString& aGenerator ) { m_generator = aGenerator; }
528 const wxString& GetGenerator() const { return m_generator; }
529
531 void Add( BOARD_ITEM* aItem, ADD_MODE aMode = ADD_MODE::INSERT,
532 bool aSkipConnectivity = false ) override;
533
535 void Remove( BOARD_ITEM* aBoardItem, REMOVE_MODE aMode = REMOVE_MODE::NORMAL ) override;
536
545 void RemoveAll( std::initializer_list<KICAD_T> aTypes = { PCB_NETINFO_T, PCB_MARKER_T,
549
550 bool HasItemsOnLayer( PCB_LAYER_ID aLayer );
551
560 bool RemoveAllItemsOnLayer( PCB_LAYER_ID aLayer );
561
566 void BulkRemoveStaleTeardrops( BOARD_COMMIT& aCommit );
567
572 void FinalizeBulkAdd( std::vector<BOARD_ITEM*>& aNewItems );
573
578 void FinalizeBulkRemove( std::vector<BOARD_ITEM*>& aRemovedItems );
579
585 void FixupEmbeddedData();
586
587 void RunOnNestedEmbeddedFiles( const std::function<void( EMBEDDED_FILES* )>& aFunction ) override;
588
589 void CacheTriangulation( PROGRESS_REPORTER* aReporter = nullptr,
590 const std::vector<ZONE*>& aZones = {} );
591
600 {
601 return m_footprints.empty() ? nullptr : m_footprints.front();
602 }
603
607 void DeleteAllFootprints();
608
612 void DetachAllFootprints();
613
618 BOARD_ITEM* ResolveItem( const KIID& aID, bool aAllowNullptrReturn = false ) const;
619
623 void RebindItemUuid( BOARD_ITEM* aItem, const KIID& aNewId );
624
633
634 void FillItemMap( std::map<KIID, EDA_ITEM*>& aMap );
635
639 wxString ConvertCrossReferencesToKIIDs( const wxString& aSource ) const;
640 wxString ConvertKIIDsToCrossReferences( const wxString& aSource ) const;
641
646 std::shared_ptr<CONNECTIVITY_DATA> GetConnectivity() const { return m_connectivity; }
647
653 bool BuildConnectivity( PROGRESS_REPORTER* aReporter = nullptr );
654
658 void DeleteMARKERs();
659
660 void DeleteMARKERs( bool aWarningsAndErrors, bool aExclusions );
661
662 PROJECT* GetProject() const { return m_project; }
663
672 void SetProject( PROJECT* aProject, bool aReferenceOnly = false );
673
674 void ClearProject();
675
683 std::vector<PCB_MARKER*> ResolveDRCExclusions( bool aCreateMarkers );
684
688 void RecordDRCExclusions();
689
694
700 void CompileRatsnest();
701
705 void ExchangeFootprint( FOOTPRINT* aExisting, FOOTPRINT* aNew, BOARD_COMMIT& aCommit,
706 bool matchPadPositions,
707 bool deleteExtraTexts = true, bool resetTextLayers = true,
708 bool resetTextEffects = true, bool resetTextPositions = true,
709 bool resetTextContent = true, bool resetFabricationAttrs = true,
710 bool resetClearanceOverrides = true, bool reset3DModels = true,
711 bool resetTransform = false,
712 bool* aUpdated = nullptr );
713
717 void ResetNetHighLight();
718
722 const std::set<int>& GetHighLightNetCodes() const
723 {
724 return m_highLight.m_netCodes;
725 }
726
733 void SetHighLightNet( int aNetCode, bool aMulti = false );
734
738 bool IsHighLightNetON() const { return m_highLight.m_highLightOn; }
739
747 void HighLightON( bool aValue = true );
748
753 {
754 HighLightON( false );
755 }
756
760 int GetCopperLayerCount() const;
761 void SetCopperLayerCount( int aCount );
762
763 int GetUserDefinedLayerCount() const;
764 void SetUserDefinedLayerCount( int aCount );
765
771
772 PCB_LAYER_ID FlipLayer( PCB_LAYER_ID aLayer ) const;
773
774 int LayerDepth( PCB_LAYER_ID aStartLayer, PCB_LAYER_ID aEndLayer ) const;
775
781 const LSET& GetEnabledLayers() const;
782 LSET GetLayerSet() const override { return GetEnabledLayers(); }
783
789 void SetEnabledLayers( const LSET& aLayerMask );
790 void SetLayerSet( const LSET& aLayerMask ) override { SetEnabledLayers( aLayerMask ); }
791
798 bool IsLayerEnabled( PCB_LAYER_ID aLayer ) const;
799
807 bool IsLayerVisible( PCB_LAYER_ID aLayer ) const;
808
814 const LSET& GetVisibleLayers() const;
815
822 void SetVisibleLayers( const LSET& aLayerMask );
823
824 // these 2 functions are not tidy at this time, since there are PCB_LAYER_IDs that
825 // are not stored in the bitmap.
826
834
841 void SetVisibleElements( const GAL_SET& aMask );
842
848 void SetVisibleAlls();
849
857 bool IsElementVisible( GAL_LAYER_ID aLayer ) const;
858
866 void SetElementVisibility( GAL_LAYER_ID aLayer, bool aNewState );
867
875 bool IsFootprintLayerVisible( PCB_LAYER_ID aLayer ) const;
876
881 void SetDesignSettings( const BOARD_DESIGN_SETTINGS& aSettings );
882
890 void InvalidateClearanceCache( const KIID& aUuid );
891
898
900
901 const PAGE_INFO& GetPageSettings() const { return m_paper; }
902 void SetPageSettings( const PAGE_INFO& aPageSettings ) { m_paper = aPageSettings; }
903
905 void SetPlotOptions( const PCB_PLOT_PARAMS& aOptions ) { m_plotOptions = aOptions; }
906
908 const TITLE_BLOCK& GetTitleBlock() const { return m_titles; }
909 void SetTitleBlock( const TITLE_BLOCK& aTitleBlock ) { m_titles = aTitleBlock; }
910
911 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
912
914 void SetUserUnits( EDA_UNITS aUnits ) { m_userUnits = aUnits; }
915
920 void UpdateUserUnits( BOARD_ITEM* aItem, KIGFX::VIEW* aView );
921
942 bool GetBoardPolygonOutlines( SHAPE_POLY_SET& aOutlines, bool aInferOutlineIfNecessary,
943 OUTLINE_ERROR_HANDLER* aErrorHandler = nullptr,
944 bool aAllowUseArcsInPolygons = false, bool aIncludeNPTHAsOutlines = false );
945
955
969 KIGFX::RENDER_SETTINGS* aRenderSettings = nullptr ) const;
970
974 PCB_LAYER_ID GetLayerID( const wxString& aLayerName ) const;
975
982 const wxString GetLayerName( PCB_LAYER_ID aLayer ) const;
983
991 bool SetLayerName( PCB_LAYER_ID aLayer, const wxString& aLayerName );
992
1003 static wxString GetStandardLayerName( PCB_LAYER_ID aLayerId )
1004 {
1005 // a BOARD's standard layer name is the PCB_LAYER_ID fixed name
1006 return LayerName( aLayerId );
1007 }
1008
1016 bool SetLayerDescr( PCB_LAYER_ID aIndex, const LAYER& aLayer );
1017
1021 bool IsFrontLayer( PCB_LAYER_ID aLayer ) const;
1022
1026 bool IsBackLayer( PCB_LAYER_ID aLayer ) const;
1027
1034 LAYER_T GetLayerType( PCB_LAYER_ID aLayer ) const;
1035
1043 bool SetLayerType( PCB_LAYER_ID aLayer, LAYER_T aLayerType );
1044
1049 unsigned GetNodesCount( int aNet = -1 ) const;
1050
1059 const std::vector<PAD*> GetPads() const;
1060
1062 {
1063 m_NetInfo.buildListOfNets();
1064 }
1065
1072 NETINFO_ITEM* FindNet( int aNetcode ) const;
1073
1080 NETINFO_ITEM* FindNet( const wxString& aNetname ) const;
1081
1091 int MatchDpSuffix( const wxString& aNetName, wxString& aComplementNet );
1092
1096 NETINFO_ITEM* DpCoupledNet( const NETINFO_ITEM* aNet );
1097
1099 {
1100 return m_NetInfo;
1101 }
1102
1104 {
1105 m_NetInfo.RemoveUnusedNets( aCommit );
1106 }
1107
1112 {
1113 return m_NetInfo.begin();
1114 }
1115
1120 {
1121 return m_NetInfo.end();
1122 }
1123
1127 unsigned GetNetCount() const
1128 {
1129 return m_NetInfo.GetNetCount();
1130 }
1131
1136
1141
1148 BOX2I ComputeBoundingBox( bool aBoardEdgesOnly = false, bool aPhysicalLayersOnly = false ) const;
1149
1150 const BOX2I GetBoundingBox() const override
1151 {
1152 return ComputeBoundingBox( false, false );
1153 }
1154
1165 {
1166 return ComputeBoundingBox( true, true );
1167 }
1168
1169 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
1170
1182 INSPECT_RESULT Visit( INSPECTOR inspector, void* testData,
1183 const std::vector<KICAD_T>& scanTypes ) override;
1184
1193 FOOTPRINT* FindFootprintByReference( const wxString& aReference ) const;
1194
1201 FOOTPRINT* FindFootprintByPath( const KIID_PATH& aPath ) const;
1202
1203 PAD* FindPadByUuid( const KIID& aUuid ) const;
1204
1205 void ReplaceNetChainTerminalPad( const wxString& aNetChain, const KIID& aPrev, const KIID& aNew );
1206
1210 void SetNetChainColor( const wxString& aChain, const KIGFX::COLOR4D& aColor )
1211 {
1212 if( aColor == KIGFX::COLOR4D::UNSPECIFIED )
1213 m_netChainColors.erase( aChain );
1214 else
1215 m_netChainColors[aChain] = aColor;
1216 }
1217
1218 KIGFX::COLOR4D GetNetChainColor( const wxString& aChain ) const
1219 {
1220 auto it = m_netChainColors.find( aChain );
1221 return it != m_netChainColors.end() ? it->second : KIGFX::COLOR4D::UNSPECIFIED;
1222 }
1223
1224 const std::map<wxString, KIGFX::COLOR4D>& GetNetChainColors() const
1225 {
1226 return m_netChainColors;
1227 }
1228
1232 std::set<wxString> GetNetClassAssignmentCandidates() const;
1233
1241 void SynchronizeNetsAndNetClasses( bool aResetTrackAndViaSizes );
1242
1252
1256 bool SynchronizeComponentClasses( const std::unordered_set<wxString>& aNewSheetPaths ) const;
1257
1261 void SynchronizeProperties();
1262
1267
1271 double Similarity( const BOARD_ITEM& aOther ) const override
1272 {
1273 return 1.0;
1274 }
1275
1276 bool operator==( const BOARD_ITEM& aOther ) const override;
1277
1278 wxString GetClass() const override
1279 {
1280 return wxT( "BOARD" );
1281 }
1282
1283#if defined(DEBUG)
1284 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
1285#endif
1286
1287
1288 /*************************/
1289 /* Copper Areas handling */
1290 /*************************/
1291
1302
1309 ZONE* GetArea( int index ) const
1310 {
1311 if( (unsigned) index < m_zones.size() )
1312 return m_zones[index];
1313
1314 return nullptr;
1315 }
1316
1320 std::list<ZONE*> GetZoneList( bool aIncludeZonesInFootprints = false ) const;
1321
1325 int GetAreaCount() const
1326 {
1327 return static_cast<int>( m_zones.size() );
1328 }
1329
1330 /* Functions used in test, merge and cut outlines */
1331
1344 ZONE* AddArea( PICKED_ITEMS_LIST* aNewZonesList, int aNetcode, PCB_LAYER_ID aLayer,
1345 VECTOR2I aStartPointPosition, ZONE_BORDER_DISPLAY_STYLE aHatch );
1346
1354 bool TestZoneIntersection( ZONE* aZone1, ZONE* aZone2 );
1355
1363 PAD* GetPad( const VECTOR2I& aPosition, const LSET& aLayerMask ) const;
1364 PAD* GetPad( const VECTOR2I& aPosition ) const
1365 {
1366 return GetPad( aPosition, LSET().set() );
1367 }
1368
1376 PAD* GetPad( const PCB_TRACK* aTrace, ENDPOINT_T aEndPoint ) const;
1377
1392 PAD* GetPad( std::vector<PAD*>& aPadList, const VECTOR2I& aPosition, const LSET& aLayerMask ) const;
1393
1405 void GetSortedPadListByXthenYCoord( std::vector<PAD*>& aVector, int aNetCode = -1 ) const;
1406
1414 std::tuple<int, double, double, double, double> GetTrackLength( const PCB_TRACK& aTrack ) const;
1415
1423 TRACKS TracksInNet( int aNetCode );
1424
1437 FOOTPRINT* GetFootprint( const VECTOR2I& aPosition, PCB_LAYER_ID aActiveLayer,
1438 bool aVisibleOnly, bool aIgnoreLocked = false ) const;
1439
1445 int GetMaxClearanceValue() const;
1446
1452 void MapNets( BOARD* aDestBoard );
1453
1454 void SanitizeNetcodes();
1455
1464 void AddListener( BOARD_LISTENER* aListener );
1465
1470 void RemoveListener( BOARD_LISTENER* aListener );
1471
1475 void RemoveAllListeners();
1476
1481 void OnItemChanged( BOARD_ITEM* aItem );
1482
1487 void OnItemsChanged( std::vector<BOARD_ITEM*>& aItems );
1488
1493 void OnItemsCompositeUpdate( std::vector<BOARD_ITEM*>& aAddedItems,
1494 std::vector<BOARD_ITEM*>& aRemovedItems,
1495 std::vector<BOARD_ITEM*>& aChangedItems );
1496
1500 void OnRatsnestChanged();
1501
1508 wxString GroupsSanityCheck( bool repair = false );
1509
1515 wxString GroupsSanityCheckInternal( bool repair );
1516
1517 bool LegacyTeardrops() const { return m_legacyTeardrops; }
1518 void SetLegacyTeardrops( bool aFlag ) { m_legacyTeardrops = aFlag; }
1519
1520 EMBEDDED_FILES* GetEmbeddedFiles() override;
1521 const EMBEDDED_FILES* GetEmbeddedFiles() const;
1522
1524
1528 std::set<KIFONT::OUTLINE_FONT*> GetFonts() const override;
1529
1533 void EmbedFonts() override;
1534
1539
1544
1546
1556 void SaveToHistory( const wxString& aProjectPath, std::vector<HISTORY_FILE_DATA>& aFileData );
1557
1562 std::weak_ptr<void> GetHistoryLifetimeToken() const { return m_historyLifetime; }
1563
1564 const std::unordered_map<KIID, BOARD_ITEM*>& GetItemByIdCache() const
1565 {
1566 return m_itemByIdCache;
1567 }
1568
1569 bool IsItemIndexedById( const BOARD_ITEM* aItem ) const
1570 {
1571 return m_cachedIdByItem.contains( aItem );
1572 }
1573
1581 BOARD_ITEM* GetCachedItemById( const KIID& aId ) const;
1582
1589 void CacheItemById( BOARD_ITEM* aItem ) const;
1590
1597 void UncacheItemById( const KIID& aId ) const;
1598
1600 {
1601 wxCHECK( aItem, /* void */ );
1602
1603 CacheItemById( aItem );
1604
1605 aItem->RunOnChildren(
1606 [this]( BOARD_ITEM* aChild )
1607 {
1608 CacheItemSubtreeById( aChild );
1609 },
1611 }
1612
1613 void CacheChildrenById( const BOARD_ITEM* aParent )
1614 {
1615 wxCHECK( aParent, /* void */ );
1616
1617 aParent->RunOnChildren(
1618 [this]( BOARD_ITEM* aChild )
1619 {
1620 CacheItemSubtreeById( aChild );
1621 },
1623 }
1624
1626 {
1627 wxCHECK( aItem, /* void */ );
1628
1629 // Pointer-keyed eviction: never remove an entry that belongs to a
1630 // different live item with the same UUID (e.g. a temporary copy).
1631 UncacheItemByPtr( aItem );
1632
1633 aItem->RunOnChildren(
1634 [this]( BOARD_ITEM* aChild )
1635 {
1636 UncacheItemSubtreeById( aChild );
1637 },
1639 }
1640
1641 void UncacheChildrenById( const BOARD_ITEM* aParent )
1642 {
1643 wxCHECK( aParent, /* void */ );
1644
1645 aParent->RunOnChildren(
1646 [this]( BOARD_ITEM* aChild )
1647 {
1648 UncacheItemSubtreeById( aChild );
1649 },
1651 }
1652
1659 void UncacheItemByPtr( const BOARD_ITEM* aItem );
1660
1661 BOARD_ITEM* CacheAndReturnItemById( const KIID& aId, BOARD_ITEM* aItem ) const;
1662
1663 void ClearItemByIdCache();
1664
1665 // --------- Item order comparators ---------
1666
1668 {
1669 bool operator() ( const BOARD_ITEM* aFirst, const BOARD_ITEM* aSecond ) const;
1670 };
1671
1673 {
1674 bool operator()( const BOARD_ITEM* aFirst, const BOARD_ITEM* aSecond ) const;
1675 };
1676
1677public:
1687 std::shared_ptr<const FOOTPRINT_COURTYARD_INDEX> GetFootprintCourtyardIndex();
1688
1689 // ------------ Run-time caches -------------
1690 mutable std::shared_mutex m_CachesMutex;
1691 // These predicate caches are written per item-pair from every DRC worker thread, so they
1692 // carry their own internal sharded locks and are NOT covered by m_CachesMutex.
1704 std::unordered_map< wxString, LSET > m_LayerExpressionCache;
1705 std::unordered_map<ZONE*, std::unique_ptr<DRC_RTREE>> m_CopperZoneRTreeCache;
1706 std::shared_ptr<DRC_RTREE> m_CopperItemRTreeCache;
1707 mutable std::unordered_map<const ZONE*, BOX2I> m_ZoneBBoxCache;
1708 mutable std::optional<int> m_maxClearanceValue;
1709
1710 mutable std::unordered_map<const BOARD_ITEM*, wxString> m_ItemNetclassCache;
1711
1712 // Zone name lookup cache for DRC rule area functions like enclosedByArea/intersectsArea.
1713 // Maps zone names to vectors of matching zones to avoid O(n) zone iteration per lookup.
1714 mutable std::unordered_map<wxString, std::vector<ZONE*>> m_ZonesByNameCache;
1715
1716 // Deflated zone outline cache for DRC area checks. Caches the deflated outline for each zone
1717 // to avoid repeated expensive deflation operations during collidesWithArea calls.
1718 mutable std::unordered_map<const ZONE*, SHAPE_POLY_SET> m_DeflatedZoneOutlineCache;
1719
1720 // Spatial index of footprint courtyards, built lazily by GetFootprintCourtyardIndex().
1721 std::shared_ptr<const FOOTPRINT_COURTYARD_INDEX> m_footprintCourtyardIndex;
1722
1723 // ------------ DRC caches -------------
1724 std::vector<ZONE*> m_DRCZones;
1725 std::vector<ZONE*> m_DRCCopperZones;
1726 std::map<PCB_LAYER_ID, std::vector<ZONE*>> m_DRCCopperZonesByLayer;
1729 ZONE* m_SolderMaskBridges; // A container to build bridges on solder mask layers
1730 std::map<ZONE*, std::map<PCB_LAYER_ID, ISOLATED_ISLANDS>> m_ZoneIsolatedIslandsMap;
1731
1732private:
1733 // The default copy constructor & operator= are inadequate,
1734 // either write one or do not use it at all
1735 BOARD( const BOARD& aOther ) = delete;
1736
1737 BOARD& operator=( const BOARD& aOther ) = delete;
1738
1739 template <typename Func, typename... Args>
1740 void InvokeListeners( Func&& aFunc, Args&&... args )
1741 {
1742 for( auto&& l : m_listeners )
1743 ( l->*aFunc )( std::forward<Args>( args )... );
1744 }
1745
1746 // Refresh user layer opposites.
1747 void recalcOpposites();
1748
1749 friend class PCB_EDIT_FRAME;
1750
1751private:
1754
1757 std::atomic<int> m_timeStamp; // actually a modification counter
1758
1759 wxString m_fileName;
1760
1761 std::map<wxString, KIGFX::COLOR4D> m_netChainColors;
1762
1763 // These containers only have const accessors and must only be modified by Add()/Remove()
1774
1775 // Cache for fast access to items in the containers above by KIID, including children.
1776 // Mutable because it's a performance cache that can be populated during const lookups.
1777 // NOT protected by m_CachesMutex. Only safe for single-threaded access (UI, serialization).
1778 mutable std::unordered_map<KIID, BOARD_ITEM*> m_itemByIdCache;
1779 mutable std::unordered_map<const BOARD_ITEM*, KIID> m_cachedIdByItem;
1780
1781 std::map<int, LAYER> m_layers; // layer data
1782
1783 HIGH_LIGHT_INFO m_highLight; // current high light data
1784 HIGH_LIGHT_INFO m_highLightPrevious; // a previously stored high light data
1785
1786 int m_fileFormatVersionAtLoad; // the version loaded from the file
1787 wxString m_generator; // the generator tag from the file
1788
1789 std::map<wxString, wxString> m_properties;
1790 std::shared_ptr<CONNECTIVITY_DATA> m_connectivity;
1791
1792 // Sentinel whose expiry signals to LOCAL_HISTORY that this board has been destroyed.
1793 std::shared_ptr<void> m_historyLifetime = std::make_shared<char>();
1794
1796 TITLE_BLOCK m_titles; // text in lower right of screen and plots
1798 PROJECT* m_project; // project this board is a part of
1800
1801 // Variant system
1802 wxString m_currentVariant; // Currently active variant (empty = default)
1803 std::vector<wxString> m_variantNames; // All variant names in the board
1804 std::map<wxString, wxString> m_variantDescriptions; // Descriptions for each variant
1805
1816 std::unique_ptr<BOARD_DESIGN_SETTINGS> m_designSettings;
1817
1822 bool m_legacyTeardrops = false;
1823
1824 NETINFO_LIST m_NetInfo; // net info list (name, design constraints...
1825
1826 std::vector<BOARD_LISTENER*> m_listeners;
1827
1829
1830 // Used for dummy boards, such as a footprint holder, where we don't want to make a copy
1831 // of all the parent's embedded data.
1833
1834 std::unique_ptr<COMPONENT_CLASS_MANAGER> m_componentClassManager;
1835 std::unique_ptr<LENGTH_DELAY_CALCULATION> m_lengthDelayCalc;
1836
1837 // Reactive text-variable dependency adapter. Installed as a listener
1838 // during BOARD construction; destructor order ensures it outlives no
1839 // listener calls.
1840 std::unique_ptr<class BOARD_TEXT_VAR_ADAPTER> m_textVarAdapter;
1841
1842public:
1844};
1845
1846
1847#endif // CLASS_BOARD_H_
int index
BOARD_USE
Flags to specify how the board is being used.
Definition board.h:363
@ FPHOLDER
Definition board.h:365
LAYER_T
The allowed types of layers, same as Specctra DSN spec.
Definition board.h:236
@ LT_POWER
Definition board.h:239
@ LT_FRONT
Definition board.h:243
@ LT_MIXED
Definition board.h:240
@ LT_BACK
Definition board.h:244
@ LT_UNDEFINED
Definition board.h:237
@ LT_JUMPER
Definition board.h:241
@ LT_AUX
Definition board.h:242
@ LT_SIGNAL
Definition board.h:238
std::set< BOARD_ITEM *, CompareByUuid > BOARD_ITEM_SET
Set of BOARD_ITEMs ordered by UUID.
Definition board.h:357
BOX2< VECTOR2I > BOX2I
Definition box2.h:918
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
Container for design settings for a BOARD object.
BOARD_ITEM_CONTAINER(BOARD_ITEM *aParent, KICAD_T aType)
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition board_item.h:83
BOARD_ITEM(BOARD_ITEM *aParent, KICAD_T idtype, PCB_LAYER_ID aLayer=F_Cu)
Definition board_item.h:85
virtual void RunOnChildren(const std::function< void(BOARD_ITEM *)> &aFunction, RECURSE_MODE aMode) const
Invoke a function on all children.
Definition board_item.h:233
wxString GetLayerName() const
Return the name of the PCB layer on which the item resides.
virtual void OnBoardNetSettingsChanged(BOARD &aBoard)
Definition board.h:342
virtual void OnBoardRatsnestChanged(BOARD &aBoard)
Definition board.h:346
virtual void OnBoardItemsAdded(BOARD &aBoard, std::vector< BOARD_ITEM * > &aBoardItems)
Definition board.h:339
virtual void OnBoardItemChanged(BOARD &aBoard, BOARD_ITEM *aBoardItem)
Definition board.h:343
virtual void OnBoardItemRemoved(BOARD &aBoard, BOARD_ITEM *aBoardItem)
Definition board.h:340
virtual void OnBoardItemAdded(BOARD &aBoard, BOARD_ITEM *aBoardItem)
Definition board.h:338
virtual void OnBoardHighlightNetChanged(BOARD &aBoard)
Definition board.h:345
virtual void OnBoardItemsRemoved(BOARD &aBoard, std::vector< BOARD_ITEM * > &aBoardItems)
Definition board.h:341
virtual void OnBoardCompositeUpdate(BOARD &aBoard, std::vector< BOARD_ITEM * > &aAddedItems, std::vector< BOARD_ITEM * > &aRemovedItems, std::vector< BOARD_ITEM * > &aChangedItems)
Definition board.h:347
virtual void OnBoardItemsChanged(BOARD &aBoard, std::vector< BOARD_ITEM * > &aBoardItems)
Definition board.h:344
virtual ~BOARD_LISTENER()
Definition board.h:337
Manage layers needed to make a physical board.
Bridges BOARD's listener stream into the generic TEXT_VAR_TRACKER.
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:373
INSPECT_RESULT Visit(INSPECTOR inspector, void *testData, const std::vector< KICAD_T > &scanTypes) override
May be re-implemented for each derived class in order to handle all the types given by its member dat...
Definition board.cpp:2617
ZONE * m_SolderMaskBridges
Definition board.h:1729
void ApplyNetChainNetclasses()
Expand the project's chain-to-netclass assignments into per-net pattern assignments,...
Definition board.cpp:3124
void GetContextualTextVars(wxArrayString *aVars) const
Definition board.cpp:542
bool IsFootprintLayerVisible(PCB_LAYER_ID aLayer) const
Expect either of the two layers on which a footprint can reside, and returns whether that layer is vi...
Definition board.cpp:1147
BOARD_STACKUP GetStackupOrDefault() const
Definition board.cpp:3389
void SetPlotOptions(const PCB_PLOT_PARAMS &aOptions)
Definition board.h:905
std::map< ZONE *, std::map< PCB_LAYER_ID, ISOLATED_ISLANDS > > m_ZoneIsolatedIslandsMap
Definition board.h:1730
PCB_LAYER_ID GetCopperLayerStackMaxId() const
Definition board.cpp:1018
GENERATORS m_generators
Definition board.h:1771
void OnItemChanged(BOARD_ITEM *aItem)
Notify the board and its listeners that an item on the board has been modified in some way.
Definition board.cpp:3732
std::shared_ptr< void > m_historyLifetime
Definition board.h:1793
const NETINFO_LIST & GetNetInfo() const
Definition board.h:1098
bool m_LegacyDesignSettingsLoaded
True if the legacy board design settings were loaded from a file.
Definition board.h:505
BOARD_TEXT_VAR_ADAPTER * GetTextVarAdapter() const
Definition board.h:1843
bool IsFootprintHolder() const
Find out if the board is being used to hold a single footprint for editing/viewing.
Definition board.h:403
PAD * GetPad(const VECTOR2I &aPosition, const LSET &aLayerMask) const
Find a pad aPosition on aLayer.
Definition board.cpp:3239
SHARDED_CACHE< PTR_PTR_LAYER_CACHE_KEY, bool > m_IntersectsAreaCache
Definition board.h:1696
int GetUserDefinedLayerCount() const
Definition board.cpp:1007
void recalcOpposites()
Definition board.cpp:927
void CacheItemSubtreeById(BOARD_ITEM *aItem)
Definition board.h:1599
void SetPosition(const VECTOR2I &aPos) override
Definition board.cpp:680
std::map< wxString, wxString > m_properties
Definition board.h:1789
void CacheItemById(BOARD_ITEM *aItem) const
Add an item to the item-by-id cache.
Definition board.cpp:2077
SHARDED_CACHE< ITEM_SELECTOR_LAYER_CACHE_KEY, bool > m_IntersectsCourtyardResultCache
Definition board.h:1698
std::unordered_map< const BOARD_ITEM *, wxString > m_ItemNetclassCache
Definition board.h:1710
EMBEDDED_FILES * GetEmbeddedFiles() override
Definition board.cpp:3575
SHARDED_CACHE< PTR_PTR_LAYER_CACHE_KEY, bool > m_EnclosedByAreaCache
Definition board.h:1697
int m_fileFormatVersionAtLoad
Definition board.h:1786
NETINFO_ITEM * DpCoupledNet(const NETINFO_ITEM *aNet)
Definition board.cpp:2844
void UncacheItemById(const KIID &aId) const
Remove an item from the item-by-id cache.
Definition board.cpp:2108
void SetCurrentVariant(const wxString &aVariant)
Definition board.cpp:2949
std::vector< ZONE * > m_DRCCopperZones
Definition board.h:1725
void SetVisibleLayers(const LSET &aLayerMask)
A proxy function that calls the correspondent function in m_BoardSettings changes the bit-mask of vis...
Definition board.cpp:1075
BOARD_USE GetBoardUse() const
Get what the board use is.
Definition board.h:392
void SetVariantNames(const std::vector< wxString > &aNames)
Definition board.h:477
const std::vector< wxString > & GetVariantNames() const
Definition board.h:476
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Removes an item from the container.
Definition board.cpp:1355
const std::set< int > & GetHighLightNetCodes() const
Definition board.h:722
SHARDED_CACHE< ITEM_SELECTOR_LAYER_CACHE_KEY, bool > m_EnclosedByAreaResultCache
Definition board.h:1702
void MapNets(BOARD *aDestBoard)
Map all nets in the given board to nets with the same name (if any) in the destination board.
Definition board.cpp:3679
bool m_legacyTeardrops
Teardrops in 7.0 were applied as a post-processing step (rather than from pad and via properties).
Definition board.h:1822
TITLE_BLOCK m_titles
Definition board.h:1796
GAL_SET m_LegacyVisibleItems
Definition board.h:502
void SetBoardUse(BOARD_USE aUse)
Set what the board is going to be used for.
Definition board.h:385
ZONE * GetArea(int index) const
Return the Zone at a given index.
Definition board.h:1309
std::vector< wxString > m_variantNames
Definition board.h:1803
const BOX2I GetBoardEdgesBoundingBox() const
Return the board bounding box calculated using exclusively the board edges (graphics on Edge....
Definition board.h:1164
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition board.h:1150
LENGTH_DELAY_CALCULATION * GetLengthCalculation() const
Returns the track length calculator.
Definition board.h:1538
wxArrayString GetVariantNamesForUI() const
Return the variant names for UI display.
Definition board.cpp:3104
void BuildListOfNets()
Definition board.h:1061
void RunOnNestedEmbeddedFiles(const std::function< void(EMBEDDED_FILES *)> &aFunction) override
Provide access to nested embedded files, such as symbols in schematics and footprints in boards.
Definition board.cpp:1276
void SetNetChainColor(const wxString &aChain, const KIGFX::COLOR4D &aColor)
Per-net-chain colour override (empty COLOR4D::UNSPECIFIED = no override).
Definition board.h:1210
const GENERATORS & Generators() const
Definition board.h:434
void SetFileName(const wxString &aFileName)
Definition board.h:408
static wxString GetStandardLayerName(PCB_LAYER_ID aLayerId)
Return an "English Standard" name of a PCB layer when given aLayerNumber.
Definition board.h:1003
const std::vector< BOARD_CONNECTED_ITEM * > AllConnectedItems()
Definition board.cpp:3644
LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
Definition board.h:782
bool IsElementVisible(GAL_LAYER_ID aLayer) const
Test whether a given element category is visible.
Definition board.cpp:1109
int m_outlinesChainingEpsilon
the max distance between 2 end point to see them connected when building the board outlines
Definition board.h:1753
std::tuple< int, double, double, double, double > GetTrackLength(const PCB_TRACK &aTrack) const
Return data on the length and number of track segments connected to a given track.
Definition board.cpp:3400
std::set< wxString > GetNetClassAssignmentCandidates() const
Return the set of netname candidates for netclass assignment.
Definition board.cpp:2915
BOARD_USE m_boardUse
What is this board being used for.
Definition board.h:1756
void ExchangeFootprint(FOOTPRINT *aExisting, FOOTPRINT *aNew, BOARD_COMMIT &aCommit, bool matchPadPositions, bool deleteExtraTexts=true, bool resetTextLayers=true, bool resetTextEffects=true, bool resetTextPositions=true, bool resetTextContent=true, bool resetFabricationAttrs=true, bool resetClearanceOverrides=true, bool reset3DModels=true, bool resetTransform=false, bool *aUpdated=nullptr)
Replace aExisting with aNew, preserving connectivity and metadata.
PCB_BOARD_OUTLINE * BoardOutline()
Definition board.h:436
PAGE_INFO m_paper
Definition board.h:1795
void RemoveAllListeners()
Remove all listeners.
Definition board.cpp:3726
SHARDED_CACHE< PTR_PTR_CACHE_KEY, bool > m_IntersectsBCourtyardCache
Definition board.h:1695
FOOTPRINTS m_footprints
Definition board.h:1766
std::unique_ptr< BOARD_DESIGN_SETTINGS > m_designSettings
All of the board design settings are stored as a JSON object inside the project file.
Definition board.h:1816
friend class PCB_EDIT_FRAME
Definition board.h:1749
void SetEmbeddedFilesDelegate(EMBEDDED_FILES *aDelegate)
Definition board.h:1523
const PCB_POINTS & Points() const
Definition board.h:442
void ConvertBrdLayerToPolygonalContours(PCB_LAYER_ID aLayer, SHAPE_POLY_SET &aOutlines, KIGFX::RENDER_SETTINGS *aRenderSettings=nullptr) const
Build a set of polygons which are the outlines of copper items (pads, tracks, vias,...
Definition board.cpp:3954
void AddListener(BOARD_LISTENER *aListener)
Add a listener to the board to receive calls whenever something on the board has been modified.
Definition board.cpp:3707
const PAGE_INFO & GetPageSettings() const
Definition board.h:901
void UpdateUserUnits(BOARD_ITEM *aItem, KIGFX::VIEW *aView)
Update any references within aItem (or its descendants) to the user units.
Definition board.cpp:1830
void SetProperties(const std::map< wxString, wxString > &aProps)
Definition board.h:470
bool IsBackLayer(PCB_LAYER_ID aLayer) const
Definition board.cpp:852
const std::map< wxString, KIGFX::COLOR4D > & GetNetChainColors() const
Definition board.h:1224
BOARD(const BOARD &aOther)=delete
GAL_SET GetVisibleElements() const
Return a set of all the element categories that are visible.
Definition board.cpp:1103
void SetHighLightNet(int aNetCode, bool aMulti=false)
Select the netcode to be highlighted.
Definition board.cpp:3774
void CompileRatsnest()
Rebuild the entire board ratsnest.
Definition board.cpp:3757
HIGH_LIGHT_INFO m_highLight
Definition board.h:1783
std::map< wxString, wxString > m_variantDescriptions
Definition board.h:1804
bool SetLayerDescr(PCB_LAYER_ID aIndex, const LAYER &aLayer)
Return the type of the copper layer given by aLayer.
Definition board.cpp:774
NETINFO_ITEM * FindNet(int aNetcode) const
Search for a net with the given netcode.
Definition board.cpp:2777
EDA_UNITS m_userUnits
Definition board.h:1799
CONSTRAINTS m_constraints
Definition board.h:1769
void UpdateBoardOutline()
Definition board.cpp:4151
const ZONES & Zones() const
Definition board.h:425
void BulkRemoveStaleTeardrops(BOARD_COMMIT &aCommit)
Remove all teardrop zones with the STRUCT_DELETED flag set.
Definition board.cpp:1486
void ClearItemByIdCache()
Definition board.cpp:2186
void DeleteVariant(const wxString &aVariantName)
Definition board.cpp:2992
void InvokeListeners(Func &&aFunc, Args &&... args)
Definition board.h:1740
void SetDesignSettings(const BOARD_DESIGN_SETTINGS &aSettings)
Definition board.cpp:1164
const LSET & GetVisibleLayers() const
A proxy function that calls the correspondent function in m_BoardSettings.
Definition board.cpp:1057
void SanitizeNetcodes()
Definition board.cpp:3697
void InitializeClearanceCache()
Initialize the clearance cache for all board items.
Definition board.cpp:1177
EMBEDDED_FILES * m_embeddedFilesDelegate
Definition board.h:1832
ZONE * AddArea(PICKED_ITEMS_LIST *aNewZonesList, int aNetcode, PCB_LAYER_ID aLayer, VECTOR2I aStartPointPosition, ZONE_BORDER_DISPLAY_STYLE aHatch)
Add an empty copper area to board areas list.
Definition board.cpp:3509
bool IsFrontLayer(PCB_LAYER_ID aLayer) const
Definition board.cpp:846
const GROUPS & Groups() const
The groups must maintain the following invariants.
Definition board.h:461
~BOARD()
Definition board.cpp:170
void SaveToHistory(const wxString &aProjectPath, std::vector< HISTORY_FILE_DATA > &aFileData)
Serialize board into HISTORY_FILE_DATA for non-blocking history commit.
Definition board.cpp:4198
bool BuildConnectivity(PROGRESS_REPORTER *aReporter=nullptr)
Build or rebuild the board connectivity database for the board, especially the list of connected item...
Definition board.cpp:202
bool IsLayerEnabled(PCB_LAYER_ID aLayer) const
A proxy function that calls the correspondent function in m_BoardSettings tests whether a given layer...
Definition board.cpp:1069
LAYER_T GetLayerType(PCB_LAYER_ID aLayer) const
Return the type of the copper layer given by aLayer.
Definition board.cpp:858
void RecordDRCExclusions()
Scan existing markers and record data from any that are Excluded.
Definition board.cpp:392
DRAWINGS m_drawings
Definition board.h:1765
void OnItemsCompositeUpdate(std::vector< BOARD_ITEM * > &aAddedItems, std::vector< BOARD_ITEM * > &aRemovedItems, std::vector< BOARD_ITEM * > &aChangedItems)
Notify the board and its listeners that items on the board have been modified in a composite operatio...
Definition board.cpp:3744
int SetAreasNetCodesFromNetNames()
Set the .m_NetCode member of all copper areas, according to the area Net Name The SetNetCodesFromNetN...
Definition board.cpp:3205
void SynchronizeNetsAndNetClasses(bool aResetTrackAndViaSizes)
Copy NETCLASS info to each NET, based on NET membership in a NETCLASS.
Definition board.cpp:3164
EDA_UNITS GetUserUnits()
Definition board.h:913
void ResetNetHighLight()
Reset all high light data to the init state.
Definition board.cpp:3765
PCB_PLOT_PARAMS m_plotOptions
Definition board.h:1797
SHARDED_CACHE< PTR_PTR_CACHE_KEY, bool > m_IntersectsCourtyardCache
Definition board.h:1693
bool SetLayerName(PCB_LAYER_ID aLayer, const wxString &aLayerName)
Changes the name of the layer given by aLayer.
Definition board.cpp:820
std::list< ZONE * > GetZoneList(bool aIncludeZonesInFootprints=false) const
Definition board.cpp:3489
std::weak_ptr< void > GetHistoryLifetimeToken() const
Liveness token handed to LOCAL_HISTORY::RegisterSaver so a shared autosave timer skips this board's s...
Definition board.h:1562
bool ResolveTextVar(wxString *token, int aDepth) const
Definition board.cpp:569
const MARKERS & Markers() const
Definition board.h:440
FOOTPRINT * GetFirstFootprint() const
Get the first footprint on the board or nullptr.
Definition board.h:599
void UncacheChildrenById(const BOARD_ITEM *aParent)
Definition board.h:1641
PCB_LAYER_ID FlipLayer(PCB_LAYER_ID aLayer) const
Definition board.cpp:987
const std::vector< PAD * > GetPads() const
Return a reference to a list of all the pads.
Definition board.cpp:3630
void Move(const VECTOR2I &aMoveVector) override
Move this object.
Definition board.cpp:686
std::unique_ptr< class BOARD_TEXT_VAR_ADAPTER > m_textVarAdapter
Definition board.h:1840
TITLE_BLOCK & GetTitleBlock()
Definition board.h:907
void FixupEmbeddedData()
After loading a file from disk, the footprints do not yet contain the full data for their embedded fi...
Definition board.cpp:1283
int GetMaxClearanceValue() const
Returns the maximum clearance value for any object on the board.
Definition board.cpp:1184
ZONES m_zones
Definition board.h:1770
void InvalidateClearanceCache(const KIID &aUuid)
Invalidate the clearance cache for a specific item.
Definition board.cpp:1170
PAD * GetPad(const VECTOR2I &aPosition) const
Definition board.h:1364
PAD * FindPadByUuid(const KIID &aUuid) const
Definition board.cpp:2883
std::unordered_map< const BOARD_ITEM *, KIID > m_cachedIdByItem
Definition board.h:1779
PCB_LAYER_ID GetLayerID(const wxString &aLayerName) const
Return the ID of a layer.
Definition board.cpp:782
HIGH_LIGHT_INFO m_highLightPrevious
Definition board.h:1784
const VECTOR2I GetFocusPosition() const override
Similar to GetPosition() but allows items to return their visual center rather than their anchor.
Definition board.h:516
void HighLightOFF()
Disable net highlight.
Definition board.h:752
NETINFO_LIST m_NetInfo
Definition board.h:1824
LSET m_LegacyVisibleLayers
Visibility settings stored in board prior to 6.0, only used for loading legacy files.
Definition board.h:501
void SetVisibleAlls()
Change the bit-mask of visible element categories and layers.
Definition board.cpp:1092
void SetOutlinesChainingEpsilon(int aValue)
Definition board.h:954
bool HasVariant(const wxString &aVariantName) const
Definition board.cpp:2975
NETINFO_LIST::iterator EndNets() const
Definition board.h:1119
void AddVariant(const wxString &aVariantName)
Definition board.cpp:2981
int GetCopperLayerCount() const
Definition board.cpp:994
std::vector< BOARD_LISTENER * > m_listeners
Definition board.h:1826
bool RemoveAllItemsOnLayer(PCB_LAYER_ID aLayer)
Removes all owned items other than footprints existing on the given board layer, and modifies the sta...
Definition board.cpp:1744
const std::map< wxString, wxString > & GetProperties() const
Definition board.h:469
void IncrementTimeStamp()
Definition board.cpp:284
int MatchDpSuffix(const wxString &aNetName, wxString &aComplementNet)
Fetch the coupled netname for a given net.
Definition board.cpp:2796
wxString GetUniqueZoneName(const wxString &aBaseName, const ZONE *aExclude=nullptr) const
Return a name based on aBaseName that is not used by any other zone or rule area on the board.
Definition board.cpp:1304
PCB_POINTS m_points
Definition board.h:1773
std::unique_ptr< LENGTH_DELAY_CALCULATION > m_lengthDelayCalc
Definition board.h:1835
void RemoveUnusedNets(BOARD_COMMIT *aCommit)
Definition board.h:1103
const FOOTPRINTS & Footprints() const
Definition board.h:421
std::shared_ptr< CONNECTIVITY_DATA > m_connectivity
Definition board.h:1790
std::set< KIFONT::OUTLINE_FONT * > GetFonts() const override
Get the list of all outline fonts used in the board.
Definition board.cpp:3593
void RemoveAll(std::initializer_list< KICAD_T > aTypes={ PCB_NETINFO_T, PCB_MARKER_T, PCB_GROUP_T, PCB_ZONE_T, PCB_GENERATOR_T, PCB_FOOTPRINT_T, PCB_TRACE_T, PCB_SHAPE_T })
An efficient way to remove all items of a certain type from the board.
Definition board.cpp:1601
const BOARD_ITEM_SET GetItemSet()
Collect every owned item (tracks, zones, generators, footprints, drawings, markers,...
Definition board.cpp:4056
const TRACKS & Tracks() const
Definition board.h:419
int m_DRCMaxPhysicalClearance
Definition board.h:1728
const PCB_BOARD_OUTLINE * BoardOutline() const
Definition board.h:437
FOOTPRINT * FindFootprintByPath(const KIID_PATH &aPath) const
Search for a FOOTPRINT within this board with the given path.
Definition board.cpp:2871
void FinalizeBulkRemove(std::vector< BOARD_ITEM * > &aRemovedItems)
Must be used if Remove() is used using a BULK_x REMOVE_MODE to generate a change event for listeners.
Definition board.cpp:1480
void SetPageSettings(const PAGE_INFO &aPageSettings)
Definition board.h:902
std::unordered_map< wxString, LSET > m_LayerExpressionCache
Definition board.h:1704
BOARD_ITEM * GetCachedItemById(const KIID &aId) const
Return a cached item for aId if the entry is still self-consistent.
Definition board.cpp:2060
bool m_embedFonts
Definition board.h:1828
wxString GroupsSanityCheckInternal(bool repair)
Definition board.cpp:3813
std::shared_ptr< const FOOTPRINT_COURTYARD_INDEX > m_footprintCourtyardIndex
Definition board.h:1721
void OnRatsnestChanged()
Notify the board and its listeners that the ratsnest has been recomputed.
Definition board.cpp:3751
wxString ConvertCrossReferencesToKIIDs(const wxString &aSource) const
Convert cross-references back and forth between ${refDes:field} and ${kiid:field}.
Definition board.cpp:2340
wxString GetClass() const override
Return the class name.
Definition board.h:1278
std::unique_ptr< COMPONENT_CLASS_MANAGER > m_componentClassManager
Definition board.h:1834
SHARDED_CACHE< PTR_PTR_CACHE_KEY, bool > m_IntersectsFCourtyardCache
Definition board.h:1694
const CONSTRAINTS & Constraints() const
Geometric constraints (#2329) owned by this board.
Definition board.h:465
NETINFO_LIST::iterator BeginNets() const
Definition board.h:1111
bool GetBoardPolygonOutlines(SHAPE_POLY_SET &aOutlines, bool aInferOutlineIfNecessary, OUTLINE_ERROR_HANDLER *aErrorHandler=nullptr, bool aAllowUseArcsInPolygons=false, bool aIncludeNPTHAsOutlines=false)
Extract the board outlines and build a closed polygon from lines, arcs and circle items on edge cut l...
Definition board.cpp:3534
bool m_LegacyNetclassesLoaded
True if netclasses were loaded from the file.
Definition board.h:509
void SetCopperLayerCount(int aCount)
Definition board.cpp:1000
std::unordered_map< const ZONE *, BOX2I > m_ZoneBBoxCache
Definition board.h:1707
std::unordered_map< const ZONE *, SHAPE_POLY_SET > m_DeflatedZoneOutlineCache
Definition board.h:1718
wxString m_generator
Definition board.h:1787
SHARDED_CACHE< ITEM_SELECTOR_LAYER_CACHE_KEY, bool > m_IntersectsFCourtyardResultCache
Definition board.h:1699
TRACKS TracksInNet(int aNetCode)
Collect all the TRACKs and VIAs that are members of a net given by aNetCode.
Definition board.cpp:752
void SetProject(PROJECT *aProject, bool aReferenceOnly=false)
Link a board to a given project.
Definition board.cpp:212
PROJECT * m_project
Definition board.h:1798
FOOTPRINT * GetFootprint(const VECTOR2I &aPosition, PCB_LAYER_ID aActiveLayer, bool aVisibleOnly, bool aIgnoreLocked=false) const
Get a footprint by its bounding rectangle at aPosition on aLayer.
Definition board.cpp:3425
bool HasItemsOnLayer(PCB_LAYER_ID aLayer)
Definition board.cpp:1698
const wxString & GetFileName() const
Definition board.h:410
bool operator==(const BOARD_ITEM &aOther) const override
Definition board.cpp:4083
std::vector< PCB_MARKER * > ResolveDRCExclusions(bool aCreateMarkers)
Rebuild DRC markers from the serialized data in BOARD_DESIGN_SETTINGS.
Definition board.cpp:454
int GetPadWithCastellatedAttrCount()
Definition board.cpp:4180
wxString GetVariantDescription(const wxString &aVariantName) const
Definition board.cpp:3068
FOOTPRINT * FindFootprintByReference(const wxString &aReference) const
Search for a FOOTPRINT within this board with the given reference designator.
Definition board.cpp:2859
unsigned GetNodesCount(int aNet=-1) const
Definition board.cpp:2493
bool IsHighLightNetON() const
Definition board.h:738
void FillItemMap(std::map< KIID, EDA_ITEM * > &aMap)
Definition board.cpp:2295
SHARDED_CACHE< ITEM_FIELD_CACHE_KEY, wxString > m_ItemFieldCache
Definition board.h:1703
int GetFileFormatVersionAtLoad() const
Definition board.h:525
std::map< PCB_LAYER_ID, std::vector< ZONE * > > m_DRCCopperZonesByLayer
Definition board.h:1726
void SetElementVisibility(GAL_LAYER_ID aLayer, bool aNewState)
Change the visibility of an element category.
Definition board.cpp:1115
std::shared_ptr< DRC_RTREE > m_CopperItemRTreeCache
Definition board.h:1706
bool SetLayerType(PCB_LAYER_ID aLayer, LAYER_T aLayerType)
Change the type of the layer given by aLayer.
Definition board.cpp:877
const PCB_PLOT_PARAMS & GetPlotOptions() const
Definition board.h:904
BOARD & operator=(const BOARD &aOther)=delete
wxString m_fileName
Definition board.h:1759
const wxString & GetGenerator() const
Adds an item to the container.
Definition board.h:528
int GetAreaCount() const
Definition board.h:1325
void DetachAllFootprints()
Remove all footprints without deleting.
Definition board.cpp:1901
void SetLegacyTeardrops(bool aFlag)
Definition board.h:1518
std::map< int, LAYER > m_layers
Definition board.h:1781
wxString GetCurrentVariant() const
Definition board.h:473
void RunOnChildren(const std::function< void(BOARD_ITEM *)> &aFunction, RECURSE_MODE aMode) const override
Invoke a function on all children.
Definition board.cpp:707
int GetOutlinesChainingEpsilon()
Definition board.h:953
void GetSortedPadListByXthenYCoord(std::vector< PAD * > &aVector, int aNetCode=-1) const
First empties then fills the vector with all pads and sorts them by increasing x coordinate,...
Definition board.cpp:3374
bool IsLayerVisible(PCB_LAYER_ID aLayer) const
A proxy function that calls the correspondent function in m_BoardSettings tests whether a given layer...
Definition board.cpp:1049
SHARDED_CACHE< ITEM_SELECTOR_LAYER_CACHE_KEY, bool > m_IntersectsAreaResultCache
Definition board.h:1701
int m_DRCMaxClearance
Definition board.h:1727
void ClearProject()
Definition board.cpp:253
void ReplaceNetChainTerminalPad(const wxString &aNetChain, const KIID &aPrev, const KIID &aNew)
Definition board.cpp:2895
void UncacheItemByPtr(const BOARD_ITEM *aItem)
Remove every cache entry that still points to aItem.
Definition board.cpp:2161
void SetLayerSet(const LSET &aLayerMask) override
Definition board.h:790
std::unordered_map< ZONE *, std::unique_ptr< DRC_RTREE > > m_CopperZoneRTreeCache
Definition board.h:1705
void FinalizeBulkAdd(std::vector< BOARD_ITEM * > &aNewItems)
Must be used if Add() is used using a BULK_x ADD_MODE to generate a change event for listeners.
Definition board.cpp:1474
wxString m_currentVariant
Definition board.h:1802
int LayerDepth(PCB_LAYER_ID aStartLayer, PCB_LAYER_ID aEndLayer) const
Definition board.cpp:1031
void DeleteAllFootprints()
Remove all footprints from the deque and free the memory associated with them.
Definition board.cpp:1889
PROJECT * GetProject() const
Definition board.h:662
bool IsEmpty() const
Definition board.cpp:668
int GetPadWithPressFitAttrCount()
Definition board.cpp:4162
bool LegacyTeardrops() const
Definition board.h:1517
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
Definition board.cpp:2579
const TITLE_BLOCK & GetTitleBlock() const
Definition board.h:908
KIGFX::COLOR4D GetNetChainColor(const wxString &aChain) const
Definition board.h:1218
wxString GetDesignRulesPath() const
Return the absolute path to the design rules file for this board.
Definition board.cpp:273
wxString GroupsSanityCheck(bool repair=false)
Consistency check of internal m_groups structure.
Definition board.cpp:3799
void RenameVariant(const wxString &aOldName, const wxString &aNewName)
Definition board.cpp:3020
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition board.cpp:1158
std::vector< ZONE * > m_DRCZones
Definition board.h:1724
const LSET & GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
Definition board.cpp:1043
void SetGenerator(const wxString &aGenerator)
Definition board.h:527
BOARD()
Definition board.cpp:91
void UpdateRatsnestExclusions()
Update the visibility flags on the current unconnected ratsnest lines.
Definition board.cpp:361
wxString ConvertKIIDsToCrossReferences(const wxString &aSource) const
Definition board.cpp:2420
void RebindItemUuid(BOARD_ITEM *aItem, const KIID &aNewId)
Rebind the UUID of an attached item and keep the item-by-id cache coherent.
Definition board.cpp:2196
int RepairDuplicateItemUuids()
Rebind duplicate attached-item UUIDs so each live board item has a unique ID.
Definition board.cpp:2222
void SynchronizeProperties()
Copy the current project's text variables into the boards property cache.
Definition board.cpp:2929
std::unordered_map< KIID, BOARD_ITEM * > m_itemByIdCache
Definition board.h:1778
void RemoveListener(BOARD_LISTENER *aListener)
Remove the specified listener.
Definition board.cpp:3714
COMPONENT_CLASS_MANAGER & GetComponentClassManager()
Gets the component class manager.
Definition board.h:1543
std::shared_mutex m_CachesMutex
Definition board.h:1690
BOX2I ComputeBoundingBox(bool aBoardEdgesOnly=false, bool aPhysicalLayersOnly=false) const
Calculate the bounding box containing all board items (or board edge segments).
Definition board.cpp:2510
std::shared_ptr< const FOOTPRINT_COURTYARD_INDEX > GetFootprintCourtyardIndex()
Return a spatial index of footprint courtyards, building it on first use.
Definition board.cpp:337
unsigned GetNetCount() const
Definition board.h:1127
std::atomic< int > m_timeStamp
Definition board.h:1757
const std::unordered_map< KIID, BOARD_ITEM * > & GetItemByIdCache() const
Definition board.h:1564
bool SynchronizeComponentClasses(const std::unordered_set< wxString > &aNewSheetPaths) const
Copy component class / component class generator information from the project settings.
Definition board.cpp:3196
BOARD_ITEM * CacheAndReturnItemById(const KIID &aId, BOARD_ITEM *aItem) const
Definition board.cpp:2128
void DeleteMARKERs()
Delete all MARKERS from the board.
Definition board.cpp:1852
void Remove(BOARD_ITEM *aBoardItem, REMOVE_MODE aMode=REMOVE_MODE::NORMAL) override
Removes an item from the container.
Definition board.cpp:1503
std::unordered_map< wxString, std::vector< ZONE * > > m_ZonesByNameCache
Definition board.h:1714
GROUPS m_groups
Definition board.h:1768
PROJECT::ELEM ProjectElementType() override
Definition board.h:1545
MARKERS m_markers
Definition board.h:1764
bool IsItemIndexedById(const BOARD_ITEM *aItem) const
Definition board.h:1569
std::optional< int > m_maxClearanceValue
Definition board.h:1708
void HighLightON(bool aValue=true)
Enable or disable net highlighting.
Definition board.cpp:3789
void SetEnabledLayers(const LSET &aLayerMask)
A proxy function that calls the correspondent function in m_BoardSettings.
Definition board.cpp:1063
void SetTitleBlock(const TITLE_BLOCK &aTitleBlock)
Definition board.h:909
void CacheChildrenById(const BOARD_ITEM *aParent)
Definition board.h:1613
void SynchronizeTuningProfileProperties()
Ensure that all time domain properties providers are in sync with current settings.
Definition board.cpp:3118
bool TestZoneIntersection(ZONE *aZone1, ZONE *aZone2)
Test for intersection of 2 copper areas.
TRACKS m_tracks
Definition board.h:1767
std::map< wxString, KIGFX::COLOR4D > m_netChainColors
Definition board.h:1761
BOARD_ITEM * ResolveItem(const KIID &aID, bool aAllowNullptrReturn=false) const
Definition board.cpp:1928
bool m_LegacyCopperEdgeClearanceLoaded
Definition board.h:506
int GetTimeStamp() const
Definition board.h:396
void OnItemsChanged(std::vector< BOARD_ITEM * > &aItems)
Notify the board and its listeners that an item on the board has been modified in some way.
Definition board.cpp:3738
SHARDED_CACHE< ITEM_SELECTOR_LAYER_CACHE_KEY, bool > m_IntersectsBCourtyardResultCache
Definition board.h:1700
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
Definition board.h:646
VECTOR2I GetPosition() const override
Definition board.cpp:674
void SetVariantDescription(const wxString &aVariantName, const wxString &aDescription)
Definition board.cpp:3087
void CacheTriangulation(PROGRESS_REPORTER *aReporter=nullptr, const std::vector< ZONE * > &aZones={})
Definition board.cpp:1216
static bool ClassOf(const EDA_ITEM *aItem)
Definition board.h:375
void SetUserUnits(EDA_UNITS aUnits)
Definition board.h:914
void SetVisibleElements(const GAL_SET &aMask)
A proxy function that calls the correspondent function in m_BoardSettings.
Definition board.cpp:1082
void EmbedFonts() override
Finds all fonts used in the board and embeds them in the file if permissions allow.
Definition board.cpp:3620
double Similarity(const BOARD_ITEM &aOther) const override
Return the Similarity.
Definition board.h:1271
PCB_BOARD_OUTLINE * m_boardOutline
Definition board.h:1772
void SetUserDefinedLayerCount(int aCount)
Definition board.cpp:1013
const DRAWINGS & Drawings() const
Definition board.h:423
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
Definition board.cpp:1824
void UncacheItemSubtreeById(const BOARD_ITEM *aItem)
Definition board.h:1625
void SetFileFormatVersionAtLoad(int aVersion)
Definition board.h:524
constexpr const Vec GetCenter() const
Definition box2.h:226
A class to manage Component Classes in a board context.
Store all of the related component information found in a netlist.
Implement an R-tree for fast spatial and layer indexing of connectable items.
Definition drc_rtree.h:45
The base class for create windows for drawing purpose.
KICAD_T Type() const
Returns the type of object.
Definition eda_item.h:108
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType, bool isSCH_ITEM=false, bool isBOARD_ITEM=false)
Definition eda_item.cpp:37
EMBEDDED_FILES()=default
Spatial index over footprint courtyard bounding boxes.
Helper for storing and iterating over GAL_LAYER_IDs.
Definition layer_ids.h:409
void Clear()
Definition board.h:312
friend class BOARD
Definition board.h:324
std::set< int > m_netCodes
Definition board.h:309
bool m_highLightOn
Definition board.h:310
Class OUTLINE_FONT implements outline font drawing.
A color representation with 4 components: red, green, blue, alpha.
Definition color4d.h:101
static const COLOR4D UNSPECIFIED
For legacy support; used as a value to indicate color hasn't been set yet.
Definition color4d.h:398
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition view.h:63
Definition kiid.h:46
Class which calculates lengths (and associated routing statistics) in a BOARD context.
LSET is a set of PCB_LAYER_IDs.
Definition lset.h:37
EDA_MSG_PANEL items for displaying messages.
Definition msgpanel.h:50
Handle the data for a net.
Definition netinfo.h:46
Wrapper class, so you can iterate through NETINFO_ITEM*s, not std::pair<int/wxString,...
Definition netinfo.h:281
Container for NETINFO_ITEM elements, which are the nets.
Definition netinfo.h:221
Store information read from a netlist along with the flags used to update the NETLIST in the BOARD.
Definition pad.h:61
Describe the page size and margins of a paper page on which to eventually print or plot.
Definition page_info.h:75
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
The main frame for Pcbnew.
A set of BOARD_ITEMs (i.e., without duplicates).
Definition pcb_group.h:51
Parameters and options when plotting/printing a board.
A holder to handle information on schematic or board items.
A progress reporter interface for use in multi-threaded environments.
A PROJECT can hold stuff it knows nothing about, in the form of _ELEM derivatives.
Definition project.h:90
Container for project specific data.
Definition project.h:63
ELEM
The set of #_ELEMs that a PROJECT can hold.
Definition project.h:69
A pure virtual class used to derive REPORTER objects from.
Definition reporter.h:72
Represent a set of closed polygons.
A concurrent key/value cache split into independently locked shards.
Hold the information shown in the lower right corner of a plot, printout, or editing view.
Definition title_block.h:37
Handle a list of polygons defining a copper zone.
Definition zone.h:70
const std::function< void(const wxString &msg, BOARD_ITEM *itemA, BOARD_ITEM *itemB, const VECTOR2I &pt)> OUTLINE_ERROR_HANDLER
#define LAYER(n, l)
RECURSE_MODE
Definition eda_item.h:48
@ NO_RECURSE
Definition eda_item.h:50
INSPECT_RESULT
Definition eda_item.h:42
const INSPECTOR_FUNC & INSPECTOR
std::function passed to nested users by ref, avoids copying std::function.
Definition eda_item.h:89
EDA_UNITS
Definition eda_units.h:44
static constexpr void hash_combine(std::size_t &seed)
This is a dummy function to take the final case of hash_combine below.
Definition hash.h:28
NORMAL
Follows standard pretty-printing rules.
wxString LayerName(int aLayer)
Returns the default display name for a given layer.
Definition layer_id.cpp:31
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
Definition layer_ids.h:224
PCB_LAYER_ID
A quick note on layer IDs:
Definition layer_ids.h:56
The Cairo implementation of the graphics abstraction layer.
Definition eda_group.h:29
STL namespace.
std::vector< ZONE * > ZONES
std::vector< PCB_MARKER * > MARKERS
std::deque< FOOTPRINT * > FOOTPRINTS
std::deque< PCB_TRACK * > TRACKS
std::deque< PCB_GROUP * > GROUPS
std::deque< PCB_CONSTRAINT * > CONSTRAINTS
std::deque< PCB_GENERATOR * > GENERATORS
std::deque< BOARD_ITEM * > DRAWINGS
std::deque< PCB_POINT * > PCB_POINTS
ENDPOINT_T
bool operator()(const BOARD_ITEM *aFirst, const BOARD_ITEM *aSecond) const
Definition board.cpp:3903
bool operator()(const BOARD_ITEM *aFirst, const BOARD_ITEM *aSecond) const
Definition board.cpp:3882
Data produced by a registered saver on the UI thread, consumed by either the background local-history...
A struct recording the isolated and single-pad islands within a zone.
Definition zone.h:57
std::size_t FieldHash
Definition board.h:148
bool operator==(const ITEM_FIELD_CACHE_KEY &other) const
Definition board.h:150
const BOARD_ITEM * A
Definition board.h:147
bool operator==(const ITEM_SELECTOR_LAYER_CACHE_KEY &other) const
Definition board.h:137
const BOARD_ITEM * A
Definition board.h:132
LAYERS_CHECKED(PCB_LAYER_ID aLayer)
Definition board.h:163
bool has_error
Definition board.h:169
LSET layers
Definition board.h:168
int m_opposite
Similar layer on opposite side of the board, if any.
Definition board.h:284
static LAYER_T ParseType(const char *aType)
Convert a string to a LAYER_T.
Definition board.cpp:906
void clear()
Definition board.h:258
LAYER_T m_type
The type of the layer.
Definition board.h:281
static const char * ShowType(LAYER_T aType)
Convert a LAYER_T enum to a string representation of the layer type.
Definition board.cpp:890
LAYER()
Definition board.h:253
wxString m_name
The canonical name of the layer.
Definition board.h:279
wxString m_userName
The user defined name of the layer.
Definition board.h:280
bool m_visible
Definition board.h:282
int m_number
The layer ID.
Definition board.h:283
BOARD_ITEM * A
Definition board.h:107
bool operator==(const PTR_LAYER_CACHE_KEY &other) const
Definition board.h:110
PCB_LAYER_ID Layer
Definition board.h:108
BOARD_ITEM * A
Definition board.h:96
BOARD_ITEM * B
Definition board.h:97
bool operator==(const PTR_PTR_CACHE_KEY &other) const
Definition board.h:99
bool operator==(const PTR_PTR_LAYER_CACHE_KEY &other) const
Definition board.h:122
BOARD_ITEM * B
Definition board.h:119
BOARD_ITEM * A
Definition board.h:118
PCB_LAYER_ID Layer
Definition board.h:120
std::size_t operator()(const ITEM_FIELD_CACHE_KEY &k) const
Definition board.h:222
std::size_t operator()(const ITEM_SELECTOR_LAYER_CACHE_KEY &k) const
Definition board.h:211
std::size_t operator()(const PTR_LAYER_CACHE_KEY &k) const
Definition board.h:189
std::size_t operator()(const PTR_PTR_CACHE_KEY &k) const
Definition board.h:178
std::size_t operator()(const PTR_PTR_LAYER_CACHE_KEY &k) const
Definition board.h:200
netlist clear()
@ PCB_T
Definition typeinfo.h:75
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
Definition typeinfo.h:81
@ PCB_GENERATOR_T
class PCB_GENERATOR, generator on a layer
Definition typeinfo.h:84
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs
Definition typeinfo.h:104
@ PCB_ZONE_T
class ZONE, a copper pour area
Definition typeinfo.h:101
@ PCB_MARKER_T
class PCB_MARKER, a marker used to show something
Definition typeinfo.h:92
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
Definition typeinfo.h:79
@ PCB_NETINFO_T
class NETINFO_ITEM, a description of a net
Definition typeinfo.h:103
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
Definition typeinfo.h:89
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:683
Class ZONE_SETTINGS used to handle zones parameters in dialogs.
ZONE_BORDER_DISPLAY_STYLE
Zone border styles.