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

Function XChartGrid

xcharts1.cpp:519–601  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

517// else only the first number of unrestricted objects will be included.
518
519void XChartGrid(int x0, int y0)
520{
521 char sz[cchSzDef];
522 int nScale, unit, siz, x, y, i, j, k, i0, j0, ig, jg;
523 KI c;
524
525 nScale = gi.nScale/gi.nScaleT;
526 unit = CELLSIZE*gi.nScale; siz = gi.nGridCell*unit;
527 i = us.fSmartCusp; us.fSmartCusp = fFalse;
528 j = us.objRequire; us.objRequire = -1;
529 if (!FCreateGrid(gs.fAlt))
530 return;
531 us.fSmartCusp = i; us.objRequire = j;
532 DrawColor(gi.kiGray);
533 DrawDash(x0, y0, x0 + siz, y0, !gs.fColor);
534 DrawDash(x0, y0, x0, y0 + siz, !gs.fColor);
535
536 // Loop through each cell in each row and column of grid.
537
538 for (y = 1, j0 = -1; y <= gi.nGridCell; y++) {
539 do {
540 j0++;
541 j = rgobjList[j0];
542 } while (!FProper(j) && j0 <= is.nObj);
543 DrawColor(gi.kiGray);
544 DrawDash(x0, y0 + y*unit, x0 + siz, y0 + y*unit, !gs.fColor);
545 DrawDash(x0 + y*unit, y0, x0 + y*unit, y0 + siz, !gs.fColor);
546 if (j0 <= is.nObj) for (x = 1, i0 = -1; x <= gi.nGridCell; x++) {
547 do {
548 i0++;
549 i = rgobjList[i0];
550 } while (!FProper(i) && i0 <= is.nObj);
551 ig = i; jg = j;
552 if ((i > j) != (i0 > j0))
553 SwapN(ig, jg);
554 if (i0 <= is.nObj) {
555 gi.xTurtle = x*unit-unit/2;
556 gi.yTurtle = y*unit-unit/2 - (nScale > 2 ? 5*gi.nScaleT : 0);
557 k = grid->n[ig][jg];
558
559 // If this is an aspect cell, draw glyph of aspect in effect.
560 if (gs.fAlt ? x > y : x < y) {
561 if (k) {
562 DrawColor(c = kAspB[k]);
563 DrawAspect2(k, x0 + gi.xTurtle, y0 + gi.yTurtle, ig, jg);
564 }
565
566 // If this is a midpoint cell, draw glyph of sign of midpoint.
567 } else if (gs.fAlt ? x < y : x > y) {
568 DrawColor(c = kSignB(grid->n[ig][jg]));
569 DrawSign(grid->n[ig][jg], x0 + gi.xTurtle, y0 + gi.yTurtle);
570
571 // For cells on main diagonal, draw glyph of planet.
572 } else {
573 if (gs.fLabelAsp) {
574 DrawColor(kDkBlueB);
575 DrawBlock(x0 + (x-1)*unit+1, y0 + (y-1)*unit+1,
576 x0 + x*unit-1, y0 + y*unit-1);

Callers 2

DrawChartXFunction · 0.85
XChartIndianFunction · 0.85

Calls 9

FCreateGridFunction · 0.85
DrawColorFunction · 0.85
DrawDashFunction · 0.85
FProperFunction · 0.85
DrawSignFunction · 0.85
DrawBlockFunction · 0.85
DrawObjectFunction · 0.85
FormatGridCellFunction · 0.85
DrawSzFunction · 0.85

Tested by

no test coverage detected