Kaydet (Commit) 3ce9af42 authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Thorsten Behrens

loplugin:unusedmethods

Change-Id: I73180266c0af98dbd8d29bd3b11850996b94def9
Reviewed-on: https://gerrit.libreoffice.org/19195Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
üst 64de38cf
......@@ -418,25 +418,6 @@ namespace basegfx
testLastLine();
}
void doNormalize()
{
if(mpLine)
{
const double fHomValue(get((RowSize - 1), (RowSize - 1)));
for(sal_uInt16 a(0); a < RowSize; a++)
{
for(sal_uInt16 b(0); b < RowSize; b++)
{
set(a, b, get(a, b) / fHomValue);
}
}
// evtl. get rid of last matrix line
testLastLine();
}
}
double doDeterminant() const
{
ImplHomMatrixTemplate aWork(*this);
......@@ -461,35 +442,6 @@ namespace basegfx
return fRetval;
}
double doTrace() const
{
double fTrace = (mpLine) ? 0.0 : 1.0;
const sal_uInt16 nMaxLine(
sal::static_int_cast<sal_uInt16>(mpLine ? RowSize : (RowSize - 1)) );
for(sal_uInt16 a(0); a < nMaxLine; a++)
{
fTrace += get(a, a);
}
return fTrace;
}
void doTranspose()
{
for(sal_uInt16 a(0); a < (RowSize - 1); a++)
{
for(sal_uInt16 b(a + 1); b < RowSize; b++)
{
const double fTemp(get(a, b));
set(a, b, get(b, a));
set(b, a, fTemp);
}
}
testLastLine();
}
void doAddMatrix(const ImplHomMatrixTemplate& rMat)
{
for(sal_uInt16 a(0); a < RowSize; a++)
......
......@@ -69,13 +69,6 @@ namespace basegfx
const OUString& rStr,
const sal_Int32 nLen);
void skipNumber(sal_Int32& io_rPos,
const OUString& rStr,
const sal_Int32 nLen);
void skipDouble(sal_Int32& io_rPos,
const OUString& rStr);
void putNumberCharWithSpace(OUStringBuffer& rStr,
double fValue,
double fOldValue,
......
......@@ -3191,39 +3191,6 @@ namespace basegfx
}
}
bool containsOnlyHorizontalAndVerticalEdges(const B2DPolygon& rCandidate)
{
if(rCandidate.areControlPointsUsed())
{
return false;
}
const sal_uInt32 nPointCount(rCandidate.count());
if(nPointCount < 2)
{
return true;
}
const sal_uInt32 nEdgeCount(rCandidate.isClosed() ? nPointCount + 1 : nPointCount);
basegfx::B2DPoint aLast(rCandidate.getB2DPoint(0));
for(sal_uInt32 a(1); a < nEdgeCount; a++)
{
const sal_uInt32 nNextIndex(a % nPointCount);
const basegfx::B2DPoint aCurrent(rCandidate.getB2DPoint(nNextIndex));
if(!basegfx::fTools::equal(aLast.getX(), aCurrent.getX()) && !basegfx::fTools::equal(aLast.getY(), aCurrent.getY()))
{
return false;
}
aLast = aCurrent;
}
return true;
}
B2DVector getTangentEnteringPoint(const B2DPolygon& rCandidate, sal_uInt32 nIndex)
{
B2DVector aRetval(0.0, 0.0);
......
......@@ -495,24 +495,6 @@ namespace basegfx
return aRetval;
}
bool containsOnlyHorizontalAndVerticalEdges(const B2DPolyPolygon& rCandidate)
{
if(rCandidate.areControlPointsUsed())
{
return false;
}
for(sal_uInt32 a(0); a < rCandidate.count(); a++)
{
if(!containsOnlyHorizontalAndVerticalEdges(rCandidate.getB2DPolygon(a)))
{
return false;
}
}
return true;
}
B2DPolyPolygon createSevenSegmentPolyPolygon(sal_Char nNumber, bool bLitSegments)
{
// config here
......
......@@ -60,12 +60,6 @@ namespace basegfx
return *this;
}
B2IVector operator*( const B2DHomMatrix& rMat, const B2IVector& rVec )
{
B2IVector aRes( rVec );
return aRes*=rMat;
}
} // end of namespace basegfx
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -19,7 +19,7 @@
Dump a list of calls to methods, and a list of method definitions.
Then we will post-process the 2 lists and find the set of unused methods.
Be warned that it produces around 4G of log file.
Be warned that it produces around 5G of log file.
The process goes something like this:
$ make check
......@@ -99,9 +99,6 @@ public:
bool VisitCallExpr(CallExpr* );
bool VisitFunctionDecl( const FunctionDecl* decl );
bool VisitDeclRefExpr( const DeclRefExpr* );
bool VisitCXXConstructExpr( const CXXConstructExpr* );
bool VisitVarDecl( const VarDecl* );
bool VisitCXXRecordDecl( CXXRecordDecl* );
private:
void logCallToRootMethods(const FunctionDecl* functionDecl);
MyFuncInfo niceName(const FunctionDecl* functionDecl);
......@@ -216,22 +213,7 @@ bool UnusedMethods::VisitCallExpr(CallExpr* expr)
goto gotfunc;
}
/*
// ignore case where we can't determine the target of the call because we're inside a template
if (isa<CXXDependentScopeMemberExpr>(callee))
return true;
if (isa<UnresolvedLookupExpr>(callee))
return true;
if (isa<UnresolvedMemberExpr>(callee))
return true;
if (isa<DependentScopeDeclRefExpr>(callee))
return true;
// ignore this, doesn't really exist (side-effect of template expansion on scalar types)
if (isa<CXXPseudoDestructorExpr>(callee))
return true;
expr->dump();
std::string name = compiler.getSourceManager().getFilename(expansionLoc);
std::string sourceLocation = name + ":" + std::to_string(compiler.getSourceManager().getSpellingLineNumber(expansionLoc));
cout << sourceLocation << endl;
throw "Cant touch this";
*/
return true;
......@@ -249,28 +231,6 @@ gotfunc:
return true;
}
bool UnusedMethods::VisitCXXConstructExpr(const CXXConstructExpr* expr)
{
const CXXConstructorDecl *consDecl = expr->getConstructor();
consDecl = consDecl->getCanonicalDecl();
if (consDecl->getTemplatedKind() == FunctionDecl::TemplatedKind::TK_NonTemplate
&& !consDecl->isFunctionTemplateSpecialization()) {
return true;
}
// if we see a call to a constructor, it may effectively create a whole new class,
// if the constructor's class is templated.
if (!traversedFunctionSet.insert(fullyQualifiedName(consDecl)).second)
return true;
const CXXRecordDecl* parent = consDecl->getParent();
for( CXXRecordDecl::ctor_iterator it = parent->ctor_begin(); it != parent->ctor_end(); ++it)
TraverseCXXConstructorDecl(*it);
for( CXXRecordDecl::method_iterator it = parent->method_begin(); it != parent->method_end(); ++it)
TraverseCXXMethodDecl(*it);
return true;
}
bool UnusedMethods::VisitFunctionDecl( const FunctionDecl* functionDecl )
{
functionDecl = functionDecl->getCanonicalDecl();
......@@ -311,57 +271,6 @@ bool UnusedMethods::VisitDeclRefExpr( const DeclRefExpr* declRefExpr )
return true;
}
// this is for declarations of static variables that involve a template
bool UnusedMethods::VisitVarDecl( const VarDecl* varDecl )
{
varDecl = varDecl->getCanonicalDecl();
if (varDecl->getStorageClass() != SC_Static)
return true;
const CXXRecordDecl* recordDecl = varDecl->getType()->getAsCXXRecordDecl();
if (!recordDecl)
return true;
// workaround clang-3.5 issue
#if __clang_major__ > 3 || ( __clang_major__ == 3 && __clang_minor__ >= 6 )
if (!recordDecl->getTemplateInstantiationPattern())
return true;
#endif
for( CXXRecordDecl::ctor_iterator it = recordDecl->ctor_begin(); it != recordDecl->ctor_end(); ++it)
TraverseCXXConstructorDecl(*it);
for( CXXRecordDecl::method_iterator it = recordDecl->method_begin(); it != recordDecl->method_end(); ++it)
TraverseCXXMethodDecl(*it);
return true;
}
// Sometimes a class will inherit from something, and in the process invoke a template,
// which can create new methods.
//
bool UnusedMethods::VisitCXXRecordDecl( CXXRecordDecl* recordDecl )
{
recordDecl = recordDecl->getCanonicalDecl();
if (!recordDecl->hasDefinition())
return true;
// workaround clang-3.5 issue
#if __clang_major__ > 3 || ( __clang_major__ == 3 && __clang_minor__ >= 6 )
for(CXXBaseSpecifier* baseSpecifier = recordDecl->bases_begin();
baseSpecifier != recordDecl->bases_end(); ++baseSpecifier)
{
const Type *baseType = baseSpecifier->getType().getTypePtr();
if (isa<TypedefType>(baseSpecifier->getType())) {
baseType = dyn_cast<TypedefType>(baseType)->desugar().getTypePtr();
}
if (isa<RecordType>(baseType)) {
const RecordType *baseRecord = dyn_cast<RecordType>(baseType);
CXXRecordDecl* baseRecordDecl = dyn_cast<CXXRecordDecl>(baseRecord->getDecl());
if (baseRecordDecl && baseRecordDecl->getTemplateInstantiationPattern()) {
TraverseCXXRecordDecl(baseRecordDecl);
}
}
}
#endif
return true;
}
loplugin::Plugin::Registration< UnusedMethods > X("unusedmethods", false);
}
......
......@@ -103,6 +103,11 @@ exclusionSet = set([
"class vcl::Window * CreateWindow(class VCLXWindow **,const struct com::sun::star::awt::WindowDescriptor *,class vcl::Window *,long)",
])
# clang does not always use exactly the same numbers in the type-parameter vars it generates
# so I need to substitute them to ensure we can match correctly.
normalizeTypeParamsRegex = re.compile(r"type-parameter-\d+-\d+")
def normalizeTypeParams( line ):
return normalizeTypeParamsRegex.sub("type-parameter-?-?", line)
# The parsing here is designed to avoid grabbing stuff which is mixed in from gbuild.
# I have not yet found a way of suppressing the gbuild output.
......@@ -111,12 +116,12 @@ with io.open(sys.argv[1], "rb", buffering=1024*1024) as txt:
if line.startswith("definition:\t"):
idx1 = line.find("\t",12)
idx2 = line.find("\t",idx1+1)
funcInfo = (line[12:idx1], line[idx1+1:idx2])
funcInfo = (normalizeTypeParams(line[12:idx1]), normalizeTypeParams(line[idx1+1:idx2]))
definitionSet.add(funcInfo)
definitionToSourceLocationMap[funcInfo] = line[idx2+1:].strip()
elif line.startswith("call:\t"):
idx1 = line.find("\t",6)
callSet.add((line[6:idx1], line[idx1+1:].strip()))
callSet.add((normalizeTypeParams(line[6:idx1]), normalizeTypeParams(line[idx1+1:].strip())))
tmp1set = set()
for d in definitionSet:
......
......@@ -96,36 +96,6 @@ namespace basegfx
bool decompose(B2DTuple& rScale, B2DTuple& rTranslate, double& rRotate, double& rShearX) const;
};
// addition, subtraction
inline B2DHomMatrix operator+(const B2DHomMatrix& rMatA, const B2DHomMatrix& rMatB)
{
B2DHomMatrix aSum(rMatA);
aSum += rMatB;
return aSum;
}
inline B2DHomMatrix operator-(const B2DHomMatrix& rMatA, const B2DHomMatrix& rMatB)
{
B2DHomMatrix aDiv(rMatA);
aDiv -= rMatB;
return aDiv;
}
// multiplication, division by a constant
inline B2DHomMatrix operator*(const B2DHomMatrix& rMat, double fValue)
{
B2DHomMatrix aNew(rMat);
aNew *= fValue;
return aNew;
}
inline B2DHomMatrix operator/(const B2DHomMatrix& rMat, double fValue)
{
B2DHomMatrix aNew(rMat);
aNew *= 1.0 / fValue;
return aNew;
}
inline B2DHomMatrix operator*(const B2DHomMatrix& rMatA, const B2DHomMatrix& rMatB)
{
B2DHomMatrix aMul(rMatB);
......
......@@ -112,36 +112,6 @@ namespace basegfx
bool decompose(B3DTuple& rScale, B3DTuple& rTranslate, B3DTuple& rRotate, B3DTuple& rShear) const;
};
// addition, subtraction
inline B3DHomMatrix operator+(const B3DHomMatrix& rMatA, const B3DHomMatrix& rMatB)
{
B3DHomMatrix aSum(rMatA);
aSum += rMatB;
return aSum;
}
inline B3DHomMatrix operator-(const B3DHomMatrix& rMatA, const B3DHomMatrix& rMatB)
{
B3DHomMatrix aDiv(rMatA);
aDiv -= rMatB;
return aDiv;
}
// multiplication, division by constant value
inline B3DHomMatrix operator*(const B3DHomMatrix& rMat, double fValue)
{
B3DHomMatrix aNew(rMat);
aNew *= fValue;
return aNew;
}
inline B3DHomMatrix operator/(const B3DHomMatrix& rMat, double fValue)
{
B3DHomMatrix aNew(rMat);
aNew *= 1.0 / fValue;
return aNew;
}
inline B3DHomMatrix operator*(const B3DHomMatrix& rMatA, const B3DHomMatrix& rMatB)
{
B3DHomMatrix aMul(rMatB);
......
......@@ -115,70 +115,6 @@ namespace basegfx
};
// external operators
inline BPixel minimum(const BPixel& rTupA, const BPixel& rTupB)
{
return BPixel(
std::min(rTupB.getRed(), rTupA.getRed()),
std::min(rTupB.getGreen(), rTupA.getGreen()),
std::min(rTupB.getBlue(), rTupA.getBlue()),
std::min(rTupB.getOpacity(), rTupA.getOpacity()));
}
inline BPixel maximum(const BPixel& rTupA, const BPixel& rTupB)
{
return BPixel(
std::max(rTupB.getRed(), rTupA.getRed()),
std::max(rTupB.getGreen(), rTupA.getGreen()),
std::max(rTupB.getBlue(), rTupA.getBlue()),
std::max(rTupB.getOpacity(), rTupA.getOpacity()));
}
inline BPixel interpolate(const BPixel& rOld1, const BPixel& rOld2, double t)
{
if(rOld1 == rOld2)
{
return rOld1;
}
else if(0.0 >= t)
{
return rOld1;
}
else if(1.0 <= t)
{
return rOld2;
}
else
{
const sal_uInt32 nFactor(fround(256.0 * t));
const sal_uInt32 nNegFac(256L - nFactor);
return BPixel(
(sal_uInt8)(((sal_uInt32)rOld1.getRed() * nNegFac + (sal_uInt32)rOld2.getRed() * nFactor) >> 8L),
(sal_uInt8)(((sal_uInt32)rOld1.getGreen() * nNegFac + (sal_uInt32)rOld2.getGreen() * nFactor) >> 8L),
(sal_uInt8)(((sal_uInt32)rOld1.getBlue() * nNegFac + (sal_uInt32)rOld2.getBlue() * nFactor) >> 8L),
(sal_uInt8)(((sal_uInt32)rOld1.getOpacity() * nNegFac + (sal_uInt32)rOld2.getOpacity() * nFactor) >> 8L));
}
}
inline BPixel average(const BPixel& rOld1, const BPixel& rOld2)
{
return BPixel(
rOld1.getRed() == rOld2.getRed() ? rOld1.getRed() : (sal_uInt8)(((sal_uInt32)rOld1.getRed() + (sal_uInt32)rOld2.getRed()) >> 1L),
rOld1.getGreen() == rOld2.getGreen() ? rOld1.getGreen() : (sal_uInt8)(((sal_uInt32)rOld1.getGreen() + (sal_uInt32)rOld2.getGreen()) >> 1L),
rOld1.getBlue() == rOld2.getBlue() ? rOld1.getBlue() : (sal_uInt8)(((sal_uInt32)rOld1.getBlue() + (sal_uInt32)rOld2.getBlue()) >> 1L),
rOld1.getOpacity() == rOld2.getOpacity() ? rOld1.getOpacity() : (sal_uInt8)(((sal_uInt32)rOld1.getOpacity() + (sal_uInt32)rOld2.getOpacity()) >> 1L));
}
inline BPixel average(const BPixel& rOld1, const BPixel& rOld2, const BPixel& rOld3)
{
return BPixel(
(rOld1.getRed() == rOld2.getRed() && rOld2.getRed() == rOld3.getRed()) ? rOld1.getRed() : (sal_uInt8)(((sal_uInt32)rOld1.getRed() + (sal_uInt32)rOld2.getRed() + (sal_uInt32)rOld3.getRed()) / 3L),
(rOld1.getGreen() == rOld2.getGreen() && rOld2.getGreen() == rOld3.getGreen()) ? rOld1.getGreen() : (sal_uInt8)(((sal_uInt32)rOld1.getGreen() + (sal_uInt32)rOld2.getGreen() + (sal_uInt32)rOld3.getGreen()) / 3L),
(rOld1.getBlue() == rOld2.getBlue() && rOld2.getBlue() == rOld3.getBlue()) ? rOld1.getBlue() : (sal_uInt8)(((sal_uInt32)rOld1.getBlue() + (sal_uInt32)rOld2.getBlue() + (sal_uInt32)rOld3.getBlue()) / 3L),
(rOld1.getOpacity() == rOld2.getOpacity() && rOld2.getOpacity() == rOld3.getOpacity()) ? rOld1.getOpacity() : (sal_uInt8)(((sal_uInt32)rOld1.getOpacity() + (sal_uInt32)rOld2.getOpacity() + (sal_uInt32)rOld3.getOpacity()) / 3L));
}
} // end of namespace basegfx
#endif // INCLUDED_BASEGFX_PIXEL_BPIXEL_HXX
......
......@@ -442,11 +442,6 @@ namespace basegfx
*/
BASEGFX_DLLPUBLIC B2DPolygon snapPointsOfHorizontalOrVerticalEdges(const B2DPolygon& rCandidate);
/** returns true if the Polygon only contains horizontal or vertical edges
so that it could be represented by RegionBands
*/
bool containsOnlyHorizontalAndVerticalEdges(const B2DPolygon& rCandidate);
/// get the tangent with which the given point is entered seen from the previous
/// polygon path data. Take into account all stuff like closed state, zero-length edges and others.
BASEGFX_DLLPUBLIC B2DVector getTangentEnteringPoint(const B2DPolygon& rCandidate, sal_uInt32 nIndex);
......
......@@ -287,11 +287,6 @@ namespace basegfx
*/
BASEGFX_DLLPUBLIC B2DPolyPolygon snapPointsOfHorizontalOrVerticalEdges(const B2DPolyPolygon& rCandidate);
/** returns true if the Polygon only contains horizontal or vertical edges
so that it could be represented by RegionBands
*/
BASEGFX_DLLPUBLIC bool containsOnlyHorizontalAndVerticalEdges(const B2DPolyPolygon& rCandidate);
/// converters for css::drawing::PointSequence
BASEGFX_DLLPUBLIC B2DPolyPolygon UnoPointSequenceSequenceToB2DPolyPolygon(
const css::drawing::PointSequenceSequence& rPointSequenceSequenceSource,
......
......@@ -55,9 +55,6 @@ namespace basegfx
// get size of polygon. Control vectors are included in that ranges.
BASEGFX_DLLPUBLIC B3DRange getRange(const B3DPolygon& rCandidate);
// get area of polygon
BASEGFX_DLLPUBLIC double getArea(const ::basegfx::B3DPolygon& rCandidate);
// get length of polygon
BASEGFX_DLLPUBLIC double getLength(const B3DPolygon& rCandidate);
......
......@@ -83,15 +83,6 @@ namespace basegfx
{
}
/** Query total bounds of all added ranges.
@return the union bound rect over all added ranges.
*/
B2DRange getBounds() const
{
return maTotalBounds;
}
/** Add an additional range.
This method integrates a new range into the connected
......
......@@ -64,13 +64,10 @@ namespace basegfx
// coordinate calcs between X/Y and span
sal_uInt32 getIndexFromXY(sal_uInt32 nX, sal_uInt32 nY) const { return (nX + (nY * mnWidth)); }
sal_uInt32 getXFromIndex(sal_uInt32 nIndex) const { return (nIndex % mnWidth); }
sal_uInt32 getYFromIndex(sal_uInt32 nIndex) const { return (nIndex / mnWidth); }
// data access read
sal_uInt32 getWidth() const { return mnWidth; }
sal_uInt32 getHeight() const { return mnHeight; }
sal_uInt32 getCount() const { return mnCount; }
// data access read only
const BPixel& getBPixel(sal_uInt32 nIndex) const
......
......@@ -33,13 +33,6 @@ namespace basegfx
sal_uInt16* mpZBuffer;
public:
// reset
void resetZ()
{
reset();
memset(mpZBuffer, 0, sizeof(sal_uInt16) * mnCount);
}
// constructor/destructor
BZPixelRaster(sal_uInt32 nWidth, sal_uInt32 nHeight)
: BPixelRaster(nWidth, nHeight),
......
......@@ -122,10 +122,6 @@ namespace basegfx
BASEGFX_DLLPUBLIC ::basegfx::B3DHomMatrix homMatrixFromAffineMatrix3D( const css::geometry::AffineMatrix3D& matrix );
BASEGFX_DLLPUBLIC css::geometry::Matrix2D&
matrixFromHomMatrix( css::geometry::Matrix2D& matrix,
const ::basegfx::B2DHomMatrix& transform);
// Geometry conversions
......
......@@ -221,20 +221,6 @@ namespace basegfx
// external operators
inline B2DTuple minimum(const B2DTuple& rTupA, const B2DTuple& rTupB)
{
return B2DTuple(
std::min(rTupB.getX(), rTupA.getX()),
std::min(rTupB.getY(), rTupA.getY()));
}
inline B2DTuple maximum(const B2DTuple& rTupA, const B2DTuple& rTupB)
{
return B2DTuple(
std::max(rTupB.getX(), rTupA.getX()),
std::max(rTupB.getY(), rTupA.getY()));
}
inline B2DTuple absolute(const B2DTuple& rTup)
{
B2DTuple aAbs(
......@@ -272,13 +258,6 @@ namespace basegfx
rOld1.getY() == rOld2.getY() ? rOld1.getY() : (rOld1.getY() + rOld2.getY()) * 0.5);
}
inline B2DTuple average(const B2DTuple& rOld1, const B2DTuple& rOld2, const B2DTuple& rOld3)
{
return B2DTuple(
(rOld1.getX() == rOld2.getX() && rOld2.getX() == rOld3.getX()) ? rOld1.getX() : (rOld1.getX() + rOld2.getX() + rOld3.getX()) * (1.0 / 3.0),
(rOld1.getY() == rOld2.getY() && rOld2.getY() == rOld3.getY()) ? rOld1.getY() : (rOld1.getY() + rOld2.getY() + rOld3.getY()) * (1.0 / 3.0));
}
inline B2DTuple operator+(const B2DTuple& rTupA, const B2DTuple& rTupB)
{
B2DTuple aSum(rTupA);
......@@ -328,14 +307,6 @@ namespace basegfx
return aNew;
}
inline B2DTuple operator/(double t, const B2DTuple& rTup)
{
B2DTuple aNew(t, t);
B2DTuple aTmp(rTup);
aNew /= aTmp;
return aNew;
}
/** Round double to nearest integer for 2D tuple
@return the nearest integer for this tuple
......
......@@ -177,123 +177,6 @@ namespace basegfx
}
};
// external operators
inline B2I64Tuple minimum(const B2I64Tuple& rTupA, const B2I64Tuple& rTupB)
{
return B2I64Tuple(
std::min(rTupB.getX(), rTupA.getX()),
std::min(rTupB.getY(), rTupA.getY()));
}
inline B2I64Tuple maximum(const B2I64Tuple& rTupA, const B2I64Tuple& rTupB)
{
return B2I64Tuple(
std::max(rTupB.getX(), rTupA.getX()),
std::max(rTupB.getY(), rTupA.getY()));
}
inline B2I64Tuple absolute(const B2I64Tuple& rTup)
{
B2I64Tuple aAbs(
(0 > rTup.getX()) ? -rTup.getX() : rTup.getX(),
(0 > rTup.getY()) ? -rTup.getY() : rTup.getY());
return aAbs;
}
inline B2I64Tuple interpolate(const B2I64Tuple& rOld1, const B2I64Tuple& rOld2, double t)
{
if(rOld1 == rOld2)
{
return rOld1;
}
else if(0.0 >= t)
{
return rOld1;
}
else if(1.0 <= t)
{
return rOld2;
}
else
{
return B2I64Tuple(
basegfx::fround64(((rOld2.getX() - rOld1.getX()) * t) + rOld1.getX()),
basegfx::fround64(((rOld2.getY() - rOld1.getY()) * t) + rOld1.getY()));
}
}
inline B2I64Tuple average(const B2I64Tuple& rOld1, const B2I64Tuple& rOld2)
{
return B2I64Tuple(
rOld1.getX() == rOld2.getX() ? rOld1.getX() : basegfx::fround64((rOld1.getX() + rOld2.getX()) * 0.5),
rOld1.getY() == rOld2.getY() ? rOld1.getY() : basegfx::fround64((rOld1.getY() + rOld2.getY()) * 0.5));
}
inline B2I64Tuple average(const B2I64Tuple& rOld1, const B2I64Tuple& rOld2, const B2I64Tuple& rOld3)
{
return B2I64Tuple(
(rOld1.getX() == rOld2.getX() && rOld2.getX() == rOld3.getX()) ? rOld1.getX() : basegfx::fround64((rOld1.getX() + rOld2.getX() + rOld3.getX()) * (1.0 / 3.0)),
(rOld1.getY() == rOld2.getY() && rOld2.getY() == rOld3.getY()) ? rOld1.getY() : basegfx::fround64((rOld1.getY() + rOld2.getY() + rOld3.getY()) * (1.0 / 3.0)));
}
inline B2I64Tuple operator+(const B2I64Tuple& rTupA, const B2I64Tuple& rTupB)
{
B2I64Tuple aSum(rTupA);
aSum += rTupB;
return aSum;
}
inline B2I64Tuple operator-(const B2I64Tuple& rTupA, const B2I64Tuple& rTupB)
{
B2I64Tuple aSub(rTupA);
aSub -= rTupB;
return aSub;
}
inline B2I64Tuple operator/(const B2I64Tuple& rTupA, const B2I64Tuple& rTupB)
{
B2I64Tuple aDiv(rTupA);
aDiv /= rTupB;
return aDiv;