25#include <geometry/shape_line_chain.h>
26#include <geometry/shape_circle.h>
56 m_viaType = VIATYPE::THROUGH;
62 int aNet = -1, VIATYPE aViaType = VIATYPE::THROUGH ) :
68 m_diameter = aDiameter;
81 SetLayers( aB.Layers() );
83 m_diameter = aB.m_diameter;
86 m_marker = aB.m_marker;
89 m_viaType = aB.m_viaType;
90 m_isFree = aB.m_isFree;
91 m_isVirtual = aB.m_isVirtual;
94 static inline bool ClassOf(
const ITEM* aItem )
96 return aItem && VIA_T == aItem->
Kind();
99 const VECTOR2I& Pos()
const {
return m_pos; }
104 m_shape.SetCenter( aPos );
105 m_hole.SetCenter( aPos );
108 VIATYPE ViaType()
const {
return m_viaType; }
109 void SetViaType( VIATYPE aViaType ) { m_viaType = aViaType; }
111 int Diameter()
const {
return m_diameter; }
113 void SetDiameter(
int aDiameter )
115 m_diameter = aDiameter;
116 m_shape.SetRadius( m_diameter / 2 );
119 int Drill()
const {
return m_drill; }
121 void SetDrill(
int aDrill )
124 m_hole.SetRadius( m_drill / 2 );
127 bool IsFree()
const {
return m_isFree; }
128 void SetIsFree(
bool aIsFree ) { m_isFree = aIsFree; }
131 bool aSolidsOnly =
true,
int aMaxIterations = 10 );
135 const SHAPE_CIRCLE* Hole()
const override {
return &m_hole; }
136 void SetHole(
const SHAPE_CIRCLE& aHole ) { m_hole = aHole; }
138 VIA*
Clone()
const override;
140 const SHAPE_LINE_CHAIN Hull(
int aClearance = 0,
int aWalkaroundThickness = 0,
141 int aLayer = -1 )
const override;
143 virtual VECTOR2I Anchor(
int n )
const override
148 virtual int AnchorCount()
const override
153 OPT_BOX2I ChangedArea(
const VIA* aOther )
const;
155 const VIA_HANDLE MakeHandle()
const;
172 VVIA(
const VECTOR2I& aPos,
int aLayer,
int aDiameter,
int aNet ) :
173 VIA( aPos,
LAYER_RANGE( aLayer, aLayer ), aDiameter, aDiameter / 2, aNet )
Represent a contiguous set of PCB layers.
Definition: pns_layerset.h:32
Base class for PNS router board items.
Definition: pns_item.h:57
PnsKind Kind() const
Return the type (kind) of the item.
Definition: pns_item.h:131
Keep the router "world" - i.e.
Definition: pns_node.h:148
const SHAPE * Shape() const override
Return the geometrical shape of the item.
Definition: pns_via.h:133
VIA * Clone() const override
Return a deep copy of the item.
Definition: pns_via.cpp:89
Definition: pns_via.h:170
Definition: shape_circle.h:37
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
Definition: shape_line_chain.h:81
An abstract shape on 2D plane.
Definition: shape.h:117