private void CalculateArrowPoints()
{
if (m_block != null)
{
switch (m_block.Orientation)
{
case TrackOrientation.EastWest:
if (m_block.AllowedDirection == TrackAllowedDirection.Both || m_block.AllowedDirection == TrackAllowedDirection.RightToLeft)
{
m_arrow1Start1 = m_arrow1Start2 = m_scaledStart;
m_arrow1End1 = new Point(m_scaledStart.X + ArrowLength, m_scaledStart.Y - ArrowLength);
m_arrow1End2 = new Point(m_scaledStart.X + ArrowLength, m_scaledStart.Y + ArrowLength);
}
if (m_block.AllowedDirection == TrackAllowedDirection.Both || m_block.AllowedDirection == TrackAllowedDirection.LeftToRight)
{
m_arrow2Start1 = m_arrow2Start2 = m_scaledEnd;
m_arrow2End1 = new Point(m_scaledEnd.X - ArrowLength, m_scaledEnd.Y - ArrowLength);
m_arrow2End2 = new Point(m_scaledEnd.X - ArrowLength, m_scaledEnd.Y + ArrowLength);
}
break;
case TrackOrientation.NorthSouth:
if (m_block.AllowedDirection == TrackAllowedDirection.Both || m_block.AllowedDirection == TrackAllowedDirection.RightToLeft)
{
m_arrow2Start1 = m_arrow2Start2 = m_scaledStart;
m_arrow2End1 = new Point(m_scaledStart.X - ArrowLength, m_scaledStart.Y - ArrowLength);
m_arrow2End2 = new Point(m_scaledStart.X + ArrowLength, m_scaledStart.Y - ArrowLength);
}
if (m_block.AllowedDirection == TrackAllowedDirection.Both || m_block.AllowedDirection == TrackAllowedDirection.LeftToRight)
{
m_arrow1Start1 = m_arrow1Start2 = m_scaledEnd;
m_arrow1End1 = new Point(m_scaledEnd.X - ArrowLength, m_scaledEnd.Y + ArrowLength);
m_arrow1End2 = new Point(m_scaledEnd.X + ArrowLength, m_scaledEnd.Y + ArrowLength);
}
break;
case TrackOrientation.NorthWestSouthEast:
if (m_block.AllowedDirection == TrackAllowedDirection.Both || m_block.AllowedDirection == TrackAllowedDirection.RightToLeft)
{
m_arrow1Start1 = m_arrow1Start2 = m_scaledStart;
m_arrow1End1 = new Point(m_scaledStart.X, m_scaledStart.Y + ArrowLength);
m_arrow1End2 = new Point(m_scaledStart.X + ArrowLength, m_scaledStart.Y);
}
if (m_block.AllowedDirection == TrackAllowedDirection.Both || m_block.AllowedDirection == TrackAllowedDirection.LeftToRight)
{
m_arrow2Start1 = m_arrow2Start2 = m_scaledEnd;
m_arrow2End1 = new Point(m_scaledEnd.X, m_scaledEnd.Y - ArrowLength);
m_arrow2End2 = new Point(m_scaledEnd.X - ArrowLength, m_scaledEnd.Y);
}
break;
case TrackOrientation.SouthWestNorthEast:
if (m_block.AllowedDirection == TrackAllowedDirection.Both || m_block.AllowedDirection == TrackAllowedDirection.RightToLeft)
{
m_arrow1Start1 = m_arrow1Start2 = m_scaledStart;
m_arrow1End1 = new Point(m_scaledStart.X, m_scaledStart.Y - ArrowLength);
m_arrow1End2 = new Point(m_scaledStart.X + ArrowLength, m_scaledStart.Y);
}
if (m_block.AllowedDirection == TrackAllowedDirection.Both || m_block.AllowedDirection == TrackAllowedDirection.LeftToRight)
{
m_arrow2Start1 = m_arrow2Start2 = m_scaledEnd;
m_arrow2End1 = new Point(m_scaledEnd.X - ArrowLength, m_scaledEnd.Y);
m_arrow2End2 = new Point(m_scaledEnd.X, m_scaledEnd.Y + ArrowLength);
}
break;
default:
//Unreachable
break;
}
}
}