346
341
# define SEPOUT_DASH_2 2
348
343
static void SeparatorOutput (SEPARATOR *pSep,
349
int nColor, int OutputMode,
350
int xLeft, int yTop, int nScaling)
344
int nColor, int OutputMode,
345
int xLeft, int yTop, int nScaling)
359
case SEPOUT_LINE: break;
360
case SEPOUT_DASH_1: _setlinestyle (0xf0f0); break;
361
case SEPOUT_DASH_2: _setlinestyle (0x0f0f); break;
364
switch (pSep -> Type)
371
_moveto ((pSep -> xBegin - xLeft) / nScaling,
372
(pSep -> yBegin - yTop) / nScaling);
373
_lineto ((pSep -> xEnd - xLeft) / nScaling,
374
(pSep -> yEnd - yTop) / nScaling);
378
_rectangle (_GBORDER,
379
(pSep -> xBegin - xLeft) / nScaling + 3,
380
(pSep -> yBegin - yTop) / nScaling + 3,
381
(pSep -> xEnd - xLeft) / nScaling - 3,
382
(pSep -> yEnd - yTop) / nScaling - 3);
386
_setlinestyle (0xffff);
354
case SEPOUT_LINE: break;
355
case SEPOUT_DASH_1: _setlinestyle (0xf0f0); break;
356
case SEPOUT_DASH_2: _setlinestyle (0x0f0f); break;
359
switch (pSep -> Type)
366
_moveto ((pSep -> xBegin - xLeft) / nScaling,
367
(pSep -> yBegin - yTop) / nScaling);
368
_lineto ((pSep -> xEnd - xLeft) / nScaling,
369
(pSep -> yEnd - yTop) / nScaling);
373
_rectangle (_GBORDER,
374
(pSep -> xBegin - xLeft) / nScaling + 3,
375
(pSep -> yBegin - yTop) / nScaling + 3,
376
(pSep -> xEnd - xLeft) / nScaling - 3,
377
(pSep -> yEnd - yTop) / nScaling - 3);
381
_setlinestyle (0xffff);
389
384
static void SeparatorsOutput (int xLeft, int yTop, int nScaling)
394
for (i = 0; i < nSeps; i++)
396
switch (pSeps [i].Type)
399
case SEP_VERT: nColor = 15; break;
400
case SEP_HORZ: nColor = 15; break;
401
case SEP_RECT: nColor = 14; break;
404
SeparatorOutput (&pSeps[i], nColor, SEPOUT_LINE, xLeft, yTop, nScaling);
389
for (i = 0; i < nSeps; i++)
391
switch (pSeps [i].Type)
394
case SEP_VERT: nColor = 15; break;
395
case SEP_HORZ: nColor = 15; break;
396
case SEP_RECT: nColor = 14; break;
399
SeparatorOutput (&pSeps[i], nColor, SEPOUT_LINE, xLeft, yTop, nScaling);
408
403
static void RootsUpdate (int xLeft, int yTop, int nScaling)
412
LT_GraphicsClearScreen ();
414
for (pRoot = pRoots; pRoot < pAfterRoots; pRoot++)
416
int nColor = _COLOR_DGRAY;
418
if (pRoot -> bType & ROOT_LETTER) nColor |= 1; //=>BLUE
419
if (pRoot -> bType & ROOT_RECOGNIZED) nColor |= 2; //=>GREEN
420
if (IS_LAYOUT_DUST (*pRoot)) nColor |= 4; //=>RED
422
if (pRoot -> bType & ROOT_DEBUG) nColor = _COLOR_YELLOW;
426
_rectangle (_GBORDER, //_GFILLINTERIOR,
427
(pRoot -> xColumn - xLeft) / nScaling,
428
(pRoot -> yRow - yTop) / nScaling,
429
(pRoot -> xColumn + pRoot ->nWidth - 1 - xLeft) / nScaling,
430
(pRoot -> yRow + pRoot ->nHeight - 1 - yTop) / nScaling);
433
SeparatorsOutput (xLeft, yTop, nScaling);
407
LT_GraphicsClearScreen ();
409
for (pRoot = pRoots; pRoot < pAfterRoots; pRoot++)
411
int nColor = _COLOR_DGRAY;
413
if (pRoot -> bType & ROOT_LETTER) nColor |= 1; //=>BLUE
414
if (pRoot -> bType & ROOT_RECOGNIZED) nColor |= 2; //=>GREEN
415
if (IS_LAYOUT_DUST (*pRoot)) nColor |= 4; //=>RED
417
if (pRoot -> bType & ROOT_DEBUG) nColor = _COLOR_YELLOW;
421
_rectangle (_GBORDER, //_GFILLINTERIOR,
422
(pRoot -> xColumn - xLeft) / nScaling,
423
(pRoot -> yRow - yTop) / nScaling,
424
(pRoot -> xColumn + pRoot ->nWidth - 1 - xLeft) / nScaling,
425
(pRoot -> yRow + pRoot ->nHeight - 1 - yTop) / nScaling);
428
SeparatorsOutput (xLeft, yTop, nScaling);
436
431
static void RootStripsUpdate (int xLeft, int yTop, int nScaling)
442
LT_GraphicsClearScreen ();
444
for (iStrip = 0; iStrip < nRootStrips; iStrip++)
446
_setcolor (NUMBER_TO_COLOR (iStrip) | 8);
447
nShift = (iStrip % 3) * 2;
452
(iStrip * nRootStripsStep + nRootStripsOffset
453
- yTop) / nScaling + 1
459
(iStrip * nRootStripsStep + nRootStripsOffset
460
- yTop) / nScaling + 1
466
((iStrip + 1) * nRootStripsStep + nRootStripsOffset
467
- yTop) / nScaling - 1
473
((iStrip + 1) * nRootStripsStep + nRootStripsOffset
474
- yTop) / nScaling - 1
477
if (pRootStrips [iStrip].pBegin == NULL)
480
for (pRoot = pRootStrips [iStrip].pBegin;
481
pRoot <= pRootStrips [iStrip].pEnd;
484
_rectangle (_GBORDER,
486
- xLeft) / nScaling + nShift,
488
- yTop) / nScaling + nShift,
489
(pRoot -> xColumn + pRoot -> nWidth - 1
490
- xLeft) / nScaling + nShift,
491
(pRoot -> yRow + pRoot -> nHeight - 1
492
- yTop) / nScaling + nShift);
495
for (pRoot = pRoots; pRoot < pAfterRoots; pRoot++)
498
- nRootStripsOffset) / nRootStripsStep > iStrip
500
(pRoot -> yRow + pRoot -> nHeight - 1
501
- nRootStripsOffset) / nRootStripsStep < iStrip)
506
_rectangle (_GBORDER,
508
- xLeft) / nScaling + nShift,
510
- yTop) / nScaling + nShift,
511
(pRoot -> xColumn + pRoot -> nWidth - 1
512
- xLeft) / nScaling + nShift,
513
(pRoot -> yRow + pRoot -> nHeight - 1
514
- yTop) / nScaling + nShift);
437
LT_GraphicsClearScreen ();
439
for (iStrip = 0; iStrip < nRootStrips; iStrip++)
441
_setcolor (NUMBER_TO_COLOR (iStrip) | 8);
442
nShift = (iStrip % 3) * 2;
447
(iStrip * nRootStripsStep + nRootStripsOffset
448
- yTop) / nScaling + 1
454
(iStrip * nRootStripsStep + nRootStripsOffset
455
- yTop) / nScaling + 1
461
((iStrip + 1) * nRootStripsStep + nRootStripsOffset
462
- yTop) / nScaling - 1
468
((iStrip + 1) * nRootStripsStep + nRootStripsOffset
469
- yTop) / nScaling - 1
472
if (pRootStrips [iStrip].pBegin == NULL)
475
for (pRoot = pRootStrips [iStrip].pBegin;
476
pRoot <= pRootStrips [iStrip].pEnd;
479
_rectangle (_GBORDER,
481
- xLeft) / nScaling + nShift,
483
- yTop) / nScaling + nShift,
484
(pRoot -> xColumn + pRoot -> nWidth - 1
485
- xLeft) / nScaling + nShift,
486
(pRoot -> yRow + pRoot -> nHeight - 1
487
- yTop) / nScaling + nShift);
490
for (pRoot = pRoots; pRoot < pAfterRoots; pRoot++)
493
- nRootStripsOffset) / nRootStripsStep > iStrip
495
(pRoot -> yRow + pRoot -> nHeight - 1
496
- nRootStripsOffset) / nRootStripsStep < iStrip)
501
_rectangle (_GBORDER,
503
- xLeft) / nScaling + nShift,
505
- yTop) / nScaling + nShift,
506
(pRoot -> xColumn + pRoot -> nWidth - 1
507
- xLeft) / nScaling + nShift,
508
(pRoot -> yRow + pRoot -> nHeight - 1
509
- yTop) / nScaling + nShift);
520
515
static void PageMatrixUpdate (int xLeft, int yTop, int nScaling)
528
PAGE_MATRIX_WIDTH, // 1024
529
PAGE_MATRIX_HEIGHT, // 1024 (������� �����)
531
MATRIX_DRAWING_NATIVE_MODE // ����� ���������, ���� �� ���� (18.10.01)
523
PAGE_MATRIX_WIDTH, // 1024
524
PAGE_MATRIX_HEIGHT, // 1024 (квадрат такой)
526
MATRIX_DRAWING_NATIVE_MODE // режим рисования, один из двух (18.10.01)
535
530
static void BlocksUpdate (int xLeft, int yTop, int nScaling)
541
LT_GraphicsClearScreen ();
543
for (p = pBlocksList; p != NULL; p = p -> pNext)
545
nColor = NUMBER_TO_COLOR (p -> nNumber) |
546
(((p -> uFlags & BF_NOT_BREAK_BLOCK) != 0) << 3);
549
BlockRectangle (p, _GBORDER, xLeft, yTop, nScaling);
551
SeparatorOutput (p -> pUpSep, nColor, SEPOUT_DASH_1, xLeft, yTop, nScaling);
552
SeparatorOutput (p -> pDownSep, nColor, SEPOUT_DASH_2, xLeft, yTop, nScaling);
553
SeparatorOutput (p -> pLeftSep, nColor, SEPOUT_DASH_1, xLeft, yTop, nScaling);
554
SeparatorOutput (p -> pRightSep, nColor, SEPOUT_DASH_2, xLeft, yTop, nScaling);
557
for (pRoot = pRoots; pRoot < pAfterRoots; pRoot++)
559
if (pRoot -> nBlock == REMOVED_BLOCK_NUMBER)
564
_rectangle (_GBORDER,
565
(pRoot -> xColumn - xLeft) / nScaling,
566
(pRoot -> yRow - yTop) / nScaling,
567
(pRoot -> xColumn + pRoot ->nWidth - 1
569
(pRoot -> yRow + pRoot ->nHeight - 1
575
if (pRoot -> nBlock == DUST_BLOCK_NUMBER)
576
_setcolor (_COLOR_BACKGROUND);
578
_setcolor (NUMBER_TO_COLOR (pRoot -> nBlock));
580
_rectangle (_GBORDER,//_GFILLINTERIOR,
581
(pRoot -> xColumn - xLeft) / nScaling,
582
(pRoot -> yRow - yTop) / nScaling,
583
(pRoot -> xColumn + pRoot ->nWidth - 1
585
(pRoot -> yRow + pRoot ->nHeight - 1
536
LT_GraphicsClearScreen ();
538
for (p = pBlocksList; p != NULL; p = p -> pNext)
540
nColor = NUMBER_TO_COLOR (p -> nNumber) |
541
(((p -> uFlags & BF_NOT_BREAK_BLOCK) != 0) << 3);
544
BlockRectangle (p, _GBORDER, xLeft, yTop, nScaling);
546
SeparatorOutput (p -> pUpSep, nColor, SEPOUT_DASH_1, xLeft, yTop, nScaling);
547
SeparatorOutput (p -> pDownSep, nColor, SEPOUT_DASH_2, xLeft, yTop, nScaling);
548
SeparatorOutput (p -> pLeftSep, nColor, SEPOUT_DASH_1, xLeft, yTop, nScaling);
549
SeparatorOutput (p -> pRightSep, nColor, SEPOUT_DASH_2, xLeft, yTop, nScaling);
552
for (pRoot = pRoots; pRoot < pAfterRoots; pRoot++)
554
if (pRoot -> nBlock == REMOVED_BLOCK_NUMBER)
559
_rectangle (_GBORDER,
560
(pRoot -> xColumn - xLeft) / nScaling,
561
(pRoot -> yRow - yTop) / nScaling,
562
(pRoot -> xColumn + pRoot ->nWidth - 1
564
(pRoot -> yRow + pRoot ->nHeight - 1
570
if (pRoot -> nBlock == DUST_BLOCK_NUMBER)
571
_setcolor (_COLOR_BACKGROUND);
573
_setcolor (NUMBER_TO_COLOR (pRoot -> nBlock));
575
_rectangle (_GBORDER,//_GFILLINTERIOR,
576
(pRoot -> xColumn - xLeft) / nScaling,
577
(pRoot -> yRow - yTop) / nScaling,
578
(pRoot -> xColumn + pRoot ->nWidth - 1
580
(pRoot -> yRow + pRoot ->nHeight - 1
591
586
static void HystogramUpdate (int xLeft, int yTop, int nScaling)
597
struct textsettings ts;
592
struct textsettings ts;
599
594
ROOT *pRoot;//Rom
601
LT_GraphicsClearScreen ();
596
LT_GraphicsClearScreen ();
607
602
for (pRoot = pRoots; pRoot < pAfterRoots; pRoot++)
609
604
if(pRoot->nBlock == pDebugBlock->nNumber)
613
if (pRoot -> bType & ROOT_LETTER) nColor |= 1;
614
if (pRoot -> bType & ROOT_RECOGNIZED) nColor |= 2;
615
if (IS_LAYOUT_DUST (*pRoot)) nColor |= 4;
608
if (pRoot -> bType & ROOT_LETTER) nColor |= 1;
609
if (pRoot -> bType & ROOT_RECOGNIZED) nColor |= 2;
610
if (IS_LAYOUT_DUST (*pRoot)) nColor |= 4;
617
if (pRoot -> bType & ROOT_DEBUG) nColor = 14;
612
if (pRoot -> bType & ROOT_DEBUG) nColor = 14;
619
614
_setcolor (nColor);
621
616
_rectangle (_GFILLINTERIOR,
622
(pRoot -> xColumn - xLeft) / nScaling,
623
(pRoot -> yRow - yTop) / nScaling,
624
(pRoot -> xColumn + pRoot ->nWidth - 1 - xLeft) / nScaling,
625
(pRoot -> yRow + pRoot ->nHeight - 1 - yTop) / nScaling);
617
(pRoot -> xColumn - xLeft) / nScaling,
618
(pRoot -> yRow - yTop) / nScaling,
619
(pRoot -> xColumn + pRoot ->nWidth - 1 - xLeft) / nScaling,
620
(pRoot -> yRow + pRoot ->nHeight - 1 - yTop) / nScaling);
630
for (i = 0; i < nHystColumns; i++)
632
if (nMaxValue < pHystogram [i])
634
nMaxValue = pHystogram [i];
642
_gettextsettings (&ts);
644
for (i = 0; i < nHystColumns; i++)
646
if (pHystogram [i] == 0)
651
_rectangle (_GFILLINTERIOR,
652
(i * VIEW_WIDTH / nHystColumns + VIEW_LEFT
656
((i + 1) * VIEW_WIDTH / nHystColumns + VIEW_LEFT
664
_setcolor (_COLOR_BLUE);
666
_rectangle (_GFILLINTERIOR,
667
(i * VIEW_WIDTH / nHystColumns + VIEW_LEFT
669
(VIEW_BOTTOM - pHystogram [i] * VIEW_HEIGHT / nMaxValue
671
((i + 1) * VIEW_WIDTH / nHystColumns + VIEW_LEFT
678
_setcolor (_COLOR_RED);
680
_moveto (((xDebugVertLine - pDebugBlock -> Rect.xLeft)
681
* VIEW_WIDTH / nHystColumns
682
+ VIEW_WIDTH / nHystColumns / 2
684
- xLeft) / nScaling, 0);
685
_lineto (((xDebugVertLine - pDebugBlock -> Rect.xLeft)
686
* VIEW_WIDTH / nHystColumns
687
+ VIEW_WIDTH / nHystColumns / 2
689
- xLeft) / nScaling, SCREEN_HEIGHT);
691
_setcolor (_COLOR_BACKGROUND);
692
_settextalign (_RIGHT, _TOP);
693
nCharHeight = VIEW_HEIGHT / 10 / nScaling / 2;
694
_setcharsize (nCharHeight, nCharHeight / 2);
696
for (i = 0; i < nMaxValue - nMaxValue / 20; i += MAX (nMaxValue / 10, 1))
698
_moveto ((VIEW_LEFT - xLeft)/ nScaling,
699
(VIEW_BOTTOM - i * VIEW_HEIGHT / nMaxValue - yTop) / nScaling);
700
_lineto ((VIEW_RIGHT - xLeft)/ nScaling,
701
(VIEW_BOTTOM - i * VIEW_HEIGHT / nMaxValue - yTop) / nScaling);
705
sprintf (szBuffer, "%d\n", i);
706
_grtext ((VIEW_LEFT - xLeft) / nScaling,
707
(VIEW_BOTTOM - i * VIEW_HEIGHT / nMaxValue - yTop) / nScaling,
712
sprintf (szBuffer, "%d\n", nMaxValue);
713
_grtext ((VIEW_LEFT - xLeft) / nScaling,
714
(VIEW_TOP - yTop) / nScaling,
717
_rectangle (_GBORDER,
718
(VIEW_LEFT - xLeft) / nScaling,
719
(VIEW_TOP - yTop) / nScaling,
720
(VIEW_RIGHT - xLeft) / nScaling,
721
(VIEW_BOTTOM - yTop) / nScaling);
723
_setcharsize (ts.height, ts.width);
625
for (i = 0; i < nHystColumns; i++)
627
if (nMaxValue < pHystogram [i])
629
nMaxValue = pHystogram [i];
637
_gettextsettings (&ts);
639
for (i = 0; i < nHystColumns; i++)
641
if (pHystogram [i] == 0)
646
_rectangle (_GFILLINTERIOR,
647
(i * VIEW_WIDTH / nHystColumns + VIEW_LEFT
651
((i + 1) * VIEW_WIDTH / nHystColumns + VIEW_LEFT
659
_setcolor (_COLOR_BLUE);
661
_rectangle (_GFILLINTERIOR,
662
(i * VIEW_WIDTH / nHystColumns + VIEW_LEFT
664
(VIEW_BOTTOM - pHystogram [i] * VIEW_HEIGHT / nMaxValue
666
((i + 1) * VIEW_WIDTH / nHystColumns + VIEW_LEFT
673
_setcolor (_COLOR_RED);
675
_moveto (((xDebugVertLine - pDebugBlock -> Rect.xLeft)
676
* VIEW_WIDTH / nHystColumns
677
+ VIEW_WIDTH / nHystColumns / 2
679
- xLeft) / nScaling, 0);
680
_lineto (((xDebugVertLine - pDebugBlock -> Rect.xLeft)
681
* VIEW_WIDTH / nHystColumns
682
+ VIEW_WIDTH / nHystColumns / 2
684
- xLeft) / nScaling, SCREEN_HEIGHT);
686
_setcolor (_COLOR_BACKGROUND);
687
_settextalign (_RIGHT, _TOP);
688
nCharHeight = VIEW_HEIGHT / 10 / nScaling / 2;
689
_setcharsize (nCharHeight, nCharHeight / 2);
691
for (i = 0; i < nMaxValue - nMaxValue / 20; i += MAX (nMaxValue / 10, 1))
693
_moveto ((VIEW_LEFT - xLeft)/ nScaling,
694
(VIEW_BOTTOM - i * VIEW_HEIGHT / nMaxValue - yTop) / nScaling);
695
_lineto ((VIEW_RIGHT - xLeft)/ nScaling,
696
(VIEW_BOTTOM - i * VIEW_HEIGHT / nMaxValue - yTop) / nScaling);
700
sprintf (szBuffer, "%d\n", i);
701
_grtext ((VIEW_LEFT - xLeft) / nScaling,
702
(VIEW_BOTTOM - i * VIEW_HEIGHT / nMaxValue - yTop) / nScaling,
707
sprintf (szBuffer, "%d\n", nMaxValue);
708
_grtext ((VIEW_LEFT - xLeft) / nScaling,
709
(VIEW_TOP - yTop) / nScaling,
712
_rectangle (_GBORDER,
713
(VIEW_LEFT - xLeft) / nScaling,
714
(VIEW_TOP - yTop) / nScaling,
715
(VIEW_RIGHT - xLeft) / nScaling,
716
(VIEW_BOTTOM - yTop) / nScaling);
718
_setcharsize (ts.height, ts.width);
726
721
static void SpecialCuttingUpdate (int xLeft, int yTop, int nScaling)
729
int nWidth = pDebugBlock -> Rect.xRight - pDebugBlock -> Rect.xLeft + 1;
730
int nHeight = pDebugBlock -> Rect.yBottom - pDebugBlock -> Rect.yTop + 1;
733
LT_GraphicsClearScreen ();
735
if (nWidth == 0 || nHeight == 0)
738
nFactor = MIN (VIEW_WIDTH / nWidth, VIEW_HEIGHT / nHeight);
740
_setcolor (_COLOR_BLUE);
746
((nWidth - 1) * nFactor - xLeft) / nScaling,
747
((nHeight - 1) * nFactor - yTop) / nScaling
750
for (i = 0; i < nHystColumns; i++)
752
if (pHystBottoms [i] == -1)
755
if (pDebugBlock -> pHorzHystogram [pHystTops [i] - 1] == 0)
756
_setcolor (_COLOR_RED);
758
_setcolor (_COLOR_BLUE);
763
(i * nFactor - xLeft) / nScaling,
764
(pHystTops [i] * nFactor - yTop) / nScaling,
765
((i + 1) * nFactor - xLeft) / nScaling - 1,
766
(pHystBottoms [i] * nFactor - yTop) / nScaling
724
int nWidth = pDebugBlock -> Rect.xRight - pDebugBlock -> Rect.xLeft + 1;
725
int nHeight = pDebugBlock -> Rect.yBottom - pDebugBlock -> Rect.yTop + 1;
728
LT_GraphicsClearScreen ();
730
if (nWidth == 0 || nHeight == 0)
733
nFactor = MIN (VIEW_WIDTH / nWidth, VIEW_HEIGHT / nHeight);
735
_setcolor (_COLOR_BLUE);
741
((nWidth - 1) * nFactor - xLeft) / nScaling,
742
((nHeight - 1) * nFactor - yTop) / nScaling
745
for (i = 0; i < nHystColumns; i++)
747
if (pHystBottoms [i] == -1)
750
if (pDebugBlock -> pHorzHystogram [pHystTops [i] - 1] == 0)
751
_setcolor (_COLOR_RED);
753
_setcolor (_COLOR_BLUE);
758
(i * nFactor - xLeft) / nScaling,
759
(pHystTops [i] * nFactor - yTop) / nScaling,
760
((i + 1) * nFactor - xLeft) / nScaling - 1,
761
(pHystBottoms [i] * nFactor - yTop) / nScaling
771
766
static void SB_MatrixUpdate (int xLeft, int yTop, int nScaling)
776
nFactor = MIN (VIEW_WIDTH / nSB_Width, VIEW_HEIGHT / nSB_Height);
787
MATRIX_DRAWING_NATIVE_MODE
790
_setcolor (NUMBER_TO_COLOR (1) | 8);
792
for (pRoot = pDebugBlock -> pRoots; pRoot != NULL; pRoot = pRoot -> u1.pNext)
794
_rectangle (_GFILLINTERIOR,
796
- pDebugBlock -> Rect.xLeft) * nFactor/ nSB_CellWidth
799
- pDebugBlock -> Rect.yTop) * nFactor/ nSB_CellHeight
801
((pRoot -> xColumn + pRoot -> nWidth - 1
802
- pDebugBlock -> Rect.xLeft) * nFactor/ nSB_CellWidth
804
((pRoot -> yRow + pRoot -> nHeight - 1
805
- pDebugBlock -> Rect.yTop) * nFactor/ nSB_CellHeight
771
nFactor = MIN (VIEW_WIDTH / nSB_Width, VIEW_HEIGHT / nSB_Height);
782
MATRIX_DRAWING_NATIVE_MODE
785
_setcolor (NUMBER_TO_COLOR (1) | 8);
787
for (pRoot = pDebugBlock -> pRoots; pRoot != NULL; pRoot = pRoot -> u1.pNext)
789
_rectangle (_GFILLINTERIOR,
791
- pDebugBlock -> Rect.xLeft) * nFactor/ nSB_CellWidth
794
- pDebugBlock -> Rect.yTop) * nFactor/ nSB_CellHeight
796
((pRoot -> xColumn + pRoot -> nWidth - 1
797
- pDebugBlock -> Rect.xLeft) * nFactor/ nSB_CellWidth
799
((pRoot -> yRow + pRoot -> nHeight - 1
800
- pDebugBlock -> Rect.yTop) * nFactor/ nSB_CellHeight
810
805
static void WSB_HystogramUpdate
821
struct textsettings ts;
824
LT_GraphicsClearScreen ();
826
_setcolor (_COLOR_RED);
828
for (i = 0; i < nWSB_Points; i++)
830
_rectangle (_GFILLINTERIOR,
831
(pWSB_Points [i].xBegin * VIEW_WIDTH / nWSB_HystColumns + VIEW_LEFT
835
(pWSB_Points [i].xEnd * VIEW_WIDTH / nWSB_HystColumns + VIEW_LEFT
841
_gettextsettings (&ts);
843
for (i = 0; i < nWSB_HystColumns; i++)
845
if (pWSB_Hyst [i] == 0)
849
_setcolor (_COLOR_GREEN);
851
_setcolor (_COLOR_BLUE);
853
_rectangle (_GFILLINTERIOR,
854
(i * VIEW_WIDTH / nWSB_HystColumns + VIEW_LEFT
856
(VIEW_BOTTOM - pWSB_Hyst [i] * VIEW_HEIGHT / nMaxValue
858
((i + 1) * VIEW_WIDTH / nWSB_HystColumns + VIEW_LEFT
864
_setcolor (_COLOR_BACKGROUND);
865
_settextalign (_RIGHT, _TOP);
866
nCharHeight = VIEW_HEIGHT / 16 / nScaling / 2;
867
_setcharsize (nCharHeight, nCharHeight / 2);
869
for (i = 0; i < nMaxValue - nMaxValue / 32; i += MAX(nMaxValue / 16,1))
871
_moveto ((VIEW_LEFT - xLeft)/ nScaling,
872
(VIEW_BOTTOM - i * VIEW_HEIGHT / nMaxValue - yTop) / nScaling);
873
_lineto ((VIEW_RIGHT - xLeft)/ nScaling,
874
(VIEW_BOTTOM - i * VIEW_HEIGHT / nMaxValue - yTop) / nScaling);
878
sprintf (szBuffer, "%d\n", i);
879
_grtext ((VIEW_LEFT - xLeft) / nScaling,
880
(VIEW_BOTTOM - i * VIEW_HEIGHT / nMaxValue - yTop) / nScaling,
885
sprintf (szBuffer, "%d\n", nMaxValue);
886
_grtext ((VIEW_LEFT - xLeft) / nScaling,
887
(VIEW_TOP - yTop) / nScaling,
890
_rectangle (_GBORDER,
891
(VIEW_LEFT - xLeft) / nScaling,
892
(VIEW_TOP - yTop) / nScaling,
893
(VIEW_RIGHT - xLeft) / nScaling,
894
(VIEW_BOTTOM - yTop) / nScaling);
896
_setcharsize (ts.height, ts.width);
898
_setcolor (_COLOR_BLACK);
900
for (i = 0; i < nWSB_Points; i++)
904
(pWSB_Points [i].xMain * VIEW_WIDTH / nWSB_HystColumns + VIEW_LEFT
911
(pWSB_Points [i].xMain * VIEW_WIDTH / nWSB_HystColumns + VIEW_LEFT
917
if (pWSB_Hyst == pWSB_Hyst2)
921
(pWSB_Points [i].xBegin * VIEW_WIDTH / nWSB_HystColumns + VIEW_LEFT
923
(VIEW_BOTTOM - pWSB_Points [i].yMin * VIEW_HEIGHT / nMaxValue
928
(pWSB_Points [i].xEnd * VIEW_WIDTH / nWSB_HystColumns + VIEW_LEFT
930
(VIEW_BOTTOM - pWSB_Points [i].yMin * VIEW_HEIGHT / nMaxValue
936
(pWSB_Points [i].xBegin * VIEW_WIDTH / nWSB_HystColumns + VIEW_LEFT
938
(VIEW_BOTTOM - pWSB_Points [i].yMax * VIEW_HEIGHT / nMaxValue
943
(pWSB_Points [i].xEnd * VIEW_WIDTH / nWSB_HystColumns + VIEW_LEFT
945
(VIEW_BOTTOM - pWSB_Points [i].yMax * VIEW_HEIGHT / nMaxValue
951
(pWSB_Points [i].xBegin * VIEW_WIDTH / nWSB_HystColumns + VIEW_LEFT
953
(VIEW_BOTTOM - pWSB_Points [i].yAverage * VIEW_HEIGHT / nMaxValue
958
(pWSB_Points [i].xEnd * VIEW_WIDTH / nWSB_HystColumns + VIEW_LEFT
960
(VIEW_BOTTOM - pWSB_Points [i].yAverage * VIEW_HEIGHT / nMaxValue
816
struct textsettings ts;
819
LT_GraphicsClearScreen ();
821
_setcolor (_COLOR_RED);
823
for (i = 0; i < nWSB_Points; i++)
825
_rectangle (_GFILLINTERIOR,
826
(pWSB_Points [i].xBegin * VIEW_WIDTH / nWSB_HystColumns + VIEW_LEFT
830
(pWSB_Points [i].xEnd * VIEW_WIDTH / nWSB_HystColumns + VIEW_LEFT
836
_gettextsettings (&ts);
838
for (i = 0; i < nWSB_HystColumns; i++)
840
if (pWSB_Hyst [i] == 0)
844
_setcolor (_COLOR_GREEN);
846
_setcolor (_COLOR_BLUE);
848
_rectangle (_GFILLINTERIOR,
849
(i * VIEW_WIDTH / nWSB_HystColumns + VIEW_LEFT
851
(VIEW_BOTTOM - pWSB_Hyst [i] * VIEW_HEIGHT / nMaxValue
853
((i + 1) * VIEW_WIDTH / nWSB_HystColumns + VIEW_LEFT
859
_setcolor (_COLOR_BACKGROUND);
860
_settextalign (_RIGHT, _TOP);
861
nCharHeight = VIEW_HEIGHT / 16 / nScaling / 2;
862
_setcharsize (nCharHeight, nCharHeight / 2);
864
for (i = 0; i < nMaxValue - nMaxValue / 32; i += MAX(nMaxValue / 16,1))
866
_moveto ((VIEW_LEFT - xLeft)/ nScaling,
867
(VIEW_BOTTOM - i * VIEW_HEIGHT / nMaxValue - yTop) / nScaling);
868
_lineto ((VIEW_RIGHT - xLeft)/ nScaling,
869
(VIEW_BOTTOM - i * VIEW_HEIGHT / nMaxValue - yTop) / nScaling);
873
sprintf (szBuffer, "%d\n", i);
874
_grtext ((VIEW_LEFT - xLeft) / nScaling,
875
(VIEW_BOTTOM - i * VIEW_HEIGHT / nMaxValue - yTop) / nScaling,
880
sprintf (szBuffer, "%d\n", nMaxValue);
881
_grtext ((VIEW_LEFT - xLeft) / nScaling,
882
(VIEW_TOP - yTop) / nScaling,
885
_rectangle (_GBORDER,
886
(VIEW_LEFT - xLeft) / nScaling,
887
(VIEW_TOP - yTop) / nScaling,
888
(VIEW_RIGHT - xLeft) / nScaling,
889
(VIEW_BOTTOM - yTop) / nScaling);
891
_setcharsize (ts.height, ts.width);
893
_setcolor (_COLOR_BLACK);
895
for (i = 0; i < nWSB_Points; i++)
899
(pWSB_Points [i].xMain * VIEW_WIDTH / nWSB_HystColumns + VIEW_LEFT
906
(pWSB_Points [i].xMain * VIEW_WIDTH / nWSB_HystColumns + VIEW_LEFT
912
if (pWSB_Hyst == pWSB_Hyst2)
916
(pWSB_Points [i].xBegin * VIEW_WIDTH / nWSB_HystColumns + VIEW_LEFT
918
(VIEW_BOTTOM - pWSB_Points [i].yMin * VIEW_HEIGHT / nMaxValue
923
(pWSB_Points [i].xEnd * VIEW_WIDTH / nWSB_HystColumns + VIEW_LEFT
925
(VIEW_BOTTOM - pWSB_Points [i].yMin * VIEW_HEIGHT / nMaxValue
931
(pWSB_Points [i].xBegin * VIEW_WIDTH / nWSB_HystColumns + VIEW_LEFT
933
(VIEW_BOTTOM - pWSB_Points [i].yMax * VIEW_HEIGHT / nMaxValue
938
(pWSB_Points [i].xEnd * VIEW_WIDTH / nWSB_HystColumns + VIEW_LEFT
940
(VIEW_BOTTOM - pWSB_Points [i].yMax * VIEW_HEIGHT / nMaxValue
946
(pWSB_Points [i].xBegin * VIEW_WIDTH / nWSB_HystColumns + VIEW_LEFT
948
(VIEW_BOTTOM - pWSB_Points [i].yAverage * VIEW_HEIGHT / nMaxValue
953
(pWSB_Points [i].xEnd * VIEW_WIDTH / nWSB_HystColumns + VIEW_LEFT
955
(VIEW_BOTTOM - pWSB_Points [i].yAverage * VIEW_HEIGHT / nMaxValue
967
962
static void WSB_Hystogram_1_Update (int xLeft, int yTop, int nScaling)
974
for (i = 0; i < nWSB_HystColumns; i++)
976
if (nMaxValue < pWSB_Hyst1 [i])
977
nMaxValue = pWSB_Hyst1 [i];
983
WSB_HystogramUpdate (xLeft, yTop, nScaling, pWSB_Hyst1, nMaxValue);
969
for (i = 0; i < nWSB_HystColumns; i++)
971
if (nMaxValue < pWSB_Hyst1 [i])
972
nMaxValue = pWSB_Hyst1 [i];
978
WSB_HystogramUpdate (xLeft, yTop, nScaling, pWSB_Hyst1, nMaxValue);
986
981
static void WSB_Hystogram_2_Update (int xLeft, int yTop, int nScaling)
988
WSB_HystogramUpdate (xLeft, yTop, nScaling, pWSB_Hyst2, nPageHeight);
983
WSB_HystogramUpdate (xLeft, yTop, nScaling, pWSB_Hyst2, nPageHeight);
991
986
static void WSB_PointsUpdate (int xLeft, int yTop, int nScaling)
995
BlocksUpdate (xLeft, yTop, nScaling);
997
_setcolor (_COLOR_RED);
999
for (i = 0; i < nWSB_Points; i++)
1003
(pWSB_Points [i].xMain + xWSB_HystOffset - xLeft) / nScaling,
1009
(pWSB_Points [i].xMain + xWSB_HystOffset - xLeft) / nScaling,
990
BlocksUpdate (xLeft, yTop, nScaling);
992
_setcolor (_COLOR_RED);
994
for (i = 0; i < nWSB_Points; i++)
998
(pWSB_Points [i].xMain + xWSB_HystOffset - xLeft) / nScaling,
1004
(pWSB_Points [i].xMain + xWSB_HystOffset - xLeft) / nScaling,
1015
1010
static void PictureRemovingConditionsUpdate (int xLeft, int yTop, int nScaling)
1022
int xSrc, ySrc, xDst, yDst;
1024
LPOINT TopLeft, TopRight, BottomLeft, BottomRight;
1027
nWidth = rDebugRect.xRight - rDebugRect.xLeft + 1;
1028
nHeight = rDebugRect.yBottom - rDebugRect.yTop + 1;
1029
pMatrix = malloc (nWidth * nHeight);
1030
memset (pMatrix, MDCF_NULL, nWidth * nHeight);
1032
if (pMatrix == NULL)
1033
ErrorNoEnoughMemory ("in LTGRAPH.C,PictureRemovingConditionsUpdate,part 1");
1035
nFactor = MIN (VIEW_WIDTH / nWidth, VIEW_HEIGHT / nHeight);
1037
for (ySrc = rDebugRect.yTop, yDst = 0;
1038
ySrc <= rDebugRect.yBottom;
1041
for (xSrc = rDebugRect.xLeft, xDst = 0;
1042
xSrc <= rDebugRect.xRight;
1045
if (PageMatrix [ySrc * PAGE_MATRIX_WIDTH + xSrc] & PMC_DEBUG1)
1046
pMatrix [yDst * nWidth + xDst] |= MDCF_COLOR;
1048
if (PageMatrix [ySrc * PAGE_MATRIX_WIDTH + xSrc] & PMC_PICTURE)
1049
pMatrix [yDst * nWidth + xDst] |= MDCF_MASK;
1062
MATRIX_DRAWING_MASK_MODE
1065
_setcolor (_COLOR_DGREEN);
1067
for (pRoot = pDebugBlock -> pRoots; pRoot != NULL; pRoot = pRoot -> u1.pNext)
1071
r.xLeft = pRoot -> xColumn;
1072
r.yTop = pRoot -> yRow;
1074
REAL_XY (r.xLeft, r.yTop);
1076
r.xRight = r.xLeft + pRoot -> nWidth - 1;
1077
r.yBottom = r.yTop + pRoot -> nHeight - 1;
1079
_rectangle (_GFILLINTERIOR,
1081
- (rDebugRect.xLeft << PAGE_COMP_SHIFT))
1082
* nFactor / PAGE_COMP_FACTOR
1083
- xLeft) / nScaling,
1085
- (rDebugRect.yTop << PAGE_COMP_SHIFT))
1086
* nFactor / PAGE_COMP_FACTOR
1089
- (rDebugRect.xLeft << PAGE_COMP_SHIFT))
1090
* nFactor / PAGE_COMP_FACTOR
1091
- xLeft) / nScaling,
1093
- (rDebugRect.yTop << PAGE_COMP_SHIFT))
1094
* nFactor / PAGE_COMP_FACTOR
1095
- yTop) / nScaling);
1098
// Get rectangle of block in real coordinates
1100
TopLeft.x = pDebugBlock -> Rect.xLeft;
1101
TopLeft.y = pDebugBlock -> Rect.yTop;
1102
TopRight.x = pDebugBlock -> Rect.xRight;
1103
TopRight.y = pDebugBlock -> Rect.yTop;
1104
BottomLeft.x = pDebugBlock -> Rect.xLeft;
1105
BottomLeft.y = pDebugBlock -> Rect.yBottom;
1106
BottomRight.x = pDebugBlock -> Rect.xRight;
1107
BottomRight.y = pDebugBlock -> Rect.yBottom;
1109
REAL_XY (TopLeft.x , TopLeft.y);
1110
REAL_XY (TopRight.x , TopRight.y);
1111
REAL_XY (BottomLeft.x , BottomLeft.y);
1112
REAL_XY (BottomRight.x, BottomRight.y);
1114
rReal.xLeft = MIN (TopLeft.x, BottomLeft.x);
1115
rReal.yTop = MIN (TopLeft.y, TopRight.y);
1116
rReal.xRight = MAX (TopRight.x, BottomRight.x);
1117
rReal.yBottom = MAX (BottomLeft.y, BottomRight.y);
1119
_setcolor (_COLOR_RED);
1124
- (rDebugRect.xLeft << PAGE_COMP_SHIFT))
1125
* nFactor / PAGE_COMP_FACTOR
1126
- xLeft) / nScaling,
1128
- (rDebugRect.yTop << PAGE_COMP_SHIFT))
1129
* nFactor / PAGE_COMP_FACTOR
1136
- (rDebugRect.xLeft << PAGE_COMP_SHIFT))
1137
* nFactor / PAGE_COMP_FACTOR
1138
- xLeft) / nScaling,
1140
- (rDebugRect.yTop << PAGE_COMP_SHIFT))
1141
* nFactor / PAGE_COMP_FACTOR
1148
- (rDebugRect.xLeft << PAGE_COMP_SHIFT))
1149
* nFactor / PAGE_COMP_FACTOR
1150
- xLeft) / nScaling,
1152
- (rDebugRect.yTop << PAGE_COMP_SHIFT))
1153
* nFactor / PAGE_COMP_FACTOR
1160
- (rDebugRect.xLeft << PAGE_COMP_SHIFT))
1161
* nFactor / PAGE_COMP_FACTOR
1162
- xLeft) / nScaling,
1164
- (rDebugRect.yTop << PAGE_COMP_SHIFT))
1165
* nFactor / PAGE_COMP_FACTOR
1172
- (rDebugRect.xLeft << PAGE_COMP_SHIFT))
1173
* nFactor / PAGE_COMP_FACTOR
1174
- xLeft) / nScaling,
1176
- (rDebugRect.yTop << PAGE_COMP_SHIFT))
1177
* nFactor / PAGE_COMP_FACTOR
1184
- (rDebugRect.xLeft << PAGE_COMP_SHIFT))
1185
* nFactor / PAGE_COMP_FACTOR
1186
- xLeft) / nScaling,
1188
- (rDebugRect.yTop << PAGE_COMP_SHIFT))
1189
* nFactor / PAGE_COMP_FACTOR
1193
_setcolor (_COLOR_BLUE);
1195
_rectangle (_GBORDER,
1197
- (rDebugRect.xLeft << PAGE_COMP_SHIFT))
1198
* nFactor / PAGE_COMP_FACTOR
1199
- xLeft) / nScaling,
1201
- (rDebugRect.yTop << PAGE_COMP_SHIFT))
1202
* nFactor / PAGE_COMP_FACTOR
1205
- (rDebugRect.xLeft << PAGE_COMP_SHIFT))
1206
* nFactor / PAGE_COMP_FACTOR
1207
- xLeft) / nScaling,
1209
- (rDebugRect.yTop << PAGE_COMP_SHIFT))
1210
* nFactor / PAGE_COMP_FACTOR
1211
- yTop) / nScaling);
1017
int xSrc, ySrc, xDst, yDst;
1019
LPOINT TopLeft, TopRight, BottomLeft, BottomRight;
1022
nWidth = rDebugRect.xRight - rDebugRect.xLeft + 1;
1023
nHeight = rDebugRect.yBottom - rDebugRect.yTop + 1;
1024
pMatrix = malloc (nWidth * nHeight);
1025
memset (pMatrix, MDCF_NULL, nWidth * nHeight);
1027
if (pMatrix == NULL)
1028
ErrorNoEnoughMemory ("in LTGRAPH.C,PictureRemovingConditionsUpdate,part 1");
1030
nFactor = MIN (VIEW_WIDTH / nWidth, VIEW_HEIGHT / nHeight);
1032
for (ySrc = rDebugRect.yTop, yDst = 0;
1033
ySrc <= rDebugRect.yBottom;
1036
for (xSrc = rDebugRect.xLeft, xDst = 0;
1037
xSrc <= rDebugRect.xRight;
1040
if (PageMatrix [ySrc * PAGE_MATRIX_WIDTH + xSrc] & PMC_DEBUG1)
1041
pMatrix [yDst * nWidth + xDst] |= MDCF_COLOR;
1043
if (PageMatrix [ySrc * PAGE_MATRIX_WIDTH + xSrc] & PMC_PICTURE)
1044
pMatrix [yDst * nWidth + xDst] |= MDCF_MASK;
1057
MATRIX_DRAWING_MASK_MODE
1060
_setcolor (_COLOR_DGREEN);
1062
for (pRoot = pDebugBlock -> pRoots; pRoot != NULL; pRoot = pRoot -> u1.pNext)
1066
r.xLeft = pRoot -> xColumn;
1067
r.yTop = pRoot -> yRow;
1069
REAL_XY (r.xLeft, r.yTop);
1071
r.xRight = r.xLeft + pRoot -> nWidth - 1;
1072
r.yBottom = r.yTop + pRoot -> nHeight - 1;
1074
_rectangle (_GFILLINTERIOR,
1076
- (rDebugRect.xLeft << PAGE_COMP_SHIFT))
1077
* nFactor / PAGE_COMP_FACTOR
1078
- xLeft) / nScaling,
1080
- (rDebugRect.yTop << PAGE_COMP_SHIFT))
1081
* nFactor / PAGE_COMP_FACTOR
1084
- (rDebugRect.xLeft << PAGE_COMP_SHIFT))
1085
* nFactor / PAGE_COMP_FACTOR
1086
- xLeft) / nScaling,
1088
- (rDebugRect.yTop << PAGE_COMP_SHIFT))
1089
* nFactor / PAGE_COMP_FACTOR
1090
- yTop) / nScaling);
1093
// Get rectangle of block in real coordinates
1095
TopLeft.x = pDebugBlock -> Rect.xLeft;
1096
TopLeft.y = pDebugBlock -> Rect.yTop;
1097
TopRight.x = pDebugBlock -> Rect.xRight;
1098
TopRight.y = pDebugBlock -> Rect.yTop;
1099
BottomLeft.x = pDebugBlock -> Rect.xLeft;
1100
BottomLeft.y = pDebugBlock -> Rect.yBottom;
1101
BottomRight.x = pDebugBlock -> Rect.xRight;
1102
BottomRight.y = pDebugBlock -> Rect.yBottom;
1104
REAL_XY (TopLeft.x , TopLeft.y);
1105
REAL_XY (TopRight.x , TopRight.y);
1106
REAL_XY (BottomLeft.x , BottomLeft.y);
1107
REAL_XY (BottomRight.x, BottomRight.y);
1109
rReal.xLeft = MIN (TopLeft.x, BottomLeft.x);
1110
rReal.yTop = MIN (TopLeft.y, TopRight.y);
1111
rReal.xRight = MAX (TopRight.x, BottomRight.x);
1112
rReal.yBottom = MAX (BottomLeft.y, BottomRight.y);
1114
_setcolor (_COLOR_RED);
1119
- (rDebugRect.xLeft << PAGE_COMP_SHIFT))
1120
* nFactor / PAGE_COMP_FACTOR
1121
- xLeft) / nScaling,
1123
- (rDebugRect.yTop << PAGE_COMP_SHIFT))
1124
* nFactor / PAGE_COMP_FACTOR
1131
- (rDebugRect.xLeft << PAGE_COMP_SHIFT))
1132
* nFactor / PAGE_COMP_FACTOR
1133
- xLeft) / nScaling,
1135
- (rDebugRect.yTop << PAGE_COMP_SHIFT))
1136
* nFactor / PAGE_COMP_FACTOR
1143
- (rDebugRect.xLeft << PAGE_COMP_SHIFT))
1144
* nFactor / PAGE_COMP_FACTOR
1145
- xLeft) / nScaling,
1147
- (rDebugRect.yTop << PAGE_COMP_SHIFT))
1148
* nFactor / PAGE_COMP_FACTOR
1155
- (rDebugRect.xLeft << PAGE_COMP_SHIFT))
1156
* nFactor / PAGE_COMP_FACTOR
1157
- xLeft) / nScaling,
1159
- (rDebugRect.yTop << PAGE_COMP_SHIFT))
1160
* nFactor / PAGE_COMP_FACTOR
1167
- (rDebugRect.xLeft << PAGE_COMP_SHIFT))
1168
* nFactor / PAGE_COMP_FACTOR
1169
- xLeft) / nScaling,
1171
- (rDebugRect.yTop << PAGE_COMP_SHIFT))
1172
* nFactor / PAGE_COMP_FACTOR
1179
- (rDebugRect.xLeft << PAGE_COMP_SHIFT))
1180
* nFactor / PAGE_COMP_FACTOR
1181
- xLeft) / nScaling,
1183
- (rDebugRect.yTop << PAGE_COMP_SHIFT))
1184
* nFactor / PAGE_COMP_FACTOR
1188
_setcolor (_COLOR_BLUE);
1190
_rectangle (_GBORDER,
1192
- (rDebugRect.xLeft << PAGE_COMP_SHIFT))
1193
* nFactor / PAGE_COMP_FACTOR
1194
- xLeft) / nScaling,
1196
- (rDebugRect.yTop << PAGE_COMP_SHIFT))
1197
* nFactor / PAGE_COMP_FACTOR
1200
- (rDebugRect.xLeft << PAGE_COMP_SHIFT))
1201
* nFactor / PAGE_COMP_FACTOR
1202
- xLeft) / nScaling,
1204
- (rDebugRect.yTop << PAGE_COMP_SHIFT))
1205
* nFactor / PAGE_COMP_FACTOR
1206
- yTop) / nScaling);
1216
1211
void ColumnChart
1228
struct textsettings ts;
1231
char szTextBuffer [32];
1233
_setcolor (_COLOR_BACKGROUND);
1235
if (nColumns == 0 || pArray == NULL)
1236
ErrorInternal ("Bad data");
1238
nBiggest = pArray [0];
1240
for (i = 1; i < nColumns; i++)
1242
if (pArray [i] > nBiggest)
1243
nBiggest = pArray [i];
1249
_gettextsettings (&ts);
1250
_setcharsize (ts.height / 2, ts.width / 2);
1251
_settextalign (_CENTER, _HALF);
1253
dxTextOffset = (xRight - xLeft) / nColumns / 2,
1254
dyTextOffset = ts.height / 2;
1256
for (i = 0; i < nColumns; i++)
1258
_setcolor (NUMBER_TO_COLOR (i));
1263
xLeft + i * (xRight - xLeft) / nColumns,
1264
yTop + (nBiggest - pArray [i]) * (yBottom - yTop) / nBiggest,
1265
xLeft + (i + 1) * (xRight - xLeft) / nColumns,
1269
_setcolor (_COLOR_BACKGROUND);
1274
xLeft + i * (xRight - xLeft) / nColumns,
1275
yTop + (nBiggest - pArray [i]) * (yBottom - yTop) / nBiggest,
1276
xLeft + (i + 1) * (xRight - xLeft) / nColumns,
1280
sprintf (szTextBuffer, "%d", pArray [i]);
1284
xLeft + i * (xRight - xLeft) / nColumns + dxTextOffset,
1285
yBottom + dyTextOffset,
1290
_setcharsize (ts.height, ts.width);
1223
struct textsettings ts;
1226
char szTextBuffer [32];
1228
_setcolor (_COLOR_BACKGROUND);
1230
if (nColumns == 0 || pArray == NULL)
1231
ErrorInternal ("Bad data");
1233
nBiggest = pArray [0];
1235
for (i = 1; i < nColumns; i++)
1237
if (pArray [i] > nBiggest)
1238
nBiggest = pArray [i];
1244
_gettextsettings (&ts);
1245
_setcharsize (ts.height / 2, ts.width / 2);
1246
_settextalign (_CENTER, _HALF);
1248
dxTextOffset = (xRight - xLeft) / nColumns / 2,
1249
dyTextOffset = ts.height / 2;
1251
for (i = 0; i < nColumns; i++)
1253
_setcolor (NUMBER_TO_COLOR (i));
1258
xLeft + i * (xRight - xLeft) / nColumns,
1259
yTop + (nBiggest - pArray [i]) * (yBottom - yTop) / nBiggest,
1260
xLeft + (i + 1) * (xRight - xLeft) / nColumns,
1264
_setcolor (_COLOR_BACKGROUND);
1269
xLeft + i * (xRight - xLeft) / nColumns,
1270
yTop + (nBiggest - pArray [i]) * (yBottom - yTop) / nBiggest,
1271
xLeft + (i + 1) * (xRight - xLeft) / nColumns,
1275
sprintf (szTextBuffer, "%d", pArray [i]);
1279
xLeft + i * (xRight - xLeft) / nColumns + dxTextOffset,
1280
yBottom + dyTextOffset,
1285
_setcharsize (ts.height, ts.width);
1293
1288
# define B2SX(x) (((x) * nFactor - xLeft) / nScaling)
1296
1291
static void DD_RemovingConditionsUpdate (int xLeft, int yTop, int nScaling)
1300
int nBlockWidth, nBlockHeight;
1301
int nMatrixWidth, nMatrixHeight;
1303
int nCellWidth, nCellHeight;
1305
struct textsettings ts;
1307
extern int DQD_Matrix [];
1308
extern int DSD_Matrix [];
1310
LT_GraphicsClearScreen ();
1312
nBlockWidth = pDebugBlock -> Rect.xRight - pDebugBlock -> Rect.xLeft + 1;
1313
nBlockHeight = pDebugBlock -> Rect.yBottom - pDebugBlock -> Rect.yTop + 1;
1315
nFactor = MIN (VIEW_WIDTH / 2 /nBlockWidth, VIEW_HEIGHT / nBlockHeight);
1317
nMatrixWidth = rDebugRect.xRight - rDebugRect.xLeft + 1;
1318
nMatrixHeight = rDebugRect.yBottom - rDebugRect.yTop + 1;
1320
rGrid.xLeft = B2SX (0);
1321
rGrid.yTop = B2SY (0);
1322
rGrid.xRight = B2SX (nBlockWidth - 1);
1323
rGrid.yBottom = B2SY (nBlockHeight - 1);
1325
nCellWidth = (rGrid.xRight - rGrid.xLeft + 1) / nMatrixWidth;
1326
nCellHeight = (rGrid.yBottom - rGrid.yTop + 1) / nMatrixHeight;
1328
for (pRoot = pDebugBlock -> pRoots; pRoot != NULL; pRoot = pRoot -> u1.pNext)
1332
r.xLeft = pRoot -> xColumn;
1333
r.yTop = pRoot -> yRow;
1334
r.xRight = r.xLeft + pRoot -> nWidth - 1;
1335
r.yBottom = r.yTop + pRoot -> nHeight - 1;
1337
_setcolor (IS_LAYOUT_DUST (*pRoot) ? _COLOR_GREEN : _COLOR_DGREEN);
1339
_rectangle (_GFILLINTERIOR,
1340
B2SX (r.xLeft - pDebugBlock -> Rect.xLeft),
1341
B2SY (r.yTop - pDebugBlock -> Rect.yTop),
1342
B2SX (r.xRight - pDebugBlock -> Rect.xLeft),
1343
B2SY (r.yBottom - pDebugBlock -> Rect.yTop));
1346
_setcolor (_COLOR_BACKGROUND);
1348
for (x = 1; x < nMatrixWidth; x++)
1350
_moveto (rGrid.xLeft + x * nCellWidth, rGrid.yTop);
1351
_lineto (rGrid.xLeft + x * nCellWidth, rGrid.yBottom);
1354
for (y = 1; y < nMatrixHeight; y++)
1356
_moveto (rGrid.xLeft, rGrid.yTop + y * nCellHeight);
1357
_lineto (rGrid.xRight, rGrid.yTop + y * nCellHeight);
1360
_rectangle (_GBORDER, rGrid.xLeft, rGrid.yTop, rGrid.xRight, rGrid.yBottom);
1362
_gettextsettings (&ts);
1363
_setcharsize (ts.height / 2, ts.width / 2);
1364
_settextalign (_CENTER, _HALF);
1366
for (x = 0; x < nMatrixWidth; x++)
1368
for (y = 0; y < nMatrixHeight; y++)
1370
char szTextBuffer [16];
1372
if (DQD_Matrix [x + y * nMatrixWidth] == 0)
1375
_setcolor (_COLOR_BLACK);
1380
rGrid.xLeft + x * nCellWidth + nCellWidth / 2 - ts.width * 2,
1381
rGrid.yTop + y * nCellHeight + nCellHeight / 2 - ts.height / 3,
1382
rGrid.xLeft + x * nCellWidth + nCellWidth / 2 + ts.width * 2,
1383
rGrid.yTop + y * nCellHeight + nCellHeight / 2 + ts.height / 3
1386
sprintf (szTextBuffer, "%d %d",
1387
DQD_Matrix [x + y * nMatrixWidth],
1388
DSD_Matrix [x + y * nMatrixWidth]);
1390
_setcolor (_COLOR_BACKGROUND);
1394
rGrid.xLeft + x * nCellWidth + nCellWidth / 2,
1395
rGrid.yTop + y * nCellHeight + nCellHeight / 2,
1401
_setcharsize (ts.height, ts.width);
1405
SCREEN_WIDTH * 6 / 10,
1406
SCREEN_HEIGHT * 1 / 10,
1407
SCREEN_WIDTH * 9 / 10,
1408
SCREEN_HEIGHT * 4 / 10,
1410
nMatrixWidth * nMatrixHeight
1415
SCREEN_WIDTH * 6 / 10,
1416
SCREEN_HEIGHT * 6 / 10,
1417
SCREEN_WIDTH * 9 / 10,
1418
SCREEN_HEIGHT * 9 / 10,
1420
nMatrixWidth * nMatrixHeight
1295
int nBlockWidth, nBlockHeight;
1296
int nMatrixWidth, nMatrixHeight;
1298
int nCellWidth, nCellHeight;
1300
struct textsettings ts;
1302
extern int DQD_Matrix [];
1303
extern int DSD_Matrix [];
1305
LT_GraphicsClearScreen ();
1307
nBlockWidth = pDebugBlock -> Rect.xRight - pDebugBlock -> Rect.xLeft + 1;
1308
nBlockHeight = pDebugBlock -> Rect.yBottom - pDebugBlock -> Rect.yTop + 1;
1310
nFactor = MIN (VIEW_WIDTH / 2 /nBlockWidth, VIEW_HEIGHT / nBlockHeight);
1312
nMatrixWidth = rDebugRect.xRight - rDebugRect.xLeft + 1;
1313
nMatrixHeight = rDebugRect.yBottom - rDebugRect.yTop + 1;
1315
rGrid.xLeft = B2SX (0);
1316
rGrid.yTop = B2SY (0);
1317
rGrid.xRight = B2SX (nBlockWidth - 1);
1318
rGrid.yBottom = B2SY (nBlockHeight - 1);
1320
nCellWidth = (rGrid.xRight - rGrid.xLeft + 1) / nMatrixWidth;
1321
nCellHeight = (rGrid.yBottom - rGrid.yTop + 1) / nMatrixHeight;
1323
for (pRoot = pDebugBlock -> pRoots; pRoot != NULL; pRoot = pRoot -> u1.pNext)
1327
r.xLeft = pRoot -> xColumn;
1328
r.yTop = pRoot -> yRow;
1329
r.xRight = r.xLeft + pRoot -> nWidth - 1;
1330
r.yBottom = r.yTop + pRoot -> nHeight - 1;
1332
_setcolor (IS_LAYOUT_DUST (*pRoot) ? _COLOR_GREEN : _COLOR_DGREEN);
1334
_rectangle (_GFILLINTERIOR,
1335
B2SX (r.xLeft - pDebugBlock -> Rect.xLeft),
1336
B2SY (r.yTop - pDebugBlock -> Rect.yTop),
1337
B2SX (r.xRight - pDebugBlock -> Rect.xLeft),
1338
B2SY (r.yBottom - pDebugBlock -> Rect.yTop));
1341
_setcolor (_COLOR_BACKGROUND);
1343
for (x = 1; x < nMatrixWidth; x++)
1345
_moveto (rGrid.xLeft + x * nCellWidth, rGrid.yTop);
1346
_lineto (rGrid.xLeft + x * nCellWidth, rGrid.yBottom);
1349
for (y = 1; y < nMatrixHeight; y++)
1351
_moveto (rGrid.xLeft, rGrid.yTop + y * nCellHeight);
1352
_lineto (rGrid.xRight, rGrid.yTop + y * nCellHeight);
1355
_rectangle (_GBORDER, rGrid.xLeft, rGrid.yTop, rGrid.xRight, rGrid.yBottom);
1357
_gettextsettings (&ts);
1358
_setcharsize (ts.height / 2, ts.width / 2);
1359
_settextalign (_CENTER, _HALF);
1361
for (x = 0; x < nMatrixWidth; x++)
1363
for (y = 0; y < nMatrixHeight; y++)
1365
char szTextBuffer [16];
1367
if (DQD_Matrix [x + y * nMatrixWidth] == 0)
1370
_setcolor (_COLOR_BLACK);
1375
rGrid.xLeft + x * nCellWidth + nCellWidth / 2 - ts.width * 2,
1376
rGrid.yTop + y * nCellHeight + nCellHeight / 2 - ts.height / 3,
1377
rGrid.xLeft + x * nCellWidth + nCellWidth / 2 + ts.width * 2,
1378
rGrid.yTop + y * nCellHeight + nCellHeight / 2 + ts.height / 3
1381
sprintf (szTextBuffer, "%d %d",
1382
DQD_Matrix [x + y * nMatrixWidth],
1383
DSD_Matrix [x + y * nMatrixWidth]);
1385
_setcolor (_COLOR_BACKGROUND);
1389
rGrid.xLeft + x * nCellWidth + nCellWidth / 2,
1390
rGrid.yTop + y * nCellHeight + nCellHeight / 2,
1396
_setcharsize (ts.height, ts.width);
1400
SCREEN_WIDTH * 6 / 10,
1401
SCREEN_HEIGHT * 1 / 10,
1402
SCREEN_WIDTH * 9 / 10,
1403
SCREEN_HEIGHT * 4 / 10,
1405
nMatrixWidth * nMatrixHeight
1410
SCREEN_WIDTH * 6 / 10,
1411
SCREEN_HEIGHT * 6 / 10,
1412
SCREEN_WIDTH * 9 / 10,
1413
SCREEN_HEIGHT * 9 / 10,
1415
nMatrixWidth * nMatrixHeight
1423
1418
static void ShowBlock (int xLeft, int yTop, int nScaling)
1427
int nBlockWidth,nBlockHeight;
1429
char szTextBuffer [80];
1431
nBlockWidth = pDebugBlock -> Rect.xRight - pDebugBlock -> Rect.xLeft + 1;
1432
nBlockHeight = pDebugBlock -> Rect.yBottom - pDebugBlock -> Rect.yTop + 1;
1434
nFactor = MIN (VIEW_WIDTH / 2 /nBlockWidth, VIEW_HEIGHT / nBlockHeight);
1436
LT_GraphicsClearScreen ();
1438
for (pRoot = pDebugBlock -> pRoots; pRoot != NULL; pRoot = pRoot -> u1.pNext)
1442
r.xLeft = pRoot -> xColumn;
1443
r.yTop = pRoot -> yRow;
1444
r.xRight = r.xLeft + pRoot -> nWidth - 1;
1445
r.yBottom = r.yTop + pRoot -> nHeight - 1;
1447
_setcolor (IS_LAYOUT_DUST (*pRoot) ? _COLOR_GREEN : _COLOR_DGREEN);
1449
_rectangle (_GFILLINTERIOR,
1450
B2SX (r.xLeft - pDebugBlock -> Rect.xLeft),
1451
B2SY (r.yTop - pDebugBlock -> Rect.yTop),
1452
B2SX (r.xRight - pDebugBlock -> Rect.xLeft),
1453
B2SY (r.yBottom - pDebugBlock -> Rect.yTop));
1455
_setcolor(_COLOR_BACKGROUND);
1457
rGrid.xLeft = B2SX (0);
1458
rGrid.yTop = B2SY (0);
1459
rGrid.xRight = B2SX (nBlockWidth - 1);
1460
rGrid.yBottom = B2SY (nBlockHeight - 1);
1462
_rectangle (_GBORDER, rGrid.xLeft, rGrid.yTop, rGrid.xRight, rGrid.yBottom);
1464
sprintf (szTextBuffer, "Number:%i", pDebugBlock->nNumber);
1422
int nBlockWidth,nBlockHeight;
1424
char szTextBuffer [80];
1426
nBlockWidth = pDebugBlock -> Rect.xRight - pDebugBlock -> Rect.xLeft + 1;
1427
nBlockHeight = pDebugBlock -> Rect.yBottom - pDebugBlock -> Rect.yTop + 1;
1429
nFactor = MIN (VIEW_WIDTH / 2 /nBlockWidth, VIEW_HEIGHT / nBlockHeight);
1431
LT_GraphicsClearScreen ();
1433
for (pRoot = pDebugBlock -> pRoots; pRoot != NULL; pRoot = pRoot -> u1.pNext)
1437
r.xLeft = pRoot -> xColumn;
1438
r.yTop = pRoot -> yRow;
1439
r.xRight = r.xLeft + pRoot -> nWidth - 1;
1440
r.yBottom = r.yTop + pRoot -> nHeight - 1;
1442
_setcolor (IS_LAYOUT_DUST (*pRoot) ? _COLOR_GREEN : _COLOR_DGREEN);
1444
_rectangle (_GFILLINTERIOR,
1445
B2SX (r.xLeft - pDebugBlock -> Rect.xLeft),
1446
B2SY (r.yTop - pDebugBlock -> Rect.yTop),
1447
B2SX (r.xRight - pDebugBlock -> Rect.xLeft),
1448
B2SY (r.yBottom - pDebugBlock -> Rect.yTop));
1450
_setcolor(_COLOR_BACKGROUND);
1452
rGrid.xLeft = B2SX (0);
1453
rGrid.yTop = B2SY (0);
1454
rGrid.xRight = B2SX (nBlockWidth - 1);
1455
rGrid.yBottom = B2SY (nBlockHeight - 1);
1457
_rectangle (_GBORDER, rGrid.xLeft, rGrid.yTop, rGrid.xRight, rGrid.yBottom);
1459
sprintf (szTextBuffer, "Number:%i", pDebugBlock->nNumber);
1475
1469
static BLOCK *pBlocksListBegin;
1476
static int oBlockNext;
1470
static int oBlockNext;
1478
1472
static void BlocksListUpdate (int xLeft, int yTop, int nScaling)
1483
struct textsettings ts;
1485
char szTextBuffer [128];
1487
LT_GraphicsClearScreen ();
1489
_gettextsettings (&ts);
1490
_setcharsize (ts.height / 2, ts.width / 2);
1491
_settextalign (_CENTER, _HALF);
1493
for (nBlock = 1, p = pBlocksListBegin;
1495
p = *(BLOCK **) ((BYTE *) p + oBlockNext), nBlock++)
1497
_setcolor (NUMBER_TO_COLOR (p -> nNumber));
1498
BlockRectangle (p, _GBORDER, xLeft, yTop, nScaling);
1500
x = ((p -> Rect.xLeft + p -> Rect.xRight) / 2 - xLeft) / nScaling;
1501
y = ((p -> Rect.yTop + p -> Rect.yBottom) / 2 - yTop) / nScaling;
1503
_setcolor (_COLOR_BACKGROUND);
1504
sprintf (szTextBuffer, "%d", nBlock);
1506
sprintf(szTextBuffer, "%d/%d", nBlock,p->nUserNum);
1507
_grtext (x, y, szTextBuffer);
1510
_setcharsize (ts.height, ts.width);
1477
struct textsettings ts;
1479
char szTextBuffer [128];
1481
LT_GraphicsClearScreen ();
1483
_gettextsettings (&ts);
1484
_setcharsize (ts.height / 2, ts.width / 2);
1485
_settextalign (_CENTER, _HALF);
1487
for (nBlock = 1, p = pBlocksListBegin;
1489
p = *(BLOCK **) ((uchar *) p + oBlockNext), nBlock++)
1491
_setcolor (NUMBER_TO_COLOR (p -> nNumber));
1492
BlockRectangle (p, _GBORDER, xLeft, yTop, nScaling);
1494
x = ((p -> Rect.xLeft + p -> Rect.xRight) / 2 - xLeft) / nScaling;
1495
y = ((p -> Rect.yTop + p -> Rect.yBottom) / 2 - yTop) / nScaling;
1497
_setcolor (_COLOR_BACKGROUND);
1498
sprintf (szTextBuffer, "%d", nBlock);
1500
sprintf(szTextBuffer, "%d/%d", nBlock,p->nUserNum);
1501
_grtext (x, y, szTextBuffer);
1504
_setcharsize (ts.height, ts.width);
1512
1506
/************** ATAL 940414
1514
static void TreeUpdate (int xLeft, int yTop, int nScaling)
1518
struct textsettings ts;
1521
char szTextBuffer [128];
1523
LT_GraphicsClearScreen ();
1525
for (p = pBlocksList; p != NULL; p = p -> pNext)
1527
_setcolor (NUMBER_TO_COLOR (p -> nNumber));
1528
BlockRectangle (p, _GBORDER, xLeft, yTop, nScaling);
1530
x1 = ((p -> Rect.xLeft + p -> Rect.xRight) / 2 - xLeft) / nScaling;
1531
y1 = ((p -> Rect.yTop + p -> Rect.yBottom) / 2 - yTop) / nScaling;
1533
for (i = 0; i < p -> nChildren; i++)
1535
q = p -> pChildren [i];
1537
x2 = ((q -> Rect.xLeft + q -> Rect.xRight) / 2 - xLeft) / nScaling;
1538
y2 = ((q -> Rect.yTop + q -> Rect.yBottom) / 2 - yTop) / nScaling;
1544
_gettextsettings (&ts);
1545
_setcharsize (ts.height / 2, ts.width / 2);
1546
_settextalign (_LEFT, _BASE);
1549
for (p = pBlocksList; p != NULL; p = p -> pNext)
1551
x1 = ((p -> Rect.xLeft + p -> Rect.xRight) / 2 - xLeft) / nScaling;
1552
y1 = ((p -> Rect.yTop + p -> Rect.yBottom) / 2 - yTop) / nScaling;
1553
sprintf (szTextBuffer, "%d", p -> nParents);
1554
_grtext (x1, y1, szTextBuffer);
1557
_setcharsize (ts.height, ts.width);
1559
*************************/
1508
static void TreeUpdate (int xLeft, int yTop, int nScaling)
1512
struct textsettings ts;
1515
char szTextBuffer [128];
1517
LT_GraphicsClearScreen ();
1519
for (p = pBlocksList; p != NULL; p = p -> pNext)
1521
_setcolor (NUMBER_TO_COLOR (p -> nNumber));
1522
BlockRectangle (p, _GBORDER, xLeft, yTop, nScaling);
1524
x1 = ((p -> Rect.xLeft + p -> Rect.xRight) / 2 - xLeft) / nScaling;
1525
y1 = ((p -> Rect.yTop + p -> Rect.yBottom) / 2 - yTop) / nScaling;
1527
for (i = 0; i < p -> nChildren; i++)
1529
q = p -> pChildren [i];
1531
x2 = ((q -> Rect.xLeft + q -> Rect.xRight) / 2 - xLeft) / nScaling;
1532
y2 = ((q -> Rect.yTop + q -> Rect.yBottom) / 2 - yTop) / nScaling;
1538
_gettextsettings (&ts);
1539
_setcharsize (ts.height / 2, ts.width / 2);
1540
_settextalign (_LEFT, _BASE);
1543
for (p = pBlocksList; p != NULL; p = p -> pNext)
1545
x1 = ((p -> Rect.xLeft + p -> Rect.xRight) / 2 - xLeft) / nScaling;
1546
y1 = ((p -> Rect.yTop + p -> Rect.yBottom) / 2 - yTop) / nScaling;
1547
sprintf (szTextBuffer, "%d", p -> nParents);
1548
_grtext (x1, y1, szTextBuffer);
1551
_setcharsize (ts.height, ts.width);
1553
*************************/
1561
1555
static void BlocksOrderUpdate (int xLeft, int yTop, int nScaling)
1564
struct textsettings ts;
1566
char szTextBuffer [128];
1568
LT_GraphicsClearScreen ();
1570
_gettextsettings (&ts);
1571
_setcharsize (ts.height / 2, ts.width / 2);
1572
_settextalign (_CENTER, _HALF);
1574
for (p = pBlocksList; p != NULL; p = p -> pNext)
1576
_setcolor (NUMBER_TO_COLOR (p -> nNumber));
1577
BlockRectangle (p, _GBORDER, xLeft, yTop, nScaling);
1579
if (p -> Type == BLOCK_TEXT || p -> Type == BLOCK_PICTURE)
1581
x = ((p -> Rect.xLeft + p -> Rect.xRight) / 2 - xLeft) / nScaling;
1582
y = ((p -> Rect.yTop + p -> Rect.yBottom) / 2 - yTop) / nScaling;
1584
_setcolor (_COLOR_BACKGROUND);
1585
sprintf (szTextBuffer, "%d", p -> nNumber);
1587
sprintf(szTextBuffer, "%d/%d", p -> nNumber,p->nUserNum);
1589
_grtext (x, y, szTextBuffer);
1593
_setcharsize (ts.height, ts.width);
1558
struct textsettings ts;
1560
char szTextBuffer [128];
1562
LT_GraphicsClearScreen ();
1564
_gettextsettings (&ts);
1565
_setcharsize (ts.height / 2, ts.width / 2);
1566
_settextalign (_CENTER, _HALF);
1568
for (p = pBlocksList; p != NULL; p = p -> pNext)
1570
_setcolor (NUMBER_TO_COLOR (p -> nNumber));
1571
BlockRectangle (p, _GBORDER, xLeft, yTop, nScaling);
1573
if (p -> Type == BLOCK_TEXT || p -> Type == BLOCK_PICTURE)
1575
x = ((p -> Rect.xLeft + p -> Rect.xRight) / 2 - xLeft) / nScaling;
1576
y = ((p -> Rect.yTop + p -> Rect.yBottom) / 2 - yTop) / nScaling;
1578
_setcolor (_COLOR_BACKGROUND);
1579
sprintf (szTextBuffer, "%d", p -> nNumber);
1581
sprintf(szTextBuffer, "%d/%d", p -> nNumber,p->nUserNum);
1583
_grtext (x, y, szTextBuffer);
1587
_setcharsize (ts.height, ts.width);
1596
1590
static void CurrentStringUpdate (int xLeft, int yTop, int nScaling)
1602
LT_GraphicsClearScreen ();
1604
for (i = 0; i < String.nLetters; i++)
1606
pRoot = pRoots + String.pLettersList [i];
1608
_setcolor ((pRoot -> bType & ROOT_SPECIAL_LETTER) ? _COLOR_BACKGROUND : _COLOR_GREEN);
1609
_rectangle (_GFILLINTERIOR,
1610
(pRoot -> xColumn - xLeft) / nScaling,
1611
(pRoot -> yRow - yTop) / nScaling,
1612
(pRoot -> xColumn + pRoot ->nWidth - 1 - xLeft) / nScaling,
1613
(pRoot -> yRow + pRoot ->nHeight - 1 - yTop) / nScaling);
1616
_setcolor (_COLOR_GREEN);
1618
for (i = 0; i < String.nDust; i++)
1620
pRoot = pRoots + String.pDustList [i];
1622
_rectangle (_GBORDER,
1623
(pRoot -> xColumn - xLeft) / nScaling - 1,
1624
(pRoot -> yRow - yTop) / nScaling - 1,
1625
(pRoot -> xColumn + pRoot -> nWidth - 1 - xLeft) / nScaling + 1,
1626
(pRoot -> yRow + pRoot -> nHeight - 1 - yTop) / nScaling + 1);
1629
old_style = _getlinestyle ();
1630
_setlinestyle (0xcccc);
1632
_moveto ((String.xLeft - xLeft) / nScaling,
1633
(String.yMin - yTop) / nScaling);
1634
_lineto ((String.xRight - xLeft) / nScaling,
1635
(String.yMin - yTop) / nScaling);
1637
_moveto ((String.xLeft - xLeft) / nScaling,
1638
(String.yMax - yTop) / nScaling);
1639
_lineto ((String.xRight - xLeft) / nScaling,
1640
(String.yMax - yTop) / nScaling);
1641
_setlinestyle (old_style);
1643
_setcolor (_COLOR_RED);
1644
_rectangle (_GBORDER,
1645
(String.xLeft - xLeft) / nScaling,
1646
(String.yTop - yTop) / nScaling,
1647
(String.xRight - xLeft) / nScaling,
1648
(String.yBottom - yTop) / nScaling);
1650
_setcolor (_COLOR_BACKGROUND);
1651
_moveto ((String.xLeft - xLeft) / nScaling,
1652
(String.yMiddleTop - yTop) / nScaling);
1653
_lineto ((String.xRight - xLeft) / nScaling,
1654
(String.yMiddleTop - yTop) / nScaling);
1656
_moveto ((String.xLeft - xLeft) / nScaling,
1657
(String.yMiddleBottom - yTop) / nScaling);
1658
_lineto ((String.xRight - xLeft) / nScaling,
1659
(String.yMiddleBottom - yTop) / nScaling);
1596
LT_GraphicsClearScreen ();
1598
for (i = 0; i < String.nLetters; i++)
1600
pRoot = pRoots + String.pLettersList [i];
1602
_setcolor ((pRoot -> bType & ROOT_SPECIAL_LETTER) ? _COLOR_BACKGROUND : _COLOR_GREEN);
1603
_rectangle (_GFILLINTERIOR,
1604
(pRoot -> xColumn - xLeft) / nScaling,
1605
(pRoot -> yRow - yTop) / nScaling,
1606
(pRoot -> xColumn + pRoot ->nWidth - 1 - xLeft) / nScaling,
1607
(pRoot -> yRow + pRoot ->nHeight - 1 - yTop) / nScaling);
1610
_setcolor (_COLOR_GREEN);
1612
for (i = 0; i < String.nDust; i++)
1614
pRoot = pRoots + String.pDustList [i];
1616
_rectangle (_GBORDER,
1617
(pRoot -> xColumn - xLeft) / nScaling - 1,
1618
(pRoot -> yRow - yTop) / nScaling - 1,
1619
(pRoot -> xColumn + pRoot -> nWidth - 1 - xLeft) / nScaling + 1,
1620
(pRoot -> yRow + pRoot -> nHeight - 1 - yTop) / nScaling + 1);
1623
old_style = _getlinestyle ();
1624
_setlinestyle (0xcccc);
1626
_moveto ((String.xLeft - xLeft) / nScaling,
1627
(String.yMin - yTop) / nScaling);
1628
_lineto ((String.xRight - xLeft) / nScaling,
1629
(String.yMin - yTop) / nScaling);
1631
_moveto ((String.xLeft - xLeft) / nScaling,
1632
(String.yMax - yTop) / nScaling);
1633
_lineto ((String.xRight - xLeft) / nScaling,
1634
(String.yMax - yTop) / nScaling);
1635
_setlinestyle (old_style);
1637
_setcolor (_COLOR_RED);
1638
_rectangle (_GBORDER,
1639
(String.xLeft - xLeft) / nScaling,
1640
(String.yTop - yTop) / nScaling,
1641
(String.xRight - xLeft) / nScaling,
1642
(String.yBottom - yTop) / nScaling);
1644
_setcolor (_COLOR_BACKGROUND);
1645
_moveto ((String.xLeft - xLeft) / nScaling,
1646
(String.yMiddleTop - yTop) / nScaling);
1647
_lineto ((String.xRight - xLeft) / nScaling,
1648
(String.yMiddleTop - yTop) / nScaling);
1650
_moveto ((String.xLeft - xLeft) / nScaling,
1651
(String.yMiddleBottom - yTop) / nScaling);
1652
_lineto ((String.xRight - xLeft) / nScaling,
1653
(String.yMiddleBottom - yTop) / nScaling);
1662
1656
static void StringsUpdate (int xLeft, int yTop, int nScaling)
1672
LT_GraphicsClearScreen ();
1674
for (pString = pStringsUpList, nString = 0;
1676
pString = pString -> pDown, nString++)
1678
nColor = NUMBER_TO_COLOR (nString);
1679
nDustShift = 2 * (nString % 6 + 1);
1681
_setcolor (nColor + 8);
1682
_rectangle (_GBORDER,
1683
(pString -> xLeft - xLeft) / nScaling,
1684
(pString -> yTop - yTop) / nScaling,
1685
(pString -> xRight - xLeft) / nScaling,
1686
(pString -> yBottom - yTop) / nScaling);
1688
for (i = 0; i < pString -> nLetters; i++)
1690
pRoot = pRoots + pString -> pLettersList [i];
1691
_setcolor ((pRoot -> bType & ROOT_SPECIAL_LETTER) ? _COLOR_BACKGROUND : nColor);
1692
_rectangle (_GFILLINTERIOR,
1693
(pRoot -> xColumn - xLeft) / nScaling + nDustShift,
1694
(pRoot -> yRow - yTop) / nScaling,
1695
(pRoot -> xColumn + pRoot ->nWidth - 1
1696
- xLeft) / nScaling + nDustShift,
1697
(pRoot -> yRow + pRoot ->nHeight - 1
1698
- yTop) / nScaling);
1701
_setcolor (nColor + 8);
1703
for (i = 0; i < pString -> nDust; i++)
1705
pRoot = pRoots + pString -> pDustList [i];
1707
if (pRoot -> bType & ROOT_USED)
1710
_rectangle (_GBORDER,
1711
(pRoot -> xColumn - xLeft) / nScaling + nDustShift,
1712
(pRoot -> yRow - yTop) / nScaling,
1713
(pRoot -> xColumn + pRoot ->nWidth - 1
1714
- xLeft) / nScaling + nDustShift,
1715
(pRoot -> yRow + pRoot ->nHeight - 1
1716
- yTop) / nScaling);
1719
_setcolor (_COLOR_BACKGROUND);
1721
for (i = 0; i < pString -> nDust; i++)
1723
pRoot = pRoots + pString -> pDustList [i];
1725
if (pRoot -> bType & ROOT_USED)
1728
_rectangle (_GBORDER,
1729
(pRoot -> xColumn - xLeft) / nScaling,
1730
(pRoot -> yRow - yTop) / nScaling,
1731
(pRoot -> xColumn + pRoot ->nWidth - 1
1732
- xLeft) / nScaling,
1733
(pRoot -> yRow + pRoot ->nHeight - 1
1734
- yTop) / nScaling);
1737
_setcolor (nColor + 8);
1739
old_style = _getlinestyle ();
1740
_setlinestyle (0xcccc);
1742
_moveto ((pString -> xLeft - xLeft) / nScaling,
1743
(pString -> yMin - yTop) / nScaling);
1744
_lineto ((pString -> xRight - xLeft) / nScaling,
1745
(pString -> yMin - yTop) / nScaling);
1747
_moveto ((pString -> xLeft - xLeft) / nScaling,
1748
(pString -> yMax - yTop) / nScaling);
1749
_lineto ((pString -> xRight - xLeft) / nScaling,
1750
(pString -> yMax - yTop) / nScaling);
1751
_setlinestyle (old_style);
1753
_setcolor (_COLOR_RED);
1754
_rectangle (_GBORDER,
1755
(pString -> xLeft - xLeft) / nScaling,
1756
(pString -> yTop - yTop) / nScaling,
1757
(pString -> xRight - xLeft) / nScaling,
1758
(pString -> yBottom - yTop) / nScaling);
1760
_setcolor (_COLOR_BACKGROUND);
1761
_moveto ((pString -> xLeft - xLeft) / nScaling,
1762
(pString -> yMiddleTop - yTop) / nScaling);
1763
_lineto ((pString -> xRight - xLeft) / nScaling,
1764
(pString -> yMiddleTop - yTop) / nScaling);
1766
_moveto ((pString -> xLeft - xLeft) / nScaling,
1767
(pString -> yMiddleBottom - yTop) / nScaling);
1768
_lineto ((pString -> xRight - xLeft) / nScaling,
1769
(pString -> yMiddleBottom - yTop) / nScaling);
1772
SeparatorsOutput (xLeft, yTop, nScaling);
1666
LT_GraphicsClearScreen ();
1668
for (pString = pStringsUpList, nString = 0;
1670
pString = pString -> pDown, nString++)
1672
nColor = NUMBER_TO_COLOR (nString);
1673
nDustShift = 2 * (nString % 6 + 1);
1675
_setcolor (nColor + 8);
1676
_rectangle (_GBORDER,
1677
(pString -> xLeft - xLeft) / nScaling,
1678
(pString -> yTop - yTop) / nScaling,
1679
(pString -> xRight - xLeft) / nScaling,
1680
(pString -> yBottom - yTop) / nScaling);
1682
for (i = 0; i < pString -> nLetters; i++)
1684
pRoot = pRoots + pString -> pLettersList [i];
1685
_setcolor ((pRoot -> bType & ROOT_SPECIAL_LETTER) ? _COLOR_BACKGROUND : nColor);
1686
_rectangle (_GFILLINTERIOR,
1687
(pRoot -> xColumn - xLeft) / nScaling + nDustShift,
1688
(pRoot -> yRow - yTop) / nScaling,
1689
(pRoot -> xColumn + pRoot ->nWidth - 1
1690
- xLeft) / nScaling + nDustShift,
1691
(pRoot -> yRow + pRoot ->nHeight - 1
1692
- yTop) / nScaling);
1695
_setcolor (nColor + 8);
1697
for (i = 0; i < pString -> nDust; i++)
1699
pRoot = pRoots + pString -> pDustList [i];
1701
if (pRoot -> bType & ROOT_USED)
1704
_rectangle (_GBORDER,
1705
(pRoot -> xColumn - xLeft) / nScaling + nDustShift,
1706
(pRoot -> yRow - yTop) / nScaling,
1707
(pRoot -> xColumn + pRoot ->nWidth - 1
1708
- xLeft) / nScaling + nDustShift,
1709
(pRoot -> yRow + pRoot ->nHeight - 1
1710
- yTop) / nScaling);
1713
_setcolor (_COLOR_BACKGROUND);
1715
for (i = 0; i < pString -> nDust; i++)
1717
pRoot = pRoots + pString -> pDustList [i];
1719
if (pRoot -> bType & ROOT_USED)
1722
_rectangle (_GBORDER,
1723
(pRoot -> xColumn - xLeft) / nScaling,
1724
(pRoot -> yRow - yTop) / nScaling,
1725
(pRoot -> xColumn + pRoot ->nWidth - 1
1726
- xLeft) / nScaling,
1727
(pRoot -> yRow + pRoot ->nHeight - 1
1728
- yTop) / nScaling);
1731
_setcolor (nColor + 8);
1733
old_style = _getlinestyle ();
1734
_setlinestyle (0xcccc);
1736
_moveto ((pString -> xLeft - xLeft) / nScaling,
1737
(pString -> yMin - yTop) / nScaling);
1738
_lineto ((pString -> xRight - xLeft) / nScaling,
1739
(pString -> yMin - yTop) / nScaling);
1741
_moveto ((pString -> xLeft - xLeft) / nScaling,
1742
(pString -> yMax - yTop) / nScaling);
1743
_lineto ((pString -> xRight - xLeft) / nScaling,
1744
(pString -> yMax - yTop) / nScaling);
1745
_setlinestyle (old_style);
1747
_setcolor (_COLOR_RED);
1748
_rectangle (_GBORDER,
1749
(pString -> xLeft - xLeft) / nScaling,
1750
(pString -> yTop - yTop) / nScaling,
1751
(pString -> xRight - xLeft) / nScaling,
1752
(pString -> yBottom - yTop) / nScaling);
1754
_setcolor (_COLOR_BACKGROUND);
1755
_moveto ((pString -> xLeft - xLeft) / nScaling,
1756
(pString -> yMiddleTop - yTop) / nScaling);
1757
_lineto ((pString -> xRight - xLeft) / nScaling,
1758
(pString -> yMiddleTop - yTop) / nScaling);
1760
_moveto ((pString -> xLeft - xLeft) / nScaling,
1761
(pString -> yMiddleBottom - yTop) / nScaling);
1762
_lineto ((pString -> xRight - xLeft) / nScaling,
1763
(pString -> yMiddleBottom - yTop) / nScaling);
1766
SeparatorsOutput (xLeft, yTop, nScaling);
1775
1769
static void StringsForwardOrderUpdate (int xLeft, int yTop, int nScaling)
1780
struct textsettings ts;
1782
char szTextBuffer [128];
1784
LT_GraphicsClearScreen ();
1786
_gettextsettings (&ts);
1787
_setcharsize (ts.height / 2, ts.width / 2);
1788
_settextalign (_CENTER, _HALF);
1790
for (nString = 1, p = pStringsList; p != NULL; p = p -> pNext, nString++)
1792
_setcolor (p -> uFlags & SF_NEED_DELETE ? _COLOR_BACKGROUND : NUMBER_TO_COLOR (nString));
1793
_rectangle (_GBORDER,
1794
(p -> xLeft - xLeft) / nScaling,
1795
(p -> yTop - yTop) / nScaling,
1796
(p -> xRight - xLeft) / nScaling,
1797
(p -> yBottom - yTop) / nScaling);
1799
x = ((p -> xLeft + p -> xRight) / 2 - xLeft) / nScaling;
1800
y = ((p -> yTop + p -> yBottom) / 2 - yTop) / nScaling;
1802
_setcolor (_COLOR_BACKGROUND);
1803
sprintf (szTextBuffer, "%d", nString);
1804
_grtext (x, y, szTextBuffer);
1807
_setcharsize (ts.height, ts.width);
1774
struct textsettings ts;
1776
char szTextBuffer [128];
1778
LT_GraphicsClearScreen ();
1780
_gettextsettings (&ts);
1781
_setcharsize (ts.height / 2, ts.width / 2);
1782
_settextalign (_CENTER, _HALF);
1784
for (nString = 1, p = pStringsList; p != NULL; p = p -> pNext, nString++)
1786
_setcolor (p -> uFlags & SF_NEED_DELETE ? _COLOR_BACKGROUND : NUMBER_TO_COLOR (nString));
1787
_rectangle (_GBORDER,
1788
(p -> xLeft - xLeft) / nScaling,
1789
(p -> yTop - yTop) / nScaling,
1790
(p -> xRight - xLeft) / nScaling,
1791
(p -> yBottom - yTop) / nScaling);
1793
x = ((p -> xLeft + p -> xRight) / 2 - xLeft) / nScaling;
1794
y = ((p -> yTop + p -> yBottom) / 2 - yTop) / nScaling;
1796
_setcolor (_COLOR_BACKGROUND);
1797
sprintf (szTextBuffer, "%d", nString);
1798
_grtext (x, y, szTextBuffer);
1801
_setcharsize (ts.height, ts.width);
1810
1804
static void StringsBackwardOrderUpdate (int xLeft, int yTop, int nScaling)
1815
struct textsettings ts;
1817
char szTextBuffer [128];
1819
LT_GraphicsClearScreen ();
1821
_gettextsettings (&ts);
1822
_setcharsize (ts.height / 2, ts.width / 2);
1823
_settextalign (_CENTER, _HALF);
1825
for (nString = 1, p = pStringsListEnd; p != NULL; p = p -> pPrev, nString++)
1827
_setcolor (p -> uFlags & SF_NEED_DELETE ? _COLOR_BACKGROUND : NUMBER_TO_COLOR (nString));
1828
_rectangle (_GBORDER,
1829
(p -> xLeft - xLeft) / nScaling,
1830
(p -> yTop - yTop) / nScaling,
1831
(p -> xRight - xLeft) / nScaling,
1832
(p -> yBottom - yTop) / nScaling);
1834
x = ((p -> xLeft + p -> xRight) / 2 - xLeft) / nScaling;
1835
y = ((p -> yTop + p -> yBottom) / 2 - yTop) / nScaling;
1837
_setcolor (_COLOR_BACKGROUND);
1838
sprintf (szTextBuffer, "%d", nString);
1839
_grtext (x, y, szTextBuffer);
1842
_setcharsize (ts.height, ts.width);
1809
struct textsettings ts;
1811
char szTextBuffer [128];
1813
LT_GraphicsClearScreen ();
1815
_gettextsettings (&ts);
1816
_setcharsize (ts.height / 2, ts.width / 2);
1817
_settextalign (_CENTER, _HALF);
1819
for (nString = 1, p = pStringsListEnd; p != NULL; p = p -> pPrev, nString++)
1821
_setcolor (p -> uFlags & SF_NEED_DELETE ? _COLOR_BACKGROUND : NUMBER_TO_COLOR (nString));
1822
_rectangle (_GBORDER,
1823
(p -> xLeft - xLeft) / nScaling,
1824
(p -> yTop - yTop) / nScaling,
1825
(p -> xRight - xLeft) / nScaling,
1826
(p -> yBottom - yTop) / nScaling);
1828
x = ((p -> xLeft + p -> xRight) / 2 - xLeft) / nScaling;
1829
y = ((p -> yTop + p -> yBottom) / 2 - yTop) / nScaling;
1831
_setcolor (_COLOR_BACKGROUND);
1832
sprintf (szTextBuffer, "%d", nString);
1833
_grtext (x, y, szTextBuffer);
1836
_setcharsize (ts.height, ts.width);
1845
1839
static void StringsUpOrderUpdate (int xLeft, int yTop, int nScaling)
1850
struct textsettings ts;
1852
char szTextBuffer [128];
1854
LT_GraphicsClearScreen ();
1856
_gettextsettings (&ts);
1857
_setcharsize (ts.height / 2, ts.width / 2);
1858
_settextalign (_CENTER, _HALF);
1860
for (nString = 1, p = pStringsUpList; p != NULL; p = p -> pDown, nString++)
1862
_setcolor (p -> uFlags & SF_NEED_DELETE ? _COLOR_BACKGROUND : NUMBER_TO_COLOR (nString));
1863
_rectangle (_GBORDER,
1864
(p -> xLeft - xLeft) / nScaling,
1865
(p -> yTop - yTop) / nScaling,
1866
(p -> xRight - xLeft) / nScaling,
1867
(p -> yBottom - yTop) / nScaling);
1869
x = ((p -> xLeft + p -> xRight) / 2 - xLeft) / nScaling;
1870
y = ((p -> yTop + p -> yBottom) / 2 - yTop) / nScaling;
1872
_setcolor (_COLOR_BACKGROUND);
1873
sprintf (szTextBuffer, "%d", nString);
1874
_grtext (x, y, szTextBuffer);
1877
_setcharsize (ts.height, ts.width);
1844
struct textsettings ts;
1846
char szTextBuffer [128];
1848
LT_GraphicsClearScreen ();
1850
_gettextsettings (&ts);
1851
_setcharsize (ts.height / 2, ts.width / 2);
1852
_settextalign (_CENTER, _HALF);
1854
for (nString = 1, p = pStringsUpList; p != NULL; p = p -> pDown, nString++)
1856
_setcolor (p -> uFlags & SF_NEED_DELETE ? _COLOR_BACKGROUND : NUMBER_TO_COLOR (nString));
1857
_rectangle (_GBORDER,
1858
(p -> xLeft - xLeft) / nScaling,
1859
(p -> yTop - yTop) / nScaling,
1860
(p -> xRight - xLeft) / nScaling,
1861
(p -> yBottom - yTop) / nScaling);
1863
x = ((p -> xLeft + p -> xRight) / 2 - xLeft) / nScaling;
1864
y = ((p -> yTop + p -> yBottom) / 2 - yTop) / nScaling;
1866
_setcolor (_COLOR_BACKGROUND);
1867
sprintf (szTextBuffer, "%d", nString);
1868
_grtext (x, y, szTextBuffer);
1871
_setcharsize (ts.height, ts.width);
1880
1874
static void StringsDownOrderUpdate (int xLeft, int yTop, int nScaling)
1885
struct textsettings ts;
1887
char szTextBuffer [128];
1889
LT_GraphicsClearScreen ();
1891
_gettextsettings (&ts);
1892
_setcharsize (ts.height / 2, ts.width / 2);
1893
_settextalign (_CENTER, _HALF);
1895
for (nString = 1, p = pStringsDownList; p != NULL; p = p -> pUp, nString++)
1897
_setcolor (p -> uFlags & SF_NEED_DELETE ? _COLOR_BACKGROUND : NUMBER_TO_COLOR (nString));
1898
_rectangle (_GBORDER,
1899
(p -> xLeft - xLeft) / nScaling,
1900
(p -> yTop - yTop) / nScaling,
1901
(p -> xRight - xLeft) / nScaling,
1902
(p -> yBottom - yTop) / nScaling);
1904
x = ((p -> xLeft + p -> xRight) / 2 - xLeft) / nScaling;
1905
y = ((p -> yTop + p -> yBottom) / 2 - yTop) / nScaling;
1907
_setcolor (_COLOR_BACKGROUND);
1908
sprintf (szTextBuffer, "%d", nString);
1909
_grtext (x, y, szTextBuffer);
1912
_setcharsize (ts.height, ts.width);
1879
struct textsettings ts;
1881
char szTextBuffer [128];
1883
LT_GraphicsClearScreen ();
1885
_gettextsettings (&ts);
1886
_setcharsize (ts.height / 2, ts.width / 2);
1887
_settextalign (_CENTER, _HALF);
1889
for (nString = 1, p = pStringsDownList; p != NULL; p = p -> pUp, nString++)
1891
_setcolor (p -> uFlags & SF_NEED_DELETE ? _COLOR_BACKGROUND : NUMBER_TO_COLOR (nString));
1892
_rectangle (_GBORDER,
1893
(p -> xLeft - xLeft) / nScaling,
1894
(p -> yTop - yTop) / nScaling,
1895
(p -> xRight - xLeft) / nScaling,
1896
(p -> yBottom - yTop) / nScaling);
1898
x = ((p -> xLeft + p -> xRight) / 2 - xLeft) / nScaling;
1899
y = ((p -> yTop + p -> yBottom) / 2 - yTop) / nScaling;
1901
_setcolor (_COLOR_BACKGROUND);
1902
sprintf (szTextBuffer, "%d", nString);
1903
_grtext (x, y, szTextBuffer);
1906
_setcharsize (ts.height, ts.width);
1915
1909
static void RasterUpdate (int xLeft, int yTop, int nScaling)
1920
LT_GraphicsClearScreen ();
1922
nStep = MIN (FIELD_WIDTH / nRasterWidth, FIELD_HEIGHT / nRasterHeight);
1924
if (nStep == 0) nStep = 1;
1926
_setcolor (_COLOR_BACKGROUND);
1927
_rectangle (_GFILLINTERIOR,
1928
(0 - xLeft) / nScaling,
1929
(0 - yTop) / nScaling,
1930
(nRasterWidth * nStep - xLeft) / nScaling,
1931
(nRasterHeight * nStep - yTop) / nScaling);
1933
_setcolor (_COLOR_BLACK);
1935
for (x = 0; x < nRasterWidth; x++)
1937
for (y = 0; y < nRasterHeight; y++)
1939
if ((pRaster [y * nRasterByteWidth + x / 8] << x % 8) & 0x80)
1941
_rectangle (_GFILLINTERIOR,
1942
(x * nStep - xLeft) / nScaling,
1943
(y * nStep - yTop) / nScaling,
1944
((x + 1) * nStep - xLeft) / nScaling,
1945
((y + 1) * nStep - yTop) / nScaling);
1950
_setcolor (_COLOR_GRAY);
1952
for (x = 0; x <= nRasterWidth; x++)
1954
_moveto ((x * nStep - xLeft) / nScaling,
1955
(0 - yTop) / nScaling);
1956
_lineto ((x * nStep - xLeft) / nScaling,
1957
(nRasterHeight * nStep - yTop) / nScaling);
1960
for (y = 0; y <= nRasterHeight; y++)
1962
_moveto ((0 - xLeft) / nScaling,
1963
(y * nStep - yTop) / nScaling);
1964
_lineto ((nRasterWidth * nStep - xLeft) / nScaling,
1965
(y * nStep - yTop) / nScaling);
1914
LT_GraphicsClearScreen ();
1916
nStep = MIN (FIELD_WIDTH / nRasterWidth, FIELD_HEIGHT / nRasterHeight);
1918
if (nStep == 0) nStep = 1;
1920
_setcolor (_COLOR_BACKGROUND);
1921
_rectangle (_GFILLINTERIOR,
1922
(0 - xLeft) / nScaling,
1923
(0 - yTop) / nScaling,
1924
(nRasterWidth * nStep - xLeft) / nScaling,
1925
(nRasterHeight * nStep - yTop) / nScaling);
1927
_setcolor (_COLOR_BLACK);
1929
for (x = 0; x < nRasterWidth; x++)
1931
for (y = 0; y < nRasterHeight; y++)
1933
if ((pRaster [y * nRasterByteWidth + x / 8] << x % 8) & 0x80)
1935
_rectangle (_GFILLINTERIOR,
1936
(x * nStep - xLeft) / nScaling,
1937
(y * nStep - yTop) / nScaling,
1938
((x + 1) * nStep - xLeft) / nScaling,
1939
((y + 1) * nStep - yTop) / nScaling);
1944
_setcolor (_COLOR_GRAY);
1946
for (x = 0; x <= nRasterWidth; x++)
1948
_moveto ((x * nStep - xLeft) / nScaling,
1949
(0 - yTop) / nScaling);
1950
_lineto ((x * nStep - xLeft) / nScaling,
1951
(nRasterHeight * nStep - yTop) / nScaling);
1954
for (y = 0; y <= nRasterHeight; y++)
1956
_moveto ((0 - xLeft) / nScaling,
1957
(y * nStep - yTop) / nScaling);
1958
_lineto ((nRasterWidth * nStep - xLeft) / nScaling,
1959
(y * nStep - yTop) / nScaling);
1969
1963
static void BreakingUpdate (int xLeft, int yTop, int nScaling)
1974
LT_GraphicsClearScreen ();
1976
nStep = MIN (FIELD_WIDTH / nRasterWidth, FIELD_HEIGHT / nRasterHeight);
1981
_setcolor (_COLOR_BACKGROUND);
1982
_rectangle (_GFILLINTERIOR,
1983
(0 - xLeft) / nScaling,
1984
(0 - yTop) / nScaling,
1985
(nRasterWidth * nStep - xLeft) / nScaling,
1986
(nRasterHeight * nStep - yTop) / nScaling);
1988
for (x = 0; x < nRasterWidth; x++)
1990
for (y = 0; y < nRasterHeight; y++)
1992
if ((pRaster [y * nRasterByteWidth + x / 8] << x % 8) & 0x80)
1993
_setcolor (_COLOR_BLACK);
1994
else if (y == yRasterBreakLine)
1995
_setcolor (_COLOR_RED);
1996
else if (y >= yRasterUpBreakLimit && y <= yRasterDownBreakLimit)
1997
_setcolor (_COLOR_YELLOW);
2001
_rectangle (_GFILLINTERIOR,
2002
(x * nStep - xLeft) / nScaling,
2003
(y * nStep - yTop) / nScaling,
2004
((x + 1) * nStep - xLeft) / nScaling,
2005
((y + 1) * nStep - yTop) / nScaling);
2009
_setcolor (_COLOR_GRAY);
2011
for (x = 0; x <= nRasterWidth; x++)
2013
_moveto ((x * nStep - xLeft) / nScaling,
2014
(0 - yTop) / nScaling);
2015
_lineto ((x * nStep - xLeft) / nScaling,
2016
(nRasterHeight * nStep - yTop) / nScaling);
2019
for (y = 0; y <= nRasterHeight; y++)
2021
_moveto ((0 - xLeft) / nScaling,
2022
(y * nStep - yTop) / nScaling);
2023
_lineto ((nRasterWidth * nStep - xLeft) / nScaling,
2024
(y * nStep - yTop) / nScaling);
2027
_setcolor (_COLOR_BLUE);
2029
for (y = 0; y <= nRasterHeight; y++)
2031
_rectangle (_GFILLINTERIOR,
2032
((nRasterWidth + 1) * nStep - xLeft) / nScaling,
2033
(y * nStep - yTop) / nScaling,
2034
((aRasterHystogram [y] + nRasterWidth + 1)
2035
* nStep - xLeft) / nScaling,
2036
((y + 1) * nStep - yTop) / nScaling);
2040
void LT_GraphicsTitle (char *pTitle)
2042
// _setcolor (_COLOR_BACKGROUND);
2043
_setcolor (_COLOR_TEXT);
2044
_settextalign (_CENTER, _HALF); // _HALF("_HALPH")==_CENTER
2045
_grtext (320, 450, pTitle);
2048
/* ����� ������� ����� � "_graphics.c";
2052
if((c=getch())=='d'){
2053
void break_point_data (char * c);
2054
static char stop_here_byte=0;
2055
static unsigned short int * stop_here_check=0;
2057
break_point_data(&stop_here_byte);
2058
stop_here_byte++; break_point_data(0);
2064
static int yCurrentTop = 0;
1968
LT_GraphicsClearScreen ();
1970
nStep = MIN (FIELD_WIDTH / nRasterWidth, FIELD_HEIGHT / nRasterHeight);
1975
_setcolor (_COLOR_BACKGROUND);
1976
_rectangle (_GFILLINTERIOR,
1977
(0 - xLeft) / nScaling,
1978
(0 - yTop) / nScaling,
1979
(nRasterWidth * nStep - xLeft) / nScaling,
1980
(nRasterHeight * nStep - yTop) / nScaling);
1982
for (x = 0; x < nRasterWidth; x++)
1984
for (y = 0; y < nRasterHeight; y++)
1986
if ((pRaster [y * nRasterByteWidth + x / 8] << x % 8) & 0x80)
1987
_setcolor (_COLOR_BLACK);
1988
else if (y == yRasterBreakLine)
1989
_setcolor (_COLOR_RED);
1990
else if (y >= yRasterUpBreakLimit && y <= yRasterDownBreakLimit)
1991
_setcolor (_COLOR_YELLOW);
1995
_rectangle (_GFILLINTERIOR,
1996
(x * nStep - xLeft) / nScaling,
1997
(y * nStep - yTop) / nScaling,
1998
((x + 1) * nStep - xLeft) / nScaling,
1999
((y + 1) * nStep - yTop) / nScaling);
2003
_setcolor (_COLOR_GRAY);
2005
for (x = 0; x <= nRasterWidth; x++)
2007
_moveto ((x * nStep - xLeft) / nScaling,
2008
(0 - yTop) / nScaling);
2009
_lineto ((x * nStep - xLeft) / nScaling,
2010
(nRasterHeight * nStep - yTop) / nScaling);
2013
for (y = 0; y <= nRasterHeight; y++)
2015
_moveto ((0 - xLeft) / nScaling,
2016
(y * nStep - yTop) / nScaling);
2017
_lineto ((nRasterWidth * nStep - xLeft) / nScaling,
2018
(y * nStep - yTop) / nScaling);
2021
_setcolor (_COLOR_BLUE);
2023
for (y = 0; y <= nRasterHeight; y++)
2025
_rectangle (_GFILLINTERIOR,
2026
((nRasterWidth + 1) * nStep - xLeft) / nScaling,
2027
(y * nStep - yTop) / nScaling,
2028
((aRasterHystogram [y] + nRasterWidth + 1)
2029
* nStep - xLeft) / nScaling,
2030
((y + 1) * nStep - yTop) / nScaling);
2034
void LT_GraphicsTitle (const char *pTitle)
2036
// _setcolor (_COLOR_BACKGROUND);
2037
_setcolor (_COLOR_TEXT);
2038
_settextalign (_CENTER, _HALF); // _HALF("_HALPH")==_CENTER
2039
_grtext (320, 450, pTitle);
2042
/* новый вариант живет в "_graphics.c";
2046
if((c=getch())=='d'){
2047
void break_point_data (char * c);
2048
static char stop_here_byte=0;
2049
static unsigned short int * stop_here_check=0;
2051
break_point_data(&stop_here_byte);
2052
stop_here_byte++; break_point_data(0);
2058
static int yCurrentTop = 0;
2065
2059
static int xCurrentLeft = 0;
2066
2060
static int nCurrentScaling = MAX_SCALING;
2067
//��� ��� MAX_SCALING, ��� � MIN_SCALING, ==1,
2068
// ����� ����� �������, ��� nCurrentScaling==1
2061
//так как MAX_SCALING, как и MIN_SCALING, ==1,
2062
// можно смело считать, что nCurrentScaling==1
2070
2064
static void ScreenOutput (const char *pTitle,
2071
void (*pProcUpdate) (int xLeft, int yTop, int nScaling))
2065
void (*pProcUpdate) (int xLeft, int yTop, int nScaling))
2076
BOOL bNeedUpdateScreen = TRUE;
2080
if (bNeedUpdateScreen)
2082
(*pProcUpdate) (xCurrentLeft, yCurrentTop, nCurrentScaling);
2083
LT_GraphicsTitle (pTitle);
2088
switch (LT_Getch ())
2094
if (xCurrentLeft > 0)
2096
xCurrentLeft -= SCREEN_WIDTH / STEPS * nCurrentScaling;
2097
bNeedUpdateScreen = TRUE;
2103
if (xCurrentLeft + SCREEN_WIDTH / STEPS * nCurrentScaling < nWidth)
2106
if (xCurrentLeft < nWidth)
2108
xCurrentLeft += SCREEN_WIDTH / STEPS * nCurrentScaling;
2109
bNeedUpdateScreen = TRUE;
2114
if (yCurrentTop > 0)
2116
yCurrentTop -= SCREEN_HEIGHT / STEPS * nCurrentScaling;
2117
bNeedUpdateScreen = TRUE;
2123
if (yCurrentTop + SCREEN_HEIGHT / STEPS * nCurrentScaling < nHeight)
2126
if (yCurrentTop < nHeight)
2128
yCurrentTop += SCREEN_HEIGHT / STEPS * nCurrentScaling;
2129
bNeedUpdateScreen = TRUE;
2134
if (nCurrentScaling != MIN_SCALING)
2137
// xCurrentLeft = 0;
2138
nCurrentScaling /= 2;
2139
bNeedUpdateScreen = TRUE;
2144
if (nCurrentScaling != MAX_SCALING)
2147
// xCurrentLeft = 0;
2148
nCurrentScaling *= 2;
2149
bNeedUpdateScreen = TRUE;
2070
Bool bNeedUpdateScreen = TRUE;
2074
if (bNeedUpdateScreen)
2076
(*pProcUpdate) (xCurrentLeft, yCurrentTop, nCurrentScaling);
2077
LT_GraphicsTitle (pTitle);
2082
switch (LT_Getch ())
2088
if (xCurrentLeft > 0)
2090
xCurrentLeft -= SCREEN_WIDTH / STEPS * nCurrentScaling;
2091
bNeedUpdateScreen = TRUE;
2097
if (xCurrentLeft + SCREEN_WIDTH / STEPS * nCurrentScaling < nWidth)
2100
if (xCurrentLeft < nWidth)
2102
xCurrentLeft += SCREEN_WIDTH / STEPS * nCurrentScaling;
2103
bNeedUpdateScreen = TRUE;
2108
if (yCurrentTop > 0)
2110
yCurrentTop -= SCREEN_HEIGHT / STEPS * nCurrentScaling;
2111
bNeedUpdateScreen = TRUE;
2117
if (yCurrentTop + SCREEN_HEIGHT / STEPS * nCurrentScaling < nHeight)
2120
if (yCurrentTop < nHeight)
2122
yCurrentTop += SCREEN_HEIGHT / STEPS * nCurrentScaling;
2123
bNeedUpdateScreen = TRUE;
2128
if (nCurrentScaling != MIN_SCALING)
2131
// xCurrentLeft = 0;
2132
nCurrentScaling /= 2;
2133
bNeedUpdateScreen = TRUE;
2138
if (nCurrentScaling != MAX_SCALING)
2141
// xCurrentLeft = 0;
2142
nCurrentScaling *= 2;
2143
bNeedUpdateScreen = TRUE;
2154
2148
# ifdef LT_DEBUG
2155
LT_DebugGraphicsLevel = 0;
2149
LT_DebugGraphicsLevel = 0;
2157
2151
# ifdef SE_DEBUG
2158
SE_DebugGraphicsLevel = 0;
2152
SE_DebugGraphicsLevel = 0;
2163
bNeedUpdateScreen = FALSE;
2167
while (!bNeedUpdateScreen);
2157
bNeedUpdateScreen = FALSE;
2161
while (!bNeedUpdateScreen);
2171
2165
void LT_GraphicsRootsOutput (const char *pTitle)
2173
ScreenOutput (pTitle, RootsUpdate);
2167
ScreenOutput (pTitle, RootsUpdate);
2176
2170
void LT_GraphicsRootStripsOutput (char *pTitle)
2178
ScreenOutput (pTitle, RootStripsUpdate);
2172
ScreenOutput (pTitle, RootStripsUpdate);
2181
2175
void LT_GraphicsPageMatrixOutput (char *pTitle)
2183
ScreenOutput (pTitle, PageMatrixUpdate);
2177
ScreenOutput (pTitle, PageMatrixUpdate);
2186
2180
void LT_GraphicsBlocksOutput (const char *pTitle)
2188
BlocksSetRootsNumbers ();
2190
ScreenOutput (pTitle, BlocksUpdate);
2192
// if (pBlocksList != NULL)
2193
// BlocksSetRandomRootsNumbers ();
2182
BlocksSetRootsNumbers ();
2184
ScreenOutput (pTitle, BlocksUpdate);
2186
// if (pBlocksList != NULL)
2187
// BlocksSetRandomRootsNumbers ();
2196
2190
void LT_GraphicsHystogramOutput (const char *pTitle)
2198
ScreenOutput (pTitle, HystogramUpdate);
2192
ScreenOutput (pTitle, HystogramUpdate);
2201
2195
void LT_GraphicsSpecialCuttingOutput (char *pTitle)
2203
ScreenOutput (pTitle, SpecialCuttingUpdate);
2197
ScreenOutput (pTitle, SpecialCuttingUpdate);
2206
2200
void LT_GraphicsSB_MatrixOutput (char *pTitle)
2208
ScreenOutput (pTitle, SB_MatrixUpdate);
2202
ScreenOutput (pTitle, SB_MatrixUpdate);
2211
2205
void LT_GraphicsWSB_Hystogram_1_Output (char *pTitle)
2213
ScreenOutput (pTitle, WSB_Hystogram_1_Update);
2207
ScreenOutput (pTitle, WSB_Hystogram_1_Update);
2216
2210
void LT_GraphicsWSB_Hystogram_2_Output (char *pTitle)
2218
ScreenOutput (pTitle, WSB_Hystogram_2_Update);
2212
ScreenOutput (pTitle, WSB_Hystogram_2_Update);
2221
2215
void LT_GraphicsWSB_PointsOutput (char *pTitle)
2223
BlocksSetRootsNumbers ();
2224
ScreenOutput (pTitle, WSB_PointsUpdate);
2217
BlocksSetRootsNumbers ();
2218
ScreenOutput (pTitle, WSB_PointsUpdate);
2227
2221
void LT_GraphicsPictureRemovingConditionsOutput (char * pTitle)
2229
ScreenOutput (pTitle, PictureRemovingConditionsUpdate);
2223
ScreenOutput (pTitle, PictureRemovingConditionsUpdate);
2232
2226
void LT_GraphicsDD_RemovingConditionsOutput (char * pTitle)
2234
ScreenOutput (pTitle, DD_RemovingConditionsUpdate);
2228
ScreenOutput (pTitle, DD_RemovingConditionsUpdate);
2237
2231
void LT_GraphicsHighEmbeddingBlocksListOutput (char *pTitle)
2241
pBlocksListBegin = pHighEmbeddingBlocksList;
2242
oBlockNext = (BYTE *) &Dummy.pLowerEmbedding - (BYTE *) &Dummy;
2243
ScreenOutput (pTitle, BlocksListUpdate);
2235
pBlocksListBegin = pHighEmbeddingBlocksList;
2236
oBlockNext = (uchar *) &Dummy.pLowerEmbedding - (uchar *) &Dummy;
2237
ScreenOutput (pTitle, BlocksListUpdate);
2246
2240
void LT_GraphicsLowEmbeddingBlocksListOutput (char *pTitle)
2250
pBlocksListBegin = pLowEmbeddingBlocksList;
2251
oBlockNext = (BYTE *) &Dummy.pHigherEmbedding - (BYTE *) &Dummy;
2252
ScreenOutput (pTitle, BlocksListUpdate);
2244
pBlocksListBegin = pLowEmbeddingBlocksList;
2245
oBlockNext = (uchar *) &Dummy.pHigherEmbedding - (uchar *) &Dummy;
2246
ScreenOutput (pTitle, BlocksListUpdate);
2255
2249
void LT_GraphicsLeftBlocksListOutput (char *pTitle)
2259
pBlocksListBegin = pLeftBlocksList;
2260
oBlockNext = (BYTE *) &Dummy.pRight - (BYTE *) &Dummy;
2261
ScreenOutput (pTitle, BlocksListUpdate);
2253
pBlocksListBegin = pLeftBlocksList;
2254
oBlockNext = (uchar *) &Dummy.pRight - (uchar *) &Dummy;
2255
ScreenOutput (pTitle, BlocksListUpdate);
2264
2258
void LT_GraphicsRightBlocksListOutput (char *pTitle)
2268
pBlocksListBegin = pRightBlocksList;
2269
oBlockNext = (BYTE *) &Dummy.pLeft - (BYTE *) &Dummy;
2270
ScreenOutput (pTitle, BlocksListUpdate);
2262
pBlocksListBegin = pRightBlocksList;
2263
oBlockNext = (uchar *) &Dummy.pLeft - (uchar *) &Dummy;
2264
ScreenOutput (pTitle, BlocksListUpdate);
2273
2267
void LT_GraphicsTopBlocksListOutput (char *pTitle)
2277
pBlocksListBegin = pTopBlocksList;
2278
oBlockNext = (BYTE *) &Dummy.pDown - (BYTE *) &Dummy;
2279
ScreenOutput (pTitle, BlocksListUpdate);
2271
pBlocksListBegin = pTopBlocksList;
2272
oBlockNext = (uchar *) &Dummy.pDown - (uchar *) &Dummy;
2273
ScreenOutput (pTitle, BlocksListUpdate);
2282
2276
void LT_GraphicsBottomBlocksListOutput (char *pTitle)
2286
pBlocksListBegin = pBottomBlocksList;
2287
oBlockNext = (BYTE *) &Dummy.pUp - (BYTE *) &Dummy;
2288
ScreenOutput (pTitle, BlocksListUpdate);
2280
pBlocksListBegin = pBottomBlocksList;
2281
oBlockNext = (uchar *) &Dummy.pUp - (uchar *) &Dummy;
2282
ScreenOutput (pTitle, BlocksListUpdate);
2291
2285
/********** ATAL 940414
2292
void LT_GraphicsTreeOutput (char *pTitle)
2294
ScreenOutput (pTitle, TreeUpdate);
2286
void LT_GraphicsTreeOutput (char *pTitle)
2288
ScreenOutput (pTitle, TreeUpdate);
2298
2292
void LT_GraphicsBlocksOrderOutput (char *pTitle)
2300
ScreenOutput (pTitle, BlocksOrderUpdate);
2294
ScreenOutput (pTitle, BlocksOrderUpdate);
2303
2297
void LT_GraphicsCurrentStringOutput (const char *pTitle)
2305
ScreenOutput (pTitle, CurrentStringUpdate);
2299
ScreenOutput (pTitle, CurrentStringUpdate);
2308
2302
void LT_GraphicsStringsOutput (const char *pTitle)
2310
ScreenOutput (pTitle, StringsUpdate);
2304
ScreenOutput (pTitle, StringsUpdate);
2313
2307
void LT_GraphicsStringsForwardOrderOutput (const char *pTitle)
2315
ScreenOutput (pTitle, StringsForwardOrderUpdate);
2309
ScreenOutput (pTitle, StringsForwardOrderUpdate);
2318
2312
void LT_GraphicsStringsBackwardOrderOutput (const char *pTitle)
2320
ScreenOutput (pTitle, StringsBackwardOrderUpdate);
2314
ScreenOutput (pTitle, StringsBackwardOrderUpdate);
2323
2317
void LT_GraphicsStringsUpOrderOutput (const char *pTitle)
2325
ScreenOutput (pTitle, StringsUpOrderUpdate);
2319
ScreenOutput (pTitle, StringsUpOrderUpdate);
2328
2322
void LT_GraphicsStringsDownOrderOutput (const char *pTitle)
2330
ScreenOutput (pTitle, StringsDownOrderUpdate);
2324
ScreenOutput (pTitle, StringsDownOrderUpdate);
2333
2327
void LT_GraphicsRasterOutput (const char *pTitle)
2335
ScreenOutput (pTitle, RasterUpdate);
2329
ScreenOutput (pTitle, RasterUpdate);
2338
2332
void LT_GraphicsBreakingOutput (const char *pTitle)
2340
ScreenOutput (pTitle, BreakingUpdate);
2334
ScreenOutput (pTitle, BreakingUpdate);
2343
2337
void LT_GraphicsBlockOutput2 (char *pTitle)
2349
_setcolor (NUMBER_TO_COLOR (pDebugBlock -> nNumber) | 8);
2351
BlockRectangle (pDebugBlock, _GBORDER,
2352
xCurrentLeft, yCurrentTop, nCurrentScaling);
2354
for (pRoot = pDebugBlock -> pRoots; pRoot != NULL; pRoot = pRoot -> u1.pNext)
2356
_rectangle (_GFILLINTERIOR,
2358
- xCurrentLeft) / nCurrentScaling,
2360
- yCurrentTop) / nCurrentScaling,
2361
(pRoot -> xColumn + pRoot -> nWidth - 1
2362
- xCurrentLeft) / nCurrentScaling,
2363
(pRoot -> yRow + pRoot -> nHeight - 1
2364
- yCurrentTop) / nCurrentScaling);
2367
_setcolor (_COLOR_RED);
2368
_moveto ((xDebugVertLine - xCurrentLeft) / nCurrentScaling, 0);
2369
_lineto ((xDebugVertLine - xCurrentLeft) / nCurrentScaling, SCREEN_HEIGHT);
2371
LT_GraphicsTitle (pTitle);
2343
_setcolor (NUMBER_TO_COLOR (pDebugBlock -> nNumber) | 8);
2345
BlockRectangle (pDebugBlock, _GBORDER,
2346
xCurrentLeft, yCurrentTop, nCurrentScaling);
2348
for (pRoot = pDebugBlock -> pRoots; pRoot != NULL; pRoot = pRoot -> u1.pNext)
2350
_rectangle (_GFILLINTERIOR,
2352
- xCurrentLeft) / nCurrentScaling,
2354
- yCurrentTop) / nCurrentScaling,
2355
(pRoot -> xColumn + pRoot -> nWidth - 1
2356
- xCurrentLeft) / nCurrentScaling,
2357
(pRoot -> yRow + pRoot -> nHeight - 1
2358
- yCurrentTop) / nCurrentScaling);
2361
_setcolor (_COLOR_RED);
2362
_moveto ((xDebugVertLine - xCurrentLeft) / nCurrentScaling, 0);
2363
_lineto ((xDebugVertLine - xCurrentLeft) / nCurrentScaling, SCREEN_HEIGHT);
2365
LT_GraphicsTitle (pTitle);
2374
2368
void LT_GraphicsPictureRemovingConditionsOutput2 (char *pTitle)
2376
PictureRemovingConditionsUpdate (0, 0, MAX_SCALING);
2377
LT_GraphicsTitle (pTitle);
2370
PictureRemovingConditionsUpdate (0, 0, MAX_SCALING);
2371
LT_GraphicsTitle (pTitle);
2379
2373
void LT_ShowBlock (char *pTitle)
2381
ShowBlock(0, 0, MAX_SCALING);
2382
LT_GraphicsTitle (pTitle);
2375
ShowBlock(0, 0, MAX_SCALING);
2376
LT_GraphicsTitle (pTitle);
2385
2379
void LT_GraphicsDD_RemovingConditionsOutput2 (char *pTitle)
2387
DD_RemovingConditionsUpdate (0, 0, MAX_SCALING);
2388
LT_GraphicsTitle (pTitle);
2381
DD_RemovingConditionsUpdate (0, 0, MAX_SCALING);
2382
LT_GraphicsTitle (pTitle);
2391
2385
void LT_GraphicsLinearRemovingConditionsOutput2 (char *pTitle)
2393
int xLeft, yTop, nScaling;
2394
char szTextBuffer [32];
2395
BLOCK *p = pDebugBlock;
2397
xLeft = xCurrentLeft;
2399
nScaling = nCurrentScaling;
2401
// ������������ �����, ��� xCurrentLeft � yCurrentTop
2402
// ����� ���� ���������� �� ����...
2403
xCurrentLeft = p -> Rect.xLeft - 1;
2404
yCurrentTop = p -> Rect.yTop - 1;
2405
nCurrentScaling = MIN_SCALING;
2407
LT_GraphicsClearScreen ();
2408
LT_GraphicsBlockOutput2 (pTitle);
2410
xCurrentLeft = xLeft;
2412
nCurrentScaling = nScaling;
2414
sprintf (szTextBuffer,
2416
"W %d H %d H/W %5.2f W/H %5.2f\n",
2418
p -> nRoots - p -> nLetters - p -> nDust,
2421
p -> Rect.xRight - p -> Rect.xLeft + 1,
2422
p -> Rect.yBottom - p -> Rect.yTop + 1,
2423
(double) (p -> Rect.yBottom - p -> Rect.yTop + 1) /
2424
(p -> Rect.xRight - p -> Rect.xLeft + 1),
2425
(double) (p -> Rect.xRight - p -> Rect.xLeft + 1) /
2426
(p -> Rect.yBottom - p -> Rect.yTop + 1)
2429
LT_GraphicsTitle (szTextBuffer);
2387
int xLeft, yTop, nScaling;
2388
char szTextBuffer [32];
2389
BLOCK *p = pDebugBlock;
2391
xLeft = xCurrentLeft;
2393
nScaling = nCurrentScaling;
2395
// единственное место, где xCurrentLeft и yCurrentTop
2396
// имеют шанс отличиться от нуля...
2397
xCurrentLeft = p -> Rect.xLeft - 1;
2398
yCurrentTop = p -> Rect.yTop - 1;
2399
nCurrentScaling = MIN_SCALING;
2401
LT_GraphicsClearScreen ();
2402
LT_GraphicsBlockOutput2 (pTitle);
2404
xCurrentLeft = xLeft;
2406
nCurrentScaling = nScaling;
2408
sprintf (szTextBuffer,
2410
"W %d H %d H/W %5.2f W/H %5.2f\n",
2412
p -> nRoots - p -> nLetters - p -> nDust,
2415
p -> Rect.xRight - p -> Rect.xLeft + 1,
2416
p -> Rect.yBottom - p -> Rect.yTop + 1,
2417
(double) (p -> Rect.yBottom - p -> Rect.yTop + 1) /
2418
(p -> Rect.xRight - p -> Rect.xLeft + 1),
2419
(double) (p -> Rect.xRight - p -> Rect.xLeft + 1) /
2420
(p -> Rect.yBottom - p -> Rect.yTop + 1)
2423
LT_GraphicsTitle (szTextBuffer);
2433
2427
// Pit 11-21-94 04:56pm
2434
2428
#include "edp.h"
2435
INT maxx,minx,maxy,miny;
2438
static void part_minmax(DP * part)
2441
for(p=part->first;p;p++){
2443
if(p==part->last)break;
2446
for(p=part;p;p=p->next){
2447
if(maxx<p->x+p->w) maxx=p->x+p->w;
2448
if(minx>p->x ) minx=p->x;
2449
if(maxy<p->y+p->h) maxy=p->y+p->h;
2450
if(miny>p->y ) miny=p->y;
2429
int16_t maxx, minx, maxy, miny;
2432
static void part_minmax(DP * part) {
2434
for (p = part->first; p; p++) {
2436
if (p == part->last)
2440
for (p = part; p; p = p->next) {
2441
if (maxx < p->x + p->w)
2445
if (maxy < p->y + p->h)
2454
static void part_graph(DP * part,INT level){
2457
for(p=part->first; p;p++){
2458
part_graph(p,level+1);
2459
_setcolor((p-part->first)%8+7);
2461
if(p->parent && p->parent->type&(VERT|TERM) &&
2462
p->parent->y && p->parent->h){
2463
_moveto ((p->x - minx)/scale,p->parent->y/scale);
2464
_lineto ((p->x - minx)/scale,(p->parent->y + p->parent->h)/scale);
2465
_moveto ((p->x - minx + p->w)/scale,p->parent->y/scale);
2466
_lineto ((p->x - minx + p->w)/scale,(p->parent->y + p->parent->h)/scale);
2469
_moveto ((p->x - minx)/scale,0);
2470
_lineto ((p->x - minx)/scale,(maxy-miny)/scale);
2471
_moveto ((p->x - minx + p->w)/scale,0);
2472
_lineto ((p->x - minx + p->w)/scale,(maxy-miny)/scale);
2476
else if(p->type&(VERT|TERM)){
2477
if(p->parent && p->parent->type&(HOR) &&
2478
p->parent->x && p->parent->w){
2479
_moveto (p->parent->x/scale ,(p->y - miny)/scale);
2480
_lineto ((p->parent->x+p->parent->w)/scale,(p->y - miny)/scale);
2481
_moveto (p->parent->x/scale ,(p->y - miny + p->h)/scale);
2482
_lineto ((p->parent->x+p->parent->w)/scale,(p->y - miny + p->h)/scale);
2485
_moveto (0, (p->y - miny)/scale);
2486
_lineto ((maxx-minx)/scale,(p->y - miny)/scale);
2487
_moveto (0, (p->y - miny + p->h)/scale);
2488
_lineto ((maxx-minx)/scale,(p->y - miny + p->h)/scale);
2452
static void part_graph(DP * part, int16_t level) {
2455
for (p = part->first; p; p++) {
2456
part_graph(p, level + 1);
2457
_setcolor((p - part->first) % 8 + 7);
2458
if (p->type & HOR) {
2459
if (p->parent && p->parent->type & (VERT | TERM) && p->parent->y
2461
_moveto((p->x - minx) / scale, p->parent->y / scale);
2462
_lineto((p->x - minx) / scale, (p->parent->y + p->parent->h)
2464
_moveto((p->x - minx + p->w) / scale, p->parent->y / scale);
2465
_lineto((p->x - minx + p->w) / scale, (p->parent->y
2466
+ p->parent->h) / scale);
2468
_moveto((p->x - minx) / scale, 0);
2469
_lineto((p->x - minx) / scale, (maxy - miny) / scale);
2470
_moveto((p->x - minx + p->w) / scale, 0);
2471
_lineto((p->x - minx + p->w) / scale, (maxy - miny) / scale);
2474
} else if (p->type & (VERT | TERM)) {
2475
if (p->parent && p->parent->type & (HOR) && p->parent->x
2477
_moveto(p->parent->x / scale, (p->y - miny) / scale);
2478
_lineto((p->parent->x + p->parent->w) / scale, (p->y - miny)
2480
_moveto(p->parent->x / scale, (p->y - miny + p->h) / scale);
2481
_lineto((p->parent->x + p->parent->w) / scale, (p->y - miny
2484
_moveto(0, (p->y - miny) / scale);
2485
_lineto((maxx - minx) / scale, (p->y - miny) / scale);
2486
_moveto(0, (p->y - miny + p->h) / scale);
2487
_lineto((maxx - minx) / scale, (p->y - miny + p->h) / scale);
2490
if (p == part->last)
2491
if(p==part->last)break;