62 bool sametype =
false;
64 for(
KICAD_T scanType : aScanTypes )
135 std::vector<VECTOR2I> pts;
148 pts.emplace_back( pt + offset );
156 while( pts.size() < 4 )
157 pts.emplace_back( pts.back() +
VECTOR2I( 10, 10 ) );
182 BOX2I rect( start, end - start );
193 rotate( aRotCentre, aAngle );
199 flip( aCentre, aFlipLeftRight );
217 if( aMirrorAroundXAxis )
243 m_poly.
Mirror( !aMirrorAroundXAxis, aMirrorAroundXAxis, aCentre );
278 constexpr double HIDE = std::numeric_limits<double>::max();
279 constexpr double SHOW = 0.0;
304 aList.emplace_back(
_(
"Type" ),
_(
"Drawing" ) );
307 aList.emplace_back(
_(
"Status" ),
_(
"Locked" ) );
371 if( aFirst->
Type() != aSecond->
Type() )
372 return aFirst->
Type() < aSecond->
Type();
391 int aClearance,
int aError,
ERROR_LOC aErrorLoc,
392 bool ignoreLineWidth )
const
426 _HKI(
"Position X" ), isPolygon );
428 _HKI(
"Position Y" ), isPolygon );
constexpr EDA_IU_SCALE pcbIUScale
BITMAPS
A list of all bitmap identifiers.
#define DEFAULT_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.
virtual bool IsLocked() const
BOARD_ITEM_CONTAINER * GetParentFootprint() const
wxString GetLayerName() const
Return the name of the PCB layer on which the item resides.
BOX2< Vec > & Normalize()
Ensure that the height and width are positive.
const Vec & GetPosition() const
BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
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.
virtual bool IsType(const std::vector< KICAD_T > &aScanTypes) const
Check whether the item is one of the listed types.
virtual const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
EDA_ITEM * m_parent
Linked list: Link (parent struct)
void move(const VECTOR2I &aMoveVector)
void rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle)
void flip(const VECTOR2I &aCentre, bool aFlipLeftRight)
void RebuildBezierToSegmentsPointsList(int aMinSegLen)
Rebuild the m_bezierPoints vertex list that approximate the Bezier curve by a list of segments.
virtual std::vector< SHAPE * > MakeEffectiveShapes(bool aEdgeOnly=false) const
Make a set of SHAPE objects representing the EDA_SHAPE.
SHAPE_POLY_SET & GetPolyShape()
void ShapeGetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList)
wxString ShowShape() const
const VECTOR2I & GetEnd() const
Return the ending point of the graphic.
void SetStart(const VECTOR2I &aStart)
const VECTOR2I & GetStart() const
Return the starting point of the graphic.
void SwapShape(EDA_SHAPE *aImage)
std::vector< VECTOR2I > GetRectCorners() const
void SetEnd(const VECTOR2I &aEnd)
wxString SHAPE_T_asString() const
void scale(double aScale)
void TransformShapeToPolygon(SHAPE_POLY_SET &aBuffer, int aClearance, int aError, ERROR_LOC aErrorLoc, bool ignoreLineWidth=false) const
Convert the shape to a closed polygon.
VECTOR2I GetArcMid() const
Class that other classes need to inherit from, in order to be inspectable.
Contains methods for drawing PCB-specific items.
virtual PCB_RENDER_SETTINGS * GetSettings() override
Return a pointer to current settings that are going to be used when drawing items.
PCB specific render settings.
PCB_LAYER_ID GetPrimaryHighContrastLayer() const
Return the board layer which is in high-contrast mode.
bool GetHighContrast() const
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
bool IsLayerVisible(int aLayer) const
Return information about visibility of a particular layer.
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
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.
virtual void swapData(BOARD_ITEM *aImage) override
EDA_ANGLE getParentOrientation() const override
virtual void Flip(const VECTOR2I &aCentre, bool aFlipLeftRight) override
Flip this object, i.e.
VECTOR2I GetCenter() const override
This defaults to the center of the bounding box if not overridden.
virtual void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
virtual BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
PCB_SHAPE(BOARD_ITEM *aParent, KICAD_T aItemType, SHAPE_T aShapeType)
FOOTPRINT * GetParentFootprint() const
Return the parent footprint or NULL if PCB_SHAPE does not belong to a footprint.
virtual const BOX2I ViewBBox() const override
std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT) const override
Make a set of SHAPE objects representing the PCB_SHAPE.
const VECTOR2I GetFocusPosition() const override
Allows items to return their visual center rather than their anchor.
virtual wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
virtual std::vector< VECTOR2I > GetCorners() const
Return 4 corners for a rectangle or rotated rectangle (stored as a poly).
VECTOR2I getParentPosition() const override
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.
virtual void Move(const VECTOR2I &aMoveVector) override
Move this object.
virtual EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
double ViewGetLOD(int aLayer, KIGFX::VIEW *aView) const override
Return the level of detail (LOD) of the item.
virtual void Mirror(const VECTOR2I &aCentre, bool aMirrorAroundXAxis)
void Scale(double aScale)
bool IsType(const std::vector< KICAD_T > &aScanTypes) const override
Check whether the item is one of the listed types.
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()
void OverrideAvailability(TYPE_ID aDerived, TYPE_ID aBase, const wxString &aName, std::function< bool(INSPECTABLE *)> aFunc)
Sets an override availability functor for a base class property of a given derived class.
PROPERTY_BASE & ReplaceProperty(size_t aBase, const wxString &aName, PROPERTY_BASE *aNew, const wxString &aGroup=wxEmptyString)
Replace an existing property for a specific type.
void AddTypeCast(TYPE_CAST_BASE *aCast)
Register a type converter.
const VECTOR2I & CPoint(int aIndex) const
Return a reference to a given point in the line chain.
const std::vector< VECTOR2I > & CPoints() const
Represent a set of closed polygons.
void Mirror(bool aX=true, bool aY=false, const VECTOR2I &aRef={ 0, 0 })
Mirror the line points about y or x (or both)
SHAPE_LINE_CHAIN & Outline(int aIndex)
int OutlineCount() const
Return the number of vertices in a given outline/hole.
static constexpr EDA_ANGLE & ANGLE_0
#define PCB_EDIT_FRAME_NAME
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
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:
PCB_LAYER_ID FlipLayer(PCB_LAYER_ID aLayerId, int aCopperLayersCount)
This file contains miscellaneous commonly used macros and functions.
#define UNIMPLEMENTED_FOR(type)
void MIRROR(T &aPoint, const T &aMirrorRef)
Updates aPoint with the mirror of aPoint relative to the aMirrorRef.
static struct PCB_SHAPE_DESC _PCB_SHAPE_DESC
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
bool operator()(const BOARD_ITEM *aFirst, const BOARD_ITEM *aSecond) const
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
@ PCB_LOCATE_BOARD_EDGE_T
@ PCB_SHAPE_LOCATE_CIRCLE_T
@ PCB_SHAPE_LOCATE_SEGMENT_T
@ PCB_SHAPE_LOCATE_RECT_T
@ PCB_SHAPE_LOCATE_BEZIER_T
@ PCB_SHAPE_LOCATE_POLY_T