36 if(rCandidate.
count())
46 aRetval.
append(rCandidate);
55 aRetval.
append(rCandidate);
64 aRetval.
append(rCandidate);
73 aRetval.
append(rCandidate);
83 const double fSmallExtension((aCandidateRange.
getWidth() + aCandidateRange.
getHeight()) * (0.5 * 0.1));
85 bParallelToXAxis ? aCandidateRange.
getMinX() - fSmallExtension : fValueOnOtherAxis,
86 bParallelToXAxis ? fValueOnOtherAxis : aCandidateRange.
getMinY() - fSmallExtension);
88 bParallelToXAxis ? aCandidateRange.
getMaxX() + fSmallExtension : fValueOnOtherAxis,
89 bParallelToXAxis ? fValueOnOtherAxis : aCandidateRange.
getMaxY() + fSmallExtension);
91 const sal_uInt32 nPointCount(aCandidate.
count());
92 const sal_uInt32 nEdgeCount(aCandidate.
isClosed() ? nPointCount : nPointCount - 1);
96 for(sal_uInt32
a(0);
a < nEdgeCount;
a++)
100 const bool bInside(bParallelToXAxis ?
122 if(bStroke && aRun.
count())
165 const sal_uInt32 nPolygonCount(rCandidate.
count());
168 for(sal_uInt32
a(0);
a < nPolygonCount;
a++)
172 if(aClippedPolyPolygon.
count())
174 aRetval.
append(aClippedPolyPolygon);
208 if(rRange.
isInside(aCandidateRange))
246 if(aRetval.
count() == 1)
258 if(aRetval.
count() == 1)
270 if(aRetval.
count() == 1)
287 const sal_uInt32 nPolygonCount(rCandidate.
count());
312 for(sal_uInt32
a(0);
a < nPolygonCount;
a++)
316 if(aClippedPolyPolygon.
count())
318 aRetval.
append(aClippedPolyPolygon);
335 bool bInside,
bool bStroke,
size_t* pPointLimit)
348 for(sal_uInt32
a(0);
a < rCandidate.
count();
a++)
352 const sal_uInt32 nPointCount(aCandidate.
count());
353 const sal_uInt32 nEdgeCount(aCandidate.
isClosed() ? nPointCount : nPointCount - 1);
357 for(sal_uInt32 b(0); b < nEdgeCount; b++)
433 if(aIntersectionRange.
isEmpty())
471 aMergePolyPolygonA.
flip();
478 if (pPointLimit && !*pPointLimit)
480 SAL_WARN(
"basegfx",
"clipPolyPolygonOnPolyPolygon hit point limit");
490 aRetval.
append(aMergePolyPolygonA);
491 aRetval.
append(aMergePolyPolygonB);
542 struct scissor_plane {
565 scissor_plane
const *pPlane,
569 sal_uInt32 out_count=0;
572 for(sal_uInt32
i=0;
i<in_count;
i++) {
583 out_vertex[out_count++] = *next;
585 else if((clip&0x0f) && (clip&0xf0)) {
587 else if((clip&0x0f) && (clip&0xf0)==0) {
593 double denominator = pPlane->nx*dir.
getX() +
594 pPlane->ny*dir.
getY();
595 double numerator = pPlane->nx*curr->
getX() +
596 pPlane->ny*curr->
getY() +
598 double t = -numerator/denominator;
604 out_vertex[out_count++] = intersection;
606 else if((clip&0x0f)==0 && (clip&0xf0)) {
612 double denominator = pPlane->nx*dir.
getX() +
613 pPlane->ny*dir.
getY();
614 double numerator = pPlane->nx*curr->
getX() +
615 pPlane->ny*curr->
getY() +
617 double t = -numerator/denominator;
623 out_vertex[out_count++] = intersection;
624 out_vertex[out_count++] = *next;
636 if( !(rCandidate.
count()%3) )
638 const int scissor_plane_count = 4;
640 scissor_plane sp[scissor_plane_count];
660 const sal_uInt32 nVertexCount = rCandidate.
count();
759 unsigned int clipflag = 0;
769 clipflag |= unsigned(!(rRange.
isInside(stack[2])));
783 sal_uInt32 vertex_count = 3;
792 if(vertex_count >= 3)
797 for(sal_uInt32
i=2;
i<vertex_count; ++
i)
const B2DPoint & getStartPoint() const
const B2DPoint & getControlPointB() const
B2DPoint interpolatePoint(double t) const
const B2DPoint & getEndPoint() const
const B2DPoint & getControlPointA() const
Base Point class with two double values.
B2DPolygon const & getB2DPolygon(sal_uInt32 nIndex) const
void append(const B2DPolygon &rPolygon, sal_uInt32 nCount=1)
B2DRange getB2DRange() const
Get the B2DRange (Rectangle dimensions) of this B2DPolyPolygon.
void remove(sal_uInt32 nIndex, sal_uInt32 nCount=1)
void clear()
clear all points
bool isClosed() const
closed state interface
basegfx::B2DPoint const & getB2DPoint(sal_uInt32 nIndex) const
Coordinate interface.
void getBezierSegment(sal_uInt32 nIndex, B2DCubicBezier &rTarget) const
bezier segment access
void append(const basegfx::B2DPoint &rPoint, sal_uInt32 nCount)
void removeDoublePoints()
remove double points, at the begin/end and follow-ups, too
sal_uInt32 count() const
member count
void appendBezierSegment(const basegfx::B2DPoint &rNextControlPoint, const basegfx::B2DPoint &rPrevControlPoint, const basegfx::B2DPoint &rPoint)
Bezier segment append with control points. The current last polygon point is implicitly taken as star...
A two-dimensional interval over doubles.
TYPE getMaxX() const
get upper bound of the set. returns arbitrary values for empty sets.
TYPE getWidth() const
return difference between upper and lower X value. returns 0 for empty sets.
TYPE getMinX() const
get lower bound of the set. returns arbitrary values for empty sets.
TYPE getMinY() const
get lower bound of the set. returns arbitrary values for empty sets.
TYPE getMaxY() const
get upper bound of the set. returns arbitrary values for empty sets.
void intersect(const Range2D &rRange)
calc set intersection
bool isInside(const Tuple2D< TYPE > &rTuple) const
yields true if given point is contained in set
bool isEmpty() const
Check if the interval set is empty.
bool equal(const Range2D &rRange) const
TYPE getHeight() const
return difference between upper and lower Y value. returns 0 for empty sets.
bool equal(const Tuple2D< TYPE > &rTup) const
TYPE getX() const
Get X-Coordinate of 2D Tuple.
TYPE getY() const
Get Y-Coordinate of 2D Tuple.
#define SAL_WARN(area, stream)
B2DPolygon addPointsAtCuts(const B2DPolygon &rCandidate, const B2DPoint &rStart, const B2DPoint &rEnd)
B2DPolygon createPolygonFromRect(const B2DRectangle &rRect, double fRadiusX, double fRadiusY)
Create a polygon from a rectangle.
B2DPolyPolygon clipPolyPolygonOnRange(const B2DPolyPolygon &rCandidate, const B2DRange &rRange, bool bInside, bool bStroke)
bool isInside(const B2DPolygon &rCandidate, const B2DPoint &rPoint, bool bWithBorder)
sal_uInt32 getCohenSutherlandClipFlags(const Point &rP, const Rect &rR)
Calc clip mask for Cohen-Sutherland rectangle clip.
B2DPolyPolygon correctOrientations(const B2DPolyPolygon &rCandidate)
static sal_uInt32 scissorLineSegment(::basegfx::B2DPoint *in_vertex, sal_uInt32 in_count, ::basegfx::B2DPoint *out_vertex, scissor_plane const *pPlane, const ::basegfx::B2DRectangle &rR)
B2DPolygon clipTriangleListOnRange(const B2DPolygon &rCandidate, const B2DRange &rRange)
void closeWithGeometryChange(B2DPolygon &rCandidate)
B2DPolyPolygon stripNeutralPolygons(const B2DPolyPolygon &rCandidate)
Strip neutral polygons from PolyPolygon.
bool isRectangle(const B2DPolygon &rPoly)
Predicate whether a given polygon is a rectangle.
B2DPolyPolygon clipPolyPolygonOnPolyPolygon(const B2DPolyPolygon &rCandidate, const B2DPolyPolygon &rClip, bool bInside, bool bStroke, size_t *pPointLimit)
B2DPolyPolygon clipPolygonOnPolyPolygon(const B2DPolygon &rCandidate, const B2DPolyPolygon &rClip, bool bInside, bool bStroke)
B2DPolyPolygon clipPolygonOnParallelAxis(const B2DPolygon &rCandidate, bool bParallelToXAxis, bool bAboveAxis, double fValueOnOtherAxis, bool bStroke)
B2DPolyPolygon solveCrossovers(const B2DPolyPolygon &rCandidate, size_t *pPointLimit)
Solve all crossovers (aka self-intersections) in a polyPolygon.
B2DPolyPolygon clipPolyPolygonOnParallelAxis(const B2DPolyPolygon &rCandidate, bool bParallelToXAxis, bool bAboveAxis, double fValueOnOtherAxis, bool bStroke)
B2DPolyPolygon stripDispensablePolygons(const B2DPolyPolygon &rCandidate, bool bKeepAboveZero)
Remove unnecessary/non-displayed polygons.
B2DPolyPolygon clipPolygonOnRange(const B2DPolygon &rCandidate, const B2DRange &rRange, bool bInside, bool bStroke)
B2DRange getRange(const B2DPolygon &rCandidate)
Get the range of a polygon.
B2DRange B2DRectangle
Alias name for interface clarity (not everybody is aware of the identity)