lets have just one getB2DRange function/method
Change-Id: I5081abca177c6fb8bd21d971d93dc115d57de294 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192589 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
This commit is contained in:
@@ -70,7 +70,7 @@ namespace basegfx::utils
|
||||
aRetval.append(rArrow);
|
||||
|
||||
// get size of the arrow
|
||||
const B2DRange aArrowSize(getRange(rArrow));
|
||||
const B2DRange aArrowSize(rArrow.getB2DRange());
|
||||
|
||||
// build ArrowTransform; center in X, align with axis in Y
|
||||
B2DHomMatrix aArrowTransform(basegfx::utils::createTranslateB2DHomMatrix(
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace basegfx::utils
|
||||
|
||||
if(rCandidate.count())
|
||||
{
|
||||
const B2DRange aCandidateRange(getRange(rCandidate));
|
||||
const B2DRange aCandidateRange(rCandidate.getB2DRange());
|
||||
|
||||
if(bParallelToXAxis && fTools::moreOrEqual(aCandidateRange.getMinY(), fValueOnOtherAxis))
|
||||
{
|
||||
@@ -203,7 +203,7 @@ namespace basegfx::utils
|
||||
}
|
||||
}
|
||||
|
||||
const B2DRange aCandidateRange(getRange(rCandidate));
|
||||
const B2DRange aCandidateRange(rCandidate.getB2DRange());
|
||||
|
||||
if(rRange.isInside(aCandidateRange))
|
||||
{
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace basegfx
|
||||
|
||||
public:
|
||||
const B2DPolygon& getPolygon() const { return maPolygon; }
|
||||
void setPolygon(const B2DPolygon& rNew) { maPolygon = rNew; maRange = utils::getRange(maPolygon); }
|
||||
void setPolygon(const B2DPolygon& rNew) { maPolygon = rNew; maRange = maPolygon.getB2DRange(); }
|
||||
const B2DRange& getRange() const { return maRange; }
|
||||
temporaryPointVector& getTemporaryPointVector() { return maPoints; }
|
||||
};
|
||||
|
||||
@@ -389,12 +389,6 @@ namespace basegfx::utils
|
||||
return true;
|
||||
}
|
||||
|
||||
B2DRange getRange(const B2DPolygon& rCandidate)
|
||||
{
|
||||
// changed to use internally buffered version at B2DPolygon
|
||||
return rCandidate.getB2DRange();
|
||||
}
|
||||
|
||||
double getSignedArea(const B2DPolygon& rCandidate)
|
||||
{
|
||||
const B2DPolygon aCandidate(rCandidate.areControlPointsUsed() ? rCandidate.getDefaultAdaptiveSubdivision() : rCandidate);
|
||||
|
||||
@@ -731,7 +731,7 @@ namespace basegfx::utils
|
||||
{
|
||||
const B2DPolygon& aCand(aCandidate.getB2DPolygon(a));
|
||||
StripHelper* pNewHelper = &(aHelpers[a]);
|
||||
pNewHelper->maRange = utils::getRange(aCand);
|
||||
pNewHelper->maRange = aCand.getB2DRange();
|
||||
pNewHelper->meOrinetation = utils::getOrientation(aCand);
|
||||
|
||||
// initialize with own orientation
|
||||
@@ -811,7 +811,7 @@ namespace basegfx::utils
|
||||
{
|
||||
const B2DPolygon& aCandidate(rCandidate.getB2DPolygon(a));
|
||||
StripHelper* pNewHelper = &(aHelpers[a]);
|
||||
pNewHelper->maRange = utils::getRange(aCandidate);
|
||||
pNewHelper->maRange = aCandidate.getB2DRange();
|
||||
pNewHelper->meOrinetation = utils::getOrientation(aCandidate);
|
||||
pNewHelper->mnDepth = (pNewHelper->meOrinetation == B2VectorOrientation::Negative ? -1 : 0);
|
||||
}
|
||||
|
||||
@@ -179,18 +179,6 @@ namespace basegfx::utils
|
||||
}
|
||||
}
|
||||
|
||||
B2DRange getRange(const B2DPolyPolygon& rCandidate)
|
||||
{
|
||||
B2DRange aRetval;
|
||||
|
||||
for(auto const& rPolygon : rCandidate)
|
||||
{
|
||||
aRetval.expand(utils::getRange(rPolygon));
|
||||
}
|
||||
|
||||
return aRetval;
|
||||
}
|
||||
|
||||
double getSignedArea(const B2DPolyPolygon& rCandidate)
|
||||
{
|
||||
double fRetval(0.0);
|
||||
|
||||
@@ -105,7 +105,7 @@ namespace basegfx::unotools
|
||||
}
|
||||
}
|
||||
|
||||
const B2DRange aBounds( utils::getRange( aSrcPoly ) );
|
||||
const B2DRange aBounds( aSrcPoly.getB2DRange() );
|
||||
const B2DVector aOffset( unotools::b2DPointFromRealPoint2D( position ) -
|
||||
aBounds.getMinimum() );
|
||||
|
||||
|
||||
@@ -171,8 +171,7 @@ namespace dxcanvas
|
||||
// apply a simple rect clip
|
||||
// ========================
|
||||
|
||||
::basegfx::B2DRectangle aClipBounds(
|
||||
::basegfx::utils::getRange( aClipPath ) );
|
||||
::basegfx::B2DRectangle aClipBounds( aClipPath.getB2DRange() );
|
||||
aClipBounds.intersect( aSourceRect );
|
||||
|
||||
mpBitmap->draw(fAlpha,rPos,aClipBounds,rTransform);
|
||||
|
||||
@@ -162,7 +162,7 @@ namespace oglcanvas
|
||||
rTexture.AffineTransform );
|
||||
::basegfx::B2DRange aBounds;
|
||||
for( const auto& rPoly : rPolyPolygons )
|
||||
aBounds.expand( ::basegfx::utils::getRange( rPoly ) );
|
||||
aBounds.expand( rPoly.getB2DRange() );
|
||||
aTextureTransform.translate(-aBounds.getMinX(), -aBounds.getMinY());
|
||||
aTextureTransform.scale(1/aBounds.getWidth(), 1/aBounds.getHeight());
|
||||
|
||||
@@ -306,7 +306,7 @@ namespace oglcanvas
|
||||
rTexture.AffineTransform );
|
||||
::basegfx::B2DRange aBounds;
|
||||
for( const auto& rPolyPolygon : rPolyPolygons )
|
||||
aBounds.expand( ::basegfx::utils::getRange( rPolyPolygon ) );
|
||||
aBounds.expand( rPolyPolygon.getB2DRange() );
|
||||
aTextureTransform.translate(-aBounds.getMinX(), -aBounds.getMinY());
|
||||
aTextureTransform.scale(1/aBounds.getWidth(), 1/aBounds.getHeight());
|
||||
aTextureTransform.invert();
|
||||
|
||||
@@ -61,8 +61,7 @@ namespace canvas
|
||||
|
||||
// clip which is about to be set, expressed as a
|
||||
// b2drectangle
|
||||
const ::basegfx::B2DRectangle aClipBounds(
|
||||
::basegfx::utils::getRange( aClipPath ) );
|
||||
const ::basegfx::B2DRectangle aClipBounds( aClipPath.getB2DRange() );
|
||||
|
||||
const ::basegfx::B2DRectangle aBounds( 0.0, 0.0,
|
||||
maSize.getX(),
|
||||
|
||||
@@ -562,7 +562,7 @@ namespace cppcanvas::internal
|
||||
}
|
||||
|
||||
const ::basegfx::B2DRectangle aBounds(
|
||||
::basegfx::utils::getRange(aDevicePoly) );
|
||||
aDevicePoly.getB2DRange() );
|
||||
const ::basegfx::B2DVector aOffset(
|
||||
rGradient.GetOfsX() / 100.0,
|
||||
rGradient.GetOfsY() / 100.0);
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace cppcanvas::internal
|
||||
bool bStroke ) :
|
||||
CachedPrimitiveBase( rCanvas, false ),
|
||||
mxPolyPoly( ::basegfx::unotools::xPolyPolygonFromB2DPolyPolygon( rCanvas->getUNOCanvas()->getDevice(), rPolyPoly) ),
|
||||
maBounds( ::basegfx::utils::getRange(rPolyPoly) ),
|
||||
maBounds( rPolyPoly.getB2DRange() ),
|
||||
mpCanvas( rCanvas )
|
||||
{
|
||||
cppcanvastools::initRenderState(maState,rState);
|
||||
@@ -109,7 +109,7 @@ namespace cppcanvas::internal
|
||||
int nTransparency ) :
|
||||
CachedPrimitiveBase( rCanvas, false ),
|
||||
mxPolyPoly( ::basegfx::unotools::xPolyPolygonFromB2DPolyPolygon( rCanvas->getUNOCanvas()->getDevice(), rPolyPoly) ),
|
||||
maBounds( ::basegfx::utils::getRange(rPolyPoly) ),
|
||||
maBounds( rPolyPoly.getB2DRange() ),
|
||||
mpCanvas( rCanvas )
|
||||
{
|
||||
cppcanvastools::initRenderState(maState,rState);
|
||||
@@ -258,7 +258,7 @@ namespace cppcanvas::internal
|
||||
const rendering::Texture& rTexture ) :
|
||||
CachedPrimitiveBase( rCanvas, true ),
|
||||
mxPolyPoly( ::basegfx::unotools::xPolyPolygonFromB2DPolyPolygon( rCanvas->getUNOCanvas()->getDevice(), rPolyPoly) ),
|
||||
maBounds( ::basegfx::utils::getRange(rPolyPoly) ),
|
||||
maBounds( rPolyPoly.getB2DRange() ),
|
||||
mpCanvas( rCanvas ),
|
||||
maTexture( rTexture )
|
||||
{
|
||||
@@ -367,7 +367,7 @@ namespace cppcanvas::internal
|
||||
rendering::StrokeAttributes aStrokeAttributes ) :
|
||||
CachedPrimitiveBase( rCanvas, false ),
|
||||
mxPolyPoly( ::basegfx::unotools::xPolyPolygonFromB2DPolyPolygon( rCanvas->getUNOCanvas()->getDevice(), rPolyPoly) ),
|
||||
maBounds( ::basegfx::utils::getRange(rPolyPoly) ),
|
||||
maBounds( rPolyPoly.getB2DRange() ),
|
||||
mpCanvas( rCanvas ),
|
||||
maStrokeAttributes(std::move( aStrokeAttributes ))
|
||||
{
|
||||
|
||||
@@ -585,7 +585,7 @@ namespace cppcanvas::internal
|
||||
const ::basegfx::B2DPolyPolygon aPoly(
|
||||
cppcanvastools::createTextLinesPolyPolygon( 0.0, nLineWidth,
|
||||
rLineInfo ) );
|
||||
auto aRange = basegfx::utils::getRange( aPoly ).getRange();
|
||||
auto aRange = aPoly.getB2DRange().getRange();
|
||||
o_rOverallSize = basegfx::B2DSize(aRange.getX(), aRange.getY());
|
||||
|
||||
o_rTextLines = ::basegfx::unotools::xPolyPolygonFromB2DPolyPolygon(
|
||||
@@ -1567,7 +1567,7 @@ namespace cppcanvas::internal
|
||||
|
||||
return calcEffectTextBounds( ::basegfx::unotools::b2DRectangleFromRealRectangle2D(
|
||||
xTextLayout->queryTextBounds() ),
|
||||
::basegfx::utils::getRange( aPoly ),
|
||||
aPoly.getB2DRange(),
|
||||
maReliefOffset,
|
||||
maShadowOffset,
|
||||
aLocalState,
|
||||
@@ -2122,7 +2122,7 @@ namespace cppcanvas::internal
|
||||
rShadowColor,
|
||||
rTextFillColor,
|
||||
xTextBoundsPoly,
|
||||
::basegfx::utils::getRange(aResultingPolyPolygon),
|
||||
aResultingPolyPolygon.getB2DRange(),
|
||||
xTextPoly,
|
||||
aCharWidthSeq,
|
||||
rVDev,
|
||||
@@ -2140,7 +2140,7 @@ namespace cppcanvas::internal
|
||||
rShadowColor,
|
||||
rTextFillColor,
|
||||
xTextBoundsPoly,
|
||||
::basegfx::utils::getRange(aResultingPolyPolygon),
|
||||
aResultingPolyPolygon.getB2DRange(),
|
||||
xTextPoly,
|
||||
aCharWidthSeq,
|
||||
rVDev,
|
||||
|
||||
@@ -59,19 +59,19 @@ void TextLinesHelper::init(double nLineWidth, const cppcanvastools::TextLineInfo
|
||||
|
||||
if (aOverline.count())
|
||||
{
|
||||
aRange.expand(::basegfx::utils::getRange(aOverline));
|
||||
aRange.expand(aOverline.getB2DRange());
|
||||
mxOverline = ::basegfx::unotools::xPolyPolygonFromB2DPolyPolygon(xDevice, aOverline);
|
||||
}
|
||||
|
||||
if (aUnderline.count())
|
||||
{
|
||||
aRange.expand(::basegfx::utils::getRange(aUnderline));
|
||||
aRange.expand(aUnderline.getB2DRange());
|
||||
mxUnderline = ::basegfx::unotools::xPolyPolygonFromB2DPolyPolygon(xDevice, aUnderline);
|
||||
}
|
||||
|
||||
if (aStrikeout.count())
|
||||
{
|
||||
aRange.expand(::basegfx::utils::getRange(aStrikeout));
|
||||
aRange.expand(aStrikeout.getB2DRange());
|
||||
mxStrikeout = ::basegfx::unotools::xPolyPolygonFromB2DPolyPolygon(xDevice, aStrikeout);
|
||||
}
|
||||
|
||||
|
||||
@@ -362,7 +362,7 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickAddHdl_Impl, weld::Button&, void)
|
||||
}
|
||||
|
||||
basegfx::B2DPolyPolygon aNewPolyPolygon(static_cast<const SdrPathObj*>(pNewObj)->GetPathPoly());
|
||||
basegfx::B2DRange aNewRange(basegfx::utils::getRange(aNewPolyPolygon));
|
||||
basegfx::B2DRange aNewRange(aNewPolyPolygon.getB2DRange());
|
||||
|
||||
// normalize
|
||||
aNewPolyPolygon.translate( -aNewRange.getMinX(), -aNewRange.getMinY() );
|
||||
|
||||
@@ -59,8 +59,8 @@ Primitive2DReference PolyPolygonAlphaGradientPrimitive2D::create2DDecomposition(
|
||||
Primitive2DContainer aContent{ new PolyPolygonColorPrimitive2D(getB2DPolyPolygon(),
|
||||
getBColor()) };
|
||||
|
||||
Primitive2DContainer aAlpha{ new FillGradientPrimitive2D(
|
||||
basegfx::utils::getRange(getB2DPolyPolygon()), getAlphaGradient()) };
|
||||
Primitive2DContainer aAlpha{ new FillGradientPrimitive2D(getB2DPolyPolygon().getB2DRange(),
|
||||
getAlphaGradient()) };
|
||||
|
||||
return new TransparencePrimitive2D(std::move(aContent), std::move(aAlpha));
|
||||
}
|
||||
@@ -93,7 +93,7 @@ basegfx::B2DRange PolyPolygonAlphaGradientPrimitive2D::getB2DRange(
|
||||
const geometry::ViewInformation2D& /*rViewInformation*/) const
|
||||
{
|
||||
// return range - without decompose
|
||||
return basegfx::utils::getRange(getB2DPolyPolygon());
|
||||
return getB2DPolyPolygon().getB2DRange();
|
||||
}
|
||||
|
||||
// provide unique ID
|
||||
|
||||
@@ -53,7 +53,7 @@ basegfx::B2DRange PolyPolygonColorPrimitive2D::getB2DRange(
|
||||
const geometry::ViewInformation2D& /*rViewInformation*/) const
|
||||
{
|
||||
// return range
|
||||
return basegfx::utils::getRange(getB2DPolyPolygon());
|
||||
return getB2DPolyPolygon().getB2DRange();
|
||||
}
|
||||
|
||||
// provide unique ID
|
||||
|
||||
@@ -69,7 +69,7 @@ basegfx::B2DRange PolyPolygonHairlinePrimitive2D::getB2DRange(
|
||||
const geometry::ViewInformation2D& /*rViewInformation*/) const
|
||||
{
|
||||
// return range
|
||||
return basegfx::utils::getRange(getB2DPolyPolygon());
|
||||
return getB2DPolyPolygon().getB2DRange();
|
||||
}
|
||||
|
||||
// provide unique ID
|
||||
|
||||
@@ -76,7 +76,7 @@ basegfx::B2DRange PolyPolygonMarkerPrimitive2D::getB2DRange(
|
||||
const geometry::ViewInformation2D& /*rViewInformation*/) const
|
||||
{
|
||||
// return range
|
||||
return basegfx::utils::getRange(getB2DPolyPolygon());
|
||||
return getB2DPolyPolygon().getB2DRange();
|
||||
}
|
||||
|
||||
// provide unique ID
|
||||
|
||||
@@ -85,7 +85,7 @@ basegfx::B2DRange PolyPolygonRGBAPrimitive2D::getB2DRange(
|
||||
const geometry::ViewInformation2D& /*rViewInformation*/) const
|
||||
{
|
||||
// return range - without decompose
|
||||
return basegfx::utils::getRange(getB2DPolyPolygon());
|
||||
return getB2DPolyPolygon().getB2DRange();
|
||||
}
|
||||
|
||||
// provide unique ID
|
||||
|
||||
@@ -100,7 +100,7 @@ bool PolyPolygonSelectionPrimitive2D::operator==(const BasePrimitive2D& rPrimiti
|
||||
basegfx::B2DRange PolyPolygonSelectionPrimitive2D::getB2DRange(
|
||||
const geometry::ViewInformation2D& rViewInformation) const
|
||||
{
|
||||
basegfx::B2DRange aRetval(basegfx::utils::getRange(getB2DPolyPolygon()));
|
||||
basegfx::B2DRange aRetval(getB2DPolyPolygon().getB2DRange());
|
||||
|
||||
if (getDiscreteGrow() > 0.0)
|
||||
{
|
||||
|
||||
@@ -79,7 +79,7 @@ basegfx::B2DRange PolyPolygonStrokePrimitive2D::getB2DRange(
|
||||
const geometry::ViewInformation2D& /*rViewInformation*/) const
|
||||
{
|
||||
// get range of it (subdivided)
|
||||
basegfx::B2DRange aRetval(basegfx::utils::getRange(getB2DPolyPolygon()));
|
||||
basegfx::B2DRange aRetval(getB2DPolyPolygon().getB2DRange());
|
||||
|
||||
// if width, grow by line width
|
||||
if (getLineAttribute().getWidth())
|
||||
|
||||
@@ -128,7 +128,7 @@ namespace drawinglayer::primitive2d
|
||||
basegfx::B2DPolygon aPolygon(basegfx::utils::createUnitPolygon());
|
||||
aPolygon.transform(getTransformation());
|
||||
|
||||
return basegfx::utils::getRange(aPolygon);
|
||||
return aPolygon.getB2DRange();
|
||||
}
|
||||
|
||||
// provide unique ID
|
||||
|
||||
@@ -128,7 +128,7 @@ namespace drawinglayer::primitive3d
|
||||
{
|
||||
// found two linearly independent 2D vectors
|
||||
// get 2d range of texture coordinates
|
||||
const basegfx::B2DRange aOutlineRange(basegfx::utils::getRange(aTexPolyPolygon));
|
||||
const basegfx::B2DRange aOutlineRange(aTexPolyPolygon.getB2DRange());
|
||||
const basegfx::BColor aHatchColor(getHatch().getColor());
|
||||
const double fAngle(getHatch().getAngle());
|
||||
std::vector< basegfx::B2DHomMatrix > aMatrices;
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace
|
||||
|
||||
if(!basegfx::fTools::equalZero(fScale))
|
||||
{
|
||||
const basegfx::B2DRange aRange(basegfx::utils::getRange(rSource));
|
||||
const basegfx::B2DRange aRange(rSource.getB2DRange());
|
||||
const basegfx::B2DPoint aCenter(aRange.getCenter());
|
||||
basegfx::B2DHomMatrix aTrans;
|
||||
|
||||
@@ -79,9 +79,9 @@ namespace
|
||||
// grow the outside polygon and scale all polygons to original size. This is done
|
||||
// to avoid a shrink which potentially would lead to self-intersections, but changes
|
||||
// the original polygon -> not a precision step, so e.g. not usable for charts
|
||||
const basegfx::B2DRange aRange(basegfx::utils::getRange(rPolygon));
|
||||
const basegfx::B2DRange aRange(rPolygon.getB2DRange());
|
||||
rPolygon = basegfx::utils::growInNormalDirection(rPolygon, fOffset);
|
||||
const basegfx::B2DRange aGrownRange(basegfx::utils::getRange(rPolygon));
|
||||
const basegfx::B2DRange aGrownRange(rPolygon.getB2DRange());
|
||||
const double fScaleX(basegfx::fTools::equalZero(aGrownRange.getWidth()) ? 1.0 : aRange.getWidth() / aGrownRange.getWidth());
|
||||
const double fScaleY(basegfx::fTools::equalZero(aGrownRange.getHeight())? 1.0 : aRange.getHeight() / aGrownRange.getHeight());
|
||||
basegfx::B2DHomMatrix aScaleTrans;
|
||||
@@ -397,7 +397,7 @@ namespace drawinglayer::primitive3d
|
||||
|
||||
if(bCloseFront || bCloseBack)
|
||||
{
|
||||
const basegfx::B2DRange aBaseRange(basegfx::utils::getRange(aFront));
|
||||
const basegfx::B2DRange aBaseRange(aFront.getB2DRange());
|
||||
const double fOuterLength(aBaseRange.getMaxX() * fRotation);
|
||||
const double fInnerLength(aBaseRange.getMinX() * fRotation);
|
||||
const double fAverageLength((fOuterLength + fInnerLength) * 0.5);
|
||||
|
||||
@@ -3595,7 +3595,7 @@ void CairoPixelProcessor2D::processPolyPolygonAlphaGradientPrimitive2D(
|
||||
|
||||
// create temporary FillGradientPrimitive2D, but do not forget
|
||||
// to embed to MaskPrimitive2D to get the PolyPolygon form
|
||||
const basegfx::B2DRange aRange(basegfx::utils::getRange(rPolyPolygon));
|
||||
const basegfx::B2DRange aRange(rPolyPolygon.getB2DRange());
|
||||
const primitive2d::Primitive2DContainer aContainerMaskedFillGradient{
|
||||
rtl::Reference<primitive2d::MaskPrimitive2D>(new primitive2d::MaskPrimitive2D(
|
||||
rPolyPolygon,
|
||||
|
||||
@@ -923,7 +923,7 @@ void VclProcessor2D::RenderMaskPrimitive2DPixel(const primitive2d::MaskPrimitive
|
||||
return;
|
||||
}
|
||||
|
||||
const basegfx::B2DRange aRange(basegfx::utils::getRange(aMask));
|
||||
const basegfx::B2DRange aRange(aMask.getB2DRange());
|
||||
tools::Rectangle aMaskRect = vcl::unotools::rectangleFromB2DRectangle(aRange);
|
||||
impBufferDevice aBufferDevice(*mpOutputDevice, aMaskRect);
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ namespace emfplushelper
|
||||
|
||||
s.Seek(pos + pathLength);
|
||||
|
||||
const ::basegfx::B2DRectangle aBounds(::basegfx::utils::getRange(path->GetPolygon(rR, false)));
|
||||
const ::basegfx::B2DRectangle aBounds(path->GetPolygon(rR, false).getB2DRange());
|
||||
aWidth = aBounds.getWidth();
|
||||
aHeight = aBounds.getHeight();
|
||||
SAL_INFO("drawinglayer.emf", "EMF+\t\t\t\tPolygon bounding box: " << aBounds.getMinX() << "," << aBounds.getMinY() << " "
|
||||
@@ -167,7 +167,7 @@ namespace emfplushelper
|
||||
|
||||
s.Seek(pos + 8 * boundaryPointCount);
|
||||
|
||||
const ::basegfx::B2DRectangle aBounds(::basegfx::utils::getRange(path->GetPolygon(rR, false)));
|
||||
const ::basegfx::B2DRectangle aBounds(path->GetPolygon(rR, false).getB2DRange());
|
||||
aWidth = aBounds.getWidth();
|
||||
aHeight = aBounds.getHeight();
|
||||
SAL_INFO("drawinglayer.emf", "EMF+\t\t\t\tPolygon bounding box: " << aBounds.getMinX() << "," << aBounds.getMinY() << " "
|
||||
|
||||
@@ -90,19 +90,6 @@ namespace basegfx::utils
|
||||
BASEGFX_DLLPUBLIC bool isInside(const B2DPolygon& rCandidate, const B2DPoint& rPoint, bool bWithBorder = false);
|
||||
BASEGFX_DLLPUBLIC bool isInside(const B2DPolygon& rCandidate, const B2DPolygon& rPolygon, bool bWithBorder = false);
|
||||
|
||||
/** Get the range of a polygon
|
||||
|
||||
This method creates the outer range of the subdivided bezier curve.
|
||||
For detailed discussion see B2DPolygon::getB2DRange()
|
||||
|
||||
@param rCandidate
|
||||
The B2DPolygon possibly containing bezier segments
|
||||
|
||||
@return
|
||||
The outer range of the bezier curve
|
||||
*/
|
||||
BASEGFX_DLLPUBLIC B2DRange getRange(const B2DPolygon& rCandidate);
|
||||
|
||||
// get signed area of polygon
|
||||
BASEGFX_DLLPUBLIC double getSignedArea(const B2DPolygon& rCandidate);
|
||||
|
||||
|
||||
@@ -59,19 +59,6 @@ namespace basegfx::utils
|
||||
// in bWithBorder flag. It is assumed that the orientations of the given polygon are correct.
|
||||
BASEGFX_DLLPUBLIC bool isInside(const B2DPolyPolygon& rCandidate, const B2DPoint& rPoint, bool bWithBorder = false);
|
||||
|
||||
/** Get the range of a polyPolygon
|
||||
|
||||
For detailed description look at getRange(const B2DPolygon&).
|
||||
This method just expands by the range of every sub-Polygon.
|
||||
|
||||
@param rCandidate
|
||||
The B2DPolyPolygon possibly containing bezier segments
|
||||
|
||||
@return
|
||||
The outer range of the polygon
|
||||
*/
|
||||
BASEGFX_DLLPUBLIC B2DRange getRange(const B2DPolyPolygon& rCandidate);
|
||||
|
||||
// get signed area of polygon
|
||||
BASEGFX_DLLPUBLIC double getSignedArea(const B2DPolyPolygon& rCandidate);
|
||||
|
||||
|
||||
@@ -737,7 +737,7 @@ namespace
|
||||
tools::Rectangle lcl_UpdateCalcPoly(basegfx::B2DPolygon &rCalcPoly, int nWhichPoint, const Point &rPos)
|
||||
{
|
||||
rCalcPoly.setB2DPoint(nWhichPoint, basegfx::B2DPoint(rPos.X(), rPos.Y()));
|
||||
basegfx::B2DRange aRange(basegfx::utils::getRange(rCalcPoly));
|
||||
basegfx::B2DRange aRange(rCalcPoly.getB2DRange());
|
||||
return tools::Rectangle(static_cast<tools::Long>(aRange.getMinX()), static_cast<tools::Long>(aRange.getMinY()),
|
||||
static_cast<tools::Long>(aRange.getMaxX()), static_cast<tools::Long>(aRange.getMaxY()));
|
||||
}
|
||||
|
||||
@@ -236,9 +236,9 @@ void FuMorph::ImpEqualizePolyPointCount(
|
||||
::basegfx::B2DPolygon aPoly1(ImpGetExpandedPolygon(rSmall, nCnt));
|
||||
|
||||
// create transformation for rBig to do the compare
|
||||
const ::basegfx::B2DRange aSrcSize(::basegfx::utils::getRange(rBig));
|
||||
const ::basegfx::B2DRange aSrcSize(rBig.getB2DRange());
|
||||
const ::basegfx::B2DPoint aSrcPos(aSrcSize.getCenter());
|
||||
const ::basegfx::B2DRange aDstSize(::basegfx::utils::getRange(rSmall));
|
||||
const ::basegfx::B2DRange aDstSize(rSmall.getB2DRange());
|
||||
const ::basegfx::B2DPoint aDstPos(aDstSize.getCenter());
|
||||
|
||||
basegfx::B2DHomMatrix aTrans(basegfx::utils::createTranslateB2DHomMatrix(-aSrcPos.getX(), -aSrcPos.getY()));
|
||||
@@ -292,13 +292,13 @@ void FuMorph::ImpAddPolys(
|
||||
while(rSmaller.count() < rBigger.count())
|
||||
{
|
||||
const ::basegfx::B2DPolygon& aToBeCopied(rBigger.getB2DPolygon(rSmaller.count()));
|
||||
const ::basegfx::B2DRange aToBeCopiedPolySize(::basegfx::utils::getRange(aToBeCopied));
|
||||
const ::basegfx::B2DRange aToBeCopiedPolySize(aToBeCopied.getB2DRange());
|
||||
::basegfx::B2DPoint aNewPoint(aToBeCopiedPolySize.getCenter());
|
||||
::basegfx::B2DPolygon aNewPoly;
|
||||
|
||||
const ::basegfx::B2DRange aSrcSize(::basegfx::utils::getRange(rBigger.getB2DPolygon(0)));
|
||||
const ::basegfx::B2DRange aSrcSize(rBigger.getB2DPolygon(0).getB2DRange());
|
||||
const ::basegfx::B2DPoint aSrcPos(aSrcSize.getCenter());
|
||||
const ::basegfx::B2DRange aDstSize(::basegfx::utils::getRange(rSmaller.getB2DPolygon(0)));
|
||||
const ::basegfx::B2DRange aDstSize(rSmaller.getB2DPolygon(0).getB2DRange());
|
||||
const ::basegfx::B2DPoint aDstPos(aDstSize.getCenter());
|
||||
aNewPoint = aNewPoint - aSrcPos + aDstPos;
|
||||
|
||||
@@ -478,9 +478,9 @@ void FuMorph::ImpMorphPolygons(
|
||||
if(!nSteps)
|
||||
return;
|
||||
|
||||
const ::basegfx::B2DRange aStartPolySize(::basegfx::utils::getRange(rPolyPoly1));
|
||||
const ::basegfx::B2DRange aStartPolySize(rPolyPoly1.getB2DRange());
|
||||
const ::basegfx::B2DPoint aStartCenter(aStartPolySize.getCenter());
|
||||
const ::basegfx::B2DRange aEndPolySize(::basegfx::utils::getRange(rPolyPoly2));
|
||||
const ::basegfx::B2DRange aEndPolySize(rPolyPoly2.getB2DRange());
|
||||
const ::basegfx::B2DPoint aEndCenter(aEndPolySize.getCenter());
|
||||
const ::basegfx::B2DPoint aDelta(aEndCenter - aStartCenter);
|
||||
const double fFactor(1.0 / (nSteps + 1));
|
||||
@@ -491,7 +491,7 @@ void FuMorph::ImpMorphPolygons(
|
||||
fValue += fFactor;
|
||||
::basegfx::B2DPolyPolygon aNewPolyPoly2D = ImpCreateMorphedPolygon(rPolyPoly1, rPolyPoly2, fValue);
|
||||
|
||||
const ::basegfx::B2DRange aNewPolySize(::basegfx::utils::getRange(aNewPolyPoly2D));
|
||||
const ::basegfx::B2DRange aNewPolySize(aNewPolyPoly2D.getB2DRange());
|
||||
const ::basegfx::B2DPoint aNewS(aNewPolySize.getCenter());
|
||||
const ::basegfx::B2DPoint aRealS(aStartCenter + (aDelta * fValue));
|
||||
const ::basegfx::B2DPoint aDiff(aRealS - aNewS);
|
||||
|
||||
@@ -147,9 +147,9 @@ void PolyPolyElement::updateGeometry()
|
||||
{
|
||||
basegfx::B2DRange aRange;
|
||||
if( PolyPoly.areControlPointsUsed() )
|
||||
aRange = basegfx::utils::getRange( basegfx::utils::adaptiveSubdivideByAngle( PolyPoly ) );
|
||||
aRange = basegfx::utils::adaptiveSubdivideByAngle( PolyPoly ).getB2DRange();
|
||||
else
|
||||
aRange = basegfx::utils::getRange( PolyPoly );
|
||||
aRange = PolyPoly.getB2DRange();
|
||||
x = aRange.getMinX();
|
||||
y = aRange.getMinY();
|
||||
w = aRange.getWidth();
|
||||
|
||||
@@ -509,7 +509,7 @@ rtl::Reference<SdrObject> EnhancedCustomShape3d::Create3DObject(
|
||||
aPolyPoly = basegfx::utils::adaptiveSubdivideByAngle(aPolyPoly);
|
||||
}
|
||||
|
||||
const basegfx::B2DRange aTempRange(basegfx::utils::getRange(aPolyPoly));
|
||||
const basegfx::B2DRange aTempRange(aPolyPoly.getB2DRange());
|
||||
const tools::Rectangle aBoundRect(basegfx::fround<tools::Long>(aTempRange.getMinX()), basegfx::fround<tools::Long>(aTempRange.getMinY()), basegfx::fround<tools::Long>(aTempRange.getMaxX()), basegfx::fround<tools::Long>(aTempRange.getMaxY()));
|
||||
aTotalPolyPoly.append(aPolyPoly);
|
||||
aBoundRect2d.Union( aBoundRect );
|
||||
|
||||
@@ -1339,7 +1339,7 @@ void E3dView::Start3DCreation()
|
||||
{
|
||||
SdrObject* pMark = rMarkList.GetMark(nMark)->GetMarkedSdrObj();
|
||||
basegfx::B2DPolyPolygon aXPP(pMark->TakeXorPoly());
|
||||
aR.expand(basegfx::utils::getRange(aXPP));
|
||||
aR.expand(aXPP.getB2DRange());
|
||||
}
|
||||
|
||||
basegfx::B2DPoint aCenter(aR.getCenter());
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace sdr::contact
|
||||
// calculate texture size; use size of top/bottom cap to get a perfect mapping
|
||||
// for the caps. The in-between geometry will get a stretched size with a
|
||||
// relative factor size of caps to extrude depth
|
||||
const basegfx::B2DRange aRange(basegfx::utils::getRange(aPolyPolygon));
|
||||
const basegfx::B2DRange aRange(aPolyPolygon.getB2DRange());
|
||||
const basegfx::B2DVector aTextureSize(aRange.getWidth(), aRange.getHeight());
|
||||
|
||||
// get more data
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace sdr::contact
|
||||
fPolygonMaxLength = std::max(fPolygonMaxLength, fPolygonLength);
|
||||
}
|
||||
|
||||
const basegfx::B2DRange aPolyPolygonRange(basegfx::utils::getRange(aPolyPolygon));
|
||||
const basegfx::B2DRange aPolyPolygonRange(aPolyPolygon.getB2DRange());
|
||||
const basegfx::B2DVector aTextureSize(
|
||||
M_PI * fabs(aPolyPolygonRange.getCenter().getX()), // PI * d
|
||||
fPolygonMaxLength);
|
||||
|
||||
@@ -110,7 +110,7 @@ namespace sdr::contact
|
||||
{
|
||||
// #i102548# create unscaled, unsheared, unrotated and untranslated polygon
|
||||
// (unit polygon) by creating the object matrix and back-transforming the polygon
|
||||
const basegfx::B2DRange aObjectRange(basegfx::utils::getRange(aUnitPolyPolygon));
|
||||
const basegfx::B2DRange aObjectRange(aUnitPolyPolygon.getB2DRange());
|
||||
const GeoStat& rGeoStat(GetPathObj().GetGeoStat());
|
||||
const double fWidth(aObjectRange.getWidth());
|
||||
const double fHeight(aObjectRange.getHeight());
|
||||
|
||||
@@ -360,7 +360,7 @@ basegfx::B2DRange SlideBackgroundFillPrimitive2D::getB2DRange(
|
||||
const geometry::ViewInformation2D& /*rViewInformation*/) const
|
||||
{
|
||||
// return range
|
||||
return basegfx::utils::getRange(getB2DPolyPolygon());
|
||||
return getB2DPolyPolygon().getB2DRange();
|
||||
}
|
||||
|
||||
// provide unique ID
|
||||
@@ -378,7 +378,7 @@ sal_uInt32 SlideBackgroundFillPrimitive2D::getPrimitive2DID() const
|
||||
{
|
||||
// when we have no given definition range, use the range of the given geometry
|
||||
// also for definition (simplest case)
|
||||
const basegfx::B2DRange aRange(basegfx::utils::getRange(rPolyPolygon));
|
||||
const basegfx::B2DRange aRange(rPolyPolygon.getB2DRange());
|
||||
|
||||
return createPolyPolygonFillPrimitive(
|
||||
rPolyPolygon,
|
||||
@@ -511,7 +511,7 @@ sal_uInt32 SlideBackgroundFillPrimitive2D::getPrimitive2DID() const
|
||||
// fillGradientPrimitive is enough here (compared to PolyPolygonGradientPrimitive2D) since float transparence will be masked anyways
|
||||
Primitive2DContainer aAlpha {
|
||||
new FillGradientPrimitive2D(
|
||||
basegfx::utils::getRange(rPolyPolygon),
|
||||
rPolyPolygon.getB2DRange(),
|
||||
rDefinitionRange,
|
||||
rAlphaGradient)
|
||||
};
|
||||
@@ -646,7 +646,7 @@ sal_uInt32 SlideBackgroundFillPrimitive2D::getPrimitive2DID() const
|
||||
basegfx::B2DPolyPolygon aScaledUnitPolyPolygon(rUnitPolyPolygon);
|
||||
aScaledUnitPolyPolygon.transform(aJustScaleTransform);
|
||||
const basegfx::B2DRange aTextAnchorRange
|
||||
= getTextAnchorRange(rText, basegfx::utils::getRange(aScaledUnitPolyPolygon));
|
||||
= getTextAnchorRange(rText, aScaledUnitPolyPolygon.getB2DRange());
|
||||
|
||||
// now create a transformation from this basic range (aTextAnchorRange)
|
||||
// #i121494# if we have no scale use at least 1.0 to have a carrier e.g. for
|
||||
|
||||
@@ -150,7 +150,7 @@ namespace drawinglayer::primitive2d
|
||||
{
|
||||
if(rLineStartEnd.isStartActive())
|
||||
{
|
||||
const basegfx::B2DRange aArrowRange(basegfx::utils::getRange(rLineStartEnd.getStartPolyPolygon()));
|
||||
const basegfx::B2DRange aArrowRange(rLineStartEnd.getStartPolyPolygon().getB2DRange());
|
||||
fStartArrowW = rLineStartEnd.getStartWidth();
|
||||
fStartArrowH = aArrowRange.getHeight() * fStartArrowW / aArrowRange.getWidth();
|
||||
|
||||
@@ -162,7 +162,7 @@ namespace drawinglayer::primitive2d
|
||||
|
||||
if(rLineStartEnd.isEndActive())
|
||||
{
|
||||
const basegfx::B2DRange aArrowRange(basegfx::utils::getRange(rLineStartEnd.getEndPolyPolygon()));
|
||||
const basegfx::B2DRange aArrowRange(rLineStartEnd.getEndPolyPolygon().getB2DRange());
|
||||
fEndArrowW = rLineStartEnd.getEndWidth();
|
||||
fEndArrowH = aArrowRange.getHeight() * fEndArrowW / aArrowRange.getWidth();
|
||||
|
||||
|
||||
@@ -1651,7 +1651,7 @@ static bool lcl_ImpIsLine(const basegfx::B2DPolyPolygon& rPolyPolygon)
|
||||
|
||||
static tools::Rectangle lcl_ImpGetBoundRect(const basegfx::B2DPolyPolygon& rPolyPolygon)
|
||||
{
|
||||
basegfx::B2DRange aRange(basegfx::utils::getRange(rPolyPolygon));
|
||||
basegfx::B2DRange aRange(rPolyPolygon.getB2DRange());
|
||||
|
||||
if (aRange.isEmpty())
|
||||
return tools::Rectangle();
|
||||
@@ -2801,7 +2801,7 @@ bool SdrPathObj::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DP
|
||||
// #i72287# use polygon without control points for range calculation. Do not change rPolyPolygon
|
||||
// itself, else this method will no longer return the full polygon information (curve will
|
||||
// be lost)
|
||||
const basegfx::B2DRange aPolyRangeNoCurve(basegfx::utils::getRange(rPolyPolygon));
|
||||
const basegfx::B2DRange aPolyRangeNoCurve(rPolyPolygon.getB2DRange());
|
||||
aScale = aPolyRangeNoCurve.getRange();
|
||||
aTranslate = aPolyRangeNoCurve.getMinimum();
|
||||
|
||||
@@ -2833,7 +2833,7 @@ bool SdrPathObj::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DP
|
||||
// #i72287# use polygon without control points for range calculation. Do not change rPolyPolygon
|
||||
// itself, else this method will no longer return the full polygon information (curve will
|
||||
// be lost)
|
||||
const basegfx::B2DRange aCorrectedRangeNoCurve(basegfx::utils::getRange(rPolyPolygon));
|
||||
const basegfx::B2DRange aCorrectedRangeNoCurve(rPolyPolygon.getB2DRange());
|
||||
aTranslate = aObjectMatrix * aCorrectedRangeNoCurve.getMinimum();
|
||||
aScale = aCorrectedRangeNoCurve.getRange();
|
||||
|
||||
@@ -2847,7 +2847,7 @@ bool SdrPathObj::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DP
|
||||
// #i72287# use polygon without control points for range calculation. Do not change rPolyPolygon
|
||||
// itself, else this method will no longer return the full polygon information (curve will
|
||||
// be lost)
|
||||
const basegfx::B2DRange aPolyRangeNoCurve(basegfx::utils::getRange(rPolyPolygon));
|
||||
const basegfx::B2DRange aPolyRangeNoCurve(rPolyPolygon.getB2DRange());
|
||||
if (!aPolyRangeNoCurve.isEmpty())
|
||||
{
|
||||
aScale = aPolyRangeNoCurve.getRange();
|
||||
@@ -2980,7 +2980,7 @@ void SdrPathObj::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const b
|
||||
if(!aTranslate.equalZero())
|
||||
{
|
||||
// #i39529# absolute positioning, so get current position (without control points (!))
|
||||
const basegfx::B2DRange aCurrentRange(basegfx::utils::getRange(aNewPolyPolygon));
|
||||
const basegfx::B2DRange aCurrentRange(aNewPolyPolygon.getB2DRange());
|
||||
aTransform.translate(aTranslate.getX() - aCurrentRange.getMinX(), aTranslate.getY() - aCurrentRange.getMinY());
|
||||
}
|
||||
|
||||
|
||||
@@ -406,7 +406,7 @@ tools::Rectangle XPolygon::GetBoundRect() const
|
||||
// get a relatively correct BoundRect. Numerically, this is not
|
||||
// correct and never was.
|
||||
|
||||
const basegfx::B2DRange aPolygonRange(basegfx::utils::getRange(getB2DPolygon()));
|
||||
const basegfx::B2DRange aPolygonRange(getB2DPolygon().getB2DRange());
|
||||
aRetval = tools::Rectangle(basegfx::fround<tools::Long>(aPolygonRange.getMinX()),
|
||||
basegfx::fround<tools::Long>(aPolygonRange.getMinY()),
|
||||
basegfx::fround<tools::Long>(aPolygonRange.getMaxX()),
|
||||
|
||||
@@ -1045,7 +1045,7 @@ bool CairoCommon::drawPolyLine(const basegfx::B2DHomMatrix& rObjectToDevice,
|
||||
static const bool bFuzzing = comphelper::IsFuzzing();
|
||||
if (bFuzzing)
|
||||
{
|
||||
const basegfx::B2DRange aRange(basegfx::utils::getRange(rPolyLine));
|
||||
const basegfx::B2DRange aRange(rPolyLine.getB2DRange());
|
||||
if (aRange.getMaxX() - aRange.getMinX() > 0x10000000
|
||||
|| aRange.getMaxY() - aRange.getMinY() > 0x10000000)
|
||||
{
|
||||
|
||||
@@ -1234,7 +1234,7 @@ tools::Rectangle vcl::Region::GetBoundRect() const
|
||||
// prefer double precision source
|
||||
if(getB2DPolyPolygon())
|
||||
{
|
||||
const basegfx::B2DRange aRange(basegfx::utils::getRange(*getB2DPolyPolygon()));
|
||||
const basegfx::B2DRange aRange(getB2DPolyPolygon()->getB2DRange());
|
||||
|
||||
if(aRange.isEmpty())
|
||||
{
|
||||
|
||||
@@ -302,7 +302,7 @@ void OutputDevice::drawLine( basegfx::B2DPolyPolygon aLinePolyPolygon, const Lin
|
||||
|
||||
if (bFuzzing)
|
||||
{
|
||||
const basegfx::B2DRange aRange(basegfx::utils::getRange(aFillPolyPolygon));
|
||||
const basegfx::B2DRange aRange(aFillPolyPolygon.getB2DRange());
|
||||
if (aRange.getMaxX() - aRange.getMinX() > 0x10000000
|
||||
|| aRange.getMaxY() - aRange.getMinY() > 0x10000000)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user