50 int aSize,
int aWidth ) :
70 int radius = aAccuracy + (
m_size / 2 );
71 return abs( dX ) <= radius && abs( dY ) <= radius;
118 return std::make_shared<SHAPE_CIRCLE>(
m_pos,
m_size / 2 );
125 return _(
"Target" );
131 return BITMAPS::add_pcb_target;
151 aList.emplace_back(
_(
"PCB Target" ), wxEmptyString );
157 aList.emplace_back(
_(
"Shape" ),
GetShape() == 0 ? wxT(
"+" ) : wxT(
"X" ) );
162 int aClearance,
int aError,
ERROR_LOC aErrorLoc,
163 bool ignoreLineWidth )
const
169 PCB_SHAPE circle(
nullptr, SHAPE_T::CIRCLE );
182 for(
PCB_SHAPE* item: { &line1, &line2, &circle } )
186 item->TransformShapeToPolygon( aBuffer, aLayer, aClearance, aError, aErrorLoc,
constexpr EDA_IU_SCALE pcbIUScale
BITMAPS
A list of all bitmap identifiers.
#define DEFAULT_COPPER_LINE_WIDTH
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.
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
wxString GetLayerName() const
Return the name of the PCB layer on which the item resides.
void SetX(coord_type val)
bool Intersects(const BOX2< Vec > &aRect) const
void SetY(coord_type val)
void SetWidth(coord_type val)
bool Contains(const Vec &aPoint) const
BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
void SetHeight(coord_type val)
The base class for create windows for drawing purpose.
A base class for most all the KiCad significant classes used in schematics and boards.
KICAD_T Type() const
Returns the type of object.
void SetStart(const VECTOR2I &aStart)
void SetEnd(const VECTOR2I &aEnd)
virtual void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
PCB_TARGET(BOARD_ITEM *aParent)
void SetWidth(int aWidth)
void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
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.
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer, FLASHING aFlash=FLASHING::DEFAULT) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
void Flip(const VECTOR2I &aCentre, bool aFlipLeftRight) override
Flip this object, i.e.
void SetShape(int aShape)
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
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.
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
virtual void swapData(BOARD_ITEM *aImage) override
VECTOR2I GetPosition() const override
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.
wxString MessageTextFromValue(double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
A lower-precision version of StringFromValue().
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...
PCB_LAYER_ID
A quick note on layer IDs:
PCB_LAYER_ID FlipLayer(PCB_LAYER_ID aLayerId, int aCopperLayersCount)
static struct PCB_TARGET_DESC _PCB_TARGET_DESC
constexpr int mmToIU(double mm) const
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
@ PCB_TARGET_T
class PCB_TARGET, a target (graphic item)