| 1188 | // Draw an aspect line between two points in a wheel chart. |
| 1189 | |
| 1190 | void DrawAspectLine(int obj1, int obj2, int cx, int cy, |
| 1191 | real deg1, real deg2, real rx, real ry, real rz, flag fEclipse) |
| 1192 | { |
| 1193 | int asp = grid->n[obj1][obj2], orb = (int)(grid->v[obj1][obj2]*3600.0), |
| 1194 | x1, y1, x2, y2, nDash, nSav, col; |
| 1195 | |
| 1196 | // Get color of aspect. Modify it through AstroExpression if one defined. |
| 1197 | col = kAspB[asp]; |
| 1198 | #ifdef EXPRESS |
| 1199 | if (!us.fExpOff && FSzSet(us.szExpColAsp)) { |
| 1200 | ExpSetN(iLetterW, obj1); |
| 1201 | ExpSetN(iLetterX, asp); |
| 1202 | ExpSetN(iLetterY, obj2); |
| 1203 | ExpSetN(iLetterZ, col); |
| 1204 | ParseExpression(us.szExpColAsp); |
| 1205 | col = NExpGet(iLetterZ); |
| 1206 | if (!FValidColorA(col)) |
| 1207 | col = kBlack; |
| 1208 | } |
| 1209 | #endif |
| 1210 | DrawColor(col); |
| 1211 | |
| 1212 | // Compute coordinates of line, and draw it. |
| 1213 | x1 = cx + POINT1(rx, rz, PX(deg1)); |
| 1214 | y1 = cy + POINT1(ry, rz, PY(deg1)); |
| 1215 | x2 = cx + POINT1(rx, rz, PX(deg2)); |
| 1216 | y2 = cy + POINT1(ry, rz, PY(deg2)); |
| 1217 | if ((gs.nDashMax >= 0) != gs.fAlt) { |
| 1218 | nDash = NAbs(orb) / (60*60*2); |
| 1219 | nDash = Min(nDash, NAbs(gs.nDashMax)); |
| 1220 | } else |
| 1221 | nDash = NAbs(orb) * NAbs(gs.nDashMax) / |
| 1222 | (int)(GetOrb(obj1, obj2, asp)*3600.0); |
| 1223 | DrawDash(x1, y1, x2, y2, nDash); |
| 1224 | |
| 1225 | // Draw aspect glyph over middle of line. |
| 1226 | if (gs.fLabelAsp) { |
| 1227 | nSav = gi.nScale; |
| 1228 | gi.nScale = gi.nScaleTextT; |
| 1229 | if (!fEclipse) |
| 1230 | DrawAspect(asp, (x1 + x2) >> 1, (y1 + y2) >> 1); |
| 1231 | else |
| 1232 | DrawAspect2(asp, (x1 + x2) >> 1, (y1 + y2) >> 1, obj1, obj2); |
| 1233 | gi.nScale = nSav; |
| 1234 | } |
| 1235 | } |
| 1236 | |
| 1237 | |
| 1238 | /* |
no test coverage detected