77 #define UNDEFINED_DRILL_DIAMETER -1 //< Undefined via drill diameter. 80 #define GEOMETRY_MIN_SIZE ( int )( 0.001 * IU_PER_MM ) 95 void Move(
const wxPoint& aMoveVector )
override 101 void Rotate(
const wxPoint& aRotCentre,
double aAngle )
override;
103 void Flip(
const wxPoint& aCentre,
bool aFlipLeftRight )
override;
160 bool ignoreLineWidth =
false )
const override;
187 bool HitTest(
const wxPoint& aPosition,
int aAccuracy = 0 )
const override;
188 bool HitTest(
const EDA_RECT& aRect,
bool aContained,
int aAccuracy = 0 )
const override;
199 return wxT(
"TRACK" );
218 virtual void ViewGetLayers(
int aLayers[],
int& aCount )
const override;
240 virtual void Show(
int nestLevel, std::ostream& os )
const override { ShowDummy( os ); }
247 static wxString ShowState(
int stateBits );
280 virtual void Move(
const wxPoint& aMoveVector )
override 283 m_Mid += aMoveVector;
284 m_End += aMoveVector;
287 virtual void Rotate(
const wxPoint& aRotCentre,
double aAngle )
override;
289 virtual void Flip(
const wxPoint& aCentre,
bool aFlipLeftRight )
override;
307 virtual bool HitTest(
const wxPoint& aPosition,
int aAccuracy = 0 )
const override;
309 virtual bool HitTest(
const EDA_RECT& aRect,
bool aContained =
true,
int aAccuracy = 0 )
const override;
329 double includedAngle = std::abs(
GetAngle() );
331 return radius * M_PI * includedAngle / 180.0;
360 for(
const KICAD_T* p = aScanTypes; *p !=
EOT; ++p )
416 bool HitTest(
const wxPoint& aPosition,
int aAccuracy = 0 )
const override;
417 bool HitTest(
const EDA_RECT& aRect,
bool aContained,
int aAccuracy = 0 )
const override;
430 void ViewGetLayers(
int aLayers[],
int& aCount )
const override;
434 void Flip(
const wxPoint& aCentre,
bool aFlipLeftRight )
override;
437 void Show(
int nestLevel, std::ostream& os )
const override { ShowDummy( os ); }
533 #endif // CLASS_TRACK_H virtual void Rotate(const wxPoint &aRotCentre, double aAngle) override
Rotate this object.
void GetWidthConstraints(int *aMin, int *aMax, wxString *aSource) const
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...
virtual wxPoint GetCenter() const override
This defaults to the center of the bounding box if not overridden.
void SetPosition(const wxPoint &aPos) override
wxPoint m_Start
Line start point.
void GetMsgPanelInfoBase_Common(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) const
double GetLineLength(const wxPoint &aPointA, const wxPoint &aPointB)
Return the length of a line segment defined by aPointA and aPointB.
void SwapData(BOARD_ITEM *aImage) override
Swap data between aItem and aImage.
bool m_isFree
"Free" vias don't get their nets auto-updated
PNG memory record (file in memory).
static bool ClassOf(const EDA_ITEM *aItem)
VIATYPE m_viaType
through, blind/buried or micro
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
bool IsOnCopperLayer() const override
wxString GetClass() const override
Return the class name.
void SetPosition(const wxPoint &aPoint) override
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
void SetEnd(const wxPoint &aEnd)
const wxPoint & GetStart() const
int m_drill
for vias: via drill (- 1 for default value)
bool IsDrillDefault() const
Function IsDrillDefault.
bool operator()(const TRACK *aFirst, const TRACK *aSecond) const
virtual void Flip(const wxPoint &aCentre, bool aFlipLeftRight) override
Flip this object, i.e.
virtual wxPoint GetPosition() const override
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is contained within or on the bounding box of an item.
virtual void Move(const wxPoint &aMoveVector) override
Move this object.
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
bool GetIsFree() const
Checks if the via is a free via (as opposed to one created on a track by the router).
void ViewGetLayers(int aLayers[], int &aCount) const override
Return the all the layers within the VIEW the object is painted on.
virtual EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
class ARC, an arc track segment on a copper layer
virtual double GetLength() const override
Function GetLength returns the length of the arc track.
void Move(const wxPoint &aMoveVector) override
Move this object.
double ViewGetLOD(int aLayer, KIGFX::VIEW *aView) const override
Return the level of detail (LOD) of the item.
The base class for create windows for drawing purpose.
void Rotate(const wxPoint &aRotCentre, double aAngle) override
Rotate this object.
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
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 TRACK, a track segment (segment on a copper layer)
int m_Width
Thickness of track, or via diameter.
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
void SetWidth(int aWidth)
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...
#define UNDEFINED_DRILL_DIAMETER
static bool ClassOf(const EDA_ITEM *aItem)
PCB_LAYER_ID
A quick note on layer IDs:
BITMAP_DEF GetMenuImage() const override
Return a pointer to an image to be used in menus.
int GetMinAnnulus(PCB_LAYER_ID aLayer, wxString *aSource) const
LSET is a set of PCB_LAYER_IDs.
const wxPoint & GetMid() const
int GetDrillValue() const
Function GetDrillValue "calculates" the drill value for vias (m-Drill if > 0, or default drill value ...
const wxPoint GetFocusPosition() const override
Similar to GetPosition, but allows items to return their visual center rather than their anchor.
Represent a set of closed polygons.
bool FlashLayer(int aLayer) const
Checks to see whether the via should have a pad on the specific layer.
int GetDrill() const
Function GetDrill returns the local drill setting for this VIA.
bool m_keepTopBottomLayer
Keep the top and bottom annular rings.
const VECTOR2I & GetP0() const
wxPoint m_End
Line end point.
void Flip(const wxPoint &aCentre, bool aFlipLeftRight) override
Flip this object, i.e.
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...
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
const VECTOR2I & GetArcMid() const
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...
bool ApproxCollinear(const SEG &aSeg) const
virtual bool IsType(const KICAD_T aScanTypes[]) const
Check whether the item is one of the listed types.
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.
double ViewGetLOD(int aLayer, KIGFX::VIEW *aView) const override
Return the level of detail (LOD) of the item.
const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
void SetMid(const wxPoint &aMid)
virtual void SwapData(BOARD_ITEM *aImage) override
Swap data between aItem and aImage.
void SetDrillDefault()
Function SetDrillDefault sets the drill value for vias to the default value UNDEFINED_DRILL_DIAMETER.
bool ApproxCollinear(const TRACK &aTrack)
virtual std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
void SetRemoveUnconnected(bool aSet)
Sets the unconnected removal property.
wxString layerMaskDescribe() const override
Return a string (to be shown to the user) describing a layer mask.
virtual void ViewGetLayers(int aLayers[], int &aCount) const override
Return the all the layers within the VIEW the object is painted on.
virtual void SetLayerSet(LSET aLayers) override
BITMAP_DEF GetMenuImage() const override
Return a pointer to an image to be used in menus.
wxString GetClass() const override
Return the class name.
STATUS_FLAGS IsPointOnEnds(const wxPoint &point, int min_dist=0) const
Function IsPointOnEnds returns STARTPOINT if point if near (dist = min_dist) start point,...
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
bool GetRemoveUnconnected() const
void SetTopLayer(PCB_LAYER_ID aLayer)
void SetPosition(const wxPoint &aPos) override
virtual std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
double GetArcAngleEnd() const
Handle the component boundary box.
void SetDrill(int aDrill)
Function SetDrill sets the drill value for vias.
void SetIsFree(bool aFree=true)
VIATYPE GetViaType() const
A base class for most all the KiCad significant classes used in schematics and boards.
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.
PCB_LAYER_ID TopLayer() const
const wxPoint & GetEnd() const
void SetBottomLayer(PCB_LAYER_ID aLayer)
virtual double GetLength() const
Function GetLength returns the length of the track using the hypotenuse calculation.
wxPoint GetPosition() const override
bool IsNull() const
Function IsNull returns true if segment length is zero.
virtual void SwapData(BOARD_ITEM *aImage) override
Swap data between aItem and aImage.
void SetStart(const wxPoint &aStart)
double GetArcAngleStart() const
class VIA, a via (like a track segment on a copper layer)
TRACK(BOARD_ITEM *aParent, KICAD_T idtype=PCB_TRACE_T)
std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Test to see if this object is on the given layer.
EDA_MSG_ITEM is used EDA_MSG_PANEL as the item type for displaying messages.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
ARC(BOARD_ITEM *aParent, const SHAPE_ARC *aArc)
void SanitizeLayers()
Function SanitizeLayers Check so that the layers are correct dependin on the type of via,...
void SetKeepTopBottom(bool aSet)
Sets whether we keep the top and bottom connections even if they are not connected.
wxPoint GetPosition() const 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.
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is contained within or on the bounding box of an item.
const wxPoint & GetEndPoint(ENDPOINT_T aEndPoint) const
Return the selected endpoint (start or end)
void SetViaType(VIATYPE aViaType)
PCB_LAYER_ID BottomLayer() const
void Flip(const wxPoint &aCentre, bool aFlipLeftRight) override
Flip this object, i.e.
wxPoint m_Mid
Arc mid point, halfway between start and end.
Definition of PCB_DISPLAY_OPTIONS class.
const VECTOR2I & GetP1() const
PCB_LAYER_ID m_bottomLayer
The bottom layer of the via (the top layer is in m_layer)
virtual bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is contained within or on the bounding box of an item.
bool m_removeUnconnectedLayer
Remove unconnected copper on a via.
bool IsType(const KICAD_T aScanTypes[]) const override
Check whether the item is one of the listed types.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
KICAD_T Type() const
Returns the type of object.
bool GetKeepTopBottom() const
int GetLocalClearance(wxString *aSource) const override
Function GetLocalClearance returns any local clearance overrides set in the "classic" (ie: pre-rule) ...
wxString GetClass() const override
Return the class name.