25 #ifndef __SHAPE_SEGMENT_H
26 #define __SHAPE_SEGMENT_H
28 #include <geometry/shape.h>
29 #include <geometry/seg.h>
35 SHAPE( SH_SEGMENT ), m_width( 0 ) {};
38 SHAPE( SH_SEGMENT ), m_seg( aA, aB ), m_width( aWidth ) {};
41 SHAPE( SH_SEGMENT ), m_seg( aSeg ), m_width( aWidth ) {};
50 const BOX2I BBox(
int aClearance = 0 )
const override
52 return BOX2I( m_seg.A, m_seg.B - m_seg.A ).
Inflate( aClearance + ( m_width + 1 ) / 2 );
55 bool Collide(
const SEG& aSeg,
int aClearance = 0 )
const override
57 return m_seg.
Distance( aSeg ) < ( m_width + 1 ) / 2 + aClearance;
62 return m_seg.
Distance( aP ) < ( m_width + 1 ) / 2 + aClearance;
65 void SetSeg(
const SEG& aSeg )
70 const SEG& GetSeg()
const
75 void SetWidth(
int aWidth )
85 bool IsSolid()
const override
90 void Move(
const VECTOR2I& aVector )
override