Beispiel #1
0
void LT_GraphicsBlocksOutput (const char *pTitle)
{
    BlocksSetRootsNumbers ();

    ScreenOutput (pTitle, BlocksUpdate);

}
Beispiel #2
0
void BlocksDisAbsorbBoundaryDust (void)     /* STDG4, STDG19 */
{
    BLOCK *p, *q;
    ROOT *pRoot, *pPrev;
    RECTANGLE rExt;
    int  dxExt, dyExt;
    ROOT *pRootsBegin, *pRootsAfter;

    BlocksSetRootsNumbers ();

    for (p = pBlocksList; p != NULL; p = p -> pNext)
    {
        for (q = p -> pNext; q != NULL; q = q -> pNext)
        {
            if (RectIsCrossed (& p -> Rect, & q -> Rect))
            {
                p -> uFlags |= BF_CROSSED;
                q -> uFlags |= BF_CROSSED;
            }
        }
    }

    for (p = pBlocksList; p != NULL; p = p -> pNext)
    {
        if (p -> Type != BLOCK_TEXT || ! (p -> uFlags & BF_CROSSED))
            continue;

        dxExt = 3 * MAX (p -> nAverageHeight, MAX_DUST_WIDTH);
        dyExt = MAX (p -> nAverageHeight, MAX_DUST_HEIGHT);

        rExt.xLeft   = p -> Rect.xLeft   - dxExt;
        rExt.yTop    = p -> Rect.yTop    - dyExt;
        rExt.xRight  = p -> Rect.xRight  + dxExt;
        rExt.yBottom = p -> Rect.yBottom + dyExt;

        RootStripsGetLoopParameters
        (
            rExt.yTop,
            rExt.yBottom,
            &pRootsBegin,
            &pRootsAfter
        );

        if (pRootsBegin == NULL)
            continue;

        for (pRoot = pRootsBegin; pRoot < pRootsAfter; pRoot++)
        {
            if (pRoot -> nBlock != p -> nNumber                       &&
                pRoot -> nBlock != DUST_BLOCK_NUMBER                  &&
                IS_LAYOUT_DUST (*pRoot)                               &&
                pRoot -> yRow                         >= rExt.yTop    &&
                pRoot -> xColumn                      >= rExt.xLeft   &&
                pRoot -> yRow    + pRoot->nHeight - 1 <= rExt.yBottom &&
                pRoot -> xColumn + pRoot->nWidth  - 1 <= rExt.xRight)
            {
                pRoot -> nBlock = DUST_BLOCK_NUMBER;
            }
        }
    }

    for (p = pBlocksList; p != NULL; p = p -> pNext)
    {
        if (p -> Type != BLOCK_TEXT)
            continue;

        while (p -> pRoots != NULL &&
               p -> pRoots -> nBlock == DUST_BLOCK_NUMBER)
        {
            p -> nRoots --;
            p -> nDust --;

            if (p -> pRoots -> bType & ROOT_LETTER)
                p -> nLetters--;

            p -> pRoots = p -> pRoots -> u1.pNext;
        }

        if (p -> pRoots == NULL)
        {
            p -> pEndRoots = NULL;
            continue;
        }

        pPrev = p -> pRoots;
        pRoot = p -> pRoots -> u1.pNext;

        while (pRoot != NULL)
        {
            if (pRoot -> nBlock == DUST_BLOCK_NUMBER)
            {
                p -> nRoots --;
                p -> nDust  --;

                if (pRoot -> bType & ROOT_LETTER)
                    p -> nLetters--;

                pPrev -> u1.pNext = pRoot -> u1.pNext;
                pRoot          = pRoot -> u1.pNext;
            }
            else
            {
                pPrev = pRoot;
                pRoot = pRoot -> u1.pNext;
            }
        }

        if (p -> pEndRoots != pPrev)
            p -> pEndRoots = pPrev;
    }
}
Beispiel #3
0
void BlocksAbsorbDust (void)
{
    BLOCK *p;
    ROOT *pRoot;
    ROOT *pRootsBegin, *pRootsAfter;
	//Bool32 WasExtendedUp;
	//Bool32 WasExtendedDown;
	int32_t xLeft, yTop, yBottom, xRight;


    BlocksSetRootsNumbers ();

    for (p = pHighEmbeddingBlocksList;
	p != NULL;
	p = p -> pLowerEmbedding)
    {
        if (p -> Type != BLOCK_TEXT)
            continue;

        RootStripsGetLoopParameters
			(
            p -> Rect.yTop,
            p -> Rect.yBottom,
            &pRootsBegin,
            &pRootsAfter
			);

        if (pRootsBegin == NULL)
            continue;

        for (pRoot = pRootsBegin; pRoot < pRootsAfter; pRoot++)
        {
            if (pRoot -> nBlock == DUST_BLOCK_NUMBER &&
                pRoot -> yRow                           >= p -> Rect.yTop    &&
                pRoot -> xColumn                        >= p -> Rect.xLeft   &&
                pRoot -> yRow    + pRoot -> nHeight - 1 <= p -> Rect.yBottom &&
                pRoot -> xColumn + pRoot -> nWidth  - 1 <= p -> Rect.xRight  &&
                ! (PageMatrixFlagsByIdealXY (pRoot -> xColumn, pRoot -> yRow)
				& PMC_PICTURE))
            {
                BlockAccountRoot (p, pRoot);
                pRoot -> nBlock = p -> nNumber;
            }
        }
    }

	for (p = pBlocksList; p != NULL; p = p -> pNext)
    {
		//WasExtendedUp = FALSE; //Rom
		//WasExtendedDown = FALSE; //Rom
		yTop    = p -> Rect.yTop;
		xLeft   = p -> Rect.xLeft;
		yBottom = p -> Rect.yBottom;
		xRight  = p -> Rect.xRight;

	// ******************** Rom 23-02-99 ***************
	// Trying include border dust
		for (pRoot = pRoots; pRoot < pAfterRoots; pRoot++)
		{
			/*
			if (pRoot -> nBlock == DUST_BLOCK_NUMBER ||
				pRoot -> nBlock == REMOVED_BLOCK_NUMBER)
			{
				continue;
			}
			*/

			/*  ????? Rom 16-08-99
			if (pRoot -> nBlock != DUST_BLOCK_NUMBER &&
				pRoot -> nBlock != REMOVED_BLOCK_NUMBER)
			{
				continue;
			}
			*/

			if (IS_LAYOUT_DUST (*pRoot))
			{
				TryingAddBorderDust (p, pRoot,&yTop, &yBottom, &xLeft, &xRight);
			}
		}
		p -> Rect.yTop    = yTop;
		p -> Rect.xLeft   = xLeft;
		p -> Rect.yBottom = yBottom;
		p -> Rect.xRight  = xRight;
	// *************************************************
	}
}