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
30#include <common.h> // Needed for stl hash extensions
31#include <convert_shape_list_to_polygon.h> // for OUTLINE_ERROR_HANDLER
32#include <hash.h>
33#include <layer_ids.h>
34#include <lset.h>
35#include <netinfo.h>
36#include <pcb_item_containers.h>
37#include <pcb_plot_params.h>
38#include <title_block.h>
39#include <tools/pcb_selection.h>
40#include <shared_mutex>
41#include <list>
42
45class BOARD_COMMIT;
46class DRC_RTREE;
47class PCB_BASE_FRAME;
48class PCB_EDIT_FRAME;
50class BOARD;
51class FOOTPRINT;
52class ZONE;
53class PCB_TRACK;
54class PAD;
55class PCB_GROUP;
56class PCB_GENERATOR;
57class PCB_MARKER;
58class MSG_PANEL_ITEM;
59class NETLIST;
60class REPORTER;
61class SHAPE_POLY_SET;
63class COMPONENT;
64class PROJECT;
66struct ISOLATED_ISLANDS;
67
68// The default value for m_outlinesChainingEpsilon to convert a board outlines to polygons
69// It is the max dist between 2 end points to see them connected
70#define DEFAULT_CHAINING_EPSILON_MM 0.01
71
72// Forward declare endpoint from class_track.h
73enum ENDPOINT_T : int;
74
75
77{
80
81 bool operator==(const PTR_PTR_CACHE_KEY& other) const
82 {
83 return A == other.A && B == other.B;
84 }
85};
86
88{
91
92 bool operator==(const PTR_LAYER_CACHE_KEY& other) const
93 {
94 return A == other.A && Layer == other.Layer;
95 }
96};
97
99{
103
104 bool operator==(const PTR_PTR_LAYER_CACHE_KEY& other) const
105 {
106 return A == other.A && B == other.B && Layer == other.Layer;
107 }
108};
109
110namespace std
111{
112 template <>
113 struct hash<PTR_PTR_CACHE_KEY>
114 {
115 std::size_t operator()( const PTR_PTR_CACHE_KEY& k ) const
116 {
117 std::size_t seed = 0xa82de1c0;
118 hash_combine( seed, k.A, k.B );
119 return seed;
120 }
121 };
122
123 template <>
125 {
126 std::size_t operator()( const PTR_LAYER_CACHE_KEY& k ) const
127 {
128 std::size_t seed = 0xa82de1c0;
129 hash_combine( seed, k.A, k.Layer );
130 return seed;
131 }
132 };
133
134 template <>
136 {
137 std::size_t operator()( const PTR_PTR_LAYER_CACHE_KEY& k ) const
138 {
139 std::size_t seed = 0xa82de1c0;
140 hash_combine( seed, k.A, k.B, k.Layer );
141 return seed;
142 }
143 };
144}
145
146
151{
159 LT_BACK
161
162
166struct LAYER
167{
169 {
170 clear();
171 }
172
173 void clear()
174 {
176 m_visible = true;
177 m_number = 0;
178 m_name.clear();
179 m_userName.clear();
181 }
182
183 /*
184 LAYER( const wxString& aName = wxEmptyString,
185 LAYER_T aType = LT_SIGNAL, bool aVisible = true, int aNumber = -1 ) :
186 m_name( aName ),
187 m_type( aType ),
188 m_visible( aVisible ),
189 m_number( aNumber )
190 {
191 }
192 */
193
194 wxString m_name;
195 wxString m_userName;
200
207 static const char* ShowType( LAYER_T aType );
208
216 static LAYER_T ParseType( const char* aType );
217};
218
219
220// Helper class to handle high light nets
222{
223protected:
224 std::set<int> m_netCodes; // net(s) selected for highlight (-1 when no net selected )
225 bool m_highLightOn; // highlight active
226
227 void Clear()
228 {
229 m_netCodes.clear();
230 m_highLightOn = false;
231 }
232
234 {
235 Clear();
236 }
237
238private:
239 friend class BOARD;
240};
241
247class BOARD;
248
250{
251public:
252 virtual ~BOARD_LISTENER() { }
253 virtual void OnBoardItemAdded( BOARD& aBoard, BOARD_ITEM* aBoardItem ) { }
254 virtual void OnBoardItemsAdded( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItem ) { }
255 virtual void OnBoardItemRemoved( BOARD& aBoard, BOARD_ITEM* aBoardItem ) { }
256 virtual void OnBoardItemsRemoved( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItem ) { }
257 virtual void OnBoardNetSettingsChanged( BOARD& aBoard ) { }
258 virtual void OnBoardItemChanged( BOARD& aBoard, BOARD_ITEM* aBoardItem ) { }
259 virtual void OnBoardItemsChanged( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItem ) { }
260 virtual void OnBoardHighlightNetChanged( BOARD& aBoard ) { }
261 virtual void OnBoardRatsnestChanged( BOARD& aBoard ) { }
262 virtual void OnBoardCompositeUpdate( BOARD& aBoard, std::vector<BOARD_ITEM*>& aAddedItems,
263 std::vector<BOARD_ITEM*>& aRemovedItems,
264 std::vector<BOARD_ITEM*>& aDeletedItems )
265 {
266 }
267};
268
272typedef std::set<BOARD_ITEM*, CompareByUuid> BOARD_ITEM_SET;
273
277enum class BOARD_USE
278{
279 NORMAL, // A normal board
280 FPHOLDER // A board that holds a single footprint
281};
282
283
288{
289public:
290 static inline bool ClassOf( const EDA_ITEM* aItem )
291 {
292 return aItem && PCB_T == aItem->Type();
293 }
294
300 void SetBoardUse( BOARD_USE aUse ) { m_boardUse = aUse; }
301
307 BOARD_USE GetBoardUse() const { return m_boardUse; }
308
309 void IncrementTimeStamp();
310
311 int GetTimeStamp() const { return m_timeStamp; }
312
318 bool IsFootprintHolder() const
319 {
320 return m_boardUse == BOARD_USE::FPHOLDER;
321 }
322
323 void SetFileName( const wxString& aFileName ) { m_fileName = aFileName; }
324
325 const wxString &GetFileName() const { return m_fileName; }
326
327 const TRACKS& Tracks() const { return m_tracks; }
328
329 const FOOTPRINTS& Footprints() const { return m_footprints; }
330
331 const DRAWINGS& Drawings() const { return m_drawings; }
332
333 const ZONES& Zones() const { return m_zones; }
334
335 const GENERATORS& Generators() const { return m_generators; }
336
337 const MARKERS& Markers() const { return m_markers; }
338
339 // SWIG requires non-const accessors for some reason to make the custom iterators in board.i
340 // work. It would be good to remove this if we can figure out how to fix that.
341#ifdef SWIG
342 DRAWINGS& Drawings() { return m_drawings; }
343 TRACKS& Tracks() { return m_tracks; }
344#endif
345
347
356 const GROUPS& Groups() const { return m_groups; }
357
358 const std::vector<BOARD_CONNECTED_ITEM*> AllConnectedItems();
359
360 const std::map<wxString, wxString>& GetProperties() const { return m_properties; }
361 void SetProperties( const std::map<wxString, wxString>& aProps ) { m_properties = aProps; }
362
363 void GetContextualTextVars( wxArrayString* aVars ) const;
364 bool ResolveTextVar( wxString* token, int aDepth ) const;
365
369
373
376
377 BOARD();
378 ~BOARD();
379
380 VECTOR2I GetPosition() const override;
381 void SetPosition( const VECTOR2I& aPos ) override;
382 const VECTOR2I GetFocusPosition() const override { return GetBoundingBox().GetCenter(); }
383
384 bool IsEmpty() const
385 {
386 return m_drawings.empty() && m_footprints.empty() && m_tracks.empty() && m_zones.empty();
387 }
388
389 void Move( const VECTOR2I& aMoveVector ) override;
390
391 void SetFileFormatVersionAtLoad( int aVersion ) { m_fileFormatVersionAtLoad = aVersion; }
393
394 void SetGenerator( const wxString& aGenerator ) { m_generator = aGenerator; }
395 const wxString& GetGenerator() const { return m_generator; }
396
398 void Add( BOARD_ITEM* aItem, ADD_MODE aMode = ADD_MODE::INSERT,
399 bool aSkipConnectivity = false ) override;
400
402 void Remove( BOARD_ITEM* aBoardItem, REMOVE_MODE aMode = REMOVE_MODE::NORMAL ) override;
403
412 void RemoveAll( std::initializer_list<KICAD_T> aTypes = { PCB_NETINFO_T, PCB_MARKER_T,
416
421 void FinalizeBulkAdd( std::vector<BOARD_ITEM*>& aNewItems );
422
427 void FinalizeBulkRemove( std::vector<BOARD_ITEM*>& aRemovedItems );
428
429 void CacheTriangulation( PROGRESS_REPORTER* aReporter = nullptr,
430 const std::vector<ZONE*>& aZones = {} );
431
440 {
441 return m_footprints.empty() ? nullptr : m_footprints.front();
442 }
443
447 void DeleteAllFootprints();
448
452 BOARD_ITEM* GetItem( const KIID& aID ) const;
453
454 void FillItemMap( std::map<KIID, EDA_ITEM*>& aMap );
455
459 wxString ConvertCrossReferencesToKIIDs( const wxString& aSource ) const;
460 wxString ConvertKIIDsToCrossReferences( const wxString& aSource ) const;
461
466 std::shared_ptr<CONNECTIVITY_DATA> GetConnectivity() const { return m_connectivity; }
467
473 bool BuildConnectivity( PROGRESS_REPORTER* aReporter = nullptr );
474
478 void DeleteMARKERs();
479
480 void DeleteMARKERs( bool aWarningsAndErrors, bool aExclusions );
481
482 PROJECT* GetProject() const { return m_project; }
483
492 void SetProject( PROJECT* aProject, bool aReferenceOnly = false );
493
494 void ClearProject();
495
503 std::vector<PCB_MARKER*> ResolveDRCExclusions( bool aCreateMarkers );
504
508 void RecordDRCExclusions();
509
514
518 void ResetNetHighLight();
519
523 const std::set<int>& GetHighLightNetCodes() const
524 {
525 return m_highLight.m_netCodes;
526 }
527
534 void SetHighLightNet( int aNetCode, bool aMulti = false );
535
540
548 void HighLightON( bool aValue = true );
549
554 {
555 HighLightON( false );
556 }
557
561 int GetCopperLayerCount() const;
562 void SetCopperLayerCount( int aCount );
563
564 PCB_LAYER_ID FlipLayer( PCB_LAYER_ID aLayer ) const;
565
566 int LayerDepth( PCB_LAYER_ID aStartLayer, PCB_LAYER_ID aEndLayer ) const;
567
573 LSET GetEnabledLayers() const;
574
580 void SetEnabledLayers( LSET aLayerMask );
581
588 bool IsLayerEnabled( PCB_LAYER_ID aLayer ) const;
589
597 bool IsLayerVisible( PCB_LAYER_ID aLayer ) const;
598
604 LSET GetVisibleLayers() const;
605
612 void SetVisibleLayers( LSET aLayerMask );
613
614 // these 2 functions are not tidy at this time, since there are PCB_LAYER_IDs that
615 // are not stored in the bitmap.
616
624
631 void SetVisibleElements( const GAL_SET& aMask );
632
638 void SetVisibleAlls();
639
647 bool IsElementVisible( GAL_LAYER_ID aLayer ) const;
648
656 void SetElementVisibility( GAL_LAYER_ID aLayer, bool aNewState );
657
665 bool IsFootprintLayerVisible( PCB_LAYER_ID aLayer ) const;
666
671
673
674 const PAGE_INFO& GetPageSettings() const { return m_paper; }
675 void SetPageSettings( const PAGE_INFO& aPageSettings ) { m_paper = aPageSettings; }
676
678 void SetPlotOptions( const PCB_PLOT_PARAMS& aOptions ) { m_plotOptions = aOptions; }
679
681 const TITLE_BLOCK& GetTitleBlock() const { return m_titles; }
682 void SetTitleBlock( const TITLE_BLOCK& aTitleBlock ) { m_titles = aTitleBlock; }
683
684 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
685
687 void SetUserUnits( EDA_UNITS aUnits ) { m_userUnits = aUnits; }
688
693 void UpdateUserUnits( BOARD_ITEM* aItem, KIGFX::VIEW* aView );
694
713 OUTLINE_ERROR_HANDLER* aErrorHandler = nullptr,
714 bool aAllowUseArcsInPolygons = false,
715 bool aIncludeNPTHAsOutlines = false );
716
726
737 void ConvertBrdLayerToPolygonalContours( PCB_LAYER_ID aLayer, SHAPE_POLY_SET& aOutlines ) const;
738
742 PCB_LAYER_ID GetLayerID( const wxString& aLayerName ) const;
743
750 const wxString GetLayerName( PCB_LAYER_ID aLayer ) const;
751
759 bool SetLayerName( PCB_LAYER_ID aLayer, const wxString& aLayerName );
760
771 static wxString GetStandardLayerName( PCB_LAYER_ID aLayerId )
772 {
773 // a BOARD's standard layer name is the PCB_LAYER_ID fixed name
774 return LayerName( aLayerId );
775 }
776
784 bool SetLayerDescr( PCB_LAYER_ID aIndex, const LAYER& aLayer );
785
792 LAYER_T GetLayerType( PCB_LAYER_ID aLayer ) const;
793
801 bool SetLayerType( PCB_LAYER_ID aLayer, LAYER_T aLayerType );
802
807 unsigned GetNodesCount( int aNet = -1 ) const;
808
817 const std::vector<PAD*> GetPads() const;
818
820 {
822 }
823
830 NETINFO_ITEM* FindNet( int aNetcode ) const;
831
838 NETINFO_ITEM* FindNet( const wxString& aNetname ) const;
839
849 int MatchDpSuffix( const wxString& aNetName, wxString& aComplementNet );
850
854 NETINFO_ITEM* DpCoupledNet( const NETINFO_ITEM* aNet );
855
857 {
858 return m_NetInfo;
859 }
860
862 {
863 m_NetInfo.RemoveUnusedNets( aCommit );
864 }
865
866#ifndef SWIG
871 {
872 return m_NetInfo.begin();
873 }
874
879 {
880 return m_NetInfo.end();
881 }
882#endif
883
887 unsigned GetNetCount() const
888 {
889 return m_NetInfo.GetNetCount();
890 }
891
898 BOX2I ComputeBoundingBox( bool aBoardEdgesOnly = false, bool aIncludeHiddenText = false ) const;
899
900 const BOX2I GetBoundingBox() const override
901 {
903 }
904
915 {
916 return ComputeBoundingBox( true, false );
917 }
918
919 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
920
932 INSPECT_RESULT Visit( INSPECTOR inspector, void* testData,
933 const std::vector<KICAD_T>& scanTypes ) override;
934
943 FOOTPRINT* FindFootprintByReference( const wxString& aReference ) const;
944
951 FOOTPRINT* FindFootprintByPath( const KIID_PATH& aPath ) const;
952
956 std::set<wxString> GetNetClassAssignmentCandidates() const;
957
965 void SynchronizeNetsAndNetClasses( bool aResetTrackAndViaSizes );
966
971
975 double Similarity( const BOARD_ITEM& aOther ) const override
976 {
977 return 1.0;
978 }
979
980 bool operator==( const BOARD_ITEM& aOther ) const override;
981
982 wxString GetClass() const override
983 {
984 return wxT( "BOARD" );
985 }
986
987#if defined(DEBUG)
988 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
989#endif
990
991
992 /*************************/
993 /* Copper Areas handling */
994 /*************************/
995
1006
1013 ZONE* GetArea( int index ) const
1014 {
1015 if( (unsigned) index < m_zones.size() )
1016 return m_zones[index];
1017
1018 return nullptr;
1019 }
1020
1024 std::list<ZONE*> GetZoneList( bool aIncludeZonesInFootprints = false ) const;
1025
1029 int GetAreaCount() const
1030 {
1031 return static_cast<int>( m_zones.size() );
1032 }
1033
1034 /* Functions used in test, merge and cut outlines */
1035
1048 ZONE* AddArea( PICKED_ITEMS_LIST* aNewZonesList, int aNetcode, PCB_LAYER_ID aLayer,
1049 VECTOR2I aStartPointPosition, ZONE_BORDER_DISPLAY_STYLE aHatch );
1050
1058 bool TestZoneIntersection( ZONE* aZone1, ZONE* aZone2 );
1059
1067 PAD* GetPad( const VECTOR2I& aPosition, LSET aLayerMask ) const;
1068 PAD* GetPad( const VECTOR2I& aPosition ) const
1069 {
1070 return GetPad( aPosition, LSET().set() );
1071 }
1072
1080 PAD* GetPad( const PCB_TRACK* aTrace, ENDPOINT_T aEndPoint ) const;
1081
1091 PAD* GetPadFast( const VECTOR2I& aPosition, LSET aLayerMask ) const;
1092
1107 PAD* GetPad( std::vector<PAD*>& aPadList, const VECTOR2I& aPosition, LSET aLayerMask ) const;
1108
1120 void GetSortedPadListByXthenYCoord( std::vector<PAD*>& aVector, int aNetCode = -1 ) const;
1121
1129 std::tuple<int, double, double> GetTrackLength( const PCB_TRACK& aTrack ) const;
1130
1138 TRACKS TracksInNet( int aNetCode );
1139
1152 FOOTPRINT* GetFootprint( const VECTOR2I& aPosition, PCB_LAYER_ID aActiveLayer,
1153 bool aVisibleOnly, bool aIgnoreLocked = false ) const;
1154
1160 int GetMaxClearanceValue() const;
1161
1167 void MapNets( BOARD* aDestBoard );
1168
1169 void SanitizeNetcodes();
1170
1179 void AddListener( BOARD_LISTENER* aListener );
1180
1185 void RemoveListener( BOARD_LISTENER* aListener );
1186
1190 void RemoveAllListeners();
1191
1196 void OnItemChanged( BOARD_ITEM* aItem );
1197
1202 void OnItemsChanged( std::vector<BOARD_ITEM*>& aItems );
1203
1208 void OnItemsCompositeUpdate( std::vector<BOARD_ITEM*>& aAddedItems,
1209 std::vector<BOARD_ITEM*>& aRemovedItems,
1210 std::vector<BOARD_ITEM*>& aChangedItems );
1211
1215 void OnRatsnestChanged();
1216
1223 wxString GroupsSanityCheck( bool repair = false );
1224
1230 wxString GroupsSanityCheckInternal( bool repair );
1231
1233 {
1234 bool create : 1;
1235 bool ungroup : 1;
1236 bool removeItems : 1;
1237 };
1238
1244 GroupLegalOpsField GroupLegalOps( const PCB_SELECTION& selection ) const;
1245
1246 bool LegacyTeardrops() const { return m_legacyTeardrops; }
1247 void SetLegacyTeardrops( bool aFlag ) { m_legacyTeardrops = aFlag; }
1248
1249 // --------- Item order comparators ---------
1250
1252 {
1253 bool operator() ( const BOARD_ITEM* aFirst, const BOARD_ITEM* aSecond ) const;
1254 };
1255
1257 {
1258 bool operator()( const BOARD_ITEM* aFirst, const BOARD_ITEM* aSecond ) const;
1259 };
1260
1261public:
1262 // ------------ Run-time caches -------------
1263 mutable std::shared_mutex m_CachesMutex;
1264 std::unordered_map<PTR_PTR_CACHE_KEY, bool> m_IntersectsCourtyardCache;
1265 std::unordered_map<PTR_PTR_CACHE_KEY, bool> m_IntersectsFCourtyardCache;
1266 std::unordered_map<PTR_PTR_CACHE_KEY, bool> m_IntersectsBCourtyardCache;
1267 std::unordered_map<PTR_PTR_LAYER_CACHE_KEY, bool> m_IntersectsAreaCache;
1268 std::unordered_map<PTR_PTR_LAYER_CACHE_KEY, bool> m_EnclosedByAreaCache;
1269 std::unordered_map< wxString, LSET > m_LayerExpressionCache;
1270 std::unordered_map<ZONE*, std::unique_ptr<DRC_RTREE>> m_CopperZoneRTreeCache;
1271 std::shared_ptr<DRC_RTREE> m_CopperItemRTreeCache;
1272 mutable std::unordered_map<const ZONE*, BOX2I> m_ZoneBBoxCache;
1273 mutable std::optional<int> m_maxClearanceValue;
1274
1275 // ------------ DRC caches -------------
1276 std::vector<ZONE*> m_DRCZones;
1277 std::vector<ZONE*> m_DRCCopperZones;
1280 ZONE* m_SolderMaskBridges; // A container to build bridges on solder mask layers
1281 std::map<ZONE*, std::map<PCB_LAYER_ID, ISOLATED_ISLANDS>> m_ZoneIsolatedIslandsMap;
1282
1283private:
1284 // The default copy constructor & operator= are inadequate,
1285 // either write one or do not use it at all
1286 BOARD( const BOARD& aOther ) = delete;
1287
1288 BOARD& operator=( const BOARD& aOther ) = delete;
1289
1290 template <typename Func, typename... Args>
1291 void InvokeListeners( Func&& aFunc, Args&&... args )
1292 {
1293 for( auto&& l : m_listeners )
1294 ( l->*aFunc )( std::forward<Args>( args )... );
1295 }
1296
1297 // Refresh user layer opposites.
1298 void recalcOpposites();
1299
1300 friend class PCB_EDIT_FRAME;
1301
1302private:
1305
1308 int m_timeStamp; // actually a modification counter
1309
1310 wxString m_fileName;
1311
1312 // These containers only have const accessors and must only be modified by Add()/Remove()
1313 MARKERS m_markers;
1314 DRAWINGS m_drawings;
1315 FOOTPRINTS m_footprints;
1316 TRACKS m_tracks;
1317 GROUPS m_groups;
1319 GENERATORS m_generators;
1320
1321 // Cache for fast access to items in the containers above by KIID, including children
1322 std::unordered_map<KIID, BOARD_ITEM*> m_itemByIdCache;
1323
1325
1326 HIGH_LIGHT_INFO m_highLight; // current high light data
1327 HIGH_LIGHT_INFO m_highLightPrevious; // a previously stored high light data
1328
1329 int m_fileFormatVersionAtLoad; // the version loaded from the file
1330 wxString m_generator; // the generator tag from the file
1331
1332 std::map<wxString, wxString> m_properties;
1333 std::shared_ptr<CONNECTIVITY_DATA> m_connectivity;
1334
1336 TITLE_BLOCK m_titles; // text in lower right of screen and plots
1338 PROJECT* m_project; // project this board is a part of
1340
1351 std::unique_ptr<BOARD_DESIGN_SETTINGS> m_designSettings;
1352
1357 bool m_legacyTeardrops = false;
1358
1359 NETINFO_LIST m_NetInfo; // net info list (name, design constraints...
1360
1361 std::vector<BOARD_LISTENER*> m_listeners;
1362};
1363
1364
1365#endif // CLASS_BOARD_H_
BOARD_USE
Flags to specify how the board is being used.
Definition: board.h:278
LAYER_T
The allowed types of layers, same as Specctra DSN spec.
Definition: board.h:151
@ LT_POWER
Definition: board.h:154
@ LT_FRONT
Definition: board.h:158
@ LT_MIXED
Definition: board.h:155
@ LT_BACK
Definition: board.h:159
@ LT_UNDEFINED
Definition: board.h:152
@ LT_JUMPER
Definition: board.h:156
@ LT_AUX
Definition: board.h:157
@ LT_SIGNAL
Definition: board.h:153
std::set< BOARD_ITEM *, CompareByUuid > BOARD_ITEM_SET
Set of BOARD_ITEMs ordered by UUID.
Definition: board.h:272
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:79
wxString GetLayerName() const
Return the name of the PCB layer on which the item resides.
Definition: board_item.cpp:104
virtual void OnBoardNetSettingsChanged(BOARD &aBoard)
Definition: board.h:257
virtual void OnBoardItemsAdded(BOARD &aBoard, std::vector< BOARD_ITEM * > &aBoardItem)
Definition: board.h:254
virtual void OnBoardRatsnestChanged(BOARD &aBoard)
Definition: board.h:261
virtual void OnBoardCompositeUpdate(BOARD &aBoard, std::vector< BOARD_ITEM * > &aAddedItems, std::vector< BOARD_ITEM * > &aRemovedItems, std::vector< BOARD_ITEM * > &aDeletedItems)
Definition: board.h:262
virtual void OnBoardItemsChanged(BOARD &aBoard, std::vector< BOARD_ITEM * > &aBoardItem)
Definition: board.h:259
virtual void OnBoardItemChanged(BOARD &aBoard, BOARD_ITEM *aBoardItem)
Definition: board.h:258
virtual void OnBoardItemRemoved(BOARD &aBoard, BOARD_ITEM *aBoardItem)
Definition: board.h:255
virtual void OnBoardItemAdded(BOARD &aBoard, BOARD_ITEM *aBoardItem)
Definition: board.h:253
virtual void OnBoardHighlightNetChanged(BOARD &aBoard)
Definition: board.h:260
virtual ~BOARD_LISTENER()
Definition: board.h:252
virtual void OnBoardItemsRemoved(BOARD &aBoard, std::vector< BOARD_ITEM * > &aBoardItem)
Definition: board.h:256
Manage layers needed to make a physical board.
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:288
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:1729
ZONE * m_SolderMaskBridges
Definition: board.h:1280
void GetContextualTextVars(wxArrayString *aVars) const
Definition: board.cpp:405
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:860
BOARD_STACKUP GetStackupOrDefault() const
Definition: board.cpp:2245
void SetPlotOptions(const PCB_PLOT_PARAMS &aOptions)
Definition: board.h:678
std::unordered_map< PTR_PTR_LAYER_CACHE_KEY, bool > m_EnclosedByAreaCache
Definition: board.h:1268
std::map< ZONE *, std::map< PCB_LAYER_ID, ISOLATED_ISLANDS > > m_ZoneIsolatedIslandsMap
Definition: board.h:1281
GENERATORS m_generators
Definition: board.h:1319
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:2451
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:2595
const NETINFO_LIST & GetNetInfo() const
Definition: board.h:856
bool m_LegacyDesignSettingsLoaded
True if the legacy board design settings were loaded from a file.
Definition: board.h:371
bool IsFootprintHolder() const
Find out if the board is being used to hold a single footprint for editing/viewing.
Definition: board.h:318
LSET GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
Definition: board.cpp:755
void recalcOpposites()
Definition: board.cpp:664
void SetPosition(const VECTOR2I &aPos) override
Definition: board.cpp:492
std::map< wxString, wxString > m_properties
Definition: board.h:1332
int m_fileFormatVersionAtLoad
Definition: board.h:1329
NETINFO_ITEM * DpCoupledNet(const NETINFO_ITEM *aNet)
Definition: board.cpp:1949
LSET GetVisibleLayers() const
A proxy function that calls the correspondent function in m_BoardSettings.
Definition: board.cpp:769
std::vector< ZONE * > m_DRCCopperZones
Definition: board.h:1277
BOARD_USE GetBoardUse() const
Get what the board use is.
Definition: board.h:307
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Removes an item from the container.
Definition: board.cpp:960
const std::set< int > & GetHighLightNetCodes() const
Definition: board.h:523
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:2541
bool m_legacyTeardrops
Teardrops in 7.0 were applied as a post-processing step (rather than from pad and via properties).
Definition: board.h:1357
TITLE_BLOCK m_titles
Definition: board.h:1336
GAL_SET m_LegacyVisibleItems
Definition: board.h:368
void SetBoardUse(BOARD_USE aUse)
Set what the board is going to be used for.
Definition: board.h:300
ZONE * GetArea(int index) const
Return the Zone at a given index.
Definition: board.h:1013
const BOX2I GetBoardEdgesBoundingBox() const
Return the board bounding box calculated using exclusively the board edges (graphics on Edge....
Definition: board.h:914
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: board.h:900
void BuildListOfNets()
Definition: board.h:819
PAD * GetPadFast(const VECTOR2I &aPosition, LSET aLayerMask) const
Return pad found at aPosition on aLayerMask using the fast search method.
Definition: board.cpp:2103
LAYER m_layers[PCB_LAYER_ID_COUNT]
Definition: board.h:1324
const GENERATORS & Generators() const
Definition: board.h:335
void SetFileName(const wxString &aFileName)
Definition: board.h:323
static wxString GetStandardLayerName(PCB_LAYER_ID aLayerId)
Return an "English Standard" name of a PCB layer when given aLayerNumber.
Definition: board.h:771
const std::vector< BOARD_CONNECTED_ITEM * > AllConnectedItems()
Definition: board.cpp:2515
bool IsElementVisible(GAL_LAYER_ID aLayer) const
Test whether a given element category is visible.
Definition: board.cpp:821
int m_outlinesChainingEpsilon
the max distance between 2 end point to see them connected when building the board outlines
Definition: board.h:1304
std::set< wxString > GetNetClassAssignmentCandidates() const
Return the set of netname candidates for netclass assignment.
Definition: board.cpp:1988
BOARD_USE m_boardUse
What is this board being used for.
Definition: board.h:1307
PAGE_INFO m_paper
Definition: board.h:1335
void RemoveAllListeners()
Remove all listeners.
Definition: board.cpp:2589
FOOTPRINTS m_footprints
Definition: board.h:1315
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:1351
void SetEnabledLayers(LSET aLayerMask)
A proxy function that calls the correspondent function in m_BoardSettings.
Definition: board.cpp:775
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:2570
const PAGE_INFO & GetPageSettings() const
Definition: board.h:674
void UpdateUserUnits(BOARD_ITEM *aItem, KIGFX::VIEW *aView)
Update any references within aItem (or its descendants) to the user units.
Definition: board.cpp:1291
void SetProperties(const std::map< wxString, wxString > &aProps)
Definition: board.h:361
BOARD(const BOARD &aOther)=delete
GAL_SET GetVisibleElements() const
Return a set of all the element categories that are visible.
Definition: board.cpp:815
void SetHighLightNet(int aNetCode, bool aMulti=false)
Select the netcode to be highlighted.
Definition: board.cpp:2631
HIGH_LIGHT_INFO m_highLight
Definition: board.h:1326
bool SetLayerDescr(PCB_LAYER_ID aIndex, const LAYER &aLayer)
Return the type of the copper layer given by aLayer.
Definition: board.cpp:540
NETINFO_ITEM * FindNet(int aNetcode) const
Search for a net with the given netcode.
Definition: board.cpp:1878
EDA_UNITS m_userUnits
Definition: board.h:1339
BOARD_ITEM * GetItem(const KIID &aID) const
Definition: board.cpp:1368
const ZONES & Zones() const
Definition: board.h:333
BOX2I ComputeBoundingBox(bool aBoardEdgesOnly=false, bool aIncludeHiddenText=false) const
Calculate the bounding box containing all board items (or board edge segments).
Definition: board.cpp:1630
void InvokeListeners(Func &&aFunc, Args &&... args)
Definition: board.h:1291
void SanitizeNetcodes()
Definition: board.cpp:2560
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:2426
const GROUPS & Groups() const
The groups must maintain the following invariants.
Definition: board.h:356
~BOARD()
Definition: board.cpp:141
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:184
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:781
LAYER_T GetLayerType(PCB_LAYER_ID aLayer) const
Return the type of the copper layer given by aLayer.
Definition: board.cpp:608
void RecordDRCExclusions()
Scan existing markers and record data from any that are Excluded.
Definition: board.cpp:325
DRAWINGS m_drawings
Definition: board.h:1314
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:2607
int SetAreasNetCodesFromNetNames()
Set the .m_NetCode member of all copper areas, according to the area Net Name The SetNetCodesFromNetN...
Definition: board.cpp:2039
void SynchronizeNetsAndNetClasses(bool aResetTrackAndViaSizes)
Copy NETCLASS info to each NET, based on NET membership in a NETCLASS.
Definition: board.cpp:2011
EDA_UNITS GetUserUnits()
Definition: board.h:686
void ResetNetHighLight()
Reset all high light data to the init state.
Definition: board.cpp:2622
PCB_PLOT_PARAMS m_plotOptions
Definition: board.h:1337
bool SetLayerName(PCB_LAYER_ID aLayer, const wxString &aLayerName)
Changes the name of the layer given by aLayer.
Definition: board.cpp:589
std::list< ZONE * > GetZoneList(bool aIncludeZonesInFootprints=false) const
Definition: board.cpp:2406
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:2824
bool ResolveTextVar(wxString *token, int aDepth) const
Definition: board.cpp:429
const MARKERS & Markers() const
Definition: board.h:337
FOOTPRINT * GetFirstFootprint() const
Get the first footprint on the board or nullptr.
Definition: board.h:439
PCB_LAYER_ID FlipLayer(PCB_LAYER_ID aLayer) const
Definition: board.cpp:725
const std::vector< PAD * > GetPads() const
Return a reference to a list of all the pads.
Definition: board.cpp:2501
void Move(const VECTOR2I &aMoveVector) override
Move this object.
Definition: board.cpp:498
TITLE_BLOCK & GetTitleBlock()
Definition: board.h:680
int GetMaxClearanceValue() const
Returns the maximum clearance value for any object on the board.
Definition: board.cpp:878
ZONES m_zones
Definition: board.h:1318
PAD * GetPad(const VECTOR2I &aPosition) const
Definition: board.h:1068
PCB_LAYER_ID GetLayerID(const wxString &aLayerName) const
Return the ID of a layer.
Definition: board.cpp:553
HIGH_LIGHT_INFO m_highLightPrevious
Definition: board.h:1327
const VECTOR2I GetFocusPosition() const override
Similar to GetPosition, but allows items to return their visual center rather than their anchor.
Definition: board.h:382
void HighLightOFF()
Disable net highlight.
Definition: board.h:553
NETINFO_LIST m_NetInfo
Definition: board.h:1359
LSET m_LegacyVisibleLayers
Visibility settings stored in board prior to 6.0, only used for loading legacy files.
Definition: board.h:367
void SetVisibleAlls()
Change the bit-mask of visible element categories and layers.
Definition: board.cpp:804
void SetOutlinesChainingEpsilon(int aValue)
Definition: board.h:725
NETINFO_LIST::iterator EndNets() const
Definition: board.h:878
GroupLegalOpsField GroupLegalOps(const PCB_SELECTION &selection) const
Check which selection tool group operations are legal given the selection.
Definition: board.cpp:2736
int GetCopperLayerCount() const
Definition: board.cpp:731
int m_timeStamp
Definition: board.h:1308
std::vector< BOARD_LISTENER * > m_listeners
Definition: board.h:1361
const std::map< wxString, wxString > & GetProperties() const
Definition: board.h:360
std::unordered_map< PTR_PTR_CACHE_KEY, bool > m_IntersectsCourtyardCache
Definition: board.h:1264
void IncrementTimeStamp()
Definition: board.cpp:253
int MatchDpSuffix(const wxString &aNetName, wxString &aComplementNet)
Fetch the coupled netname for a given net.
Definition: board.cpp:1899
std::unordered_map< PTR_PTR_CACHE_KEY, bool > m_IntersectsFCourtyardCache
Definition: board.h:1265
void RemoveUnusedNets(BOARD_COMMIT *aCommit)
Definition: board.h:861
const FOOTPRINTS & Footprints() const
Definition: board.h:329
std::shared_ptr< CONNECTIVITY_DATA > m_connectivity
Definition: board.h:1333
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:1204
const BOARD_ITEM_SET GetItemSet()
Definition: board.cpp:2925
const TRACKS & Tracks() const
Definition: board.h:327
int m_DRCMaxPhysicalClearance
Definition: board.h:1279
FOOTPRINT * FindFootprintByPath(const KIID_PATH &aPath) const
Search for a FOOTPRINT within this board with the given path.
Definition: board.cpp:1976
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:1092
void SetPageSettings(const PAGE_INFO &aPageSettings)
Definition: board.h:675
std::unordered_map< wxString, LSET > m_LayerExpressionCache
Definition: board.h:1269
wxString GroupsSanityCheckInternal(bool repair)
Definition: board.cpp:2667
void OnRatsnestChanged()
Notify the board and its listeners that the ratsnest has been recomputed.
Definition: board.cpp:2616
wxString ConvertCrossReferencesToKIIDs(const wxString &aSource) const
Convert cross-references back and forth between ${refDes:field} and ${kiid:field}.
Definition: board.cpp:1511
wxString GetClass() const override
Return the class name.
Definition: board.h:982
void SetVisibleLayers(LSET aLayerMask)
A proxy function that calls the correspondent function in m_BoardSettings changes the bit-mask of vis...
Definition: board.cpp:787
NETINFO_LIST::iterator BeginNets() const
Definition: board.h:870
bool m_LegacyNetclassesLoaded
True if netclasses were loaded from the file.
Definition: board.h:375
void SetCopperLayerCount(int aCount)
Definition: board.cpp:737
std::unordered_map< const ZONE *, BOX2I > m_ZoneBBoxCache
Definition: board.h:1272
wxString m_generator
Definition: board.h:1330
std::unordered_map< PTR_PTR_CACHE_KEY, bool > m_IntersectsBCourtyardCache
Definition: board.h:1266
TRACKS TracksInNet(int aNetCode)
Collect all the TRACKs and VIAs that are members of a net given by aNetCode.
Definition: board.cpp:518
void SetProject(PROJECT *aProject, bool aReferenceOnly=false)
Link a board to a given project.
Definition: board.cpp:194
PROJECT * m_project
Definition: board.h:1338
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:2342
const wxString & GetFileName() const
Definition: board.h:325
bool operator==(const BOARD_ITEM &aOther) const override
Definition: board.cpp:2940
std::vector< PCB_MARKER * > ResolveDRCExclusions(bool aCreateMarkers)
Rebuild DRC markers from the serialized data in BOARD_DESIGN_SETTINGS.
Definition: board.cpp:342
FOOTPRINT * FindFootprintByReference(const wxString &aReference) const
Search for a FOOTPRINT within this board with the given reference designator.
Definition: board.cpp:1964
unsigned GetNodesCount(int aNet=-1) const
Definition: board.cpp:1613
bool IsHighLightNetON() const
Definition: board.h:539
void FillItemMap(std::map< KIID, EDA_ITEM * > &aMap)
Definition: board.cpp:1472
int GetFileFormatVersionAtLoad() const
Definition: board.h:392
void SetElementVisibility(GAL_LAYER_ID aLayer, bool aNewState)
Change the visibility of an element category.
Definition: board.cpp:827
std::shared_ptr< DRC_RTREE > m_CopperItemRTreeCache
Definition: board.h:1271
bool SetLayerType(PCB_LAYER_ID aLayer, LAYER_T aLayerType)
Change the type of the layer given by aLayer.
Definition: board.cpp:622
const PCB_PLOT_PARAMS & GetPlotOptions() const
Definition: board.h:677
BOARD & operator=(const BOARD &aOther)=delete
wxString m_fileName
Definition: board.h:1310
const wxString & GetGenerator() const
Adds an item to the container.
Definition: board.h:395
int GetAreaCount() const
Definition: board.h:1029
void SetLegacyTeardrops(bool aFlag)
Definition: board.h:1247
int GetOutlinesChainingEpsilon()
Definition: board.h:724
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:2230
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:761
int m_DRCMaxClearance
Definition: board.h:1278
void ClearProject()
Definition: board.cpp:233
std::unordered_map< ZONE *, std::unique_ptr< DRC_RTREE > > m_CopperZoneRTreeCache
Definition: board.h:1270
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:1086
int LayerDepth(PCB_LAYER_ID aStartLayer, PCB_LAYER_ID aEndLayer) const
Definition: board.cpp:743
void DeleteAllFootprints()
Remove all footprints from the deque and free the memory associated with them.
Definition: board.cpp:1355
PROJECT * GetProject() const
Definition: board.h:482
bool IsEmpty() const
Definition: board.h:384
bool LegacyTeardrops() const
Definition: board.h:1246
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:2256
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:1691
const TITLE_BLOCK & GetTitleBlock() const
Definition: board.h:681
wxString GroupsSanityCheck(bool repair=false)
Consistency check of internal m_groups structure.
Definition: board.cpp:2654
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.cpp:872
std::vector< ZONE * > m_DRCZones
Definition: board.h:1276
PAD * GetPad(const VECTOR2I &aPosition, LSET aLayerMask) const
Find a pad aPosition on aLayer.
Definition: board.cpp:2073
void SetGenerator(const wxString &aGenerator)
Definition: board.h:394
BOARD()
Definition: board.cpp:74
void UpdateRatsnestExclusions()
Update the visibility flags on the current unconnected ratsnest lines.
Definition: board.cpp:294
wxString ConvertKIIDsToCrossReferences(const wxString &aSource) const
Definition: board.cpp:1565
void SynchronizeProperties()
Copy the current project's text variables into the boards property cache.
Definition: board.cpp:2002
std::unordered_map< KIID, BOARD_ITEM * > m_itemByIdCache
Definition: board.h:1322
void RemoveListener(BOARD_LISTENER *aListener)
Remove the specified listener.
Definition: board.cpp:2577
std::shared_mutex m_CachesMutex
Definition: board.h:1263
unsigned GetNetCount() const
Definition: board.h:887
void DeleteMARKERs()
Delete all MARKERS from the board.
Definition: board.cpp:1317
void Remove(BOARD_ITEM *aBoardItem, REMOVE_MODE aMode=REMOVE_MODE::NORMAL) override
Removes an item from the container.
Definition: board.cpp:1098
GROUPS m_groups
Definition: board.h:1317
MARKERS m_markers
Definition: board.h:1313
std::unordered_map< PTR_PTR_LAYER_CACHE_KEY, bool > m_IntersectsAreaCache
Definition: board.h:1267
std::optional< int > m_maxClearanceValue
Definition: board.h:1273
void HighLightON(bool aValue=true)
Enable or disable net highlighting.
Definition: board.cpp:2644
void SetTitleBlock(const TITLE_BLOCK &aTitleBlock)
Definition: board.h:682
bool TestZoneIntersection(ZONE *aZone1, ZONE *aZone2)
Test for intersection of 2 copper areas.
TRACKS m_tracks
Definition: board.h:1316
bool m_LegacyCopperEdgeClearanceLoaded
Definition: board.h:372
int GetTimeStamp() const
Definition: board.h:311
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:2601
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
Definition: board.h:466
VECTOR2I GetPosition() const override
Definition: board.cpp:486
void CacheTriangulation(PROGRESS_REPORTER *aReporter=nullptr, const std::vector< ZONE * > &aZones={})
Definition: board.cpp:910
static bool ClassOf(const EDA_ITEM *aItem)
Definition: board.h:290
void SetUserUnits(EDA_UNITS aUnits)
Definition: board.h:687
void SetVisibleElements(const GAL_SET &aMask)
A proxy function that calls the correspondent function in m_BoardSettings.
Definition: board.cpp:794
double Similarity(const BOARD_ITEM &aOther) const override
Return the Similarity.
Definition: board.h:975
const DRAWINGS & Drawings() const
Definition: board.h:331
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
Definition: board.cpp:1285
void SetFileFormatVersionAtLoad(int aVersion)
Definition: board.h:391
const Vec GetCenter() const
Definition: box2.h:220
Store all of the related footprint information found in a netlist.
Definition: pcb_netlist.h:86
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:88
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:100
Helper for storing and iterating over GAL_LAYER_IDs.
Definition: layer_ids.h:308
void Clear()
Definition: board.h:227
HIGH_LIGHT_INFO()
Definition: board.h:233
std::set< int > m_netCodes
Definition: board.h:224
bool m_highLightOn
Definition: board.h:225
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:37
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:223
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:62
A pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:71
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:81
EDA_UNITS
Definition: eda_units.h:46
static void hash_combine(std::size_t &seed)
This is a dummy function to take the final case of hash_combine below.
Definition: hash.h:34
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:194
@ LAYER_HIDDEN_TEXT
text marked as invisible
Definition: layer_ids.h:204
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:60
@ PCB_LAYER_ID_COUNT
Definition: layer_ids.h:137
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:2784
bool operator()(const BOARD_ITEM *aFirst, const BOARD_ITEM *aSecond) const
Definition: board.cpp:2763
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:167
int m_opposite
Similar layer on opposite side of the board, if any.
Definition: board.h:199
static LAYER_T ParseType(const char *aType)
Convert a string to a LAYER_T.
Definition: board.cpp:651
void clear()
Definition: board.h:173
LAYER_T m_type
The type of the layer.
Definition: board.h:196
static const char * ShowType(LAYER_T aType)
Convert a LAYER_T enum to a string representation of the layer type.
Definition: board.cpp:635
LAYER()
Definition: board.h:168
wxString m_name
The canonical name of the layer.
Definition: board.h:194
wxString m_userName
The user defined name of the layer.
Definition: board.h:195
bool m_visible
Definition: board.h:197
int m_number
The layer ID.
Definition: board.h:198
BOARD_ITEM * A
Definition: board.h:89
bool operator==(const PTR_LAYER_CACHE_KEY &other) const
Definition: board.h:92
PCB_LAYER_ID Layer
Definition: board.h:90
BOARD_ITEM * A
Definition: board.h:78
BOARD_ITEM * B
Definition: board.h:79
bool operator==(const PTR_PTR_CACHE_KEY &other) const
Definition: board.h:81
bool operator==(const PTR_PTR_LAYER_CACHE_KEY &other) const
Definition: board.h:104
BOARD_ITEM * B
Definition: board.h:101
BOARD_ITEM * A
Definition: board.h:100
PCB_LAYER_ID Layer
Definition: board.h:102
std::size_t operator()(const PTR_LAYER_CACHE_KEY &k) const
Definition: board.h:126
std::size_t operator()(const PTR_PTR_CACHE_KEY &k) const
Definition: board.h:115
std::size_t operator()(const PTR_PTR_LAYER_CACHE_KEY &k) const
Definition: board.h:137
@ 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