25 #ifndef BOARD_ITEM_STRUCT_H 26 #define BOARD_ITEM_STRUCT_H 88 wxPoint p( aX,
GetY() );
94 wxPoint p(
GetX(), aY );
151 wxFAIL_MSG( wxT(
"Attempted to SetLayerSet() on a single-layer object." ) );
233 virtual void Move(
const wxPoint& aMoveVector )
235 wxFAIL_MSG( wxT(
"virtual BOARD_ITEM::Move called for " ) +
GetClass() );
240 Move( wxPoint( aMoveVector.
x, aMoveVector.
y ) );
249 virtual void Rotate(
const wxPoint& aRotCentre,
double aAngle );
253 Rotate( wxPoint( aRotCentre.
x, aRotCentre.
y ), aAngle );
262 virtual void Flip(
const wxPoint& aCentre,
bool aFlipLeftRight );
266 Flip( wxPoint( aCentre.
x, aCentre.
y ), aFlipLeftRight );
282 virtual void ViewGetLayers(
int aLayers[],
int& aCount )
const override;
299 bool ignoreLineWidth =
false )
const;
336 return _(
"(Deleted Item)" );
341 return wxT(
"DELETED_BOARD_ITEM" );
359 void Show(
int , std::ostream& )
const override {}
PCB_GROUP * GetParentGroup() const
EDA_ITEM * m_parent
Linked list: Link (parent struct)
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
virtual void SetPosition(const wxPoint &aPos)
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
wxString GetClass() const override
Return the class name.
virtual void Rotate(const wxPoint &aRotCentre, double aAngle)
Rotate this object.
wxPoint GetPosition() const override
A set of BOARD_ITEMs (i.e., without duplicates).
the 3d code uses this value
virtual void ViewGetLayers(int aLayers[], int &aCount) const override
Return the all the layers within the VIEW the object is painted on.
void DeleteStructure()
Delete this object after removing from its parent if it has one.
bool IsTrack() const
Test to see if this object is a track or via (or microvia).
virtual void SetLocked(bool aLocked)
Modify the 'lock' status for of the item.
virtual wxPoint GetPosition() const
A singleton item of this class is returned for a weak reference that no longer exists.
virtual void SetLayerSet(LSET aLayers)
virtual bool IsLocked() const
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.
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
static wxPoint ZeroOffset
A value of wxPoint(0,0) which can be passed to the Draw() functions.
class PCB_TRACK, a track segment (segment on a copper layer)
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
DECLARE_ENUM_TO_WXANY(PCB_LAYER_ID)
virtual void SwapData(BOARD_ITEM *aImage)
Swap data between aItem and aImage.
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
virtual wxString layerMaskDescribe() const
Return a string (to be shown to the user) describing a layer mask.
virtual void Flip(const wxPoint &aCentre, bool aFlipLeftRight)
Flip this object, i.e.
void SetState(EDA_ITEM_FLAGS type, bool state)
LSET is a set of PCB_LAYER_IDs.
virtual bool IsOnLayer(PCB_LAYER_ID aLayer) const
Test to see if this object is on the given layer.
virtual void Move(const wxPoint &aMoveVector)
Move this object.
Represent a set of closed polygons.
static DELETED_BOARD_ITEM * GetInstance()
#define LOCKED
Pcbnew: locked from movement and deletion.
virtual wxPoint GetCenter() const
This defaults to the center of the bounding box if not overridden.
a few functions useful in geometry calculations.
void SetPosition(const wxPoint &) override
An abstract shape on 2D plane.
void Move(const VECTOR2I &aMoveVector)
bool IsCopperLayer(LAYER_NUM aLayerId)
Tests whether a layer is a copper layer.
FLASHING
Enum used during connectivity building to ensure we do not query connectivity while building the data...
BOARD_ITEM(BOARD_ITEM *aParent, KICAD_T idtype)
virtual wxString GetClass() const =0
Return the class name.
Information pertinent to a Pcbnew printed circuit board.
bool operator()(const BOARD_ITEM *a, const BOARD_ITEM *b) const
PCB_LAYER_ID
A quick note on layer IDs:
A base class for most all the KiCad significant classes used in schematics and boards.
virtual bool IsConnected() const
Returns information if the object is derived from BOARD_CONNECTED_ITEM.
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
class PCB_VIA, a via (like a track segment on a copper layer)
virtual void TransformShapeWithClearanceToPolygon(SHAPE_POLY_SET &aCornerBuffer, PCB_LAYER_ID aLayer, int aClearanceValue, int aError, ERROR_LOC aErrorLoc, bool ignoreLineWidth=false) const
Convert the item shape to a closed polygon.
Abstract interface for BOARD_ITEMs capable of storing other items inside.
virtual const EDA_RECT GetBoundingBox() const
Return the orthogonal bounding box of this object for display purposes.
const wxPoint GetCenter() const
BOARD_ITEM_CONTAINER * GetParent() const
void Flip(const VECTOR2I &aCentre, bool aFlipLeftRight)
wxString GetLayerName() const
Return the name of the PCB layer on which the item resides.
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
virtual bool IsOnCopperLayer() const
virtual LSET GetLayerSet() const
Return a std::bitset of all layers on which the item physically resides.
void Rotate(const VECTOR2I &aRotCentre, double aAngle)
virtual BOARD_ITEM * Duplicate() const
Create a copy of this BOARD_ITEM.
KICAD_T Type() const
Returns the type of object.
BOARD_ITEM_CONTAINER * GetParentFootprint() const
void SetParentGroup(PCB_GROUP *aGroup)