Changeset 299 for trunk/Utilities/DirectionControl/MainDialog.h
 Timestamp:
 Jun 28, 2014, 9:27:57 AM (9 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/Utilities/DirectionControl/MainDialog.h
r294 r299 122 122 CPoint Value; 123 123 const DOUBLE S = sin(fAngle), C = cos(fAngle); 124 Value.x = (LONG) Round(fX * C + fY * S); 125 Value.y = (LONG) Round(fX * S  fY * C); 124 // NOTE: Clockwise from Right 125 Value.x = (LONG) Round(+ fX * C + fY * S); 126 Value.y = (LONG) Round( fX * S + fY * C); 126 127 Value.Offset(m_CenterPosition); 127 128 return Value; … … 138 139 return; 139 140 m_nToleranceArrowSize = m_nArrowSize * 3 / 4; 140 m_ArrowHandlePosition = Transform( 0, m_nArrowSize  6, m_fAngle);141 m_ToleranceArrowHandlePositionA = Transform( 0, m_nToleranceArrowSize  6, m_fAngle  m_fToleranceAngle / 2);142 m_ToleranceArrowHandlePositionB = Transform( 0, m_nToleranceArrowSize  6, m_fAngle + m_fToleranceAngle / 2);141 m_ArrowHandlePosition = Transform(m_nArrowSize  6, 0, m_fAngle); 142 m_ToleranceArrowHandlePositionA = Transform(m_nToleranceArrowSize  6, 0, m_fAngle  m_fToleranceAngle / 2); 143 m_ToleranceArrowHandlePositionB = Transform(m_nToleranceArrowSize  6, 0, m_fAngle + m_fToleranceAngle / 2); 143 144 } 144 145 VOID EraseBackground(CDCHandle Dc) … … 168 169 { 169 170 Dc.MoveTo(m_CenterPosition.x, m_CenterPosition.y); 170 Dc.AngleArc(m_CenterPosition.x, m_CenterPosition.y, 2 * m_nToleranceArrowSize / 3, 90.f  (FLOAT) ((m_fAngle  m_fToleranceAngle / 2) * 180 / M_PI), (FLOAT) (m_fToleranceAngle * 180 / M_PI));171 Dc.AngleArc(m_CenterPosition.x, m_CenterPosition.y, 2 * m_nToleranceArrowSize / 3, (FLOAT) ((m_fAngle  m_fToleranceAngle / 2) * 180 / M_PI), (FLOAT) (m_fToleranceAngle * 180 / M_PI)); 171 172 static const LONG A = 3; 172 173 static const LONG B = 7; … … 176 177 const DOUBLE fAngle = m_fAngle  m_fToleranceAngle / 2; 177 178 POINT pArrowPoints[] = { 178 Transform( A, 0, fAngle),179 Transform( A, m_nToleranceArrowSize  C, fAngle),180 Transform( B, m_nToleranceArrowSize  D, fAngle),181 Transform( 0, m_nToleranceArrowSize,fAngle),182 Transform( +B, m_nToleranceArrowSize  D, fAngle),183 Transform( +A, m_nToleranceArrowSize  C, fAngle),184 Transform( +A, 0, fAngle),179 Transform( 0, A, fAngle), 180 Transform(m_nToleranceArrowSize  C, A, fAngle), 181 Transform(m_nToleranceArrowSize  D, B, fAngle), 182 Transform(m_nToleranceArrowSize, 0, fAngle), 183 Transform(m_nToleranceArrowSize  D, +B, fAngle), 184 Transform(m_nToleranceArrowSize  C, +A, fAngle), 185 Transform( 0, +A, fAngle), 185 186 }; 186 187 Dc.Polygon(pArrowPoints, DIM(pArrowPoints)); … … 189 190 const DOUBLE fAngle = m_fAngle + m_fToleranceAngle / 2; 190 191 POINT pArrowPoints[] = { 191 Transform( A, 0, fAngle),192 Transform( A, m_nToleranceArrowSize  C, fAngle),193 Transform( B, m_nToleranceArrowSize  D, fAngle),194 Transform( 0, m_nToleranceArrowSize,fAngle),195 Transform( +B, m_nToleranceArrowSize  D, fAngle),196 Transform( +A, m_nToleranceArrowSize  C, fAngle),197 Transform( +A, 0, fAngle),192 Transform( 0, A, fAngle), 193 Transform(m_nToleranceArrowSize  C, A, fAngle), 194 Transform(m_nToleranceArrowSize  D, B, fAngle), 195 Transform(m_nToleranceArrowSize, 0, fAngle), 196 Transform(m_nToleranceArrowSize  D, +B, fAngle), 197 Transform(m_nToleranceArrowSize  C, +A, fAngle), 198 Transform( 0, +A, fAngle), 198 199 }; 199 200 Dc.Polygon(pArrowPoints, DIM(pArrowPoints)); … … 209 210 static const LONG D = 14; 210 211 POINT pArrowPoints[] = { 211 Transform( A, 0, m_fAngle),212 Transform( A, m_nArrowSize  C, m_fAngle),213 Transform( B, m_nArrowSize  D, m_fAngle),214 Transform( 0, m_nArrowSize,m_fAngle),215 Transform( +B, m_nArrowSize  D, m_fAngle),216 Transform( +A, m_nArrowSize  C, m_fAngle),217 Transform( +A, 0, m_fAngle),212 Transform( 0, A, m_fAngle), 213 Transform(m_nArrowSize  C, A, m_fAngle), 214 Transform(m_nArrowSize  D, B, m_fAngle), 215 Transform(m_nArrowSize, 0, m_fAngle), 216 Transform(m_nArrowSize  D, +B, m_fAngle), 217 Transform(m_nArrowSize  C, +A, m_fAngle), 218 Transform( 0, +A, m_fAngle), 218 219 }; 219 220 Dc.Polygon(pArrowPoints, DIM(pArrowPoints)); … … 387 388 { 388 389 CPoint AlignPosition = Position  m_DragRelativeButtonDownPosition; 389 const DOUBLE fAngle = atan2( (DOUBLE) (Position.y  m_CenterPosition.y), (DOUBLE) (Position.x  m_CenterPosition.x)) + M_PI / 2;390 const DOUBLE fAngle = atan2( (DOUBLE) (Position.y  m_CenterPosition.y), (DOUBLE) (Position.x  m_CenterPosition.x)); 390 391 m_fAngle = fAngle; 391 392 m_nVersion++; … … 395 396 { 396 397 CPoint AlignPosition = Position  m_DragRelativeButtonDownPosition; 397 const DOUBLE fAngle = atan2( (DOUBLE) (Position.y  m_CenterPosition.y), (DOUBLE) (Position.x  m_CenterPosition.x)) + M_PI / 2;398 const DOUBLE fAngle = atan2( (DOUBLE) (Position.y  m_CenterPosition.y), (DOUBLE) (Position.x  m_CenterPosition.x)); 398 399 DOUBLE fToleranceAngle = abs(fAngle  m_fAngle); 399 400 if(fToleranceAngle > M_PI) … … 407 408 { 408 409 CPoint AlignPosition = Position  m_DragRelativeButtonDownPosition; 409 const DOUBLE fAngle = atan2( (DOUBLE) (Position.y  m_CenterPosition.y), (DOUBLE) (Position.x  m_CenterPosition.x)) + M_PI / 2;410 const DOUBLE fAngle = atan2( (DOUBLE) (Position.y  m_CenterPosition.y), (DOUBLE) (Position.x  m_CenterPosition.x)); 410 411 DOUBLE fToleranceAngle = abs(fAngle  m_fAngle); 411 412 if(fToleranceAngle > M_PI)
Note: See TracChangeset
for help on using the changeset viewer.