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 (C) 1992-2023 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, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25#ifndef CLASS_BOARD_H_
26#define CLASS_BOARD_H_
27
31#include <embedded_files.h>
32#include <common.h> // Needed for stl hash extensions
33#include <convert_shape_list_to_polygon.h> // for OUTLINE_ERROR_HANDLER
34#include <hash.h>
35#include <layer_ids.h>
36#include <lset.h>
37#include <netinfo.h>
38#include <pcb_item_containers.h>
39#include <pcb_plot_params.h>
40#include <title_block.h>
41#include <tools/pcb_selection.h>
42#include <shared_mutex>
43#include <list>
44
47class BOARD_COMMIT;
48class DRC_RTREE;
49class PCB_BASE_FRAME;
50class PCB_EDIT_FRAME;
52class BOARD;
53class FOOTPRINT;
54class ZONE;
55class PCB_TRACK;
56class PAD;
57class PCB_GROUP;
58class PCB_GENERATOR;
59class PCB_MARKER;
60class MSG_PANEL_ITEM;
61class NETLIST;
62class REPORTER;
63class SHAPE_POLY_SET;
65class COMPONENT;
66class PROJECT;
68struct ISOLATED_ISLANDS;
69
70// The default value for m_outlinesChainingEpsilon to convert a board outlines to polygons
71// It is the max dist between 2 end points to see them connected
72#define DEFAULT_CHAINING_EPSILON_MM 0.01
73
74// Forward declare endpoint from class_track.h
75enum ENDPOINT_T : int;
76
77
79{
82
83 bool operator==(const PTR_PTR_CACHE_KEY& other) const
84 {
85 return A == other.A && B == other.B;
86 }
87};
88
90{
93
94 bool operator==(const PTR_LAYER_CACHE_KEY& other) const
95 {
96 return A == other.A && Layer == other.Layer;
97 }
98};
99
101{
105
106 bool operator==(const PTR_PTR_LAYER_CACHE_KEY& other) const
107 {
108 return A == other.A && B == other.B && Layer == other.Layer;
109 }
110};
111
112namespace std
113{
114 template <>
115 struct hash<PTR_PTR_CACHE_KEY>
116 {
117 std::size_t operator()( const PTR_PTR_CACHE_KEY& k ) const
118 {
119 std::size_t seed = 0xa82de1c0;
120 hash_combine( seed, k.A, k.B );
121 return seed;
122 }
123 };
124
125 template <>
127 {
128 std::size_t operator()( const PTR_LAYER_CACHE_KEY& k ) const
129 {
130 std::size_t seed = 0xa82de1c0;
131 hash_combine( seed, k.A, k.Layer );
132 return seed;
133 }
134 };
135
136 template <>
138 {
139 std::size_t operator()( const PTR_PTR_LAYER_CACHE_KEY& k ) const
140 {
141 std::size_t seed = 0xa82de1c0;
142 hash_combine( seed, k.A, k.B, k.Layer );
143 return seed;
144 }
145 };
146}
147
148
153{
161 LT_BACK
163
164
168struct LAYER
169{
171 {
172 clear();
173 }
174
175 void clear()
176 {
178 m_visible = true;
179 m_number = 0;
180 m_name.clear();
181 m_userName.clear();
183 }
184
185 /*
186 LAYER( const wxString& aName = wxEmptyString,
187 LAYER_T aType = LT_SIGNAL, bool aVisible = true, int aNumber = -1 ) :
188 m_name( aName ),
189 m_type( aType ),
190 m_visible( aVisible ),
191 m_number( aNumber )
192 {
193 }
194 */
195
196 wxString m_name;
197 wxString m_userName;
202
209 static const char* ShowType( LAYER_T aType );
210
218 static LAYER_T ParseType( const char* aType );
219};
220
221
222// Helper class to handle high light nets
224{
225protected:
226 std::set<int> m_netCodes; // net(s) selected for highlight (-1 when no net selected )
227 bool m_highLightOn; // highlight active
228
229 void Clear()
230 {
231 m_netCodes.clear();
232 m_highLightOn = false;
233 }
234
236 {
237 Clear();
238 }
239
240private:
241 friend class BOARD;
242};
243
249class BOARD;
250
252{
253public:
254 virtual ~BOARD_LISTENER() { }
255 virtual void OnBoardItemAdded( BOARD& aBoard, BOARD_ITEM* aBoardItem ) { }
256 virtual void OnBoardItemsAdded( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItem ) { }
257 virtual void OnBoardItemRemoved( BOARD& aBoard, BOARD_ITEM* aBoardItem ) { }
258 virtual void OnBoardItemsRemoved( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItem ) { }
259 virtual void OnBoardNetSettingsChanged( BOARD& aBoard ) { }
260 virtual void OnBoardItemChanged( BOARD& aBoard, BOARD_ITEM* aBoardItem ) { }
261 virtual void OnBoardItemsChanged( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItem ) { }
262 virtual void OnBoardHighlightNetChanged( BOARD& aBoard ) { }
263 virtual void OnBoardRatsnestChanged( BOARD& aBoard ) { }
264 virtual void OnBoardCompositeUpdate( BOARD& aBoard, std::vector<BOARD_ITEM*>& aAddedItems,
265 std::vector<BOARD_ITEM*>& aRemovedItems,
266 std::vector<BOARD_ITEM*>& aDeletedItems )
267 {
268 }
269};
270
274typedef std::set<BOARD_ITEM*, CompareByUuid> BOARD_ITEM_SET;
275
279enum class BOARD_USE
280{
281 NORMAL, // A normal board
282 FPHOLDER // A board that holds a single footprint
283};
284
285
290{
291public:
292 static inline bool ClassOf( const EDA_ITEM* aItem )
293 {
294 return aItem && PCB_T == aItem->Type();
295 }
296
302 void SetBoardUse( BOARD_USE aUse ) { m_boardUse = aUse; }
303
309 BOARD_USE GetBoardUse() const { return m_boardUse; }
310
311 void IncrementTimeStamp();
312
313 int GetTimeStamp() const { return m_timeStamp; }
314
320 bool IsFootprintHolder() const
321 {
322 return m_boardUse == BOARD_USE::FPHOLDER;
323 }
324
325 void SetFileName( const wxString& aFileName ) { m_fileName = aFileName; }
326
327 const wxString &GetFileName() const { return m_fileName; }
328
329 const TRACKS& Tracks() const { return m_tracks; }
330
331 const FOOTPRINTS& Footprints() const { return m_footprints; }
332
333 const DRAWINGS& Drawings() const { return m_drawings; }
334
335 const ZONES& Zones() const { return m_zones; }
336
337 const GENERATORS& Generators() const { return m_generators; }
338
339 const MARKERS& Markers() const { return m_markers; }
340
341 // SWIG requires non-const accessors for some reason to make the custom iterators in board.i
342 // work. It would be good to remove this if we can figure out how to fix that.
343#ifdef SWIG
344 DRAWINGS& Drawings() { return m_drawings; }
345 TRACKS& Tracks() { return m_tracks; }
346#endif
347
349
358 const GROUPS& Groups() const { return m_groups; }
359
360 const std::vector<BOARD_CONNECTED_ITEM*> AllConnectedItems();
361
362 const std::map<wxString, wxString>& GetProperties() const { return m_properties; }
363 void SetProperties( const std::map<wxString, wxString>& aProps ) { m_properties = aProps; }
364
365 void GetContextualTextVars( wxArrayString* aVars ) const;
366 bool ResolveTextVar( wxString* token, int aDepth ) const;
367
371
375
378
379 BOARD();
380 ~BOARD();
381
382 VECTOR2I GetPosition() const override;
383 void SetPosition( const VECTOR2I& aPos ) override;
384 const VECTOR2I GetFocusPosition() const override { return GetBoundingBox().GetCenter(); }
385
386 bool IsEmpty() const
387 {
388 return m_drawings.empty() && m_footprints.empty() && m_tracks.empty() && m_zones.empty();
389 }
390
391 void Move( const VECTOR2I& aMoveVector ) override;
392
393 void SetFileFormatVersionAtLoad( int aVersion ) { m_fileFormatVersionAtLoad = aVersion; }
395
396 void SetGenerator( const wxString& aGenerator ) { m_generator = aGenerator; }
397 const wxString& GetGenerator() const { return m_generator; }
398
400 void Add( BOARD_ITEM* aItem, ADD_MODE aMode = ADD_MODE::INSERT,
401 bool aSkipConnectivity = false ) override;
402
404 void Remove( BOARD_ITEM* aBoardItem, REMOVE_MODE aMode = REMOVE_MODE::NORMAL ) override;
405
414 void RemoveAll( std::initializer_list<KICAD_T> aTypes = { PCB_NETINFO_T, PCB_MARKER_T,
418
423 void FinalizeBulkAdd( std::vector<BOARD_ITEM*>& aNewItems );
424
429 void FinalizeBulkRemove( std::vector<BOARD_ITEM*>& aRemovedItems );
430
436 void FixupEmbeddedData();
437
438 void CacheTriangulation( PROGRESS_REPORTER* aReporter = nullptr,
439 const std::vector<ZONE*>& aZones = {} );
440
449 {
450 return m_footprints.empty() ? nullptr : m_footprints.front();
451 }
452
456 void DeleteAllFootprints();
457
461 BOARD_ITEM* GetItem( const KIID& aID ) const;
462
463 void FillItemMap( std::map<KIID, EDA_ITEM*>& aMap );
464
468 wxString ConvertCrossReferencesToKIIDs( const wxString& aSource ) const;
469 wxString ConvertKIIDsToCrossReferences( const wxString& aSource ) const;
470
475 std::shared_ptr<CONNECTIVITY_DATA> GetConnectivity() const { return m_connectivity; }
476
482 bool BuildConnectivity( PROGRESS_REPORTER* aReporter = nullptr );
483
487 void DeleteMARKERs();
488
489 void DeleteMARKERs( bool aWarningsAndErrors, bool aExclusions );
490
491 PROJECT* GetProject() const { return m_project; }
492
501 void SetProject( PROJECT* aProject, bool aReferenceOnly = false );
502
503 void ClearProject();
504
512 std::vector<PCB_MARKER*> ResolveDRCExclusions( bool aCreateMarkers );
513
517 void RecordDRCExclusions();
518
523
527 void ResetNetHighLight();
528
532 const std::set<int>& GetHighLightNetCodes() const
533 {
534 return m_highLight.m_netCodes;
535 }
536
543 void SetHighLightNet( int aNetCode, bool aMulti = false );
544
549
557 void HighLightON( bool aValue = true );
558
563 {
564 HighLightON( false );
565 }
566
570 int GetCopperLayerCount() const;
571 void SetCopperLayerCount( int aCount );
572
578
579 PCB_LAYER_ID FlipLayer( PCB_LAYER_ID aLayer ) const;
580
581 int LayerDepth( PCB_LAYER_ID aStartLayer, PCB_LAYER_ID aEndLayer ) const;
582
588 LSET GetEnabledLayers() const;
589
595 void SetEnabledLayers( LSET aLayerMask );
596
603 bool IsLayerEnabled( PCB_LAYER_ID aLayer ) const;
604
612 bool IsLayerVisible( PCB_LAYER_ID aLayer ) const;
613
619 LSET GetVisibleLayers() const;
620
627 void SetVisibleLayers( LSET aLayerMask );
628
629 // these 2 functions are not tidy at this time, since there are PCB_LAYER_IDs that
630 // are not stored in the bitmap.
631
639
646 void SetVisibleElements( const GAL_SET& aMask );
647
653 void SetVisibleAlls();
654
662 bool IsElementVisible( GAL_LAYER_ID aLayer ) const;
663
671 void SetElementVisibility( GAL_LAYER_ID aLayer, bool aNewState );
672
680 bool IsFootprintLayerVisible( PCB_LAYER_ID aLayer ) const;
681
686
688
689 const PAGE_INFO& GetPageSettings() const { return m_paper; }
690 void SetPageSettings( const PAGE_INFO& aPageSettings ) { m_paper = aPageSettings; }
691
693 void SetPlotOptions( const PCB_PLOT_PARAMS& aOptions ) { m_plotOptions = aOptions; }
694
696 const TITLE_BLOCK& GetTitleBlock() const { return m_titles; }
697 void SetTitleBlock( const TITLE_BLOCK& aTitleBlock ) { m_titles = aTitleBlock; }
698
699 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
700
702 void SetUserUnits( EDA_UNITS aUnits ) { m_userUnits = aUnits; }
703
708 void UpdateUserUnits( BOARD_ITEM* aItem, KIGFX::VIEW* aView );
709
728 OUTLINE_ERROR_HANDLER* aErrorHandler = nullptr,
729 bool aAllowUseArcsInPolygons = false,
730 bool aIncludeNPTHAsOutlines = false );
731
741
752 void ConvertBrdLayerToPolygonalContours( PCB_LAYER_ID aLayer, SHAPE_POLY_SET& aOutlines ) const;
753
757 PCB_LAYER_ID GetLayerID( const wxString& aLayerName ) const;
758
765 const wxString GetLayerName( PCB_LAYER_ID aLayer ) const;
766
774 bool SetLayerName( PCB_LAYER_ID aLayer, const wxString& aLayerName );
775
786 static wxString GetStandardLayerName( PCB_LAYER_ID aLayerId )
787 {
788 // a BOARD's standard layer name is the PCB_LAYER_ID fixed name
789 return LayerName( aLayerId );
790 }
791
799 bool SetLayerDescr( PCB_LAYER_ID aIndex, const LAYER& aLayer );
800
807 LAYER_T GetLayerType( PCB_LAYER_ID aLayer ) const;
808
816 bool SetLayerType( PCB_LAYER_ID aLayer, LAYER_T aLayerType );
817
822 unsigned GetNodesCount( int aNet = -1 ) const;
823
832 const std::vector<PAD*> GetPads() const;
833
835 {
837 }
838
845 NETINFO_ITEM* FindNet( int aNetcode ) const;
846
853 NETINFO_ITEM* FindNet( const wxString& aNetname ) const;
854
864 int MatchDpSuffix( const wxString& aNetName, wxString& aComplementNet );
865
869 NETINFO_ITEM* DpCoupledNet( const NETINFO_ITEM* aNet );
870
872 {
873 return m_NetInfo;
874 }
875
877 {
878 m_NetInfo.RemoveUnusedNets( aCommit );
879 }
880
881#ifndef SWIG
886 {
887 return m_NetInfo.begin();
888 }
889
894 {
895 return m_NetInfo.end();
896 }
897#endif
898
902 unsigned GetNetCount() const
903 {
904 return m_NetInfo.GetNetCount();
905 }
906
913 BOX2I ComputeBoundingBox( bool aBoardEdgesOnly = false ) const;
914
915 const BOX2I GetBoundingBox() const override
916 {
917 return ComputeBoundingBox( false );
918 }
919
930 {
931 return ComputeBoundingBox( true );
932 }
933
934 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
935
947 INSPECT_RESULT Visit( INSPECTOR inspector, void* testData,
948 const std::vector<KICAD_T>& scanTypes ) override;
949
958 FOOTPRINT* FindFootprintByReference( const wxString& aReference ) const;
959
966 FOOTPRINT* FindFootprintByPath( const KIID_PATH& aPath ) const;
967
971 std::set<wxString> GetNetClassAssignmentCandidates() const;
972
980 void SynchronizeNetsAndNetClasses( bool aResetTrackAndViaSizes );
981
986
990 double Similarity( const BOARD_ITEM& aOther ) const override
991 {
992 return 1.0;
993 }
994
995 bool operator==( const BOARD_ITEM& aOther ) const override;
996
997 wxString GetClass() const override
998 {
999 return wxT( "BOARD" );
1000 }
1001
1002#if defined(DEBUG)
1003 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
1004#endif
1005
1006
1007 /*************************/
1008 /* Copper Areas handling */
1009 /*************************/
1010
1021
1028 ZONE* GetArea( int index ) const
1029 {
1030 if( (unsigned) index < m_zones.size() )
1031 return m_zones[index];
1032
1033 return nullptr;
1034 }
1035
1039 std::list<ZONE*> GetZoneList( bool aIncludeZonesInFootprints = false ) const;
1040
1044 int GetAreaCount() const
1045 {
1046 return static_cast<int>( m_zones.size() );
1047 }
1048
1049 /* Functions used in test, merge and cut outlines */
1050
1063 ZONE* AddArea( PICKED_ITEMS_LIST* aNewZonesList, int aNetcode, PCB_LAYER_ID aLayer,
1064 VECTOR2I aStartPointPosition, ZONE_BORDER_DISPLAY_STYLE aHatch );
1065
1073 bool TestZoneIntersection( ZONE* aZone1, ZONE* aZone2 );
1074
1082 PAD* GetPad( const VECTOR2I& aPosition, LSET aLayerMask ) const;
1083 PAD* GetPad( const VECTOR2I& aPosition ) const
1084 {
1085 return GetPad( aPosition, LSET().set() );
1086 }
1087
1095 PAD* GetPad( const PCB_TRACK* aTrace, ENDPOINT_T aEndPoint ) const;
1096
1106 PAD* GetPadFast( const VECTOR2I& aPosition, LSET aLayerMask ) const;
1107
1122 PAD* GetPad( std::vector<PAD*>& aPadList, const VECTOR2I& aPosition, LSET aLayerMask ) const;
1123
1135 void GetSortedPadListByXthenYCoord( std::vector<PAD*>& aVector, int aNetCode = -1 ) const;
1136
1144 std::tuple<int, double, double> GetTrackLength( const PCB_TRACK& aTrack ) const;
1145
1153 TRACKS TracksInNet( int aNetCode );
1154
1167 FOOTPRINT* GetFootprint( const VECTOR2I& aPosition, PCB_LAYER_ID aActiveLayer,
1168 bool aVisibleOnly, bool aIgnoreLocked = false ) const;
1169
1175 int GetMaxClearanceValue() const;
1176
1182 void MapNets( BOARD* aDestBoard );
1183
1184 void SanitizeNetcodes();
1185
1194 void AddListener( BOARD_LISTENER* aListener );
1195
1200 void RemoveListener( BOARD_LISTENER* aListener );
1201
1205 void RemoveAllListeners();
1206
1211 void OnItemChanged( BOARD_ITEM* aItem );
1212
1217 void OnItemsChanged( std::vector<BOARD_ITEM*>& aItems );
1218
1223 void OnItemsCompositeUpdate( std::vector<BOARD_ITEM*>& aAddedItems,
1224 std::vector<BOARD_ITEM*>& aRemovedItems,
1225 std::vector<BOARD_ITEM*>& aChangedItems );
1226
1230 void OnRatsnestChanged();
1231
1238 wxString GroupsSanityCheck( bool repair = false );
1239
1245 wxString GroupsSanityCheckInternal( bool repair );
1246
1248 {
1249 bool create : 1;
1250 bool ungroup : 1;
1251 bool removeItems : 1;
1252 };
1253
1259 GroupLegalOpsField GroupLegalOps( const PCB_SELECTION& selection ) const;
1260
1261 bool LegacyTeardrops() const { return m_legacyTeardrops; }
1262 void SetLegacyTeardrops( bool aFlag ) { m_legacyTeardrops = aFlag; }
1263
1264 EMBEDDED_FILES* GetEmbeddedFiles() override;
1265 const EMBEDDED_FILES* GetEmbeddedFiles() const;
1266
1270 void EmbedFonts() override;
1271
1276
1277 // --------- Item order comparators ---------
1278
1280 {
1281 bool operator() ( const BOARD_ITEM* aFirst, const BOARD_ITEM* aSecond ) const;
1282 };
1283
1285 {
1286 bool operator()( const BOARD_ITEM* aFirst, const BOARD_ITEM* aSecond ) const;
1287 };
1288
1289public:
1290 // ------------ Run-time caches -------------
1291 mutable std::shared_mutex m_CachesMutex;
1292 std::unordered_map<PTR_PTR_CACHE_KEY, bool> m_IntersectsCourtyardCache;
1293 std::unordered_map<PTR_PTR_CACHE_KEY, bool> m_IntersectsFCourtyardCache;
1294 std::unordered_map<PTR_PTR_CACHE_KEY, bool> m_IntersectsBCourtyardCache;
1295 std::unordered_map<PTR_PTR_LAYER_CACHE_KEY, bool> m_IntersectsAreaCache;
1296 std::unordered_map<PTR_PTR_LAYER_CACHE_KEY, bool> m_EnclosedByAreaCache;
1297 std::unordered_map< wxString, LSET > m_LayerExpressionCache;
1298 std::unordered_map<ZONE*, std::unique_ptr<DRC_RTREE>> m_CopperZoneRTreeCache;
1299 std::shared_ptr<DRC_RTREE> m_CopperItemRTreeCache;
1300 mutable std::unordered_map<const ZONE*, BOX2I> m_ZoneBBoxCache;
1301 mutable std::optional<int> m_maxClearanceValue;
1302
1303 // ------------ DRC caches -------------
1304 std::vector<ZONE*> m_DRCZones;
1305 std::vector<ZONE*> m_DRCCopperZones;
1308 ZONE* m_SolderMaskBridges; // A container to build bridges on solder mask layers
1309 std::map<ZONE*, std::map<PCB_LAYER_ID, ISOLATED_ISLANDS>> m_ZoneIsolatedIslandsMap;
1310
1311private:
1312 // The default copy constructor & operator= are inadequate,
1313 // either write one or do not use it at all
1314 BOARD( const BOARD& aOther ) = delete;
1315
1316 BOARD& operator=( const BOARD& aOther ) = delete;
1317
1318 template <typename Func, typename... Args>
1319 void InvokeListeners( Func&& aFunc, Args&&... args )
1320 {
1321 for( auto&& l : m_listeners )
1322 ( l->*aFunc )( std::forward<Args>( args )... );
1323 }
1324
1325 // Refresh user layer opposites.
1326 void recalcOpposites();
1327
1328 friend class PCB_EDIT_FRAME;
1329
1330private:
1333
1336 int m_timeStamp; // actually a modification counter
1337
1338 wxString m_fileName;
1339
1340 // These containers only have const accessors and must only be modified by Add()/Remove()
1341 MARKERS m_markers;
1342 DRAWINGS m_drawings;
1343 FOOTPRINTS m_footprints;
1344 TRACKS m_tracks;
1345 GROUPS m_groups;
1347 GENERATORS m_generators;
1348
1349 // Cache for fast access to items in the containers above by KIID, including children
1350 std::unordered_map<KIID, BOARD_ITEM*> m_itemByIdCache;
1351
1353
1354 HIGH_LIGHT_INFO m_highLight; // current high light data
1355 HIGH_LIGHT_INFO m_highLightPrevious; // a previously stored high light data
1356
1357 int m_fileFormatVersionAtLoad; // the version loaded from the file
1358 wxString m_generator; // the generator tag from the file
1359
1360 std::map<wxString, wxString> m_properties;
1361 std::shared_ptr<CONNECTIVITY_DATA> m_connectivity;
1362
1364 TITLE_BLOCK m_titles; // text in lower right of screen and plots
1366 PROJECT* m_project; // project this board is a part of
1368
1379 std::unique_ptr<BOARD_DESIGN_SETTINGS> m_designSettings;
1380
1385 bool m_legacyTeardrops = false;
1386
1387 NETINFO_LIST m_NetInfo; // net info list (name, design constraints...
1388
1389 std::vector<BOARD_LISTENER*> m_listeners;
1390
1392
1394};
1395
1396
1397#endif // CLASS_BOARD_H_
BOARD_USE
Flags to specify how the board is being used.
Definition: board.h:280
LAYER_T
The allowed types of layers, same as Specctra DSN spec.
Definition: board.h:153
@ LT_POWER
Definition: board.h:156
@ LT_FRONT
Definition: board.h:160
@ LT_MIXED
Definition: board.h:157
@ LT_BACK
Definition: board.h:161
@ LT_UNDEFINED
Definition: board.h:154
@ LT_JUMPER
Definition: board.h:158
@ LT_AUX
Definition: board.h:159
@ LT_SIGNAL
Definition: board.h:155
std::set< BOARD_ITEM *, CompareByUuid > BOARD_ITEM_SET
Set of BOARD_ITEMs ordered by UUID.
Definition: board.h:274
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.
Abstract interface for BOARD_ITEMs capable of storing other items inside.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:80
wxString GetLayerName() const
Return the name of the PCB layer on which the item resides.
Definition: board_item.cpp:139
virtual void OnBoardNetSettingsChanged(BOARD &aBoard)
Definition: board.h:259
virtual void OnBoardItemsAdded(BOARD &aBoard, std::vector< BOARD_ITEM * > &aBoardItem)
Definition: board.h:256
virtual void OnBoardRatsnestChanged(BOARD &aBoard)
Definition: board.h:263
virtual void OnBoardCompositeUpdate(BOARD &aBoard, std::vector< BOARD_ITEM * > &aAddedItems, std::vector< BOARD_ITEM * > &aRemovedItems, std::vector< BOARD_ITEM * > &aDeletedItems)
Definition: board.h:264
virtual void OnBoardItemsChanged(BOARD &aBoard, std::vector< BOARD_ITEM * > &aBoardItem)
Definition: board.h:261
virtual void OnBoardItemChanged(BOARD &aBoard, BOARD_ITEM *aBoardItem)
Definition: board.h:260
virtual void OnBoardItemRemoved(BOARD &aBoard, BOARD_ITEM *aBoardItem)
Definition: board.h:257
virtual void OnBoardItemAdded(BOARD &aBoard, BOARD_ITEM *aBoardItem)
Definition: board.h:255
virtual void OnBoardHighlightNetChanged(BOARD &aBoard)
Definition: board.h:262
virtual ~BOARD_LISTENER()
Definition: board.h:254
virtual void OnBoardItemsRemoved(BOARD &aBoard, std::vector< BOARD_ITEM * > &aBoardItem)
Definition: board.h:258
Manage layers needed to make a physical board.
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:290
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:1767
ZONE * m_SolderMaskBridges
Definition: board.h:1308
void GetContextualTextVars(wxArrayString *aVars) const
Definition: board.cpp:407
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:878
BOARD_STACKUP GetStackupOrDefault() const
Definition: board.cpp:2285
void SetPlotOptions(const PCB_PLOT_PARAMS &aOptions)
Definition: board.h:693
std::unordered_map< PTR_PTR_LAYER_CACHE_KEY, bool > m_EnclosedByAreaCache
Definition: board.h:1296
std::map< ZONE *, std::map< PCB_LAYER_ID, ISOLATED_ISLANDS > > m_ZoneIsolatedIslandsMap
Definition: board.h:1309
PCB_LAYER_ID GetCopperLayerStackMaxId() const
Definition: board.cpp:748
GENERATORS m_generators
Definition: board.h:1347
bool GetBoardPolygonOutlines(SHAPE_POLY_SET &aOutlines, 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:2491
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:2688
const NETINFO_LIST & GetNetInfo() const
Definition: board.h:871
bool m_LegacyDesignSettingsLoaded
True if the legacy board design settings were loaded from a file.
Definition: board.h:373
bool IsFootprintHolder() const
Find out if the board is being used to hold a single footprint for editing/viewing.
Definition: board.h:320
LSET GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
Definition: board.cpp:773
void recalcOpposites()
Definition: board.cpp:669
void SetPosition(const VECTOR2I &aPos) override
Definition: board.cpp:494
std::map< wxString, wxString > m_properties
Definition: board.h:1360
EMBEDDED_FILES * GetEmbeddedFiles() override
Definition: board.cpp:2544
int m_fileFormatVersionAtLoad
Definition: board.h:1357
NETINFO_ITEM * DpCoupledNet(const NETINFO_ITEM *aNet)
Definition: board.cpp:1987
LSET GetVisibleLayers() const
A proxy function that calls the correspondent function in m_BoardSettings.
Definition: board.cpp:787
std::vector< ZONE * > m_DRCCopperZones
Definition: board.h:1305
BOARD_USE GetBoardUse() const
Get what the board use is.
Definition: board.h:309
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Removes an item from the container.
Definition: board.cpp:998
const std::set< int > & GetHighLightNetCodes() const
Definition: board.h:532
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:2634
bool m_legacyTeardrops
Teardrops in 7.0 were applied as a post-processing step (rather than from pad and via properties).
Definition: board.h:1385
TITLE_BLOCK m_titles
Definition: board.h:1364
GAL_SET m_LegacyVisibleItems
Definition: board.h:370
void SetBoardUse(BOARD_USE aUse)
Set what the board is going to be used for.
Definition: board.h:302
ZONE * GetArea(int index) const
Return the Zone at a given index.
Definition: board.h:1028
const BOX2I GetBoardEdgesBoundingBox() const
Return the board bounding box calculated using exclusively the board edges (graphics on Edge....
Definition: board.h:929
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: board.h:915
void BuildListOfNets()
Definition: board.h:834
PAD * GetPadFast(const VECTOR2I &aPosition, LSET aLayerMask) const
Return pad found at aPosition on aLayerMask using the fast search method.
Definition: board.cpp:2143
LAYER m_layers[PCB_LAYER_ID_COUNT]
Definition: board.h:1352
const GENERATORS & Generators() const
Definition: board.h:337
void SetFileName(const wxString &aFileName)
Definition: board.h:325
static wxString GetStandardLayerName(PCB_LAYER_ID aLayerId)
Return an "English Standard" name of a PCB layer when given aLayerNumber.
Definition: board.h:786
const std::vector< BOARD_CONNECTED_ITEM * > AllConnectedItems()
Definition: board.cpp:2608
bool IsElementVisible(GAL_LAYER_ID aLayer) const
Test whether a given element category is visible.
Definition: board.cpp:839
int m_outlinesChainingEpsilon
the max distance between 2 end point to see them connected when building the board outlines
Definition: board.h:1332
std::set< wxString > GetNetClassAssignmentCandidates() const
Return the set of netname candidates for netclass assignment.
Definition: board.cpp:2026
BOARD_USE m_boardUse
What is this board being used for.
Definition: board.h:1335
PAGE_INFO m_paper
Definition: board.h:1363
void RemoveAllListeners()
Remove all listeners.
Definition: board.cpp:2682
FOOTPRINTS m_footprints
Definition: board.h:1343
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:1379
void SetEnabledLayers(LSET aLayerMask)
A proxy function that calls the correspondent function in m_BoardSettings.
Definition: board.cpp:793
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:2663
const PAGE_INFO & GetPageSettings() const
Definition: board.h:689
void UpdateUserUnits(BOARD_ITEM *aItem, KIGFX::VIEW *aView)
Update any references within aItem (or its descendants) to the user units.
Definition: board.cpp:1329
void SetProperties(const std::map< wxString, wxString > &aProps)
Definition: board.h:363
BOARD(const BOARD &aOther)=delete
GAL_SET GetVisibleElements() const
Return a set of all the element categories that are visible.
Definition: board.cpp:833
void SetHighLightNet(int aNetCode, bool aMulti=false)
Select the netcode to be highlighted.
Definition: board.cpp:2724
HIGH_LIGHT_INFO m_highLight
Definition: board.h:1354
bool SetLayerDescr(PCB_LAYER_ID aIndex, const LAYER &aLayer)
Return the type of the copper layer given by aLayer.
Definition: board.cpp:544
NETINFO_ITEM * FindNet(int aNetcode) const
Search for a net with the given netcode.
Definition: board.cpp:1916
EDA_UNITS m_userUnits
Definition: board.h:1367
BOARD_ITEM * GetItem(const KIID &aID) const
Definition: board.cpp:1406
const ZONES & Zones() const
Definition: board.h:335
void InvokeListeners(Func &&aFunc, Args &&... args)
Definition: board.h:1319
void SanitizeNetcodes()
Definition: board.cpp:2653
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:2466
const GROUPS & Groups() const
The groups must maintain the following invariants.
Definition: board.h:358
~BOARD()
Definition: board.cpp:144
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:187
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:799
LAYER_T GetLayerType(PCB_LAYER_ID aLayer) const
Return the type of the copper layer given by aLayer.
Definition: board.cpp:613
void RecordDRCExclusions()
Scan existing markers and record data from any that are Excluded.
Definition: board.cpp:327
DRAWINGS m_drawings
Definition: board.h:1342
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:2700
int SetAreasNetCodesFromNetNames()
Set the .m_NetCode member of all copper areas, according to the area Net Name The SetNetCodesFromNetN...
Definition: board.cpp:2079
void SynchronizeNetsAndNetClasses(bool aResetTrackAndViaSizes)
Copy NETCLASS info to each NET, based on NET membership in a NETCLASS.
Definition: board.cpp:2049
EDA_UNITS GetUserUnits()
Definition: board.h:701
void ResetNetHighLight()
Reset all high light data to the init state.
Definition: board.cpp:2715
PCB_PLOT_PARAMS m_plotOptions
Definition: board.h:1365
bool SetLayerName(PCB_LAYER_ID aLayer, const wxString &aLayerName)
Changes the name of the layer given by aLayer.
Definition: board.cpp:593
std::list< ZONE * > GetZoneList(bool aIncludeZonesInFootprints=false) const
Definition: board.cpp:2446
void ConvertBrdLayerToPolygonalContours(PCB_LAYER_ID aLayer, SHAPE_POLY_SET &aOutlines) const
Build a set of polygons which are the outlines of copper items (pads, tracks, vias,...
Definition: board.cpp:2919
bool ResolveTextVar(wxString *token, int aDepth) const
Definition: board.cpp:431
const MARKERS & Markers() const
Definition: board.h:339
FOOTPRINT * GetFirstFootprint() const
Get the first footprint on the board or nullptr.
Definition: board.h:448
PCB_LAYER_ID FlipLayer(PCB_LAYER_ID aLayer) const
Definition: board.cpp:730
const std::vector< PAD * > GetPads() const
Return a reference to a list of all the pads.
Definition: board.cpp:2594
void Move(const VECTOR2I &aMoveVector) override
Move this object.
Definition: board.cpp:500
TITLE_BLOCK & GetTitleBlock()
Definition: board.h:695
BOX2I ComputeBoundingBox(bool aBoardEdgesOnly=false) const
Calculate the bounding box containing all board items (or board edge segments).
Definition: board.cpp:1668
void FixupEmbeddedData()
After loading a file from disk, the footprints do not yet contain the full data for their embedded fi...
Definition: board.cpp:978
int GetMaxClearanceValue() const
Returns the maximum clearance value for any object on the board.
Definition: board.cpp:896
ZONES m_zones
Definition: board.h:1346
PAD * GetPad(const VECTOR2I &aPosition) const
Definition: board.h:1083
PCB_LAYER_ID GetLayerID(const wxString &aLayerName) const
Return the ID of a layer.
Definition: board.cpp:557
HIGH_LIGHT_INFO m_highLightPrevious
Definition: board.h:1355
const VECTOR2I GetFocusPosition() const override
Similar to GetPosition, but allows items to return their visual center rather than their anchor.
Definition: board.h:384
void HighLightOFF()
Disable net highlight.
Definition: board.h:562
NETINFO_LIST m_NetInfo
Definition: board.h:1387
LSET m_LegacyVisibleLayers
Visibility settings stored in board prior to 6.0, only used for loading legacy files.
Definition: board.h:369
void SetVisibleAlls()
Change the bit-mask of visible element categories and layers.
Definition: board.cpp:822
void SetOutlinesChainingEpsilon(int aValue)
Definition: board.h:740
NETINFO_LIST::iterator EndNets() const
Definition: board.h:893
GroupLegalOpsField GroupLegalOps(const PCB_SELECTION &selection) const
Check which selection tool group operations are legal given the selection.
Definition: board.cpp:2829
int GetCopperLayerCount() const
Definition: board.cpp:736
int m_timeStamp
Definition: board.h:1336
std::vector< BOARD_LISTENER * > m_listeners
Definition: board.h:1389
const std::map< wxString, wxString > & GetProperties() const
Definition: board.h:362
std::unordered_map< PTR_PTR_CACHE_KEY, bool > m_IntersectsCourtyardCache
Definition: board.h:1292
void IncrementTimeStamp()
Definition: board.cpp:255
int MatchDpSuffix(const wxString &aNetName, wxString &aComplementNet)
Fetch the coupled netname for a given net.
Definition: board.cpp:1937
COMPONENT_CLASS_MANAGER m_componentClassManager
Definition: board.h:1393
std::unordered_map< PTR_PTR_CACHE_KEY, bool > m_IntersectsFCourtyardCache
Definition: board.h:1293
void RemoveUnusedNets(BOARD_COMMIT *aCommit)
Definition: board.h:876
const FOOTPRINTS & Footprints() const
Definition: board.h:331
std::shared_ptr< CONNECTIVITY_DATA > m_connectivity
Definition: board.h:1361
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:1242
const BOARD_ITEM_SET GetItemSet()
Definition: board.cpp:3020
const TRACKS & Tracks() const
Definition: board.h:329
int m_DRCMaxPhysicalClearance
Definition: board.h:1307
FOOTPRINT * FindFootprintByPath(const KIID_PATH &aPath) const
Search for a FOOTPRINT within this board with the given path.
Definition: board.cpp:2014
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:1130
void SetPageSettings(const PAGE_INFO &aPageSettings)
Definition: board.h:690
std::unordered_map< wxString, LSET > m_LayerExpressionCache
Definition: board.h:1297
bool m_embedFonts
Definition: board.h:1391
wxString GroupsSanityCheckInternal(bool repair)
Definition: board.cpp:2760
void OnRatsnestChanged()
Notify the board and its listeners that the ratsnest has been recomputed.
Definition: board.cpp:2709
wxString ConvertCrossReferencesToKIIDs(const wxString &aSource) const
Convert cross-references back and forth between ${refDes:field} and ${kiid:field}.
Definition: board.cpp:1549
wxString GetClass() const override
Return the class name.
Definition: board.h:997
void SetVisibleLayers(LSET aLayerMask)
A proxy function that calls the correspondent function in m_BoardSettings changes the bit-mask of vis...
Definition: board.cpp:805
NETINFO_LIST::iterator BeginNets() const
Definition: board.h:885
bool m_LegacyNetclassesLoaded
True if netclasses were loaded from the file.
Definition: board.h:377
void SetCopperLayerCount(int aCount)
Definition: board.cpp:742
std::unordered_map< const ZONE *, BOX2I > m_ZoneBBoxCache
Definition: board.h:1300
wxString m_generator
Definition: board.h:1358
std::unordered_map< PTR_PTR_CACHE_KEY, bool > m_IntersectsBCourtyardCache
Definition: board.h:1294
TRACKS TracksInNet(int aNetCode)
Collect all the TRACKs and VIAs that are members of a net given by aNetCode.
Definition: board.cpp:522
void SetProject(PROJECT *aProject, bool aReferenceOnly=false)
Link a board to a given project.
Definition: board.cpp:197
PROJECT * m_project
Definition: board.h:1366
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:2382
const wxString & GetFileName() const
Definition: board.h:327
bool operator==(const BOARD_ITEM &aOther) const override
Definition: board.cpp:3035
std::vector< PCB_MARKER * > ResolveDRCExclusions(bool aCreateMarkers)
Rebuild DRC markers from the serialized data in BOARD_DESIGN_SETTINGS.
Definition: board.cpp:344
FOOTPRINT * FindFootprintByReference(const wxString &aReference) const
Search for a FOOTPRINT within this board with the given reference designator.
Definition: board.cpp:2002
unsigned GetNodesCount(int aNet=-1) const
Definition: board.cpp:1651
bool IsHighLightNetON() const
Definition: board.h:548
void FillItemMap(std::map< KIID, EDA_ITEM * > &aMap)
Definition: board.cpp:1510
int GetFileFormatVersionAtLoad() const
Definition: board.h:394
void SetElementVisibility(GAL_LAYER_ID aLayer, bool aNewState)
Change the visibility of an element category.
Definition: board.cpp:845
std::shared_ptr< DRC_RTREE > m_CopperItemRTreeCache
Definition: board.h:1299
bool SetLayerType(PCB_LAYER_ID aLayer, LAYER_T aLayerType)
Change the type of the layer given by aLayer.
Definition: board.cpp:627
const PCB_PLOT_PARAMS & GetPlotOptions() const
Definition: board.h:692
BOARD & operator=(const BOARD &aOther)=delete
wxString m_fileName
Definition: board.h:1338
const wxString & GetGenerator() const
Adds an item to the container.
Definition: board.h:397
int GetAreaCount() const
Definition: board.h:1044
void SetLegacyTeardrops(bool aFlag)
Definition: board.h:1262
int GetOutlinesChainingEpsilon()
Definition: board.h:739
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:2270
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:779
int m_DRCMaxClearance
Definition: board.h:1306
void ClearProject()
Definition: board.cpp:235
std::unordered_map< ZONE *, std::unique_ptr< DRC_RTREE > > m_CopperZoneRTreeCache
Definition: board.h:1298
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:1124
int LayerDepth(PCB_LAYER_ID aStartLayer, PCB_LAYER_ID aEndLayer) const
Definition: board.cpp:761
void DeleteAllFootprints()
Remove all footprints from the deque and free the memory associated with them.
Definition: board.cpp:1393
PROJECT * GetProject() const
Definition: board.h:491
bool IsEmpty() const
Definition: board.h:386
bool LegacyTeardrops() const
Definition: board.h:1261
std::tuple< int, 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:2296
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:1729
const TITLE_BLOCK & GetTitleBlock() const
Definition: board.h:696
wxString GroupsSanityCheck(bool repair=false)
Consistency check of internal m_groups structure.
Definition: board.cpp:2747
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.cpp:890
std::vector< ZONE * > m_DRCZones
Definition: board.h:1304
PAD * GetPad(const VECTOR2I &aPosition, LSET aLayerMask) const
Find a pad aPosition on aLayer.
Definition: board.cpp:2113
void SetGenerator(const wxString &aGenerator)
Definition: board.h:396
BOARD()
Definition: board.cpp:75
void UpdateRatsnestExclusions()
Update the visibility flags on the current unconnected ratsnest lines.
Definition: board.cpp:296
wxString ConvertKIIDsToCrossReferences(const wxString &aSource) const
Definition: board.cpp:1603
void SynchronizeProperties()
Copy the current project's text variables into the boards property cache.
Definition: board.cpp:2040
std::unordered_map< KIID, BOARD_ITEM * > m_itemByIdCache
Definition: board.h:1350
void RemoveListener(BOARD_LISTENER *aListener)
Remove the specified listener.
Definition: board.cpp:2670
COMPONENT_CLASS_MANAGER & GetComponentClassManager()
Gets the component class manager.
Definition: board.h:1275
std::shared_mutex m_CachesMutex
Definition: board.h:1291
unsigned GetNetCount() const
Definition: board.h:902
void DeleteMARKERs()
Delete all MARKERS from the board.
Definition: board.cpp:1355
void Remove(BOARD_ITEM *aBoardItem, REMOVE_MODE aMode=REMOVE_MODE::NORMAL) override
Removes an item from the container.
Definition: board.cpp:1136
GROUPS m_groups
Definition: board.h:1345
MARKERS m_markers
Definition: board.h:1341
std::unordered_map< PTR_PTR_LAYER_CACHE_KEY, bool > m_IntersectsAreaCache
Definition: board.h:1295
std::optional< int > m_maxClearanceValue
Definition: board.h:1301
void HighLightON(bool aValue=true)
Enable or disable net highlighting.
Definition: board.cpp:2737
void SetTitleBlock(const TITLE_BLOCK &aTitleBlock)
Definition: board.h:697
bool TestZoneIntersection(ZONE *aZone1, ZONE *aZone2)
Test for intersection of 2 copper areas.
TRACKS m_tracks
Definition: board.h:1344
bool m_LegacyCopperEdgeClearanceLoaded
Definition: board.h:374
int GetTimeStamp() const
Definition: board.h:313
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:2694
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
Definition: board.h:475
VECTOR2I GetPosition() const override
Definition: board.cpp:488
void CacheTriangulation(PROGRESS_REPORTER *aReporter=nullptr, const std::vector< ZONE * > &aZones={})
Definition: board.cpp:928
static bool ClassOf(const EDA_ITEM *aItem)
Definition: board.h:292
void SetUserUnits(EDA_UNITS aUnits)
Definition: board.h:702
void SetVisibleElements(const GAL_SET &aMask)
A proxy function that calls the correspondent function in m_BoardSettings.
Definition: board.cpp:812
void EmbedFonts() override
Finds all fonts used in the board and embeds them in the file if permissions allow.
Definition: board.cpp:2562
double Similarity(const BOARD_ITEM &aOther) const override
Return the Similarity.
Definition: board.h:990
const DRAWINGS & Drawings() const
Definition: board.h:333
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
Definition: board.cpp:1323
void SetFileFormatVersionAtLoad(int aVersion)
Definition: board.h:393
constexpr const Vec GetCenter() const
Definition: box2.h:230
Store all of the related footprint information found in a netlist.
Definition: pcb_netlist.h:88
Implement an R-tree for fast spatial and layer indexing of connectable items.
Definition: drc_rtree.h:48
The base class for create windows for drawing purpose.
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:89
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:101
Helper for storing and iterating over GAL_LAYER_IDs.
Definition: layer_ids.h:308
void Clear()
Definition: board.h:229
HIGH_LIGHT_INFO()
Definition: board.h:235
std::set< int > m_netCodes
Definition: board.h:226
bool m_highLightOn
Definition: board.h:227
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition: view.h:68
Definition: kiid.h:49
LSET is a set of PCB_LAYER_IDs.
Definition: lset.h:36
EDA_MSG_PANEL items for displaying messages.
Definition: msgpanel.h:54
Handle the data for a net.
Definition: netinfo.h:56
Wrapper class, so you can iterate through NETINFO_ITEM*s, not std::pair<int/wxString,...
Definition: netinfo.h:407
Container for NETINFO_ITEM elements, which are the nets.
Definition: netinfo.h:346
void RemoveUnusedNets(BOARD_COMMIT *aCommit)
iterator begin() const
Definition: netinfo.h:452
unsigned GetNetCount() const
Definition: netinfo.h:369
iterator end() const
Definition: netinfo.h:457
void buildListOfNets()
Rebuild the list of NETINFO_ITEMs.
Store information read from a netlist along with the flags used to update the NETLIST in the BOARD.
Definition: pcb_netlist.h:241
Definition: pad.h:54
Describe the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:59
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:52
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.
Container for project specific data.
Definition: project.h:64
A pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:72
Represent a set of closed polygons.
Hold the information shown in the lower right corner of a plot, printout, or editing view.
Definition: title_block.h:41
Handle a list of polygons defining a copper zone.
Definition: zone.h:73
The common library.
const std::function< void(const wxString &msg, BOARD_ITEM *itemA, BOARD_ITEM *itemB, const VECTOR2I &pt)> OUTLINE_ERROR_HANDLER
INSPECT_RESULT
Definition: eda_item.h:43
const INSPECTOR_FUNC & INSPECTOR
Definition: eda_item.h:82
EDA_UNITS
Definition: eda_units.h:46
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:32
wxString LayerName(int aLayer)
Returns the default display name for a given layer.
Definition: layer_id.cpp:30
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
Definition: layer_ids.h:192
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:60
@ PCB_LAYER_ID_COUNT
Definition: layer_ids.h:135
STL namespace.
std::vector< ZONE * > ZONES
Definition: pcb_io_eagle.h:47
ENDPOINT_T
Definition: pcb_track.h:59
bool operator()(const BOARD_ITEM *aFirst, const BOARD_ITEM *aSecond) const
Definition: board.cpp:2879
bool operator()(const BOARD_ITEM *aFirst, const BOARD_ITEM *aSecond) const
Definition: board.cpp:2858
A struct recording the isolated and single-pad islands within a zone.
Definition: zone.h:60
Container to hold information pertinent to a layer of a BOARD.
Definition: board.h:169
int m_opposite
Similar layer on opposite side of the board, if any.
Definition: board.h:201
static LAYER_T ParseType(const char *aType)
Convert a string to a LAYER_T.
Definition: board.cpp:656
void clear()
Definition: board.h:175
LAYER_T m_type
The type of the layer.
Definition: board.h:198
static const char * ShowType(LAYER_T aType)
Convert a LAYER_T enum to a string representation of the layer type.
Definition: board.cpp:640
LAYER()
Definition: board.h:170
wxString m_name
The canonical name of the layer.
Definition: board.h:196
wxString m_userName
The user defined name of the layer.
Definition: board.h:197
bool m_visible
Definition: board.h:199
int m_number
The layer ID.
Definition: board.h:200
BOARD_ITEM * A
Definition: board.h:91
bool operator==(const PTR_LAYER_CACHE_KEY &other) const
Definition: board.h:94
PCB_LAYER_ID Layer
Definition: board.h:92
BOARD_ITEM * A
Definition: board.h:80
BOARD_ITEM * B
Definition: board.h:81
bool operator==(const PTR_PTR_CACHE_KEY &other) const
Definition: board.h:83
bool operator==(const PTR_PTR_LAYER_CACHE_KEY &other) const
Definition: board.h:106
BOARD_ITEM * B
Definition: board.h:103
BOARD_ITEM * A
Definition: board.h:102
PCB_LAYER_ID Layer
Definition: board.h:104
std::size_t operator()(const PTR_LAYER_CACHE_KEY &k) const
Definition: board.h:128
std::size_t operator()(const PTR_PTR_CACHE_KEY &k) const
Definition: board.h:117
std::size_t operator()(const PTR_PTR_LAYER_CACHE_KEY &k) const
Definition: board.h:139
@ PCB_T
Definition: typeinfo.h:82
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
Definition: typeinfo.h:88
@ PCB_GENERATOR_T
class PCB_GENERATOR, generator on a layer
Definition: typeinfo.h:91
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs
Definition: typeinfo.h:110
@ PCB_ZONE_T
class ZONE, a copper pour area
Definition: typeinfo.h:107
@ PCB_MARKER_T
class PCB_MARKER, a marker used to show something
Definition: typeinfo.h:99
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
Definition: typeinfo.h:86
@ PCB_NETINFO_T
class NETINFO_ITEM, a description of a net
Definition: typeinfo.h:109
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:96
ZONE_BORDER_DISPLAY_STYLE
Zone border styles.
Definition: zone_settings.h:50