21#include <osl/diagnose.h>
40 : mpImplPolyPolygon( rPoly )
49 : mpImplPolyPolygon( rPolyPoly.mpImplPolyPolygon )
54 : mpImplPolyPolygon( std::move(rPolyPoly.mpImplPolyPolygon) )
74 assert(
nPos <
Count() &&
"PolyPolygon::Remove(): nPos >= nSize");
81 assert(
nPos <
Count() &&
"PolyPolygon::Replace(): nPos >= nSize");
88 assert(
nPos <
Count() &&
"PolyPolygon::GetObject(): nPos >= nSize");
108 if(!(
bool(nOptimizeFlags) &&
Count()))
112 bool bIsCurve(
false);
114 for(sal_uInt16
a(0); !bIsCurve &&
a <
Count();
a++)
116 if((*
this)[
a].HasFlags())
124 OSL_ENSURE(
false,
"Optimize does *not* support curves, falling back to AdaptiveSubdivide()...");
135 sal_uInt16 nPercent = 0;
155 if(
bool(nOptimizeFlags) )
170 rResult.
Insert( aPolygon );
176 sal_uInt16
i, nPolys = rPolyPoly.
Count();
178 for(
i=0;
i<nPolys; ++
i )
239 if( nHorzMove || nVertMove )
243 for ( sal_uInt16
i = 0;
i < nPolyCount;
i++ )
264 nAngle10 %= 3600_deg10;
268 const double fAngle =
toRadians(nAngle10);
269 Rotate( rCenter, sin( fAngle ), cos( fAngle ) );
290 for (
i = 0;
i < nPolyCount;
i++ )
310 for (
i = 0;
i < nPolyCount;
i++ )
314 if (
GetObject( nPolyCount-1 ).GetSize() <= 2 )
326 for ( sal_uInt16
n = 0;
n < nPolyCount;
n++ )
330 sal_uInt16 nPointCount = pPoly->
GetSize();
332 for ( sal_uInt16
i = 0;
i < nPointCount;
i++ )
334 const Point* pPt = &pAry[
i ];
338 nXMin = nXMax = pPt->
X();
339 nYMin = nYMax = pPt->
Y();
344 if ( pPt->
X() < nXMin )
346 if ( pPt->
X() > nXMax )
348 if ( pPt->
Y() < nYMin )
350 if ( pPt->
Y() > nYMax )
364 assert(
nPos <
Count() &&
"PolyPolygon::[](): nPos >= nSize");
377 mpImplPolyPolygon = std::move(rPolyPoly.mpImplPolyPolygon);
388 sal_uInt16 nPolyCount(0);
393 const size_t nMinRecordSize =
sizeof(sal_uInt16);
394 const size_t nMaxRecords = rIStream.
remainingSize() / nMinRecordSize;
395 if (nPolyCount > nMaxRecords)
397 SAL_WARN(
"tools",
"Parsing error: " << nMaxRecords <<
398 " max possible entries, but " << nPolyCount <<
" claimed, truncating");
399 nPolyCount = nMaxRecords;
407 for ( sal_uInt16
i = 0;
i < nPolyCount;
i++ )
426 for ( sal_uInt16
i = 0;
i < nPolyCount;
i++ )
436 sal_uInt16 nPolyCount(0);
441 const size_t nMinRecordSize =
sizeof(sal_uInt16);
442 const size_t nMaxRecords = rIStream.
remainingSize() / nMinRecordSize;
443 if (nPolyCount > nMaxRecords)
445 SAL_WARN(
"tools",
"Parsing error: " << nMaxRecords <<
446 " max possible entries, but " << nPolyCount <<
" claimed, truncating");
447 nPolyCount = nMaxRecords;
454 for ( sal_uInt16
i = 0;
i < nPolyCount;
i++ )
474 for ( sal_uInt16
i = 0;
i < nPolyCount;
i++ )
494 : mpImplPolyPolygon(rPolyPolygon)
502 const sal_uInt16
nCount(sal_uInt16(rPolyPolygon.
count()));
504 "PolyPolygon::PolyPolygon: Too many sub-polygons in given basegfx::B2DPolyPolygon (!)");
constexpr tools::Long Y() const
constexpr tools::Long X() const
SvStream & WriteUInt16(sal_uInt16 nUInt16)
SvStream & ReadUInt16(sal_uInt16 &rUInt16)
sal_uInt64 remainingSize()
B2DPolygon const & getB2DPolygon(sal_uInt32 nIndex) const
void append(const B2DPolygon &rPolygon, sal_uInt32 nCount=1)
#define DBG_ASSERT(sCon, aError)
#define SAL_WARN(area, stream)
B2DPolyPolygon prepareForPolygonOperation(const B2DPolygon &rCandidate)
B2DPolyPolygon solvePolygonOperationOr(const B2DPolyPolygon &rCandidateA, const B2DPolyPolygon &rCandidateB)
B2DPolyPolygon clipPolyPolygonOnRange(const B2DPolyPolygon &rCandidate, const B2DRange &rRange, bool bInside, bool bStroke)
B2DPolyPolygon solvePolygonOperationAnd(const B2DPolyPolygon &rCandidateA, const B2DPolyPolygon &rCandidateB)
ImplPolyPolygon(sal_uInt16 nInitSize)
std::vector< tools::Polygon > mvPolyAry