72#define UNDEFINED_DRILL_DIAMETER -1
75#define GEOMETRY_MIN_SIZE (int) ( 0.001 * pcbIUScale.IU_PER_MM )
98 virtual void Mirror(
const VECTOR2I& aCentre,
bool aMirrorAroundXAxis );
100 void Flip(
const VECTOR2I& aCentre,
bool aFlipLeftRight )
override;
153 bool ignoreLineWidth =
false )
const override;
157 FLASHING aFlash = FLASHING::DEFAULT )
const override;
180 const std::vector<KICAD_T>& aScanTypes )
override;
182 bool HitTest(
const VECTOR2I& aPosition,
int aAccuracy = 0 )
const override;
183 bool HitTest(
const BOX2I& aRect,
bool aContained,
int aAccuracy = 0 )
const override;
189 return wxT(
"PCB_TRACK" );
208 virtual void ViewGetLayers(
int aLayers[],
int& aCount )
const override;
268 virtual void Show(
int nestLevel, std::ostream& os )
const override { ShowDummy( os ); }
275 std::vector<MSG_PANEL_ITEM>& aList )
const;
306 m_Mid += aMoveVector;
307 m_End += aMoveVector;
312 void Mirror(
const VECTOR2I& aCentre,
bool aMirrorAroundXAxis )
override;
314 void Flip(
const VECTOR2I& aCentre,
bool aFlipLeftRight )
override;
332 virtual bool HitTest(
const VECTOR2I& aPosition,
int aAccuracy = 0 )
const override;
334 virtual bool HitTest(
const BOX2I& aRect,
bool aContained =
true,
335 int aAccuracy = 0 )
const override;
341 return wxT(
"PCB_ARC" );
346 FLASHING aFlash = FLASHING::DEFAULT )
const override;
381 bool IsType(
const std::vector<KICAD_T>& aScanTypes )
const override
386 for(
KICAD_T scanType : aScanTypes )
451 bool HitTest(
const VECTOR2I& aPosition,
int aAccuracy = 0 )
const override;
452 bool HitTest(
const BOX2I& aRect,
bool aContained,
int aAccuracy = 0 )
const override;
456 return wxT(
"PCB_VIA" );
465 void ViewGetLayers(
int aLayers[],
int& aCount )
const override;
469 void Flip(
const VECTOR2I& aCentre,
bool aFlipLeftRight )
override;
472 void Show(
int nestLevel, std::ostream& os )
const override { ShowDummy( os ); }
561 FLASHING aFlash = FLASHING::DEFAULT )
const override;
BITMAPS
A list of all bitmap identifiers.
ZONE_LAYER_OVERRIDE
Conditionally flashed vias and pads that interact with zones of different priority can be very squirr...
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
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.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
LSET is a set of PCB_LAYER_IDs.
EDA_MSG_PANEL items for displaying messages.
virtual VECTOR2I GetPosition() const override
virtual void swapData(BOARD_ITEM *aImage) override
virtual double GetLength() const override
Return the length of the arc track.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
EDA_ANGLE GetArcAngleStart() const
virtual bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
EDA_ANGLE GetArcAngleEnd() const
void SetPosition(const VECTOR2I &aPos) override
virtual void Move(const VECTOR2I &aMoveVector) override
Move this object.
wxString GetClass() const override
Return the class name.
void SetMid(const VECTOR2I &aMid)
EDA_ANGLE GetAngle() const
const VECTOR2I & GetMid() const
PCB_ARC(BOARD_ITEM *aParent)
void Flip(const VECTOR2I &aCentre, bool aFlipLeftRight) override
Flip this object, i.e.
VECTOR2I m_Mid
Arc mid point, halfway between start and end.
static bool ClassOf(const EDA_ITEM *aItem)
void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
virtual VECTOR2I GetCenter() const override
This defaults to the center of the bounding box if not overridden.
void Mirror(const VECTOR2I &aCentre, bool aMirrorAroundXAxis) override
double m_CachedScale
Last zoom scale used to draw this track's net.
double m_CachedLOD
Last LOD used to draw this track's net.
double GetCachedScale()
Get last used zoom scale for the track net name.
double GetCachedLOD()
Get last used LOD for the track net name.
void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
virtual void ViewGetLayers(int aLayers[], int &aCount) const override
Return the all the layers within the VIEW the object is painted on.
int GetLocalClearance(wxString *aSource) const override
Return any local clearance overrides set in the "classic" (ie: pre-rule) system.
void SetCachedScale(double aScale)
Set the cached scale.
const VECTOR2I GetFocusPosition() const override
Similar to GetPosition, but allows items to return their visual center rather than their anchor.
bool IsOnCopperLayer() const override
void Move(const VECTOR2I &aMoveVector) override
Move this object.
void SetWidth(int aWidth)
wxString GetClass() const override
Return the class name.
double ViewGetLOD(int aLayer, KIGFX::VIEW *aView) const override
Return the level of detail (LOD) of the item.
virtual double GetLength() const
Get the length of the track using the hypotenuse calculation.
virtual void swapData(BOARD_ITEM *aImage) override
void SetEnd(const VECTOR2I &aEnd)
void SetStart(const VECTOR2I &aStart)
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
INSPECT_RESULT Visit(INSPECTOR inspector, void *testData, const std::vector< KICAD_T > &aScanTypes) override
May be re-implemented for each derived class in order to handle all the types given by its member dat...
bool ApproxCollinear(const PCB_TRACK &aTrack)
VECTOR2I m_End
Line end point.
void SetPosition(const VECTOR2I &aPos) override
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 EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
void TransformShapeToPolygon(SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, int aClearance, int aError, ERROR_LOC aErrorLoc, bool ignoreLineWidth=false) const override
Convert the track shape to a closed polygon.
const VECTOR2I & GetStart() const
VECTOR2I m_Start
Line start point.
wxString GetFriendlyName() const override
VECTOR2I GetPosition() const override
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
void Flip(const VECTOR2I &aCentre, bool aFlipLeftRight) override
Flip this object, i.e.
void SetCachedLOD(double aLOD)
Set the cached LOD.
const VECTOR2I & GetEndPoint(ENDPOINT_T aEndPoint) const
Return the selected endpoint (start or end)
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
static bool ClassOf(const EDA_ITEM *aItem)
bool IsNull() const
Return true if segment length is zero.
std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
const VECTOR2I & GetEnd() const
int m_Width
Thickness of track, or via diameter.
MINOPTMAX< int > GetWidthConstraint(wxString *aSource=nullptr) const
virtual void Mirror(const VECTOR2I &aCentre, bool aMirrorAroundXAxis)
EDA_ITEM_FLAGS IsPointOnEnds(const VECTOR2I &point, int min_dist=0) const
Return STARTPOINT if point if near (dist = min_dist) start point, ENDPOINT if point if near (dist = m...
void GetMsgPanelInfoBase_Common(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) const
void SetRemoveUnconnected(bool aSet)
Sets the unconnected removal property.
bool IsTented() const override
bool GetIsFree() const
Check if the via is a free via (as opposed to one created on a track by the router).
PCB_LAYER_ID BottomLayer() const
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
VECTOR2I GetPosition() const override
std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
bool GetRemoveUnconnected() const
bool FlashLayer(int aLayer) const
Check to see whether the via should have a pad on the specific layer.
void SetKeepStartEnd(bool aSet)
Sets whether we keep the start and end annular rings even if they are not connected.
void SetDrillDefault()
Set the drill value for vias to the default value UNDEFINED_DRILL_DIAMETER.
void ClearZoneLayerOverrides()
PCB_LAYER_ID m_bottomLayer
The bottom layer of the via (the top layer is in m_layer)
int GetDrill() const
Return the local drill setting for this PCB_VIA.
bool m_isFree
"Free" vias don't get their nets auto-updated
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
virtual void SetLayerSet(LSET aLayers) override
void SetBottomLayer(PCB_LAYER_ID aLayer)
std::array< ZONE_LAYER_OVERRIDE, MAX_CU_LAYERS > m_zoneLayerOverrides
int GetSolderMaskExpansion() const
void SetDrill(int aDrill)
Set the drill value for vias.
void SetIsFree(bool aFree=true)
bool IsOnLayer(PCB_LAYER_ID aLayer, bool aIncludeCourtyards=false) const override
Test to see if this object is on the given layer.
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.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
int m_drill
for vias: via drill (- 1 for default value)
double ViewGetLOD(int aLayer, KIGFX::VIEW *aView) const override
Return the level of detail (LOD) of the item.
std::mutex m_zoneLayerOverridesMutex
void SetTopLayer(PCB_LAYER_ID aLayer)
void SetPosition(const VECTOR2I &aPoint) override
std::shared_ptr< SHAPE_SEGMENT > GetEffectiveHoleShape() const override
void SetLayerPair(PCB_LAYER_ID aTopLayer, PCB_LAYER_ID aBottomLayer)
For a via m_layer contains the top layer, the other layer is in m_bottomLayer/.
bool IsType(const std::vector< KICAD_T > &aScanTypes) const override
Check whether the item is one of the listed types.
bool m_removeUnconnectedLayer
Remove annular rings on unconnected layers.
bool GetKeepStartEnd() const
static bool ClassOf(const EDA_ITEM *aItem)
void ViewGetLayers(int aLayers[], int &aCount) const override
Return the all the layers within the VIEW the object is painted on.
bool HasHole() const override
void SanitizeLayers()
Check so that the layers are correct depending on the type of via, and so that the top actually is on...
PCB_VIA & operator=(const PCB_VIA &aOther)
void swapData(BOARD_ITEM *aImage) override
wxString GetClass() const override
Return the class name.
bool ConditionallyFlashed(PCB_LAYER_ID aLayer) const
wxString layerMaskDescribe() const override
Return a string (to be shown to the user) describing a layer mask.
void SetViaType(VIATYPE aViaType)
int GetMinAnnulus(PCB_LAYER_ID aLayer, wxString *aSource) const
PCB_LAYER_ID TopLayer() const
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
VIATYPE m_viaType
through, blind/buried or micro
bool m_keepStartEndLayer
Keep the start and end annular rings.
int GetDrillValue() const
Calculate the drill value for vias (m-Drill if > 0, or default drill value for the board.
void SetZoneLayerOverride(PCB_LAYER_ID aLayer, ZONE_LAYER_OVERRIDE aOverride)
VIATYPE GetViaType() const
bool IsDrillDefault() const
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
const ZONE_LAYER_OVERRIDE & GetZoneLayerOverride(PCB_LAYER_ID aLayer) const
void LayerPair(PCB_LAYER_ID *top_layer, PCB_LAYER_ID *bottom_layer) const
Return the 2 layers used by the via (the via actually uses all layers between these 2 layers)
void Flip(const VECTOR2I &aCentre, bool aFlipLeftRight) override
Flip this object, i.e.
Represent a set of closed polygons.
const INSPECTOR_FUNC & INSPECTOR
std::uint32_t EDA_ITEM_FLAGS
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...
PCB_LAYER_ID
A quick note on layer IDs:
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
#define UNDEFINED_DRILL_DIAMETER
bool operator()(const PCB_TRACK *aFirst, const PCB_TRACK *aSecond) const
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)