Add other (open) shapes to GetLength() calculation.
Since this is for trace length/propagation time, I'm not sure what it would mean on a closed shape, so I left RECT and CIRCLE for now.
This commit is contained in:
parent
80846dcbc7
commit
9878a1e10c
|
@ -89,6 +89,16 @@ double DRAWSEGMENT::GetLength() const
|
|||
length = GetLineLength( GetStart(), GetEnd() );
|
||||
break;
|
||||
|
||||
case S_POLYGON:
|
||||
for( int ii = 0; ii < m_Poly.COutline( 0 ).SegmentCount(); ii++ )
|
||||
length += m_Poly.COutline( 0 ).CSegment( ii ).Length();
|
||||
|
||||
break;
|
||||
|
||||
case S_ARC:
|
||||
length = 2 * M_PI * GetRadius() * ( GetAngle() / 3600.0 );
|
||||
break;
|
||||
|
||||
default:
|
||||
wxASSERT_MSG( false, "DRAWSEGMENT::GetLength not implemented for shape"
|
||||
+ ShowShape( GetShape() ) );
|
||||
|
|
Loading…
Reference in New Issue