26#include <pybind11/pybind11.h>
50 return static_cast<const BOARD*
>( this );
64 return static_cast<BOARD*
>( this );
88 wxFAIL_MSG( wxString(
"GetStroke() not defined by " ) +
GetClass() );
96 wxFAIL_MSG( wxString(
"SetStroke() not defined by " ) +
GetClass() );
142 return board->GetLayerName(
m_layer );
176 return _(
"all copper layers" );
178 for(
LSET testLayers : { copperLayers, techLayers, layers } )
182 if( testLayers[ bit ] )
186 if( testLayers.count() > 1 )
187 layerInfo << wxS(
" " ) +
_(
"and others" );
195 return _(
"no layers" );
228 if( aImage ==
nullptr )
257 int aClearance,
int aError,
ERROR_LOC aErrorLoc,
258 bool ignoreLineWidth )
const
260 wxASSERT_MSG(
false, wxT(
"Called TransformShapeToPolygon() on unsupported BOARD_ITEM." ) );
281 static std::shared_ptr<SHAPE> shape;
291 static std::shared_ptr<SHAPE_SEGMENT> slot;
304 switch( aTest->Type() )
318 while( ancestor && isContainer( ancestor ) )
322 return static_cast<FOOTPRINT*
>( ancestor );
334 pos -= parentFP->GetPosition();
349 pos += parentFP->GetPosition();
358 wxMessageBox( wxT(
"virtual BOARD_ITEM::Rotate used, should not occur" ),
GetClass() );
364 wxMessageBox( wxT(
"virtual BOARD_ITEM::Flip used, should not occur" ),
GetClass() );
370 wxMessageBox( wxT(
"virtual BOARD_ITEM::Mirror used, should not occur" ),
GetClass() );
377 return fp->GetReference();
389 if( layerEnum.
Choices().GetCount() == 0 )
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
constexpr EDA_IU_SCALE pcbIUScale
LAYER_T
The allowed types of layers, same as Specctra DSN spec.
#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 void Mirror(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection)
Mirror this object relative to a given horizontal axis the layer is not changed.
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 STROKE_PARAMS GetStroke() const
virtual void SetLocked(bool aLocked)
virtual int BoardLayerCount() const
Return the total number of layers for the board that this item resides on.
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 BoardLayerSet() const
Return the LSET for the board that this item resides on.
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.
bool IsSideSpecific() const
virtual int BoardCopperLayerCount() const
Return the total number of copper layers for the board that this item resides 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
virtual void Flip(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection)
Flip this object, i.e.
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
LSET is a set of PCB_LAYER_IDs.
static LSET AllLayersMask()
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 LSET SideSpecificMask()
LSEQ Seq(const LSEQ &aSequence) const
Return an LSEQ from the union of this LSET and a desired sequence.
static wxString 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 & SetIsHiddenFromPropertiesManager(bool aHide=true)
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.
Some functions to handle hotkeys in KiCad.
constexpr PCB_LAYER_ID PCBNEW_LAYER_ID_START
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_GENERATOR_T
class PCB_GENERATOR, generator on a layer
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
@ PCB_TABLE_T
class PCB_TABLE, table of PCB_TABLECELLs