111#define UNDEFINED_DRILL_DIAMETER  -1        
  114#define GEOMETRY_MIN_SIZE (int) ( 0.001 * pcbIUScale.IU_PER_MM ) 
  134        m_End   += aMoveVector;
 
 
  220                                  bool ignoreLineWidth = 
false ) 
const override;
 
  247                          const std::vector<KICAD_T>& aScanTypes ) 
override;
 
  249    bool HitTest( 
const VECTOR2I& aPosition, 
int aAccuracy = 0 ) 
const override;
 
  250    bool HitTest( 
const BOX2I& aRect, 
bool aContained, 
int aAccuracy = 0 ) 
const override;
 
  257        return wxT( 
"PCB_TRACK" );
 
 
  292    void Serialize( google::protobuf::Any &aContainer ) 
const override;
 
  293    bool Deserialize( 
const google::protobuf::Any &aContainer ) 
override;
 
  296    virtual void Show( 
int nestLevel, std::ostream& os )
 const override { ShowDummy( os ); }
 
  303                                     std::vector<MSG_PANEL_ITEM>& aList ) 
const;
 
 
  336        m_Mid   += aMoveVector;
 
  337        m_End   += aMoveVector;
 
 
  360    virtual bool HitTest( 
const VECTOR2I& aPosition, 
int aAccuracy = 0 ) 
const override;
 
  362    virtual bool HitTest( 
const BOX2I& aRect, 
bool aContained = 
true,
 
  363                          int aAccuracy = 0 ) 
const override;
 
  369        return wxT( 
"PCB_ARC" );
 
 
  401    void Serialize( google::protobuf::Any &aContainer ) 
const override;
 
  402    bool Deserialize( 
const google::protobuf::Any &aContainer ) 
override;
 
 
  430    bool IsType( 
const std::vector<KICAD_T>& aScanTypes )
 const override 
  435        for( 
KICAD_T scanType : aScanTypes )
 
 
  486    static std::optional<VIA_PARAMETER_ERROR>
 
  488                                    std::optional<int> aDrill,
 
  489                                    std::optional<PCB_LAYER_ID> aStartLayer = std::nullopt,
 
  490                                    std::optional<PCB_LAYER_ID> aEndLayer = std::nullopt );
 
  495    void SetWidth( 
int aWidth ) 
override;
 
  591    bool HitTest( 
const VECTOR2I& aPosition, 
int aAccuracy = 0 ) 
const override;
 
  592    bool HitTest( 
const BOX2I& aRect, 
bool aContained, 
int aAccuracy = 0 ) 
const override;
 
  596        return wxT( 
"PCB_VIA" );
 
 
  612    void Show( 
int nestLevel, std::ostream& os )
 const override { ShowDummy( os ); }
 
  751    void Serialize( google::protobuf::Any &aContainer ) 
const override;
 
  752    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...
 
BOARD_CONNECTED_ITEM(BOARD_ITEM *aParent, KICAD_T idtype)
 
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
 
BOARD_ITEM(BOARD_ITEM *aParent, KICAD_T idtype, PCB_LAYER_ID aLayer=F_Cu)
 
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.
 
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType, bool isSCH_ITEM=false, bool isBOARD_ITEM=false)
 
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.
 
@ 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.
 
void CopyFrom(const BOARD_ITEM *aOther) override
 
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.
 
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.
 
void SetHasSolderMask(bool aVal)
 
virtual double GetLength() const
Get the length of the track using the hypotenuse calculation.
 
double ViewGetLOD(int aLayer, const KIGFX::VIEW *aView) const override
Return the level of detail (LOD) of the item.
 
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 CopyFrom(const BOARD_ITEM *aOther) override
 
void SetPosition(const VECTOR2I &aPos) override
 
std::optional< int > GetLocalSolderMaskMargin() const
 
virtual double GetDelay() const
Get the time delay of the track.
 
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
 
virtual std::vector< int > ViewGetLayers() const override
Return the all the layers within the VIEW the object is painted on.
 
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
 
PCB_TRACK(BOARD_ITEM *aParent, KICAD_T idtype=PCB_TRACE_T)
 
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.
 
PLUGGING_MODE GetFrontPluggingMode() const
 
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 ...
 
void CopyFrom(const BOARD_ITEM *aOther) 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.
 
void SetCappingMode(CAPPING_MODE aMode)
 
void SetFrontCoveringMode(COVERING_MODE aMode)
 
wxString LayerMaskDescribe() const override
Return a string (to be shown to the user) describing a layer mask.
 
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
 
COVERING_MODE GetBackCoveringMode() const
 
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)
 
static std::optional< VIA_PARAMETER_ERROR > ValidateViaParameters(std::optional< int > aDiameter, std::optional< int > aDrill, std::optional< PCB_LAYER_ID > aStartLayer=std::nullopt, std::optional< PCB_LAYER_ID > aEndLayer=std::nullopt)
 
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()
 
CAPPING_MODE GetCappingMode() const
 
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.
 
PLUGGING_MODE GetBackPluggingMode() const
 
void SetBackPluggingMode(PLUGGING_MODE aMode)
 
MINOPTMAX< int > GetDrillConstraint(wxString *aSource=nullptr) const
 
void SetBackTentingMode(TENTING_MODE aMode)
 
void SetIsFree(bool aFree=true)
 
void SetFrontPluggingMode(PLUGGING_MODE aMode)
 
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.
 
std::mutex m_zoneLayerOverridesMutex
 
void SetTopLayer(PCB_LAYER_ID aLayer)
 
FILLING_MODE GetFillingMode() const
 
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)
 
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.
 
void SetFillingMode(FILLING_MODE aMode)
 
PCB_VIA(BOARD_ITEM *aParent)
 
bool ConditionallyFlashed(PCB_LAYER_ID aLayer) const
 
std::vector< int > ViewGetLayers() const override
Return the all the layers within the VIEW the object is painted on.
 
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
 
COVERING_MODE GetFrontCoveringMode() const
 
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
 
double ViewGetLOD(int aLayer, const KIGFX::VIEW *aView) const override
Return the level of detail (LOD) of the item.
 
MINOPTMAX< int > GetWidthConstraint(wxString *aSource=nullptr) const override
 
void SetWidth(int aWidth) override
 
void SetBackCoveringMode(COVERING_MODE aMode)
 
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 polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
 
Represent a set of closed polygons.
 
const INSPECTOR_FUNC & INSPECTOR
std::function passed to nested users by ref, avoids copying std::function.
 
std::uint32_t EDA_ITEM_FLAGS
 
static const bool NOT_FILLED
 
FLASHING
Enum used during connectivity building to ensure we do not query connectivity while building the data...
 
@ DEFAULT
Flashing follows connectivity.
 
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)
 
VECTOR2< int32_t > VECTOR2I