21#include <osl/diagnose.h>
56 const bool bIgnorePoints)
96 while (pPoint !=
nullptr)
100 pPointCopy->
mnX = pPoint->
mnX;
105 if (pPrevPointCopy !=
nullptr)
110 pPrevPointCopy = pPointCopy;
145 while ( pRegionBandPoint )
158 delete pSaveRegionBandPoint;
176 delete pRegionBandPoint;
179 pRegionBandPoint = pNextBandPoint;
183 delete pRegionBandPoint;
193 bool bEndPoint,
LineType eLineType )
209 while( pRegionBandPoint )
211 if ( pRegionBandPoint->
mnLineId == nLineId )
221 pRegionBandPoint->
mnX = nX;
228 if( !pLastTestedRegionBandPoint )
233 delete pSaveBandPoint;
239 delete pRegionBandPoint;
251 pLastTestedRegionBandPoint = pRegionBandPoint;
259 pLastTestedRegionBandPoint =
nullptr;
260 while ( pRegionBandPoint )
263 if ( nX <= pRegionBandPoint->mnX )
266 pNewRegionBandPoint->
mnX = nX;
267 pNewRegionBandPoint->
mnLineId = nLineId;
273 if ( !pLastTestedRegionBandPoint )
282 pLastTestedRegionBandPoint = pRegionBandPoint;
288 pNewRegionBandPoint->
mnX = nX;
289 pNewRegionBandPoint->
mnLineId = nLineId;
366 SAL_WARN_IF( nXLeft > nXRight,
"vcl",
"ImplRegionBand::Union(): nxLeft > nXRight" );
386 if ( (nXLeft >= pSep->
mnXLeft) && (nXRight <= pSep->mnXRight) )
390 if ( nXRight < pSep->mnXLeft )
406 if ( (nXRight >= pSep->
mnXLeft) && (nXLeft <= pSep->mnXLeft) )
410 if ( (nXLeft <= pSep->mnXRight) && (nXRight > pSep->
mnXRight) )
438 SAL_WARN_IF( nXLeft > nXRight,
"vcl",
"ImplRegionBand::Intersect(): nxLeft > nXRight" );
452 if ( (nXRight < pSep->mnXLeft) || (nXLeft > pSep->
mnXRight) )
457 if ( (nXLeft <= pSep->mnXLeft) &&
458 (nXRight <= pSep->mnXRight) &&
463 if ( (nXLeft >= pSep->
mnXLeft) &&
464 (nXLeft <= pSep->mnXRight) &&
469 if ( (nXLeft >= pSep->
mnXLeft) && (nXRight <= pSep->mnXRight) )
483 SAL_WARN_IF( nXLeft > nXRight,
"vcl",
"ImplRegionBand::Exclude(): nxLeft > nXRight" );
498 bool bSepProcessed =
false;
501 if ( (nXLeft <= pSep->mnXLeft) && (nXRight >= pSep->
mnXRight) )
505 bSepProcessed =
true;
509 if ( !bSepProcessed )
511 if ( (nXRight >= pSep->
mnXLeft) && (nXLeft <= pSep->mnXLeft) )
514 bSepProcessed =
true;
519 if ( !bSepProcessed )
521 if ( (nXLeft <= pSep->mnXRight) && (nXRight > pSep->
mnXRight) )
524 bSepProcessed =
true;
530 if ( !bSepProcessed )
532 if ( (nXLeft >= pSep->
mnXLeft) && (nXRight <= pSep->mnXRight) )
561 SAL_WARN_IF( nXLeft > nXRight,
"vcl",
"ImplRegionBand::XOr(): nxLeft > nXRight" );
631 if( nXLeft <= nOldRight )
633 if( nXRight < nOldLeft )
655 else if( nXLeft == nOldLeft && nXRight == nOldRight )
662 else if( nXLeft != nOldLeft && nXRight == nOldRight )
665 if( nXLeft < nOldLeft )
681 else if( nXLeft == nOldLeft && nXRight != nOldRight )
685 if( nXRight > nOldRight )
687 nXLeft = nOldRight+1;
704 SAL_WARN_IF( nXLeft == nOldLeft || nXRight == nOldRight,
"vcl",
705 "ImplRegionBand::XOr(): Case 4,5,6,7 expected all coordinates to be not equal!" );
739 if( nXLeft < nOldLeft )
740 ::std::swap( nOldLeft, nXLeft );
744 if( nXRight < nOldRight )
746 ::std::swap( nOldRight, nXRight );
754 SAL_WARN_IF( nOldLeft==nXLeft || nXLeft>nOldRight || nOldRight>=nXRight,
"vcl",
755 "ImplRegionBand::XOr(): Case 4,5,6,7 expected coordinates to be ordered now!" );
760 nXLeft = nOldRight+1;
787 if( pPrevSep && nXLeft >= pPrevSep->
mnXRight )
818 SAL_WARN_IF(
mpFirstSep ==
nullptr,
"vcl",
"ImplRegionBand::XLeftBoundary -> no separation in band!");
825 SAL_WARN_IF(
mpFirstSep ==
nullptr,
"vcl",
"ImplRegionBand::XRightBoundary -> no separation in band!" );
839 while ( pOwnRectBandSep && pSecondRectBandSep )
844 if ( nOwnXLeft != nSecondXLeft )
849 if ( nOwnXRight != nSecondXRight )
853 pOwnRectBandSep = pOwnRectBandSep->
mpNextSep;
856 pSecondRectBandSep = pSecondRectBandSep->
mpNextSep;
860 return !(pOwnRectBandSep || pSecondRectBandSep);
void Union(tools::Long nXLeft, tools::Long nXRight)
void Intersect(tools::Long nXLeft, tools::Long nXRight)
ImplRegionBand * mpPrevBand
tools::Long GetXRightBoundary() const
ImplRegionBandPoint * mpFirstBandPoint
bool InsertPoint(tools::Long nX, tools::Long nLineID, bool bEndPoint, LineType eLineType)
bool operator==(const ImplRegionBand &rRegionBand) const
void XOr(tools::Long nXLeft, tools::Long nXRight)
void Exclude(tools::Long nXLeft, tools::Long nXRight)
bool Contains(tools::Long nX)
tools::Long GetXLeftBoundary() const
void MoveX(tools::Long nHorzMove)
ImplRegionBand(tools::Long nYTop, tools::Long nYBottom)
ImplRegionBand * mpNextBand
ImplRegionBand * SplitBand(const sal_Int32 nY)
Split the called band at the given vertical coordinate.
void ScaleX(double fHorzScale)
ImplRegionBandSep * mpFirstSep
tools::Long FRound(double fVal)
#define SAL_WARN_IF(condition, area, stream)
ImplRegionBandPoint * mpNextBandPoint
ImplRegionBandSep * mpNextSep