81#define UNDEFINED_DRILL_DIAMETER -1
84#define GEOMETRY_MIN_SIZE (int) ( 0.001 * pcbIUScale.IU_PER_MM )
102 m_End += aMoveVector;
175 bool ignoreLineWidth =
false )
const override;
179 FLASHING aFlash = FLASHING::DEFAULT )
const override;
202 const std::vector<KICAD_T>& aScanTypes )
override;
204 bool HitTest(
const VECTOR2I& aPosition,
int aAccuracy = 0 )
const override;
205 bool HitTest(
const BOX2I& aRect,
bool aContained,
int aAccuracy = 0 )
const override;
211 return wxT(
"PCB_TRACK" );
222 virtual void ViewGetLayers(
int aLayers[],
int& aCount )
const override;
246 void Serialize( google::protobuf::Any &aContainer )
const override;
247 bool Deserialize(
const google::protobuf::Any &aContainer )
override;
250 virtual void Show(
int nestLevel, std::ostream& os )
const override { ShowDummy( os ); }
257 std::vector<MSG_PANEL_ITEM>& aList )
const;
288 m_Mid += aMoveVector;
289 m_End += aMoveVector;
312 virtual bool HitTest(
const VECTOR2I& aPosition,
int aAccuracy = 0 )
const override;
314 virtual bool HitTest(
const BOX2I& aRect,
bool aContained =
true,
315 int aAccuracy = 0 )
const override;
321 return wxT(
"PCB_ARC" );
326 FLASHING aFlash = FLASHING::DEFAULT )
const override;
353 void Serialize( google::protobuf::Any &aContainer )
const override;
354 bool Deserialize(
const google::protobuf::Any &aContainer )
override;
380 bool IsType(
const std::vector<KICAD_T>& aScanTypes )
const override
385 for(
KICAD_T scanType : aScanTypes )
412 void SetWidth(
int aWidth )
override;
492 bool HitTest(
const VECTOR2I& aPosition,
int aAccuracy = 0 )
const override;
493 bool HitTest(
const BOX2I& aRect,
bool aContained,
int aAccuracy = 0 )
const override;
497 return wxT(
"PCB_VIA" );
506 void ViewGetLayers(
int aLayers[],
int& aCount )
const override;
513 void Show(
int nestLevel, std::ostream& os )
const override { ShowDummy( os ); }
641 FLASHING aFlash = FLASHING::DEFAULT )
const override;
654 void Serialize( google::protobuf::Any &aContainer )
const override;
655 bool Deserialize(
const google::protobuf::Any &aContainer )
override;
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
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.
A PADSTACK defines the characteristics of a single or multi-layer pad, in the IPC sense of the word.
void SetUnconnectedLayerMode(UNCONNECTED_LAYER_MODE aMode)
UNCONNECTED_LAYER_MODE UnconnectedLayerMode() const
@ REMOVE_EXCEPT_START_AND_END
virtual VECTOR2I GetPosition() const override
bool IsDegenerated(int aThreshold=5) const
virtual void swapData(BOARD_ITEM *aImage) override
virtual double GetLength() const override
Return the length of the arc track.
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
void Flip(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection) override
Flip this object, i.e.
EDA_ANGLE GetArcAngleStart() const
void Mirror(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection) override
Mirror this object relative to a given horizontal axis the layer is not changed.
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
const VECTOR2I GetFocusPosition() const override
Similar to GetPosition, but allows items to return their visual center rather than their anchor.
void SetPosition(const VECTOR2I &aPos) override
virtual void Move(const VECTOR2I &aMoveVector) override
Move this object.
wxString GetClass() const override
Return the class name.
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
void SetMid(const VECTOR2I &aMid)
EDA_ANGLE GetAngle() const
const VECTOR2I & GetMid() const
PCB_ARC(BOARD_ITEM *aParent)
double Similarity(const BOARD_ITEM &aOther) const override
Return a measure of how likely the other object is to represent the same object.
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.
bool operator==(const PCB_ARC &aOther) const
virtual VECTOR2I GetCenter() const override
This defaults to the center of the bounding box if not overridden.
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
virtual void SetLayerSet(const LSET &aLayers) override
int GetSolderMaskExpansion() const
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.
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
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.
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.
void SetHasSolderMask(bool aVal)
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)
bool HasSolderMask() const
void SetStart(const VECTOR2I &aStart)
const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
virtual void Mirror(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection) override
Mirror this object relative to a given horizontal axis the layer is not changed.
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
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 SetLocalSolderMaskMargin(std::optional< int > aMargin)
std::optional< int > m_solderMaskMargin
void SetPosition(const VECTOR2I &aPos) override
std::optional< int > GetLocalSolderMaskMargin() const
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
virtual bool operator==(const BOARD_ITEM &aOther) const override
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.
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)
void Flip(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection) override
Flip this object, i.e.
bool IsNull() const
Return true if segment length is zero.
virtual double Similarity(const BOARD_ITEM &aOther) const override
Return a measure of how likely the other object is to represent the same 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.
const VECTOR2I & GetEnd() const
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Test to see if this object is on the given layer.
virtual MINOPTMAX< int > GetWidthConstraint(wxString *aSource=nullptr) const
int m_width
Thickness of track (or arc) – no longer the width of a via.
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...
virtual void SetWidth(int aWidth)
virtual int GetWidth() const
void GetMsgPanelInfoBase_Common(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) const
void SetRemoveUnconnected(bool aSet)
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
bool IsTented(PCB_LAYER_ID aLayer) const override
Checks if the given object is tented (its copper shape is covered by solder mask) on a given side of ...
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 Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
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)
void SetDrillDefault()
Set the drill value for vias to the default value UNDEFINED_DRILL_DIAMETER.
std::map< PCB_LAYER_ID, ZONE_LAYER_OVERRIDE > m_zoneLayerOverrides
void ClearZoneLayerOverrides()
const PADSTACK & Padstack() const
void SetFrontTentingMode(TENTING_MODE aMode)
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.
TENTING_MODE GetFrontTentingMode() const
void SetBottomLayer(PCB_LAYER_ID aLayer)
int GetSolderMaskExpansion() const
void SetDrill(int aDrill)
Set the drill value for vias.
MINOPTMAX< int > GetDrillConstraint(wxString *aSource=nullptr) const
void SetBackTentingMode(TENTING_MODE aMode)
void SetIsFree(bool aFree=true)
void Flip(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection) override
Flip this object, i.e.
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.
bool operator==(const PCB_VIA &aOther) const
PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
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
int GetFrontWidth() const
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 HasDrilledHole() const override
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
bool IsType(const std::vector< KICAD_T > &aScanTypes) const override
Check whether the item is one of the listed types.
double Similarity(const BOARD_ITEM &aOther) const override
Return a measure of how likely the other object is to represent the same object.
void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
bool GetKeepStartEnd() const
virtual void SetLayerSet(const LSET &aLayers) override
Note SetLayerSet() initialize the first and last copper layers connected by the via.
void GetOutermostConnectedLayers(PCB_LAYER_ID *aTopmost, PCB_LAYER_ID *aBottommost) const
Return the top-most and bottom-most connected layers.
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...
int GetWidth() const override
PCB_VIA & operator=(const PCB_VIA &aOther)
void swapData(BOARD_ITEM *aImage) override
wxString GetClass() const override
Return the class name.
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
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
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Test to see if this object is on the given layer.
TENTING_MODE GetBackTentingMode() const
PCB_LAYER_ID TopLayer() const
VIATYPE m_viaType
through, blind/buried or micro
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)
void SetFrontWidth(int aWidth)
VIATYPE GetViaType() const
MINOPTMAX< int > GetWidthConstraint(wxString *aSource=nullptr) const override
void SetWidth(int aWidth) override
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)
bool HasValidLayerPair(int aCopperLayerCount)
void SetPadstack(const PADSTACK &aPadstack)
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Represent a set of closed polygons.
const INSPECTOR_FUNC & INSPECTOR
std::uint32_t EDA_ITEM_FLAGS
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
VECTOR2I size
Drill diameter (x == y) or slot dimensions (x != y)
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)