KiCad PCB EDA Suite
BOARD Class Reference

Information pertinent to a Pcbnew printed circuit board. More...

#include <board.h>

Inheritance diagram for BOARD:
BOARD_ITEM_CONTAINER BOARD_ITEM EDA_ITEM KIGFX::VIEW_ITEM INSPECTABLE

Classes

struct  cmp_drawings
 
struct  cmp_items
 
struct  GroupLegalOpsField
 

Public Member Functions

void SetBoardUse (BOARD_USE aUse)
 Set what the board is going to be used for. More...
 
BOARD_USE GetBoardUse () const
 Get what the board use is. More...
 
void IncrementTimeStamp ()
 
int GetTimeStamp () const
 
bool IsFootprintHolder () const
 Find out if the board is being used to hold a single footprint for editing/viewing. More...
 
void SetFileName (const wxString &aFileName)
 
const wxString & GetFileName () const
 
TRACKS & Tracks ()
 
const TRACKS & Tracks () const
 
FOOTPRINTS & Footprints ()
 
const FOOTPRINTS & Footprints () const
 
DRAWINGS & Drawings ()
 
const DRAWINGS & Drawings () const
 
ZONESZones ()
 
const ZONESZones () const
 
MARKERS & Markers ()
 
const MARKERS & Markers () const
 
GROUPS & Groups ()
 The groups must maintain the following invariants. More...
 
const GROUPS & Groups () const
 
const std::vector< BOARD_CONNECTED_ITEM * > AllConnectedItems ()
 
const std::map< wxString, wxString > & GetProperties () const
 
void SetProperties (const std::map< wxString, wxString > &aProps)
 
bool ResolveTextVar (wxString *token, int aDepth) const
 
 BOARD ()
 
 ~BOARD ()
 
VECTOR2I GetPosition () const override
 
void SetPosition (const VECTOR2I &aPos) override
 
const VECTOR2I GetFocusPosition () const override
 Similar to GetPosition, but allows items to return their visual center rather than their anchor. More...
 
bool IsEmpty () const
 
void Move (const VECTOR2I &aMoveVector) override
 Move this object. More...
 
void SetFileFormatVersionAtLoad (int aVersion)
 
int GetFileFormatVersionAtLoad () const
 
void SetGenerator (const wxString &aGenerator)
 
const wxString & GetGenerator () const
 Adds an item to the container. More...
 
void Add (BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
 Removes an item from the container. More...
 
void Remove (BOARD_ITEM *aBoardItem, REMOVE_MODE aMode=REMOVE_MODE::NORMAL) override
 Removes an item from the container. More...
 
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. More...
 
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. More...
 
void CacheTriangulation (PROGRESS_REPORTER *aReporter=nullptr, const std::vector< ZONE * > &aZones={})
 
FOOTPRINTGetFirstFootprint () const
 Get the first footprint on the board or nullptr. More...
 
void DeleteAllFootprints ()
 Remove all footprints from the deque and free the memory associated with them. More...
 
BOARD_ITEMGetItem (const KIID &aID) const
 
void FillItemMap (std::map< KIID, EDA_ITEM * > &aMap)
 
wxString ConvertCrossReferencesToKIIDs (const wxString &aSource) const
 Convert cross-references back and forth between ${refDes:field} and ${kiid:field}. More...
 
wxString ConvertKIIDsToCrossReferences (const wxString &aSource) const
 
std::shared_ptr< CONNECTIVITY_DATAGetConnectivity () const
 Return a list of missing connections between components/tracks. More...
 
bool BuildConnectivity (PROGRESS_REPORTER *aReporter=nullptr)
 Build or rebuild the board connectivity database for the board, especially the list of connected items, list of nets and rastnest data Needed after loading a board to have the connectivity database updated. More...
 
void DeleteMARKERs ()
 Delete all MARKERS from the board. More...
 
void DeleteMARKERs (bool aWarningsAndErrors, bool aExclusions)
 
PROJECTGetProject () const
 
void SetProject (PROJECT *aProject, bool aReferenceOnly=false)
 Link a board to a given project. More...
 
void ClearProject ()
 
std::vector< PCB_MARKER * > ResolveDRCExclusions ()
 Rebuild DRC markers from the serialized data in BOARD_DESIGN_SETTINGS. More...
 
void UpdateRatsnestExclusions ()
 Update the visibility flags on the current unconnected ratsnest lines. More...
 
void ResetNetHighLight ()
 Reset all high light data to the init state. More...
 
const std::set< int > & GetHighLightNetCodes () const
 
void SetHighLightNet (int aNetCode, bool aMulti=false)
 Select the netcode to be highlighted. More...
 
bool IsHighLightNetON () const
 
void HighLightON (bool aValue=true)
 Enable or disable net highlighting. More...
 
void HighLightOFF ()
 Disable net highlight. More...
 
int GetCopperLayerCount () const
 
void SetCopperLayerCount (int aCount)
 
int LayerDepth (PCB_LAYER_ID aStartLayer, PCB_LAYER_ID aEndLayer) const
 
LSET GetEnabledLayers () const
 A proxy function that calls the corresponding function in m_BoardSettings. More...
 
void SetEnabledLayers (LSET aLayerMask)
 A proxy function that calls the correspondent function in m_BoardSettings. More...
 
bool IsLayerEnabled (PCB_LAYER_ID aLayer) const
 A proxy function that calls the correspondent function in m_BoardSettings tests whether a given layer is enabled. More...
 
bool IsLayerVisible (PCB_LAYER_ID aLayer) const
 A proxy function that calls the correspondent function in m_BoardSettings tests whether a given layer is visible. More...
 
LSET GetVisibleLayers () const
 A proxy function that calls the correspondent function in m_BoardSettings. More...
 
void SetVisibleLayers (LSET aLayerMask)
 A proxy function that calls the correspondent function in m_BoardSettings changes the bit-mask of visible layers. More...
 
GAL_SET GetVisibleElements () const
 Return a set of all the element categories that are visible. More...
 
void SetVisibleElements (const GAL_SET &aMask)
 A proxy function that calls the correspondent function in m_BoardSettings. More...
 
void SetVisibleAlls ()
 Change the bit-mask of visible element categories and layers. More...
 
bool IsElementVisible (GAL_LAYER_ID aLayer) const
 Test whether a given element category is visible. More...
 
void SetElementVisibility (GAL_LAYER_ID aLayer, bool aNewState)
 Change the visibility of an element category. More...
 
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 visible. More...
 
BOARD_DESIGN_SETTINGSGetDesignSettings () const
 
const ZONE_SETTINGSGetZoneSettings () const override
 Fetch the zone settings for this container. More...
 
void SetZoneSettings (const ZONE_SETTINGS &aSettings) override
 Set the zone settings for this container. More...
 
bool GetTentVias () const
 
void SetTentVias (bool aFlag)
 
const PAGE_INFOGetPageSettings () const
 
void SetPageSettings (const PAGE_INFO &aPageSettings)
 
const PCB_PLOT_PARAMSGetPlotOptions () const
 
void SetPlotOptions (const PCB_PLOT_PARAMS &aOptions)
 
TITLE_BLOCKGetTitleBlock ()
 
const TITLE_BLOCKGetTitleBlock () const
 
void SetTitleBlock (const TITLE_BLOCK &aTitleBlock)
 
wxString GetItemDescription (UNITS_PROVIDER *aUnitsProvider) const override
 Return a user-visible description string of this item. More...
 
bool GetBoardPolygonOutlines (SHAPE_POLY_SET &aOutlines, OUTLINE_ERROR_HANDLER *aErrorHandler=nullptr)
 Extract the board outlines and build a closed polygon from lines, arcs and circle items on edge cut layer. More...
 
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, texts, zones). More...
 
const PCB_LAYER_ID GetLayerID (const wxString &aLayerName) const
 Return the ID of a layer. More...
 
const wxString GetLayerName (PCB_LAYER_ID aLayer) const
 Return the name of a aLayer. More...
 
bool SetLayerName (PCB_LAYER_ID aLayer, const wxString &aLayerName)
 Changes the name of the layer given by aLayer. More...
 
bool SetLayerDescr (PCB_LAYER_ID aIndex, const LAYER &aLayer)
 Return the type of the copper layer given by aLayer. More...
 
LAYER_T GetLayerType (PCB_LAYER_ID aLayer) const
 Return the type of the copper layer given by aLayer. More...
 
bool SetLayerType (PCB_LAYER_ID aLayer, LAYER_T aLayerType)
 Change the type of the layer given by aLayer. More...
 
unsigned GetNodesCount (int aNet=-1) const
 
const std::vector< PAD * > GetPads () const
 Return a reference to a list of all the pads. More...
 
void BuildListOfNets ()
 
NETINFO_ITEMFindNet (int aNetcode) const
 Search for a net with the given netcode. More...
 
NETINFO_ITEMFindNet (const wxString &aNetname) const
 Search for a net with the given name. More...
 
const NETINFO_LISTGetNetInfo () const
 
NETINFO_LISTGetNetInfo ()
 
NETINFO_LIST::iterator BeginNets () const
 
NETINFO_LIST::iterator EndNets () const
 
unsigned GetNetCount () const
 
BOX2I ComputeBoundingBox (bool aBoardEdgesOnly=false) const
 Calculate the bounding box containing all board items (or board edge segments). More...
 
const BOX2I GetBoundingBox () const override
 Return the orthogonal bounding box of this object for display purposes. More...
 
const BOX2I GetBoardEdgesBoundingBox () const
 Return the board bounding box calculated using exclusively the board edges (graphics on Edge.Cuts layer). More...
 
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. More...
 
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 data. More...
 
FOOTPRINTFindFootprintByReference (const wxString &aReference) const
 Search for a FOOTPRINT within this board with the given reference designator. More...
 
FOOTPRINTFindFootprintByPath (const KIID_PATH &aPath) const
 Search for a FOOTPRINT within this board with the given path. More...
 
std::set< wxString > GetNetClassAssignmentCandidates () const
 Return the set of netname candidates for netclass assignment. More...
 
void SynchronizeNetsAndNetClasses (bool aResetTrackAndViaSizes)
 Copy NETCLASS info to each NET, based on NET membership in a NETCLASS. More...
 
void SynchronizeProperties ()
 Copy the current project's text variables into the boards property cache. More...
 
wxString GetClass () const override
 Return the class name. More...
 
int SetAreasNetCodesFromNetNames ()
 Set the .m_NetCode member of all copper areas, according to the area Net Name The SetNetCodesFromNetNames is an equivalent to net name, for fast comparisons. More...
 
ZONEGetArea (int index) const
 Return the Zone at a given index. More...
 
std::list< ZONE * > GetZoneList (bool aIncludeZonesInFootprints=false) const
 
int GetAreaCount () const
 
ZONEAddArea (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. More...
 
bool TestZoneIntersection (ZONE *aZone1, ZONE *aZone2)
 Test for intersection of 2 copper areas. More...
 
PADGetPad (const VECTOR2I &aPosition, LSET aLayerMask) const
 Find a pad aPosition on aLayer. More...
 
PADGetPad (const VECTOR2I &aPosition) const
 
PADGetPad (const PCB_TRACK *aTrace, ENDPOINT_T aEndPoint) const
 Find a pad connected to aEndPoint of aTrace. More...
 
PADGetPadFast (const VECTOR2I &aPosition, LSET aLayerMask) const
 Return pad found at aPosition on aLayerMask using the fast search method. More...
 
PADGetPad (std::vector< PAD * > &aPadList, const VECTOR2I &aPosition, LSET aLayerMask) const
 Locate the pad connected at aPosition on aLayer starting at list position aPad. More...
 
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, and for increasing y coordinate for same values of x coordinates. More...
 
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. More...
 
TRACKS TracksInNet (int aNetCode)
 Collect all the TRACKs and VIAs that are members of a net given by aNetCode. More...
 
FOOTPRINTGetFootprint (const VECTOR2I &aPosition, PCB_LAYER_ID aActiveLayer, bool aVisibleOnly, bool aIgnoreLocked=false) const
 Get a footprint by its bounding rectangle at aPosition on aLayer. More...
 
void MapNets (const BOARD *aDestBoard)
 Map all nets in the given board to nets with the same name (if any) in the destination board. More...
 
void SanitizeNetcodes ()
 
void AddListener (BOARD_LISTENER *aListener)
 Add a listener to the board to receive calls whenever something on the board has been modified. More...
 
void RemoveListener (BOARD_LISTENER *aListener)
 Remove the specified listener. More...
 
void RemoveAllListeners ()
 Remove all listeners. More...
 
void OnItemChanged (BOARD_ITEM *aItem)
 Notify the board and its listeners that an item on the board has been modified in some way. More...
 
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. More...
 
wxString GroupsSanityCheck (bool repair=false)
 Consistency check of internal m_groups structure. More...
 
wxString GroupsSanityCheckInternal (bool repair)
 
GroupLegalOpsField GroupLegalOps (const PCB_SELECTION &selection) const
 Check which selection tool group operations are legal given the selection. More...
 
virtual void Delete (BOARD_ITEM *aItem)
 Removes an item from the container and deletes it. More...
 
void SetParentGroup (PCB_GROUP *aGroup)
 
PCB_GROUPGetParentGroup () const
 
int GetX () const
 
int GetY () const
 
virtual VECTOR2I GetCenter () const
 This defaults to the center of the bounding box if not overridden. More...
 
void SetX (int aX)
 
void SetY (int aY)
 
virtual bool IsConnected () const
 Returns information if the object is derived from BOARD_CONNECTED_ITEM. More...
 
virtual bool IsOnCopperLayer () const
 
virtual bool HasHole () const
 
virtual bool IsTented () const
 
virtual std::shared_ptr< SHAPEGetEffectiveShape (PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT) const
 Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes. More...
 
virtual std::shared_ptr< SHAPE_SEGMENTGetEffectiveHoleShape () const
 
BOARD_ITEM_CONTAINERGetParent () const
 
BOARD_ITEM_CONTAINERGetParentFootprint () const
 
virtual bool HasLineStroke () const
 Check if this item has line stoke properties. More...
 
virtual STROKE_PARAMS GetStroke () const
 
virtual void SetStroke (const STROKE_PARAMS &aStroke)
 
virtual PCB_LAYER_ID GetLayer () const
 Return the primary layer this item is on. More...
 
virtual LSET GetLayerSet () const
 Return a std::bitset of all layers on which the item physically resides. More...
 
virtual void SetLayerSet (LSET aLayers)
 
virtual void SetLayer (PCB_LAYER_ID aLayer)
 Set the layer this item is on. More...
 
virtual BOARD_ITEMDuplicate () const
 Create a copy of this BOARD_ITEM. More...
 
void SwapItemData (BOARD_ITEM *aImage)
 Swap data between aItem and aImage. More...
 
virtual bool IsOnLayer (PCB_LAYER_ID aLayer) const
 Test to see if this object is on the given layer. More...
 
virtual bool IsKnockout () const
 
virtual void SetIsKnockout (bool aKnockout)
 
virtual bool IsLocked () const
 
virtual void SetLocked (bool aLocked)
 
void DeleteStructure ()
 Delete this object after removing from its parent if it has one. More...
 
virtual void Rotate (const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle)
 Rotate this object. More...
 
virtual void Flip (const VECTOR2I &aCentre, bool aFlipLeftRight)
 Flip this object, i.e. More...
 
virtual const BOARDGetBoard () const
 Return the BOARD in which this BOARD_ITEM resides, or NULL if none. More...
 
virtual BOARDGetBoard ()
 
wxString GetLayerName () const
 Return the name of the PCB layer on which the item resides. More...
 
virtual void ViewGetLayers (int aLayers[], int &aCount) const override
 Return the all the layers within the VIEW the object is painted on. More...
 
virtual void TransformShapeToPolygon (SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, int aClearance, int aError, ERROR_LOC aErrorLoc, bool ignoreLineWidth=false) const
 Convert the item shape to a closed polygon. More...
 
KICAD_T Type () const
 Returns the type of object. More...
 
virtual void SetParent (EDA_ITEM *aParent)
 
bool IsModified () const
 
bool IsNew () const
 
bool IsMoving () const
 
bool IsSelected () const
 
bool IsEntered () const
 
bool IsBrightened () const
 
bool IsRollover () const
 
void SetSelected ()
 
void SetBrightened ()
 
void ClearSelected ()
 
void ClearBrightened ()
 
void SetModified ()
 
int GetState (EDA_ITEM_FLAGS type) const
 
void SetState (EDA_ITEM_FLAGS type, bool state)
 
EDA_ITEM_FLAGS GetStatus () const
 
void SetStatus (EDA_ITEM_FLAGS aStatus)
 
void SetFlags (EDA_ITEM_FLAGS aMask)
 
void XorFlags (EDA_ITEM_FLAGS aMask)
 
void ClearFlags (EDA_ITEM_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
 
EDA_ITEM_FLAGS GetFlags () const
 
bool HasFlag (EDA_ITEM_FLAGS aFlag) const
 
EDA_ITEM_FLAGS GetEditFlags () const
 
void ClearTempFlags ()
 
void ClearEditFlags ()
 
virtual bool RenderAsBitmap (double aWorldScale) const
 
void SetIsShownAsBitmap (bool aBitmap)
 
bool IsShownAsBitmap () const
 
virtual bool IsType (const std::vector< KICAD_T > &aScanTypes) const
 Check whether the item is one of the listed types. More...
 
void SetForceVisible (bool aEnable)
 Set and clear force visible flag used to force the item to be drawn even if it's draw attribute is set to not visible. More...
 
bool IsForceVisible () const
 
virtual wxString GetFriendlyName () const
 
virtual bool HitTest (const VECTOR2I &aPosition, int aAccuracy=0) const
 Test if aPosition is inside or on the boundary of this item. More...
 
virtual bool HitTest (const BOX2I &aRect, bool aContained, int aAccuracy=0) const
 Test if aRect intersects this item. More...
 
virtual VECTOR2I GetSortPosition () const
 Return the coordinates that should be used for sorting this element visually compared to other elements. More...
 
virtual EDA_ITEMClone () const
 Create a duplicate of this item with linked list members set to NULL. More...
 
wxString GetTypeDesc () const
 Return a translated description of the type for this EDA_ITEM for display in user facing messages. More...
 
virtual BITMAPS GetMenuImage () const
 Return a pointer to an image to be used in menus. More...
 
virtual bool Matches (const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const
 Compare the item against the search criteria in aSearchData. More...
 
virtual bool Replace (const EDA_SEARCH_DATA &aSearchData, void *aAuxData=nullptr)
 Perform a text replace using the find and replace criteria in aSearchData on items that support text find and replace. More...
 
virtual bool IsReplaceable () const
 Override this method in any derived object that supports test find and replace. More...
 
bool operator< (const EDA_ITEM &aItem) const
 Test if another item is less than this object. More...
 
virtual const BOX2I ViewBBox () const override
 Return the bounding box of the item covering all its layers. More...
 
virtual void ViewDraw (int aLayer, VIEW *aView) const
 Draw the parts of the object belonging to layer aLayer. More...
 
virtual double ViewGetLOD (int aLayer, VIEW *aView) const
 Return the level of detail (LOD) of the item. More...
 
VIEW_ITEM_DATA * viewPrivData () const
 
void ClearViewPrivData ()
 
bool Set (PROPERTY_BASE *aProperty, wxAny &aValue)
 
template<typename T >
bool Set (PROPERTY_BASE *aProperty, T aValue)
 
template<typename T >
bool Set (const wxString &aProperty, T aValue)
 
wxAny Get (PROPERTY_BASE *aProperty) const
 
template<typename T >
Get (PROPERTY_BASE *aProperty) const
 
template<typename T >
std::optional< T > Get (const wxString &aProperty) const
 

Static Public Member Functions

static bool ClassOf (const EDA_ITEM *aItem)
 
static wxString GetStandardLayerName (PCB_LAYER_ID aLayerId)
 Return an "English Standard" name of a PCB layer when given aLayerNumber. More...
 
template<class T >
static INSPECT_RESULT IterateForward (std::deque< T > &aList, INSPECTOR inspector, void *testData, const std::vector< KICAD_T > &scanTypes)
 This changes first parameter to avoid the DList and use the main queue instead. More...
 
template<class T >
static INSPECT_RESULT IterateForward (std::vector< T > &aList, INSPECTOR inspector, void *testData, const std::vector< KICAD_T > &scanTypes)
 Change first parameter to avoid the DList and use std::vector instead. More...
 
static bool Replace (const EDA_SEARCH_DATA &aSearchData, wxString &aText)
 Perform a text replace on aText using the find and replace criteria in aSearchData on items that support text find and replace. More...
 
static bool Sort (const EDA_ITEM *aLeft, const EDA_ITEM *aRight)
 Helper function to be used by the C++ STL sort algorithm for sorting a STL container of EDA_ITEM pointers. More...
 

Public Attributes

LSET m_LegacyVisibleLayers
 Visibility settings stored in board prior to 6.0, only used for loading legacy files. More...
 
GAL_SET m_LegacyVisibleItems
 
bool m_LegacyDesignSettingsLoaded
 True if the legacy board design settings were loaded from a file. More...
 
bool m_LegacyCopperEdgeClearanceLoaded
 
bool m_LegacyNetclassesLoaded
 True if netclasses were loaded from the file. More...
 
std::mutex m_CachesMutex
 
std::unordered_map< PTR_PTR_CACHE_KEY, bool > m_IntersectsCourtyardCache
 
std::unordered_map< PTR_PTR_CACHE_KEY, bool > m_IntersectsFCourtyardCache
 
std::unordered_map< PTR_PTR_CACHE_KEY, bool > m_IntersectsBCourtyardCache
 
std::unordered_map< PTR_PTR_LAYER_CACHE_KEY, bool > m_IntersectsAreaCache
 
std::unordered_map< PTR_PTR_LAYER_CACHE_KEY, bool > m_EnclosedByAreaCache
 
std::unordered_map< wxString, LSETm_LayerExpressionCache
 
std::unordered_map< ZONE *, std::unique_ptr< DRC_RTREE > > m_CopperZoneRTreeCache
 
std::unique_ptr< DRC_RTREEm_CopperItemRTreeCache
 
std::unordered_map< const ZONE *, BOX2Im_ZoneBBoxCache
 
std::vector< ZONE * > m_DRCZones
 
std::vector< ZONE * > m_DRCCopperZones
 
int m_DRCMaxClearance
 
int m_DRCMaxPhysicalClearance
 
ZONEm_SolderMask
 
const KIID m_Uuid
 

Static Public Attributes

static VECTOR2I ZeroOffset
 A value of wxPoint(0,0) which can be passed to the Draw() functions. More...
 

Protected Member Functions

virtual wxString layerMaskDescribe () const
 Return a string (to be shown to the user) describing a layer mask. More...
 
virtual void swapData (BOARD_ITEM *aImage)
 
bool Matches (const wxString &aText, const EDA_SEARCH_DATA &aSearchData) const
 Compare aText against search criteria in aSearchData. More...
 

Protected Attributes

PCB_LAYER_ID m_layer
 
bool m_isKnockout
 
bool m_isLocked
 
PCB_GROUPm_group
 
EDA_ITEM_FLAGS m_status
 
EDA_ITEMm_parent
 Linked list: Link (parent struct) More...
 
bool m_forceVisible
 
EDA_ITEM_FLAGS m_flags
 

Private Member Functions

 BOARD (const BOARD &aOther)=delete
 
BOARDoperator= (const BOARD &aOther)=delete
 
template<typename Func , typename... Args>
void InvokeListeners (Func &&aFunc, Args &&... args)
 

Private Attributes

BOARD_USE m_boardUse
 What is this board being used for. More...
 
int m_timeStamp
 
wxString m_fileName
 
MARKERS m_markers
 
DRAWINGS m_drawings
 
FOOTPRINTS m_footprints
 
TRACKS m_tracks
 
GROUPS m_groups
 
ZONES m_zones
 
LAYER m_layers [PCB_LAYER_ID_COUNT]
 
HIGH_LIGHT_INFO m_highLight
 
HIGH_LIGHT_INFO m_highLightPrevious
 
int m_fileFormatVersionAtLoad
 
wxString m_generator
 
std::map< wxString, wxString > m_properties
 
std::shared_ptr< CONNECTIVITY_DATAm_connectivity
 
PAGE_INFO m_paper
 
TITLE_BLOCK m_titles
 
PCB_PLOT_PARAMS m_plotOptions
 
PROJECTm_project
 
std::unique_ptr< BOARD_DESIGN_SETTINGSm_designSettings
 All of the board design settings are stored as a JSON object inside the project file. More...
 
NETINFO_LIST m_NetInfo
 
std::vector< BOARD_LISTENER * > m_listeners
 
ZONE_SETTINGS m_zoneSettings
 
KICAD_T m_structType
 Run time identification, keep private so it can never be changed after a ctor sets it. More...
 
VIEW_ITEM_DATA * m_viewPrivData
 

Friends

class PCB_EDIT_FRAME
 

Detailed Description

Information pertinent to a Pcbnew printed circuit board.

Definition at line 264 of file board.h.

Constructor & Destructor Documentation

◆ BOARD() [1/2]

BOARD::BOARD ( )

Definition at line 69 of file board.cpp.

69 :
75 m_timeStamp( 1 ),
77 m_project( nullptr ),
78 m_designSettings( new BOARD_DESIGN_SETTINGS( nullptr, "board.design_settings" ) ),
79 m_NetInfo( this )
80{
81 // we have not loaded a board yet, assume latest until then.
82 m_fileFormatVersionAtLoad = LEGACY_BOARD_FILE_VERSION;
83
84 for( int layer = 0; layer < PCB_LAYER_ID_COUNT; ++layer )
85 {
87
88 if( IsCopperLayer( layer ) )
89 m_layers[layer].m_type = LT_SIGNAL;
90 else
92 }
93
94 m_SolderMask = new ZONE( this );
95 m_SolderMask->SetLayerSet( LSET().set( F_Mask ).set( B_Mask ) );
96 int infinity = ( std::numeric_limits<int>::max() / 2 ) - pcbIUScale.mmToIU( 1 );
98 m_SolderMask->Outline()->Append( VECTOR2I( -infinity, -infinity ) );
99 m_SolderMask->Outline()->Append( VECTOR2I( -infinity, +infinity ) );
100 m_SolderMask->Outline()->Append( VECTOR2I( +infinity, +infinity ) );
101 m_SolderMask->Outline()->Append( VECTOR2I( +infinity, -infinity ) );
103
105
106 // Initialize default netclass.
107 bds.m_NetSettings->m_DefaultNetClass = std::make_shared<NETCLASS>( NETCLASS::Default );
108 bds.m_NetSettings->m_DefaultNetClass->SetDescription( _( "This is the default net class." ) );
109
110 bds.UseCustomTrackViaSize( false );
111
112 // Initialize ratsnest
113 m_connectivity.reset( new CONNECTIVITY_DATA() );
114
115 // Set flag bits on these that will only be cleared if these are loaded from a legacy file
116 m_LegacyVisibleLayers.reset().set( Rescue );
118}
constexpr EDA_IU_SCALE pcbIUScale
Definition: base_units.h:109
@ LT_UNDEFINED
Definition: board.h:144
@ LT_SIGNAL
Definition: board.h:145
Container for design settings for a BOARD object.
void UseCustomTrackViaSize(bool aEnabled)
Enables/disables custom track/via size settings.
std::shared_ptr< NET_SETTINGS > m_NetSettings
BOARD_ITEM_CONTAINER(BOARD_ITEM *aParent, KICAD_T aType)
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:58
bool m_LegacyDesignSettingsLoaded
True if the legacy board design settings were loaded from a file.
Definition: board.h:342
int m_fileFormatVersionAtLoad
Definition: board.h:1189
GAL_SET m_LegacyVisibleItems
Definition: board.h:339
LAYER m_layers[PCB_LAYER_ID_COUNT]
Definition: board.h:1184
static wxString GetStandardLayerName(PCB_LAYER_ID aLayerId)
Return an "English Standard" name of a PCB layer when given aLayerNumber.
Definition: board.h:696
BOARD_USE m_boardUse
What is this board being used for.
Definition: board.h:1173
PAGE_INFO m_paper
Definition: board.h:1195
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:1210
NETINFO_LIST m_NetInfo
Definition: board.h:1212
LSET m_LegacyVisibleLayers
Visibility settings stored in board prior to 6.0, only used for loading legacy files.
Definition: board.h:338
int m_timeStamp
Definition: board.h:1174
std::shared_ptr< CONNECTIVITY_DATA > m_connectivity
Definition: board.h:1193
bool m_LegacyNetclassesLoaded
True if netclasses were loaded from the file.
Definition: board.h:346
PROJECT * m_project
Definition: board.h:1198
ZONE * m_SolderMask
Definition: board.h:1154
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.cpp:682
bool m_LegacyCopperEdgeClearanceLoaded
Definition: board.h:343
GAL_SET & set()
Definition: layer_ids.h:311
LSET is a set of PCB_LAYER_IDs.
Definition: layer_ids.h:530
static const char Default[]
the name of the default NETCLASS
Definition: netclass.h:49
static const wxChar A4[]
Definition: page_info.h:63
int Append(int x, int y, int aOutline=-1, int aHole=-1, bool aAllowDuplication=false)
Add a new vertex to the contour indexed by aOutline and aHole (defaults to the outline of the last po...
int NewOutline()
Creates a new hole in a given outline.
Handle a list of polygons defining a copper zone.
Definition: zone.h:57
void SetMinThickness(int aMinThickness)
Definition: zone.h:252
SHAPE_POLY_SET * Outline()
Definition: zone.h:312
void SetLayerSet(LSET aLayerSet) override
Definition: zone.cpp:266
#define _(s)
bool IsCopperLayer(int aLayerId)
Tests whether a layer is a copper layer.
Definition: layer_ids.h:825
@ GAL_LAYER_ID_BITMASK_END
This is the end of the layers used for visibility bit masks in legacy board files.
Definition: layer_ids.h:226
@ B_Mask
Definition: layer_ids.h:106
@ F_Mask
Definition: layer_ids.h:107
@ Rescue
Definition: layer_ids.h:133
@ PCB_LAYER_ID_COUNT
Definition: layer_ids.h:137
#define GAL_LAYER_INDEX(x)
Use this macro to convert a GAL layer to a 0-indexed offset from LAYER_VIAS.
Definition: layer_ids.h:264
PCB_LAYER_ID ToLAYER_ID(int aLayer)
Definition: lset.cpp:932
constexpr int mmToIU(double mm) const
Definition: base_units.h:89
LAYER_T m_type
The type of the layer.
Definition: board.h:184
wxString m_name
The canonical name of the layer.
Definition: board.h:182
@ PCB_T
Definition: typeinfo.h:82
VECTOR2< int > VECTOR2I
Definition: vector2d.h:618

References _, A4, SHAPE_POLY_SET::Append(), B_Mask, NETCLASS::Default, F_Mask, GAL_LAYER_ID_BITMASK_END, GAL_LAYER_INDEX, GetDesignSettings(), GetStandardLayerName(), IsCopperLayer(), LT_SIGNAL, LT_UNDEFINED, m_connectivity, m_fileFormatVersionAtLoad, m_layers, m_LegacyVisibleItems, m_LegacyVisibleLayers, LAYER::m_name, BOARD_DESIGN_SETTINGS::m_NetSettings, m_SolderMask, LAYER::m_type, EDA_IU_SCALE::mmToIU(), SHAPE_POLY_SET::NewOutline(), NORMAL, ZONE::Outline(), PCB_LAYER_ID_COUNT, pcbIUScale, Rescue, GAL_SET::set(), ZONE::SetLayerSet(), ZONE::SetMinThickness(), ToLAYER_ID(), and BOARD_DESIGN_SETTINGS::UseCustomTrackViaSize().

◆ ~BOARD()

BOARD::~BOARD ( )

Definition at line 121 of file board.cpp.

122{
123 // Untangle group parents before doing any deleting
124 for( PCB_GROUP* group : m_groups )
125 {
126 for( BOARD_ITEM* item : group->GetItems() )
127 item->SetParentGroup( nullptr );
128 }
129
130 // Clean up the owned elements
132
133 for( ZONE* zone : m_zones )
134 delete zone;
135
136 m_zones.clear();
137
138 delete m_SolderMask;
139
140 for( FOOTPRINT* footprint : m_footprints )
141 delete footprint;
142
143 m_footprints.clear();
144
145 for( PCB_TRACK* t : m_tracks )
146 delete t;
147
148 m_tracks.clear();
149
150 for( BOARD_ITEM* d : m_drawings )
151 delete d;
152
153 m_drawings.clear();
154
155 for( PCB_GROUP* g : m_groups )
156 delete g;
157
158 m_groups.clear();
159}
FOOTPRINTS m_footprints
Definition: board.h:1179
DRAWINGS m_drawings
Definition: board.h:1178
ZONES m_zones
Definition: board.h:1182
void DeleteMARKERs()
Delete all MARKERS from the board.
Definition: board.cpp:956
GROUPS m_groups
Definition: board.h:1181
TRACKS m_tracks
Definition: board.h:1180
A set of BOARD_ITEMs (i.e., without duplicates).
Definition: pcb_group.h:51

References DeleteMARKERs(), group, m_drawings, m_footprints, m_groups, m_SolderMask, m_tracks, and m_zones.

◆ BOARD() [2/2]

BOARD::BOARD ( const BOARD aOther)
privatedelete

Member Function Documentation

◆ Add()

void BOARD::Add ( BOARD_ITEM aItem,
ADD_MODE  aMode = ADD_MODE::INSERT,
bool  aSkipConnectivity = false 
)
overridevirtual

Removes an item from the container.

Implements BOARD_ITEM_CONTAINER.

Definition at line 750 of file board.cpp.

751{
752 if( aBoardItem == nullptr )
753 {
754 wxFAIL_MSG( wxT( "BOARD::Add() param error: aBoardItem nullptr" ) );
755 return;
756 }
757
758 switch( aBoardItem->Type() )
759 {
760 case PCB_NETINFO_T:
761 m_NetInfo.AppendNet( (NETINFO_ITEM*) aBoardItem );
762 break;
763
764 // this one uses a vector
765 case PCB_MARKER_T:
766 m_markers.push_back( (PCB_MARKER*) aBoardItem );
767 break;
768
769 // this one uses a vector
770 case PCB_GROUP_T:
771 m_groups.push_back( (PCB_GROUP*) aBoardItem );
772 break;
773
774 // this one uses a vector
775 case PCB_ZONE_T:
776 m_zones.push_back( (ZONE*) aBoardItem );
777 break;
778
779 case PCB_TRACE_T:
780 case PCB_VIA_T:
781 case PCB_ARC_T:
782
783 // N.B. This inserts a small memory leak as we lose the
784 if( !IsCopperLayer( aBoardItem->GetLayer() ) )
785 {
786 wxFAIL_MSG( wxT( "BOARD::Add() Cannot place Track on non-copper layer" ) );
787 return;
788 }
789
790 if( aMode == ADD_MODE::APPEND || aMode == ADD_MODE::BULK_APPEND )
791 m_tracks.push_back( static_cast<PCB_TRACK*>( aBoardItem ) );
792 else
793 m_tracks.push_front( static_cast<PCB_TRACK*>( aBoardItem ) );
794
795 break;
796
797 case PCB_FOOTPRINT_T:
798 if( aMode == ADD_MODE::APPEND || aMode == ADD_MODE::BULK_APPEND )
799 m_footprints.push_back( static_cast<FOOTPRINT*>( aBoardItem ) );
800 else
801 m_footprints.push_front( static_cast<FOOTPRINT*>( aBoardItem ) );
802
803 break;
804
806 case PCB_DIM_CENTER_T:
807 case PCB_DIM_RADIAL_T:
809 case PCB_DIM_LEADER_T:
810 case PCB_SHAPE_T:
811 case PCB_BITMAP_T:
812 case PCB_TEXT_T:
813 case PCB_TEXTBOX_T:
814 case PCB_TARGET_T:
815 if( aMode == ADD_MODE::APPEND || aMode == ADD_MODE::BULK_APPEND )
816 m_drawings.push_back( aBoardItem );
817 else
818 m_drawings.push_front( aBoardItem );
819
820 break;
821
822 // other types may use linked list
823 default:
824 {
825 wxString msg;
826 msg.Printf( wxT( "BOARD::Add() needs work: BOARD_ITEM type (%d) not handled" ),
827 aBoardItem->Type() );
828 wxFAIL_MSG( msg );
829 return;
830 }
831 break;
832 }
833
834 aBoardItem->SetParent( this );
835 aBoardItem->ClearEditFlags();
836
837 if( !aSkipConnectivity )
838 m_connectivity->Add( aBoardItem );
839
840 if( aMode != ADD_MODE::BULK_INSERT && aMode != ADD_MODE::BULK_APPEND )
841 {
843 }
844}
virtual void OnBoardItemAdded(BOARD &aBoard, BOARD_ITEM *aBoardItem)
Definition: board.h:240
void InvokeListeners(Func &&aFunc, Args &&... args)
Definition: board.h:1164
MARKERS m_markers
Definition: board.h:1177
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:97
virtual void SetParent(EDA_ITEM *aParent)
Definition: eda_item.h:100
void ClearEditFlags()
Definition: eda_item.h:158
Handle the data for a net.
Definition: netinfo.h:67
void AppendNet(NETINFO_ITEM *aNewElement)
Add aNewElement to the end of the net list.
virtual PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
Definition: zone.cpp:239
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
Definition: typeinfo.h:88
@ PCB_DIM_ORTHOGONAL_T
class PCB_DIM_ORTHOGONAL, a linear dimension constrained to x/y
Definition: typeinfo.h:110
@ PCB_DIM_LEADER_T
class PCB_DIM_LEADER, a leader dimension (graphic item)
Definition: typeinfo.h:107
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:102
@ PCB_DIM_CENTER_T
class PCB_DIM_CENTER, a center point marking (graphic item)
Definition: typeinfo.h:108
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs
Definition: typeinfo.h:115
@ PCB_TEXTBOX_T
class PCB_TEXTBOX, wrapped text on a layer
Definition: typeinfo.h:91
@ PCB_ZONE_T
class ZONE, a copper pour area
Definition: typeinfo.h:112
@ PCB_TEXT_T
class PCB_TEXT, text on a layer
Definition: typeinfo.h:90
@ PCB_MARKER_T
class PCB_MARKER, a marker used to show something
Definition: typeinfo.h:104
@ PCB_TARGET_T
class PCB_TARGET, a target (graphic item)
Definition: typeinfo.h:111
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
Definition: typeinfo.h:86
@ PCB_DIM_ALIGNED_T
class PCB_DIM_ALIGNED, a linear dimension (graphic item)
Definition: typeinfo.h:106
@ PCB_BITMAP_T
class PCB_BITMAP, bitmap on a layer
Definition: typeinfo.h:89
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
Definition: typeinfo.h:103
@ PCB_NETINFO_T
class NETINFO_ITEM, a description of a net
Definition: typeinfo.h:114
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:101
@ PCB_DIM_RADIAL_T
class PCB_DIM_RADIAL, a radius or diameter dimension
Definition: typeinfo.h:109

References APPEND, NETINFO_LIST::AppendNet(), BULK_APPEND, BULK_INSERT, EDA_ITEM::ClearEditFlags(), BOARD_ITEM::GetLayer(), InvokeListeners(), IsCopperLayer(), m_connectivity, m_drawings, m_footprints, m_groups, m_markers, m_NetInfo, m_tracks, m_zones, BOARD_LISTENER::OnBoardItemAdded(), PCB_ARC_T, PCB_BITMAP_T, PCB_DIM_ALIGNED_T, PCB_DIM_CENTER_T, PCB_DIM_LEADER_T, PCB_DIM_ORTHOGONAL_T, PCB_DIM_RADIAL_T, PCB_FOOTPRINT_T, PCB_GROUP_T, PCB_MARKER_T, PCB_NETINFO_T, PCB_SHAPE_T, PCB_TARGET_T, PCB_TEXT_T, PCB_TEXTBOX_T, PCB_TRACE_T, PCB_VIA_T, PCB_ZONE_T, EDA_ITEM::SetParent(), and EDA_ITEM::Type().

Referenced by NET_SELECTOR_COMBOPOPUP::Accept(), PCB_BASE_FRAME::AddFootprintToBoard(), TEARDROP_MANAGER::addTeardropsOnTracks(), PCAD2KICAD::PCB::AddToBoard(), PCAD2KICAD::PCB_ARC::AddToBoard(), PCAD2KICAD::PCB_FOOTPRINT::AddToBoard(), PCAD2KICAD::PCB_LINE::AddToBoard(), PCAD2KICAD::PCB_PAD::AddToBoard(), PCAD2KICAD::PCB_POLYGON::AddToBoard(), PCAD2KICAD::PCB_TEXT::AddToBoard(), PCAD2KICAD::PCB_PAD::AddToFootprint(), ALTIUM_PCB::ConvertArcs6ToBoardItem(), ALTIUM_PCB::ConvertArcs6ToBoardItemOnLayer(), ALTIUM_PCB::ConvertFills6ToBoardItemOnLayer(), ALTIUM_PCB::ConvertFills6ToBoardItemWithNet(), ALTIUM_PCB::ConvertPads6ToBoardItem(), ALTIUM_PCB::ConvertPads6ToBoardItemOnNonCopper(), ALTIUM_PCB::ConvertShapeBasedRegions6ToBoardItem(), ALTIUM_PCB::ConvertShapeBasedRegions6ToBoardItemOnLayer(), ALTIUM_PCB::ConvertTexts6ToBoardItemOnLayer(), ALTIUM_PCB::ConvertTracks6ToBoardItem(), ALTIUM_PCB::ConvertTracks6ToBoardItemOnLayer(), CADSTAR_PCB_ARCHIVE_LOADER::createUniqueGroupID(), FOOTPRINT_VIEWER_FRAME::displayFootprint(), CADSTAR_PCB_ARCHIVE_LOADER::drawCadstarText(), DSN::SPECCTRA_DB::FromSESSION(), CADSTAR_PCB_ARCHIVE_LOADER::getKiCadNet(), ZONE_SEARCH_HANDLER::GetResultCell(), GROUP_TOOL::Group(), ALTIUM_PCB::HelperCreateAndAddShape(), ALTIUM_PCB::HelperCreateBoardOutline(), ALTIUM_PCB::HelperParseDimensions6Center(), ALTIUM_PCB::HelperParseDimensions6Datum(), ALTIUM_PCB::HelperParseDimensions6Leader(), ALTIUM_PCB::HelperParseDimensions6Linear(), ALTIUM_PCB::HelperParseDimensions6Radial(), ALTIUM_PCB::HelperPcpShapeAsBoardKeepoutRegion(), DISPLAY_FOOTPRINTS_FRAME::InitDisplay(), LEGACY_PLUGIN::loadAllSections(), CADSTAR_PCB_ARCHIVE_LOADER::loadAreas(), LoadBoard(), CADSTAR_PCB_ARCHIVE_LOADER::loadComponents(), CADSTAR_PCB_ARCHIVE_LOADER::loadCoppers(), LEGACY_PLUGIN::loadDIMENSION(), CADSTAR_PCB_ARCHIVE_LOADER::loadDimensions(), EAGLE_PLUGIN::loadElements(), FABMASTER::loadEtch(), FABMASTER::loadFootprints(), FABMASTER::loadGraphics(), CADSTAR_PCB_ARCHIVE_LOADER::loadGroups(), LEGACY_PLUGIN::loadNETINFO_ITEM(), FABMASTER::loadNets(), CADSTAR_PCB_ARCHIVE_LOADER::loadNetVia(), FABMASTER::loadOutline(), LEGACY_PLUGIN::loadPCB_LINE(), LEGACY_PLUGIN::loadPCB_TARGET(), LEGACY_PLUGIN::loadPCB_TEXT(), EAGLE_PLUGIN::loadPlain(), FABMASTER::loadPolygon(), EAGLE_PLUGIN::loadPolygon(), EAGLE_PLUGIN::loadSignals(), CADSTAR_PCB_ARCHIVE_LOADER::loadTemplates(), LEGACY_PLUGIN::loadTrackList(), FABMASTER::loadVias(), FABMASTER::loadZone(), LEGACY_PLUGIN::loadZONE_CONTAINER(), DIALOG_NET_INSPECTOR::onAddNet(), PANEL_PREVIEW_3D_MODEL::PANEL_PREVIEW_3D_MODEL(), PCB_PARSER::parseBOARD_unchecked(), ALTIUM_PCB::ParseComponents6Data(), PCB_PARSER::parseNETINFO_ITEM(), ALTIUM_PCB::ParseNets6Data(), ALTIUM_PCB::ParsePolygons6Data(), ALTIUM_PCB::ParseVias6Data(), PCB_PARSER::parseZONE(), BOARD_COMMIT::Push(), FOOTPRINT_WIZARD_FRAME::ReloadFootprint(), BOARD_EDITOR_CONTROL::RepairBoard(), BOARD_COMMIT::Revert(), DIALOG_FOOTPRINT_CHECKER::runChecks(), and TEARDROP_MANAGER::SetTeardrops().

◆ AddArea()

ZONE * BOARD::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.

Parameters
aNewZonesListis a PICKED_ITEMS_LIST * where to store new areas pickers (useful in undo commands) can be NULL.
aNetcodeis the netcode of the copper area (0 = no net).
aLayeris the layer of area.
aStartPointPositionis position of the first point of the polygon outline of this area.
aHatchis the hatch option.
Returns
a reference to the new area.

Definition at line 1925 of file board.cpp.

1927{
1928 ZONE* new_area = new ZONE( this );
1929
1930 new_area->SetNetCode( aNetcode );
1931 new_area->SetLayer( aLayer );
1932
1933 m_zones.push_back( new_area );
1934
1935 new_area->SetHatchStyle( (ZONE_BORDER_DISPLAY_STYLE) aHatch );
1936
1937 // Add the first corner to the new zone
1938 new_area->AppendCorner( aStartPointPosition, -1 );
1939
1940 if( aNewZonesList )
1941 {
1942 ITEM_PICKER picker( nullptr, new_area, UNDO_REDO::NEWITEM );
1943 aNewZonesList->PushItem( picker );
1944 }
1945
1946 return new_area;
1947}
bool SetNetCode(int aNetCode, bool aNoAssert)
Set net using a net code.
void PushItem(const ITEM_PICKER &aItem)
Push aItem to the top of the list.
virtual void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
Definition: zone.cpp:260
void SetHatchStyle(ZONE_BORDER_DISPLAY_STYLE aStyle)
Definition: zone.h:581
bool AppendCorner(VECTOR2I aPosition, int aHoleIdx, bool aAllowDuplication=false)
Add a new corner to the zone outline (to the main outline or a hole)
Definition: zone.cpp:760
ZONE_BORDER_DISPLAY_STYLE
Zone border styles.
Definition: zone_settings.h:49

References ZONE::AppendCorner(), m_zones, NEWITEM, PICKED_ITEMS_LIST::PushItem(), ZONE::SetHatchStyle(), ZONE::SetLayer(), and BOARD_CONNECTED_ITEM::SetNetCode().

◆ AddListener()

void BOARD::AddListener ( BOARD_LISTENER aListener)

Add a listener to the board to receive calls whenever something on the board has been modified.

The board does not take ownership of the listener object. Make sure to call RemoveListener before deleting the listener object. The order of listener invocations is not guaranteed. If the specified listener object has been added before, it will not be added again.

Definition at line 2023 of file board.cpp.

2024{
2025 if( !alg::contains( m_listeners, aListener ) )
2026 m_listeners.push_back( aListener );
2027}
std::vector< BOARD_LISTENER * > m_listeners
Definition: board.h:1214
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.
Definition: kicad_algo.h:99

References alg::contains(), and m_listeners.

Referenced by DIALOG_NET_INSPECTOR::DIALOG_NET_INSPECTOR(), APPEARANCE_CONTROLS::OnBoardChanged(), DIALOG_NET_INSPECTOR::onBoardChanged(), PCB_SEARCH_PANE::onBoardChanged(), and PCB_SEARCH_PANE::PCB_SEARCH_PANE().

◆ AllConnectedItems()

const std::vector< BOARD_CONNECTED_ITEM * > BOARD::AllConnectedItems ( )

Definition at line 1979 of file board.cpp.

1980{
1981 std::vector<BOARD_CONNECTED_ITEM*> items;
1982
1983 for( PCB_TRACK* track : Tracks() )
1984 items.push_back( track );
1985
1986 for( FOOTPRINT* footprint : Footprints() )
1987 {
1988 for( PAD* pad : footprint->Pads() )
1989 items.push_back( pad );
1990 }
1991
1992 for( ZONE* zone : Zones() )
1993 items.push_back( zone );
1994
1995 return items;
1996}
ZONES & Zones()
Definition: board.h:313
FOOTPRINTS & Footprints()
Definition: board.h:307
TRACKS & Tracks()
Definition: board.h:304
Definition: pad.h:59

References Footprints(), pad, Tracks(), and Zones().

Referenced by MapNets(), and SanitizeNetcodes().

◆ BeginNets()

NETINFO_LIST::iterator BOARD::BeginNets ( ) const
inline
Returns
iterator to the first element of the NETINFO_ITEMs list.

Definition at line 779 of file board.h.

780 {
781 return m_NetInfo.begin();
782 }
iterator begin() const
Definition: netinfo.h:453

References NETINFO_LIST::begin(), and m_NetInfo.

◆ BuildConnectivity()

bool BOARD::BuildConnectivity ( PROGRESS_REPORTER aReporter = nullptr)

Build or rebuild the board connectivity database for the board, especially the list of connected items, list of nets and rastnest data Needed after loading a board to have the connectivity database updated.

Definition at line 162 of file board.cpp.

163{
164 if( !GetConnectivity()->Build( this, aReporter ) )
165 return false;
166
168 return true;
169}
void UpdateRatsnestExclusions()
Update the visibility flags on the current unconnected ratsnest lines.
Definition: board.cpp:266
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
Definition: board.h:424

References GetConnectivity(), and UpdateRatsnestExclusions().

Referenced by PCB_CONTROL::AppendBoard(), TRACKS_CLEANER::deleteDanglingTracks(), KI_TEST::FillZones(), PCB_EDIT_FRAME::ImportSpecctraSession(), LoadBoard(), PCB_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::RebuildAndRefresh(), PCB_BASE_FRAME::rebuildConnectivity(), EDIT_TOOL::rebuildConnectivity(), ZONE_FILLER_TOOL::rebuildConnectivity(), TEARDROP_MANAGER::RemoveTeardrops(), SaveBoard(), PCB_EDIT_FRAME::SetBoard(), PANEL_SETUP_LAYERS::TransferDataFromWindow(), BOARD_NETLIST_UPDATER::UpdateNetlist(), and PCB_EDIT_FRAME::UpdateUserInterface().

◆ BuildListOfNets()

◆ CacheTriangulation()

void BOARD::CacheTriangulation ( PROGRESS_REPORTER aReporter = nullptr,
const std::vector< ZONE * > &  aZones = {} 
)

Definition at line 700 of file board.cpp.

701{
702 std::vector<ZONE*> zones = aZones;
703
704 if( zones.empty() )
705 zones = m_zones;
706
707 if( zones.empty() )
708 return;
709
710 if( aReporter )
711 aReporter->Report( _( "Tessellating copper zones..." ) );
712
714 std::vector<std::future<size_t>> returns;
715
716 returns.reserve( zones.size() );
717
718 auto cache_zones = [aReporter]( ZONE* aZone ) -> size_t
719 {
720 if( aReporter && aReporter->IsCancelled() )
721 return 0;
722
723 aZone->CacheTriangulation();
724
725 if( aReporter )
726 aReporter->AdvanceProgress();
727
728 return 1;
729 };
730
731 for( ZONE* zone : zones )
732 returns.emplace_back( tp.submit( cache_zones, zone ) );
733
734 // Finalize the triangulation threads
735 for( const std::future<size_t>& ret : returns )
736 {
737 std::future_status status = ret.wait_for( std::chrono::milliseconds( 250 ) );
738
739 while( status != std::future_status::ready )
740 {
741 if( aReporter )
742 aReporter->KeepRefreshing();
743
744 status = ret.wait_for( std::chrono::milliseconds( 250 ) );
745 }
746 }
747}
virtual bool IsCancelled() const =0
virtual bool KeepRefreshing(bool aWait=false)=0
Update the UI (if any).
virtual void Report(const wxString &aMessage)=0
Display aMessage in the progress bar dialog.
virtual void AdvanceProgress()=0
Increment the progress bar length (inside the current virtual zone).
thread_pool & GetKiCadThreadPool()
Get a reference to the current thread pool.
Definition: thread_pool.cpp:32
static thread_pool * tp
Definition: thread_pool.cpp:30
BS::thread_pool thread_pool
Definition: thread_pool.h:30

References _, PROGRESS_REPORTER::AdvanceProgress(), GetKiCadThreadPool(), PROGRESS_REPORTER::IsCancelled(), PROGRESS_REPORTER::KeepRefreshing(), m_zones, PROGRESS_REPORTER::Report(), and tp.

Referenced by CONNECTIVITY_DATA::Build(), and PCB_DRAW_PANEL_GAL::DisplayBoard().

◆ ClassOf()

static bool BOARD::ClassOf ( const EDA_ITEM aItem)
inlinestatic

Definition at line 267 of file board.h.

268 {
269 return aItem && PCB_T == aItem->Type();
270 }

References PCB_T, and EDA_ITEM::Type().

◆ ClearBrightened()

void EDA_ITEM::ClearBrightened ( )
inlineinherited

Definition at line 119 of file eda_item.h.

void ClearFlags(EDA_ITEM_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: eda_item.h:141
#define BRIGHTENED
item is drawn with a bright contour

References BRIGHTENED, and EDA_ITEM::ClearFlags().

Referenced by SCH_EDIT_FRAME::FocusOnItem(), PCB_BASE_FRAME::FocusOnItems(), EE_SELECTION_TOOL::unhighlight(), PL_SELECTION_TOOL::unhighlight(), PCB_SELECTION_TOOL::unhighlightInternal(), and SCH_EDITOR_CONTROL::UpdateNetHighlighting().

◆ ClearEditFlags()

◆ ClearFlags()

void EDA_ITEM::ClearFlags ( EDA_ITEM_FLAGS  aMask = EDA_ITEM_ALL_FLAGS)
inlineinherited

Definition at line 141 of file eda_item.h.

141{ m_flags &= ~aMask; }
EDA_ITEM_FLAGS m_flags
Definition: eda_item.h:498

References EDA_ITEM::m_flags.

Referenced by FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), PNS_KICAD_IFACE::AddItem(), SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), SCH_MOVE_TOOL::AlignElements(), SCH_EDIT_TOOL::BreakWire(), FOOTPRINT::BuildCourtyardCaches(), EDA_ITEM::ClearBrightened(), EDA_ITEM::ClearEditFlags(), EDA_ITEM::ClearSelected(), EDA_ITEM::ClearTempFlags(), SCH_EDIT_FRAME::ConvertPart(), SYMBOL_EDITOR_EDIT_TOOL::Copy(), FOOTPRINT_EDITOR_CONTROL::CreateFootprint(), SYMBOL_EDITOR_PIN_TOOL::CreateImagePins(), MICROWAVE_TOOL::createMicrowaveInductor(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), PCB_TOOL_BASE::doInteractiveItemPlacement(), KIGFX::SCH_PAINTER::draw(), SCH_ITEM::Duplicate(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), PCB_EDIT_FRAME::ExchangeFootprint(), PCB_SELECTION_TOOL::ExitGroup(), SYMBOL_EDIT_FRAME::GetSymbolFromRedoList(), SYMBOL_EDIT_FRAME::GetSymbolFromUndoList(), FOOTPRINT_EDITOR_CONTROL::ImportFootprint(), DRC_INTERACTIVE_COURTYARD_CLEARANCE::Init(), EE_COLLECTOR::Inspect(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromLibrary(), FOOTPRINT_EDITOR_CONTROL::NewFootprint(), DIALOG_SYMBOL_PROPERTIES::OnUnitChoice(), FOOTPRINT_EDIT_FRAME::OpenProjectFiles(), PCB_BASE_FRAME::PlaceFootprint(), SYMBOL_EDITOR_PIN_TOOL::PlacePin(), BOARD_COMMIT::Push(), PCB_SELECTION_TOOL::RebuildSelection(), PAD_TOOL::RecombinePad(), SCH_EDIT_TOOL::RepeatDrawItem(), SYMBOL_EDIT_FRAME::RollbackSymbolFromUndo(), DRC_TEST_PROVIDER_DISALLOW::Run(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_SEXPR_PLUGIN_CACHE::savePin(), EE_SELECTION_TOOL::selectMultiple(), SCH_EDIT_FRAME::SelectUnit(), EDA_ITEM::SetIsShownAsBitmap(), BOARD_COMMIT::Stage(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), SCH_DRAWING_TOOLS::TwoClickPlace(), and EE_SELECTION_TOOL::unhighlight().

◆ ClearProject()

void BOARD::ClearProject ( )

Definition at line 206 of file board.cpp.

207{
208 if( !m_project )
209 return;
210
212
213 // Owned by the BOARD
214 if( project.m_BoardSettings )
215 {
216 project.ReleaseNestedSettings( project.m_BoardSettings );
217 project.m_BoardSettings = nullptr;
218 }
219
221 GetDesignSettings().SetParent( nullptr );
222 m_project = nullptr;
223}
void SetParent(JSON_SETTINGS *aParent, bool aLoadFromFile=true)
The backing store for a PROJECT, in JSON format.
Definition: project_file.h:65
virtual PROJECT_FILE & GetProjectFile() const
Definition: project.h:149

References GetDesignSettings(), PROJECT::GetProjectFile(), BOARD_DESIGN_SETTINGS::m_NetSettings, m_project, project, and NESTED_SETTINGS::SetParent().

Referenced by PCB_EDIT_FRAME::doCloseWindow(), PCB_EDIT_FRAME::Files_io_from_id(), DIALOG_BOARD_SETUP::onAuxiliaryAction(), PCB_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::SetBoard(), and SetProject().

◆ ClearSelected()

◆ ClearTempFlags()

void EDA_ITEM::ClearTempFlags ( )
inlineinherited

Definition at line 153 of file eda_item.h.

154 {
156 }
#define IS_LINKED
Used in calculation to mark linked items (temporary use)
#define SELECTED_BY_DRAG
Item was algorithmically selected as a dragged item.
#define SKIP_STRUCT
flag indicating that the structure should be ignored
#define CANDIDATE
flag indicating that the structure is connected

References CANDIDATE, EDA_ITEM::ClearFlags(), IS_LINKED, SELECTED_BY_DRAG, and SKIP_STRUCT.

Referenced by PCB_EDIT_FRAME::OpenProjectFiles(), and SCH_EDIT_FRAME::PutDataInPreviousState().

◆ ClearViewPrivData()

void KIGFX::VIEW_ITEM::ClearViewPrivData ( )
inlineinherited

Definition at line 143 of file view_item.h.

144 {
145 m_viewPrivData = nullptr;
146 }
VIEW_ITEM_DATA * m_viewPrivData
Definition: view_item.h:151

References KIGFX::VIEW_ITEM::m_viewPrivData.

Referenced by KIGFX::VIEW::OnDestroy().

◆ Clone()

EDA_ITEM * EDA_ITEM::Clone ( ) const
virtualinherited

Create a duplicate of this item with linked list members set to NULL.

The default version will return NULL in release builds and likely crash the program. In debug builds, a warning message indicating the derived class has not implemented cloning. This really should be a pure virtual function. Due to the fact that there are so many objects derived from EDA_ITEM, the decision was made to return NULL until all the objects derived from EDA_ITEM implement cloning. Once that happens, this function should be made pure.

Returns
A clone of the item.

Reimplemented in LIB_FIELD, LIB_PIN, LIB_SHAPE, LIB_TEXT, LIB_TEXTBOX, SCH_BITMAP, SCH_BUS_WIRE_ENTRY, SCH_BUS_BUS_ENTRY, SCH_FIELD, SCH_JUNCTION, SCH_LABEL, SCH_DIRECTIVE_LABEL, SCH_GLOBALLABEL, SCH_HIERLABEL, SCH_LINE, SCH_MARKER, SCH_NO_CONNECT, SCH_PIN, SCH_SHAPE, SCH_SHEET, SCH_SHEET_PIN, SCH_SYMBOL, SCH_TEXT, SCH_TEXTBOX, KIGFX::ORIGIN_VIEWITEM, PCB_GROUP, FOOTPRINT, FP_SHAPE, FP_TEXT, FP_TEXTBOX, NETINFO_ITEM, PAD, PCB_BITMAP, PCB_DIM_ALIGNED, PCB_DIM_ORTHOGONAL, PCB_DIM_RADIAL, PCB_DIM_LEADER, PCB_DIM_CENTER, PCB_MARKER, PCB_SHAPE, PCB_TARGET, PCB_TEXT, PCB_TEXTBOX, PCB_TRACK, PCB_ARC, PCB_VIA, ZONE, and FP_ZONE.

Definition at line 82 of file eda_item.cpp.

83{
84 wxCHECK_MSG( false, nullptr, wxT( "Clone not implemented in derived class " ) + GetClass() +
85 wxT( ". Bad programmer!" ) );
86}
virtual wxString GetClass() const =0
Return the class name.

References EDA_ITEM::GetClass().

Referenced by SCH_EDIT_FRAME::AddCopyForRepeatItem(), DIALOG_DIMENSION_PROPERTIES::DIALOG_DIMENSION_PROPERTIES(), BOARD_ITEM::Duplicate(), SCH_ITEM::Duplicate(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), PCB_DIMENSION_BASE::GetEffectiveShape(), LIB_SYMBOL::LIB_SYMBOL(), BOARD_COMMIT::makeImage(), new_clone(), LIB_SYMBOL::operator=(), SYMBOL_EDITOR_EDIT_TOOL::Paste(), SCH_LIB_PLUGIN_CACHE::removeSymbol(), PCB_BASE_EDIT_FRAME::saveCopyInUndoList(), CLIPBOARD_IO::SaveSelection(), LIB_SYMBOL::SetConversion(), LIB_SYMBOL::SetUnitCount(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), and SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace().

◆ ComputeBoundingBox()

BOX2I BOARD::ComputeBoundingBox ( bool  aBoardEdgesOnly = false) const

Calculate the bounding box containing all board items (or board edge segments).

Parameters
aBoardEdgesOnlyis true if we are interested in board edge segments only.
Returns
the board's bounding box.

Definition at line 1231 of file board.cpp.

1232{
1233 BOX2I bbox;
1234 LSET visible = GetVisibleLayers();
1235 bool showInvisibleText = IsElementVisible( LAYER_MOD_TEXT_INVISIBLE )
1236 && PgmOrNull() && !PgmOrNull()->m_Printing;
1237
1238 if( aBoardEdgesOnly )
1239 visible.set( Edge_Cuts );
1240
1241 // Check shapes, dimensions, texts, and fiducials
1242 for( BOARD_ITEM* item : m_drawings )
1243 {
1244 if( aBoardEdgesOnly && ( item->GetLayer() != Edge_Cuts || item->Type() != PCB_SHAPE_T ) )
1245 continue;
1246
1247 if( ( item->GetLayerSet() & visible ).any() )
1248 bbox.Merge( item->GetBoundingBox() );
1249 }
1250
1251 // Check footprints
1252 for( FOOTPRINT* footprint : m_footprints )
1253 {
1254 if( !( footprint->GetLayerSet() & visible ).any() )
1255 continue;
1256
1257 if( aBoardEdgesOnly )
1258 {
1259 for( const BOARD_ITEM* edge : footprint->GraphicalItems() )
1260 {
1261 if( edge->GetLayer() == Edge_Cuts && edge->Type() == PCB_FP_SHAPE_T )
1262 bbox.Merge( edge->GetBoundingBox() );
1263 }
1264 }
1265 else
1266 {
1267 bbox.Merge( footprint->GetBoundingBox( true, showInvisibleText ) );
1268 }
1269 }
1270
1271 if( !aBoardEdgesOnly )
1272 {
1273 // Check tracks
1274 for( PCB_TRACK* track : m_tracks )
1275 {
1276 if( ( track->GetLayerSet() & visible ).any() )
1277 bbox.Merge( track->GetBoundingBox() );
1278 }
1279
1280 // Check zones
1281 for( ZONE* aZone : m_zones )
1282 {
1283 if( ( aZone->GetLayerSet() & visible ).any() )
1284 bbox.Merge( aZone->GetBoundingBox() );
1285 }
1286 }
1287
1288 return bbox;
1289}
LSET GetVisibleLayers() const
A proxy function that calls the correspondent function in m_BoardSettings.
Definition: board.cpp:579
bool IsElementVisible(GAL_LAYER_ID aLayer) const
Test whether a given element category is visible.
Definition: board.cpp:631
BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
Definition: box2.h:588
bool m_Printing
wxWidgets on MSW tends to crash if you spool up more than one print job at a time.
Definition: pgm_base.h:304
PGM_BASE * PgmOrNull()
similar to PGM_BASE& Pgm(), but return a reference that can be nullptr when running a shared lib from...
Definition: cvpcb.cpp:125
@ LAYER_MOD_TEXT_INVISIBLE
text marked as invisible
Definition: layer_ids.h:200
@ Edge_Cuts
Definition: layer_ids.h:113
@ PCB_FP_SHAPE_T
class FP_SHAPE, a footprint edge
Definition: typeinfo.h:94

References Edge_Cuts, GetVisibleLayers(), IsElementVisible(), LAYER_MOD_TEXT_INVISIBLE, m_drawings, m_footprints, PGM_BASE::m_Printing, m_tracks, m_zones, BOX2< Vec >::Merge(), PCB_FP_SHAPE_T, PCB_SHAPE_T, and PgmOrNull().

Referenced by buildBoardBoundingBoxPoly(), BuildBoardPolygonOutlines(), PCB_EDIT_FRAME::ExportToGenCAD(), PLACE_FILE_EXPORTER::GenReportData(), GetBoardEdgesBoundingBox(), GetBoundingBox(), PCBNEW_PRINTOUT::getBoundingBox(), initializePlotter(), BOARD_ADAPTER::InitSettings(), DIALOG_EXPORT_STEP::onExportButton(), PCB_PLOT_SVG::Plot(), and StartPlotBoard().

◆ ConvertBrdLayerToPolygonalContours()

void BOARD::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, texts, zones).

Holes in vias or pads are ignored. The polygons are not merged. This is useful to export the shape of copper layers to dxf polygons or 3D viewer/

Parameters
aLayeris a copper layer, like B_Cu, etc.
aOutlinesis the SHAPE_POLY_SET to fill in with items outline.

Definition at line 2249 of file board.cpp.

2251{
2252 int maxError = GetDesignSettings().m_MaxError;
2253
2254 // convert tracks and vias:
2255 for( const PCB_TRACK* track : m_tracks )
2256 {
2257 if( !track->IsOnLayer( aLayer ) )
2258 continue;
2259
2260 track->TransformShapeToPolygon( aOutlines, aLayer, 0, maxError, ERROR_INSIDE );
2261 }
2262
2263 // convert pads and other copper items in footprints
2264 for( const FOOTPRINT* footprint : m_footprints )
2265 {
2266 footprint->TransformPadsToPolySet( aOutlines, aLayer, 0, maxError, ERROR_INSIDE );
2267
2268 // Microwave footprints may have items on copper layers
2269 footprint->TransformFPShapesToPolySet( aOutlines, aLayer, 0, maxError, ERROR_INSIDE,
2270 true, /* include text */
2271 true, /* include shapes */
2272 false /* include private items */ );
2273
2274 for( const ZONE* zone : footprint->Zones() )
2275 {
2276 if( zone->GetLayerSet().test( aLayer ) )
2277 zone->TransformSolidAreasShapesToPolygon( aLayer, aOutlines );
2278 }
2279 }
2280
2281 // convert copper zones
2282 for( const ZONE* zone : Zones() )
2283 {
2284 if( zone->GetLayerSet().test( aLayer ) )
2285 zone->TransformSolidAreasShapesToPolygon( aLayer, aOutlines );
2286 }
2287
2288 // convert graphic items on copper layers (texts)
2289 for( const BOARD_ITEM* item : m_drawings )
2290 {
2291 if( !item->IsOnLayer( aLayer ) )
2292 continue;
2293
2294 switch( item->Type() )
2295 {
2296 case PCB_SHAPE_T:
2297 {
2298 const PCB_SHAPE* shape = static_cast<const PCB_SHAPE*>( item );
2299 shape->TransformShapeToPolygon( aOutlines, aLayer, 0, maxError, ERROR_INSIDE );
2300 break;
2301 }
2302
2303 case PCB_TEXT_T:
2304 {
2305 const PCB_TEXT* text = static_cast<const PCB_TEXT*>( item );
2306 text->TransformTextToPolySet( aOutlines, aLayer, 0, maxError, ERROR_INSIDE );
2307 break;
2308 }
2309
2310 case PCB_TEXTBOX_T:
2311 {
2312 const PCB_TEXTBOX* textbox = static_cast<const PCB_TEXTBOX*>( item );
2313
2314 // plot border
2315 textbox->PCB_SHAPE::TransformShapeToPolygon( aOutlines, aLayer, 0, maxError,
2316 ERROR_INSIDE );
2317 // plot text
2318 textbox->TransformTextToPolySet( aOutlines, aLayer, 0, maxError, ERROR_INSIDE );
2319 break;
2320 }
2321
2322 default:
2323 break;
2324 }
2325 }
2326}
void TransformShapeToPolygon(SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, int aClearance, int aError, ERROR_LOC aErrorLoc, bool ignoreLineWidth=false) const override
Convert the shape to a closed polygon.
Definition: pcb_shape.cpp:390
void TransformTextToPolySet(SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, int aClearance, int aError, ERROR_LOC aErrorLoc) const
Function TransformTextToPolySet Convert the text to a polygonSet describing the actual character stro...
@ ERROR_INSIDE

References ERROR_INSIDE, GetDesignSettings(), m_drawings, m_footprints, BOARD_DESIGN_SETTINGS::m_MaxError, m_tracks, PCB_SHAPE_T, PCB_TEXT_T, PCB_TEXTBOX_T, text, PCB_SHAPE::TransformShapeToPolygon(), PCB_TEXTBOX::TransformTextToPolySet(), and Zones().

Referenced by EXPORTER_PCB_VRML::ExportStandardLayers(), EXPORTER_PCB_VRML::ExportVrmlSolderMask(), and PlotLayerOutlines().

◆ ConvertCrossReferencesToKIIDs()

wxString BOARD::ConvertCrossReferencesToKIIDs ( const wxString &  aSource) const

Convert cross-references back and forth between ${refDes:field} and ${kiid:field}.

Definition at line 1112 of file board.cpp.

1113{
1114 wxString newbuf;
1115 size_t sourceLen = aSource.length();
1116
1117 for( size_t i = 0; i < sourceLen; ++i )
1118 {
1119 if( aSource[i] == '$' && i + 1 < sourceLen && aSource[i+1] == '{' )
1120 {
1121 wxString token;
1122 bool isCrossRef = false;
1123
1124 for( i = i + 2; i < sourceLen; ++i )
1125 {
1126 if( aSource[i] == '}' )
1127 break;
1128
1129 if( aSource[i] == ':' )
1130 isCrossRef = true;
1131
1132 token.append( aSource[i] );
1133 }
1134
1135 if( isCrossRef )
1136 {
1137 wxString remainder;
1138 wxString ref = token.BeforeFirst( ':', &remainder );
1139
1140 for( const FOOTPRINT* footprint : Footprints() )
1141 {
1142 if( footprint->GetReference().CmpNoCase( ref ) == 0 )
1143 {
1144 wxString test( remainder );
1145
1146 if( footprint->ResolveTextVar( &test ) )
1147 token = footprint->m_Uuid.AsString() + wxT( ":" ) + remainder;
1148
1149 break;
1150 }
1151 }
1152 }
1153
1154 newbuf.append( wxT( "${" ) + token + wxT( "}" ) );
1155 }
1156 else
1157 {
1158 newbuf.append( aSource[i] );
1159 }
1160 }
1161
1162 return newbuf;
1163}

References Footprints().

Referenced by DIALOG_TEXTBOX_PROPERTIES::TransferDataFromWindow(), and DIALOG_DIMENSION_PROPERTIES::updateDimensionFromDialog().

◆ ConvertKIIDsToCrossReferences()

wxString BOARD::ConvertKIIDsToCrossReferences ( const wxString &  aSource) const

Definition at line 1166 of file board.cpp.

1167{
1168 wxString newbuf;
1169 size_t sourceLen = aSource.length();
1170
1171 for( size_t i = 0; i < sourceLen; ++i )
1172 {
1173 if( aSource[i] == '$' && i + 1 < sourceLen && aSource[i+1] == '{' )
1174 {
1175 wxString token;
1176 bool isCrossRef = false;
1177
1178 for( i = i + 2; i < sourceLen; ++i )
1179 {
1180 if( aSource[i] == '}' )
1181 break;
1182
1183 if( aSource[i] == ':' )
1184 isCrossRef = true;
1185
1186 token.append( aSource[i] );
1187 }
1188
1189 if( isCrossRef )
1190 {
1191 wxString remainder;
1192 wxString ref = token.BeforeFirst( ':', &remainder );
1193 BOARD_ITEM* refItem = GetItem( KIID( ref ) );
1194
1195 if( refItem && refItem->Type() == PCB_FOOTPRINT_T )
1196 {
1197 token = static_cast<FOOTPRINT*>( refItem )->GetReference() + wxT( ":" )
1198 + remainder;
1199 }
1200 }
1201
1202 newbuf.append( wxT( "${" ) + token + wxT( "}" ) );
1203 }
1204 else
1205 {
1206 newbuf.append( aSource[i] );
1207 }
1208 }
1209
1210 return newbuf;
1211}
BOARD_ITEM * GetItem(const KIID &aID) const
Definition: board.cpp:997
Definition: kiid.h:48

References GetItem(), PCB_FOOTPRINT_T, and EDA_ITEM::Type().

Referenced by DIALOG_DIMENSION_PROPERTIES::TransferDataToWindow(), and DIALOG_TEXTBOX_PROPERTIES::TransferDataToWindow().

◆ Delete()

virtual void BOARD_ITEM_CONTAINER::Delete ( BOARD_ITEM aItem)
inlinevirtualinherited

Removes an item from the container and deletes it.

Definition at line 77 of file board_item_container.h.

78 {
79 Remove( aItem );
80 delete aItem;
81 }
virtual void Remove(BOARD_ITEM *aItem, REMOVE_MODE aMode=REMOVE_MODE::NORMAL)=0
Removes an item from the container.

References BOARD_ITEM_CONTAINER::Remove().

Referenced by DRC_ITEMS_PROVIDER::DeleteItem(), PCB_PARSER::parseBOARD_unchecked(), and BOARD_COMMIT::Push().

◆ DeleteAllFootprints()

void BOARD::DeleteAllFootprints ( )

Remove all footprints from the deque and free the memory associated with them.

Definition at line 988 of file board.cpp.

989{
990 for( FOOTPRINT* footprint : m_footprints )
991 delete footprint;
992
993 m_footprints.clear();
994}

References m_footprints.

Referenced by FOOTPRINT_VIEWER_FRAME::ClickOnFootprintList(), DISPLAY_FOOTPRINTS_FRAME::InitDisplay(), FOOTPRINT_WIZARD_FRAME::ReloadFootprint(), FOOTPRINT_VIEWER_FRAME::SelectAndViewFootprint(), and DISPLAY_FOOTPRINTS_FRAME::~DISPLAY_FOOTPRINTS_FRAME().

◆ DeleteMARKERs() [1/2]

void BOARD::DeleteMARKERs ( )

Delete all MARKERS from the board.

Definition at line 956 of file board.cpp.

957{
958 // the vector does not know how to delete the PCB_MARKER, it holds pointers
959 for( PCB_MARKER* marker : m_markers )
960 delete marker;
961
962 m_markers.clear();
963}

References m_markers.

Referenced by DIALOG_FOOTPRINT_CHECKER::deleteAllMarkers(), DIALOG_DRC::deleteAllMarkers(), DIALOG_GLOBAL_DELETION::DoGlobalDeletions(), DSN::SPECCTRA_DB::FromSESSION(), and ~BOARD().

◆ DeleteMARKERs() [2/2]

void BOARD::DeleteMARKERs ( bool  aWarningsAndErrors,
bool  aExclusions 
)

Definition at line 966 of file board.cpp.

967{
968 // Deleting lots of items from a vector can be very slow. Copy remaining items instead.
969 MARKERS remaining;
970
971 for( PCB_MARKER* marker : m_markers )
972 {
973 if( ( marker->GetSeverity() == RPT_SEVERITY_EXCLUSION && aExclusions )
974 || ( marker->GetSeverity() != RPT_SEVERITY_EXCLUSION && aWarningsAndErrors ) )
975 {
976 delete marker;
977 }
978 else
979 {
980 remaining.push_back( marker );
981 }
982 }
983
984 m_markers = remaining;
985}
@ RPT_SEVERITY_EXCLUSION

References m_markers, and RPT_SEVERITY_EXCLUSION.

◆ DeleteStructure()

void BOARD_ITEM::DeleteStructure ( )
inherited

Delete this object after removing from its parent if it has one.

Definition at line 150 of file board_item.cpp.

151{
153
154 if( parent )
155 parent->Remove( this );
156
157 delete this;
158}
Abstract interface for BOARD_ITEMs capable of storing other items inside.
BOARD_ITEM_CONTAINER * GetParent() const
Definition: board_item.h:163

References BOARD_ITEM::GetParent(), and BOARD_ITEM_CONTAINER::Remove().

Referenced by DIALOG_FOOTPRINT_PROPERTIES::TransferDataFromWindow().

◆ Drawings() [1/2]

◆ Drawings() [2/2]

const DRAWINGS & BOARD::Drawings ( ) const
inline

Definition at line 311 of file board.h.

311{ return m_drawings; }

References m_drawings.

◆ Duplicate()

BOARD_ITEM * BOARD_ITEM::Duplicate ( ) const
virtualinherited

Create a copy of this BOARD_ITEM.

Reimplemented in FOOTPRINT.

Definition at line 184 of file board_item.cpp.

185{
186 BOARD_ITEM* dupe = static_cast<BOARD_ITEM*>( Clone() );
187 const_cast<KIID&>( dupe->m_Uuid ) = KIID();
188
189 if( dupe->GetParentGroup() )
190 dupe->GetParentGroup()->AddItem( dupe );
191
192 return static_cast<BOARD_ITEM*>( dupe );
193}
PCB_GROUP * GetParentGroup() const
Definition: board_item.h:72
const KIID m_Uuid
Definition: eda_item.h:492
virtual EDA_ITEM * Clone() const
Create a duplicate of this item with linked list members set to NULL.
Definition: eda_item.cpp:82
bool AddItem(BOARD_ITEM *aItem)
Add item to group.
Definition: pcb_group.cpp:80

References PCB_GROUP::AddItem(), EDA_ITEM::Clone(), BOARD_ITEM::GetParentGroup(), and EDA_ITEM::m_Uuid.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::addAttribute(), PCB_GROUP::DeepDuplicate(), KIGFX::PCB_PAINTER::draw(), CADSTAR_PCB_ARCHIVE_LOADER::drawCadstarText(), FOOTPRINT::Duplicate(), EDIT_TOOL::Duplicate(), FOOTPRINT::DuplicateItem(), and ARRAY_CREATOR::Invoke().

◆ EndNets()

NETINFO_LIST::iterator BOARD::EndNets ( ) const
inline
Returns
iterator to the last element of the NETINFO_ITEMs list.

Definition at line 787 of file board.h.

788 {
789 return m_NetInfo.end();
790 }
iterator end() const
Definition: netinfo.h:458

References NETINFO_LIST::end(), and m_NetInfo.

◆ FillItemMap()

void BOARD::FillItemMap ( std::map< KIID, EDA_ITEM * > &  aMap)

Definition at line 1076 of file board.cpp.

1077{
1078 // the board itself
1079 aMap[ m_Uuid ] = this;
1080
1081 for( PCB_TRACK* track : Tracks() )
1082 aMap[ track->m_Uuid ] = track;
1083
1084 for( FOOTPRINT* footprint : Footprints() )
1085 {
1086 aMap[ footprint->m_Uuid ] = footprint;
1087
1088 for( PAD* pad : footprint->Pads() )
1089 aMap[ pad->m_Uuid ] = pad;
1090
1091 aMap[ footprint->Reference().m_Uuid ] = &footprint->Reference();
1092 aMap[ footprint->Value().m_Uuid ] = &footprint->Value();
1093
1094 for( BOARD_ITEM* drawing : footprint->GraphicalItems() )
1095 aMap[ drawing->m_Uuid ] = drawing;
1096 }
1097
1098 for( ZONE* zone : Zones() )
1099 aMap[ zone->m_Uuid ] = zone;
1100
1101 for( BOARD_ITEM* drawing : Drawings() )
1102 aMap[ drawing->m_Uuid ] = drawing;
1103
1104 for( PCB_MARKER* marker : m_markers )
1105 aMap[ marker->m_Uuid ] = marker;
1106
1107 for( PCB_GROUP* group : m_groups )
1108 aMap[ group->m_Uuid ] = group;
1109}
DRAWINGS & Drawings()
Definition: board.h:310

References Drawings(), Footprints(), group, m_groups, m_markers, EDA_ITEM::m_Uuid, pad, Tracks(), and Zones().

Referenced by WriteDRCReport(), and DIALOG_DRC::writeReport().

◆ FinalizeBulkAdd()

void BOARD::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 at line 847 of file board.cpp.

848{
850}
virtual void OnBoardItemsAdded(BOARD &aBoard, std::vector< BOARD_ITEM * > &aBoardItem)
Definition: board.h:241

References InvokeListeners(), and BOARD_LISTENER::OnBoardItemsAdded().

Referenced by PCB_PARSER::parseBOARD_unchecked(), BOARD_COMMIT::Push(), and BOARD_COMMIT::Revert().

◆ FinalizeBulkRemove()

void BOARD::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 at line 853 of file board.cpp.

854{
856}
virtual void OnBoardItemsRemoved(BOARD &aBoard, std::vector< BOARD_ITEM * > &aBoardItem)
Definition: board.h:243

References InvokeListeners(), and BOARD_LISTENER::OnBoardItemsRemoved().

Referenced by BOARD_COMMIT::Push(), and BOARD_COMMIT::Revert().

◆ FindFootprintByPath()

FOOTPRINT * BOARD::FindFootprintByPath ( const KIID_PATH aPath) const

Search for a FOOTPRINT within this board with the given path.

Parameters
aPathThe path ([sheetUUID, .., symbolUUID]) to search for.
Returns
If found, the FOOTPRINT having the given uuid, else NULL.

Definition at line 1489 of file board.cpp.

1490{
1491 for( FOOTPRINT* footprint : m_footprints )
1492 {
1493 if( footprint->GetPath() == aPath )
1494 return footprint;
1495 }
1496
1497 return nullptr;
1498}

References m_footprints.

Referenced by PCB_EDIT_FRAME::LoadFootprints().

◆ FindFootprintByReference()

FOOTPRINT * BOARD::FindFootprintByReference ( const wxString &  aReference) const

Search for a FOOTPRINT within this board with the given reference designator.

Finds only the first one, if there is more than one such FOOTPRINT.

Parameters
aReferenceThe reference designator of the FOOTPRINT to find.
Returns
If found the FOOTPRINT having the given reference designator, else nullptr.

Definition at line 1477 of file board.cpp.

1478{
1479 for( FOOTPRINT* footprint : m_footprints )
1480 {
1481 if( aReference == footprint->GetReference() )
1482 return footprint;
1483 }
1484
1485 return nullptr;
1486}

References m_footprints.

Referenced by DSN::SPECCTRA_DB::FromSESSION(), PCB_EDIT_FRAME::LoadFootprints(), and DRC_TEST_PROVIDER_SCHEMATIC_PARITY::testNetlist().

◆ FindNet() [1/2]

NETINFO_ITEM * BOARD::FindNet ( const wxString &  aNetname) const

Search for a net with the given name.

Parameters
aNetnameA Netname to search for.
Returns
the net if found or NULL if not found.

Definition at line 1471 of file board.cpp.

1472{
1473 return m_NetInfo.GetNetItem( aNetname );
1474}
NETINFO_ITEM * GetNetItem(int aNetCode) const

References NETINFO_LIST::GetNetItem(), and m_NetInfo.

◆ FindNet() [2/2]

NETINFO_ITEM * BOARD::FindNet ( int  aNetcode) const

Search for a net with the given netcode.

Parameters
aNetcodeA netcode to search for.
Returns
the net if found or NULL if not found.

Definition at line 1456 of file board.cpp.

1457{
1458 // the first valid netcode is 1 and the last is m_NetInfo.GetCount()-1.
1459 // zero is reserved for "no connection" and is not actually a net.
1460 // nullptr is returned for non valid netcodes
1461
1462 wxASSERT( m_NetInfo.GetNetCount() > 0 );
1463
1464 if( aNetcode == NETINFO_LIST::UNCONNECTED && m_NetInfo.GetNetCount() == 0 )
1466 else
1467 return m_NetInfo.GetNetItem( aNetcode );
1468}
static const int UNCONNECTED
Constant that forces initialization of a netinfo item to the NETINFO_ITEM ORPHANED (typically -1) whe...
Definition: netinfo.h:382
static NETINFO_ITEM * OrphanedItem()
Wrapper class, so you can iterate through NETINFO_ITEM*s, not std::pair<int/wxString,...
Definition: netinfo.h:390
unsigned GetNetCount() const
Definition: netinfo.h:356

References NETINFO_LIST::GetNetCount(), NETINFO_LIST::GetNetItem(), m_NetInfo, NETINFO_LIST::OrphanedItem(), and NETINFO_LIST::UNCONNECTED.

Referenced by PCAD2KICAD::PCB_PAD::AddToFootprint(), CreateSignalsSection(), PNS_PCBNEW_RULE_RESOLVER::DpCoupledNet(), PNS_PCBNEW_RULE_RESOLVER::DpNetPair(), PNS_PCBNEW_RULE_RESOLVER::DpNetPolarity(), PCB_EDIT_FRAME::Edit_Zone_Params(), DIALOG_COPPER_ZONE::ensureSelectedNetIsVisible(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), DSN::SPECCTRA_DB::FromBOARD(), DSN::SPECCTRA_DB::FromSESSION(), inDiffPairFunc(), DRC_ENGINE::IsNetADiffPair(), LEGACY_PLUGIN::loadNETINFO_ITEM(), LEGACY_PLUGIN::loadPAD(), MapNets(), PNS_PCBNEW_RULE_RESOLVER::NetName(), DIALOG_NET_INSPECTOR::onAddNet(), DIALOG_NET_INSPECTOR::onRenameNet(), NETINFO_MAPPING::iterator::operator*(), PCB_PARSER::parseNETINFO_ITEM(), PCB_PARSER::parsePAD(), PCB_PARSER::parseZONE(), BOARD_EDITOR_CONTROL::RepairBoard(), SanitizeNetcodes(), BOARD_CONNECTED_ITEM::SetNetCode(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::TransferDataToWindow(), BOARD_NETLIST_UPDATER::updateComponentPadConnections(), BOARD_NETLIST_UPDATER::updateCopperZoneNets(), and ROUTER_TOOL::UpdateMessagePanel().

◆ Flip()

void BOARD_ITEM::Flip ( const VECTOR2I aCentre,
bool  aFlipLeftRight 
)
virtualinherited

Flip this object, i.e.

change the board side for this object.

Parameters
aCentrethe rotation point.
aFlipLeftRightmirror across Y axis instead of X (the default).

Reimplemented in PCB_GROUP, FOOTPRINT, FP_SHAPE, FP_TEXT, FP_TEXTBOX, PCB_BITMAP, PCB_DIMENSION_BASE, PCB_MARKER, PCB_SHAPE, PCB_TARGET, PCB_TEXT, PCB_TEXTBOX, PCB_TRACK, PCB_ARC, PCB_VIA, ZONE, and PAD.

Definition at line 256 of file board_item.cpp.

257{
258 wxMessageBox( wxT( "virtual BOARD_ITEM::Flip used, should not occur" ), GetClass() );
259}

References EDA_ITEM::GetClass().

◆ Footprints() [1/2]

FOOTPRINTS & BOARD::Footprints ( )
inline

Definition at line 307 of file board.h.

307{ return m_footprints; }

References m_footprints.

Referenced by ZONE_FILLER::addHatchFillTypeOnZone(), GERBER_JOBFILE_WRITER::addJSONDesignRules(), RENDER_3D_RAYTRACE::addPadsAndVias(), AllConnectedItems(), PCB_CONTROL::AppendBoard(), AR_AUTOPLACER::AR_AUTOPLACER(), AR_AUTOPLACER::AutoplaceFootprints(), CN_CONNECTIVITY_ALGO::Build(), build_pad_testpoints(), BuildBoardPolygonOutlines(), ZONE_FILLER::buildCopperItemClearances(), FROM_TO_CACHE::buildEndpointList(), DIALOG_BOARD_REANNOTATE::BuildFootprintList(), GENDRILL_WRITER_BASE::buildHolesList(), DIALOG_NET_INSPECTOR::buildNetsList(), HYPERLYNX_EXPORTER::collectNetObjects(), TEARDROP_MANAGER::collectPadsCandidate(), EXPORTER_STEP::composePCB(), ConvertCrossReferencesToKIIDs(), CreateComponentsSection(), BOARD_ADAPTER::createLayers(), PLACEFILE_GERBER_WRITER::CreatePlaceFile(), CreateShapesSection(), CreateSignalsSection(), DIALOG_EXPORT_STEP::DIALOG_EXPORT_STEP(), PCB_DRAW_PANEL_GAL::DisplayBoard(), DIALOG_GLOBAL_DELETION::DoGlobalDeletions(), doPushPadProperties(), DRAWING_TOOL::DrawVia(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), PCB_EDIT_FRAME::Export_IDF3(), EXPORTER_PCB_VRML::ExportFp3DModelsAsLinkedFile(), PCB_EDIT_FRAME::ExportToGenCAD(), EXPORTER_PCB_VRML::ExportVRML_File(), ZONE_FILLER::Fill(), FillItemMap(), ZONE_FILLER::fillNonCopperZone(), DSN::SPECCTRA_DB::FlipFOOTPRINTs(), DRC_TEST_PROVIDER::forEachGeometryItem(), PCB_PLUGIN::format(), DSN::SPECCTRA_DB::FromBOARD(), RENDER_3D_OPENGL::generateViasAndPads(), PLACE_FILE_EXPORTER::GenPositionData(), PLACE_FILE_EXPORTER::GenReportData(), DIALOG_BOARD_STATISTICS::getDataFromPCB(), GetItem(), GetMsgPanelInfo(), NETINFO_ITEM::GetMsgPanelInfo(), PCB_DRAW_PANEL_GAL::GetMsgPanelInfo(), GetNodesCount(), GetPadFast(), GetPads(), GetSortedPadListByXthenYCoord(), DRC_INTERACTIVE_COURTYARD_CLEARANCE::Init(), DIALOG_GENDRILL::InitDisplayParams(), ZONE_FILLER::knockoutThermalReliefs(), RENDER_3D_RAYTRACE::load3DModels(), RENDER_3D_OPENGL::load3dModels(), DRC_ENGINE::loadImplicitRules(), BOARD_INSPECTION_TOOL::LocalRatsnestTool(), BOARD_INSPECTION_TOOL::makeDRCEngine(), AR_AUTOPLACER::nearestPad(), FOOTPRINT_EDIT_FRAME::OnUpdateSaveFootprintToBoard(), PCB_PARSER::parseBOARD_unchecked(), PCB_CONTROL::Paste(), AR_AUTOPLACER::pickFootprint(), PCB_CONTROL::placeBoardItems(), BRDITEMS_PLOTTER::PlotDrillMarks(), PlotInteractiveLayer(), PlotLayerOutlines(), PlotSolderMaskLayer(), PlotStandardLayer(), DIALOG_EXCHANGE_FOOTPRINTS::processMatchingFootprints(), BOARD_COMMIT::Push(), BOARD_REANNOTATE_TOOL::ReannotateDuplicates(), RecreateCmpFile(), RENDER_3D_OPENGL::render3dModelsSelected(), FOOTPRINT_EDITOR_CONTROL::RepairFootprint(), DSN::SPECCTRA_DB::RevertFOOTPRINTs(), DRC_CACHE_GENERATOR::Run(), DRC_TEST_PROVIDER_ANNULAR_WIDTH::Run(), DRC_TEST_PROVIDER_CONNECTION_WIDTH::Run(), DRC_TEST_PROVIDER_EDGE_CLEARANCE::Run(), DRC_TEST_PROVIDER_FOOTPRINT_CHECKS::Run(), DRC_TEST_PROVIDER_HOLE_SIZE::Run(), DRC_TEST_PROVIDER_LIBRARY_PARITY::Run(), DRC_TEST_PROVIDER_SOLDER_MASK::Run(), PCB_EDIT_FRAME::RunActionPlugin(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), CLIPBOARD_IO::SaveSelection(), DIALOG_FIND::search(), FOOTPRINT_SEARCH_HANDLER::Search(), searchAreas(), searchFootprints(), FOOTPRINT_EDIT_FRAME::SelectFootprintFromBoard(), SetElementVisibility(), ZONE_FILLER::subtractHigherPriorityZones(), PNS_KICAD_IFACE_BASE::SyncWorld(), DRC_INTERACTIVE_COURTYARD_CLEARANCE::testCourtyardClearances(), DRC_TEST_PROVIDER_COURTYARD_CLEARANCE::testCourtyardClearances(), DRC_TEST_PROVIDER_COURTYARD_CLEARANCE::testFootprintCourtyardDefinitions(), TestForExistingItem(), DRC_TEST_PROVIDER_SCHEMATIC_PARITY::testNetlist(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadClearances(), DRC_TEST_PROVIDER_ZONE_CONNECTIONS::testZoneLayer(), DIALOG_UNUSED_PAD_LAYERS::TransferDataFromWindow(), PANEL_SETUP_LAYERS::TransferDataFromWindow(), NETINFO_MAPPING::Update(), BOARD_NETLIST_UPDATER::UpdateNetlist(), HYPERLYNX_EXPORTER::writeDevices(), and HYPERLYNX_EXPORTER::writePadStacks().

◆ Footprints() [2/2]

const FOOTPRINTS & BOARD::Footprints ( ) const
inline

Definition at line 308 of file board.h.

308{ return m_footprints; }

References m_footprints.

◆ Get() [1/3]

template<typename T >
std::optional< T > INSPECTABLE::Get ( const wxString &  aProperty) const
inlineinherited

Definition at line 104 of file inspectable.h.

105 {
107 TYPE_ID thisType = TYPE_HASH( *this );
108 PROPERTY_BASE* prop = propMgr.GetProperty( thisType, aProperty );
109 std::optional<T> ret;
110
111 if( prop )
112 {
113 const void* object = propMgr.TypeCast( this, thisType, prop->OwnerHash() );
114
115 if( object )
116 ret = prop->get<T>( object );
117 }
118
119 return ret;
120 }
virtual size_t OwnerHash() const =0
Return type-id of the Owner class.
T get(const void *aObject) const
Definition: property.h:316
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:74
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:76
PROPERTY_BASE * GetProperty(TYPE_ID aType, const wxString &aProperty) const
Return a property for a specific type.
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Cast a type to another type.
#define TYPE_HASH(x)
Definition: property.h:62
size_t TYPE_ID
Unique type identifier.
Definition: property_mgr.h:46

References PROPERTY_BASE::get(), PROPERTY_MANAGER::GetProperty(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ Get() [2/3]

wxAny INSPECTABLE::Get ( PROPERTY_BASE aProperty) const
inlineinherited

Definition at line 84 of file inspectable.h.

85 {
87 const void* object = propMgr.TypeCast( this, TYPE_HASH( *this ), aProperty->OwnerHash() );
88 return object ? aProperty->getter( object ) : wxAny();
89 }
virtual wxAny getter(const void *aObject) const =0

References PROPERTY_BASE::getter(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

Referenced by BOOST_AUTO_TEST_CASE(), CLASS_D_DESC::CLASS_D_DESC(), EDA_SHAPE_DESC::EDA_SHAPE_DESC(), PROPERTIES_PANEL::getItemValue(), PCB_EXPR_VAR_REF::GetValue(), and PAD_DESC::PAD_DESC().

◆ Get() [3/3]

template<typename T >
T INSPECTABLE::Get ( PROPERTY_BASE aProperty) const
inlineinherited

Definition at line 92 of file inspectable.h.

93 {
95 const void* object = propMgr.TypeCast( this, TYPE_HASH( *this ), aProperty->OwnerHash() );
96
97 if( !object )
98 throw std::runtime_error( "Could not cast INSPECTABLE to the requested type" );
99
100 return aProperty->get<T>( object );
101 }

References PROPERTY_BASE::get(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ GetArea()

ZONE * BOARD::GetArea ( int  index) const
inline

Return the Zone at a given index.

Parameters
indexThe array type index into a collection of ZONE *.
Returns
a pointer to the Area or NULL if index out of range.

Definition at line 912 of file board.h.

913 {
914 if( (unsigned) index < m_zones.size() )
915 return m_zones[index];
916
917 return nullptr;
918 }

References m_zones.

Referenced by UpdateCopyOfZonesList().

◆ GetAreaCount()

int BOARD::GetAreaCount ( ) const
inline
Returns
The number of copper pour areas or ZONEs.

Definition at line 928 of file board.h.

929 {
930 return static_cast<int>( m_zones.size() );
931 }

References m_zones.

◆ GetBoard() [1/2]

BOARD * BOARD_ITEM::GetBoard ( )
virtualinherited

Definition at line 57 of file board_item.cpp.

58{
59 if( Type() == PCB_T )
60 return static_cast<BOARD*>( this );
61
62 BOARD_ITEM* parent = GetParent();
63
64 if( parent )
65 return parent->GetBoard();
66
67 return nullptr;
68}
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
Definition: board_item.cpp:43
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:265

References BOARD_ITEM::GetBoard(), BOARD_ITEM::GetParent(), PCB_T, and EDA_ITEM::Type().

◆ GetBoard() [2/2]

const BOARD * BOARD_ITEM::GetBoard ( ) const
virtualinherited

Return the BOARD in which this BOARD_ITEM resides, or NULL if none.

Definition at line 43 of file board_item.cpp.

44{
45 if( Type() == PCB_T )
46 return static_cast<const BOARD*>( this );
47
48 BOARD_ITEM* parent = GetParent();
49
50 if( parent )
51 return parent->GetBoard();
52
53 return nullptr;
54}

References BOARD_ITEM::GetBoard(), BOARD_ITEM::GetParent(), PCB_T, and EDA_ITEM::Type().

Referenced by BOARD_ADAPTER::addShape(), FOOTPRINT::BuildCourtyardCaches(), PAD::BuildEffectivePolygon(), PAD::BuildEffectiveShapes(), ZONE::BuildSmoothedPoly(), ZONE::CacheBoundingBox(), collidesWithArea(), KIGFX::PCB_PAINTER::draw(), KIGFX::PCB_PAINTER::Draw(), enclosedByAreaFunc(), existsOnLayerFunc(), PCB_VIA::FlashLayer(), PAD::FlashLayer(), FP_SHAPE::Flip(), FP_TEXT::Flip(), FP_TEXTBOX::Flip(), PCB_DIMENSION_BASE::Flip(), PCB_SHAPE::Flip(), PCB_TARGET::Flip(), PCB_TEXT::Flip(), PCB_TEXTBOX::Flip(), PCB_TRACK::Flip(), PCB_ARC::Flip(), PCB_VIA::Flip(), ZONE::Flip(), PCB_PLUGIN::format(), fromToFunc(), BOARD_ITEM::GetBoard(), PCB_EXPR_CONTEXT::GetBoard(), NETINFO_ITEM::GetBoundingBox(), ZONE::GetBoundingBox(), FOOTPRINT::GetBoundingBox(), FOOTPRINT::GetBoundingHull(), FOOTPRINT::GetCourtyard(), BOARD_CONNECTED_ITEM::GetEffectiveNetClass(), FP_TEXT::GetEffectiveShape(), PCB_TEXT::GetEffectiveShape(), getFieldFunc(), ZONE::GetInteractingZones(), ZONE::GetItemDescription(), BOARD_ITEM::GetLayerName(), PCB_VIA::GetMinAnnulus(), NETINFO_ITEM::GetMsgPanelInfo(), PCB_TRACK::GetMsgPanelInfo(), ZONE::GetMsgPanelInfo(), PCB_TRACK::GetMsgPanelInfoBase_Common(), BOARD_CONNECTED_ITEM::GetNetnameMsg(), BOARD_CONNECTED_ITEM::GetOwnClearance(), PAD::GetOwnClearance(), PCB_MARKER::GetSeverity(), PAD::GetSolderMaskExpansion(), PCB_VIA::GetSolderMaskExpansion(), PAD::GetSolderPasteMargin(), GetTrackLength(), PCB_TRACK::GetWidthConstraint(), inDiffPairFunc(), ROUTER_TOOL::Init(), intersectsAreaFunc(), intersectsBackCourtyardFunc(), intersectsCourtyardFunc(), intersectsFrontCourtyardFunc(), BOARD_ITEM::IsLocked(), PCB_VIA::IsTented(), BOARD_ITEM::layerMaskDescribe(), PCB_VIA::layerMaskDescribe(), PAD::MergePrimitivesAsPolygon(), ZONE::Move(), DIALOG_TEXTBOX_PROPERTIES::onBorderChecked(), EAGLE_PLUGIN::packageWire(), padsNeedUpdate(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), ResolveDRCExclusions(), FOOTPRINT::ResolveTextVar(), BOARD_CONNECTED_ITEM::SetNetCode(), TEARDROP_DIALOG::TEARDROP_DIALOG(), DRC_TEST_PROVIDER_SOLDER_MASK::testItemAgainstItems(), CONNECTIVITY_DATA::TestTrackEndpointDangling(), DIALOG_FOOTPRINT_PROPERTIES::TransferDataToWindow(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::TransferDataToWindow(), ZONE::TransformSmoothedOutlineToPolygon(), UpdateRatsnestExclusions(), FOOTPRINT::ViewBBox(), PAD::ViewBBox(), PCB_TRACK::ViewBBox(), PAD::ViewGetLOD(), PCB_BITMAP::ViewGetLOD(), PCB_VIA::ViewGetLOD(), FOOTPRINT::~FOOTPRINT(), and ZONE::~ZONE().

◆ GetBoardEdgesBoundingBox()

const BOX2I BOARD::GetBoardEdgesBoundingBox ( ) const
inline

Return the board bounding box calculated using exclusively the board edges (graphics on Edge.Cuts layer).

If there are items outside of the area limited by Edge.Cuts graphics, the items will not be taken into account.

Returns
bounding box calculated using exclusively the board edges.

Definition at line 823 of file board.h.

824 {
825 return ComputeBoundingBox( true );
826 }
BOX2I ComputeBoundingBox(bool aBoardEdgesOnly=false) const
Calculate the bounding box containing all board items (or board edge segments).
Definition: board.cpp:1231

References ComputeBoundingBox().

Referenced by GERBER_JOBFILE_WRITER::addJSONGeneralSpecs(), AUTOPLACE_TOOL::autoplace(), BuildBoardPolygonOutlines(), EAGLE_PLUGIN::centerBoard(), BOARD_NETLIST_UPDATER::estimateFootprintInsertionPosition(), GENDRILL_WRITER_BASE::genDrillMapFile(), AR_AUTOPLACER::genPlacementRoutingMatrix(), PCB_BASE_FRAME::GetBoardBoundingBox(), idf_export_outline(), CADSTAR_PCB_ARCHIVE_PLUGIN::Load(), PCB_EDIT_FRAME::OnExportIDF3(), and ALTIUM_PCB::Parse().

◆ GetBoardPolygonOutlines()

bool BOARD::GetBoardPolygonOutlines ( SHAPE_POLY_SET aOutlines,
OUTLINE_ERROR_HANDLER aErrorHandler = nullptr 
)

Extract the board outlines and build a closed polygon from lines, arcs and circle items on edge cut layer.

Any closed outline inside the main outline is a hole. All contours should be closed, i.e. have valid vertices to build a closed polygon.

Parameters
aOutlinesis the SHAPE_POLY_SET to fill in with outlines/holes.
aErrorHandleris an optional DRC_ITEM error handler.
Returns
true if success, false if a contour is not valid

Definition at line 1950 of file board.cpp.

1952{
1953 int chainingEpsilon = pcbIUScale.mmToIU( 0.02 ); // max dist from one endPt to next startPt
1954
1955 bool success = BuildBoardPolygonOutlines( this, aOutlines, GetDesignSettings().m_MaxError,
1956 chainingEpsilon, aErrorHandler );
1957
1958 // Make polygon strictly simple to avoid issues (especially in 3D viewer)
1960
1961 return success;
1962}
void Simplify(POLYGON_MODE aFastMode)
bool BuildBoardPolygonOutlines(BOARD *aBoard, SHAPE_POLY_SET &aOutlines, int aErrorMax, int aChainingEpsilon, OUTLINE_ERROR_HANDLER *aErrorHandler)
Extracts the board outlines and build a closed polygon from lines, arcs and circle items on edge cut ...

References BuildBoardPolygonOutlines(), GetDesignSettings(), EDA_IU_SCALE::mmToIU(), pcbIUScale, SHAPE_POLY_SET::PM_STRICTLY_SIMPLE, and SHAPE_POLY_SET::Simplify().

Referenced by DSN::SPECCTRA_DB::BuiltBoardOutlines(), EXPORTER_STEP::composePCB(), BOARD_ADAPTER::createBoardPolygon(), DRAWING_TOOL::DrawBoardCharacteristics(), EXPORTER_PCB_VRML::ExportVrmlBoard(), ZONE_FILLER::Fill(), AR_AUTOPLACER::genPlacementRoutingMatrix(), DIALOG_BOARD_STATISTICS::getDataFromPCB(), PlotSolderMaskLayer(), PNS_KICAD_IFACE_BASE::SyncWorld(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testZonesToZones(), and HYPERLYNX_EXPORTER::writeBoardInfo().

◆ GetBoardUse()

BOARD_USE BOARD::GetBoardUse ( ) const
inline

Get what the board use is.

Returns
what the board is being used for

Definition at line 284 of file board.h.

284{ return m_boardUse; }

References m_boardUse.

Referenced by BOARD_ITEM::IsLocked().

◆ GetBoundingBox()

const BOX2I BOARD::GetBoundingBox ( ) const
inlineoverridevirtual

Return the orthogonal bounding box of this object for display purposes.

This box should be an enclosing perimeter for visible components of this object, and the units should be in the pcb or schematic coordinate system. It is OK to overestimate the size by a few counts.

Reimplemented from EDA_ITEM.

Definition at line 809 of file board.h.

810 {
811 return ComputeBoundingBox( false );
812 }

References ComputeBoundingBox().

Referenced by buildBoardBoundingBoxPoly(), PCB_BASE_FRAME::GetBoardBoundingBox(), GetFocusPosition(), PCB_EDIT_FRAME::OnExportVRML(), DRC_TEST_PROVIDER_MISC::testOutline(), and PANEL_PCBNEW_COLOR_SETTINGS::zoomFitPreview().

◆ GetCenter()

virtual VECTOR2I BOARD_ITEM::GetCenter ( ) const
inlinevirtualinherited

This defaults to the center of the bounding box if not overridden.

Returns
center point of the item

Reimplemented in PAD, PCB_MARKER, PCB_SHAPE, and PCB_ARC.

Definition at line 93 of file board_item.h.

94 {
95 return GetBoundingBox().GetCenter();
96 }
const Vec GetCenter() const
Definition: box2.h:195
virtual const BOX2I GetBoundingBox() const
Return the orthogonal bounding box of this object for display purposes.
Definition: eda_item.cpp:74

References EDA_ITEM::GetBoundingBox(), and BOX2< Vec >::GetCenter().

Referenced by PCB_GRID_HELPER::computeAnchors(), PCB_SELECTION_TOOL::FindItem(), and ALTIUM_PCB::HelperParseDimensions6Radial().

◆ GetClass()

wxString BOARD::GetClass ( ) const
inlineoverridevirtual

Return the class name.

Implements EDA_ITEM.

Definition at line 881 of file board.h.

882 {
883 return wxT( "BOARD" );
884 }

Referenced by Visit().

◆ GetConnectivity()

std::shared_ptr< CONNECTIVITY_DATA > BOARD::GetConnectivity ( ) const
inline

Return a list of missing connections between components/tracks.

Returns
an object that contains information about missing connections.

Definition at line 424 of file board.h.

424{ return m_connectivity; }

References m_connectivity.

Referenced by BuildConnectivity(), BOARD_NETLIST_UPDATER::cacheCopperZoneConnections(), FROM_TO_CACHE::cacheFromToPaths(), BOARD_INSPECTION_TOOL::calculateSelectionRatsnest(), DIALOG_NET_INSPECTOR::calculateViaLength(), TRACKS_CLEANER::cleanup(), PCB_BASE_FRAME::Compile_Ratsnest(), TRACKS_CLEANER::deleteDanglingTracks(), TRACKS_CLEANER::deleteTracksInPads(), PCB_DRAW_PANEL_GAL::DisplayBoard(), PNS_KICAD_IFACE::DisplayRatline(), EDIT_TOOL::DragArcTrack(), ZONE_FILLER::Fill(), EDIT_TOOL::FilletTracks(), PCB_VIA::FlashLayer(), fromToFunc(), NETINFO_ITEM::GetBoundingBox(), TRACKS_CLEANER::getConnectedItems(), GetMsgPanelInfo(), PCB_DRAW_PANEL_GAL::GetMsgPanelInfo(), GetTrackLength(), PCB_SELECTION_TOOL::grabUnconnected(), PCB_EDIT_FRAME::ImportSpecctraSession(), ROUTER_TOOL::Init(), ROUTER_TOOL::InlineDrag(), TRACKS_CLEANER::mergeCollinearSegments(), DIALOG_DRC::OnDRCItemRClick(), DIALOG_DRC::OnDRCItemSelected(), PCB_BASE_FRAME::PlaceFootprint(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::processItem(), BOARD_COMMIT::Push(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), DIALOG_NET_INSPECTOR::relevantConnectivityItems(), TRACKS_CLEANER::removeShortingTrackSegments(), BOARD_COMMIT::Revert(), ROUTER_TOOL::RouteSelected(), DRC_TEST_PROVIDER_CONNECTIVITY::Run(), test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run(), DRC_TEST_PROVIDER_ZONE_CONNECTIONS::Run(), DRC_TEST_PROVIDER_MATCHED_LENGTH::runInternal(), PCB_SELECTION_TOOL::selectAllConnectedTracks(), PCB_SELECTION_TOOL::SelectAllItemsOnNet(), PCB_SELECTION_TOOL::selectConnections(), PCB_SELECTION_TOOL::selectUnconnected(), TRACKS_CLEANER::testTrackEndpointIsNode(), DRC_TEST_PROVIDER_ZONE_CONNECTIONS::testZoneLayer(), DIALOG_TRACK_VIA_PROPERTIES::TransferDataFromWindow(), and UpdateRatsnestExclusions().

◆ GetCopperLayerCount()

int BOARD::GetCopperLayerCount ( ) const
Returns
The number of copper layers in the BOARD.

Definition at line 541 of file board.cpp.

542{
544}

References BOARD_DESIGN_SETTINGS::GetCopperLayerCount(), and GetDesignSettings().

Referenced by GERBER_JOBFILE_WRITER::addJSONDesignRules(), GERBER_JOBFILE_WRITER::addJSONFilesAttributes(), GERBER_JOBFILE_WRITER::addJSONGeneralSpecs(), GERBER_JOBFILE_WRITER::addJSONMaterialStackup(), PCB_CONTROL::AppendBoard(), GENDRILL_WRITER_BASE::BuildFileFunctionAttributeString(), DSN::SPECCTRA_DB::buildLayerMaps(), PANEL_SETUP_LAYERS::CheckCopperLayerCount(), compute_pad_access_code(), EXPORTER_PCB_VRML::ComputeLayer3D_Zpos(), CreateComponentsSection(), CreatePadsShapesSection(), PLACEFILE_GERBER_WRITER::CreatePlaceFile(), CreateRoutesSection(), DIALOG_COPPER_ZONE::DIALOG_COPPER_ZONE(), DIALOG_RULE_AREA_PROPERTIES::DIALOG_RULE_AREA_PROPERTIES(), DIALOG_SWAP_LAYERS::DIALOG_SWAP_LAYERS(), KIGFX::PCB_PAINTER::draw(), DRAWING_TOOL::DrawVia(), PCB_TRACK::Flip(), PCB_ARC::Flip(), PCB_VIA::Flip(), DSN::SPECCTRA_DB::FromBOARD(), GetGerberFileFunctionAttribute(), DIALOG_TRACK_VIA_PROPERTIES::getLayerDepth(), BOARD_ADAPTER::InitSettings(), LayerDepth(), DSN::SPECCTRA_DB::makeIMAGE(), DSN::SPECCTRA_DB::makePADSTACK(), DSN::SPECCTRA_DB::makeVIA(), APPEARANCE_CONTROLS::rebuildLayerContextMenu(), PCB_BASE_FRAME::SwitchLayer(), PANEL_SETUP_BOARD_STACKUP::synchronizeWithBoard(), DIALOG_SWAP_LAYERS::TransferDataFromWindow(), DIALOG_SWAP_LAYERS::TransferDataToWindow(), PANEL_SETUP_LAYERS::TransferDataToWindow(), and via_access_code().

◆ GetDesignSettings()

BOARD_DESIGN_SETTINGS & BOARD::GetDesignSettings ( ) const
Returns
the BOARD_DESIGN_SETTINGS for this BOARD

Definition at line 682 of file board.cpp.

683{
684 return *m_designSettings;
685}

References m_designSettings.

Referenced by AddGerberX2Header(), GERBER_JOBFILE_WRITER::addJSONDesignRules(), GERBER_JOBFILE_WRITER::addJSONGeneralSpecs(), GERBER_JOBFILE_WRITER::addJSONMaterialStackup(), BOARD(), CONNECTIVITY_DATA::Build(), build_pad_testpoints(), build_via_testpoints(), ZONE_FILLER::buildCopperItemClearances(), PAD::BuildEffectivePolygon(), PAD::BuildEffectiveShapes(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::buildFilterLists(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::buildNetclassesGrid(), BOARD_ADAPTER::buildPadOutlineAsPolygon(), ZONE::BuildSmoothedPoly(), ZONE_FILLER::buildThermalSpokes(), DIALOG_NET_INSPECTOR::calculateViaLength(), CADSTAR_PCB_ARCHIVE_LOADER::calculateZonePriorities(), EDIT_TOOL::ChangeTrackWidth(), GRAPHICS_CLEANER::CleanupBoard(), NETINFO_ITEM::Clear(), FOOTPRINT_EDIT_FRAME::Clear_Pcb(), ClearProject(), collidesWithArea(), ZONE_CREATE_HELPER::commitZone(), FOOTPRINT_EDIT_FRAME::CommonSettingsChanged(), EXPORTER_STEP::composePCB(), EXPORTER_PCB_VRML::ComputeLayer3D_Zpos(), ConvertBrdLayerToPolygonalContours(), BOARD_ADAPTER::createBoardPolygon(), MICROWAVE_TOOL::createInductorBetween(), BOARD_ADAPTER::createLayers(), CreatePadsShapesSection(), BOARD_ADAPTER::createPadWithMargin(), PLACEFILE_GERBER_WRITER::CreatePlaceFile(), CONVERT_TOOL::CreatePolys(), CreateRoutesSection(), ROUTER_TOOL::CustomTrackWidthDialog(), EXPORTER_STEP::determinePcbThickness(), DIALOG_BOARD_SETUP::DIALOG_BOARD_SETUP(), DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME(), ROUTER_TOOL::DpDimensionsDialog(), DRAWING_TOOL::DrawBoardCharacteristics(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::DrawVia(), enclosedByAreaFunc(), TRACK_WIDTH_MENU::eventHandler(), DIFF_PAIR_MENU::eventHandler(), VIA_SIZE_MENU::eventHandler(), EVT_GRID_CMD_CELL_CHANGED(), PCB_EDIT_FRAME::Export_IDF3(), EXPORTER_PCB_VRML::EXPORTER_PCB_VRML(), PCB_EDIT_FRAME::ExportToGenCAD(), ZONE_FILLER::Fill(), ZONE_FILLER::fillCopperZone(), ZONE_FILLER::fillNonCopperZone(), FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME(), PCB_PLUGIN::formatGeneral(), PCB_PLUGIN::formatSetup(), DSN::SPECCTRA_DB::FromBOARD(), DSN::SPECCTRA_DB::FromSESSION(), PCB_BASE_FRAME::GetAuxOrigin(), GetBoardPolygonOutlines(), GetCopperLayerCount(), PCB_BASE_FRAME::GetDesignSettings(), FOOTPRINT_EDIT_FRAME::GetDesignSettings(), BOARD_CONNECTED_ITEM::GetEffectiveNetClass(), GetEnabledLayers(), PCB_BASE_FRAME::GetGridOrigin(), CADSTAR_PCB_ARCHIVE_LOADER::getHatchCodeAngle(), BOARD_ADAPTER::GetHolePlatingThickness(), CADSTAR_PCB_ARCHIVE_LOADER::getKiCadHatchCodeGap(), CADSTAR_PCB_ARCHIVE_LOADER::getKiCadHatchCodeThickness(), CADSTAR_PCB_ARCHIVE_LOADER::getKiCadNet(), CADSTAR_PCB_ARCHIVE_LOADER::getKiCadPad(), CADSTAR_PCB_ARCHIVE_LOADER::getLineThickness(), PCB_VIA::GetMinAnnulus(), BOARD_CONNECTED_ITEM::GetOwnClearance(), PAD::GetOwnClearance(), DRAWING_TOOL::getSegmentWidth(), PCB_MARKER::GetSeverity(), PCB_BASE_FRAME::GetSeverity(), PAD::GetSolderMaskExpansion(), PCB_VIA::GetSolderMaskExpansion(), GetTrackLength(), PCB_TRACK::GetWidthConstraint(), PCB_BASE_FRAME::GetZoneSettings(), GetZoneSettings(), ROUTER_TOOL::handleLayerSwitch(), ALTIUM_PCB::HelperCreateBoardOutline(), PANEL_SETUP_BOARD_FINISH::ImportSettingsFrom(), PANEL_SETUP_BOARD_STACKUP::ImportSettingsFrom(), PANEL_SETUP_CONSTRAINTS::ImportSettingsFrom(), PANEL_SETUP_MASK_AND_PASTE::ImportSettingsFrom(), PANEL_SETUP_TEXT_AND_GRAPHICS::ImportSettingsFrom(), PANEL_SETUP_TRACKS_AND_VIAS::ImportSettingsFrom(), PNS_KICAD_IFACE_BASE::ImportSizes(), DIALOG_PLOT::init_Dialog(), initializePlotter(), BOARD_ADAPTER::InitSettings(), IsLayerEnabled(), IsLayerVisible(), PNS_PCBNEW_RULE_RESOLVER::IsNetTieExclusion(), PCBNEW_JOBS_HANDLER::JobExportDrill(), ZONE_FILLER::knockoutThermalReliefs(), EAGLE_PLUGIN::Load(), LoadBoard(), CADSTAR_PCB_ARCHIVE_LOADER::loadBoardStackup(), EAGLE_PLUGIN::loadClasses(), CADSTAR_PCB_ARCHIVE_LOADER::loadDesignRules(), FABMASTER::loadFootprints(), LEGACY_PLUGIN::loadGENERAL(), DRC_ENGINE::loadImplicitRules(), LEGACY_PLUGIN::loadNETCLASS(), FABMASTER::loadOutline(), EAGLE_PLUGIN::loadPlain(), FABMASTER::loadPolygon(), LEGACY_PLUGIN::loadSETUP(), EAGLE_PLUGIN::loadSignals(), CADSTAR_PCB_ARCHIVE_LOADER::loadTemplates(), FABMASTER::loadVias(), BOARD_INSPECTION_TOOL::makeDRCEngine(), DSN::SPECCTRA_DB::makePADSTACK(), CONVERT_TOOL::makePolysFromChainedSegs(), CONVERT_TOOL::makePolysFromClosedGraphics(), CONVERT_TOOL::makePolysFromOpenGraphics(), PAD::MergePrimitivesAsPolygon(), EDIT_TOOL::MoveExact(), NETINFO_ITEM::NETINFO_ITEM(), NewBoard(), DIALOG_PAD_PROPERTIES::onAddPrimitive(), DIALOG_BOARD_SETUP::onAuxiliaryAction(), DIALOG_TEXTBOX_PROPERTIES::onBorderChecked(), APPEARANCE_CONTROLS::onNetclassContextMenu(), PANEL_SETUP_RULES::onScintillaCharAdded(), PCB_EDIT_FRAME::OpenProjectFiles(), EAGLE_PLUGIN::packageWire(), DIALOG_PAD_PROPERTIES::padValuesOK(), PANEL_PREVIEW_3D_MODEL::PANEL_PREVIEW_3D_MODEL(), PANEL_SETUP_BOARD_FINISH::PANEL_SETUP_BOARD_FINISH(), PANEL_SETUP_BOARD_STACKUP::PANEL_SETUP_BOARD_STACKUP(), PANEL_SETUP_CONSTRAINTS::PANEL_SETUP_CONSTRAINTS(), PANEL_SETUP_MASK_AND_PASTE::PANEL_SETUP_MASK_AND_PASTE(), PANEL_SETUP_TEXT_AND_GRAPHICS::PANEL_SETUP_TEXT_AND_GRAPHICS(), PANEL_SETUP_TRACKS_AND_VIAS::PANEL_SETUP_TRACKS_AND_VIAS(), ALTIUM_PCB::Parse(), ALTIUM_PCB::ParseBoard6Data(), PCB_PARSER::parseBoardStackup(), ALTIUM_PCB::ParseClasses6Data(), PCB_PARSER::parseGeneralSection(), PCB_PARSER::parseNETCLASS(), PCB_PARSER::parseSetup(), PLACE_FILE_EXPORTER::PLACE_FILE_EXPORTER(), PCB_PLOT_SVG::Plot(), DIALOG_PLOT::Plot(), PlotOneBoardLayer(), PlotSolderMaskLayer(), PlotStandardLayer(), ROUTER_TOOL::prepareInteractive(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::processItem(), PNS_PCBNEW_RULE_RESOLVER::QueryConstraint(), PCB_EDIT_FRAME::RebuildAndRefresh(), APPEARANCE_CONTROLS::rebuildNets(), PAD_TOOL::RecombinePad(), PCB_EDIT_FRAME::RecordDRCExclusions(), DIALOG_PLOT::reInitDialog(), DRC_TOOL::Reset(), DRC_TEST_PROVIDER_ANNULAR_WIDTH::Run(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::Run(), test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run(), DRC_TEST_PROVIDER_DISALLOW::Run(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::Run(), DRC_TEST_PROVIDER_SOLDER_MASK::Run(), DRC_TEST_PROVIDER_MATCHED_LENGTH::runInternal(), PCB_BASE_EDIT_FRAME::SetBoard(), SetCopperLayerCount(), SetEnabledLayers(), PCB_BASE_FRAME::SetGridOrigin(), NETINFO_ITEM::SetNetClass(), DIALOG_PLOT::SetPlotFormat(), SetProject(), PANEL_PREVIEW_3D_MODEL::SetSelectedModel(), PCB_BASE_FRAME::SetZoneSettings(), SetZoneSettings(), PNS_KICAD_IFACE_BASE::StackupHeight(), SynchronizeNetsAndNetClasses(), PNS_KICAD_IFACE_BASE::syncVia(), PNS_KICAD_IFACE_BASE::SyncWorld(), TEARDROP_DIALOG::TEARDROP_DIALOG(), TEARDROP_MANAGER::TEARDROP_MANAGER(), DRC_TEST_PROVIDER_HOLE_TO_HOLE::testHoleAgainstHole(), DRC_TEST_PROVIDER_SOLDER_MASK::testItemAgainstItems(), DRC_TEST_PROVIDER_SOLDER_MASK::testMaskItemAgainstZones(), DRC_TEST_PROVIDER_MISC::testOutline(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testShapeLineChain(), DRC_TEST_PROVIDER_ZONE_CONNECTIONS::testZoneLayer(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testZoneLayer(), PANEL_SETUP_RULES::TransferDataFromWindow(), BOARD_ADAPTER::transformFPShapesToPolySet(), ZONE::TransformSmoothedOutlineToPolygon(), TRACK_WIDTH_MENU::update(), DIFF_PAIR_MENU::update(), VIA_SIZE_MENU::update(), PANEL_PREVIEW_3D_MODEL::updateBoardThickness(), DIALOG_GENDRILL::UpdateDrillParams(), PCB_CONTROL::UpdateMessagePanel(), ROUTER_TOOL::updateSizesAfterLayerSwitch(), FOOTPRINT::ViewBBox(), PAD::ViewBBox(), PCB_TRACK::ViewBBox(), WriteDRCReport(), DIALOG_DRC::writeReport(), and HYPERLYNX_EXPORTER::writeStackupInfo().

◆ GetEditFlags()

EDA_ITEM_FLAGS EDA_ITEM::GetEditFlags ( ) const
inlineinherited

Definition at line 145 of file eda_item.h.

146 {
147 constexpr int mask =
149
150 return m_flags & mask;
151 }
#define IS_PASTED
Modifier on IS_NEW which indicates it came from clipboard.
#define IS_CHANGED
Item was edited, and modified.
#define IS_NEW
New item, just created.
#define IS_BROKEN
Is a segment just broken by BreakSegment.
#define STRUCT_DELETED
flag indication structures to be erased
#define IS_MOVING
Item being moved.

References IS_BROKEN, IS_CHANGED, IS_MOVING, IS_NEW, IS_PASTED, EDA_ITEM::m_flags, and STRUCT_DELETED.

Referenced by SCH_EDIT_TOOL::ChangeTextType(), EDA_ITEM::ClearEditFlags(), SCH_EDIT_FRAME::DeleteJunction(), SCH_EDIT_TOOL::editFieldText(), SYMBOL_EDITOR_PIN_TOOL::EditPinProperties(), SCH_EDITOR_CONTROL::EditWithSymbolEditor(), SCH_SYMBOL::GetMsgPanelInfo(), SELECTION_CONDITIONS::Idle(), SELECTION_CONDITIONS::IdleSelection(), SYMBOL_EDITOR_MOVE_TOOL::Main(), PCB_POINT_EDITOR::OnSelectionChange(), SYMBOL_EDITOR_EDIT_TOOL::Properties(), SCH_EDIT_FRAME::SelectUnit(), DIALOG_IMAGE_PROPERTIES::TransferDataFromWindow(), DIALOG_LABEL_PROPERTIES::TransferDataFromWindow(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_DIMENSION_PROPERTIES::TransferDataFromWindow(), DIALOG_FOOTPRINT_PROPERTIES::TransferDataFromWindow(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), and DIALOG_TEXTBOX_PROPERTIES::TransferDataFromWindow().

◆ GetEffectiveHoleShape()

std::shared_ptr< SHAPE_SEGMENT > BOARD_ITEM::GetEffectiveHoleShape ( ) const
virtualinherited

◆ GetEffectiveShape()

std::shared_ptr< SHAPE > BOARD_ITEM::GetEffectiveShape ( PCB_LAYER_ID  aLayer = UNDEFINED_LAYER,
FLASHING  aFlash = FLASHING::DEFAULT 
) const
virtualinherited

Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.

This routine returns a COMPOUND shape (set of simple shapes which make up the pad for use with routing, collision determination, etc).

Note
This list can contain a SHAPE_SIMPLE (a simple single-outline non-intersecting polygon), but should never contain a SHAPE_POLY_SET (a complex polygon consisting of multiple outlines and/or holes).
Parameters
aLayerin case of items spanning multiple layers, only the shapes belonging to aLayer will be returned. Pass UNDEFINED_LAYER to return shapes for all layers.
aFlashoptional parameter allowing a caller to force the pad to be flashed (or not flashed) on the current layer (default is to honour the pad's setting and the current connections for the given layer).

Reimplemented in PCB_DIMENSION_BASE, PCB_MARKER, PCB_TARGET, PCB_GROUP, FOOTPRINT, FP_TEXT, FP_TEXTBOX, PCB_BITMAP, PCB_SHAPE, PCB_TEXT, PCB_TEXTBOX, PCB_TRACK, PCB_ARC, PCB_VIA, ZONE, and PAD.

Definition at line 219 of file board_item.cpp.

220{
221 static std::shared_ptr<SHAPE> shape;
222
224
225 return shape;
226}

References EDA_ITEM::GetClass(), and UNIMPLEMENTED_FOR.

Referenced by CN_VISITOR::checkZoneItemConnection(), collidesWithArea(), collidesWithCourtyard(), DRAWING_TOOL::DrawVia(), PCB_SELECTION_TOOL::hitTestDistance(), DRC_RTREE::Insert(), CN_VISITOR::operator()(), DRC_RTREE::QueryColliding(), DRC_TEST_PROVIDER_DISALLOW::Run(), DRC_TEST_PROVIDER_EDGE_CLEARANCE::Run(), DRC_TEST_PROVIDER_EDGE_CLEARANCE::testAgainstEdge(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstItem(), DRC_TEST_PROVIDER_SOLDER_MASK::testItemAgainstItems(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testItemAgainstZone(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstZones(), DRC_TEST_PROVIDER_SOLDER_MASK::testMaskItemAgainstZones(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testTrackAgainstItem(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testTrackClearances(), CONNECTIVITY_DATA::TestTrackEndpointDangling(), and PCB_CONTROL::UpdateMessagePanel().

◆ GetEnabledLayers()

LSET BOARD::GetEnabledLayers ( ) const

A proxy function that calls the corresponding function in m_BoardSettings.

Returns
the enabled layers in bit-mapped form.

Definition at line 565 of file board.cpp.

566{
568}
LSET GetEnabledLayers() const
Return a bit-mask of all the layers that are enabled.

References GetDesignSettings(), and BOARD_DESIGN_SETTINGS::GetEnabledLayers().

Referenced by PCB_CONTROL::AppendBoard(), PCB_ONE_LAYER_SELECTOR::buildList(), SELECT_COPPER_LAYERS_PAIR_DIALOG::buildList(), DIALOG_NET_INSPECTOR::DIALOG_NET_INSPECTOR(), DIALOG_PLOT::DIALOG_PLOT(), KIGFX::PCB_PAINTER::draw(), DRC_ENGINE::EvalRules(), PCB_PLUGIN::format(), PCB_PLUGIN::formatBoardLayers(), GENDRILL_WRITER_BASE::GenDrillReportFile(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), PCB_LAYER_BOX_SELECTOR::getEnabledLayers(), PANEL_SETUP_LAYERS::getNonRemovableLayers(), PANEL_SETUP_LAYERS::getRemovedLayersWithItems(), PANEL_SETUP_BOARD_STACKUP::ImportSettingsFrom(), DIALOG_PLOT::init_Dialog(), DIALOG_EXPORT_SVG::initDialog(), HYPERLYNX_PAD_STACK::IsEmpty(), PCBNEW_JOBS_HANDLER::JobExportGerbers(), BOARD_ITEM::layerMaskDescribe(), padsNeedUpdate(), PANEL_SETUP_BOARD_STACKUP::PANEL_SETUP_BOARD_STACKUP(), DIALOG_PLOT::Plot(), PCB_CONTROL::pruneItemLayers(), APPEARANCE_CONTROLS::rebuildLayers(), CADSTAR_PCB_ARCHIVE_LOADER::remapUnsureLayers(), DRC_TEST_PROVIDER_CONNECTION_WIDTH::Run(), DRC_TEST_PROVIDER_SLIVER_CHECKER::Run(), DRC_TEST_PROVIDER_MISC::testDisabledLayers(), PANEL_SETUP_LAYERS::TransferDataFromWindow(), DIALOG_FOOTPRINT_PROPERTIES::TransferDataToWindow(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::TransferDataToWindow(), DIALOG_PRINT_PCBNEW::TransferDataToWindow(), PANEL_SETUP_LAYERS::TransferDataToWindow(), PCB_PROPERTIES_PANEL::updateLists(), PCB_EDIT_FRAME::UpdateUserInterface(), PAD::ViewGetLOD(), PCB_VIA::ViewGetLOD(), and HYPERLYNX_EXPORTER::writeSinglePadStack().

◆ GetFileFormatVersionAtLoad()

int BOARD::GetFileFormatVersionAtLoad ( ) const
inline

Definition at line 363 of file board.h.

References m_fileFormatVersionAtLoad.

Referenced by PCB_EDIT_FRAME::OpenProjectFiles().

◆ GetFileName()

const wxString & BOARD::GetFileName ( void  ) const
inline

Definition at line 302 of file board.h.

302{ return m_fileName; }
wxString m_fileName
Definition: board.h:1176

References m_fileName.

Referenced by AddGerberX2Header(), GERBER_JOBFILE_WRITER::addJSONGeneralSpecs(), PCB_EDIT_FRAME::canCloseWindow(), DIALOG_GEN_FOOTPRINT_POSITION::CreateAsciiFiles(), DIALOG_GEN_FOOTPRINT_POSITION::CreateGerberFiles(), CreateHeaderInfoData(), DIALOG_BOARD_STATISTICS::DIALOG_BOARD_STATISTICS(), DIALOG_EXPORT_STEP::DIALOG_EXPORT_STEP(), PCB_DRAW_PANEL_GAL::DisplayBoard(), PCB_EDIT_FRAME::doCloseWindow(), PCB_EDIT_FRAME::Export_IDF3(), BOARD_EDITOR_CONTROL::ExportSpecctraDSN(), DIALOG_EXPORT_SVG::ExportSVGFile(), PCB_EDIT_FRAME::ExportToGenCAD(), PCB_EDIT_FRAME::Files_io_from_id(), PCB_EDIT_FRAME::GenD356File(), DIALOG_GENDRILL::GenDrillAndMapFiles(), GENDRILL_WRITER_BASE::GenDrillReportFile(), PCB_EDIT_FRAME::GenFootprintsReport(), PCB_EDIT_FRAME::GetCurrentFileName(), PCB_BASE_EDIT_FRAME::GetDesignRulesPath(), GENDRILL_WRITER_BASE::getDrillFileName(), PCB_EDIT_FRAME::GetLastPath(), BOARD_EDITOR_CONTROL::ImportSpecctraSession(), PCBNEW_JOBS_HANDLER::JobExportDxf(), PCBNEW_JOBS_HANDLER::JobExportGerber(), PCBNEW_JOBS_HANDLER::JobExportGerbers(), PCBNEW_JOBS_HANDLER::JobExportPdf(), PCBNEW_JOBS_HANDLER::JobExportPos(), PCBNEW_JOBS_HANDLER::JobExportStep(), FABMASTER::loadFootprints(), PCB_EDIT_FRAME::onBoardLoaded(), DIALOG_IMPORT_SETTINGS::OnBrowseClicked(), PCB_EDIT_FRAME::OnExportHyperlynx(), PCB_EDIT_FRAME::OnExportIDF3(), PCB_EDIT_FRAME::OnExportSTEP(), PCB_EDIT_FRAME::OnExportVRML(), DIALOG_GENDRILL::OnGenReportFile(), DIALOG_EXPORT_SVG::OnOutputDirectoryBrowseClicked(), DIALOG_GEN_FOOTPRINT_POSITION::OnOutputDirectoryBrowseClicked(), DIALOG_GENDRILL::OnOutputDirectoryBrowseClicked(), DIALOG_PLOT::OnOutputDirectoryBrowseClicked(), PLOT_CONTROLLER::OpenPlotfile(), EAGLE_PLUGIN::packagePad(), ALTIUM_PCB::ParseModelsData(), PCB_PLOT_SVG::Plot(), DIALOG_PLOT::Plot(), PCB_EDIT_FRAME::RecreateBOMFileFromBoard(), PCB_EDIT_FRAME::RecreateCmpFileFromBoard(), DIALOG_BOARD_STATISTICS::saveReportClicked(), PCB_EDIT_FRAME::SetLastPath(), StartPlotBoard(), PCB_EDIT_FRAME::UpdateTitle(), HYPERLYNX_EXPORTER::writeBoardInfo(), WriteDRCReport(), and DIALOG_DRC::writeReport().

◆ GetFirstFootprint()

FOOTPRINT * BOARD::GetFirstFootprint ( ) const
inline

Get the first footprint on the board or nullptr.

This is used primarily by the footprint editor which knows there is only one.

Returns
first footprint or null pointer

Definition at line 397 of file board.h.

398 {
399 return m_footprints.empty() ? nullptr : m_footprints.front();
400 }

References m_footprints.

Referenced by FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), BuildFootprintPolygonOutlines(), FOOTPRINT_EDIT_FRAME::CanCloseFPFromBoard(), FOOTPRINT_EDIT_FRAME::canCloseWindow(), FOOTPRINT_EDIT_FRAME::ClearModify(), BOARD_ADAPTER::createBoardPolygon(), FOOTPRINT_EDITOR_CONTROL::CutCopyFootprint(), PCB_CONTROL::DeleteItemCursor(), DIALOG_FOOTPRINT_CHECKER::DIALOG_FOOTPRINT_CHECKER(), DIALOG_IMPORT_GFX::DIALOG_IMPORT_GFX(), DIALOG_CLEANUP_GRAPHICS::doCleanup(), EDIT_TOOL::Duplicate(), FOOTPRINT_EDITOR_CONTROL::DuplicateFootprint(), PAD_TOOL::EnumeratePads(), FOOTPRINT_EDITOR_CONTROL::ExportFootprint(), PCB_TOOL_BASE::footprint(), PCB_VIEWER_TOOLS::footprint(), FOOTPRINT_EDIT_FRAME::GetDocumentExtents(), FOOTPRINT_EDIT_FRAME::GetLoadedFPID(), DISPLAY_FOOTPRINTS_FRAME::GetModel(), FOOTPRINT_EDIT_FRAME::GetModel(), FOOTPRINT_VIEWER_FRAME::GetModel(), FOOTPRINT_WIZARD_FRAME::GetModel(), FP_TREE_SYNCHRONIZING_ADAPTER::GetValue(), GROUP_TOOL::Group(), FOOTPRINT_EDITOR_CONTROL::ImportFootprint(), ARRAY_CREATOR::Invoke(), FOOTPRINT_EDIT_FRAME::IsContentModified(), FOOTPRINT_EDIT_FRAME::IsCurrentFPFromBoard(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard(), FOOTPRINT_EDIT_FRAME::OnUpdateLoadFootprintFromBoard(), FOOTPRINT_EDIT_FRAME::OnUpdateSaveFootprintToBoard(), FOOTPRINT_EDIT_FRAME::OpenProjectFiles(), PCB_CONTROL::Paste(), pasteFootprintItemsToFootprintEditor(), DRAWING_TOOL::PlaceImportedGraphics(), FOOTPRINT_EDITOR_CONTROL::Properties(), BOARD_COMMIT::Push(), FOOTPRINT_EDITOR_CONTROL::RenameFootprint(), DIALOG_FOOTPRINT_CHECKER::runChecks(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), FOOTPRINT_EDIT_FRAME::setupUIConditions(), GROUP_TOOL::Ungroup(), DISPLAY_FOOTPRINTS_FRAME::UpdateMsgPanel(), FOOTPRINT_WIZARD_FRAME::UpdateMsgPanel(), FOOTPRINT_EDIT_FRAME::UpdateTitle(), and DIALOG_FOOTPRINT_CHECKER::~DIALOG_FOOTPRINT_CHECKER().

◆ GetFlags()

◆ GetFocusPosition()

const VECTOR2I BOARD::GetFocusPosition ( ) const
inlineoverridevirtual

Similar to GetPosition, but allows items to return their visual center rather than their anchor.

Reimplemented from EDA_ITEM.

Definition at line 353 of file board.h.

353{ return GetBoundingBox().GetCenter(); }
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: board.h:809

References GetBoundingBox(), and BOX2< Vec >::GetCenter().

◆ GetFootprint()

FOOTPRINT * BOARD::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.

If more than one footprint is at aPosition, then the closest footprint on the active layer is returned. The distance is calculated via manhattan distance from the center of the bounding rectangle to aPosition.

Parameters
aPositionA VECTOR2I object containing the position to test.
aActiveLayerLayer to test.
aVisibleOnlySearch only the visible layers if true.
aIgnoreLockedIgnore locked footprints when true.

Definition at line 1841 of file board.cpp.

1843{
1844 FOOTPRINT* footprint = nullptr;
1845 FOOTPRINT* alt_footprint = nullptr;
1846 int min_dim = 0x7FFFFFFF;
1847 int alt_min_dim = 0x7FFFFFFF;
1848 bool current_layer_back = IsBackLayer( aActiveLayer );
1849
1850 for( FOOTPRINT* candidate : m_footprints )
1851 {
1852 // is the ref point within the footprint's bounds?
1853 if( !candidate->HitTest( aPosition ) )
1854 continue;
1855
1856 // if caller wants to ignore locked footprints, and this one is locked, skip it.
1857 if( aIgnoreLocked && candidate->IsLocked() )
1858 continue;
1859
1860 PCB_LAYER_ID layer = candidate->GetLayer();
1861
1862 // Filter non visible footprints if requested
1863 if( !aVisibleOnly || IsFootprintLayerVisible( layer ) )
1864 {
1865 BOX2I bb = candidate->GetBoundingBox( false, false );
1866
1867 int offx = bb.GetX() + bb.GetWidth() / 2;
1868 int offy = bb.GetY() + bb.GetHeight() / 2;
1869
1870 // off x & offy point to the middle of the box.
1871 int dist = ( aPosition.x - offx ) * ( aPosition.x - offx ) +
1872 ( aPosition.y - offy ) * ( aPosition.y - offy );
1873
1874 if( current_layer_back == IsBackLayer( layer ) )
1875 {
1876 if( dist <= min_dim )
1877 {
1878 // better footprint shown on the active side
1879 footprint = candidate;
1880 min_dim = dist;
1881 }
1882 }
1883 else if( aVisibleOnly && IsFootprintLayerVisible( layer ) )
1884 {
1885 if( dist <= alt_min_dim )
1886 {
1887 // better footprint shown on the other side
1888 alt_footprint = candidate;
1889 alt_min_dim = dist;
1890 }
1891 }
1892 }
1893 }
1894
1895 if( footprint )
1896 return footprint;
1897
1898 if( alt_footprint)
1899 return alt_footprint;
1900
1901 return nullptr;
1902}
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:670
coord_type GetHeight() const
Definition: box2.h:188
coord_type GetY() const
Definition: box2.h:181
coord_type GetWidth() const
Definition: box2.h:187
coord_type GetX() const
Definition: box2.h:180
bool IsBackLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a back layer.
Definition: layer_ids.h:922
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:59

References BOX2< Vec >::GetHeight(), BOX2< Vec >::GetWidth(), BOX2< Vec >::GetX(), BOX2< Vec >::GetY(), IsBackLayer(), IsFootprintLayerVisible(), m_footprints, VECTOR2< T >::x, and VECTOR2< T >::y.

◆ GetFriendlyName()

wxString EDA_ITEM::GetFriendlyName ( ) const
virtualinherited

Reimplemented in PCB_SHAPE, PCB_TRACK, and ZONE.

Definition at line 310 of file eda_item.cpp.

311{
312 return GetTypeDesc();
313}
wxString GetTypeDesc() const
Return a translated description of the type for this EDA_ITEM for display in user facing messages.
Definition: eda_item.cpp:301

References EDA_ITEM::GetTypeDesc().

Referenced by PROPERTIES_PANEL::rebuildProperties().

◆ GetGenerator()

const wxString & BOARD::GetGenerator ( ) const
inline

Adds an item to the container.

Parameters
aModedecides whether the item is added in the beginning or at the end of the list.
aSkipConnectivityskip connectivity update (useful for file loading, when the connectivity is updated after end of loading).

Definition at line 366 of file board.h.

References m_generator.

Referenced by PCB_EDIT_FRAME::OpenProjectFiles().

◆ GetHighLightNetCodes()

const std::set< int > & BOARD::GetHighLightNetCodes ( ) const
inline
Returns
the set of net codes that should be highlighted

Definition at line 472 of file board.h.

473 {
474 return m_highLight.m_netCodes;
475 }
HIGH_LIGHT_INFO m_highLight
Definition: board.h:1186
std::set< int > m_netCodes
Definition: board.h:211

References m_highLight, and HIGH_LIGHT_INFO::m_netCodes.

Referenced by DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::buildFilterLists(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), and DIALOG_NET_INSPECTOR::OnBoardHighlightNetChanged().

◆ GetItem()

BOARD_ITEM * BOARD::GetItem ( const KIID aID) const
Returns
null if aID is null. Returns an object of Type() == NOT_USED if the aID is not found.

Definition at line 997 of file board.cpp.

998{
999 if( aID == niluuid )
1000 return nullptr;
1001
1002 for( PCB_TRACK* track : Tracks() )
1003 {
1004 if( track->m_Uuid == aID )
1005 return track;
1006 }
1007
1008 for( FOOTPRINT* footprint : Footprints() )
1009 {
1010 if( footprint->m_Uuid == aID )
1011 return footprint;
1012
1013 for( PAD* pad : footprint->Pads() )
1014 {
1015 if( pad->m_Uuid == aID )
1016 return pad;
1017 }
1018
1019 if( footprint->Reference().m_Uuid == aID )
1020 return &footprint->Reference();
1021
1022 if( footprint->Value().m_Uuid == aID )
1023 return &footprint->Value();
1024
1025 for( BOARD_ITEM* drawing : footprint->GraphicalItems() )
1026 {
1027 if( drawing->m_Uuid == aID )
1028 return drawing;
1029 }
1030
1031 for( BOARD_ITEM* zone : footprint->Zones() )
1032 {
1033 if( zone->m_Uuid == aID )
1034 return zone;
1035 }
1036
1037 for( PCB_GROUP* group : footprint->Groups() )
1038 {
1039 if( group->m_Uuid == aID )
1040 return group;
1041 }
1042 }
1043
1044 for( ZONE* zone : Zones() )
1045 {
1046 if( zone->m_Uuid == aID )
1047 return zone;
1048 }
1049
1050 for( BOARD_ITEM* drawing : Drawings() )
1051 {
1052 if( drawing->m_Uuid == aID )
1053 return drawing;
1054 }
1055
1056 for( PCB_MARKER* marker : m_markers )
1057 {
1058 if( marker->m_Uuid == aID )
1059 return marker;
1060 }
1061
1062 for( PCB_GROUP* group : m_groups )
1063 {
1064 if( group->m_Uuid == aID )
1065 return group;
1066 }
1067
1068 if( m_Uuid == aID )
1069 return const_cast<BOARD*>( this );
1070
1071 // Not found; weak reference has been deleted.
1073}
static DELETED_BOARD_ITEM * GetInstance()
Definition: board_item.h:368
KIID niluuid(0)

References Drawings(), Footprints(), DELETED_BOARD_ITEM::GetInstance(), group, m_groups, m_markers, EDA_ITEM::m_Uuid, niluuid, pad, Tracks(), and Zones().

Referenced by CollisionMatchesExpected(), ConvertKIIDsToCrossReferences(), PCB_BASE_FRAME::FocusOnItems(), PCB_BASE_FRAME::GetItem(), BOARD_INSPECTION_TOOL::InspectDRCError(), InvalidMatchesExpected(), DIALOG_DRC::OnDRCItemSelected(), DIALOG_CLEANUP_GRAPHICS::OnSelectItem(), DIALOG_CLEANUP_TRACKS_AND_VIAS::OnSelectItem(), DIALOG_FOOTPRINT_CHECKER::OnSelectItem(), ResolveTextVar(), and DRC_TEST_PROVIDER_DISALLOW::Run().

◆ GetItemDescription()

wxString BOARD::GetItemDescription ( UNITS_PROVIDER aUnitsProvider) const
overridevirtual

Return a user-visible description string of this item.

This description is used in disambiguation menus, the message panel, ERC/DRC reports, etc.

The default version of this function raises an assertion in the debug mode and returns a string to indicate that it was not overridden to provide the object specific text.

Returns
The menu text string.

Reimplemented from EDA_ITEM.

Definition at line 950 of file board.cpp.

951{
952 return wxString::Format( _( "PCB" ) );
953}
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200

References _, and Format().

◆ GetLayer()

virtual PCB_LAYER_ID BOARD_ITEM::GetLayer ( ) const
inlinevirtualinherited

Return the primary layer this item is on.

Reimplemented in FOOTPRINT, PAD, and ZONE.

Definition at line 180 of file board_item.h.

180{ return m_layer; }
PCB_LAYER_ID m_layer
Definition: board_item.h:329

References BOARD_ITEM::m_layer.

Referenced by Add(), CN_LIST::Add(), BOARD_ADAPTER::addFootprintShapes(), TEARDROP_MANAGER::addTeardropsOnTracks(), GRAPHICS_CLEANER::areEquivalent(), BOARD_CONNECTED_ITEM_DESC::BOARD_CONNECTED_ITEM_DESC(), BOARD_ITEM_DESC::BOARD_ITEM_DESC(), BuildBoardPolygonOutlines(), PNS::ITEM::collideSimple(), TEARDROP_MANAGER::ComputePointsOnPadVia(), CreateBoardSection(), PCB_BASE_FRAME::CreateNewFootprint(), TEARDROP_MANAGER::createTeardrop(), DIALOG_DIMENSION_PROPERTIES::DIALOG_DIMENSION_PROPERTIES(), DIALOG_GRAPHIC_ITEM_PROPERTIES::DIALOG_GRAPHIC_ITEM_PROPERTIES(), DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), DIALOG_TEXTBOX_PROPERTIES::DIALOG_TEXTBOX_PROPERTIES(), DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES(), EDIT_TOOL::DragArcTrack(), KIGFX::PCB_PAINTER::draw(), extractDiffPairCoupledItems(), EDIT_TOOL::FilletTracks(), TEARDROP_MANAGER::findAnchorPointsOnTrack(), TEARDROP_MANAGER::findTouchingTrack(), FP_SHAPE::Flip(), FP_TEXT::Flip(), FP_TEXTBOX::Flip(), PCB_DIMENSION_BASE::Flip(), PCB_SHAPE::Flip(), PCB_TARGET::Flip(), PCB_TEXT::Flip(), PCB_TEXTBOX::Flip(), PCB_TRACK::Flip(), PCB_ARC::Flip(), FootprintWriteShape(), PCB_PLUGIN::format(), FOOTPRINT::GetBoundingBox(), FOOTPRINT::GetLayer(), PAD::GetLayer(), ZONE::GetLayer(), PCB_TRACK::GetMsgPanelInfo(), PCB_VIA::GetMsgPanelInfo(), GetPad(), PCB_SELECTION_TOOL::GuessSelectionCandidates(), GENERAL_COLLECTOR::Inspect(), BOARD_INSPECTION_TOOL::InspectClearance(), BOARD_INSPECTION_TOOL::InspectConstraints(), BOARD_INSPECTION_TOOL::InspectDRCError(), BOARD_ITEM::IsOnCopperLayer(), FP_SHAPE::IsParentFlipped(), FP_TEXT::IsParentFlipped(), TEARDROP_MANAGER::isViaAndTrackInSameZone(), itemIsIncludedByFilter(), FABMASTER::loadFootprints(), FABMASTER::loadOutline(), CADSTAR_PCB_ARCHIVE_LOADER::makeTracksFromShapes(), DIALOG_FOOTPRINT_PROPERTIES::OnAddField(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::OnAddField(), DIALOG_TEXTBOX_PROPERTIES::onBorderChecked(), BOARD::cmp_items::operator()(), BOARD::cmp_drawings::operator()(), PCB_SHAPE::cmp_drawings::operator()(), FOOTPRINT::cmp_drawings::operator()(), PCB_TRACK::cmp_tracks::operator()(), PCB_SHAPE_DESC::PCB_SHAPE_DESC(), BRDITEMS_PLOTTER::PlotDimension(), BRDITEMS_PLOTTER::PlotFootprintGraphicItems(), BRDITEMS_PLOTTER::PlotFootprintShape(), BRDITEMS_PLOTTER::PlotFootprintTextItem(), BRDITEMS_PLOTTER::PlotFootprintTextItems(), BRDITEMS_PLOTTER::PlotPcbGraphicItem(), BRDITEMS_PLOTTER::PlotPcbShape(), BRDITEMS_PLOTTER::PlotPcbTarget(), DRC_ENGINE::ProcessAssertions(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::processItem(), PCB_CONTROL::pruneItemLayers(), PAD_TOOL::RecombinePad(), test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run(), DRC_TEST_PROVIDER_TEXT_DIMS::Run(), CLIPBOARD_IO::SaveSelection(), PCB_SELECTION_TOOL::Selectable(), shapesNeedUpdate(), GLOBAL_EDIT_TOOL::swapBoardItem(), PNS_KICAD_IFACE_BASE::syncArc(), PNS_KICAD_IFACE_BASE::syncGraphicalItem(), PNS_KICAD_IFACE_BASE::syncTrack(), PNS_KICAD_IFACE_BASE::SyncWorld(), DRC_TEST_PROVIDER_MISC::testTextVars(), CONNECTIVITY_DATA::TestTrackEndpointDangling(), textsNeedUpdate(), TRACK_VIA_DESC::TRACK_VIA_DESC(), DIALOG_DIMENSION_PROPERTIES::TransferDataToWindow(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::TransferDataToWindow(), DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataToWindow(), DIALOG_TEXTBOX_PROPERTIES::TransferDataToWindow(), BOARD_ADAPTER::transformFPShapesToPolySet(), FOOTPRINT::TransformFPShapesToPolySet(), PCB_CONTROL::UpdateMessagePanel(), FP_TEXT::ViewGetLayers(), FP_TEXTBOX::ViewGetLayers(), PCB_TRACK::ViewGetLayers(), FP_TEXT::ViewGetLOD(), FP_TEXTBOX::ViewGetLOD(), FP_ZONE::ViewGetLOD(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem(), and DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::visitItem().

◆ GetLayerID()

const PCB_LAYER_ID BOARD::GetLayerID ( const wxString &  aLayerName) const

Return the ID of a layer.

Definition at line 432 of file board.cpp.

433{
434 // Check the BOARD physical layer names.
435 for( int layer = 0; layer < PCB_LAYER_ID_COUNT; ++layer )
436 {
437 if ( m_layers[ layer ].m_name == aLayerName || m_layers[ layer ].m_userName == aLayerName )
438 return ToLAYER_ID( layer );
439 }
440
441 // Otherwise fall back to the system standard layer names for virtual layers.
442 for( int layer = 0; layer < PCB_LAYER_ID_COUNT; ++layer )
443 {
444 if( GetStandardLayerName( ToLAYER_ID( layer ) ) == aLayerName )
445 return ToLAYER_ID( layer );
446 }
447
448 return UNDEFINED_LAYER;
449}
@ UNDEFINED_LAYER
Definition: layer_ids.h:60

References GetStandardLayerName(), m_layers, PCB_LAYER_ID_COUNT, ToLAYER_ID(), and UNDEFINED_LAYER.

Referenced by PCB_EXPR_VAR_REF::GetValue(), and PCB_PARSER::parseBoardStackup().

◆ GetLayerName() [1/2]

wxString BOARD_ITEM::GetLayerName ( ) const
inherited

◆ GetLayerName() [2/2]

wxString BOARD::GetLayerName ( PCB_LAYER_ID  aLayer) const

Return the name of a aLayer.

Parameters
aLayeris the PCB_LAYER_ID of the layer.
Returns
a string containing the name of the layer.

Definition at line 452 of file board.cpp.

453{
454 // All layer names are stored in the BOARD.
455 if( IsLayerEnabled( aLayer ) )
456 {
457 // Standard names were set in BOARD::BOARD() but they may be over-ridden by
458 // BOARD::SetLayerName(). For copper layers, return the user defined layer name,
459 // if it was set. Otherwise return the Standard English layer name.
460 if( !m_layers[aLayer].m_userName.IsEmpty() )
461 return m_layers[aLayer].m_userName;
462 }
463
464 return GetStandardLayerName( aLayer );
465}
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:591
wxString m_userName
The user defined name of the layer.
Definition: board.h:183

References GetStandardLayerName(), IsLayerEnabled(), m_layers, and LAYER::m_userName.

Referenced by GERBER_JOBFILE_WRITER::addJSONMaterialStackup(), DSN::SPECCTRA_DB::buildLayerMaps(), PCB_PROPERTIES_PANEL::createPGProperty(), PANEL_SETUP_BOARD_STACKUP::createRowData(), PANEL_PCBNEW_COLOR_SETTINGS::createSwatches(), DIALOG_NET_INSPECTOR::DIALOG_NET_INSPECTOR(), DIALOG_PLOT::DIALOG_PLOT(), GRID_CELL_LAYER_RENDERER::Draw(), DRAWING_TOOL::DrawSpecificationStackup(), PCB_PLUGIN::formatBoardLayers(), GENDRILL_WRITER_BASE::GenDrillReportFile(), ZONE::GetItemDescription(), BOARD_ITEM::GetLayerName(), PCB_LAYER_BOX_SELECTOR::getLayerName(), PCB_LAYER_SELECTOR::getLayerName(), ZONE::GetMsgPanelInfo(), ZONE_SEARCH_HANDLER::GetResultCell(), GRID_CELL_LAYER_SELECTOR::GetValue(), PRIVATE_LAYERS_GRID_TABLE::GetValue(), DIALOG_PLOT::init_Dialog(), DIALOG_EXPORT_SVG::initDialog(), DIALOG_PAD_PROPERTIES::initValues(), BOARD_INSPECTION_TOOL::InspectClearance(), PCBNEW_JOBS_HANDLER::JobExportGerbers(), DRC_TEST_PROVIDER_CONNECTION_WIDTH::layerDesc(), DRC_TEST_PROVIDER_SLIVER_CHECKER::layerDesc(), BOARD_ITEM::layerMaskDescribe(), PCB_VIA::layerMaskDescribe(), CADSTAR_PCB_ARCHIVE_LOADER::Load(), PCBNEW_PRINTOUT::OnPrintPage(), DIALOG_PLOT::Plot(), APPEARANCE_CONTROLS::rebuildLayers(), BOARD_INSPECTION_TOOL::reportHeader(), DIALOG_GLOBAL_DELETION::SetCurrentLayer(), ZONE_SETTINGS::SetupLayersList(), PANEL_SETUP_LAYERS::showBoardLayerNames(), StartPlotBoard(), PANEL_SETUP_LAYERS::TransferDataFromWindow(), DIALOG_FOOTPRINT_PROPERTIES::TransferDataToWindow(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::TransferDataToWindow(), DIALOG_PRINT_PCBNEW::TransferDataToWindow(), BOARD_NETLIST_UPDATER::updateCopperZoneNets(), DIALOG_BOARD_STATISTICS::updateDrillGrid(), DIALOG_PAD_PROPERTIES::UpdateLayersDropdown(), HYPERLYNX_EXPORTER::writeDevices(), WriteDRCReport(), HYPERLYNX_EXPORTER::writeNetObjects(), HYPERLYNX_EXPORTER::writeSinglePadStack(), and HYPERLYNX_EXPORTER::writeStackupInfo().

◆ GetLayerSet()

virtual LSET BOARD_ITEM::GetLayerSet ( ) const
inlinevirtualinherited

Return a std::bitset of all layers on which the item physically resides.

Reimplemented in PCB_GROUP, PAD, PCB_VIA, and ZONE.

Definition at line 185 of file board_item.h.

186 {
187 if( m_layer == UNDEFINED_LAYER )
188 return LSET();
189 else
190 return LSET( m_layer );
191 }

References BOARD_ITEM::m_layer, and UNDEFINED_LAYER.

Referenced by PCB_GRID_HELPER::BestSnapAnchor(), KI_TEST::CheckFpShape(), collidesWithArea(), BOARD_COMMIT::dirtyIntersectingZones(), APPEARANCE_CONTROLS::doApplyLayerPreset(), DIALOG_GLOBAL_DELETION::DoGlobalDeletions(), KIGFX::PCB_PAINTER::draw(), KIGFX::PCB_PAINTER::Draw(), DRAWING_TOOL::DrawVia(), DRC_ENGINE::EvalRules(), existsOnLayerFunc(), extractDiffPairCoupledItems(), FP_TEXT::Flip(), FP_TEXTBOX::Flip(), PCB_TEXT::Flip(), PCB_TEXTBOX::Flip(), hash_board_item(), BOARD_INSPECTION_TOOL::InspectClearance(), PNS_KICAD_IFACE::IsItemVisible(), isMaskAperture(), BOARD_ITEM::layerMaskDescribe(), FABMASTER::loadZone(), PCB_DIMENSION_BASE::Mirror(), PCB_GRID_HELPER::nearestAnchor(), PCB_POINT_EDITOR::OnSelectionChange(), DIALOG_CLEANUP_GRAPHICS::OnSelectItem(), DIALOG_FOOTPRINT_CHECKER::OnSelectItem(), CN_VISITOR::operator()(), BOARD_ITEM::ptr_cmp::operator()(), KI_TEST::kitest_cmp_drawings::operator()(), DRC_ENGINE::ProcessAssertions(), EDIT_TOOL::Properties(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::Run(), PCB_SELECTION_CONDITIONS::sameLayerFunc(), PCB_SELECTION_TOOL::selectAllConnectedTracks(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstItem(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testItemAgainstZone(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstZones(), PANEL_SETUP_LAYERS::TransferDataFromWindow(), and PCB_CONTROL::UpdateMessagePanel().

◆ GetLayerType()

LAYER_T BOARD::GetLayerType ( PCB_LAYER_ID  aLayer) const

Return the type of the copper layer given by aLayer.

Parameters
aLayerA layer index, like B_Cu, etc.
Returns
the layer type, or LAYER_T(-1) if the index was out of range.

Definition at line 486 of file board.cpp.

487{
488 if( !IsCopperLayer( aLayer ) )
489 return LT_SIGNAL;
490
491 if( IsLayerEnabled( aLayer ) )
492 return m_layers[aLayer].m_type;
493
494 return LT_SIGNAL;
495}

References IsCopperLayer(), IsLayerEnabled(), LT_SIGNAL, m_layers, and LAYER::m_type.

Referenced by PCB_PLUGIN::formatBoardLayers(), DSN::SPECCTRA_DB::FromBOARD(), GetGerberFileFunctionAttribute(), PANEL_SETUP_LAYERS::showLayerTypes(), and PANEL_SETUP_LAYERS::TransferDataFromWindow().

◆ GetMenuImage()

BITMAPS EDA_ITEM::GetMenuImage ( ) const
virtualinherited

Return a pointer to an image to be used in menus.

The default version returns the right arrow image. Override this function to provide object specific menu images.

Returns
The menu image associated with the item.

Reimplemented in LIB_FIELD, LIB_PIN, LIB_SHAPE, LIB_TEXT, LIB_TEXTBOX, SCH_BITMAP, SCH_BUS_WIRE_ENTRY, SCH_BUS_BUS_ENTRY, SCH_FIELD, SCH_JUNCTION, SCH_LABEL, SCH_GLOBALLABEL, SCH_HIERLABEL, SCH_LINE, SCH_MARKER, SCH_NO_CONNECT, SCH_SHAPE, SCH_SHEET, SCH_SHEET_PIN, SCH_SYMBOL, SCH_TEXT, SCH_TEXTBOX, GERBER_DRAW_ITEM, PCB_GROUP, FOOTPRINT, FP_SHAPE, FP_TEXT, FP_TEXTBOX, PAD, PCB_BITMAP, PCB_DIM_ALIGNED, PCB_DIM_ORTHOGONAL, PCB_DIM_RADIAL, PCB_DIM_LEADER, PCB_DIM_CENTER, PCB_MARKER, PCB_SHAPE, PCB_TARGET, PCB_TEXT, PCB_TEXTBOX, PCB_TRACK, PCB_VIA, and ZONE.

Definition at line 269 of file eda_item.cpp.

270{
271 return BITMAPS::dummy_item;
272}

References dummy_item.

Referenced by SELECTION_TOOL::doSelectionMenu().

◆ GetMsgPanelInfo()

void BOARD::GetMsgPanelInfo ( EDA_DRAW_FRAME aFrame,
std::vector< MSG_PANEL_ITEM > &  aList 
)
overridevirtual

Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.

Parameters
aListis the list to populate.

Reimplemented from EDA_ITEM.

Definition at line 1292 of file board.cpp.

1293{
1294 int padCount = 0;
1295 int viaCount = 0;
1296 int trackSegmentCount = 0;
1297 std::set<int> netCodes;
1298 int unconnected = GetConnectivity()->GetUnconnectedCount( true );
1299
1300 for( PCB_TRACK* item : m_tracks )
1301 {
1302 if( item->Type() == PCB_VIA_T )
1303 viaCount++;
1304 else
1305 trackSegmentCount++;
1306
1307 if( item->GetNetCode() > 0 )
1308 netCodes.insert( item->GetNetCode() );
1309 }
1310
1311 for( FOOTPRINT* footprint : Footprints() )
1312 {
1313 for( PAD* pad : footprint->Pads() )
1314 {
1315 padCount++;
1316
1317 if( pad->GetNetCode() > 0 )
1318 netCodes.insert( pad->GetNetCode() );
1319 }
1320 }
1321
1322 aList.emplace_back( _( "Pads" ), wxString::Format( wxT( "%d" ), padCount ) );
1323 aList.emplace_back( _( "Vias" ), wxString::Format( wxT( "%d" ), viaCount ) );
1324 aList.emplace_back( _( "Track Segments" ), wxString::Format( wxT( "%d" ), trackSegmentCount ) );
1325 aList.emplace_back( _( "Nets" ), wxString::Format( wxT( "%d" ), (int) netCodes.size() ) );
1326 aList.emplace_back( _( "Unrouted" ), wxString::Format( wxT( "%d" ), unconnected ) );
1327}

References _, Footprints(), Format(), GetConnectivity(), m_tracks, pad, and PCB_VIA_T.

Referenced by PCB_CONTROL::UpdateMessagePanel().

◆ GetNetClassAssignmentCandidates()

std::set< wxString > BOARD::GetNetClassAssignmentCandidates ( ) const

Return the set of netname candidates for netclass assignment.

Definition at line 1501 of file board.cpp.

1502{
1503 std::set<wxString> names;
1504
1505 for( const NETINFO_ITEM* net : m_NetInfo )
1506 {
1507 if( !net->GetNetname().IsEmpty() )
1508 names.insert( net->GetNetname() );
1509 }
1510
1511 return names;
1512}

References m_NetInfo.

Referenced by DIALOG_BOARD_SETUP::DIALOG_BOARD_SETUP(), and PANEL_SETUP_RULES::onScintillaCharAdded().

◆ GetNetCount()

unsigned BOARD::GetNetCount ( ) const
inline
Returns
the number of nets (NETINFO_ITEM).

Definition at line 796 of file board.h.

797 {
798 return m_NetInfo.GetNetCount();
799 }

References NETINFO_LIST::GetNetCount(), and m_NetInfo.

Referenced by CreateSignalsSection(), and PCB_PARSER::parseZONE().

◆ GetNetInfo() [1/2]

NETINFO_LIST & BOARD::GetNetInfo ( )
inline

Definition at line 770 of file board.h.

771 {
772 return m_NetInfo;
773 }

References m_NetInfo.

◆ GetNetInfo() [2/2]

◆ GetNodesCount()

unsigned BOARD::GetNodesCount ( int  aNet = -1) const
Parameters
aNetOnly count nodes belonging to this net.
Returns
the number of pads members of nets (i.e. with netcode > 0).

Definition at line 1214 of file board.cpp.

1215{
1216 unsigned retval = 0;
1217
1218 for( FOOTPRINT* footprint : Footprints() )
1219 {
1220 for( PAD* pad : footprint->Pads() )
1221 {
1222 if( ( aNet == -1 && pad->GetNetCode() > 0 ) || aNet == pad->GetNetCode() )
1223 retval++;
1224 }
1225 }
1226
1227 return retval;
1228}

References Footprints(), and pad.

Referenced by DIALOG_NET_INSPECTOR::OnBoardItemAdded(), and DIALOG_NET_INSPECTOR::updateNet().

◆ GetPad() [1/4]

PAD * BOARD::GetPad ( const PCB_TRACK aTrace,
ENDPOINT_T  aEndPoint 
) const

Find a pad connected to aEndPoint of aTrace.

Parameters
aTraceA pointer to a PCB_TRACK object to hit test against.
aEndPointThe end point of aTrace the hit test against.
Returns
A pointer to a PAD object if found or NULL if not found.

Definition at line 1606 of file board.cpp.

1607{
1608 const VECTOR2I& aPosition = aTrace->GetEndPoint( aEndPoint );
1609
1610 LSET lset( aTrace->GetLayer() );
1611
1612 return GetPad( aPosition, lset );
1613}
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition: board_item.h:180
PAD * GetPad(const VECTOR2I &aPosition, LSET aLayerMask) const
Find a pad aPosition on aLayer.
Definition: board.cpp:1586
const VECTOR2I & GetEndPoint(ENDPOINT_T aEndPoint) const
Return the selected endpoint (start or end)
Definition: pcb_track.h:122

References PCB_TRACK::GetEndPoint(), BOARD_ITEM::GetLayer(), and GetPad().

◆ GetPad() [2/4]

PAD * BOARD::GetPad ( const VECTOR2I aPosition) const
inline

Definition at line 967 of file board.h.

968 {
969 return GetPad( aPosition, LSET().set() );
970 }

References GetPad().

◆ GetPad() [3/4]

PAD * BOARD::GetPad ( const VECTOR2I aPosition,
LSET  aLayerMask 
) const

Find a pad aPosition on aLayer.

Parameters
aPositionA VECTOR2I object containing the position to hit test.
aLayerMaskA layer or layers to mask the hit test.
Returns
A pointer to a PAD object if found or NULL if not found.

Definition at line 1586 of file board.cpp.

1587{
1588 if( !aLayerSet.any() )
1589 aLayerSet = LSET::AllCuMask();
1590
1591 for( FOOTPRINT* footprint : m_footprints )
1592 {
1593 PAD* pad = nullptr;
1594
1595 if( footprint->HitTest( aPosition ) )
1596 pad = footprint->GetPad( aPosition, aLayerSet );
1597
1598 if( pad )
1599 return pad;
1600 }
1601
1602 return nullptr;
1603}
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:773

References LSET::AllCuMask(), m_footprints, and pad.

Referenced by GetPad().

◆ GetPad() [4/4]

PAD * BOARD::GetPad ( std::vector< PAD * > &  aPadList,
const VECTOR2I aPosition,
LSET  aLayerMask 
) const

Locate the pad connected at aPosition on aLayer starting at list position aPad.

This function uses a fast search in this sorted pad list and it is faster than GetPadFast(). This list is a sorted pad list must be built before calling this function.

Note
The normal pad list is sorted by increasing netcodes.
Parameters
aPadListis the list of pads candidates (a std::vector<PAD*>).
aPositionA VECTOR2I object containing the position to test.
aLayerMaskA layer or layers to mask the hit test.
Returns
a PAD object pointer to the connected pad.

Definition at line 1635 of file board.cpp.

1636{
1637 // Search aPadList for aPosition
1638 // aPadList is sorted by X then Y values, and a fast binary search is used
1639 int idxmax = aPadList.size() - 1;
1640
1641 int delta = aPadList.size();
1642
1643 int idx = 0; // Starting index is the beginning of list
1644
1645 while( delta )
1646 {
1647 // Calculate half size of remaining interval to test.
1648 // Ensure the computed value is not truncated (too small)
1649 if( (delta & 1) && ( delta > 1 ) )
1650 delta++;
1651
1652 delta /= 2;
1653
1654 PAD* pad = aPadList[idx];
1655
1656 if( pad->GetPosition() == aPosition ) // candidate found
1657 {
1658 // The pad must match the layer mask:
1659 if( ( aLayerSet & pad->GetLayerSet() ).any() )
1660 return pad;
1661
1662 // More than one pad can be at aPosition
1663 // search for a pad at aPosition that matched this mask
1664
1665 // search next
1666 for( int ii = idx+1; ii <= idxmax; ii++ )
1667 {
1668 pad = aPadList[ii];
1669
1670 if( pad->GetPosition() != aPosition )
1671 break;
1672
1673 if( ( aLayerSet & pad->GetLayerSet() ).any() )
1674 return pad;
1675 }
1676 // search previous
1677 for( int ii = idx - 1 ;ii >=0; ii-- )
1678 {
1679 pad = aPadList[ii];
1680
1681 if( pad->GetPosition() != aPosition )
1682 break;
1683
1684 if( ( aLayerSet & pad->GetLayerSet() ).any() )
1685 return pad;
1686 }
1687
1688 // Not found:
1689 return nullptr;
1690 }
1691
1692 if( pad->GetPosition().x == aPosition.x ) // Must search considering Y coordinate
1693 {
1694 if( pad->GetPosition().y < aPosition.y ) // Must search after this item
1695 {
1696 idx += delta;
1697
1698 if( idx > idxmax )
1699 idx = idxmax;
1700 }
1701 else // Must search before this item
1702 {
1703 idx -= delta;
1704
1705 if( idx < 0 )
1706 idx = 0;
1707 }
1708 }
1709 else if( pad->GetPosition().x < aPosition.x ) // Must search after this item
1710 {
1711 idx += delta;
1712
1713 if( idx > idxmax )
1714 idx = idxmax;
1715 }
1716 else // Must search before this item
1717 {
1718 idx -= delta;
1719
1720 if( idx < 0 )
1721 idx = 0;
1722 }
1723 }
1724
1725 return nullptr;
1726}
constexpr int delta

References delta, pad, VECTOR2< T >::x, and VECTOR2< T >::y.

◆ GetPadFast()

PAD * BOARD::GetPadFast ( const VECTOR2I aPosition,
LSET  aLayerMask 
) const

Return pad found at aPosition on aLayerMask using the fast search method.

The fast search method only works if the pad list has already been built.

Parameters
aPositionA VECTOR2I object containing the position to hit test.
aLayerMaskA layer or layers to mask the hit test.
Returns
A pointer to a PAD object if found or NULL if not found.

Definition at line 1616 of file board.cpp.

1617{
1618 for( FOOTPRINT* footprint : Footprints() )
1619 {
1620 for( PAD* pad : footprint->Pads() )
1621 {
1622 if( pad->GetPosition() != aPosition )
1623 continue;
1624
1625 // Pad found, it must be on the correct layer
1626 if( ( pad->GetLayerSet() & aLayerSet ).any() )
1627 return pad;
1628 }
1629 }
1630
1631 return nullptr;
1632}

References Footprints(), and pad.

◆ GetPads()

const std::vector< PAD * > BOARD::GetPads ( ) const

Return a reference to a list of all the pads.

The returned list is not sorted and contains pointers to PADS, but those pointers do not convey ownership of the respective PADs.

Returns
a full list of pads.

Definition at line 1965 of file board.cpp.

1966{
1967 std::vector<PAD*> allPads;
1968
1969 for( FOOTPRINT* footprint : Footprints() )
1970 {
1971 for( PAD* pad : footprint->Pads() )
1972 allPads.push_back( pad );
1973 }
1974
1975 return allPads;
1976}

References Footprints(), and pad.

Referenced by CreatePadsShapesSection(), and DIALOG_COPPER_ZONE::sortNetsByPadCount().

◆ GetPageSettings()

◆ GetParent()

BOARD_ITEM_CONTAINER * BOARD_ITEM::GetParent ( void  ) const
inlineinherited

Definition at line 163 of file board_item.h.

163{ return (BOARD_ITEM_CONTAINER*) m_parent; }
EDA_ITEM * m_parent
Linked list: Link (parent struct)
Definition: eda_item.h:496

References EDA_ITEM::m_parent.

Referenced by PCB_POINT_EDITOR::addCorner(), ALIGN_DISTRIBUTE_TOOL::AlignBottom(), ALIGN_DISTRIBUTE_TOOL::AlignCenterX(), ALIGN_DISTRIBUTE_TOOL::AlignCenterY(), ALIGN_DISTRIBUTE_TOOL::AlignTop(), PNS_KICAD_IFACE::Commit(), FOOTPRINT::CoverageRatio(), BOARD_ITEM::DeleteStructure(), ALIGN_DISTRIBUTE_TOOL::doAlignLeft(), ALIGN_DISTRIBUTE_TOOL::doAlignRight(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersVertically(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsVertically(), EDIT_TOOL::DragArcTrack(), KIGFX::PCB_PAINTER::draw(), EDIT_TOOL::Duplicate(), PCB_SELECTION_TOOL::FilterCollectorForFreePads(), PCB_SELECTION_TOOL::FilterCollectorForHierarchy(), PCB_PLUGIN::format(), FormatProbeItem(), BOARD_ITEM::GetBoard(), getClosestGroup(), FP_TEXT::GetItemDescription(), FP_TEXTBOX::GetItemDescription(), BOARD_ITEM::GetParentFootprint(), ALIGN_DISTRIBUTE_TOOL::GetSelections(), FP_TEXT::GetShownText(), FP_TEXTBOX::GetShownText(), PCB_TEXT::GetShownText(), PCB_TEXTBOX::GetShownText(), ALTIUM_PCB::HelperShapeSetLocalCoord(), GENERAL_COLLECTOR::Inspect(), FP_SHAPE::IsParentFlipped(), FP_TEXT::IsParentFlipped(), PCB_SELECTION_TOOL::itemPassesFilter(), memberOfFunc(), EDIT_TOOL::MoveExact(), BRDITEMS_PLOTTER::PlotFootprintShape(), BRDITEMS_PLOTTER::PlotFootprintTextItem(), BOARD_COMMIT::Push(), PCB_PARSER::resolveGroups(), PCB_BASE_EDIT_FRAME::saveCopyInUndoList(), CLIPBOARD_IO::SaveSelection(), PCB_SELECTION_TOOL::Selectable(), BOARD_ITEM::SwapItemData(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem(), FP_ZONE::ViewGetLOD(), and DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem().

◆ GetParentFootprint()

◆ GetParentGroup()

◆ GetPlotOptions()

◆ GetPosition()

VECTOR2I BOARD::GetPosition ( ) const
overridevirtual

Reimplemented from EDA_ITEM.

Definition at line 367 of file board.cpp.

368{
369 return ZeroOffset;
370}
static VECTOR2I ZeroOffset
A value of wxPoint(0,0) which can be passed to the Draw() functions.
Definition: board_item.h:141

References BOARD_ITEM::ZeroOffset.

◆ GetProject()

◆ GetProperties()

const std::map< wxString, wxString > & BOARD::GetProperties ( ) const
inline

Definition at line 332 of file board.h.

332{ return m_properties; }
std::map< wxString, wxString > m_properties
Definition: board.h:1192

References m_properties.

Referenced by PCB_CONTROL::AppendBoard(), PCB_PLUGIN::formatProperties(), PCB_EDIT_FRAME::SetPageSettings(), and StartPlotBoard().

◆ GetSortedPadListByXthenYCoord()

void BOARD::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, and for increasing y coordinate for same values of x coordinates.

The vector only holds pointers to the pads and those pointers are only references to pads which are owned by the BOARD through other links.

Parameters
aVectorWhere to put the pad pointers.
aNetCode= the netcode filter: = -1 to build the full pad list. = a given netcode to build the pad list relative to the given net

Definition at line 1743 of file board.cpp.

1744{
1745 for( FOOTPRINT* footprint : Footprints() )
1746 {
1747 for( PAD* pad : footprint->Pads( ) )
1748 {
1749 if( aNetCode < 0 || pad->GetNetCode() == aNetCode )
1750 aVector.push_back( pad );
1751 }
1752 }
1753
1754 std::sort( aVector.begin(), aVector.end(), sortPadsByXthenYCoord );
1755}
bool sortPadsByXthenYCoord(PAD *const &aLH, PAD *const &aRH)
Used by #GetSortedPadListByXCoord to sort a pad list by X coordinate value.
Definition: board.cpp:1734

References Footprints(), pad, and sortPadsByXthenYCoord().

◆ GetSortPosition()

virtual VECTOR2I EDA_ITEM::GetSortPosition ( ) const
inlinevirtualinherited

Return the coordinates that should be used for sorting this element visually compared to other elements.

For instance, for lines the midpoint might be a better sorting point than either end.

Returns
X,Y coordinate of the sort point

Reimplemented in SCH_LINE.

Definition at line 265 of file eda_item.h.

265{ return GetPosition(); }
virtual VECTOR2I GetPosition() const
Definition: eda_item.h:249

References EDA_ITEM::GetPosition().

◆ GetStandardLayerName()

static wxString BOARD::GetStandardLayerName ( PCB_LAYER_ID  aLayerId)
inlinestatic

Return an "English Standard" name of a PCB layer when given aLayerNumber.

This function is static so it can be called without a BOARD instance. Use GetLayerName() if want the layer names of a specific BOARD, which could be different than the default if the user has renamed any copper layers.

Parameters
aLayerIdis the layer identifier (index) to fetch.
Returns
a string containing the layer name or "BAD INDEX" if aLayerId is not legal.

Definition at line 696 of file board.h.

697 {
698 // a BOARD's standard layer name is the PCB_LAYER_ID fixed name
699 return LayerName( aLayerId );
700 }
wxString LayerName(int aLayer)
Returns the default display name for a given layer.
Definition: layer_id.cpp:30

References LayerName().

Referenced by BOARD(), GRID_CELL_LAYER_RENDERER::Draw(), DIALOG_EXPORT_SVG::ExportSVGFile(), GetLayerID(), BOARD_ITEM::GetLayerName(), PCB_LAYER_BOX_SELECTOR::getLayerName(), GetLayerName(), and GRID_CELL_LAYER_SELECTOR::GetValue().

◆ GetState()

int EDA_ITEM::GetState ( EDA_ITEM_FLAGS  type) const
inlineinherited

Definition at line 123 of file eda_item.h.

124 {
125 return m_status & type;
126 }
EDA_ITEM_FLAGS m_status
Definition: eda_item.h:495

References EDA_ITEM::m_status.

◆ GetStatus()

EDA_ITEM_FLAGS EDA_ITEM::GetStatus ( ) const
inlineinherited

Definition at line 136 of file eda_item.h.

136{ return m_status; }

References EDA_ITEM::m_status.

◆ GetStroke()

STROKE_PARAMS BOARD_ITEM::GetStroke ( ) const
virtualinherited

Reimplemented in PCB_SHAPE.

Definition at line 82 of file board_item.cpp.

83{
84 wxCHECK( false, STROKE_PARAMS( pcbIUScale.mmToIU( DEFAULT_LINE_WIDTH ) ) );
85}
#define DEFAULT_LINE_WIDTH
Simple container to manage line stroke parameters.
Definition: stroke_params.h:88

References DEFAULT_LINE_WIDTH, EDA_IU_SCALE::mmToIU(), and pcbIUScale.

Referenced by CONVERT_TOOL::CreatePolys(), and PCB_BASE_EDIT_FRAME::ShowGraphicItemPropertiesDialog().

◆ GetTentVias()

bool BOARD::GetTentVias ( ) const
inline

◆ GetTimeStamp()

int BOARD::GetTimeStamp ( ) const
inline

◆ GetTitleBlock() [1/2]

◆ GetTitleBlock() [2/2]

const TITLE_BLOCK & BOARD::GetTitleBlock ( ) const
inline

Definition at line 633 of file board.h.

633{ return m_titles; }

References m_titles.

◆ GetTrackLength()

std::tuple< int, double, double > BOARD::GetTrackLength ( const PCB_TRACK aTrack) const

Return data on the length and number of track segments connected to a given track.

This uses the connectivity data for the board to calculate connections

Parameters
aTrackStarting track (can also be a via) to check against for connection.
Returns
a tuple containing <number, length, package length>

Definition at line 1758 of file board.cpp.

1759{
1760 int count = 0;
1761 double length = 0.0;
1762 double package_length = 0.0;
1763
1764 auto connectivity = GetBoard()->GetConnectivity();
1767
1768 for( BOARD_CONNECTED_ITEM* item : connectivity->GetConnectedItems(
1769 static_cast<const BOARD_CONNECTED_ITEM*>( &aTrack ),
1770 { PCB_TRACE_T, PCB_ARC_T, PCB_VIA_T, PCB_PAD_T } ) )
1771 {
1772 count++;
1773
1774 if( PCB_TRACK* track = dynamic_cast<PCB_TRACK*>( item ) )
1775 {
1776 if( track->Type() == PCB_VIA_T && useHeight )
1777 {
1778 PCB_VIA* via = static_cast<PCB_VIA*>( track );
1779 length += stackup.GetLayerDistance( via->TopLayer(), via->BottomLayer() );
1780 continue;
1781 }
1782 else if( track->Type() == PCB_ARC_T )
1783 {
1784 // Note: we don't apply the clip-to-pad optimization if an arc ends in a pad
1785 // Room for future improvement.
1786 length += track->GetLength();
1787 continue;
1788 }
1789
1790 bool inPad = false;
1791 SEG trackSeg( track->GetStart(), track->GetEnd() );
1792 double segLen = trackSeg.Length();
1793 double segInPadLen = 0;
1794
1795 for( auto pad_it : connectivity->GetConnectedPads( item ) )
1796 {
1797 PAD* pad = static_cast<PAD*>( pad_it );
1798
1799 bool hitStart = pad->HitTest( track->GetStart(), track->GetWidth() / 2 );
1800 bool hitEnd = pad->HitTest( track->GetEnd(), track->GetWidth() / 2 );
1801
1802 if( hitStart && hitEnd )
1803 {
1804 inPad = true;
1805 break;
1806 }
1807 else if( hitStart || hitEnd )
1808 {
1809 VECTOR2I loc;
1810
1811 // We may not collide even if we passed the bounding-box hit test
1812 if( pad->GetEffectivePolygon()->Collide( trackSeg, 0, nullptr, &loc ) )
1813 {
1814 // Part 1: length of the seg to the intersection with the pad poly
1815 if( hitStart )
1816 trackSeg.A = loc;
1817 else
1818 trackSeg.B = loc;
1819
1820 segLen = trackSeg.Length();
1821
1822 // Part 2: length from the intersection to the pad anchor
1823 segInPadLen += ( loc - pad->GetPosition() ).EuclideanNorm();
1824 }
1825 }
1826 }
1827
1828 if( !inPad )
1829 length += segLen + segInPadLen;
1830 }
1831 else if( PAD* pad = dyn_cast<PAD*>( item ) )
1832 {
1833 package_length += pad->GetPadToDieLength();
1834 }
1835 }
1836
1837 return std::make_tuple( count, length, package_length );
1838}
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
BOARD_STACKUP & GetStackupDescriptor()
bool m_UseHeightForLengthCalcs
Enable inclusion of stackup height in track length measurements and length tuning.
Manage layers needed to make a physical board.
int GetLayerDistance(PCB_LAYER_ID aFirstLayer, PCB_LAYER_ID aSecondLayer) const
Calculate the distance (height) between the two given copper layers.
Definition: seg.h:42
double EuclideanNorm(const VECTOR2I &vector)
Definition: trigo.h:129

References SEG::A, SEG::B, EuclideanNorm(), BOARD_ITEM::GetBoard(), GetConnectivity(), GetDesignSettings(), BOARD_STACKUP::GetLayerDistance(), BOARD_DESIGN_SETTINGS::GetStackupDescriptor(), SEG::Length(), BOARD_DESIGN_SETTINGS::m_UseHeightForLengthCalcs, pad, PCB_ARC_T, PCB_VIA_T, and via.

Referenced by NETINFO_ITEM::GetMsgPanelInfo(), and PCB_TRACK::GetMsgPanelInfo().

◆ GetTypeDesc()

wxString EDA_ITEM::GetTypeDesc ( ) const
inherited

Return a translated description of the type for this EDA_ITEM for display in user facing messages.

Definition at line 301 of file eda_item.cpp.

302{
303 //@see EDA_ITEM_DESC for definition of ENUM_MAP<KICAD_T>
304 wxString typeDescr = ENUM_MAP<KICAD_T>::Instance().ToString( Type() );
305
306 return wxGetTranslation( typeDescr );
307}
static ENUM_MAP< T > & Instance()
Definition: property.h:573

References ENUM_MAP< T >::Instance(), and EDA_ITEM::Type().

Referenced by PCB_GROUP::AddItem(), EDIT_TOOL::doMoveSelection(), and EDA_ITEM::GetFriendlyName().

◆ GetVisibleElements()

GAL_SET BOARD::GetVisibleElements ( ) const

Return a set of all the element categories that are visible.

Returns
the set of visible GAL layers.
See also
enum GAL_LAYER_ID

Definition at line 625 of file board.cpp.

626{
628}
Helper for storing and iterating over GAL_LAYER_IDs.
Definition: layer_ids.h:296
GAL_SET m_VisibleItems
The GAL layers (aka items) that are turned on for viewing (.
virtual PROJECT_LOCAL_SETTINGS & GetLocalSettings() const
Definition: project.h:155

References PROJECT::GetLocalSettings(), m_project, PROJECT_LOCAL_SETTINGS::m_VisibleItems, and GAL_SET::set().

Referenced by APPEARANCE_CONTROLS::getVisibleObjects(), and PCB_EDIT_FRAME::setupUIConditions().

◆ GetVisibleLayers()

◆ GetX()

◆ GetY()

◆ GetZoneList()

std::list< ZONE * > BOARD::GetZoneList ( bool  aIncludeZonesInFootprints = false) const
Returns
a std::list of pointers to all board zones (possibly including zones in footprints)

Definition at line 1905 of file board.cpp.

1906{
1907 std::list<ZONE*> zones;
1908
1909 for( ZONE* zone : Zones() )
1910 zones.push_back( zone );
1911
1912 if( aIncludeZonesInFootprints )
1913 {
1914 for( FOOTPRINT* footprint : m_footprints )
1915 {
1916 for( FP_ZONE* zone : footprint->Zones() )
1917 zones.push_back( zone );
1918 }
1919 }
1920
1921 return zones;
1922}
A specialization of ZONE for use in footprints.
Definition: zone.h:910

References m_footprints, and Zones().

◆ GetZoneSettings()

const ZONE_SETTINGS & BOARD::GetZoneSettings ( ) const
overridevirtual

Fetch the zone settings for this container.

Reimplemented from BOARD_ITEM_CONTAINER.

Definition at line 688 of file board.cpp.

689{
691}
ZONE_SETTINGS & GetDefaultZoneSettings()

References BOARD_DESIGN_SETTINGS::GetDefaultZoneSettings(), and GetDesignSettings().

Referenced by LEGACY_PLUGIN::loadSETUP().

◆ GroupLegalOps()

BOARD::GroupLegalOpsField BOARD::GroupLegalOps ( const PCB_SELECTION selection) const

Check which selection tool group operations are legal given the selection.

Returns
bit field of legal ops.

Definition at line 2171 of file board.cpp.

2172{
2173 bool hasGroup = false;
2174 bool hasMember = false;
2175
2176 for( EDA_ITEM* item : selection )
2177 {
2178 if( item->Type() == PCB_GROUP_T )
2179 hasGroup = true;
2180
2181 if( static_cast<BOARD_ITEM*>( item )->GetParentGroup() )
2182 hasMember = true;
2183 }
2184
2185 GroupLegalOpsField legalOps;
2186
2187 legalOps.create = true;
2188 legalOps.removeItems = hasMember;
2189 legalOps.ungroup = hasGroup;
2190
2191 return legalOps;
2192}
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:85

References BOARD::GroupLegalOpsField::create, BOARD_ITEM::GetParentGroup(), PCB_GROUP_T, BOARD::GroupLegalOpsField::removeItems, and BOARD::GroupLegalOpsField::ungroup.

◆ Groups() [1/2]

GROUPS & BOARD::Groups ( )
inline

The groups must maintain the following invariants.

These are checked by GroupsSanityCheck():

  • An item may appear in at most one group
  • Each group must contain at least one item
  • If a group specifies a name, it must be unique
  • The graph of groups containing subgroups must be cyclic.

Definition at line 327 of file board.h.

327{ return m_groups; }

References m_groups.

Referenced by PCB_CONTROL::AppendBoard(), PCB_PLUGIN::format(), GroupsSanityCheckInternal(), PCB_CONTROL::Paste(), PCB_CONTROL::placeBoardItems(), and TestForExistingItem().

◆ Groups() [2/2]

const GROUPS & BOARD::Groups ( ) const
inline

Definition at line 328 of file board.h.

328{ return m_groups; }

References m_groups.

◆ GroupsSanityCheck()

wxString BOARD::GroupsSanityCheck ( bool  repair = false)

Consistency check of internal m_groups structure.

Parameters
repairif true, modify groups structure until it passes the sanity check.
Returns
empty string on success. Or error description if there's a problem.

Definition at line 2092 of file board.cpp.

2093{
2094 if( repair )
2095 {
2096 while( GroupsSanityCheckInternal( repair ) != wxEmptyString )
2097 {};
2098
2099 return wxEmptyString;
2100 }
2101 return GroupsSanityCheckInternal( repair );
2102}
wxString GroupsSanityCheckInternal(bool repair)
Definition: board.cpp:2105

References GroupsSanityCheckInternal().

Referenced by PCB_PARSER::resolveGroups(), and PCB_PLUGIN::Save().

◆ GroupsSanityCheckInternal()

wxString BOARD::GroupsSanityCheckInternal ( bool  repair)
Parameters
repairif true, make one modification to groups structure that brings it closer to passing the sanity check.
Returns
empty string on success. Or error description if there's a problem.

Definition at line 2105 of file board.cpp.

2106{
2107 // Cycle detection
2108 //
2109 // Each group has at most one parent group.
2110 // So we start at group 0 and traverse the parent chain, marking groups seen along the way.
2111 // If we ever see a group that we've already marked, that's a cycle.
2112 // If we reach the end of the chain, we know all groups in that chain are not part of any cycle.
2113 //
2114 // Algorithm below is linear in the # of groups because each group is visited only once.
2115 // There may be extra time taken due to the container access calls and iterators.
2116 //
2117 // Groups we know are cycle free
2118 std::unordered_set<PCB_GROUP*> knownCycleFreeGroups;
2119 // Groups in the current chain we're exploring.
2120 std::unordered_set<PCB_GROUP*> currentChainGroups;
2121 // Groups we haven't checked yet.
2122 std::unordered_set<PCB_GROUP*> toCheckGroups;
2123
2124 // Initialize set of groups to check that could participate in a cycle.
2125 for( PCB_GROUP* group : Groups() )
2126 toCheckGroups.insert( group);
2127
2128 while( !toCheckGroups.empty() )
2129 {
2130 currentChainGroups.clear();
2131 PCB_GROUP* group = *toCheckGroups.begin();
2132
2133 while( true )
2134 {
2135 if( currentChainGroups.find( group ) != currentChainGroups.end() )
2136 {
2137 if( repair )
2138 Remove( group );
2139
2140 return "Cycle detected in group membership";
2141 }
2142 else if( knownCycleFreeGroups.find( group ) != knownCycleFreeGroups.end() )
2143 {
2144 // Parent is a group we know does not lead to a cycle
2145 break;
2146 }
2147
2148 currentChainGroups.insert( group );
2149 // We haven't visited currIdx yet, so it must be in toCheckGroups
2150 toCheckGroups.erase( group );
2151
2152 group = group->GetParentGroup();
2153
2154 if( !group )
2155 {
2156 // end of chain and no cycles found in this chain
2157 break;
2158 }
2159 }
2160
2161 // No cycles found in chain, so add it to set of groups we know don't participate
2162 // in a cycle.
2163 knownCycleFreeGroups.insert( currentChainGroups.begin(), currentChainGroups.end() );
2164 }
2165
2166 // Success
2167 return "";
2168}
GROUPS & Groups()
The groups must maintain the following invariants.
Definition: board.h:327
void Remove(BOARD_ITEM *aBoardItem, REMOVE_MODE aMode=REMOVE_MODE::NORMAL) override
Removes an item from the container.
Definition: board.cpp:859

References group, Groups(), and Remove().

Referenced by GroupsSanityCheck().

◆ HasFlag()

◆ HasHole()

◆ HasLineStroke()

virtual bool BOARD_ITEM::HasLineStroke ( ) const
inlinevirtualinherited

Check if this item has line stoke properties.

See also
STROKE_PARAMS

Reimplemented in PCB_SHAPE.

Definition at line 172 of file board_item.h.

172{ return false; }

◆ HighLightOFF()

void BOARD::HighLightOFF ( )
inline

Disable net highlight.

Definition at line 502 of file board.h.

503 {
504 HighLightON( false );
505 }
void HighLightON(bool aValue=true)
Enable or disable net highlighting.
Definition: board.cpp:2082

References HighLightON().

◆ HighLightON()

void BOARD::HighLightON ( bool  aValue = true)

Enable or disable net highlighting.

If a netcode >= 0 has been set with SetHighLightNet and aValue is true, the net will be highlighted. If aValue is false, net highlighting will be disabled regardless of the highlight netcode being set.

Definition at line 2082 of file board.cpp.

2083{
2084 if( m_highLight.m_highLightOn != aValue )
2085 {
2086 m_highLight.m_highLightOn = aValue;
2088 }
2089}
virtual void OnBoardHighlightNetChanged(BOARD &aBoard)
Definition: board.h:247
bool m_highLightOn
Definition: board.h:212

References InvokeListeners(), m_highLight, HIGH_LIGHT_INFO::m_highLightOn, and BOARD_LISTENER::OnBoardHighlightNetChanged().

Referenced by PCB_EDIT_FRAME::ExecuteRemoteCommand(), BOARD_INSPECTION_TOOL::highlightNet(), HighLightOFF(), and APPEARANCE_CONTROLS::onNetclassContextMenu().

◆ HitTest() [1/2]

virtual bool EDA_ITEM::HitTest ( const BOX2I aRect,
bool  aContained,
int  aAccuracy = 0 
) const
inlinevirtualinherited

Test if aRect intersects this item.

Parameters
aRectA reference to a BOX2I object containing the rectangle to test.
aContainedSet to true to test for containment instead of an intersection.
aAccuracyIncrease aRect by this amount.
Returns
True if aRect contains or intersects the item bounding box.

Reimplemented in LIB_ITEM, LIB_PIN, LIB_SHAPE, LIB_TEXT, LIB_TEXTBOX, SCH_BITMAP, SCH_BUS_ENTRY_BASE, SCH_FIELD, SCH_JUNCTION, SCH_LABEL_BASE, SCH_LINE, SCH_NO_CONNECT, SCH_PIN, SCH_SHAPE, SCH_SHEET, SCH_SYMBOL, SCH_TEXT, SCH_TEXTBOX, DS_DRAW_ITEM_BASE, DS_DRAW_ITEM_POLYPOLYGONS, DS_DRAW_ITEM_RECT, DS_DRAW_ITEM_TEXT, DS_DRAW_ITEM_BITMAP, PCB_GROUP, FOOTPRINT, FP_TEXT, FP_TEXTBOX, PAD, PCB_BITMAP, PCB_DIMENSION_BASE, PCB_SHAPE, PCB_TARGET, PCB_TEXT, PCB_TEXTBOX, PCB_TRACK, PCB_VIA, PCB_ARC, ZONE, and GERBER_DRAW_ITEM.

Definition at line 235 of file eda_item.h.

236 {
237 return false; // derived classes should override this function
238 }

◆ HitTest() [2/2]

virtual bool EDA_ITEM::HitTest ( const VECTOR2I aPosition,
int  aAccuracy = 0 
) const
inlinevirtualinherited

◆ IncrementTimeStamp()

void BOARD::IncrementTimeStamp ( )

Definition at line 226 of file board.cpp.

227{
228 m_timeStamp++;
229
230 if( !m_IntersectsAreaCache.empty()
231 || !m_EnclosedByAreaCache.empty()
235 || !m_LayerExpressionCache.empty()
236 || !m_ZoneBBoxCache.empty() )
237 {
238 std::unique_lock<std::mutex> cacheLock( m_CachesMutex );
239
240 m_IntersectsAreaCache.clear();
241 m_EnclosedByAreaCache.clear();
246
247 m_ZoneBBoxCache.clear();
248
249 // These are always regenerated before use, but still probably safer to clear them
250 // while we're here.
253 m_DRCZones.clear();
254 m_DRCCopperZones.clear();
256 m_CopperItemRTreeCache = std::make_unique<DRC_RTREE>();
257 }
258 else if( !m_CopperItemRTreeCache )
259 {
260 std::unique_lock<std::mutex> cacheLock( m_CachesMutex );
261 m_CopperItemRTreeCache = std::make_unique<DRC_RTREE>();
262 }
263}
std::unordered_map< PTR_PTR_LAYER_CACHE_KEY, bool > m_EnclosedByAreaCache
Definition: board.h:1143
std::vector< ZONE * > m_DRCCopperZones
Definition: board.h:1151
std::unique_ptr< DRC_RTREE > m_CopperItemRTreeCache
Definition: board.h:1146
std::unordered_map< PTR_PTR_CACHE_KEY, bool > m_IntersectsCourtyardCache
Definition: board.h:1139
std::unordered_map< PTR_PTR_CACHE_KEY, bool > m_IntersectsFCourtyardCache
Definition: board.h:1140
int m_DRCMaxPhysicalClearance
Definition: board.h:1153
std::unordered_map< wxString, LSET > m_LayerExpressionCache
Definition: board.h:1144
std::unordered_map< const ZONE *, BOX2I > m_ZoneBBoxCache
Definition: board.h:1147
std::unordered_map< PTR_PTR_CACHE_KEY, bool > m_IntersectsBCourtyardCache
Definition: board.h:1141
int m_DRCMaxClearance
Definition: board.h:1152
std::unordered_map< ZONE *, std::unique_ptr< DRC_RTREE > > m_CopperZoneRTreeCache
Definition: board.h:1145
std::vector< ZONE * > m_DRCZones
Definition: board.h:1150
std::unordered_map< PTR_PTR_LAYER_CACHE_KEY, bool > m_IntersectsAreaCache
Definition: board.h:1142
std::mutex m_CachesMutex
Definition: board.h:1138

References m_CachesMutex, m_CopperItemRTreeCache, m_CopperZoneRTreeCache, m_DRCCopperZones, m_DRCMaxClearance, m_DRCMaxPhysicalClearance, m_DRCZones, m_EnclosedByAreaCache, m_IntersectsAreaCache, m_IntersectsBCourtyardCache, m_IntersectsCourtyardCache, m_IntersectsFCourtyardCache, m_LayerExpressionCache, m_timeStamp, and m_ZoneBBoxCache.

Referenced by ZONE_FILLER_TOOL::FillAllZones(), DRC_ENGINE::InitEngine(), PCB_BASE_FRAME::OnModify(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), BOARD_COMMIT::Revert(), DRC_ENGINE::RunTests(), and ZONE_FILLER_TOOL::ZoneFillDirty().

◆ InvokeListeners()

template<typename Func , typename... Args>
void BOARD::InvokeListeners ( Func &&  aFunc,
Args &&...  args 
)
inlineprivate

Definition at line 1164 of file board.h.

1165 {
1166 for( auto&& l : m_listeners )
1167 ( l->*aFunc )( std::forward<Args>( args )... );
1168 }

References m_listeners.

Referenced by Add(), FinalizeBulkAdd(), FinalizeBulkRemove(), HighLightON(), OnItemChanged(), OnItemsChanged(), Remove(), ResetNetHighLight(), SetHighLightNet(), and SynchronizeNetsAndNetClasses().

◆ IsBrightened()

◆ IsConnected()

◆ IsElementVisible()

bool BOARD::IsElementVisible ( GAL_LAYER_ID  aLayer) const

◆ IsEmpty()

bool BOARD::IsEmpty ( ) const
inline

◆ IsEntered()

bool EDA_ITEM::IsEntered ( ) const
inlineinherited

Definition at line 107 of file eda_item.h.

107{ return m_flags & ENTERED; }
#define ENTERED
indicates a group has been entered

References ENTERED, and EDA_ITEM::m_flags.

Referenced by KIGFX::PCB_PAINTER::draw().

◆ IsFootprintHolder()

bool BOARD::IsFootprintHolder ( ) const
inline

Find out if the board is being used to hold a single footprint for editing/viewing.

Returns
if the board is just holding a footprint

Definition at line 295 of file board.h.

296 {
298 }

References FPHOLDER, and m_boardUse.

Referenced by BOARD_ADAPTER::createBoardPolygon(), FOOTPRINT::GetBoundingBox(), FOOTPRINT::GetBoundingHull(), and BOARD_ADAPTER::InitSettings().

◆ IsFootprintLayerVisible()

bool BOARD::IsFootprintLayerVisible ( PCB_LAYER_ID  aLayer) const

Expect either of the two layers on which a footprint can reside, and returns whether that layer is visible.

Parameters
aLayeris one of the two allowed layers for footprints: F_Cu or B_Cu
Returns
true if the layer is visible, otherwise false.

Definition at line 670 of file board.cpp.

671{
672 switch( aLayer )
673 {
674 case F_Cu: return IsElementVisible( LAYER_MOD_FR );
675 case B_Cu: return IsElementVisible( LAYER_MOD_BK );
676 default: wxFAIL_MSG( wxT( "BOARD::IsModuleLayerVisible(): bad layer" ) ); return true;
677 }
678}
@ LAYER_MOD_FR
show footprints on front
Definition: layer_ids.h:208
@ LAYER_MOD_BK
show footprints on back
Definition: layer_ids.h:209
@ B_Cu
Definition: layer_ids.h:95
@ F_Cu
Definition: layer_ids.h:64

References B_Cu, F_Cu, IsElementVisible(), LAYER_MOD_BK, and LAYER_MOD_FR.

Referenced by GetFootprint().

◆ IsForceVisible()

bool EDA_ITEM::IsForceVisible ( ) const
inlineinherited

Definition at line 201 of file eda_item.h.

201{ return m_forceVisible; }
bool m_forceVisible
Definition: eda_item.h:497

References EDA_ITEM::m_forceVisible.

Referenced by KIGFX::SCH_PAINTER::draw(), and SCH_FIELD::Print().

◆ IsHighLightNetON()

bool BOARD::IsHighLightNetON ( ) const
inline
Returns
true if a net is currently highlighted

Definition at line 488 of file board.h.

488{ return m_highLight.m_highLightOn; }

References m_highLight, and HIGH_LIGHT_INFO::m_highLightOn.

Referenced by PCB_EDIT_FRAME::ExecuteRemoteCommand(), and DIALOG_NET_INSPECTOR::OnBoardHighlightNetChanged().

◆ IsKnockout()

◆ IsLayerEnabled()

bool BOARD::IsLayerEnabled ( PCB_LAYER_ID  aLayer) const

A proxy function that calls the correspondent function in m_BoardSettings tests whether a given layer is enabled.

Parameters
aLayer= The layer to be tested
Returns
true if the layer is visible.

Definition at line 591 of file board.cpp.

592{
593 return GetDesignSettings().IsLayerEnabled( aLayer );
594}
bool IsLayerEnabled(PCB_LAYER_ID aLayerId) const
Test whether a given layer aLayerId is enabled.

References GetDesignSettings(), and BOARD_DESIGN_SETTINGS::IsLayerEnabled().

Referenced by GRID_CELL_LAYER_SELECTOR::BeginEdit(), DIALOG_DIMENSION_PROPERTIES::DIALOG_DIMENSION_PROPERTIES(), DIALOG_TEXTBOX_PROPERTIES::DIALOG_TEXTBOX_PROPERTIES(), GetLayerName(), GetLayerType(), BOARD_ADAPTER::Is3dLayerEnabled(), PCB_LAYER_SELECTOR::isLayerEnabled(), SetLayerName(), SetLayerType(), PANEL_SETUP_LAYERS::setUserDefinedLayerCheckBoxes(), and DRC_TEST_PROVIDER_COPPER_CLEARANCE::testZonesToZones().

◆ IsLayerVisible()

bool BOARD::IsLayerVisible ( PCB_LAYER_ID  aLayer) const

A proxy function that calls the correspondent function in m_BoardSettings tests whether a given layer is visible.

Parameters
aLayeris the layer to be tested.
Returns
true if the layer is visible otherwise false.

Definition at line 571 of file board.cpp.

572{
573 // If there is no project, assume layer is visible always
574 return GetDesignSettings().IsLayerEnabled( aLayer )
576}

References GetDesignSettings(), PROJECT::GetLocalSettings(), BOARD_DESIGN_SETTINGS::IsLayerEnabled(), m_project, and PROJECT_LOCAL_SETTINGS::m_VisibleLayers.

Referenced by FOOTPRINT::GetBoundingBox(), PCB_BASE_FRAME::GetDocumentExtents(), BOARD_ADAPTER::Is3dLayerEnabled(), PCB_CONTROL::LayerNext(), PCB_CONTROL::LayerPrev(), PCB_SELECTION_TOOL::Selectable(), and PCB_DRAW_PANEL_GAL::SyncLayersVisibility().

◆ IsLocked()

bool BOARD_ITEM::IsLocked ( ) const
virtualinherited

Reimplemented in FOOTPRINT, and PAD.

Definition at line 71 of file board_item.cpp.

72{
73 if( GetParentGroup() )
74 return GetParentGroup()->IsLocked();
75
76 const BOARD* board = GetBoard();
77
78 return board && board->GetBoardUse() != BOARD_USE::FPHOLDER && m_isLocked;
79}
bool m_isLocked
Definition: board_item.h:332
virtual bool IsLocked() const
Definition: board_item.cpp:71
BOARD_USE GetBoardUse() const
Get what the board use is.
Definition: board.h:284

References FPHOLDER, BOARD_ITEM::GetBoard(), GetBoardUse(), BOARD_ITEM::GetParentGroup(), BOARD_ITEM::IsLocked(), and BOARD_ITEM::m_isLocked.

Referenced by BOARD_ITEM_DESC::BOARD_ITEM_DESC(), KI_TEST::CheckFpShape(), KI_TEST::CheckFpZone(), PCB_CONTROL::DeleteItemCursor(), DIALOG_GROUP_PROPERTIES::DIALOG_GROUP_PROPERTIES(), DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES(), DIALOG_GLOBAL_DELETION::DoGlobalDeletions(), EDIT_TOOL::DragArcTrack(), EDIT_TOOL::FilletTracks(), PCB_PLUGIN::format(), DSN::SPECCTRA_DB::FromSESSION(), PCB_GROUP::GetMsgPanelInfo(), FP_TEXT::GetMsgPanelInfo(), FP_TEXTBOX::GetMsgPanelInfo(), PCB_DIMENSION_BASE::GetMsgPanelInfo(), PCB_SHAPE::GetMsgPanelInfo(), PCB_TEXT::GetMsgPanelInfo(), PCB_TEXTBOX::GetMsgPanelInfo(), ZONE::GetMsgPanelInfo(), PCB_TRACK::GetMsgPanelInfoBase_Common(), ALIGN_DISTRIBUTE_TOOL::GetSelections(), GROUP_TOOL::Group(), PCB_SELECTION_CONDITIONS::HasLockedItems(), PCB_SELECTION_CONDITIONS::HasUnlockedItems(), ROUTER_TOOL::InlineDrag(), GENERAL_COLLECTOR::Inspect(), BOARD_ITEM::IsLocked(), PAD::IsLocked(), PCB_SELECTION_TOOL::itemPassesFilter(), CADSTAR_PCB_ARCHIVE_LOADER::makeTracksFromShapes(), TRACKS_CLEANER::mergeCollinearSegments(), BOARD_EDITOR_CONTROL::modifyLockSelected(), PCB_POINT_EDITOR::OnSelectionChange(), ZONE_SETTINGS::operator<<(), PCB_SELECTION_TOOL::RequestSelection(), PNS_KICAD_IFACE_BASE::syncArc(), PNS_KICAD_IFACE_BASE::syncTrack(), PNS_KICAD_IFACE_BASE::syncVia(), DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataFromWindow(), DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataToWindow(), DIALOG_TEXTBOX_PROPERTIES::TransferDataToWindow(), BOARD_ITEM::ViewGetLayers(), PCB_TRACK::ViewGetLayers(), and PCB_VIA::ViewGetLayers().

◆ IsModified()

bool EDA_ITEM::IsModified ( ) const
inlineinherited

Definition at line 102 of file eda_item.h.

102{ return m_flags & IS_CHANGED; }

References IS_CHANGED, and EDA_ITEM::m_flags.

Referenced by PCB_EDIT_FRAME::OpenProjectFiles().

◆ IsMoving()

◆ IsNew()

◆ IsOnCopperLayer()

virtual bool BOARD_ITEM::IsOnCopperLayer ( ) const
inlinevirtualinherited
Returns
true if the object is on any copper layer, false otherwise.

Reimplemented in PAD, PCB_TRACK, and ZONE.

Definition at line 123 of file board_item.h.

124 {
125 return IsCopperLayer( GetLayer() );
126 }

References BOARD_ITEM::GetLayer(), and IsCopperLayer().

Referenced by CN_CONNECTIVITY_ALGO::Add(), FOOTPRINT::CheckNetTies(), DRC_ENGINE::EvalRules(), BOARD_INSPECTION_TOOL::InspectClearance(), BOARD_CONNECTED_ITEM::SetNetCode(), and PCB_CONTROL::UpdateMessagePanel().

◆ IsOnLayer()

virtual bool BOARD_ITEM::IsOnLayer ( PCB_LAYER_ID  aLayer) const
inlinevirtualinherited

◆ IsReplaceable()

virtual bool EDA_ITEM::IsReplaceable ( ) const
inlinevirtualinherited

Override this method in any derived object that supports test find and replace.

Returns
True if the item has replaceable text that can be modified using the find and replace dialog.

Reimplemented in LIB_TEXTBOX, SCH_FIELD, SCH_LABEL, SCH_SHEET, SCH_SHEET_PIN, SCH_SYMBOL, SCH_TEXT, and SCH_TEXTBOX.

Definition at line 420 of file eda_item.h.

420{ return false; }

Referenced by EDA_ITEM::Matches().

◆ IsRollover()

bool EDA_ITEM::IsRollover ( ) const
inlineinherited

Definition at line 110 of file eda_item.h.

111 {
112 return ( m_flags & ( IS_ROLLOVER | IS_MOVING ) ) == IS_ROLLOVER;
113 }
#define IS_ROLLOVER
Rollover active. Used for hyperlink highlighting.

References IS_MOVING, IS_ROLLOVER, and EDA_ITEM::m_flags.

Referenced by KIGFX::SCH_PAINTER::draw().

◆ IsSelected()

bool EDA_ITEM::IsSelected ( ) const
inlineinherited

Definition at line 106 of file eda_item.h.

106{ return m_flags & SELECTED; }

References EDA_ITEM::m_flags, and SELECTED.

Referenced by ALIGN_DISTRIBUTE_TOOL::AlignBottom(), ALIGN_DISTRIBUTE_TOOL::AlignCenterX(), ALIGN_DISTRIBUTE_TOOL::AlignCenterY(), ALIGN_DISTRIBUTE_TOOL::AlignTop(), SCH_EDIT_TOOL::ChangeTextType(), SCH_EDIT_FRAME::ConvertPart(), DIALOG_CHANGE_SYMBOLS::DIALOG_CHANGE_SYMBOLS(), ALIGN_DISTRIBUTE_TOOL::doAlignLeft(), ALIGN_DISTRIBUTE_TOOL::doAlignRight(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersVertically(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsVertically(), EDIT_TOOL::doMoveSelection(), KIGFX::SCH_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), KIGFX::PCB_PAINTER::Draw(), DS_PROXY_UNDO_ITEM::DS_PROXY_UNDO_ITEM(), KIGFX::GERBVIEW_RENDER_SETTINGS::GetColor(), KIGFX::DS_RENDER_SETTINGS::GetColor(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), SCH_MOVE_TOOL::getConnectedDragItems(), KIGFX::SCH_PAINTER::getLineWidth(), DIALOG_EXCHANGE_FOOTPRINTS::isMatch(), DIALOG_CHANGE_SYMBOLS::isMatch(), SCH_SCREEN::MarkConnections(), SCH_LINE::MergeOverlap(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::MoveExact(), SCH_MOVE_TOOL::moveItem(), KIGFX::SCH_PAINTER::nonCached(), SCH_MOVE_TOOL::orthoLineDrag(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::processItem(), BOARD_COMMIT::Push(), EE_SELECTION_TOOL::RebuildSelection(), PCB_SELECTION_TOOL::RebuildSelection(), RENDER_3D_OPENGL::renderFootprint(), SCH_EDIT_TOOL::Rotate(), EE_TOOL_BASE< T >::saveCopyInUndoList(), GERBVIEW_SELECTION_TOOL::select(), PCB_SELECTION_TOOL::select(), EE_SELECTION_TOOL::selectMultiple(), PCB_SELECTION_TOOL::selectMultiple(), GERBVIEW_SELECTION_TOOL::selectPoint(), KIGFX::SCH_PAINTER::setDeviceColors(), GERBVIEW_SELECTION_TOOL::unselect(), HIERARCHY_PANE::UpdateHierarchySelection(), PCB_BASE_FRAME::UpdateUserUnits(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem(), and DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::visitItem().

◆ IsShownAsBitmap()

bool EDA_ITEM::IsShownAsBitmap ( ) const
inlineinherited

Definition at line 173 of file eda_item.h.

173{ return m_flags & IS_SHOWN_AS_BITMAP; }
#define IS_SHOWN_AS_BITMAP

References IS_SHOWN_AS_BITMAP, and EDA_ITEM::m_flags.

◆ IsTented()

virtual bool BOARD_ITEM::IsTented ( ) const
inlinevirtualinherited

Reimplemented in PCB_VIA.

Definition at line 133 of file board_item.h.

134 {
135 return false;
136 }

Referenced by BOARD_INSPECTION_TOOL::InspectClearance(), and DRC_TEST_PROVIDER_SILK_CLEARANCE::Run().

◆ IsType()

virtual bool EDA_ITEM::IsType ( const std::vector< KICAD_T > &  aScanTypes) const
inlinevirtualinherited

Check whether the item is one of the listed types.

Parameters
aScanTypesList of item types
Returns
true if the item type is contained in the list aScanTypes

Reimplemented in SCH_FIELD, SCH_ITEM, SCH_LABEL_BASE, SCH_LINE, FP_SHAPE, FP_TEXT, FP_TEXTBOX, PAD, PCB_DIMENSION_BASE, PCB_SHAPE, PCB_TEXT, PCB_TEXTBOX, and PCB_VIA.

Definition at line 181 of file eda_item.h.

182 {
183 for( KICAD_T scanType : aScanTypes )
184 {
185 if( scanType == SCH_LOCATE_ANY_T || scanType == m_structType )
186 return true;
187 }
188
189 return false;
190 }
KICAD_T m_structType
Run time identification, keep private so it can never be changed after a ctor sets it.
Definition: eda_item.h:505
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:78
@ SCH_LOCATE_ANY_T
Definition: typeinfo.h:183

References EDA_ITEM::m_structType, and SCH_LOCATE_ANY_T.

Referenced by SCH_EDIT_TOOL::AutoplaceFields(), ROUTER_TOOL::CanInlineDrag(), DIALOG_SCH_FIELD_PROPERTIES::DIALOG_SCH_FIELD_PROPERTIES(), SCH_FIELD::GetCanonicalName(), KIGFX::SCH_PAINTER::getLineWidth(), SCH_FIELD::GetName(), KIGFX::SCH_PAINTER::getRenderColor(), SCH_FIELD::GetShownText(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingBus(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingLine(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingWire(), SCH_ITEM::IsType(), FP_TEXT::IsType(), FP_TEXTBOX::IsType(), PAD::IsType(), PCB_DIMENSION_BASE::IsType(), PCB_SHAPE::IsType(), PCB_TEXT::IsType(), PCB_TEXTBOX::IsType(), PCB_VIA::IsType(), EE_POINT_EDITOR::Main(), PL_POINT_EDITOR::Main(), CONVERT_TOOL::makePolysFromChainedSegs(), EE_SELECTION_TOOL::RequestSelection(), SCH_FIELD::SetId(), SCH_BASE_FRAME::UpdateItem(), and EDA_ITEM::Visit().

◆ IterateForward() [1/2]

template<class T >
static INSPECT_RESULT EDA_ITEM::IterateForward ( std::deque< T > &  aList,
INSPECTOR  inspector,
void *  testData,
const std::vector< KICAD_T > &  scanTypes 
)
inlinestaticinherited

This changes first parameter to avoid the DList and use the main queue instead.

Definition at line 302 of file eda_item.h.

304 {
305 for( const auto& it : aList )
306 {
307 if( static_cast<EDA_ITEM*>( it )->Visit( inspector,
308 testData,
309 scanTypes ) == INSPECT_RESULT::QUIT )
310 {
312 }
313 }
314
316 }
virtual INSPECT_RESULT Visit(INSPECTOR inspector, void *testData, const std::vector< KICAD_T > &aScanTypes)
May be re-implemented for each derived class in order to handle all the types given by its member dat...
Definition: eda_item.cpp:91

References CONTINUE, QUIT, and EDA_ITEM::Visit().

Referenced by GERBER_FILE_IMAGE::Visit().

◆ IterateForward() [2/2]

template<class T >
static INSPECT_RESULT EDA_ITEM::IterateForward ( std::vector< T > &  aList,
INSPECTOR  inspector,
void *  testData,
const std::vector< KICAD_T > &  scanTypes 
)
inlinestaticinherited

Change first parameter to avoid the DList and use std::vector instead.

Definition at line 322 of file eda_item.h.

324 {
325 for( const auto& it : aList )
326 {
327 if( static_cast<EDA_ITEM*>( it )->Visit( inspector,
328 testData,
329 scanTypes ) == INSPECT_RESULT::QUIT )
330 {
332 }
333 }
334
336 }

References CONTINUE, QUIT, and EDA_ITEM::Visit().

◆ LayerDepth()

int BOARD::LayerDepth ( PCB_LAYER_ID  aStartLayer,
PCB_LAYER_ID  aEndLayer 
) const

Definition at line 553 of file board.cpp.

554{
555 if( aStartLayer > aEndLayer )
556 std::swap( aStartLayer, aEndLayer );
557
558 if( aEndLayer == B_Cu )
559 aEndLayer = ToLAYER_ID( F_Cu + GetCopperLayerCount() - 1 );
560
561 return aEndLayer - aStartLayer;
562}
int GetCopperLayerCount() const
Definition: board.cpp:541

References B_Cu, F_Cu, GetCopperLayerCount(), and ToLAYER_ID().

Referenced by DIALOG_TRACK_VIA_PROPERTIES::getLayerDepth().

◆ layerMaskDescribe()

wxString BOARD_ITEM::layerMaskDescribe ( ) const
protectedvirtualinherited

Return a string (to be shown to the user) describing a layer mask.

Reimplemented in PCB_VIA.

Definition at line 106 of file board_item.cpp.

107{
108 const BOARD* board = GetBoard();
109 LSET layers = GetLayerSet();
110
111 // Try to be smart and useful. Check all copper first.
112 if( layers[F_Cu] && layers[B_Cu] )
113 return _( "all copper layers" );
114
115 LSET copperLayers = layers & board->GetEnabledLayers().AllCuMask();
116 LSET techLayers = layers & board->GetEnabledLayers().AllTechMask();
117
118 for( LSET testLayers : { copperLayers, techLayers, layers } )
119 {
120 for( int bit = PCBNEW_LAYER_ID_START; bit < PCB_LAYER_ID_COUNT; ++bit )
121 {
122 if( testLayers[ bit ] )
123 {
124 wxString layerInfo = board->GetLayerName( static_cast<PCB_LAYER_ID>( bit ) );
125
126 if( testLayers.count() > 1 )
127 layerInfo << wxS( " " ) + _( "and others" );
128
129 return layerInfo;
130 }
131 }
132 }
133
134 // No copper, no technicals: no layer
135 return _( "no layers" );
136}
virtual LSET GetLayerSet() const
Return a std::bitset of all layers on which the item physically resides.
Definition: board_item.h:185
LSET GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
Definition: board.cpp:565
static LSET AllTechMask()
Return a mask holding all technical layers (no CU layer) on both side.
Definition: lset.cpp:841
@ PCBNEW_LAYER_ID_START
Definition: layer_ids.h:63

References _, LSET::AllCuMask(), LSET::AllTechMask(), B_Cu, F_Cu, BOARD_ITEM::GetBoard(), GetEnabledLayers(), GetLayerName(), BOARD_ITEM::GetLayerSet(), PCB_LAYER_ID_COUNT, and PCBNEW_LAYER_ID_START.

Referenced by PAD::GetItemDescription(), PAD::GetMsgPanelInfo(), and PCB_TRACK::GetMsgPanelInfo().

◆ MapNets()

void BOARD::MapNets ( const BOARD aDestBoard)

Map all nets in the given board to nets with the same name (if any) in the destination board.

This allows us to share layouts which came from the same hierarchical sheet in the schematic.

Definition at line 1999 of file board.cpp.

2000{
2002 {
2003 NETINFO_ITEM* netInfo = aDestBoard->FindNet( item->GetNetname() );
2004
2005 if( netInfo )
2006 item->SetNet( netInfo );
2007 else
2008 item->SetNetCode( 0 );
2009 }
2010}
const std::vector< BOARD_CONNECTED_ITEM * > AllConnectedItems()
Definition: board.cpp:1979
NETINFO_ITEM * FindNet(int aNetcode) const
Search for a net with the given netcode.
Definition: board.cpp:1456
void SetNetCode(int aNetCode)
Definition: netinfo.h:115

References AllConnectedItems(), FindNet(), and NETINFO_ITEM::SetNetCode().

◆ Markers() [1/2]

◆ Markers() [2/2]

const MARKERS & BOARD::Markers ( ) const
inline

Definition at line 317 of file board.h.

317{ return m_markers; }

References m_markers.

◆ Matches() [1/2]

virtual bool EDA_ITEM::Matches ( const EDA_SEARCH_DATA aSearchData,
void *  aAuxData 
) const
inlinevirtualinherited

Compare the item against the search criteria in aSearchData.

The base class returns false since many of the objects derived from EDA_ITEM do not have any text to search.

Parameters
aSearchDataA reference to a wxFindReplaceData object containing the search criteria.
aAuxDataA pointer to optional data required for the search or NULL if not used.
Returns
True if the item's text matches the search criteria in aSearchData.

Reimplemented in SCH_MARKER, LIB_TEXTBOX, SCH_FIELD, SCH_LABEL_BASE, SCH_PIN, SCH_SHEET, SCH_SHEET_PIN, SCH_SYMBOL, SCH_TEXT, SCH_TEXTBOX, FP_TEXT, FP_TEXTBOX, NETINFO_ITEM, PCB_MARKER, PCB_TEXT, PCB_TEXTBOX, and ZONE.

Definition at line 382 of file eda_item.h.

383 {
384 return false;
385 }

Referenced by SCH_DRAWING_TOOLS::DrawShape(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), SCH_FIND_REPLACE_TOOL::HasMatch(), SCH_MARKER::Matches(), LIB_TEXTBOX::Matches(), SCH_FIELD::Matches(), SCH_LABEL_BASE::Matches(), SCH_PIN::Matches(), SCH_SHEET_PIN::Matches(), SCH_TEXT::Matches(), SCH_TEXTBOX::Matches(), FP_TEXT::Matches(), FP_TEXTBOX::Matches(), NETINFO_ITEM::Matches(), PCB_MARKER::Matches(), PCB_TEXT::Matches(), PCB_TEXTBOX::Matches(), ZONE::Matches(), SCH_FIND_REPLACE_TOOL::ReplaceAndFindNext(), SCH_DRAWING_TOOLS::TwoClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), and SCH_FIND_REPLACE_TOOL::UpdateFind().

◆ Matches() [2/2]

bool EDA_ITEM::Matches ( const wxString &  aText,
const EDA_SEARCH_DATA aSearchData 
) const
protectedinherited

Compare aText against search criteria in aSearchData.

This is a helper function for simplify derived class logic.

Parameters
aTextA reference to a wxString object containing the string to test.
aSearchDataThe criteria to search against.
Returns
True if aText matches the search criteria in aSearchData.

Definition at line 117 of file eda_item.cpp.

118{
119 wxString text = aText;
120 wxString searchText = aSearchData.findString;
121
122 // Don't match if searching for replaceable item and the item doesn't support text replace.
123 if( aSearchData.searchAndReplace && !IsReplaceable() )
124 return false;
125
126 if( !aSearchData.matchCase )
127 {
128 text.MakeUpper();
129 searchText.MakeUpper();
130 }
131
133 {
134 int ii = 0;
135
136 while( ii < (int) text.length() )
137 {
138 int next = text.find( searchText, ii );
139
140 if( next == wxNOT_FOUND )
141 return false;
142
143 ii = next;
144 next += searchText.length();
145
146 bool startOK = ( ii == 0 || !wxIsalnum( text.GetChar( ii - 1 ) ) );
147 bool endOK = ( next == (int) text.length() || !wxIsalnum( text.GetChar( next ) ) );
148
149 if( startOK && endOK )
150 return true;
151 else
152 ii++;
153 }
154
155 return false;
156 }
157 else if( aSearchData.matchMode == EDA_SEARCH_MATCH_MODE::WILDCARD )
158 {
159 return text.Matches( searchText );
160 }
161 else
162 {
163 return text.Find( searchText ) != wxNOT_FOUND;
164 }
165}
virtual bool IsReplaceable() const
Override this method in any derived object that supports test find and replace.
Definition: eda_item.h:420
CITER next(CITER it)
Definition: ptree.cpp:126
EDA_SEARCH_MATCH_MODE matchMode

References EDA_SEARCH_DATA::findString, EDA_ITEM::IsReplaceable(), EDA_SEARCH_DATA::matchCase, EDA_SEARCH_DATA::matchMode, next(), EDA_SEARCH_DATA::searchAndReplace, text, WHOLEWORD, and WILDCARD.

◆ Move()

void BOARD::Move ( const VECTOR2I aMoveVector)
overridevirtual

Move this object.

Parameters
aMoveVectorthe move vector for this object.

Reimplemented from BOARD_ITEM.

Definition at line 379 of file board.cpp.

380{
381 INSPECTOR_FUNC inspector =
382 [&] ( EDA_ITEM* item, void* testData )
383 {
384 BOARD_ITEM* brdItem = static_cast<BOARD_ITEM*>( item );
385
386 // aMoveVector was snapshotted, don't need "data".
387 // Only move the top level group
388 if( brdItem->GetParentGroup() == nullptr )
389 brdItem->Move( aMoveVector );
390
392 };
393
394 Visit( inspector, nullptr, GENERAL_COLLECTOR::BoardLevelItems );
395}
virtual void Move(const VECTOR2I &aMoveVector)
Move this object.
Definition: board_item.h:266
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:1330
static const std::vector< KICAD_T > BoardLevelItems
A scan list for all primary board items, omitting items which are subordinate to a FOOTPRINT,...
Definition: collectors.h:235
std::function< INSPECT_RESULT(EDA_ITEM *aItem, void *aTestData) > INSPECTOR_FUNC
Used to inspect and possibly collect the (search) results of iterating over a list or tree of KICAD_T...
Definition: eda_item.h:75

References GENERAL_COLLECTOR::BoardLevelItems, CONTINUE, BOARD_ITEM::GetParentGroup(), BOARD_ITEM::Move(), and Visit().

Referenced by EAGLE_PLUGIN::centerBoard(), CADSTAR_PCB_ARCHIVE_PLUGIN::Load(), and ALTIUM_PCB::Parse().

◆ OnItemChanged()

void BOARD::OnItemChanged ( BOARD_ITEM aItem)

Notify the board and its listeners that an item on the board has been modified in some way.

Definition at line 2048 of file board.cpp.

2049{
2051}
virtual void OnBoardItemChanged(BOARD &aBoard, BOARD_ITEM *aBoardItem)
Definition: board.h:245

References InvokeListeners(), and BOARD_LISTENER::OnBoardItemChanged().

Referenced by PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), and BOARD_COMMIT::Revert().

◆ OnItemsChanged()

void BOARD::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 at line 2054 of file board.cpp.

2055{
2057}
virtual void OnBoardItemsChanged(BOARD &aBoard, std::vector< BOARD_ITEM * > &aBoardItem)
Definition: board.h:246

References InvokeListeners(), and BOARD_LISTENER::OnBoardItemsChanged().

Referenced by BOARD_COMMIT::Push(), BOARD_COMMIT::Revert(), and DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::TransferDataFromWindow().

◆ operator<()

bool EDA_ITEM::operator< ( const EDA_ITEM aItem) const
inherited

Test if another item is less than this object.

Parameters
aItem- Item to compare against.
Returns
- True if aItem is less than the item.

Definition at line 231 of file eda_item.cpp.

232{
233 wxFAIL_MSG( wxString::Format( wxT( "Less than operator not defined for item type %s." ),
234 GetClass() ) );
235
236 return false;
237}

References Format(), and EDA_ITEM::GetClass().

◆ operator=()

BOARD & BOARD::operator= ( const BOARD aOther)
privatedelete

◆ Remove()

void BOARD::Remove ( BOARD_ITEM aItem,
REMOVE_MODE  aMode = REMOVE_MODE::NORMAL 
)
overridevirtual

Removes an item from the container.

Implements BOARD_ITEM_CONTAINER.

Definition at line 859 of file board.cpp.

860{
861 // find these calls and fix them! Don't send me no stinking' nullptr.
862 wxASSERT( aBoardItem );
863
864 switch( aBoardItem->Type() )
865 {
866 case PCB_NETINFO_T:
867 {
868 NETINFO_ITEM* item = static_cast<NETINFO_ITEM*>( aBoardItem );
870
871 for( FOOTPRINT* fp : m_footprints )
872 {
873 for( PAD* pad : fp->Pads() )
874 {
875 if( pad->GetNet() == item )
876 pad->SetNet( unconnected );
877 }
878 }
879
880 for( ZONE* zone : m_zones )
881 {
882 if( zone->GetNet() == item )
883 zone->SetNet( unconnected );
884 }
885
886 for( PCB_TRACK* track : m_tracks )
887 {
888 if( track->GetNet() == item )
889 track->SetNet( unconnected );
890 }
891
892 m_NetInfo.RemoveNet( item );
893 break;
894 }
895
896 case PCB_MARKER_T:
897 alg::delete_matching( m_markers, aBoardItem );
898 break;
899
900 case PCB_GROUP_T:
901 alg::delete_matching( m_groups, aBoardItem );
902 break;
903
904 case PCB_ZONE_T:
905 alg::delete_matching( m_zones, aBoardItem );
906 break;
907
908 case PCB_FOOTPRINT_T:
909 alg::delete_matching( m_footprints, aBoardItem );
910 break;
911
912 case PCB_TRACE_T:
913 case PCB_ARC_T:
914 case PCB_VIA_T:
915 alg::delete_matching( m_tracks, aBoardItem );
916 break;
917
919 case PCB_DIM_CENTER_T:
920 case PCB_DIM_RADIAL_T:
922 case PCB_DIM_LEADER_T:
923 case PCB_SHAPE_T:
924 case PCB_BITMAP_T:
925 case PCB_TEXT_T:
926 case PCB_TEXTBOX_T:
927 case PCB_TARGET_T:
928 alg::delete_matching( m_drawings, aBoardItem );
929 break;
930
931 // other types may use linked list
932 default:
933 wxFAIL_MSG( wxT( "BOARD::Remove() needs more ::Type() support" ) );
934 }
935
936 aBoardItem->SetFlags( STRUCT_DELETED );
937
938 PCB_GROUP* parentGroup = aBoardItem->GetParentGroup();
939
940 if( parentGroup && !( parentGroup->GetFlags() & STRUCT_DELETED ) )
941 parentGroup->RemoveItem( aBoardItem );
942
943 m_connectivity->Remove( aBoardItem );
944
945 if( aRemoveMode != REMOVE_MODE::BULK )
947}
virtual void OnBoardItemRemoved(BOARD &aBoard, BOARD_ITEM *aBoardItem)
Definition: board.h:242
EDA_ITEM_FLAGS GetFlags() const
Definition: eda_item.h:142
void RemoveNet(NETINFO_ITEM *aNet)
Remove a net from the net list.