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>
32#include "pns_linked_item.h"
54 m_seg( aSeg, aParentLine.
Width() )
56 m_net = aParentLine.Net();
57 m_layers = aParentLine.Layers();
58 m_marker = aParentLine.Marker();
59 m_rank = aParentLine.Rank();
62 static inline bool ClassOf(
const ITEM* aItem )
64 return aItem && SEGMENT_T == aItem->
Kind();
71 return static_cast<const SHAPE*
>( &m_seg );
74 void SetWidth(
int aWidth )
override
76 m_seg.SetWidth(aWidth);
79 int Width()
const override
81 return m_seg.GetWidth();
84 const SEG& Seg()
const
86 return m_seg.GetSeg();
96 m_seg.SetSeg(
SEG ( a, b ) );
101 SEG tmp = m_seg.GetSeg();
102 m_seg.SetSeg(
SEG (tmp.B , tmp.A ) );
105 const SHAPE_LINE_CHAIN Hull(
int aClearance,
int aWalkaroundThickness,
int aLayer = -1 )
const override;
107 virtual VECTOR2I Anchor(
int n )
const override
110 return m_seg.GetSeg().A;
112 return m_seg.GetSeg().B;
115 virtual int AnchorCount()
const override
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
Represents a track on a PCB, connecting two non-trivial joints (that is, vias, pads,...
Definition pns_line.h:61
int Width() const
Return true if the line is geometrically identical as line aOther.
Definition pns_line.h:156
Definition pns_linked_item.h:30
Definition pns_segment.h:39
SEGMENT * Clone() const override
Return a deep copy of the item.
Definition pns_line.cpp:121
const SHAPE * Shape() const override
Return the geometrical shape of the item.
Definition pns_segment.h:69
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
Definition shape_segment.h:36
An abstract shape on 2D plane.
Definition shape.h:117