1995 | | if (l >= 0) { |
1996 | | Vector3 p = pt_v - right * l; |
1997 | | double X = p.GetX() * COS - p.GetY() * SIN; |
1998 | | double Y = (p.GetX() * SIN + p.GetY() * COS); |
1999 | | long x = (long)((X * Sc + m_layout->xOrg) * m_layout->scX); |
2000 | | long y = (long)((Y * Sc + m_layout->yOrg) * m_layout->scY); |
2001 | | MoveTo(x - PWX_CROSS_SIZE, y - PWX_CROSS_SIZE); |
2002 | | DrawTo(x, y); |
2003 | | DrawTo(x - PWX_CROSS_SIZE, y + PWX_CROSS_SIZE); |
2004 | | } |
2005 | | if (r >= 0) { |
2006 | | Vector3 p = pt_v + right * r; |
2007 | | double X = p.GetX() * COS - p.GetY() * SIN; |
2008 | | double Y = (p.GetX() * SIN + p.GetY() * COS); |
2009 | | long x = (long)((X * Sc + m_layout->xOrg) * m_layout->scX); |
2010 | | long y = (long)((Y * Sc + m_layout->yOrg) * m_layout->scY); |
2011 | | MoveTo(x + PWX_CROSS_SIZE, y - PWX_CROSS_SIZE); |
2012 | | DrawTo(x, y); |
2013 | | DrawTo(x + PWX_CROSS_SIZE, y + PWX_CROSS_SIZE); |
| 1995 | if (l >= 0 || r >= 0) { |
| 1996 | |
| 1997 | // Get the x and y coordinates of the survey station |
| 1998 | double pt_X = pt_v.GetX() * COS - pt_v.GetY() * SIN; |
| 1999 | double pt_Y = pt_v.GetX() * SIN + pt_v.GetY() * COS; |
| 2000 | long pt_x = (long)((pt_X * Sc + m_layout->xOrg) * m_layout->scX); |
| 2001 | long pt_y = (long)((pt_Y * Sc + m_layout->yOrg) * m_layout->scY); |
| 2002 | |
| 2003 | // Calculate dimensions for the right arrow |
| 2004 | double COSR = right.GetX(); |
| 2005 | double SINR = right.GetY(); |
| 2006 | long CROSS_MAJOR = (COSR + SINR) * PWX_CROSS_SIZE; |
| 2007 | long CROSS_MINOR = (COSR - SINR) * PWX_CROSS_SIZE; |
| 2008 | |
| 2009 | // Set fraction for arrow stem |
| 2010 | double frac = 0.5; |
| 2011 | |
| 2012 | if (l >= 0) { |
| 2013 | |
| 2014 | // Get the x and y coordinates of the end of the left arrow |
| 2015 | Vector3 p = pt_v - right * l; |
| 2016 | double X = p.GetX() * COS - p.GetY() * SIN; |
| 2017 | double Y = (p.GetX() * SIN + p.GetY() * COS); |
| 2018 | long x = (long)((X * Sc + m_layout->xOrg) * m_layout->scX); |
| 2019 | long y = (long)((Y * Sc + m_layout->yOrg) * m_layout->scY); |
| 2020 | |
| 2021 | // Draw the arrow stem from partway |
| 2022 | MoveTo(frac*x + (1-frac)*pt_x, frac*y + (1-frac)*pt_y); |
| 2023 | DrawTo(x, y); |
| 2024 | |
| 2025 | // Rotate the arrow by the page rotation |
| 2026 | long dx1 = (+CROSS_MINOR) * COS - (+CROSS_MAJOR) * SIN; |
| 2027 | long dy1 = (+CROSS_MINOR) * SIN + (+CROSS_MAJOR) * COS; |
| 2028 | long dx2 = (+CROSS_MAJOR) * COS - (-CROSS_MINOR) * SIN; |
| 2029 | long dy2 = (+CROSS_MAJOR) * SIN + (-CROSS_MINOR) * COS; |
| 2030 | |
| 2031 | // Draw the arrow |
| 2032 | MoveTo(x + dx1, y + dy1); |
| 2033 | DrawTo(x , y); |
| 2034 | DrawTo(x + dx2, y + dy2); |
| 2035 | } |
| 2036 | |
| 2037 | if (r >= 0) { |
| 2038 | |
| 2039 | // Get the x and y coordinates of the end of the right arrow |
| 2040 | Vector3 p = pt_v + right * r; |
| 2041 | double X = p.GetX() * COS - p.GetY() * SIN; |
| 2042 | double Y = (p.GetX() * SIN + p.GetY() * COS); |
| 2043 | long x = (long)((X * Sc + m_layout->xOrg) * m_layout->scX); |
| 2044 | long y = (long)((Y * Sc + m_layout->yOrg) * m_layout->scY); |
| 2045 | |
| 2046 | // Draw the arrow stem from partway |
| 2047 | MoveTo(frac*x + (1-frac)*pt_x, frac*y + (1-frac)*pt_y); |
| 2048 | DrawTo(x, y); |
| 2049 | |
| 2050 | // Rotate the arrow by the page rotation |
| 2051 | long dx1 = (-CROSS_MINOR) * COS - (-CROSS_MAJOR) * SIN; |
| 2052 | long dy1 = (-CROSS_MINOR) * SIN + (-CROSS_MAJOR) * COS; |
| 2053 | long dx2 = (-CROSS_MAJOR) * COS - (+CROSS_MINOR) * SIN; |
| 2054 | long dy2 = (-CROSS_MAJOR) * SIN + (+CROSS_MINOR) * COS; |
| 2055 | |
| 2056 | // Draw the arrow |
| 2057 | MoveTo(x + dx1, y + dy1); |
| 2058 | DrawTo(x , y); |
| 2059 | DrawTo(x + dx2, y + dy2); |
| 2060 | } |
| 2061 | |