22 #ifndef __PNS_SEGMENT_H
23 #define __PNS_SEGMENT_H
25 #include <math/vector2d.h>
27 #include <geometry/seg.h>
28 #include <geometry/shape_segment.h>
29 #include <geometry/shape_line_chain.h>
38 class SEGMENT :
public ITEM
45 SEGMENT(
const SEG& aSeg,
int aNet ) :
46 ITEM( SEGMENT_T ), m_seg( aSeg, 0 )
51 SEGMENT(
const LINE& aParentLine,
const SEG& aSeg ) :
53 m_seg( aSeg, aParentLine.Width() )
55 m_net = aParentLine.Net();
56 m_layers = aParentLine.Layers();
57 m_marker = aParentLine.Marker();
58 m_rank = aParentLine.Rank();
61 static inline bool ClassOf(
const ITEM* aItem )
63 return aItem && SEGMENT_T == aItem->Kind();
70 return static_cast<const SHAPE*
>( &m_seg );
73 void SetLayer(
int aLayer )
83 void SetWidth(
int aWidth )
85 m_seg.SetWidth(aWidth);
90 return m_seg.GetWidth();
93 const SEG& Seg()
const
95 return m_seg.GetSeg();
105 m_seg.SetSeg(
SEG ( a, b ) );
110 SEG tmp = m_seg.GetSeg();
111 m_seg.SetSeg(
SEG (tmp.B , tmp.A ) );
114 const SHAPE_LINE_CHAIN Hull(
int aClearance,
int aWalkaroundThickness )
const override;
116 virtual VECTOR2I Anchor(
int n )
const override
119 return m_seg.GetSeg().A;
121 return m_seg.GetSeg().B;
124 virtual int AnchorCount()
const override