MCPcopy Create free account
hub / github.com/CruiserOne/Astrolog / XChartDispositor

Function XChartDispositor

xcharts1.cpp:3155–3320  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3153// position, and the planets may be arranged in a hierarchy or a wheel format.
3154
3155void XChartDispositor()
3156{
3157 int oDis[oNorm1], dLev[oNorm1], cLev[oNorm1], xo[oNorm1], yo[oNorm1],
3158 obj[oNorm1];
3159 real xCirc[oNorm1], yCirc[oNorm1];
3160 char sz[cchSzDef];
3161 int *rgRules, oNum, xLev, yLev, xSub, ySub, cx0, cy0, cx, cy, i, j, k;
3162
3163 // Determine rulership and object sets to use.
3164
3165 rgRules = RgRules();
3166 oNum = 0;
3167 for (i = 0; i <= oNorm; i++)
3168 if ((FThing(i) || gs.fAlt) && (!FIgnore(i) || (rgRules == rules ?
3169 FBetween(i, oSun, oMain) : (FBetween(i, oEar, oMain) || i == oVul))))
3170 obj[++oNum] = i;
3171
3172 // Set up screen positions of the 10 planets for the wheel graphs.
3173
3174 cx0 = gs.xWin >> 1; cy0 = gs.yWin >> 1;
3175 for (i = 1; i <= oNum; i++) {
3176 j = (gs.fHouseExtra ? 270 : 180) - (i-1)*(us.fIndian ? -360 : 360)/oNum;
3177 xCirc[i] = (real)cx0*0.4*RCosD((real)j);
3178 yCirc[i] = (real)cy0*0.4*RSinD((real)j);
3179 }
3180
3181 // Loop over the two basic dispositor types: sign based and house based.
3182
3183 for (xSub = 0; xSub <= 1; xSub++) {
3184 cx = xSub * cx0 + (cx0 >> 1);
3185
3186 // For each planet, get its dispositor planet for current graph type.
3187 for (i = 1; i <= oNum; i++) {
3188 k = obj[i];
3189 j = rgRules[xSub ? inhouse[k] : SFromZ(planet[k])];
3190 for (k = 1; k <= oNum; k++)
3191 if (obj[k] == j)
3192 break;
3193 if (k > oNum)
3194 k = 1;
3195 oDis[i] = k;
3196 dLev[i] = 1;
3197 }
3198
3199 // Determine the final dispositors (including mutual reception loops).
3200 do {
3201 j = fFalse;
3202 for (i = 1; i <= oNum; i++)
3203 cLev[i] = fFalse;
3204 for (i = 1; i <= oNum; i++)
3205 if (dLev[i])
3206 cLev[oDis[i]] = fTrue;
3207 for (i = 1; i <= oNum; i++) // A planet isn't a final dispositor if
3208 if (dLev[i] && !cLev[i]) { // nobody is pointing to it.
3209 dLev[i] = 0;
3210 j = fTrue;
3211 }
3212 } while (j);

Callers 1

DrawChartXFunction · 0.85

Calls 4

DrawColorFunction · 0.85
DrawSzFunction · 0.85
DrawObjectFunction · 0.85
DrawArrowFunction · 0.85

Tested by

no test coverage detected