#i106127# perf: consecutive polygon segments always touch so costly decisions based only on the touch-criterion should be avoided for this case
This commit is contained in:
@@ -7,7 +7,6 @@
|
|||||||
* OpenOffice.org - a multi-platform office productivity suite
|
* OpenOffice.org - a multi-platform office productivity suite
|
||||||
*
|
*
|
||||||
* $RCSfile: b1drange.hxx,v $
|
* $RCSfile: b1drange.hxx,v $
|
||||||
* $Revision: 1.15 $
|
|
||||||
*
|
*
|
||||||
* This file is part of OpenOffice.org.
|
* This file is part of OpenOffice.org.
|
||||||
*
|
*
|
||||||
@@ -131,6 +130,11 @@ namespace basegfx
|
|||||||
return maRange.overlaps(rRange.maRange);
|
return maRange.overlaps(rRange.maRange);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool overlapsMore(const B1DRange& rRange) const
|
||||||
|
{
|
||||||
|
return maRange.overlapsMore(rRange.maRange);
|
||||||
|
}
|
||||||
|
|
||||||
void expand(double fValue)
|
void expand(double fValue)
|
||||||
{
|
{
|
||||||
maRange.expand(fValue);
|
maRange.expand(fValue);
|
||||||
|
@@ -7,7 +7,6 @@
|
|||||||
* OpenOffice.org - a multi-platform office productivity suite
|
* OpenOffice.org - a multi-platform office productivity suite
|
||||||
*
|
*
|
||||||
* $RCSfile: b2drange.hxx,v $
|
* $RCSfile: b2drange.hxx,v $
|
||||||
* $Revision: 1.19 $
|
|
||||||
*
|
*
|
||||||
* This file is part of OpenOffice.org.
|
* This file is part of OpenOffice.org.
|
||||||
*
|
*
|
||||||
@@ -222,6 +221,14 @@ namespace basegfx
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool overlapsMore(const B2DRange& rRange) const
|
||||||
|
{
|
||||||
|
return (
|
||||||
|
maRangeX.overlapsMore(rRange.maRangeX)
|
||||||
|
&& maRangeY.overlapsMore(rRange.maRangeY)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
void expand(const B2DTuple& rTuple)
|
void expand(const B2DTuple& rTuple)
|
||||||
{
|
{
|
||||||
maRangeX.expand(rTuple.getX());
|
maRangeX.expand(rTuple.getX());
|
||||||
|
@@ -7,7 +7,6 @@
|
|||||||
* OpenOffice.org - a multi-platform office productivity suite
|
* OpenOffice.org - a multi-platform office productivity suite
|
||||||
*
|
*
|
||||||
* $RCSfile: basicrange.hxx,v $
|
* $RCSfile: basicrange.hxx,v $
|
||||||
* $Revision: 1.15 $
|
|
||||||
*
|
*
|
||||||
* This file is part of OpenOffice.org.
|
* This file is part of OpenOffice.org.
|
||||||
*
|
*
|
||||||
@@ -142,6 +141,14 @@ namespace basegfx
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool overlapsMore(const BasicRange& rRange) const
|
||||||
|
{
|
||||||
|
if(isEmpty() || rRange.isEmpty())
|
||||||
|
return false;
|
||||||
|
// returns true if the overlap is more than just a touching at the limits
|
||||||
|
return ((rRange.mnMaximum > mnMinimum) && (rRange.mnMinimum < mnMaximum));
|
||||||
|
}
|
||||||
|
|
||||||
bool operator==( const BasicRange& rRange ) const
|
bool operator==( const BasicRange& rRange ) const
|
||||||
{
|
{
|
||||||
return (mnMinimum == rRange.mnMinimum && mnMaximum == rRange.mnMaximum);
|
return (mnMinimum == rRange.mnMinimum && mnMaximum == rRange.mnMaximum);
|
||||||
|
@@ -567,7 +567,14 @@ namespace basegfx
|
|||||||
const bool bEdgeBIsCurve(aCubicB.isBezier());
|
const bool bEdgeBIsCurve(aCubicB.isBezier());
|
||||||
const B2DRange aRangeB(aCubicB.getRange());
|
const B2DRange aRangeB(aCubicB.getRange());
|
||||||
|
|
||||||
if(aRangeA.overlaps(aRangeB))
|
// only overlapping segments need to be tested
|
||||||
|
// consecutive segments touch of course
|
||||||
|
bool bOverlap = false;
|
||||||
|
if( b > a+1)
|
||||||
|
bOverlap = aRangeA.overlaps(aRangeB);
|
||||||
|
else
|
||||||
|
bOverlap = aRangeA.overlapsMore(aRangeB);
|
||||||
|
if( bOverlap)
|
||||||
{
|
{
|
||||||
if(bEdgeAIsCurve && bEdgeBIsCurve)
|
if(bEdgeAIsCurve && bEdgeBIsCurve)
|
||||||
{
|
{
|
||||||
@@ -609,7 +616,13 @@ namespace basegfx
|
|||||||
const B2DPoint aNextB(rCandidate.getB2DPoint(b + 1L == nPointCount ? 0L : b + 1L));
|
const B2DPoint aNextB(rCandidate.getB2DPoint(b + 1L == nPointCount ? 0L : b + 1L));
|
||||||
const B2DRange aRangeB(aCurrB, aNextB);
|
const B2DRange aRangeB(aCurrB, aNextB);
|
||||||
|
|
||||||
if(aRangeA.overlaps(aRangeB))
|
// consecutive segments touch of course
|
||||||
|
bool bOverlap = false;
|
||||||
|
if( b > a+1)
|
||||||
|
bOverlap = aRangeA.overlaps(aRangeB);
|
||||||
|
else
|
||||||
|
bOverlap = aRangeA.overlapsMore(aRangeB);
|
||||||
|
if( bOverlap)
|
||||||
{
|
{
|
||||||
findEdgeCutsTwoEdges(aCurrA, aNextA, aCurrB, aNextB, a, b, rTempPoints, rTempPoints);
|
findEdgeCutsTwoEdges(aCurrA, aNextA, aCurrB, aNextB, a, b, rTempPoints, rTempPoints);
|
||||||
}
|
}
|
||||||
@@ -806,7 +819,13 @@ namespace basegfx
|
|||||||
const bool bEdgeBIsCurve(aCubicB.isBezier());
|
const bool bEdgeBIsCurve(aCubicB.isBezier());
|
||||||
const B2DRange aRangeB(aCubicB.getRange());
|
const B2DRange aRangeB(aCubicB.getRange());
|
||||||
|
|
||||||
if(aRangeA.overlaps(aRangeB))
|
// consecutive segments touch of course
|
||||||
|
bool bOverlap = false;
|
||||||
|
if( b > a+1)
|
||||||
|
bOverlap = aRangeA.overlaps(aRangeB);
|
||||||
|
else
|
||||||
|
bOverlap = aRangeA.overlapsMore(aRangeB);
|
||||||
|
if( bOverlap)
|
||||||
{
|
{
|
||||||
if(bEdgeAIsCurve && bEdgeBIsCurve)
|
if(bEdgeAIsCurve && bEdgeBIsCurve)
|
||||||
{
|
{
|
||||||
@@ -848,7 +867,13 @@ namespace basegfx
|
|||||||
const B2DPoint aNextB(rCandidateB.getB2DPoint(b + 1L == nPointCountB ? 0L : b + 1L));
|
const B2DPoint aNextB(rCandidateB.getB2DPoint(b + 1L == nPointCountB ? 0L : b + 1L));
|
||||||
const B2DRange aRangeB(aCurrB, aNextB);
|
const B2DRange aRangeB(aCurrB, aNextB);
|
||||||
|
|
||||||
if(aRangeA.overlaps(aRangeB))
|
// consecutive segments touch of course
|
||||||
|
bool bOverlap = false;
|
||||||
|
if( b > a+1)
|
||||||
|
bOverlap = aRangeA.overlaps(aRangeB);
|
||||||
|
else
|
||||||
|
bOverlap = aRangeA.overlapsMore(aRangeB);
|
||||||
|
if( bOverlap)
|
||||||
{
|
{
|
||||||
// test for simple edge-edge cuts
|
// test for simple edge-edge cuts
|
||||||
findEdgeCutsTwoEdges(aCurrA, aNextA, aCurrB, aNextB, a, b, rTempPointsA, rTempPointsB);
|
findEdgeCutsTwoEdges(aCurrA, aNextA, aCurrB, aNextB, a, b, rTempPointsA, rTempPointsB);
|
||||||
|
Reference in New Issue
Block a user