KiCad PCB EDA Suite
class_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, jaen-pierre.charras@gipsa-lab.inpg.com
5  * Copyright (C) 1992-2017 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 
28 #include <tuple>
29 #include <core/iterators.h>
30 #include <board_design_settings.h>
31 #include <board_item_container.h>
32 #include <class_module.h>
33 #include <class_pad.h>
34 #include <pcb_general_settings.h>
35 #include <common.h> // PAGE_INFO
36 #include <eda_rect.h>
38 #include <netinfo.h>
39 #include <pcb_plot_params.h>
40 #include <title_block.h>
41 #include <zone_settings.h>
42 
43 #include <memory>
44 
45 using std::unique_ptr;
46 
47 class PCB_BASE_FRAME;
48 class PCB_EDIT_FRAME;
49 class PICKED_ITEMS_LIST;
50 class BOARD;
51 class ZONE_CONTAINER;
52 class TRACK;
53 class D_PAD;
54 class MARKER_PCB;
55 class MSG_PANEL_ITEM;
56 class NETLIST;
57 class REPORTER;
58 class SHAPE_POLY_SET;
59 class CONNECTIVITY_DATA;
60 class COMPONENT;
61 
66 enum LAYER_T
67 {
73 };
74 
75 
80 struct LAYER
81 {
83  {
84  clear();
85  }
86 
87  void clear()
88  {
89  m_type = LT_SIGNAL;
90  m_visible = true;
91  m_number = 0;
92  m_name.clear();
93  }
94 
95  /*
96  LAYER( const wxString& aName = wxEmptyString,
97  LAYER_T aType = LT_SIGNAL, bool aVisible = true, int aNumber = -1 ) :
98  m_name( aName ),
99  m_type( aType ),
100  m_visible( aVisible ),
101  m_number( aNumber )
102  {
103  }
104  */
105 
106  wxString m_name;
108  bool m_visible;
109  int m_number;
110 
117  static const char* ShowType( LAYER_T aType );
118 
126  static LAYER_T ParseType( const char* aType );
127 };
128 
129 
130 // Helper class to handle high light nets
132 {
133  friend class BOARD;
134 
135 protected:
136  int m_netCode; // net selected for highlight (-1 when no net selected )
137  bool m_highLightOn; // highlight active
138 
139  void Clear()
140  {
141  m_netCode = -1;
142  m_highLightOn = false;
143  }
144 
146  {
147  Clear();
148  }
149 };
150 
151 
152 DECL_VEC_FOR_SWIG( MARKERS, MARKER_PCB* )
153 DECL_VEC_FOR_SWIG( ZONE_CONTAINERS, ZONE_CONTAINER* )
154 DECL_DEQ_FOR_SWIG( TRACKS, TRACK* )
155 
156 
157 
162 {
163  friend class PCB_EDIT_FRAME;
164 
165 private:
167  wxString m_fileName;
168 
170  MARKERS m_markers;
171 
173  DRAWINGS m_drawings;
174 
176  MODULES m_modules;
177 
179  TRACKS m_tracks;
180 
182  ZONE_CONTAINERS m_ZoneDescriptorList;
183 
185 
186  // if true m_highLight_NetCode is used
187  HIGH_LIGHT_INFO m_highLight; // current high light data
188  HIGH_LIGHT_INFO m_highLightPrevious; // a previously stored high light data
189 
191 
192  std::shared_ptr<CONNECTIVITY_DATA> m_connectivity;
193 
201 
202 
203  // The default copy constructor & operator= are inadequate,
204  // either write one or do not use it at all
205  BOARD( const BOARD& aOther ) :
206  BOARD_ITEM_CONTAINER( aOther ), m_NetInfo( this )
207  {
208  assert( false );
209  }
210 
211  BOARD& operator=( const BOARD& aOther )
212  {
213  assert( false );
214  return *this; // just to mute warning
215  }
216 
217 public:
218  static inline bool ClassOf( const EDA_ITEM* aItem )
219  {
220  return aItem && PCB_T == aItem->Type();
221  }
222 
223  void SetFileName( const wxString& aFileName ) { m_fileName = aFileName; }
224 
225  const wxString &GetFileName() const { return m_fileName; }
226 
227  TRACKS& Tracks()
228  {
229  return m_tracks;
230  }
231  const TRACKS& Tracks() const
232  {
233  return m_tracks;
234  }
235 
236  MODULES& Modules()
237  {
238  return m_modules;
239  }
240  const MODULES& Modules() const
241  {
242  return m_modules;
243  }
244 
245  DRAWINGS& Drawings()
246  {
247  return m_drawings;
248  }
249 
250  ZONE_CONTAINERS& Zones()
251  {
252  return m_ZoneDescriptorList;
253  }
254 
255  const std::vector<BOARD_CONNECTED_ITEM*> AllConnectedItems();
256 
259 
260  BOARD();
261  ~BOARD();
262 
263  const wxPoint GetPosition() const override;
264  void SetPosition( const wxPoint& aPos ) override;
265 
266  bool IsEmpty() const
267  {
268  return m_drawings.empty() && m_modules.empty() && m_tracks.empty() &&
269  m_ZoneDescriptorList.empty();
270  }
271 
272  void Move( const wxPoint& aMoveVector ) override;
273 
274  void SetFileFormatVersionAtLoad( int aVersion ) { m_fileFormatVersionAtLoad = aVersion; }
275  int GetFileFormatVersionAtLoad() const { return m_fileFormatVersionAtLoad; }
276 
277  void Add( BOARD_ITEM* aItem, ADD_MODE aMode = ADD_INSERT ) override;
278 
279  void Remove( BOARD_ITEM* aBoardItem ) override;
280 
286  {
287  return m_modules.empty() ? nullptr : m_modules.front();
288  }
289 
294  {
295  for( MODULE* mod : m_modules )
296  delete mod;
297 
298  m_modules.clear();
299  }
300 
301  BOARD_ITEM* GetItem( void* aWeakReference );
302 
303  BOARD_ITEM* Duplicate( const BOARD_ITEM* aItem, bool aAddToBoard = false );
304 
310  std::shared_ptr<CONNECTIVITY_DATA> GetConnectivity() const
311  {
312  return m_connectivity;
313  }
314 
320  void BuildConnectivity();
321 
322 
327  void DeleteMARKERs();
328 
333  void DeleteZONEOutlines();
334 
341  MARKER_PCB* GetMARKER( int index ) const
342  {
343  if( (unsigned) index < m_markers.size() )
344  return m_markers[index];
345 
346  return NULL;
347  }
348 
353  int GetMARKERCount() const
354  {
355  return (int) m_markers.size();
356  }
357 
362  void SetAuxOrigin( const wxPoint& aPoint ) { m_designSettings.m_AuxOrigin = aPoint; }
363  const wxPoint& GetAuxOrigin() const { return m_designSettings.m_AuxOrigin; }
364 
369  void SetGridOrigin( const wxPoint& aPoint ) { m_designSettings.m_GridOrigin = aPoint; }
370  const wxPoint& GetGridOrigin() const { return m_designSettings.m_GridOrigin; }
371 
377  {
378  m_highLight.Clear();
379  m_highLightPrevious.Clear();
380  }
381 
386  int GetHighLightNetCode() const { return m_highLight.m_netCode; }
387 
392  void SetHighLightNet( int aNetCode)
393  {
394  m_highLight.m_netCode = aNetCode;
395  }
396 
401  bool IsHighLightNetON() const { return m_highLight.m_highLightOn; }
402 
407  void HighLightOFF() { m_highLight.m_highLightOn = false; }
408 
414  void HighLightON() { m_highLight.m_highLightOn = true; }
415 
420  int GetCopperLayerCount() const;
421 
422  void SetCopperLayerCount( int aCount );
423 
430  LSET GetEnabledLayers() const;
431 
438  void SetEnabledLayers( LSET aLayerMask );
439 
447  bool IsLayerEnabled( PCB_LAYER_ID aLayer ) const
448  {
449  return m_designSettings.IsLayerEnabled( aLayer );
450  }
451 
459  bool IsLayerVisible( PCB_LAYER_ID aLayer ) const
460  {
461  return m_designSettings.IsLayerVisible( aLayer );
462  }
463 
470  LSET GetVisibleLayers() const;
471 
478  void SetVisibleLayers( LSET aLayerMask );
479 
480  // these 2 functions are not tidy at this time, since there are PCB_LAYER_IDs that
481  // are not stored in the bitmap.
482 
490  int GetVisibleElements() const;
491 
499  void SetVisibleElements( int aMask );
500 
506  void SetVisibleAlls();
507 
516  bool IsElementVisible( GAL_LAYER_ID aLayer ) const;
517 
525  void SetElementVisibility( GAL_LAYER_ID aLayer, bool aNewState );
526 
534  bool IsModuleLayerVisible( PCB_LAYER_ID aLayer );
535 
541  {
542  // remove const-ness with cast.
543  return (BOARD_DESIGN_SETTINGS&) m_designSettings;
544  }
545 
550  void SetDesignSettings( const BOARD_DESIGN_SETTINGS& aDesignSettings )
551  {
552  m_designSettings = aDesignSettings;
553  }
554 
555  const PAGE_INFO& GetPageSettings() const { return m_paper; }
556  void SetPageSettings( const PAGE_INFO& aPageSettings ) { m_paper = aPageSettings; }
557 
558  const PCB_PLOT_PARAMS& GetPlotOptions() const { return m_plotOptions; }
559  void SetPlotOptions( const PCB_PLOT_PARAMS& aOptions ) { m_plotOptions = aOptions; }
560 
561  TITLE_BLOCK& GetTitleBlock() { return m_titles; }
562  void SetTitleBlock( const TITLE_BLOCK& aTitleBlock ) { m_titles = aTitleBlock; }
563 
564  const ZONE_SETTINGS& GetZoneSettings() const { return m_zoneSettings; }
565  void SetZoneSettings( const ZONE_SETTINGS& aSettings ) { m_zoneSettings = aSettings; }
566 
567  wxString GetSelectMenuText( EDA_UNITS_T aUnits ) const override;
568 
573  const COLORS_DESIGN_SETTINGS& Colors() const { return m_generalSettings->Colors(); }
574 
575  const PCB_GENERAL_SETTINGS& GeneralSettings() const { return *m_generalSettings; }
576 
577  void SetGeneralSettings( PCB_GENERAL_SETTINGS* aGeneralSettings )
578  {
579  m_generalSettings = aGeneralSettings;
580  }
581 
597  bool GetBoardPolygonOutlines( SHAPE_POLY_SET& aOutlines,
598  wxString* aErrorText = nullptr, wxPoint* aErrorLocation = nullptr );
599 
611  void ConvertBrdLayerToPolygonalContours( PCB_LAYER_ID aLayer, SHAPE_POLY_SET& aOutlines );
612 
623  const PCB_LAYER_ID GetLayerID( const wxString& aLayerName ) const;
624 
635  const wxString GetLayerName( PCB_LAYER_ID aLayer ) const;
636 
646  bool SetLayerName( PCB_LAYER_ID aLayer, const wxString& aLayerName );
647 
659  static wxString GetStandardLayerName( PCB_LAYER_ID aLayerId )
660  {
661  // a BOARD's standard layer name is the PCB_LAYER_ID fixed name
662  return LSET::Name( aLayerId );
663  }
664 
673  bool SetLayerDescr( PCB_LAYER_ID aIndex, const LAYER& aLayer );
674 
683  LAYER_T GetLayerType( PCB_LAYER_ID aLayer ) const;
684 
693  bool SetLayerType( PCB_LAYER_ID aLayer, LAYER_T aLayerType );
694 
700  unsigned GetNodesCount( int aNet = -1 );
701 
706  unsigned GetUnconnectedNetCount() const;
707 
712  unsigned GetPadCount();
713 
718  D_PAD* GetPad( unsigned aIndex ) const;
719 
727  const std::vector<D_PAD*> GetPads();
728 
730  {
731  m_NetInfo.buildListOfNets();
732  }
733 
740  NETINFO_ITEM* FindNet( int aNetcode ) const;
741 
748  NETINFO_ITEM* FindNet( const wxString& aNetname ) const;
749 
751  {
752  return m_NetInfo;
753  }
754 
755 #ifndef SWIG
756 
761  {
762  return m_NetInfo.begin();
763  }
764 
770  {
771  return m_NetInfo.end();
772  }
773 #endif
774 
779  unsigned GetNetCount() const
780  {
781  return m_NetInfo.GetNetCount();
782  }
783 
790  EDA_RECT ComputeBoundingBox( bool aBoardEdgesOnly = false ) const;
791 
792  const EDA_RECT GetBoundingBox() const override
793  {
794  return ComputeBoundingBox( false );
795  }
796 
805  {
806  return ComputeBoundingBox( true );
807  }
808 
809  void GetMsgPanelInfo( EDA_UNITS_T aUnits, std::vector< MSG_PANEL_ITEM >& aList ) override;
810 
819  void Print( PCB_BASE_FRAME* aFrame, wxDC* aDC, const wxPoint& aOffset = ZeroOffset ) override;
820 
834  SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
835 
845  MODULE* FindModuleByReference( const wxString& aReference ) const;
846 
856  MODULE* FindModule( const wxString& aRefOrTimeStamp, bool aSearchByTimeStamp = false ) const;
857 
865  int SortedNetnamesList( wxArrayString& aNames, bool aSortbyPadsCount );
866 
874  void SynchronizeNetsAndNetClasses();
875 
876  /***************************************************************************/
877 
878  wxString GetClass() const override
879  {
880  return wxT( "BOARD" );
881  }
882 
883 #if defined(DEBUG)
884  void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
885 #endif
886 
887 
888  /*************************/
889  /* Copper Areas handling */
890  /*************************/
891 
903  ZONE_CONTAINER* HitTestForAnyFilledArea( const wxPoint& aRefPos,
904  PCB_LAYER_ID aStartLayer,
905  PCB_LAYER_ID aEndLayer,
906  int aNetCode );
907 
918  int SetAreasNetCodesFromNetNames( void );
919 
926  ZONE_CONTAINER* GetArea( int index ) const
927  {
928  if( (unsigned) index < m_ZoneDescriptorList.size() )
929  return m_ZoneDescriptorList[index];
930 
931  return NULL;
932  }
933 
940  int GetAreaIndex( const ZONE_CONTAINER* aArea ) const
941  {
942  for( int ii = 0; ii < GetAreaCount(); ii++ ) // Search for aArea in list
943  {
944  if( aArea == GetArea( ii ) ) // Found !
945  return ii;
946  }
947 
948  return -1;
949  }
950 
955  int GetAreaCount() const
956  {
957  return (int) m_ZoneDescriptorList.size();
958  }
959 
960  /* Functions used in test, merge and cut outlines */
961 
973  ZONE_CONTAINER* AddArea( PICKED_ITEMS_LIST* aNewZonesList, int aNetcode,
974  PCB_LAYER_ID aLayer, wxPoint aStartPointPosition, int aHatch );
975 
986  ZONE_CONTAINER* InsertArea( int aNetcode, int aAreaIdx, PCB_LAYER_ID aLayer,
987  int aCornerX, int aCornerY, int aHatch );
988 
998  bool NormalizeAreaPolygon( PICKED_ITEMS_LIST* aNewZonesList, ZONE_CONTAINER* aCurrArea );
999 
1010  bool OnAreaPolygonModified( PICKED_ITEMS_LIST* aModifiedZonesList,
1011  ZONE_CONTAINER* modified_area );
1012 
1023  bool CombineAllAreasInNet( PICKED_ITEMS_LIST* aDeletedList,
1024  int aNetCode,
1025  bool aUseLocalFlags );
1026 
1034  void RemoveArea( PICKED_ITEMS_LIST* aDeletedList, ZONE_CONTAINER* area_to_remove );
1035 
1041  bool TestAreaIntersections( ZONE_CONTAINER* area_to_test );
1042 
1051  bool TestAreaIntersection( ZONE_CONTAINER* area_ref, ZONE_CONTAINER* area_to_test );
1052 
1064  bool CombineAreas( PICKED_ITEMS_LIST* aDeletedList,
1065  ZONE_CONTAINER* area_ref,
1066  ZONE_CONTAINER* area_to_combine );
1067 
1076  D_PAD* GetPad( const wxPoint& aPosition, LSET aLayerMask );
1077  D_PAD* GetPad( const wxPoint& aPosition )
1078  {
1079  return GetPad( aPosition, LSET().set() );
1080  }
1081 
1090  D_PAD* GetPad( TRACK* aTrace, ENDPOINT_T aEndPoint );
1091 
1102  D_PAD* GetPadFast( const wxPoint& aPosition, LSET aLayerMask );
1103 
1119  D_PAD* GetPad( std::vector<D_PAD*>& aPadList, const wxPoint& aPosition, LSET aLayerMask );
1120 
1127  void PadDelete( D_PAD* aPad );
1128 
1141  void GetSortedPadListByXthenYCoord( std::vector<D_PAD*>& aVector, int aNetCode = -1 );
1142 
1150  std::tuple<int, double, double> GetTrackLength( const TRACK& aTrack ) const;
1151 
1159  TRACKS TracksInNet( int aNetCode );
1160 
1175  MODULE* GetFootprint( const wxPoint& aPosition, PCB_LAYER_ID aActiveLayer,
1176  bool aVisibleOnly, bool aIgnoreLocked = false );
1177 
1182  void ClearAllNetCodes();
1183 
1184  void SanitizeNetcodes();
1185 };
1186 
1187 #endif // CLASS_BOARD_H_
MODULES m_modules
MODULES for components on the board, owned by pointer.
Definition: class_board.h:176
iterator end() const
Definition: netinfo.h:531
Wrapper class, so you can iterate through NETINFO_ITEM*s, not std::pair<int/wxString,...
Definition: netinfo.h:480
void SetFileFormatVersionAtLoad(int aVersion)
Definition: class_board.h:274
D_PAD * GetPad(const wxPoint &aPosition)
Definition: class_board.h:1077
void BuildListOfNets()
Definition: class_board.h:729
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
Definition: class_board.h:792
Class ZONE_CONTAINER handles a list of polygons defining a copper zone.
Definition: class_zone.h:57
void SetZoneSettings(const ZONE_SETTINGS &aSettings)
Definition: class_board.h:565
const PAGE_INFO & GetPageSettings() const
Definition: class_board.h:555
void SetElementVisibility(GAL_LAYER_ID aElement, bool aNewState)
Function SetElementVisibility changes the visibility of an element category.
static bool ClassOf(const EDA_ITEM *aItem)
Definition: class_board.h:218
const PCB_PLOT_PARAMS & GetPlotOptions() const
Definition: class_board.h:558
Definition: typeinfo.h:85
int GetMARKERCount() const
Function GetMARKERCount.
Definition: class_board.h:353
wxPoint m_GridOrigin
origin for grid offsets
void SetGridOrigin(const wxPoint &aPoint)
Function SetGridOrigin sets the origin point of the grid.
Definition: class_board.h:369
BOARD(const BOARD &aOther)
Definition: class_board.h:205
wxString m_name
The name of the layer, there should be no spaces in this name.
Definition: class_board.h:106
wxString m_fileName
the board filename
Definition: class_board.h:167
void SetPosition(wxString aStr, const wxString &aDefaultMeasurementUnit, int *aX, int *aY, const wxString &aActualConversion)
Class BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
bool IsLayerEnabled(PCB_LAYER_ID aLayerId) const
Function IsLayerEnabled tests whether a given layer is enabled.
void SetTitleBlock(const TITLE_BLOCK &aTitleBlock)
Definition: class_board.h:562
PAGE_INFO m_paper
Definition: class_board.h:197
const EDA_RECT GetBoardEdgesBoundingBox() const
Function GetBoardEdgesBoundingBox Returns the board bounding box calculated using exclusively the boa...
Definition: class_board.h:804
bool IsHighLightNetON() const
Function IsHighLightNetON.
Definition: class_board.h:401
void SetPageSettings(const PAGE_INFO &aPageSettings)
Definition: class_board.h:556
LAYER_T m_type
The type of the layer.
Definition: class_board.h:107
NETINFO_LIST::iterator EndNets() const
Function EndNets.
Definition: class_board.h:769
ZONE_CONTAINER * m_CurrentZoneContour
zone contour currently in progress
Definition: class_board.h:258
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
void HighLightOFF()
Function HighLightOFF Disable highlight.
Definition: class_board.h:407
LAYER()
Definition: class_board.h:82
#define DECL_DEQ_FOR_SWIG(TypeName, MemberType)
Definition: macros.h:160
bool IsLayerVisible(PCB_LAYER_ID aLayerId) const
Function IsLayerVisible tests whether a given layer is visible.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:540
BOARD & operator=(const BOARD &aOther)
Definition: class_board.h:211
HIGH_LIGHT_INFO m_highLight
Definition: class_board.h:187
NETINFO_LIST m_NetInfo
net info list (name, design constraints ..
Definition: class_board.h:200
Class REPORTER is a pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:61
HIGH_LIGHT_INFO m_highLightPrevious
Definition: class_board.h:188
bool IsLayerEnabled(PCB_LAYER_ID aLayer) const
Function IsLayerEnabled is a proxy function that calls the correspondent function in m_BoardSettings ...
Definition: class_board.h:447
TRACKS m_tracks
TRACKS for traces on the board, owned by pointer.
Definition: class_board.h:179
const wxString & GetFileName() const
Definition: class_board.h:225
Class TITLE_BLOCK holds the information shown in the lower right corner of a plot,...
Definition: title_block.h:40
PCB_PLOT_PARAMS m_plotOptions
Definition: class_board.h:199
void SetVisibleAlls()
Function SetVisibleAlls Set the status of all visible element categories and layers to VISIBLE.
void SetAuxOrigin(const wxPoint &aPoint)
Function SetAuxOrigin sets the origin point used for plotting.
Definition: class_board.h:362
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78
NETINFO_LIST::iterator BeginNets() const
Function BeginNets.
Definition: class_board.h:760
static const char * ShowType(LAYER_T aType)
Function ShowType converts a LAYER_T enum to a const char*.
const INSPECTOR_FUNC & INSPECTOR
Definition: base_struct.h:108
ZONE_SETTINGS m_zoneSettings
Definition: class_board.h:195
PCB_LAYER_ID
A quick note on layer IDs:
int GetAreaCount() const
Function GetAreaCount.
Definition: class_board.h:955
Class LSET is a set of PCB_LAYER_IDs.
void ResetNetHighLight()
Function ResetNetHighLight Reset all high light data to the init state.
Definition: class_board.h:376
Class NETLIST stores all of information read from a netlist along with the flags used to update the N...
Definition: pcb_netlist.h:214
unsigned GetNetCount() const
Function GetNetCount.
Definition: class_board.h:779
MODULES & Modules()
Definition: class_board.h:236
static const wxChar * Name(PCB_LAYER_ID aLayerId)
Function Name returns the fixed name association with aLayerId.
Definition: lset.cpp:73
Class NETINFO_LIST is a container class for NETINFO_ITEM elements, which are the nets.
Definition: netinfo.h:409
Class SHAPE_POLY_SET.
Class PAGE_INFO describes the page size and margins of a paper page on which to eventually print or p...
Definition: page_info.h:54
iterator begin() const
Definition: netinfo.h:526
LAYER_T
Enum LAYER_T gives the allowed types of layers, same as Specctra DSN spec.
Definition: class_board.h:66
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Function GetConnectivity() returns list of missing connections between components/tracks.
Definition: class_board.h:310
TITLE_BLOCK m_titles
text in lower right of screen and plots
Definition: class_board.h:198
MODULE * GetFirstModule() const
Gets the first module in the list (used in footprint viewer/editor) or NULL if none.
Definition: class_board.h:285
bool m_visible
Definition: class_board.h:108
ENDPOINT_T
Definition: class_track.h:53
#define DECL_VEC_FOR_SWIG(TypeName, MemberType)
Declare a std::vector but no swig template.
Definition: macros.h:159
void SetDesignSettings(const BOARD_DESIGN_SETTINGS &aDesignSettings)
Function SetDesignSettings.
Definition: class_board.h:550
void SetGeneralSettings(PCB_GENERAL_SETTINGS *aGeneralSettings)
Definition: class_board.h:577
MARKERS m_markers
MARKER_PCBs for clearance problems, owned by pointer.
Definition: class_board.h:170
void SetFileName(const wxString &aFileName)
Definition: class_board.h:223
const wxPoint & GetAuxOrigin() const
Definition: class_board.h:363
void SetPlotOptions(const PCB_PLOT_PARAMS &aOptions)
Definition: class_board.h:559
Class PICKED_ITEMS_LIST is a holder to handle information on schematic or board items.
static LAYER_T ParseType(const char *aType)
Function ParseType converts a string to a LAYER_T.
const MODULES & Modules() const
Definition: class_board.h:240
Class PCB_PLOT_PARAMS handles plot parameters and options when plotting/printing a board.
NETINFO_LIST & GetNetInfo()
Definition: class_board.h:750
DRAWINGS m_drawings
BOARD_ITEMs for drawings on the board, owned by pointer.
Definition: class_board.h:173
const wxPoint & GetGridOrigin() const
Definition: class_board.h:370
Pad object description.
COLORS_DESIGN_SETTINGS & Colors()
int GetFileFormatVersionAtLoad() const
Definition: class_board.h:275
void HighLightON()
Function HighLightON Enable highlight.
Definition: class_board.h:414
Class COMPONENT is used to store components and all of their related information found in a netlist.
Definition: pcb_netlist.h:83
Class ZONE_SETTINGS handles zones parameters.
Definition: zone_settings.h:49
MARKER_PCB * GetMARKER(int index) const
Function GetMARKER returns the MARKER at a given index.
Definition: class_board.h:341
int GetHighLightNetCode() const
Function GetHighLightNetCode.
Definition: class_board.h:386
void SetHighLightNet(int aNetCode)
Function SetHighLightNet.
Definition: class_board.h:392
void clear()
Definition: class_board.h:87
const COLORS_DESIGN_SETTINGS & Colors() const
Function GetColorSettings.
Definition: class_board.h:573
Class NETINFO_ITEM handles the data for a net.
Definition: netinfo.h:65
bool IsLayerVisible(PCB_LAYER_ID aLayer) const
Function IsLayerVisible is a proxy function that calls the correspondent function in m_BoardSettings ...
Definition: class_board.h:459
ZONE_CONTAINERS & Zones()
Definition: class_board.h:250
TITLE_BLOCK & GetTitleBlock()
Definition: class_board.h:561
Board layer functions and definitions.
const PCB_GENERAL_SETTINGS & GeneralSettings() const
Definition: class_board.h:575
int m_fileFormatVersionAtLoad
the version loaded from the file
Definition: class_board.h:190
PCB_GENERAL_SETTINGS * m_generalSettings
reference only; I have no ownership
Definition: class_board.h:196
Class LAYER holds information pertinent to a layer of a BOARD.
Definition: class_board.h:80
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:161
ZONE_CONTAINERS m_ZoneDescriptorList
edge zone descriptors, owned by pointer.
Definition: class_board.h:182
std::shared_ptr< CONNECTIVITY_DATA > m_connectivity
Definition: class_board.h:192
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
Class PCB_EDIT_FRAME is the main frame for Pcbnew.
const ZONE_SETTINGS & GetZoneSettings() const
Definition: class_board.h:564
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:163
The common library.
wxString GetClass() const override
Function GetClass returns the class name.
Definition: class_board.h:878
const TRACKS & Tracks() const
Definition: class_board.h:231
Class COLORS_DESIGN_SETTINGS is a list of color settings for designs in Pcbnew.
unsigned GetNetCount() const
Function GetNetCount.
Definition: netinfo.h:436
void DeleteAllModules()
Removes all modules from the deque and frees the memory associated with them.
Definition: class_board.h:293
BOARD_DESIGN_SETTINGS m_designSettings
Definition: class_board.h:194
Module description (excepted pads)
ZONE_CONTAINER * GetArea(int index) const
Function GetArea returns the Area (Zone Container) at a given index.
Definition: class_board.h:926
Abstract interface for BOARD_ITEMs capable of storing other items inside.
int m_number
Definition: class_board.h:109
Class EDA_MSG_ITEM is used EDA_MSG_PANEL as the item type for displaying messages.
Definition: msgpanel.h:53
int GetAreaIndex(const ZONE_CONTAINER *aArea) const
Function GetAreaIndex returns the Area Index for the given Zone Container.
Definition: class_board.h:940
bool IsElementVisible(GAL_LAYER_ID aElement) const
Function IsElementVisible tests whether a given element category is visible.
SEARCH_RESULT
Definition: base_struct.h:54
DRAWINGS & Drawings()
Definition: class_board.h:245
bool IsEmpty() const
Definition: class_board.h:266
#define mod(a, n)
Definition: greymap.cpp:24
wxPoint m_AuxOrigin
origin for plot exports
class PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
EDA_UNITS_T
Definition: common.h:154
TRACKS & Tracks()
Definition: class_board.h:227
void buildListOfNets()
Function buildListOfNets builds or rebuilds the list of NETINFO_ITEMs The list is sorted by names.
KICAD_T Type() const
Function Type()
Definition: base_struct.h:210
static wxString GetStandardLayerName(PCB_LAYER_ID aLayerId)
Function GetStandardLayerName returns an "English Standard" name of a PCB layer when given aLayerNumb...
Definition: class_board.h:659
Class BOARD_DESIGN_SETTINGS contains design settings for a BOARD object.