69 #define UNDEFINED_DRILL_DIAMETER -1 //< Undefined via drill diameter. 72 #define GEOMETRY_MIN_SIZE ( int )( 0.001 * IU_PER_MM ) 87 void Move(
const wxPoint& aMoveVector )
override 93 void Rotate(
const wxPoint& aRotCentre,
double aAngle )
override;
95 void Flip(
const wxPoint& aCentre,
bool aFlipLeftRight )
override;
149 bool ignoreLineWidth =
false )
const override;
177 bool HitTest(
const wxPoint& aPosition,
int aAccuracy = 0 )
const override;
178 bool HitTest(
const EDA_RECT& aRect,
bool aContained,
int aAccuracy = 0 )
const override;
184 return wxT(
"PCB_TRACK" );
201 virtual void ViewGetLayers(
int aLayers[],
int& aCount )
const override;
223 virtual void Show(
int nestLevel, std::ostream& os )
const override { ShowDummy( os ); }
230 static wxString ShowState(
int stateBits );
260 virtual void Move(
const wxPoint& aMoveVector )
override 263 m_Mid += aMoveVector;
264 m_End += aMoveVector;
267 virtual void Rotate(
const wxPoint& aRotCentre,
double aAngle )
override;
269 virtual void Flip(
const wxPoint& aCentre,
bool aFlipLeftRight )
override;
287 virtual bool HitTest(
const wxPoint& aPosition,
int aAccuracy = 0 )
const override;
289 virtual bool HitTest(
const EDA_RECT& aRect,
bool aContained =
true,
int aAccuracy = 0 )
const override;
293 return wxT(
"PCB_ARC" );
310 double includedAngle = std::abs(
GetAngle() );
312 return radius * M_PI * includedAngle / 1800.0;
341 for(
const KICAD_T* p = aScanTypes; *p !=
EOT; ++p )
397 bool HitTest(
const wxPoint& aPosition,
int aAccuracy = 0 )
const override;
398 bool HitTest(
const EDA_RECT& aRect,
bool aContained,
int aAccuracy = 0 )
const override;
402 return wxT(
"PCB_VIA" );
411 void ViewGetLayers(
int aLayers[],
int& aCount )
const override;
415 void Flip(
const wxPoint& aCentre,
bool aFlipLeftRight )
override;
418 void Show(
int nestLevel, std::ostream& os )
const override { ShowDummy( os ); }
515 #endif // CLASS_TRACK_H bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Test to see if this object is on the given layer.
static bool ClassOf(const EDA_ITEM *aItem)
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
bool operator()(const PCB_TRACK *aFirst, const PCB_TRACK *aSecond) const
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
virtual wxPoint GetCenter() const override
This defaults to the center of the bounding box if not overridden.
wxPoint m_Start
Line start point.
static bool ClassOf(const EDA_ITEM *aItem)
PCB_ARC(BOARD_ITEM *aParent)
void SetBottomLayer(PCB_LAYER_ID aLayer)
void Flip(const wxPoint &aCentre, bool aFlipLeftRight) override
Flip this object, i.e.
wxPoint GetPosition() const override
virtual bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
bool FlashLayer(int aLayer) const
Checks to see whether the via should have a pad on the specific layer.
wxPoint GetPosition() const override
void SetRemoveUnconnected(bool aSet)
Sets the unconnected removal property.
const wxPoint & GetEnd() const
virtual EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
virtual double GetLength() const override
Function GetLength returns the length of the arc track.
void SetDrill(int aDrill)
Function SetDrill sets the drill value for vias.
void SetEnd(const wxPoint &aEnd)
VIATYPE GetViaType() const
virtual double GetLength() const
Function GetLength returns the length of the track using the hypotenuse calculation.
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
void SetLayerPair(PCB_LAYER_ID aTopLayer, PCB_LAYER_ID aBottomLayer)
Function SetLayerPair For a via m_layer contains the top layer, the other layer is in m_bottomLayer.
PCB_TRACK(BOARD_ITEM *aParent, KICAD_T idtype=PCB_TRACE_T)
void Move(const wxPoint &aMoveVector) override
Move this object.
int m_drill
for vias: via drill (- 1 for default value)
int GetMinAnnulus(PCB_LAYER_ID aLayer, wxString *aSource) const
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
void SetPosition(const wxPoint &aPos) override
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
class PCB_ARC, an arc track segment on a copper layer
virtual 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 SetPosition(const wxPoint &aPoint) override
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
std::uint32_t EDA_ITEM_FLAGS
void TransformShapeWithClearanceToPolygon(SHAPE_POLY_SET &aCornerBuffer, PCB_LAYER_ID aLayer, int aClearanceValue, int aError, ERROR_LOC aErrorLoc, bool ignoreLineWidth=false) const override
Function TransformShapeWithClearanceToPolygon Convert the track shape to a closed polygon Used in fil...
VIATYPE m_viaType
through, blind/buried or micro
The base class for create windows for drawing purpose.
void GetMsgPanelInfoBase_Common(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) const
PCB_LAYER_ID BottomLayer() const
bool IsDrillDefault() const
Function IsDrillDefault.
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
static bool ClassOf(const EDA_ITEM *aItem)
const INSPECTOR_FUNC & INSPECTOR
search types array terminator (End Of Types)
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
class PCB_TRACK, a track segment (segment on a copper 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.
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
void SwapData(BOARD_ITEM *aImage) override
Swap data between aItem and aImage.
void ViewGetLayers(int aLayers[], int &aCount) const override
Return the all the layers within the VIEW the object is painted on.
wxPoint m_End
Line end point.
bool IsType(const KICAD_T aScanTypes[]) const override
Check whether the item is one of the listed types.
void SetKeepTopBottom(bool aSet)
Sets whether we keep the top and bottom connections even if they are not connected.
double GetArcAngleEnd() const
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
PCB_LAYER_ID TopLayer() const
LSET is a set of PCB_LAYER_IDs.
bool ApproxCollinear(const PCB_TRACK &aTrack)
int GetLocalClearance(wxString *aSource) const override
Function GetLocalClearance returns any local clearance overrides set in the "classic" (ie: pre-rule) ...
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
void SetDrillDefault()
Function SetDrillDefault sets the drill value for vias to the default value UNDEFINED_DRILL_DIAMETER.
wxString GetClass() const override
Return the class name.
double GetArcAngleStart() const
Represent a set of closed polygons.
bool GetRemoveUnconnected() const
void SetMid(const wxPoint &aMid)
virtual wxPoint GetPosition() const override
bool m_keepTopBottomLayer
Keep the top and bottom annular rings.
#define UNDEFINED_DRILL_DIAMETER
virtual void Rotate(const wxPoint &aRotCentre, double aAngle) override
Rotate this object.
int GetDrill() const
Function GetDrill returns the local drill setting for this PCB_VIA.
void LayerPair(PCB_LAYER_ID *top_layer, PCB_LAYER_ID *bottom_layer) const
Function LayerPair Return the 2 layers used by the via (the via actually uses all layers between thes...
void SetStart(const wxPoint &aStart)
virtual bool IsType(const KICAD_T aScanTypes[]) const
Check whether the item is one of the listed types.
wxString GetClass() const override
Return the class name.
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
void SetViaType(VIATYPE aViaType)
bool GetKeepTopBottom() const
bool m_removeUnconnectedLayer
Remove unconnected copper on a via.
virtual void Flip(const wxPoint &aCentre, bool aFlipLeftRight) override
Flip this object, i.e.
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
virtual void SetLayerSet(LSET aLayers) override
void SetTopLayer(PCB_LAYER_ID aLayer)
FLASHING
Enum used during connectivity building to ensure we do not query connectivity while building the data...
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.
void SetPosition(const wxPoint &aPos) override
const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
void SetWidth(int aWidth)
SEARCH_RESULT Visit(INSPECTOR inspector, void *testData, const KICAD_T scanTypes[]) override
May be re-implemented for each derived class in order to handle all the types given by its member dat...
void Flip(const wxPoint &aCentre, bool aFlipLeftRight) override
Flip this object, i.e.
virtual void SwapData(BOARD_ITEM *aImage) override
Swap data between aItem and aImage.
int m_Width
Thickness of track, or via diameter.
PCB_LAYER_ID m_bottomLayer
The bottom layer of the via (the top layer is in m_layer)
void SetIsFree(bool aFree=true)
double ViewGetLOD(int aLayer, KIGFX::VIEW *aView) const override
Return the level of detail (LOD) of the item.
BITMAPS
A list of all bitmap identifiers.
double ViewGetLOD(int aLayer, KIGFX::VIEW *aView) const override
Return the level of detail (LOD) of the item.
bool GetIsFree() const
Checks if the via is a free via (as opposed to one created on a track by the router).
PCB_LAYER_ID
A quick note on layer IDs:
EDA_ITEM_FLAGS IsPointOnEnds(const wxPoint &point, int min_dist=0) const
Function IsPointOnEnds returns STARTPOINT if point if near (dist = min_dist) start point,...
const wxPoint GetFocusPosition() const override
Similar to GetPosition, but allows items to return their visual center rather than their anchor.
Handle the component boundary box.
const wxPoint & GetEndPoint(ENDPOINT_T aEndPoint) const
Return the selected endpoint (start or end)
A base class for most all the KiCad significant classes used in schematics and boards.
virtual 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 void SwapData(BOARD_ITEM *aImage) override
Swap data between aItem and aImage.
int GetDrillValue() const
Function GetDrillValue "calculates" the drill value for vias (m-Drill if > 0, or default drill value ...
class PCB_VIA, a via (like a track segment on a copper layer)
virtual void Move(const wxPoint &aMoveVector) override
Move this object.
virtual void ViewGetLayers(int aLayers[], int &aCount) const override
Return the all the layers within the VIEW the object is painted on.
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.
EDA_MSG_PANEL items for displaying messages.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
bool IsNull() const
Function IsNull returns true if segment length is zero.
void SanitizeLayers()
Function SanitizeLayers Check so that the layers are correct dependin on the type of via,...
wxPoint m_Mid
Arc mid point, halfway between start and end.
const wxPoint & GetMid() const
bool m_isFree
"Free" vias don't get their nets auto-updated
bool IsOnCopperLayer() const override
void Rotate(const wxPoint &aRotCentre, double aAngle) override
Rotate this object.
const wxPoint & GetStart() const
KICAD_T Type() const
Returns the type of object.
wxString GetClass() const override
Return the class name.
PCB_VIA(BOARD_ITEM *aParent)
wxString layerMaskDescribe() const override
Return a string (to be shown to the user) describing a layer mask.