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

Function XChartGridRelation

xcharts2.cpp:739–833  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

737// the text version, the chart has a (definable) fixed number of cells.
738
739void XChartGridRelation()
740{
741 char sz[cchSzDef], szT[cchSzDef];
742 int nScale, unit, siz, x, y, i, j, i0, j0, k;
743 KI c;
744
745 nScale = gi.nScale/gi.nScaleT;
746 unit = CELLSIZE*gi.nScale; siz = (gi.nGridCell+1)*unit;
747 *szT = chNull;
748 i = us.fSmartCusp; us.fSmartCusp = fFalse;
749 j = us.objRequire; us.objRequire = -1;
750 if (!FCreateGridRelation(gs.fAlt != us.fGridMidpoint))
751 return;
752 us.fSmartCusp = i; us.objRequire = j;
753
754 // Loop through each cell in each row and column of grid.
755
756 for (y = 0, j0 = -2; y <= gi.nGridCell; y++) {
757 do {
758 j0++;
759 j = rgobjList[j0];
760 } while (j0 >= 0 && ignore[j] && j0 <= is.nObj);
761 DrawColor(gi.kiGray);
762 DrawDash(0, (y+1)*unit, siz, (y+1)*unit, !gs.fColor);
763 DrawDash((y+1)*unit, 0, (y+1)*unit, siz, !gs.fColor);
764 DrawColor(gi.kiLite);
765 DrawEdge(0, y*unit, unit, (y+1)*unit);
766 DrawEdge(y*unit, 0, (y+1)*unit, unit);
767 DrawEdge(y*unit, y*unit, (y+1)*unit, (y+1)*unit);
768 if (j0 <= is.nObj) for (x = 0, i0 = -2; x <= gi.nGridCell; x++) {
769 do {
770 i0++;
771 i = rgobjList[i0];
772 } while (i0 >= 0 && ignore[i] && i0 <= is.nObj);
773
774 // Again, are looping through each cell in each row and column.
775
776 if (i0 <= is.nObj) {
777 gi.xTurtle = x*unit+unit/2;
778 gi.yTurtle = y*unit+unit/2 - (nScale > 2 ? 5*gi.nScaleT : 0);
779 k = (i >= 0 && j >= 0 ? grid->n[i][j] : 0);
780
781 // If current cell is on top row or left hand column, draw glyph of
782 // planet owning the particular row or column in question.
783
784 if (y == 0 || x == 0) {
785 if (gs.fLabelAsp) {
786 DrawColor(kDkBlueB);
787 DrawBlock(x*unit+1, y*unit+1, (x+1)*unit-1, (y+1)*unit-1);
788 }
789 if (x+y > 0)
790 DrawObject(y == 0 ? i : j, gi.xTurtle, gi.yTurtle);
791 } else {
792
793 // Otherwise, draw glyph of aspect in effect, or glyph of sign of
794 // midpoint, between the two planets in question.
795
796 if (gs.fAlt == us.fGridMidpoint) {

Callers 1

DrawChartXFunction · 0.85

Calls 9

FCreateGridRelationFunction · 0.85
DrawColorFunction · 0.85
DrawDashFunction · 0.85
DrawBlockFunction · 0.85
DrawObjectFunction · 0.85
DrawAspectFunction · 0.85
DrawSignFunction · 0.85
FormatGridCellFunction · 0.85
DrawSzFunction · 0.85

Tested by

no test coverage detected