26#include <pybind11/pybind11.h>
48 return static_cast<const BOARD*
>( this );
62 return static_cast<BOARD*
>( this );
124 return _(
"all copper layers" );
126 for(
LSET testLayers : { copperLayers, techLayers, layers } )
130 if( testLayers[ bit ] )
134 if( testLayers.count() > 1 )
135 layerInfo << wxS(
" " ) +
_(
"and others" );
143 return _(
"no layers" );
176 if( aImage ==
nullptr )
205 int aClearance,
int aError,
ERROR_LOC aErrorLoc,
206 bool ignoreLineWidth )
const
208 wxASSERT_MSG(
false, wxT(
"Called TransformShapeToPolygon() on unsupported BOARD_ITEM." ) );
229 static std::shared_ptr<SHAPE> shape;
239 static std::shared_ptr<SHAPE_SEGMENT> slot;
255 return static_cast<FOOTPRINT*
>( ancestor );
267 pos -= parentFP->GetPosition();
282 pos += parentFP->GetPosition();
291 wxMessageBox( wxT(
"virtual BOARD_ITEM::Rotate used, should not occur" ),
GetClass() );
297 wxMessageBox( wxT(
"virtual BOARD_ITEM::Flip used, should not occur" ),
GetClass() );
304 return fp->GetReference();
316 if( layerEnum.
Choices().GetCount() == 0 )
constexpr EDA_IU_SCALE pcbIUScale
#define DEFAULT_LINE_WIDTH
static struct BOARD_ITEM_DESC _BOARD_ITEM_DESC
Abstract interface for BOARD_ITEMs capable of storing other items inside.
virtual void Remove(BOARD_ITEM *aItem, REMOVE_MODE aMode=REMOVE_MODE::NORMAL)=0
Removes an item from the container.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
void SetParentGroup(PCB_GROUP *aGroup)
void DeleteStructure()
Delete this object after removing from its parent if it has one.
void SwapItemData(BOARD_ITEM *aImage)
Swap data between aItem and aImage.
virtual void Flip(const VECTOR2I &aCentre, bool aFlipLeftRight)
Flip this object, i.e.
virtual STROKE_PARAMS GetStroke() const
virtual void SetLocked(bool aLocked)
PCB_GROUP * GetParentGroup() const
virtual void SetStroke(const STROKE_PARAMS &aStroke)
wxString GetParentAsString() const
For "parent" property.
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.
virtual void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle)
Rotate this object.
virtual BOARD_ITEM * Duplicate() const
Create a copy of this BOARD_ITEM.
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
virtual std::shared_ptr< SHAPE > GetEffectiveShape(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.
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
FOOTPRINT * GetParentFootprint() const
VECTOR2I GetFPRelativePosition() const
virtual LSET GetLayerSet() const
Return a std::bitset of all layers on which the item physically resides.
virtual void swapData(BOARD_ITEM *aImage)
const KIFONT::METRICS & GetFontMetrics() const
void SetFPRelativePosition(const VECTOR2I &aPos)
virtual bool IsLocked() const
BOARD_ITEM_CONTAINER * GetParent() const
virtual void ViewGetLayers(int aLayers[], int &aCount) const override
Return the all the layers within the VIEW the object is painted on.
virtual wxString layerMaskDescribe() const
Return a string (to be shown to the user) describing a layer mask.
wxString GetLayerName() const
Return the name of the PCB layer on which the item resides.
virtual std::shared_ptr< SHAPE_SEGMENT > GetEffectiveHoleShape() const
Information pertinent to a Pcbnew printed circuit board.
bool IsFootprintHolder() const
Find out if the board is being used to hold a single footprint for editing/viewing.
LSET GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
BOARD_USE GetBoardUse() const
Get what the board use is.
static wxString GetStandardLayerName(PCB_LAYER_ID aLayerId)
Return an "English Standard" name of a PCB layer when given aLayerNumber.
int GetCopperLayerCount() const
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
A base class for most all the KiCad significant classes used in schematics and boards.
virtual VECTOR2I GetPosition() const
virtual void SetPosition(const VECTOR2I &aPos)
KICAD_T Type() const
Returns the type of object.
virtual void SetParent(EDA_ITEM *aParent)
virtual EDA_ITEM * Clone() const
Create a duplicate of this item with linked list members set to NULL.
virtual wxString GetClass() const =0
Return the class name.
EDA_ITEM * m_parent
Linked list: Link (parent struct)
ENUM_MAP & Map(T aValue, const wxString &aName)
static ENUM_MAP< T > & Instance()
ENUM_MAP & Undefined(T aValue)
Class that other classes need to inherit from, in order to be inspectable.
static const METRICS & Default()
wxString AsString() const
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
LSET is a set of PCB_LAYER_IDs.
static LSET AllLayersMask()
LSEQ Seq(const PCB_LAYER_ID *aWishListSequence, unsigned aCount) const
Return an LSEQ from the union of this LSET and a desired sequence.
static LSET AllTechMask()
Return a mask holding all technical layers (no CU layer) on both side.
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
static const wxChar * Name(PCB_LAYER_ID aLayerId)
Return the fixed name association with aLayerId.
A set of BOARD_ITEMs (i.e., without duplicates).
virtual bool AddItem(BOARD_ITEM *aItem)
Add item to group.
PROPERTY_BASE & SetAvailableFunc(std::function< bool(INSPECTABLE *)> aFunc)
Set a callback function to determine whether an object provides this property.
PROPERTY_BASE & SetIsHiddenFromLibraryEditors(bool aIsHidden=true)
Provide class metadata.Helper macro to map type hashes to names.
void InheritsAfter(TYPE_ID aDerived, TYPE_ID aBase)
Declare an inheritance relationship between types.
static PROPERTY_MANAGER & Instance()
PROPERTY_BASE & AddProperty(PROPERTY_BASE *aProperty, const wxString &aGroup=wxEmptyString)
Register a property.
Represent a set of closed polygons.
Simple container to manage line stroke parameters.
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
Some functions to handle hotkeys in KiCad.
FLASHING
Enum used during connectivity building to ensure we do not query connectivity while building the data...
@ LAYER_LOCKED_ITEM_SHADOW
shadow layer for locked items
PCB_LAYER_ID
A quick note on layer IDs:
This file contains miscellaneous commonly used macros and functions.
#define UNIMPLEMENTED_FOR(type)
Class to handle a set of BOARD_ITEMs.
#define IMPLEMENT_ENUM_TO_WXANY(type)
#define NO_SETTER(owner, type)
bool operator()(const BOARD_ITEM *a, const BOARD_ITEM *b) const
constexpr int mmToIU(double mm) const
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
Calculate the new point of coord coord pX, pY, for a rotation center 0, 0.
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint