diff options
Diffstat (limited to 'basegfx/inc/basegfx')
80 files changed, 2111 insertions, 2111 deletions
diff --git a/basegfx/inc/basegfx/color/bcolor.hxx b/basegfx/inc/basegfx/color/bcolor.hxx index ba39c1dd4ab4..2d1edd112ae7 100644 --- a/basegfx/inc/basegfx/color/bcolor.hxx +++ b/basegfx/inc/basegfx/color/bcolor.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -55,52 +55,52 @@ namespace basegfx */ class BColor : public B3DTuple { - public: - /** Create a Color with red, green and blue components from [0.0 to 1.0] + public: + /** Create a Color with red, green and blue components from [0.0 to 1.0] The color is initialized to (0.0, 0.0, 0.0) */ - BColor() - : B3DTuple() + BColor() + : B3DTuple() {} - /** Create a 3D Color + /** Create a 3D Color @param fRed @param fGreen @param fBlue These parameters are used to initialize the red, green and blue intensities of the color */ - BColor(double fRed, double fGreen, double fBlue) - : B3DTuple(fRed, fGreen, fBlue) + BColor(double fRed, double fGreen, double fBlue) + : B3DTuple(fRed, fGreen, fBlue) {} - /** Create a 3D Color + /** Create a 3D Color @param fLuminosity The parameter is used to initialize the red, green and blue intensities of the color */ - BColor(double fLuminosity) - : B3DTuple(fLuminosity, fLuminosity, fLuminosity) + BColor(double fLuminosity) + : B3DTuple(fLuminosity, fLuminosity, fLuminosity) {} - /** Create a copy of a Color + /** Create a copy of a Color @param rVec The Color which will be copied. */ - BColor(const BColor& rVec) - : B3DTuple(rVec) + BColor(const BColor& rVec) + : B3DTuple(rVec) {} /** constructor with tuple to allow copy-constructing from B3DTuple-based classes */ - BColor(const ::basegfx::B3DTuple& rTuple) - : B3DTuple(rTuple) + BColor(const ::basegfx::B3DTuple& rTuple) + : B3DTuple(rTuple) {} - ~BColor() + ~BColor() {} // data access read @@ -115,33 +115,33 @@ namespace basegfx /** *=operator to allow usage from BColor, too */ - BColor& operator*=( const BColor& rPnt ) - { + BColor& operator*=( const BColor& rPnt ) + { mfX *= rPnt.mfX; - mfY *= rPnt.mfY; - mfZ *= rPnt.mfZ; - return *this; + mfY *= rPnt.mfY; + mfZ *= rPnt.mfZ; + return *this; } /** *=operator to allow usage from BColor, too */ - BColor& operator*=(double t) - { - mfX *= t; - mfY *= t; - mfZ *= t; - return *this; + BColor& operator*=(double t) + { + mfX *= t; + mfY *= t; + mfZ *= t; + return *this; } /** assignment operator to allow assigning the results of B3DTuple calculations */ - BColor& operator=( const ::basegfx::B3DTuple& rVec ) - { + BColor& operator=( const ::basegfx::B3DTuple& rVec ) + { mfX = rVec.getX(); - mfY = rVec.getY(); - mfZ = rVec.getZ(); - return *this; + mfY = rVec.getY(); + mfZ = rVec.getZ(); + return *this; } // blend to another color using luminance diff --git a/basegfx/inc/basegfx/color/bcolormodifier.hxx b/basegfx/inc/basegfx/color/bcolormodifier.hxx index b109f05c7e11..cc4a181ccc05 100644 --- a/basegfx/inc/basegfx/color/bcolormodifier.hxx +++ b/basegfx/inc/basegfx/color/bcolormodifier.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -36,32 +36,32 @@ namespace basegfx { - /** Descriptor for type of color modification + /** Descriptor for type of color modification */ enum BColorModifyMode { - BCOLORMODIFYMODE_REPLACE, // replace all color with local color - BCOLORMODIFYMODE_INTERPOLATE, // interpolate color between given and local with local value - BCOLORMODIFYMODE_GRAY, // convert color to gray - BCOLORMODIFYMODE_BLACKANDWHITE // convert color to B&W, local value is treshhold + BCOLORMODIFYMODE_REPLACE, // replace all color with local color + BCOLORMODIFYMODE_INTERPOLATE, // interpolate color between given and local with local value + BCOLORMODIFYMODE_GRAY, // convert color to gray + BCOLORMODIFYMODE_BLACKANDWHITE // convert color to B&W, local value is treshhold }; - /** Class to hold a color, value and mode for a color modification. Color modification is + /** Class to hold a color, value and mode for a color modification. Color modification is done calling the getModifiedColor() method */ class BColorModifier { protected: - ::basegfx::BColor maBColor; - double mfValue; - BColorModifyMode meMode; + ::basegfx::BColor maBColor; + double mfValue; + BColorModifyMode meMode; public: BColorModifier( - const ::basegfx::BColor& rBColor, - double fValue = 0.5, + const ::basegfx::BColor& rBColor, + double fValue = 0.5, BColorModifyMode eMode = BCOLORMODIFYMODE_REPLACE) - : maBColor(rBColor), + : maBColor(rBColor), mfValue(fValue), meMode(eMode) {} @@ -72,9 +72,9 @@ namespace basegfx return (maBColor == rCompare.maBColor && mfValue == rCompare.mfValue && meMode == rCompare.meMode); } - bool operator!=(const BColorModifier& rCompare) const - { - return !(operator==(rCompare)); + bool operator!=(const BColorModifier& rCompare) const + { + return !(operator==(rCompare)); } // data access @@ -86,13 +86,13 @@ namespace basegfx ::basegfx::BColor getModifiedColor(const ::basegfx::BColor& aSourceColor) const; }; - /** Class to hold a stack of BColorModifiers and to get the modified color with + /** Class to hold a stack of BColorModifiers and to get the modified color with applying all existing entry changes */ class BColorModifierStack { protected: - ::std::vector< BColorModifier > maBColorModifiers; + ::std::vector< BColorModifier > maBColorModifiers; public: sal_uInt32 count() const @@ -126,14 +126,14 @@ namespace basegfx } } - void push(const BColorModifier& rNew) - { - maBColorModifiers.push_back(rNew); + void push(const BColorModifier& rNew) + { + maBColorModifiers.push_back(rNew); } - void pop() - { - maBColorModifiers.pop_back(); + void pop() + { + maBColorModifiers.pop_back(); } }; } // end of namespace basegfx diff --git a/basegfx/inc/basegfx/color/bcolortools.hxx b/basegfx/inc/basegfx/color/bcolortools.hxx index 0502c77f3236..6814c31a30cd 100644 --- a/basegfx/inc/basegfx/color/bcolortools.hxx +++ b/basegfx/inc/basegfx/color/bcolortools.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/basegfx/inc/basegfx/curve/b2dbeziertools.hxx b/basegfx/inc/basegfx/curve/b2dbeziertools.hxx index 875ab5a1acec..4546244c2510 100644 --- a/basegfx/inc/basegfx/curve/b2dbeziertools.hxx +++ b/basegfx/inc/basegfx/curve/b2dbeziertools.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -47,8 +47,8 @@ namespace basegfx class B2DCubicBezierHelper { private: - ::std::vector< double > maLengthArray; - sal_uInt32 mnEdgeCount; + ::std::vector< double > maLengthArray; + sal_uInt32 mnEdgeCount; public: B2DCubicBezierHelper(const B2DCubicBezier& rBase, sal_uInt32 nDivisions = 9); diff --git a/basegfx/inc/basegfx/curve/b2dcubicbezier.hxx b/basegfx/inc/basegfx/curve/b2dcubicbezier.hxx index bcc657110521..2fc9f20fe701 100644 --- a/basegfx/inc/basegfx/curve/b2dcubicbezier.hxx +++ b/basegfx/inc/basegfx/curve/b2dcubicbezier.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -46,12 +46,12 @@ namespace basegfx { class B2DCubicBezier { - B2DPoint maStartPoint; - B2DPoint maEndPoint; - B2DPoint maControlPointA; - B2DPoint maControlPointB; + B2DPoint maStartPoint; + B2DPoint maEndPoint; + B2DPoint maControlPointA; + B2DPoint maControlPointB; - public: + public: B2DCubicBezier(); B2DCubicBezier(const B2DCubicBezier& rBezier); B2DCubicBezier(const B2DPoint& rStart, const B2DPoint& rEnd); @@ -72,7 +72,7 @@ namespace basegfx // test if contained bezier is trivial and reset vectors accordingly void testAndSolveTrivialBezier(); - /** get length of edge + /** get length of edge This method handles beziers and simple edges. For beziers, the deviation describes the maximum allowed @@ -101,10 +101,10 @@ namespace basegfx // data interface B2DPoint getStartPoint() const { return maStartPoint; } void setStartPoint(const B2DPoint& rValue) { maStartPoint = rValue; } - + B2DPoint getEndPoint() const { return maEndPoint; } void setEndPoint(const B2DPoint& rValue) { maEndPoint = rValue; } - + B2DPoint getControlPointA() const { return maControlPointA; } void setControlPointA(const B2DPoint& rValue) { maControlPointA = rValue; } @@ -147,14 +147,14 @@ namespace basegfx value. No start point is added, but all necessary created edges and the end point - + @param rPoly Output polygon. The subdivided bezier segment is added to this polygon via B2DPolygon::append(). - + @param rCurve The cubic bezier curve to subdivide - + @param fDistanceBound Bound on the maximal distance of the approximation to the true curve. diff --git a/basegfx/inc/basegfx/curve/b2dquadraticbezier.hxx b/basegfx/inc/basegfx/curve/b2dquadraticbezier.hxx index 6680acdc45ca..0da07c1ec554 100644 --- a/basegfx/inc/basegfx/curve/b2dquadraticbezier.hxx +++ b/basegfx/inc/basegfx/curve/b2dquadraticbezier.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -37,15 +37,15 @@ namespace basegfx { class B2DQuadraticBezier { - ::basegfx::B2DPoint maStartPoint; - ::basegfx::B2DPoint maEndPoint; - ::basegfx::B2DPoint maControlPoint; + ::basegfx::B2DPoint maStartPoint; + ::basegfx::B2DPoint maEndPoint; + ::basegfx::B2DPoint maControlPoint; - public: + public: B2DQuadraticBezier(); B2DQuadraticBezier(const B2DQuadraticBezier& rBezier); B2DQuadraticBezier(const ::basegfx::B2DPoint& rStart, const ::basegfx::B2DPoint& rEnd); - B2DQuadraticBezier(const ::basegfx::B2DPoint& rStart, + B2DQuadraticBezier(const ::basegfx::B2DPoint& rStart, const ::basegfx::B2DPoint& rControlPoint, const ::basegfx::B2DPoint& rEnd); ~B2DQuadraticBezier(); @@ -62,10 +62,10 @@ namespace basegfx // data interface ::basegfx::B2DPoint getStartPoint() const { return maStartPoint; } void setStartPoint(const ::basegfx::B2DPoint& rValue) { maStartPoint = rValue; } - + ::basegfx::B2DPoint getEndPoint() const { return maEndPoint; } void setEndPoint(const ::basegfx::B2DPoint& rValue) { maEndPoint = rValue; } - + ::basegfx::B2DPoint getControlPoint() const { return maControlPoint; } void setControlPoint(const ::basegfx::B2DPoint& rValue) { maControlPoint = rValue; } }; diff --git a/basegfx/inc/basegfx/matrix/b2dhommatrix.hxx b/basegfx/inc/basegfx/matrix/b2dhommatrix.hxx index 04d9a2aaf734..e64d1dbb9101 100644 --- a/basegfx/inc/basegfx/matrix/b2dhommatrix.hxx +++ b/basegfx/inc/basegfx/matrix/b2dhommatrix.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -129,14 +129,14 @@ namespace basegfx }; // Addition, Subtraktion - inline B2DHomMatrix operator+(const B2DHomMatrix& rMatA, const B2DHomMatrix& rMatB) + 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) + inline B2DHomMatrix operator-(const B2DHomMatrix& rMatA, const B2DHomMatrix& rMatB) { B2DHomMatrix aDiv(rMatA); aDiv -= rMatB; @@ -144,21 +144,21 @@ namespace basegfx } // Multiplikation, Division mit Konstante - inline B2DHomMatrix operator*(const B2DHomMatrix& rMat, double fValue) + inline B2DHomMatrix operator*(const B2DHomMatrix& rMat, double fValue) { - B2DHomMatrix aNew(rMat); - aNew *= fValue; - return aNew; + B2DHomMatrix aNew(rMat); + aNew *= fValue; + return aNew; } - inline B2DHomMatrix operator/(const B2DHomMatrix& rMat, double fValue) + inline B2DHomMatrix operator/(const B2DHomMatrix& rMat, double fValue) { - B2DHomMatrix aNew(rMat); + B2DHomMatrix aNew(rMat); aNew *= 1.0 / fValue; - return aNew; + return aNew; } - inline B2DHomMatrix operator*(const B2DHomMatrix& rMatA, const B2DHomMatrix& rMatB) + inline B2DHomMatrix operator*(const B2DHomMatrix& rMatA, const B2DHomMatrix& rMatB) { B2DHomMatrix aMul(rMatB); aMul *= rMatA; diff --git a/basegfx/inc/basegfx/matrix/b2dhommatrixtools.hxx b/basegfx/inc/basegfx/matrix/b2dhommatrixtools.hxx index a737719e4a30..1b310d5a14d2 100644 --- a/basegfx/inc/basegfx/matrix/b2dhommatrixtools.hxx +++ b/basegfx/inc/basegfx/matrix/b2dhommatrixtools.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -42,11 +42,11 @@ namespace basegfx namespace tools { /** If the rotation angle is an approximate multiple of pi/2, - force fSin/fCos to -1/0/1, to maintain orthogonality (which - might also be advantageous for the other cases, but: for - multiples of pi/2, the exact values _can_ be attained. It - would be largely unintuitive, if a 180 degrees rotation - would introduce slight roundoff errors, instead of exactly + force fSin/fCos to -1/0/1, to maintain orthogonality (which + might also be advantageous for the other cases, but: for + multiples of pi/2, the exact values _can_ be attained. It + would be largely unintuitive, if a 180 degrees rotation + would introduce slight roundoff errors, instead of exactly mirroring the coordinate system) */ void createSinCosOrthogonal(double& o_rSin, double& rCos, double fRadiant); @@ -164,12 +164,12 @@ namespace basegfx } // data access - B2DHomMatrix getB2DHomMatrix() const + B2DHomMatrix getB2DHomMatrix() const { return createScaleShearXRotateTranslateB2DHomMatrix( maScale, mfShearX, mfRotate, maTranslate); } - + const B2DVector& getScale() const { return maScale; } const B2DVector& getTranslate() const { return maTranslate; } double getRotate() const { return mfRotate; } diff --git a/basegfx/inc/basegfx/matrix/b3dhommatrix.hxx b/basegfx/inc/basegfx/matrix/b3dhommatrix.hxx index f3face91ee21..1aee20844adb 100644 --- a/basegfx/inc/basegfx/matrix/b3dhommatrix.hxx +++ b/basegfx/inc/basegfx/matrix/b3dhommatrix.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -102,7 +102,7 @@ namespace basegfx void frustum(double fLeft = -1.0, double fRight = 1.0, double fBottom = -1.0, double fTop = 1.0, double fNear = 0.001, double fFar = 1.0); - + void ortho(double fLeft = -1.0, double fRight = 1.0, double fBottom = -1.0, double fTop = 1.0, double fNear = 0.0, double fFar = 1.0); @@ -136,14 +136,14 @@ namespace basegfx }; // addition, subtraction - inline B3DHomMatrix operator+(const B3DHomMatrix& rMatA, const B3DHomMatrix& rMatB) + 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) + inline B3DHomMatrix operator-(const B3DHomMatrix& rMatA, const B3DHomMatrix& rMatB) { B3DHomMatrix aDiv(rMatA); aDiv -= rMatB; @@ -151,21 +151,21 @@ namespace basegfx } // multiplication, division by constant value - inline B3DHomMatrix operator*(const B3DHomMatrix& rMat, double fValue) + inline B3DHomMatrix operator*(const B3DHomMatrix& rMat, double fValue) { - B3DHomMatrix aNew(rMat); - aNew *= fValue; - return aNew; + B3DHomMatrix aNew(rMat); + aNew *= fValue; + return aNew; } - inline B3DHomMatrix operator/(const B3DHomMatrix& rMat, double fValue) + inline B3DHomMatrix operator/(const B3DHomMatrix& rMat, double fValue) { - B3DHomMatrix aNew(rMat); + B3DHomMatrix aNew(rMat); aNew *= 1.0 / fValue; - return aNew; + return aNew; } - inline B3DHomMatrix operator*(const B3DHomMatrix& rMatA, const B3DHomMatrix& rMatB) + inline B3DHomMatrix operator*(const B3DHomMatrix& rMatA, const B3DHomMatrix& rMatB) { B3DHomMatrix aMul(rMatB); aMul *= rMatA; diff --git a/basegfx/inc/basegfx/numeric/ftools.hxx b/basegfx/inc/basegfx/numeric/ftools.hxx index bc9a1c554187..a235f0a969b9 100644 --- a/basegfx/inc/basegfx/numeric/ftools.hxx +++ b/basegfx/inc/basegfx/numeric/ftools.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -35,25 +35,25 @@ // standard PI defines from solar.h, but we do not want to link against tools #ifndef F_PI -#define F_PI M_PI +#define F_PI M_PI #endif #ifndef F_PI2 -#define F_PI2 M_PI_2 +#define F_PI2 M_PI_2 #endif #ifndef F_PI4 -#define F_PI4 M_PI_4 +#define F_PI4 M_PI_4 #endif #ifndef F_PI180 -#define F_PI180 (M_PI/180.0) +#define F_PI180 (M_PI/180.0) #endif #ifndef F_PI1800 -#define F_PI1800 (M_PI/1800.0) +#define F_PI1800 (M_PI/1800.0) #endif #ifndef F_PI18000 -#define F_PI18000 (M_PI/18000.0) +#define F_PI18000 (M_PI/18000.0) #endif #ifndef F_2PI -#define F_2PI (2.0*M_PI) +#define F_2PI (2.0*M_PI) #endif ////////////////////////////////////////////////////////////////////////////// @@ -68,16 +68,16 @@ namespace basegfx inline sal_Int32 fround( double fVal ) { return fVal > 0.0 ? static_cast<sal_Int32>( fVal + .5 ) : -static_cast<sal_Int32>( -fVal + .5 ); - } + } /** Round double to nearest integer - - @return the nearest 64 bit integer + + @return the nearest 64 bit integer */ inline sal_Int64 fround64( double fVal ) { return fVal > 0.0 ? static_cast<sal_Int64>( fVal + .5 ) : -static_cast<sal_Int64>( -fVal + .5 ); - } + } /** Prune a small epsilon range around zero. @@ -98,9 +98,9 @@ namespace basegfx // just use the full comparison. I keep the original here, maybe there will be a better // solution some day. // - //return fVal < 0.0 ? + //return fVal < 0.0 ? // (::std::min(fVal,-0.00001)) : - // (::std::max(fVal,0.00001)); + // (::std::max(fVal,0.00001)); if(fVal < 0.0) return (fVal < -0.00001 ? fVal : -0.00001); @@ -128,17 +128,17 @@ namespace basegfx /** Convert value from degrees to radians */ - inline double deg2rad( double v ) - { + inline double deg2rad( double v ) + { // divide first, to get exact values for v being a multiple of // 90 degrees - return v / 90.0 * M_PI_2; + return v / 90.0 * M_PI_2; } /** Convert value radians to degrees */ - inline double rad2deg( double v ) - { + inline double rad2deg( double v ) + { // divide first, to get exact values for v being a multiple of // pi/2 return v / M_PI_2 * 90.0; @@ -148,7 +148,7 @@ namespace basegfx class fTools { /// Threshold value for equalZero() - static double mfSmallValue; + static double mfSmallValue; public: /// Get threshold value for equalZero and friends @@ -157,46 +157,46 @@ namespace basegfx static void setSmallValue(const double& rfNew) { mfSmallValue = rfNew; } /// Compare against small value - static bool equalZero(const double& rfVal) - { - return (fabs(rfVal) <= getSmallValue()); + static bool equalZero(const double& rfVal) + { + return (fabs(rfVal) <= getSmallValue()); } /// Compare against given small value - static bool equalZero(const double& rfVal, const double& rfSmallValue) - { - return (fabs(rfVal) <= rfSmallValue); + static bool equalZero(const double& rfVal, const double& rfSmallValue) + { + return (fabs(rfVal) <= rfSmallValue); } - static bool equal(const double& rfValA, const double& rfValB) - { + static bool equal(const double& rfValA, const double& rfValB) + { // changed to approxEqual usage for better numerical correctness return rtl::math::approxEqual(rfValA, rfValB); } - static bool equal(const double& rfValA, const double& rfValB, const double& rfSmallValue) - { - return (fabs(rfValA - rfValB) <= rfSmallValue); + static bool equal(const double& rfValA, const double& rfValB, const double& rfSmallValue) + { + return (fabs(rfValA - rfValB) <= rfSmallValue); } - static bool less(const double& rfValA, const double& rfValB) - { - return (rfValA < rfValB && !equal(rfValA, rfValB)); + static bool less(const double& rfValA, const double& rfValB) + { + return (rfValA < rfValB && !equal(rfValA, rfValB)); } - static bool lessOrEqual(const double& rfValA, const double& rfValB) - { - return (rfValA < rfValB || equal(rfValA, rfValB)); + static bool lessOrEqual(const double& rfValA, const double& rfValB) + { + return (rfValA < rfValB || equal(rfValA, rfValB)); } - static bool more(const double& rfValA, const double& rfValB) - { - return (rfValA > rfValB && !equal(rfValA, rfValB)); + static bool more(const double& rfValA, const double& rfValB) + { + return (rfValA > rfValB && !equal(rfValA, rfValB)); } - static bool moreOrEqual(const double& rfValA, const double& rfValB) - { - return (rfValA > rfValB || equal(rfValA, rfValB)); + static bool moreOrEqual(const double& rfValA, const double& rfValB) + { + return (rfValA > rfValB || equal(rfValA, rfValB)); } }; } // end of namespace basegfx diff --git a/basegfx/inc/basegfx/pixel/bpixel.hxx b/basegfx/inc/basegfx/pixel/bpixel.hxx index fcc2fdfba2a4..7890ef4199a1 100644 --- a/basegfx/inc/basegfx/pixel/bpixel.hxx +++ b/basegfx/inc/basegfx/pixel/bpixel.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -48,16 +48,16 @@ namespace basegfx struct { // bitfield - unsigned mnR : 8; // red intensity - unsigned mnG : 8; // green intensity - unsigned mnB : 8; // blue intensity - unsigned mnO : 8; // opacity, 0 == full transparence + unsigned mnR : 8; // red intensity + unsigned mnG : 8; // green intensity + unsigned mnB : 8; // blue intensity + unsigned mnO : 8; // opacity, 0 == full transparence } maRGBO; - + struct { // bitfield - unsigned mnValue : 32; // all values + unsigned mnValue : 32; // all values } maCombinedRGBO; } maPixelUnion; @@ -97,10 +97,10 @@ namespace basegfx {} // assignment operator - BPixel& operator=( const BPixel& rPixel ) - { + BPixel& operator=( const BPixel& rPixel ) + { maPixelUnion.maCombinedRGBO.mnValue = rPixel.maPixelUnion.maCombinedRGBO.mnValue; - return *this; + return *this; } // data access read @@ -124,13 +124,13 @@ namespace basegfx bool isEmpty() const { return isInvisible(); } bool isUsed() const { return isVisible(); } - bool operator==( const BPixel& rPixel ) const - { + bool operator==( const BPixel& rPixel ) const + { return (rPixel.maPixelUnion.maCombinedRGBO.mnValue == maPixelUnion.maCombinedRGBO.mnValue); } - bool operator!=( const BPixel& rPixel ) const - { + bool operator!=( const BPixel& rPixel ) const + { return (rPixel.maPixelUnion.maCombinedRGBO.mnValue != maPixelUnion.maCombinedRGBO.mnValue); } @@ -141,28 +141,28 @@ namespace basegfx ////////////////////////////////////////////////////////////////////////// // external operators - inline BPixel minimum(const BPixel& rTupA, const BPixel& rTupB) - { + inline BPixel minimum(const BPixel& rTupA, const BPixel& rTupB) + { BPixel aMin( (rTupB.getRed() < rTupA.getRed()) ? rTupB.getRed() : rTupA.getRed(), (rTupB.getGreen() < rTupA.getGreen()) ? rTupB.getGreen() : rTupA.getGreen(), (rTupB.getBlue() < rTupA.getBlue()) ? rTupB.getBlue() : rTupA.getBlue(), - (rTupB.getOpacity() < rTupA.getOpacity()) ? rTupB.getOpacity() : rTupA.getOpacity()); + (rTupB.getOpacity() < rTupA.getOpacity()) ? rTupB.getOpacity() : rTupA.getOpacity()); return aMin; } - inline BPixel maximum(const BPixel& rTupA, const BPixel& rTupB) - { + inline BPixel maximum(const BPixel& rTupA, const BPixel& rTupB) + { BPixel aMax( (rTupB.getRed() > rTupA.getRed()) ? rTupB.getRed() : rTupA.getRed(), (rTupB.getGreen() > rTupA.getGreen()) ? rTupB.getGreen() : rTupA.getGreen(), (rTupB.getBlue() > rTupA.getBlue()) ? rTupB.getBlue() : rTupA.getBlue(), - (rTupB.getOpacity() > rTupA.getOpacity()) ? rTupB.getOpacity() : rTupA.getOpacity()); + (rTupB.getOpacity() > rTupA.getOpacity()) ? rTupB.getOpacity() : rTupA.getOpacity()); return aMax; } - inline BPixel interpolate(const BPixel& rOld1, const BPixel& rOld2, double t) - { + inline BPixel interpolate(const BPixel& rOld1, const BPixel& rOld2, double t) + { if(rOld1 == rOld2) { return rOld1; @@ -187,8 +187,8 @@ namespace basegfx } } - inline BPixel average(const BPixel& rOld1, const BPixel& rOld2) - { + inline BPixel average(const BPixel& rOld1, const BPixel& rOld2) + { if(rOld1 == rOld2) { return rOld1; @@ -202,9 +202,9 @@ namespace basegfx (sal_uInt8)(((sal_uInt32)rOld1.getOpacity() + (sal_uInt32)rOld2.getOpacity()) >> 1L)); } } - + inline BPixel average(const BPixel& rOld1, const BPixel& rOld2, const BPixel& rOld3) - { + { if(rOld1 == rOld2 && rOld2 == rOld3) { return rOld1; diff --git a/basegfx/inc/basegfx/point/b2dhompoint.hxx b/basegfx/inc/basegfx/point/b2dhompoint.hxx index 2736edaedde8..bccea8d783e7 100644 --- a/basegfx/inc/basegfx/point/b2dhompoint.hxx +++ b/basegfx/inc/basegfx/point/b2dhompoint.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -50,18 +50,18 @@ namespace basegfx { protected: /// This member contains the coordinate part of the point - ::basegfx::B2DTuple maTuple; + ::basegfx::B2DTuple maTuple; /// This Member holds the homogenous part of the point - double mfW; + double mfW; - /** Test if this homogen point does have a homogenous part + /** Test if this homogen point does have a homogenous part @return Returns true if this point has no homogenous part */ bool implIsHomogenized() const; - - /** Remove homogenous part of this Point + + /** Remove homogenous part of this Point This method does necessary calculations to remove the evtl. homogenous part of this Point. This may @@ -69,7 +69,7 @@ namespace basegfx */ void implHomogenize(); - /** Test and on demand remove homogenous part + /** Test and on demand remove homogenous part This method tests if this Point does have a homogenous part and then evtl. takes actions to remove that part. @@ -81,87 +81,87 @@ namespace basegfx */ void implTestAndHomogenize() const; - public: - /** Create a homogen point + public: + /** Create a homogen point The point is initialized to (0.0, 0.0) */ - B2DHomPoint() - : maTuple(), + B2DHomPoint() + : maTuple(), mfW(1.0) {} - /** Create a homogen point + /** Create a homogen point @param fX This parameter is used to initialize the X-coordinate of the Point. The homogenous part is initialized to 1.0. - + @param fY This parameter is used to initialize the Y-coordinate of the Point. The homogenous part is initialized to 1.0. */ - B2DHomPoint(double fX, double fY) - : maTuple(fX, fY), + B2DHomPoint(double fX, double fY) + : maTuple(fX, fY), mfW(1.0) {} - /** Create a copy of a 2D Point + /** Create a copy of a 2D Point @param rVec - The 2D point which will be copied. The homogenous part + The 2D point which will be copied. The homogenous part is initialized to 1.0. */ - B2DHomPoint(const B2DPoint& rVec) - : maTuple(rVec), + B2DHomPoint(const B2DPoint& rVec) + : maTuple(rVec), mfW(1.0) {} - /** Create a copy of a homogen point + /** Create a copy of a homogen point @param rVec - The homogen point which will be copied. The homogenous part + The homogen point which will be copied. The homogenous part is copied, too. */ - B2DHomPoint(const B2DHomPoint& rVec) - : maTuple(rVec.maTuple.getX(), rVec.maTuple.getY()), + B2DHomPoint(const B2DHomPoint& rVec) + : maTuple(rVec.maTuple.getX(), rVec.maTuple.getY()), mfW(rVec.mfW) {} - ~B2DHomPoint() + ~B2DHomPoint() {} - /** Get a 2D point from this homogenous point + /** Get a 2D point from this homogenous point This method normalizes this homogen point if necessary and returns the corresponding 2D point for this homogen point. - + @attention Even when this method is const it may change all members of this instance. */ B2DPoint getB2DPoint() const; - /** Get X-coordinate + /** Get X-coordinate This method normalizes this homogen point if necessary and returns the corresponding X-coordinate for this homogen point. - + @attention Even when this method is const it may change all members of this instance. */ double getX() const; - /** Get Y-coordinate + /** Get Y-coordinate This method normalizes this homogen point if necessary and returns the corresponding Y-coordinate for this homogen point. - + @attention Even when this method is const it may change all members of this instance. */ double getY() const; - /** Set X-coordinate of the homogen point. + /** Set X-coordinate of the homogen point. This method sets the X-coordinate of the homogen point. If the point does have a homogenous part this is taken into account. @@ -171,7 +171,7 @@ namespace basegfx */ void setX(double fX); - /** Set Y-coordinate of the homogen point. + /** Set Y-coordinate of the homogen point. This method sets the Y-coordinate of the homogen point. If the point does have a homogenous part this is taken into account. @@ -187,7 +187,7 @@ namespace basegfx B2DHomPoint& operator+=( const B2DHomPoint& rPnt ); B2DHomPoint& operator-=( const B2DHomPoint& rPnt ); - + B2DHomPoint& operator*=(double t); B2DHomPoint& operator*=( const B2DHomMatrix& rMat ); @@ -195,11 +195,11 @@ namespace basegfx B2DHomPoint& operator/=(double t); B2DHomPoint& operator-(void); - + bool operator==( const B2DHomPoint& rPnt ) const; bool operator!=( const B2DHomPoint& rPnt ) const; - + B2DHomPoint& operator=( const B2DHomPoint& rPnt ); }; @@ -215,7 +215,7 @@ namespace basegfx B2DHomPoint interpolate(B2DHomPoint& rOld1, B2DHomPoint& rOld2, double t); B2DHomPoint average(B2DHomPoint& rOld1, B2DHomPoint& rOld2); - + B2DHomPoint average(B2DHomPoint& rOld1, B2DHomPoint& rOld2, B2DHomPoint& rOld3); B2DHomPoint operator+(const B2DHomPoint& rVecA, const B2DHomPoint& rVecB); diff --git a/basegfx/inc/basegfx/point/b2dpoint.hxx b/basegfx/inc/basegfx/point/b2dpoint.hxx index 2b652d64afb8..19ca6e3a70ca 100644 --- a/basegfx/inc/basegfx/point/b2dpoint.hxx +++ b/basegfx/inc/basegfx/point/b2dpoint.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -49,73 +49,73 @@ namespace basegfx */ class B2DPoint : public ::basegfx::B2DTuple { - public: - /** Create a 2D Point + public: + /** Create a 2D Point The point is initialized to (0.0, 0.0) */ - B2DPoint() - : B2DTuple() + B2DPoint() + : B2DTuple() {} - /** Create a 2D Point + /** Create a 2D Point @param fX This parameter is used to initialize the X-coordinate of the 2D Point. - + @param fY This parameter is used to initialize the Y-coordinate of the 2D Point. */ - B2DPoint(double fX, double fY) - : B2DTuple(fX, fY) + B2DPoint(double fX, double fY) + : B2DTuple(fX, fY) {} - /** Create a copy of a 2D Point + /** Create a copy of a 2D Point @param rPoint The 2D Point which will be copied. */ - B2DPoint(const B2DPoint& rPoint) - : B2DTuple(rPoint) + B2DPoint(const B2DPoint& rPoint) + : B2DTuple(rPoint) {} - /** Create a copy of a 2D Point + /** Create a copy of a 2D Point @param rPoint The 2D Point which will be copied. */ - B2DPoint(const ::basegfx::B2IPoint& rPoint) - : B2DTuple(rPoint) + B2DPoint(const ::basegfx::B2IPoint& rPoint) + : B2DTuple(rPoint) {} /** constructor with tuple to allow copy-constructing from B2DTuple-based classes */ - B2DPoint(const ::basegfx::B2DTuple& rTuple) - : B2DTuple(rTuple) + B2DPoint(const ::basegfx::B2DTuple& rTuple) + : B2DTuple(rTuple) {} - ~B2DPoint() + ~B2DPoint() {} /** *=operator to allow usage from B2DPoint, too */ - B2DPoint& operator*=( const B2DPoint& rPnt ) - { + B2DPoint& operator*=( const B2DPoint& rPnt ) + { mfX *= rPnt.mfX; - mfY *= rPnt.mfY; - return *this; + mfY *= rPnt.mfY; + return *this; } /** *=operator to allow usage from B2DPoint, too */ - B2DPoint& operator*=(double t) - { - mfX *= t; - mfY *= t; - return *this; + B2DPoint& operator*=(double t) + { + mfX *= t; + mfY *= t; + return *this; } /** assignment operator to allow assigning the results @@ -140,7 +140,7 @@ namespace basegfx ////////////////////////////////////////////////////////////////////////// /** Transform B2DPoint by given transformation matrix. - + Since this is a Point, translational components of the matrix are used. */ diff --git a/basegfx/inc/basegfx/point/b2ipoint.hxx b/basegfx/inc/basegfx/point/b2ipoint.hxx index c9ec03108b22..2c4cff939c7a 100644 --- a/basegfx/inc/basegfx/point/b2ipoint.hxx +++ b/basegfx/inc/basegfx/point/b2ipoint.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -46,64 +46,64 @@ namespace basegfx */ class B2IPoint : public ::basegfx::B2ITuple { - public: - /** Create a 2D Point + public: + /** Create a 2D Point The point is initialized to (0, 0) */ - B2IPoint() - : B2ITuple() + B2IPoint() + : B2ITuple() {} - /** Create a 2D Point + /** Create a 2D Point @param nX This parameter is used to initialize the X-coordinate of the 2D Point. - + @param nY This parameter is used to initialize the Y-coordinate of the 2D Point. */ - B2IPoint(sal_Int32 nX, sal_Int32 nY) - : B2ITuple(nX, nY) + B2IPoint(sal_Int32 nX, sal_Int32 nY) + : B2ITuple(nX, nY) {} - /** Create a copy of a 2D Point + /** Create a copy of a 2D Point @param rPoint The 2D Point which will be copied. */ - B2IPoint(const B2IPoint& rPoint) - : B2ITuple(rPoint) + B2IPoint(const B2IPoint& rPoint) + : B2ITuple(rPoint) {} /** constructor with tuple to allow copy-constructing from B2ITuple-based classes */ - B2IPoint(const ::basegfx::B2ITuple& rTuple) - : B2ITuple(rTuple) + B2IPoint(const ::basegfx::B2ITuple& rTuple) + : B2ITuple(rTuple) {} - ~B2IPoint() + ~B2IPoint() {} /** *=operator to allow usage from B2IPoint, too */ - B2IPoint& operator*=( const B2IPoint& rPnt ) - { + B2IPoint& operator*=( const B2IPoint& rPnt ) + { mnX *= rPnt.mnX; - mnY *= rPnt.mnY; - return *this; + mnY *= rPnt.mnY; + return *this; } /** *=operator to allow usage from B2IPoint, too */ - B2IPoint& operator*=(sal_Int32 t) - { - mnX *= t; - mnY *= t; - return *this; + B2IPoint& operator*=(sal_Int32 t) + { + mnX *= t; + mnY *= t; + return *this; } /** assignment operator to allow assigning the results diff --git a/basegfx/inc/basegfx/point/b3dhompoint.hxx b/basegfx/inc/basegfx/point/b3dhompoint.hxx index 763997620bd0..3bea4d66f2ac 100644 --- a/basegfx/inc/basegfx/point/b3dhompoint.hxx +++ b/basegfx/inc/basegfx/point/b3dhompoint.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -50,22 +50,22 @@ namespace basegfx { protected: /// This member contains the coordinate part of the point - ::basegfx::B3DTuple maTuple; - + ::basegfx::B3DTuple maTuple; + /// This Member holds the homogenous part of the point - double mfW; + double mfW; - /** Test if this homogen point does have a homogenous part + /** Test if this homogen point does have a homogenous part @return Returns true if this point has no homogenous part */ - bool implIsHomogenized() const - { + bool implIsHomogenized() const + { const double fOne(1.0); - return ::basegfx::fTools::equal(mfW, fOne); + return ::basegfx::fTools::equal(mfW, fOne); } - - /** Remove homogenous part of this Point + + /** Remove homogenous part of this Point This method does necessary calculations to remove the evtl. homogenous part of this Point. This may @@ -73,7 +73,7 @@ namespace basegfx */ void implHomogenize(); - /** Test and on demand remove homogenous part + /** Test and on demand remove homogenous part This method tests if this Point does have a homogenous part and then evtl. takes actions to remove that part. @@ -89,65 +89,65 @@ namespace basegfx ((B3DHomPoint*)this)->implHomogenize(); } - public: - /** Create a homogen point + public: + /** Create a homogen point The point is initialized to (0.0, 0.0, 0.0) */ - B3DHomPoint() - : maTuple(), + B3DHomPoint() + : maTuple(), mfW(1.0) {} - /** Create a homogen point + /** Create a homogen point @param fX This parameter is used to initialize the X-coordinate of the Point. The homogenous part is initialized to 1.0. - + @param fY This parameter is used to initialize the Y-coordinate of the Point. The homogenous part is initialized to 1.0. - + @param fZ This parameter is used to initialize the Z-coordinate of the Point. The homogenous part is initialized to 1.0. */ - B3DHomPoint(double fX, double fY, double fZ) - : maTuple(fX, fY, fZ), + B3DHomPoint(double fX, double fY, double fZ) + : maTuple(fX, fY, fZ), mfW(1.0) {} - /** Create a copy of a 3D Point + /** Create a copy of a 3D Point @param rVec - The 3D point which will be copied. The homogenous part + The 3D point which will be copied. The homogenous part is initialized to 1.0. */ - B3DHomPoint(const B3DPoint& rVec) - : maTuple(rVec), + B3DHomPoint(const B3DPoint& rVec) + : maTuple(rVec), mfW(1.0) {} - /** Create a copy of a homogen point + /** Create a copy of a homogen point @param rVec - The homogen point which will be copied. The homogenous part + The homogen point which will be copied. The homogenous part is copied, too. */ - B3DHomPoint(const B3DHomPoint& rVec) - : maTuple(rVec.maTuple.getX(), rVec.maTuple.getY(), rVec.maTuple.getZ()), + B3DHomPoint(const B3DHomPoint& rVec) + : maTuple(rVec.maTuple.getX(), rVec.maTuple.getY(), rVec.maTuple.getZ()), mfW(rVec.mfW) {} - ~B3DHomPoint() + ~B3DHomPoint() {} - /** get a 3D point from this homogenous point + /** get a 3D point from this homogenous point This method normalizes this homogen point if necessary and returns the corresponding 3D point for this homogen point. - + @attention Even when this method is const it may change all members of this instance. */ @@ -157,49 +157,49 @@ namespace basegfx return B3DPoint(maTuple.getX(), maTuple.getY(), maTuple.getZ()); } - /** get X-coordinate + /** get X-coordinate This method normalizes this homogen point if necessary and returns the corresponding X-coordinate for this homogen point. - + @attention Even when this method is const it may change all members of this instance. */ double getX() const - { + { implTestAndHomogenize(); - return maTuple.getX(); + return maTuple.getX(); } - /** get Y-coordinate + /** get Y-coordinate This method normalizes this homogen point if necessary and returns the corresponding Y-coordinate for this homogen point. - + @attention Even when this method is const it may change all members of this instance. */ double getY() const - { + { implTestAndHomogenize(); - return maTuple.getY(); + return maTuple.getY(); } - /** get Z-coordinate + /** get Z-coordinate This method normalizes this homogen point if necessary and returns the corresponding Z-coordinate for this homogen point. - + @attention Even when this method is const it may change all members of this instance. */ double getZ() const - { + { implTestAndHomogenize(); - return maTuple.getY(); + return maTuple.getY(); } - /** Set X-coordinate of the homogen point. + /** Set X-coordinate of the homogen point. This method sets the X-coordinate of the homogen point. If the point does have a homogenous part this is taken into account. @@ -212,7 +212,7 @@ namespace basegfx maTuple.setX(implIsHomogenized() ? fX : fX * mfW ); } - /** Set Y-coordinate of the homogen point. + /** Set Y-coordinate of the homogen point. This method sets the Y-coordinate of the homogen point. If the point does have a homogenous part this is taken into account. @@ -225,7 +225,7 @@ namespace basegfx maTuple.setY(implIsHomogenized() ? fY : fY * mfW ); } - /** Set Z-coordinate of the homogen point. + /** Set Z-coordinate of the homogen point. This method sets the Z-coordinate of the homogen point. If the point does have a homogenous part this is taken into account. @@ -241,8 +241,8 @@ namespace basegfx // operators ////////////////////////////////////////////////////////////////////// - B3DHomPoint& operator+=( const B3DHomPoint& rPnt ) - { + B3DHomPoint& operator+=( const B3DHomPoint& rPnt ) + { maTuple.setX(getX() * rPnt.mfW + rPnt.getX() * mfW); maTuple.setY(getY() * rPnt.mfW + rPnt.getY() * mfW); maTuple.setZ(getZ() * rPnt.mfW + rPnt.getZ() * mfW); @@ -251,8 +251,8 @@ namespace basegfx return *this; } - B3DHomPoint& operator-=( const B3DHomPoint& rPnt ) - { + B3DHomPoint& operator-=( const B3DHomPoint& rPnt ) + { maTuple.setX(getX() * rPnt.mfW - rPnt.getX() * mfW); maTuple.setY(getY() * rPnt.mfW - rPnt.getY() * mfW); maTuple.setZ(getZ() * rPnt.mfW - rPnt.getZ() * mfW); @@ -260,146 +260,146 @@ namespace basegfx return *this; } - - B3DHomPoint& operator*=(double t) - { + + B3DHomPoint& operator*=(double t) + { if(!::basegfx::fTools::equalZero(t)) { mfW /= t; } - return *this; + return *this; } - B3DHomPoint& operator/=(double t) - { + B3DHomPoint& operator/=(double t) + { mfW *= t; - return *this; + return *this; } B3DHomPoint& operator-(void) - { + { mfW = -mfW; return *this; } - - bool operator==( const B3DHomPoint& rPnt ) const - { + + bool operator==( const B3DHomPoint& rPnt ) const + { implTestAndHomogenize(); return (maTuple == rPnt.maTuple); } - bool operator!=( const B3DHomPoint& rPnt ) const - { + bool operator!=( const B3DHomPoint& rPnt ) const + { implTestAndHomogenize(); return (maTuple != rPnt.maTuple); } - - B3DHomPoint& operator=( const B3DHomPoint& rPnt ) - { + + B3DHomPoint& operator=( const B3DHomPoint& rPnt ) + { maTuple = rPnt.maTuple; mfW = rPnt.mfW; - return *this; + return *this; } }; // external operators ////////////////////////////////////////////////////////////////////////// - inline B3DHomPoint minimum(const B3DHomPoint& rVecA, const B3DHomPoint& rVecB) - { + inline B3DHomPoint minimum(const B3DHomPoint& rVecA, const B3DHomPoint& rVecB) + { B3DHomPoint aMin( (rVecB.getX() < rVecA.getX()) ? rVecB.getX() : rVecA.getX(), (rVecB.getY() < rVecA.getY()) ? rVecB.getY() : rVecA.getY(), - (rVecB.getZ() < rVecA.getZ()) ? rVecB.getZ() : rVecA.getZ()); + (rVecB.getZ() < rVecA.getZ()) ? rVecB.getZ() : rVecA.getZ()); return aMin; } - inline B3DHomPoint maximum(const B3DHomPoint& rVecA, const B3DHomPoint& rVecB) - { + inline B3DHomPoint maximum(const B3DHomPoint& rVecA, const B3DHomPoint& rVecB) + { B3DHomPoint aMax( (rVecB.getX() > rVecA.getX()) ? rVecB.getX() : rVecA.getX(), (rVecB.getY() > rVecA.getY()) ? rVecB.getY() : rVecA.getY(), - (rVecB.getZ() > rVecA.getZ()) ? rVecB.getZ() : rVecA.getZ()); + (rVecB.getZ() > rVecA.getZ()) ? rVecB.getZ() : rVecA.getZ()); return aMax; } - inline B3DHomPoint absolute(const B3DHomPoint& rVec) - { + inline B3DHomPoint absolute(const B3DHomPoint& rVec) + { B3DHomPoint aAbs( (0.0 > rVec.getX()) ? -rVec.getX() : rVec.getX(), (0.0 > rVec.getY()) ? -rVec.getY() : rVec.getY(), - (0.0 > rVec.getZ()) ? -rVec.getZ() : rVec.getZ()); + (0.0 > rVec.getZ()) ? -rVec.getZ() : rVec.getZ()); return aAbs; } - inline B3DHomPoint interpolate(B3DHomPoint& rOld1, B3DHomPoint& rOld2, double t) - { + inline B3DHomPoint interpolate(B3DHomPoint& rOld1, B3DHomPoint& rOld2, double t) + { B3DHomPoint aInt( ((rOld2.getX() - rOld1.getX()) * t) + rOld1.getX(), ((rOld2.getY() - rOld1.getY()) * t) + rOld1.getY(), - ((rOld2.getZ() - rOld1.getZ()) * t) + rOld1.getZ()); + ((rOld2.getZ() - rOld1.getZ()) * t) + rOld1.getZ()); return aInt; } - inline B3DHomPoint average(B3DHomPoint& rOld1, B3DHomPoint& rOld2) - { + inline B3DHomPoint average(B3DHomPoint& rOld1, B3DHomPoint& rOld2) + { B3DHomPoint aAvg( (rOld1.getX() + rOld2.getX()) * 0.5, (rOld1.getY() + rOld2.getY()) * 0.5, - (rOld1.getZ() + rOld2.getZ()) * 0.5); + (rOld1.getZ() + rOld2.getZ()) * 0.5); return aAvg; } - + inline B3DHomPoint average(B3DHomPoint& rOld1, B3DHomPoint& rOld2, B3DHomPoint& rOld3) - { + { B3DHomPoint aAvg( (rOld1.getX() + rOld2.getX() + rOld3.getX()) * (1.0 / 3.0), (rOld1.getY() + rOld2.getY() + rOld3.getY()) * (1.0 / 3.0), - (rOld1.getZ() + rOld2.getZ() + rOld3.getZ()) * (1.0 / 3.0)); + (rOld1.getZ() + rOld2.getZ() + rOld3.getZ()) * (1.0 / 3.0)); return aAvg; } inline B3DHomPoint operator+(const B3DHomPoint& rVecA, const B3DHomPoint& rVecB) - { - B3DHomPoint aSum(rVecA); - aSum += rVecB; - return aSum; + { + B3DHomPoint aSum(rVecA); + aSum += rVecB; + return aSum; } inline B3DHomPoint operator-(const B3DHomPoint& rVecA, const B3DHomPoint& rVecB) - { - B3DHomPoint aSub(rVecA); - aSub -= rVecB; - return aSub; + { + B3DHomPoint aSub(rVecA); + aSub -= rVecB; + return aSub; } inline B3DHomPoint operator*(const B3DHomPoint& rVec, double t) - { - B3DHomPoint aNew(rVec); - aNew *= t; - return aNew; + { + B3DHomPoint aNew(rVec); + aNew *= t; + return aNew; } inline B3DHomPoint operator*(double t, const B3DHomPoint& rVec) - { - B3DHomPoint aNew(rVec); - aNew *= t; - return aNew; + { + B3DHomPoint aNew(rVec); + aNew *= t; + return aNew; } inline B3DHomPoint operator/(const B3DHomPoint& rVec, double t) - { - B3DHomPoint aNew(rVec); - aNew /= t; - return aNew; + { + B3DHomPoint aNew(rVec); + aNew /= t; + return aNew; } inline B3DHomPoint operator/(double t, const B3DHomPoint& rVec) { - B3DHomPoint aNew(rVec); - aNew /= t; - return aNew; + B3DHomPoint aNew(rVec); + aNew /= t; + return aNew; } } // end of namespace basegfx diff --git a/basegfx/inc/basegfx/point/b3dpoint.hxx b/basegfx/inc/basegfx/point/b3dpoint.hxx index 96686efaf450..e2120a16bd94 100644 --- a/basegfx/inc/basegfx/point/b3dpoint.hxx +++ b/basegfx/inc/basegfx/point/b3dpoint.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -46,81 +46,81 @@ namespace basegfx */ class B3DPoint : public ::basegfx::B3DTuple { - public: - /** Create a 3D Point + public: + /** Create a 3D Point The point is initialized to (0.0, 0.0, 0.0) */ - B3DPoint() - : B3DTuple() + B3DPoint() + : B3DTuple() {} - /** Create a 3D Point + /** Create a 3D Point @param fX This parameter is used to initialize the X-coordinate of the 3D Point. - + @param fY This parameter is used to initialize the Y-coordinate of the 3D Point. - + @param fZ This parameter is used to initialize the Z-coordinate of the 3D Point. */ - B3DPoint(double fX, double fY, double fZ) - : B3DTuple(fX, fY, fZ) + B3DPoint(double fX, double fY, double fZ) + : B3DTuple(fX, fY, fZ) {} - /** Create a copy of a 3D Point + /** Create a copy of a 3D Point @param rVec The 3D Point which will be copied. */ - B3DPoint(const B3DPoint& rVec) - : B3DTuple(rVec) + B3DPoint(const B3DPoint& rVec) + : B3DTuple(rVec) {} /** constructor with tuple to allow copy-constructing from B3DTuple-based classes */ - B3DPoint(const ::basegfx::B3DTuple& rTuple) - : B3DTuple(rTuple) + B3DPoint(const ::basegfx::B3DTuple& rTuple) + : B3DTuple(rTuple) {} - ~B3DPoint() + ~B3DPoint() {} /** *=operator to allow usage from B3DPoint, too */ - B3DPoint& operator*=( const B3DPoint& rPnt ) - { + B3DPoint& operator*=( const B3DPoint& rPnt ) + { mfX *= rPnt.mfX; - mfY *= rPnt.mfY; - mfZ *= rPnt.mfZ; - return *this; + mfY *= rPnt.mfY; + mfZ *= rPnt.mfZ; + return *this; } /** *=operator to allow usage from B3DPoint, too */ - B3DPoint& operator*=(double t) - { - mfX *= t; - mfY *= t; - mfZ *= t; - return *this; + B3DPoint& operator*=(double t) + { + mfX *= t; + mfY *= t; + mfZ *= t; + return *this; } /** assignment operator to allow assigning the results of B3DTuple calculations */ - B3DPoint& operator=( const ::basegfx::B3DTuple& rVec ) - { + B3DPoint& operator=( const ::basegfx::B3DTuple& rVec ) + { mfX = rVec.getX(); - mfY = rVec.getY(); - mfZ = rVec.getZ(); - return *this; + mfY = rVec.getY(); + mfZ = rVec.getZ(); + return *this; } /** Transform point by given transformation matrix. @@ -140,7 +140,7 @@ namespace basegfx ////////////////////////////////////////////////////////////////////////// /** Transform B3DPoint by given transformation matrix. - + Since this is a Point, translational components of the matrix are used. */ diff --git a/basegfx/inc/basegfx/point/b3ipoint.hxx b/basegfx/inc/basegfx/point/b3ipoint.hxx index 17e63a00040c..ed84ed8c4bb9 100644 --- a/basegfx/inc/basegfx/point/b3ipoint.hxx +++ b/basegfx/inc/basegfx/point/b3ipoint.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -46,81 +46,81 @@ namespace basegfx */ class B3IPoint : public ::basegfx::B3ITuple { - public: - /** Create a 3D Point + public: + /** Create a 3D Point The point is initialized to (0, 0, 0) */ - B3IPoint() - : B3ITuple() + B3IPoint() + : B3ITuple() {} - /** Create a 3D Point + /** Create a 3D Point @param nX This parameter is used to initialize the X-coordinate of the 3D Point. - + @param nY This parameter is used to initialize the Y-coordinate of the 3D Point. - + @param nZ This parameter is used to initialize the Z-coordinate of the 3D Point. */ - B3IPoint(sal_Int32 nX, sal_Int32 nY, sal_Int32 nZ) - : B3ITuple(nX, nY, nZ) + B3IPoint(sal_Int32 nX, sal_Int32 nY, sal_Int32 nZ) + : B3ITuple(nX, nY, nZ) {} - /** Create a copy of a 3D Point + /** Create a copy of a 3D Point @param rVec The 3D Point which will be copied. */ - B3IPoint(const B3IPoint& rVec) - : B3ITuple(rVec) + B3IPoint(const B3IPoint& rVec) + : B3ITuple(rVec) {} /** constructor with tuple to allow copy-constructing from B3ITuple-based classes */ - B3IPoint(const ::basegfx::B3ITuple& rTuple) - : B3ITuple(rTuple) + B3IPoint(const ::basegfx::B3ITuple& rTuple) + : B3ITuple(rTuple) {} - ~B3IPoint() + ~B3IPoint() {} /** *=operator to allow usage from B3IPoint, too */ - B3IPoint& operator*=( const B3IPoint& rPnt ) - { + B3IPoint& operator*=( const B3IPoint& rPnt ) + { mnX *= rPnt.mnX; - mnY *= rPnt.mnY; - mnZ *= rPnt.mnZ; - return *this; + mnY *= rPnt.mnY; + mnZ *= rPnt.mnZ; + return *this; } /** *=operator to allow usage from B3IPoint, too */ - B3IPoint& operator*=(sal_Int32 t) - { - mnX *= t; - mnY *= t; - mnZ *= t; - return *this; + B3IPoint& operator*=(sal_Int32 t) + { + mnX *= t; + mnY *= t; + mnZ *= t; + return *this; } /** assignment operator to allow assigning the results of B3ITuple calculations */ - B3IPoint& operator=( const ::basegfx::B3ITuple& rVec ) - { + B3IPoint& operator=( const ::basegfx::B3ITuple& rVec ) + { mnX = rVec.getX(); - mnY = rVec.getY(); - mnZ = rVec.getZ(); - return *this; + mnY = rVec.getY(); + mnZ = rVec.getZ(); + return *this; } /** Transform point by given transformation matrix. diff --git a/basegfx/inc/basegfx/polygon/b2dlinegeometry.hxx b/basegfx/inc/basegfx/polygon/b2dlinegeometry.hxx index 87e44787c5b6..86fa47201c10 100644 --- a/basegfx/inc/basegfx/polygon/b2dlinegeometry.hxx +++ b/basegfx/inc/basegfx/polygon/b2dlinegeometry.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -43,7 +43,7 @@ namespace basegfx /** Create line start/end geometry element, mostly arrows and things like that. @param rCandidate - The polygon which needs to get that line ends and needs to have two points + The polygon which needs to get that line ends and needs to have two points at least. @param rArrow @@ -57,8 +57,8 @@ namespace basegfx defines the size of the element, it's describing the target width in X of the arrow. - @param fDockingPosition needs to be in [0.0 ..1.0] range, where 0.0 means - that the tip of the arrow will be aligned with the polygon start, 1.0 means + @param fDockingPosition needs to be in [0.0 ..1.0] range, where 0.0 means + that the tip of the arrow will be aligned with the polygon start, 1.0 means the bottom. The default of 0.5 describes a centered arrow. @param pConsumedLength @@ -74,8 +74,8 @@ namespace basegfx The Line start and end polygon, correctly rotated and scaled */ B2DPolyPolygon createAreaGeometryForLineStartEnd( - const B2DPolygon& rCandidate, - const B2DPolyPolygon& rArrow, + const B2DPolygon& rCandidate, + const B2DPolyPolygon& rArrow, bool bStart, double fWidth, double fCandidateLength = 0.0, // 0.0 -> calculate self @@ -85,9 +85,9 @@ namespace basegfx /** create filled polygon geometry for lines with a line width This method will create bezier based, fillable polygons which - will resample the curve if it was extended for the given half - line width. It will remove extrema positions from contained - bezier segments and get as close as possible and defined by + will resample the curve if it was extended for the given half + line width. It will remove extrema positions from contained + bezier segments and get as close as possible and defined by the given parameters to the ideal result. It will check edges for trivial bezier to avoid unnecessary @@ -114,7 +114,7 @@ namespace basegfx @param fMaxPartOfEdge Allows to influence from with relative length of a control vector - compared to it's edge a split is forced. The smaller, the more + compared to it's edge a split is forced. The smaller, the more subdivisions will be needed to create the filled geometry. Allowed range is cropped to [1.0 .. 0.01] @@ -130,10 +130,10 @@ namespace basegfx needed and defined. */ B2DPolyPolygon createAreaGeometry( - const B2DPolygon& rCandidate, - double fHalfLineWidth, - B2DLineJoin eJoin = B2DLINEJOIN_ROUND, - double fMaxAllowedAngle = (12.5 * F_PI180), + const B2DPolygon& rCandidate, + double fHalfLineWidth, + B2DLineJoin eJoin = B2DLINEJOIN_ROUND, + double fMaxAllowedAngle = (12.5 * F_PI180), double fMaxPartOfEdge = 0.4, double fMiterMinimumAngle = (15.0 * F_PI180)); } // end of namespace tools diff --git a/basegfx/inc/basegfx/polygon/b2dpolygon.hxx b/basegfx/inc/basegfx/polygon/b2dpolygon.hxx index 60d6c7a18d70..65b56ad6c4ae 100644 --- a/basegfx/inc/basegfx/polygon/b2dpolygon.hxx +++ b/basegfx/inc/basegfx/polygon/b2dpolygon.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -113,11 +113,11 @@ namespace basegfx B2VectorContinuity getContinuityInPoint(sal_uInt32 nIndex) const; /** check edge for being a bezier segment - - This test the existance of control vectors, but do not apply - testAndSolveTrivialBezier() to the bezier segment, so it is still useful + + This test the existance of control vectors, but do not apply + testAndSolveTrivialBezier() to the bezier segment, so it is still useful to do so. - Since it can use internal data representations, it is faster + Since it can use internal data representations, it is faster than using getBezierSegment() and applying isBezier() on it. @param nIndex @@ -127,14 +127,14 @@ namespace basegfx true if edge exists and at least one control vector is used */ bool isBezierSegment(sal_uInt32 nIndex) const; - + /** bezier segment access - + This method also works when it is no bezier segment at all and will fill the given B2DCubicBezier as needed. In any case, the given B2DCubicBezier will be filled, if necessary with the single start point (if no valid edge exists). - + @param nIndex Index of the addressed edge's start point @@ -181,18 +181,18 @@ namespace basegfx (a) the range of the polygon points (b) the range of the polygon points and control points (c) the outer range of the subdivided bezier curve - - Ranges (a) and (c) are produced by tools::getRange(); resp. this + + Ranges (a) and (c) are produced by tools::getRange(); resp. this getB2DRange(). tools::getRangeWithControlPoints handles case (b). - - To get range (c) a simple solution would be to subdivide the polygon - and use getRange() on it. Since subdivision is expensive and decreases + + To get range (c) a simple solution would be to subdivide the polygon + and use getRange() on it. Since subdivision is expensive and decreases the polygon quality, i added this new method. It will use a methodology suggested by HDU. First, it gets the range (a). Then it iterates over the bezier segments and for each it first tests if the outer range of the bezier segment is already contained in the result range. - + The subdivision itself uses getAllExtremumPositions() to only calculate extremum points and to expand the result accordingly. Thus it calculates maximal four extremum points on the bezier diff --git a/basegfx/inc/basegfx/polygon/b2dpolygonclipper.hxx b/basegfx/inc/basegfx/polygon/b2dpolygonclipper.hxx index 9915ddf4be87..0e26017489cd 100644 --- a/basegfx/inc/basegfx/polygon/b2dpolygonclipper.hxx +++ b/basegfx/inc/basegfx/polygon/b2dpolygonclipper.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/basegfx/inc/basegfx/polygon/b2dpolygoncutandtouch.hxx b/basegfx/inc/basegfx/polygon/b2dpolygoncutandtouch.hxx index 6a6a8ba650e3..7d88ca8f8c78 100644 --- a/basegfx/inc/basegfx/polygon/b2dpolygoncutandtouch.hxx +++ b/basegfx/inc/basegfx/polygon/b2dpolygoncutandtouch.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -66,7 +66,7 @@ namespace basegfx B2DPolygon addPointsAtCuts(const B2DPolygon& rCandidate, const B2DPolyPolygon& rMask); B2DPolyPolygon addPointsAtCuts(const B2DPolyPolygon& rCandidate, const B2DPolyPolygon& rMask); - // look for self-intersections in given polygon and add extra points there. Result will have no + // look for self-intersections in given polygon and add extra points there. Result will have no // intersections on an edge B2DPolygon addPointsAtCuts(const B2DPolygon& rCandidate); diff --git a/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx b/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx index 1ac4fd9d2af5..51157cdde5a1 100644 --- a/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx +++ b/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -52,7 +52,7 @@ namespace basegfx void openWithGeometryChange(B2DPolygon& rCandidate); void closeWithGeometryChange(B2DPolygon& rCandidate); - /** Check if given polygon is closed. + /** Check if given polygon is closed. This is kind of a 'classic' method to support old polygon definitions. Those old polygon definitions define the @@ -89,7 +89,7 @@ namespace basegfx B2DRange getRangeWithControlPoints(const B2DPolygon& rCandidate); /** Get the range of a polygon - + This method creates the outer range of the subdivided bezier curve. For detailed discussion see B2DPolygon::getB2DRange() @@ -125,13 +125,13 @@ namespace basegfx // get a snippet from given polygon for absolute distances. The polygon is assumed // to be opened (not closed). fFrom and fTo need to be in range [0.0 .. fLength], where - // fTo >= fFrom. If length is given, it is assumed the correct polygon length, + // fTo >= fFrom. If length is given, it is assumed the correct polygon length, // if 0.0 it is calculated using getLength(...) B2DPolygon getSnippetAbsolute(const B2DPolygon& rCandidate, double fFrom, double fTo, double fLength = 0.0); // get a snippet from given polygon for relative distances. The polygon is assumed // to be opened (not closed). fFrom and fTo need to be in range [0.0 .. 1.0], where - // fTo >= fFrom. If length is given, it is assumed the correct polygon length, + // fTo >= fFrom. If length is given, it is assumed the correct polygon length, // if 0.0 it is calculated using getLength(...) B2DPolygon getSnippetRelative(const B2DPolygon& rCandidate, double fFrom = 0.0, double fTo = 1.0, double fLength = 0.0); @@ -150,22 +150,22 @@ namespace basegfx // Definitions for the cut flags used from the findCut methods typedef sal_uInt16 CutFlagValue; - #define CUTFLAG_NONE (0x0000) - #define CUTFLAG_LINE (0x0001) - #define CUTFLAG_START1 (0x0002) - #define CUTFLAG_START2 (0x0004) - #define CUTFLAG_END1 (0x0008) - #define CUTFLAG_END2 (0x0010) - #define CUTFLAG_ALL (CUTFLAG_LINE|CUTFLAG_START1|CUTFLAG_START2|CUTFLAG_END1|CUTFLAG_END2) - #define CUTFLAG_DEFAULT (CUTFLAG_LINE|CUTFLAG_START2|CUTFLAG_END2) + #define CUTFLAG_NONE (0x0000) + #define CUTFLAG_LINE (0x0001) + #define CUTFLAG_START1 (0x0002) + #define CUTFLAG_START2 (0x0004) + #define CUTFLAG_END1 (0x0008) + #define CUTFLAG_END2 (0x0010) + #define CUTFLAG_ALL (CUTFLAG_LINE|CUTFLAG_START1|CUTFLAG_START2|CUTFLAG_END1|CUTFLAG_END2) + #define CUTFLAG_DEFAULT (CUTFLAG_LINE|CUTFLAG_START2|CUTFLAG_END2) // Calculate cut between the points given by the two indices. pCut1 // and pCut2 will contain the cut coordinate on each edge in ]0.0, 1.0] // (if given) and the return value will contain a cut description. CutFlagValue findCut( const B2DPolygon& rCandidate, - sal_uInt32 nIndex1, sal_uInt32 nIndex2, - CutFlagValue aCutFlags = CUTFLAG_DEFAULT, + sal_uInt32 nIndex1, sal_uInt32 nIndex2, + CutFlagValue aCutFlags = CUTFLAG_DEFAULT, double* pCut1 = 0L, double* pCut2 = 0L); // This version is working with two indexed edges from different @@ -173,7 +173,7 @@ namespace basegfx CutFlagValue findCut( const B2DPolygon& rCandidate1, sal_uInt32 nIndex1, const B2DPolygon& rCandidate2, sal_uInt32 nIndex2, - CutFlagValue aCutFlags = CUTFLAG_DEFAULT, + CutFlagValue aCutFlags = CUTFLAG_DEFAULT, double* pCut1 = 0L, double* pCut2 = 0L); // This version works with two points and vectors to define the @@ -189,8 +189,8 @@ namespace basegfx // value in pCut (if provided) bool isPointOnEdge( const B2DPoint& rPoint, - const B2DPoint& rEdgeStart, - const B2DVector& rEdgeDelta, + const B2DPoint& rEdgeStart, + const B2DVector& rEdgeDelta, double* pCut = 0L); /** Apply given LineDashing to given polygon @@ -198,8 +198,8 @@ namespace basegfx This method is used to cut down line polygons to the needed pieces when a dashing needs to be applied. It is now capable of keeping contained bezier segments. - It is also capable of delivering line and non-line portions - depending on what target polygons You provide. This is useful + It is also capable of delivering line and non-line portions + depending on what target polygons You provide. This is useful e.g. for dashed lines with two colors. If the last and the first snippet in one of the results have a common start/end ppoint, they will be merged to achieve as @@ -227,8 +227,8 @@ namespace basegfx be calculated internally. */ void applyLineDashing( - const B2DPolygon& rCandidate, - const ::std::vector<double>& rDotDashArray, + const B2DPolygon& rCandidate, + const ::std::vector<double>& rDotDashArray, B2DPolyPolygon* pLineTarget, B2DPolyPolygon* pGapTarget = 0, double fFullDashDotLen = 0.0); @@ -239,9 +239,9 @@ namespace basegfx // 2 x fDistance, and the circle around both points with radius fDistance. bool isInEpsilonRange(const B2DPoint& rEdgeStart, const B2DPoint& rEdgeEnd, const B2DPoint& rTestPosition, double fDistance); - // test if point is inside epsilon-range around the given Polygon. Can be used - // for HitTesting. The epsilon-range is defined to be the rectangle centered - // to the given edge, using height 2 x fDistance, and the circle around both points + // test if point is inside epsilon-range around the given Polygon. Can be used + // for HitTesting. The epsilon-range is defined to be the rectangle centered + // to the given edge, using height 2 x fDistance, and the circle around both points // with radius fDistance. bool isInEpsilonRange(const B2DPolygon& rCandidate, const B2DPoint& rTestPosition, double fDistance); @@ -321,7 +321,7 @@ namespace basegfx /** Create an unit ellipse polygon with the given angles, from start to end */ - B2DPolygon createPolygonFromEllipseSegment( const B2DPoint& rCenter, double fRadiusX, double fRadiusY, double fStart, double fEnd ); + B2DPolygon createPolygonFromEllipseSegment( const B2DPoint& rCenter, double fRadiusX, double fRadiusY, double fStart, double fEnd ); B2DPolygon createPolygonFromUnitEllipseSegment( double fStart, double fEnd ); @@ -405,7 +405,7 @@ namespace basegfx // calculates if given point is on given line, taking care of the numerical epsilon bool isPointOnLine(const B2DPoint& rStart, const B2DPoint& rEnd, const B2DPoint& rCandidate, bool bWithPoints = false); - // calculates if given point is on given polygon, taking care of the numerical epsilon. Uses + // calculates if given point is on given polygon, taking care of the numerical epsilon. Uses // isPointOnLine internally bool isPointOnPolygon(const B2DPolygon& rCandidate, const B2DPoint& rPoint, bool bWithPoints = true); @@ -449,7 +449,7 @@ namespace basegfx preserved. The polygon is subdivided if curve segments are included. That subdivision is the base for the newly created points. - If the source is closed, the indirectly existing last edge may NOT have the + If the source is closed, the indirectly existing last edge may NOT have the given length. If the source is open, all edges will have the given length. You may use the last point of the original when You want to add the last edge Yourself. @@ -462,7 +462,7 @@ namespace basegfx original start point. Negative values are truncated to 0.0. @param fEnd - The maximum distance for the last point. No more points behind this distance will be created. + The maximum distance for the last point. No more points behind this distance will be created. Use 0.0 to proccess the whole polygon. Negative values are truncated to 0.0. It also needs to be more or equal to fStart, else it is truncated to fStart. @@ -471,12 +471,12 @@ namespace basegfx */ B2DPolygon createEdgesOfGivenLength(const B2DPolygon& rCandidate, double fLength, double fStart = 0.0, double fEnd = 0.0); - /** Create Waveline along given polygon + /** Create Waveline along given polygon The implementation is based on createEdgesOfGivenLength and creates a curve segment with the given dimensions for each created line segment. The polygon is treated as if opened (closed state will be ignored) and only for whole edges a curve segment will be created (no rest handling) - + @param rCandidate The polygon along which the waveline will be created @@ -489,7 +489,7 @@ namespace basegfx B2DPolygon createWaveline(const B2DPolygon& rCandidate, double fWaveWidth, double fWaveHeight); /** split each edge of a polygon in exactly nSubEdges equidistant edges - + @param rCandidate The source polygon. If too small (no edges), nSubEdges too small (<2) or neither bHandleCurvedEdgesnor bHandleStraightEdges it will just be returned. @@ -497,12 +497,12 @@ namespace basegfx @param nSubEdges How many edges shall be created as replacement for each single edge - + @param bHandleCurvedEdges Process curved edges or not. If to handle the curved edges will be splitted into nSubEdges part curved edges of equidistant bezier distances. If not, curved edges will just be copied. - + @param bHandleStraightEdges Process straight edges or not. If to handle the straight edges will be splitted into nSubEdges part curved edges of equidistant length. If not, @@ -518,7 +518,7 @@ namespace basegfx /** snap some polygon coordinates to discrete coordinates This method allows to snap some polygon points to discrete (integer) values - which equals e.g. a snap to discrete coordinates. It will snap points of + which equals e.g. a snap to discrete coordinates. It will snap points of horizontal and vertical edges @param rCandidate diff --git a/basegfx/inc/basegfx/polygon/b2dpolygontriangulator.hxx b/basegfx/inc/basegfx/polygon/b2dpolygontriangulator.hxx index 05bd230031a0..f05e2eadcc3a 100644 --- a/basegfx/inc/basegfx/polygon/b2dpolygontriangulator.hxx +++ b/basegfx/inc/basegfx/polygon/b2dpolygontriangulator.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/basegfx/inc/basegfx/polygon/b2dpolypolygon.hxx b/basegfx/inc/basegfx/polygon/b2dpolypolygon.hxx index 80664d065dc6..7fe739a4f7fc 100644 --- a/basegfx/inc/basegfx/polygon/b2dpolypolygon.hxx +++ b/basegfx/inc/basegfx/polygon/b2dpolypolygon.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -37,8 +37,8 @@ class ImplB2DPolyPolygon; namespace basegfx -{ - class B2DPolygon; +{ + class B2DPolygon; class B2DHomMatrix; } // end of namespace basegfx @@ -54,7 +54,7 @@ namespace basegfx private: ImplType mpPolyPolygon; - public: + public: B2DPolyPolygon(); B2DPolyPolygon(const B2DPolyPolygon& rPolyPolygon); explicit B2DPolyPolygon(const B2DPolygon& rPolygon); diff --git a/basegfx/inc/basegfx/polygon/b2dpolypolygoncutter.hxx b/basegfx/inc/basegfx/polygon/b2dpolypolygoncutter.hxx index 3f00b3093f06..09519396846c 100644 --- a/basegfx/inc/basegfx/polygon/b2dpolypolygoncutter.hxx +++ b/basegfx/inc/basegfx/polygon/b2dpolypolygoncutter.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -63,7 +63,7 @@ namespace basegfx // it's depth is increased when inside a polygon, decreased when inside a hole. The result is a depth // which e.g. is -1 for holes outside everything, 1 for a polygon covered by another polygon and zero // for e.g. holes in a polygon or polygons outside everythig else. - // In the 2nd step, all polygons with depth other than zero are removed. If bKeepAboveZero is used, + // In the 2nd step, all polygons with depth other than zero are removed. If bKeepAboveZero is used, // all polygons < 1 are removed. The bKeepAboveZero mode is useful for clipping, e.g. just append // one polygon to another and use this mode -> only parts where two polygons overlapped will be kept. // In combination with correct orientation of the input orientations and the SolveCrossover calls this diff --git a/basegfx/inc/basegfx/polygon/b2dpolypolygonfillrule.hxx b/basegfx/inc/basegfx/polygon/b2dpolypolygonfillrule.hxx index 2517a9c423e9..01b4af602756 100644 --- a/basegfx/inc/basegfx/polygon/b2dpolypolygonfillrule.hxx +++ b/basegfx/inc/basegfx/polygon/b2dpolypolygonfillrule.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/basegfx/inc/basegfx/polygon/b2dpolypolygonrasterconverter.hxx b/basegfx/inc/basegfx/polygon/b2dpolypolygonrasterconverter.hxx index 1f56a14c1842..e43a9a57c5bb 100644 --- a/basegfx/inc/basegfx/polygon/b2dpolypolygonrasterconverter.hxx +++ b/basegfx/inc/basegfx/polygon/b2dpolypolygonrasterconverter.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -46,7 +46,7 @@ namespace basegfx derive from this, and override the span() method, which will get called for every scanline span of the poly-polygon. - @derive + @derive Overwrite span() with the render output method of your choice. */ class B2DPolyPolygonRasterConverter @@ -74,7 +74,7 @@ namespace basegfx area might also be larger. */ B2DPolyPolygonRasterConverter(const B2DPolyPolygon& rPolyPolyRaster, - const B2DRectangle& rRasterArea ); + const B2DRectangle& rRasterArea ); virtual ~B2DPolyPolygonRasterConverter(); @@ -90,7 +90,7 @@ namespace basegfx @param rfXLeft The left end of the current horizontal span - + @param rfXRight The right end of the current horizontal span @@ -103,8 +103,8 @@ namespace basegfx */ virtual void span(const double& rfXLeft, const double& rfXRight, - sal_Int32 nY, - bool bOn ) = 0; + sal_Int32 nY, + bool bOn ) = 0; /// @internal struct Vertex @@ -112,9 +112,9 @@ namespace basegfx inline Vertex(); inline Vertex( const B2DPoint&, const B2DPoint&, bool ); - B2DPoint aP1; - B2DPoint aP2; - bool bDownwards; + B2DPoint aP1; + B2DPoint aP2; + bool bDownwards; }; private: @@ -124,18 +124,18 @@ namespace basegfx void init(); - typedef ::std::vector<Vertex> VectorOfVertices; - typedef ::std::vector<VectorOfVertices> VectorOfVertexVectors; + typedef ::std::vector<Vertex> VectorOfVertices; + typedef ::std::vector<VectorOfVertices> VectorOfVertexVectors; /// The poly-polygon to raster-convert - B2DPolyPolygon maPolyPolygon; + B2DPolyPolygon maPolyPolygon; /// Total bound rect of the poly-polygon - const B2DRectangle maPolyPolyRectangle; + const B2DRectangle maPolyPolyRectangle; /** Vector containing for each scanline a vector which in turn contains all vertices that start on the specific scanline */ - VectorOfVertexVectors maScanlines; + VectorOfVertexVectors maScanlines; }; } diff --git a/basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx b/basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx index 8b025bcff99e..f8ccf09a5745 100644 --- a/basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx +++ b/basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -73,7 +73,7 @@ namespace basegfx // is created. B2DPolyPolygon adaptiveSubdivideByCount(const B2DPolyPolygon& rCandidate, sal_uInt32 nCount = 0L); - // isInside test for B2dPoint. On border is not inside as long as not true is given + // isInside test for B2dPoint. On border is not inside as long as not true is given // in bWithBorder flag. It is assumed that the orientations of the given polygon are correct. bool isInside(const B2DPolyPolygon& rCandidate, const B2DPoint& rPoint, bool bWithBorder = false); @@ -102,19 +102,19 @@ namespace basegfx The outer range of the polygon */ B2DRange getRange(const B2DPolyPolygon& rCandidate); - + /** Apply given LineDashing to given polyPolygon For a description see applyLineDashing in b2dpolygontoos.hxx */ void applyLineDashing( - const B2DPolyPolygon& rCandidate, - const ::std::vector<double>& rDotDashArray, + const B2DPolyPolygon& rCandidate, + const ::std::vector<double>& rDotDashArray, B2DPolyPolygon* pLineTarget, B2DPolyPolygon* pGapTarget = 0, double fFullDashDotLen = 0.0); - // test if point is inside epsilon-range around the given PolyPolygon. Can be used + // test if point is inside epsilon-range around the given PolyPolygon. Can be used // for HitTesting. The epsilon-range is defined to be the tube around the PolyPolygon // with distance fDistance and rounded edges (start and end point). bool isInEpsilonRange(const B2DPolyPolygon& rCandidate, const B2DPoint& rTestPosition, double fDistance); @@ -180,7 +180,7 @@ namespace basegfx B2DPolyPolygon createB2DPolyPolygonFromB3DPolyPolygon(const B3DPolyPolygon& rCandidate, const B3DHomMatrix& rMat); // for each contained edge in each contained polygon calculate the smallest distance. Return the index to the smallest - // edge in rEdgeIndex and the index to the polygon in rPolygonIndex. The relative position on the edge is returned in rCut. + // edge in rEdgeIndex and the index to the polygon in rPolygonIndex. The relative position on the edge is returned in rCut. // If nothing was found (e.g. empty input plygon), DBL_MAX is returned. double getSmallestDistancePointToPolyPolygon(const B2DPolyPolygon& rCandidate, const B2DPoint& rTestPoint, sal_uInt32& rPolygonIndex, sal_uInt32& rEdgeIndex, double& rCut); @@ -219,7 +219,7 @@ namespace basegfx @param rPolyPoly The poly-polygon to export - + @param bUseRelativeCoordinates When true, all coordinate values are exported as relative to the current position. This tends to save some space, @@ -235,14 +235,14 @@ namespace basegfx value alone, without any "<path ...>" or "d="...") */ ::rtl::OUString exportToSvgD( const B2DPolyPolygon& rPolyPoly, - bool bUseRelativeCoordinates=true, - bool bDetectQuadraticBeziers=true ); + bool bUseRelativeCoordinates=true, + bool bDetectQuadraticBeziers=true ); // #i76891# Try to remove existing curve segments if they are simply edges B2DPolyPolygon simplifyCurveSegments(const B2DPolyPolygon& rCandidate); /** split each edge of a polyPolygon in exactly nSubEdges equidistant edges - + @param rCandidate The source polyPolygon. If too small (no edges), nSubEdges too small (<2) or neither bHandleCurvedEdgesnor bHandleStraightEdges it will just be returned. @@ -263,7 +263,7 @@ namespace basegfx /** snap some polygon coordinates to discrete coordinates This method allows to snap some polygon points to discrete (integer) values - which equals e.g. a snap to discrete coordinates. It will snap points of + which equals e.g. a snap to discrete coordinates. It will snap points of horizontal and vertical edges @param rCandidate diff --git a/basegfx/inc/basegfx/polygon/b2dtrapezoid.hxx b/basegfx/inc/basegfx/polygon/b2dtrapezoid.hxx index 77c6e40c4742..cd0f8fbf6a87 100644 --- a/basegfx/inc/basegfx/polygon/b2dtrapezoid.hxx +++ b/basegfx/inc/basegfx/polygon/b2dtrapezoid.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -51,12 +51,12 @@ namespace basegfx // - mfBottomY >= mfTopY // - mfTopXRight >= mfTopXLeft // - mfBottomXRight >= mfBottomXLeft - double mfTopXLeft; - double mfTopXRight; - double mfTopY; - double mfBottomXLeft; - double mfBottomXRight; - double mfBottomY; + double mfTopXLeft; + double mfTopXRight; + double mfTopY; + double mfBottomXLeft; + double mfBottomXRight; + double mfBottomY; public: // constructor @@ -98,22 +98,22 @@ namespace basegfx // for primitive decompositions. To use it, the shear and rotate parts of the // involved transformations HAVE to be taken into account. void trapezoidSubdivide( - B2DTrapezoidVector& ro_Result, + B2DTrapezoidVector& ro_Result, const B2DPolyPolygon& rSourcePolyPolygon); // directly create trapezoids from given edge. Depending on the given geometry, // none up to three trapezoids will be created void createLineTrapezoidFromEdge( - B2DTrapezoidVector& ro_Result, - const B2DPoint& rPointA, - const B2DPoint& rPointB, + B2DTrapezoidVector& ro_Result, + const B2DPoint& rPointA, + const B2DPoint& rPointB, double fLineWidth = 1.0); // create trapezoids for all edges of the given polygon. The closed state of // the polygon is taken into account. If curves are contaned, the default // AdaptiveSubdivision will be used. void createLineTrapezoidFromB2DPolygon( - B2DTrapezoidVector& ro_Result, + B2DTrapezoidVector& ro_Result, const B2DPolygon& rPolygon, double fLineWidth = 1.0); @@ -121,7 +121,7 @@ namespace basegfx // the PolyPolygon is taken into account. If curves are contaned, the default // AdaptiveSubdivision will be used. void createLineTrapezoidFromB2DPolyPolygon( - B2DTrapezoidVector& ro_Result, + B2DTrapezoidVector& ro_Result, const B2DPolyPolygon& rPolyPolygon, double fLineWidth = 1.0); diff --git a/basegfx/inc/basegfx/polygon/b3dpolygon.hxx b/basegfx/inc/basegfx/polygon/b3dpolygon.hxx index 5f1613845915..d6fc01f959a2 100644 --- a/basegfx/inc/basegfx/polygon/b3dpolygon.hxx +++ b/basegfx/inc/basegfx/polygon/b3dpolygon.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/basegfx/inc/basegfx/polygon/b3dpolygonclipper.hxx b/basegfx/inc/basegfx/polygon/b3dpolygonclipper.hxx index 3166c39012c1..3b6934da1a92 100644 --- a/basegfx/inc/basegfx/polygon/b3dpolygonclipper.hxx +++ b/basegfx/inc/basegfx/polygon/b3dpolygonclipper.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -42,13 +42,13 @@ namespace basegfx namespace tools { - /** define for deciding one of X,Y,Z directions + /** define for deciding one of X,Y,Z directions */ enum B3DOrientation { - B3DORIENTATION_X, // X-Axis - B3DORIENTATION_Y, // Y-Axis - B3DORIENTATION_Z // Z-Axis + B3DORIENTATION_X, // X-Axis + B3DORIENTATION_Y, // Y-Axis + B3DORIENTATION_Z // Z-Axis }; // Clip given 3D polygon against a plane orthogonal to X,Y or Z axis. The plane is defined using the diff --git a/basegfx/inc/basegfx/polygon/b3dpolygontools.hxx b/basegfx/inc/basegfx/polygon/b3dpolygontools.hxx index 00caf76823e1..89982d777f90 100644 --- a/basegfx/inc/basegfx/polygon/b3dpolygontools.hxx +++ b/basegfx/inc/basegfx/polygon/b3dpolygontools.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -47,7 +47,7 @@ namespace basegfx { // B3DPolygon tools - /** Check if given polygon is closed. This is kind of a + /** Check if given polygon is closed. This is kind of a 'classic' method to support old polygon definitions. Those old polygon definitions define the closed state of the polygon using identical start and endpoints. This @@ -106,15 +106,15 @@ namespace basegfx For a description see applyLineDashing in b2dpolygontoos.hxx */ void applyLineDashing( - const B3DPolygon& rCandidate, - const ::std::vector<double>& rDotDashArray, + const B3DPolygon& rCandidate, + const ::std::vector<double>& rDotDashArray, B3DPolyPolygon* pLineTarget, B3DPolyPolygon* pGapTarget = 0, double fFullDashDotLen = 0.0); /** Create/replace normals for given 3d geometry with default normals from given center to outside. - rCandidate: the 3d geometry to change - rCenter: the center of the 3d geometry + rCandidate: the 3d geometry to change + rCenter: the center of the 3d geometry */ B3DPolygon applyDefaultNormalsSphere( const B3DPolygon& rCandidate, const B3DPoint& rCenter); @@ -142,8 +142,8 @@ namespace basegfx // fDistance, and the sphere around both points with radius fDistance. bool isInEpsilonRange(const B3DPoint& rEdgeStart, const B3DPoint& rEdgeEnd, const B3DPoint& rTestPosition, double fDistance); - // test if point is inside epsilon-range around the given Polygon. Can be used - // for HitTesting. The epsilon-range is defined to be the cylinder centered to + // test if point is inside epsilon-range around the given Polygon. Can be used + // for HitTesting. The epsilon-range is defined to be the cylinder centered to // the given edge, using radius fDistance, and the sphere around both points with radius fDistance. bool isInEpsilonRange(const B3DPolygon& rCandidate, const B3DPoint& rTestPosition, double fDistance); @@ -155,7 +155,7 @@ namespace basegfx // calculates if given point is on given line, taking care of the numerical epsilon bool isPointOnLine(const B3DPoint& rStart, const B3DPoint& rEnd, const B3DPoint& rCandidate, bool bWithPoints = false); - // calculates if given point is on given polygon, taking care of the numerical epsilon. Uses + // calculates if given point is on given polygon, taking care of the numerical epsilon. Uses // isPointOnLine internally bool isPointOnPolygon(const B3DPolygon& rCandidate, const B3DPoint& rPoint, bool bWithPoints = true); @@ -175,7 +175,7 @@ namespace basegfx /** snap some polygon coordinates to discrete coordinates This method allows to snap some polygon points to discrete (integer) values - which equals e.g. a snap to discrete coordinates. It will snap points of + which equals e.g. a snap to discrete coordinates. It will snap points of horizontal and vertical edges @param rCandidate diff --git a/basegfx/inc/basegfx/polygon/b3dpolypolygon.hxx b/basegfx/inc/basegfx/polygon/b3dpolypolygon.hxx index 472b39bab267..697edfe93084 100644 --- a/basegfx/inc/basegfx/polygon/b3dpolypolygon.hxx +++ b/basegfx/inc/basegfx/polygon/b3dpolypolygon.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -36,8 +36,8 @@ class ImplB3DPolyPolygon; namespace basegfx -{ - class B3DPolygon; +{ + class B3DPolygon; class B3DHomMatrix; class B2DHomMatrix; } // end of namespace basegfx @@ -54,7 +54,7 @@ namespace basegfx private: ImplType mpPolyPolygon; - public: + public: B3DPolyPolygon(); B3DPolyPolygon(const B3DPolyPolygon& rPolyPolygon); explicit B3DPolyPolygon(const B3DPolygon& rPolygon); diff --git a/basegfx/inc/basegfx/polygon/b3dpolypolygontools.hxx b/basegfx/inc/basegfx/polygon/b3dpolypolygontools.hxx index 10083f57dd60..1be2e31f38fc 100644 --- a/basegfx/inc/basegfx/polygon/b3dpolypolygontools.hxx +++ b/basegfx/inc/basegfx/polygon/b3dpolypolygontools.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -55,8 +55,8 @@ namespace basegfx For a description see applyLineDashing in b2dpolygontoos.hxx */ void applyLineDashing( - const B3DPolyPolygon& rCandidate, - const ::std::vector<double>& rDotDashArray, + const B3DPolyPolygon& rCandidate, + const ::std::vector<double>& rDotDashArray, B3DPolyPolygon* pLineTarget, B3DPolyPolygon* pGapTarget = 0, double fFullDashDotLen = 0.0); @@ -91,8 +91,8 @@ namespace basegfx If nHorSeg == 0 and/or nVerSeg == 0, a default will be calculated to have a step at least each 15 degrees. With VerStart, VerStop and hor range in cartesian may be specified to create a partial sphere only. */ - B3DPolyPolygon createSpherePolyPolygonFromB3DRange( - const B3DRange& rRange, + B3DPolyPolygon createSpherePolyPolygonFromB3DRange( + const B3DRange& rRange, sal_uInt32 nHorSeg = 0L, sal_uInt32 nVerSeg = 0L, double fVerStart = F_PI2, double fVerStop = -F_PI2, double fHorStart = 0.0, double fHorStop = F_2PI); @@ -109,16 +109,16 @@ namespace basegfx /** same as createSpherePolyPolygonFromB3DRange, but creates filled polygons (closed and oriented) There is one extra, the bool bNormals defines if normals will be set, default is false */ - B3DPolyPolygon createSphereFillPolyPolygonFromB3DRange( - const B3DRange& rRange, + B3DPolyPolygon createSphereFillPolyPolygonFromB3DRange( + const B3DRange& rRange, sal_uInt32 nHorSeg = 0L, sal_uInt32 nVerSeg = 0L, bool bNormals = false, double fVerStart = F_PI2, double fVerStop = -F_PI2, double fHorStart = 0.0, double fHorStop = F_2PI); /** Create/replace normals for given 3d geometry with default normals from given center to outside. - rCandidate: the 3d geometry to change - rCenter: the center of the 3d geometry + rCandidate: the 3d geometry to change + rCenter: the center of the 3d geometry */ B3DPolyPolygon applyDefaultNormalsSphere( const B3DPolyPolygon& rCandidate, const B3DPoint& rCenter); @@ -140,7 +140,7 @@ namespace basegfx */ B3DPolyPolygon applyDefaultTextureCoordinatesSphere( const B3DPolyPolygon& rCandidate, const B3DPoint& rCenter, bool bChangeX = true, bool bChangeY = true); - // isInside test for B3DPoint. On border is not inside as long as not true is given + // isInside test for B3DPoint. On border is not inside as long as not true is given // in bWithBorder flag. It is assumed that the orientations of the given polygon are correct. bool isInside(const B3DPolyPolygon& rCandidate, const B3DPoint& rPoint, bool bWithBorder = false); diff --git a/basegfx/inc/basegfx/range/b1drange.hxx b/basegfx/inc/basegfx/range/b1drange.hxx index feb48d336e9a..a6cacec6d718 100644 --- a/basegfx/inc/basegfx/range/b1drange.hxx +++ b/basegfx/inc/basegfx/range/b1drange.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -38,55 +38,55 @@ namespace basegfx class B1DRange { - ::basegfx::BasicRange< double, DoubleTraits > maRange; + ::basegfx::BasicRange< double, DoubleTraits > maRange; - public: - B1DRange() + public: + B1DRange() { } - - explicit B1DRange(double fStartValue) - : maRange(fStartValue) + + explicit B1DRange(double fStartValue) + : maRange(fStartValue) { } - - B1DRange(double fStartValue1, double fStartValue2) - : maRange(fStartValue1) + + B1DRange(double fStartValue1, double fStartValue2) + : maRange(fStartValue1) { expand(fStartValue2); } - + B1DRange(const B1DRange& rRange) - : maRange(rRange.maRange) + : maRange(rRange.maRange) { } explicit B1DRange( const B1IRange& rRange ); - bool isEmpty() const + bool isEmpty() const { return maRange.isEmpty(); } - void reset() - { - maRange.reset(); + void reset() + { + maRange.reset(); } - - bool operator==( const B1DRange& rRange ) const - { - return (maRange == rRange.maRange); + + bool operator==( const B1DRange& rRange ) const + { + return (maRange == rRange.maRange); } - bool operator!=( const B1DRange& rRange ) const - { - return (maRange != rRange.maRange); + bool operator!=( const B1DRange& rRange ) const + { + return (maRange != rRange.maRange); } - B1DRange& operator=(const B1DRange& rRange) - { - maRange = rRange.maRange; - return *this; + B1DRange& operator=(const B1DRange& rRange) + { + maRange = rRange.maRange; + return *this; } bool equal(const B1DRange& rRange) const @@ -94,64 +94,64 @@ namespace basegfx return (maRange.equal(rRange.maRange)); } - double getMinimum() const - { - return maRange.getMinimum(); + double getMinimum() const + { + return maRange.getMinimum(); } - double getMaximum() const - { - return maRange.getMaximum(); + double getMaximum() const + { + return maRange.getMaximum(); } - double getRange() const - { - return maRange.getRange(); + double getRange() const + { + return maRange.getRange(); } - + double getCenter() const { - return maRange.getCenter(); + return maRange.getCenter(); } - bool isInside(double fValue) const - { - return maRange.isInside(fValue); + bool isInside(double fValue) const + { + return maRange.isInside(fValue); } - - bool isInside(const B1DRange& rRange) const - { - return maRange.isInside(rRange.maRange); + + bool isInside(const B1DRange& rRange) const + { + return maRange.isInside(rRange.maRange); } - bool overlaps(const B1DRange& rRange) const - { - return maRange.overlaps(rRange.maRange); + bool overlaps(const B1DRange& rRange) const + { + return maRange.overlaps(rRange.maRange); } - bool overlapsMore(const B1DRange& rRange) const - { - return maRange.overlapsMore(rRange.maRange); + bool overlapsMore(const B1DRange& rRange) const + { + return maRange.overlapsMore(rRange.maRange); } - void expand(double fValue) - { - maRange.expand(fValue); + void expand(double fValue) + { + maRange.expand(fValue); } - void expand(const B1DRange& rRange) - { - maRange.expand(rRange.maRange); + void expand(const B1DRange& rRange) + { + maRange.expand(rRange.maRange); } - void intersect(const B1DRange& rRange) - { - maRange.intersect(rRange.maRange); + void intersect(const B1DRange& rRange) + { + maRange.intersect(rRange.maRange); } void grow(double fValue) { - maRange.grow(fValue); + maRange.grow(fValue); } }; diff --git a/basegfx/inc/basegfx/range/b1ibox.hxx b/basegfx/inc/basegfx/range/b1ibox.hxx index d2ef68b86e7a..2001ec964a32 100644 --- a/basegfx/inc/basegfx/range/b1ibox.hxx +++ b/basegfx/inc/basegfx/range/b1ibox.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -36,107 +36,107 @@ namespace basegfx { class B1IBox { - ::basegfx::BasicBox maRange; + ::basegfx::BasicBox maRange; - public: - B1IBox() + public: + B1IBox() { } - - explicit B1IBox(sal_Int32 nStartValue) - : maRange(nStartValue) + + explicit B1IBox(sal_Int32 nStartValue) + : maRange(nStartValue) { } - - B1IBox(sal_Int32 nStartValue1, sal_Int32 nStartValue2) - : maRange(nStartValue1) + + B1IBox(sal_Int32 nStartValue1, sal_Int32 nStartValue2) + : maRange(nStartValue1) { expand(nStartValue2); } B1IBox(const B1IBox& rBox) - : maRange(rBox.maRange) + : maRange(rBox.maRange) { } - bool isEmpty() const + bool isEmpty() const { return maRange.isEmpty(); } - void reset() - { - maRange.reset(); + void reset() + { + maRange.reset(); } - - bool operator==( const B1IBox& rBox ) const - { - return (maRange == rBox.maRange); + + bool operator==( const B1IBox& rBox ) const + { + return (maRange == rBox.maRange); } - bool operator!=( const B1IBox& rBox ) const - { - return (maRange != rBox.maRange); + bool operator!=( const B1IBox& rBox ) const + { + return (maRange != rBox.maRange); } - void operator=(const B1IBox& rBox) - { - maRange = rBox.maRange; + void operator=(const B1IBox& rBox) + { + maRange = rBox.maRange; } - sal_Int32 getMinimum() const - { - return maRange.getMinimum(); + sal_Int32 getMinimum() const + { + return maRange.getMinimum(); } - sal_Int32 getMaximum() const - { - return maRange.getMaximum(); + sal_Int32 getMaximum() const + { + return maRange.getMaximum(); } - Int32Traits::DifferenceType getRange() const - { - return maRange.getRange(); + Int32Traits::DifferenceType getRange() const + { + return maRange.getRange(); } - + double getCenter() const { - return maRange.getCenter(); + return maRange.getCenter(); } - bool isInside(sal_Int32 nValue) const - { - return maRange.isInside(nValue); + bool isInside(sal_Int32 nValue) const + { + return maRange.isInside(nValue); } - - bool isInside(const B1IBox& rBox) const - { - return maRange.isInside(rBox.maRange); + + bool isInside(const B1IBox& rBox) const + { + return maRange.isInside(rBox.maRange); } - bool overlaps(const B1IBox& rBox) const - { - return maRange.overlaps(rBox.maRange); + bool overlaps(const B1IBox& rBox) const + { + return maRange.overlaps(rBox.maRange); } - void expand(sal_Int32 nValue) - { - maRange.expand(nValue); + void expand(sal_Int32 nValue) + { + maRange.expand(nValue); } - void expand(const B1IBox& rBox) - { - maRange.expand(rBox.maRange); + void expand(const B1IBox& rBox) + { + maRange.expand(rBox.maRange); } - void intersect(const B1IBox& rBox) - { - maRange.intersect(rBox.maRange); + void intersect(const B1IBox& rBox) + { + maRange.intersect(rBox.maRange); } void grow(sal_Int32 nValue) { - maRange.grow(nValue); + maRange.grow(nValue); } }; } // end of namespace basegfx diff --git a/basegfx/inc/basegfx/range/b1irange.hxx b/basegfx/inc/basegfx/range/b1irange.hxx index a503133f4b0f..9c77d23b8204 100644 --- a/basegfx/inc/basegfx/range/b1irange.hxx +++ b/basegfx/inc/basegfx/range/b1irange.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -36,108 +36,108 @@ namespace basegfx { class B1IRange { - ::basegfx::BasicRange< sal_Int32, Int32Traits > maRange; + ::basegfx::BasicRange< sal_Int32, Int32Traits > maRange; - public: - B1IRange() + public: + B1IRange() { } - - explicit B1IRange(sal_Int32 nStartValue) - : maRange(nStartValue) + + explicit B1IRange(sal_Int32 nStartValue) + : maRange(nStartValue) { } - - B1IRange(sal_Int32 nStartValue1, sal_Int32 nStartValue2) - : maRange(nStartValue1) + + B1IRange(sal_Int32 nStartValue1, sal_Int32 nStartValue2) + : maRange(nStartValue1) { expand(nStartValue2); } B1IRange(const B1IRange& rRange) - : maRange(rRange.maRange) + : maRange(rRange.maRange) { } - bool isEmpty() const + bool isEmpty() const { return maRange.isEmpty(); } - void reset() - { - maRange.reset(); + void reset() + { + maRange.reset(); } - - bool operator==( const B1IRange& rRange ) const - { - return (maRange == rRange.maRange); + + bool operator==( const B1IRange& rRange ) const + { + return (maRange == rRange.maRange); } - bool operator!=( const B1IRange& rRange ) const - { - return (maRange != rRange.maRange); + bool operator!=( const B1IRange& rRange ) const + { + return (maRange != rRange.maRange); } - B1IRange& operator=(const B1IRange& rRange) - { - maRange = rRange.maRange; - return *this; + B1IRange& operator=(const B1IRange& rRange) + { + maRange = rRange.maRange; + return *this; } - sal_Int32 getMinimum() const - { - return maRange.getMinimum(); + sal_Int32 getMinimum() const + { + return maRange.getMinimum(); } - sal_Int32 getMaximum() const - { - return maRange.getMaximum(); + sal_Int32 getMaximum() const + { + return maRange.getMaximum(); } - Int32Traits::DifferenceType getRange() const - { - return maRange.getRange(); + Int32Traits::DifferenceType getRange() const + { + return maRange.getRange(); } - + double getCenter() const { - return maRange.getCenter(); + return maRange.getCenter(); } - bool isInside(sal_Int32 nValue) const - { - return maRange.isInside(nValue); + bool isInside(sal_Int32 nValue) const + { + return maRange.isInside(nValue); } - - bool isInside(const B1IRange& rRange) const - { - return maRange.isInside(rRange.maRange); + + bool isInside(const B1IRange& rRange) const + { + return maRange.isInside(rRange.maRange); } - bool overlaps(const B1IRange& rRange) const - { - return maRange.overlaps(rRange.maRange); + bool overlaps(const B1IRange& rRange) const + { + return maRange.overlaps(rRange.maRange); } - void expand(sal_Int32 nValue) - { - maRange.expand(nValue); + void expand(sal_Int32 nValue) + { + maRange.expand(nValue); } - void expand(const B1IRange& rRange) - { - maRange.expand(rRange.maRange); + void expand(const B1IRange& rRange) + { + maRange.expand(rRange.maRange); } - void intersect(const B1IRange& rRange) - { - maRange.intersect(rRange.maRange); + void intersect(const B1IRange& rRange) + { + maRange.intersect(rRange.maRange); } void grow(sal_Int32 nValue) { - maRange.grow(nValue); + maRange.grow(nValue); } }; } // end of namespace basegfx diff --git a/basegfx/inc/basegfx/range/b2dconnectedranges.hxx b/basegfx/inc/basegfx/range/b2dconnectedranges.hxx index 6949918fa2ef..27fbcb06b527 100644 --- a/basegfx/inc/basegfx/range/b2dconnectedranges.hxx +++ b/basegfx/inc/basegfx/range/b2dconnectedranges.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -73,16 +73,16 @@ namespace basegfx public: /// Type of the basic entity (rect + user data) typedef ::std::pair< B2DRange, UserData > ComponentType; - typedef ::std::list< ComponentType > ComponentListType; + typedef ::std::list< ComponentType > ComponentListType; /// List of (intersecting) components, plus overall bounds struct ConnectedComponents { - ComponentListType maComponentList; - B2DRange maTotalBounds; + ComponentListType maComponentList; + B2DRange maTotalBounds; }; - typedef ::std::list< ConnectedComponents > ConnectedComponentsType; + typedef ::std::list< ConnectedComponents > ConnectedComponentsType; /// Create the range calculator @@ -109,15 +109,15 @@ namespace basegfx ranges (typically, for well-behaved input, it is O(n) though). */ - void addRange( const B2DRange& rRange, - const UserData& rUserData ) + void addRange( const B2DRange& rRange, + const UserData& rUserData ) { // check whether fast path is possible: if new range is // outside accumulated total range, can add it as a // separate component right away. - const bool bNotOutsideEverything( + const bool bNotOutsideEverything( maTotalBounds.overlaps( rRange ) ); - + // update own global bounds range maTotalBounds.expand( rRange ); @@ -172,7 +172,7 @@ namespace basegfx // no position and size. if( !aCurrAggregate->maTotalBounds.isEmpty() && - aCurrAggregate->maTotalBounds.overlaps( + aCurrAggregate->maTotalBounds.overlaps( aNewConnectedComponent.maTotalBounds ) ) { // union the intersecting @@ -181,13 +181,13 @@ namespace basegfx // calc union bounding box aNewConnectedComponent.maTotalBounds.expand( aCurrAggregate->maTotalBounds ); - + // extract all aCurrAggregate components // to aNewConnectedComponent - aNewConnectedComponent.maComponentList.splice( - aNewConnectedComponent.maComponentList.end(), + aNewConnectedComponent.maComponentList.splice( + aNewConnectedComponent.maComponentList.end(), aCurrAggregate->maComponentList ); - + // remove and delete aCurrAggregate entry // from list (we've gutted it's content // above). list::erase() will update our @@ -212,17 +212,17 @@ namespace basegfx // // add new component to the end of the component list - aNewConnectedComponent.maComponentList.push_back( + aNewConnectedComponent.maComponentList.push_back( ComponentType( rRange, rUserData ) ); - + // do some consistency checks (aka post conditions) OSL_ENSURE( !aNewConnectedComponent.maComponentList.empty(), "B2DConnectedRanges::addRange(): empty aggregate list" ); - OSL_ENSURE( !aNewConnectedComponent.maTotalBounds.isEmpty() || - (aNewConnectedComponent.maTotalBounds.isEmpty() && + OSL_ENSURE( !aNewConnectedComponent.maTotalBounds.isEmpty() || + (aNewConnectedComponent.maTotalBounds.isEmpty() && aNewConnectedComponent.maComponentList.size() == 1), "B2DConnectedRanges::addRange(): empty ranges must be solitary"); - + // add aNewConnectedComponent as a new entry to // maDisjunctAggregatesList maDisjunctAggregatesList.push_back( aNewConnectedComponent ); @@ -242,7 +242,7 @@ namespace basegfx maDisjunctAggregatesList.end(), aFunctor ); } - + private: // default: disabled copy/assignment B2DConnectedRanges(const B2DConnectedRanges&); @@ -253,11 +253,11 @@ namespace basegfx Each entry corresponds to one of the top-level rectangles in the drawing above. */ - ConnectedComponentsType maDisjunctAggregatesList; - + ConnectedComponentsType maDisjunctAggregatesList; + /** Global bound rect over all added ranges. */ - B2DRange maTotalBounds; + B2DRange maTotalBounds; }; } diff --git a/basegfx/inc/basegfx/range/b2dpolyrange.hxx b/basegfx/inc/basegfx/range/b2dpolyrange.hxx index 5ce105da980b..1abdbda7cad5 100644 --- a/basegfx/inc/basegfx/range/b2dpolyrange.hxx +++ b/basegfx/inc/basegfx/range/b2dpolyrange.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/basegfx/inc/basegfx/range/b2drange.hxx b/basegfx/inc/basegfx/range/b2drange.hxx index 8d78f1141298..f1271fe4ae0c 100644 --- a/basegfx/inc/basegfx/range/b2drange.hxx +++ b/basegfx/inc/basegfx/range/b2drange.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -44,25 +44,25 @@ namespace basegfx class B2DRange { - public: - typedef double ValueType; - typedef DoubleTraits TraitsType; + public: + typedef double ValueType; + typedef DoubleTraits TraitsType; - B2DRange() + B2DRange() { } - + explicit B2DRange(const B2DTuple& rTuple) - : maRangeX(rTuple.getX()), + : maRangeX(rTuple.getX()), maRangeY(rTuple.getY()) { } - + B2DRange(double x1, double y1, double x2, double y2) - : maRangeX(x1), + : maRangeX(x1), maRangeY(y1) { maRangeX.expand(x2); @@ -71,57 +71,57 @@ namespace basegfx B2DRange(const B2DTuple& rTuple1, const B2DTuple& rTuple2) - : maRangeX(rTuple1.getX()), + : maRangeX(rTuple1.getX()), maRangeY(rTuple1.getY()) { expand( rTuple2 ); } - + B2DRange(const B2DRange& rRange) - : maRangeX(rRange.maRangeX), + : maRangeX(rRange.maRangeX), maRangeY(rRange.maRangeY) { } explicit B2DRange(const B2IRange& rRange); - bool isEmpty() const + bool isEmpty() const { return ( - maRangeX.isEmpty() + maRangeX.isEmpty() || maRangeY.isEmpty() ); } - void reset() - { - maRangeX.reset(); - maRangeY.reset(); + void reset() + { + maRangeX.reset(); + maRangeY.reset(); } - bool operator==( const B2DRange& rRange ) const - { - return (maRangeX == rRange.maRangeX - && maRangeY == rRange.maRangeY); + bool operator==( const B2DRange& rRange ) const + { + return (maRangeX == rRange.maRangeX + && maRangeY == rRange.maRangeY); } - bool operator!=( const B2DRange& rRange ) const - { - return (maRangeX != rRange.maRangeX - || maRangeY != rRange.maRangeY); + bool operator!=( const B2DRange& rRange ) const + { + return (maRangeX != rRange.maRangeX + || maRangeY != rRange.maRangeY); } - B2DRange& operator=(const B2DRange& rRange) - { - maRangeX = rRange.maRangeX; - maRangeY = rRange.maRangeY; - return *this; + B2DRange& operator=(const B2DRange& rRange) + { + maRangeX = rRange.maRangeX; + maRangeY = rRange.maRangeY; + return *this; } bool equal(const B2DRange& rRange) const { - return (maRangeX.equal(rRange.maRangeX) - && maRangeY.equal(rRange.maRangeY)); + return (maRangeX.equal(rRange.maRangeX) + && maRangeY.equal(rRange.maRangeY)); } double getMinX() const @@ -161,7 +161,7 @@ namespace basegfx maRangeY.getMinimum() ); } - + B2DPoint getMaximum() const { return B2DPoint( @@ -177,7 +177,7 @@ namespace basegfx maRangeY.getRange() ); } - + B2DPoint getCenter() const { return B2DPoint( @@ -185,21 +185,21 @@ namespace basegfx maRangeY.getCenter() ); } - + double getCenterX() const { return maRangeX.getCenter(); } - + double getCenterY() const { return maRangeY.getCenter(); } - + bool isInside(const B2DTuple& rTuple) const { return ( - maRangeX.isInside(rTuple.getX()) + maRangeX.isInside(rTuple.getX()) && maRangeY.isInside(rTuple.getY()) ); } @@ -207,7 +207,7 @@ namespace basegfx bool isInside(const B2DRange& rRange) const { return ( - maRangeX.isInside(rRange.maRangeX) + maRangeX.isInside(rRange.maRangeX) && maRangeY.isInside(rRange.maRangeY) ); } @@ -215,7 +215,7 @@ namespace basegfx bool overlaps(const B2DRange& rRange) const { return ( - maRangeX.overlaps(rRange.maRangeX) + maRangeX.overlaps(rRange.maRangeX) && maRangeY.overlaps(rRange.maRangeY) ); } @@ -223,7 +223,7 @@ namespace basegfx bool overlapsMore(const B2DRange& rRange) const { return ( - maRangeX.overlapsMore(rRange.maRangeX) + maRangeX.overlapsMore(rRange.maRangeX) && maRangeY.overlapsMore(rRange.maRangeY) ); } @@ -236,29 +236,29 @@ namespace basegfx void expand(const B2DRange& rRange) { - maRangeX.expand(rRange.maRangeX); - maRangeY.expand(rRange.maRangeY); + maRangeX.expand(rRange.maRangeX); + maRangeY.expand(rRange.maRangeY); } void intersect(const B2DRange& rRange) { - maRangeX.intersect(rRange.maRangeX); - maRangeY.intersect(rRange.maRangeY); + maRangeX.intersect(rRange.maRangeX); + maRangeY.intersect(rRange.maRangeY); } void grow(double fValue) { - maRangeX.grow(fValue); - maRangeY.grow(fValue); + maRangeX.grow(fValue); + maRangeY.grow(fValue); } void transform(const B2DHomMatrix& rMatrix); private: - typedef ::basegfx::BasicRange< ValueType, TraitsType > MyBasicRange; + typedef ::basegfx::BasicRange< ValueType, TraitsType > MyBasicRange; - MyBasicRange maRangeX; - MyBasicRange maRangeY; + MyBasicRange maRangeX; + MyBasicRange maRangeY; }; /** Round double to nearest integer for 2D range @@ -286,9 +286,9 @@ namespace basegfx @return the input vector */ - ::std::vector< B2DRange >& computeSetDifference( ::std::vector< B2DRange >& o_rResult, - const B2DRange& rFirst, - const B2DRange& rSecond ); + ::std::vector< B2DRange >& computeSetDifference( ::std::vector< B2DRange >& o_rResult, + const B2DRange& rFirst, + const B2DRange& rSecond ); } // end of namespace basegfx diff --git a/basegfx/inc/basegfx/range/b2drangeclipper.hxx b/basegfx/inc/basegfx/range/b2drangeclipper.hxx index 146273d5d21d..c59329c226ea 100644 --- a/basegfx/inc/basegfx/range/b2drangeclipper.hxx +++ b/basegfx/inc/basegfx/range/b2drangeclipper.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -40,13 +40,13 @@ namespace basegfx namespace tools { /** Extract poly-polygon w/o self-intersections from poly-range - + Similar to the solveCrossovers(const B2DPolyPolygon&) method, this one calculates a self-intersection-free poly-polygon with the same topology, and encoding inside/outsidedness via polygon orientation and layering. */ - B2DPolyPolygon solveCrossovers(const std::vector<B2DRange>& rRanges, + B2DPolyPolygon solveCrossovers(const std::vector<B2DRange>& rRanges, const std::vector<B2VectorOrientation>& rOrientations); } } diff --git a/basegfx/inc/basegfx/range/b2drectangle.hxx b/basegfx/inc/basegfx/range/b2drectangle.hxx index c00d13256cea..9a9e1b7cbf80 100644 --- a/basegfx/inc/basegfx/range/b2drectangle.hxx +++ b/basegfx/inc/basegfx/range/b2drectangle.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/basegfx/inc/basegfx/range/b2ibox.hxx b/basegfx/inc/basegfx/range/b2ibox.hxx index 1e2c790dc51d..38e664d4faeb 100644 --- a/basegfx/inc/basegfx/range/b2ibox.hxx +++ b/basegfx/inc/basegfx/range/b2ibox.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -41,20 +41,20 @@ namespace basegfx { class B2IBox { - public: - typedef sal_Int32 ValueType; - typedef Int32Traits TraitsType; + public: + typedef sal_Int32 ValueType; + typedef Int32Traits TraitsType; - B2IBox() + B2IBox() { } - + explicit B2IBox(const B2ITuple& rTuple) - : maRangeX(rTuple.getX()), + : maRangeX(rTuple.getX()), maRangeY(rTuple.getY()) { } - + B2IBox(sal_Int32 x1, sal_Int32 y1, sal_Int32 x2, @@ -65,7 +65,7 @@ namespace basegfx maRangeX.expand(x2); maRangeY.expand(y2); } - + B2IBox(const B2ITuple& rTuple1, const B2ITuple& rTuple2) : maRangeX(rTuple1.getX()), @@ -73,40 +73,40 @@ namespace basegfx { expand( rTuple2 ); } - + B2IBox(const B2IBox& rBox) : maRangeX(rBox.maRangeX), maRangeY(rBox.maRangeY) { } - bool isEmpty() const + bool isEmpty() const { return maRangeX.isEmpty() || maRangeY.isEmpty(); } - void reset() - { - maRangeX.reset(); - maRangeY.reset(); + void reset() + { + maRangeX.reset(); + maRangeY.reset(); } - bool operator==( const B2IBox& rBox ) const - { - return (maRangeX == rBox.maRangeX - && maRangeY == rBox.maRangeY); + bool operator==( const B2IBox& rBox ) const + { + return (maRangeX == rBox.maRangeX + && maRangeY == rBox.maRangeY); } - bool operator!=( const B2IBox& rBox ) const - { - return (maRangeX != rBox.maRangeX - || maRangeY != rBox.maRangeY); + bool operator!=( const B2IBox& rBox ) const + { + return (maRangeX != rBox.maRangeX + || maRangeY != rBox.maRangeY); } - void operator=(const B2IBox& rBox) - { - maRangeX = rBox.maRangeX; - maRangeY = rBox.maRangeY; + void operator=(const B2IBox& rBox) + { + maRangeX = rBox.maRangeX; + maRangeY = rBox.maRangeY; } sal_Int32 getMinX() const @@ -146,7 +146,7 @@ namespace basegfx maRangeY.getMinimum() ); } - + B2IPoint getMaximum() const { return B2IPoint( @@ -162,7 +162,7 @@ namespace basegfx maRangeY.getRange() ); } - + B2DPoint getCenter() const { return B2DPoint( @@ -170,11 +170,11 @@ namespace basegfx maRangeY.getCenter() ); } - + bool isInside(const B2ITuple& rTuple) const { return ( - maRangeX.isInside(rTuple.getX()) + maRangeX.isInside(rTuple.getX()) && maRangeY.isInside(rTuple.getY()) ); } @@ -182,7 +182,7 @@ namespace basegfx bool isInside(const B2IBox& rBox) const { return ( - maRangeX.isInside(rBox.maRangeX) + maRangeX.isInside(rBox.maRangeX) && maRangeY.isInside(rBox.maRangeY) ); } @@ -190,7 +190,7 @@ namespace basegfx bool overlaps(const B2IBox& rBox) const { return ( - maRangeX.overlaps(rBox.maRangeX) + maRangeX.overlaps(rBox.maRangeX) && maRangeY.overlaps(rBox.maRangeY) ); } @@ -203,25 +203,25 @@ namespace basegfx void expand(const B2IBox& rBox) { - maRangeX.expand(rBox.maRangeX); - maRangeY.expand(rBox.maRangeY); + maRangeX.expand(rBox.maRangeX); + maRangeY.expand(rBox.maRangeY); } void intersect(const B2IBox& rBox) { - maRangeX.intersect(rBox.maRangeX); - maRangeY.intersect(rBox.maRangeY); + maRangeX.intersect(rBox.maRangeX); + maRangeY.intersect(rBox.maRangeY); } void grow(sal_Int32 nValue) { - maRangeX.grow(nValue); - maRangeY.grow(nValue); + maRangeX.grow(nValue); + maRangeY.grow(nValue); } private: - BasicBox maRangeX; - BasicBox maRangeY; + BasicBox maRangeX; + BasicBox maRangeY; }; /** Compute the set difference of the two given boxes @@ -243,9 +243,9 @@ namespace basegfx @return the input vector */ - ::std::vector< B2IBox >& computeSetDifference( ::std::vector< B2IBox >& o_rResult, - const B2IBox& rFirst, - const B2IBox& rSecond ); + ::std::vector< B2IBox >& computeSetDifference( ::std::vector< B2IBox >& o_rResult, + const B2IBox& rFirst, + const B2IBox& rSecond ); } // end of namespace basegfx diff --git a/basegfx/inc/basegfx/range/b2irange.hxx b/basegfx/inc/basegfx/range/b2irange.hxx index 5378e487ba95..85ac60df724e 100644 --- a/basegfx/inc/basegfx/range/b2irange.hxx +++ b/basegfx/inc/basegfx/range/b2irange.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -41,73 +41,73 @@ namespace basegfx { class B2IRange { - public: - typedef sal_Int32 ValueType; - typedef Int32Traits TraitsType; + public: + typedef sal_Int32 ValueType; + typedef Int32Traits TraitsType; - B2IRange() + B2IRange() { } - + explicit B2IRange(const B2ITuple& rTuple) - : maRangeX(rTuple.getX()), + : maRangeX(rTuple.getX()), maRangeY(rTuple.getY()) { } - + B2IRange(sal_Int32 x1, sal_Int32 y1, sal_Int32 x2, sal_Int32 y2) - : maRangeX(x1), + : maRangeX(x1), maRangeY(y1) { maRangeX.expand(x2); maRangeY.expand(y2); } - + B2IRange(const B2ITuple& rTuple1, const B2ITuple& rTuple2) - : maRangeX(rTuple1.getX()), + : maRangeX(rTuple1.getX()), maRangeY(rTuple1.getY()) { expand( rTuple2 ); } - + B2IRange(const B2IRange& rRange) - : maRangeX(rRange.maRangeX), + : maRangeX(rRange.maRangeX), maRangeY(rRange.maRangeY) { } - bool isEmpty() const + bool isEmpty() const { return maRangeX.isEmpty() || maRangeY.isEmpty(); } - void reset() - { - maRangeX.reset(); - maRangeY.reset(); + void reset() + { + maRangeX.reset(); + maRangeY.reset(); } - bool operator==( const B2IRange& rRange ) const - { - return (maRangeX == rRange.maRangeX - && maRangeY == rRange.maRangeY); + bool operator==( const B2IRange& rRange ) const + { + return (maRangeX == rRange.maRangeX + && maRangeY == rRange.maRangeY); } - bool operator!=( const B2IRange& rRange ) const - { - return (maRangeX != rRange.maRangeX - || maRangeY != rRange.maRangeY); + bool operator!=( const B2IRange& rRange ) const + { + return (maRangeX != rRange.maRangeX + || maRangeY != rRange.maRangeY); } - B2IRange& operator=(const B2IRange& rRange) - { - maRangeX = rRange.maRangeX; - maRangeY = rRange.maRangeY; - return *this; + B2IRange& operator=(const B2IRange& rRange) + { + maRangeX = rRange.maRangeX; + maRangeY = rRange.maRangeY; + return *this; } sal_Int32 getMinX() const @@ -147,7 +147,7 @@ namespace basegfx maRangeY.getMinimum() ); } - + B2IPoint getMaximum() const { return B2IPoint( @@ -163,7 +163,7 @@ namespace basegfx maRangeY.getRange() ); } - + B2DPoint getCenter() const { return B2DPoint( @@ -171,11 +171,11 @@ namespace basegfx maRangeY.getCenter() ); } - + bool isInside(const B2ITuple& rTuple) const { return ( - maRangeX.isInside(rTuple.getX()) + maRangeX.isInside(rTuple.getX()) && maRangeY.isInside(rTuple.getY()) ); } @@ -183,7 +183,7 @@ namespace basegfx bool isInside(const B2IRange& rRange) const { return ( - maRangeX.isInside(rRange.maRangeX) + maRangeX.isInside(rRange.maRangeX) && maRangeY.isInside(rRange.maRangeY) ); } @@ -191,7 +191,7 @@ namespace basegfx bool overlaps(const B2IRange& rRange) const { return ( - maRangeX.overlaps(rRange.maRangeX) + maRangeX.overlaps(rRange.maRangeX) && maRangeY.overlaps(rRange.maRangeY) ); } @@ -204,27 +204,27 @@ namespace basegfx void expand(const B2IRange& rRange) { - maRangeX.expand(rRange.maRangeX); - maRangeY.expand(rRange.maRangeY); + maRangeX.expand(rRange.maRangeX); + maRangeY.expand(rRange.maRangeY); } void intersect(const B2IRange& rRange) { - maRangeX.intersect(rRange.maRangeX); - maRangeY.intersect(rRange.maRangeY); + maRangeX.intersect(rRange.maRangeX); + maRangeY.intersect(rRange.maRangeY); } void grow(sal_Int32 nValue) { - maRangeX.grow(nValue); - maRangeY.grow(nValue); + maRangeX.grow(nValue); + maRangeY.grow(nValue); } private: - typedef ::basegfx::BasicRange< ValueType, TraitsType > MyBasicRange; + typedef ::basegfx::BasicRange< ValueType, TraitsType > MyBasicRange; - MyBasicRange maRangeX; - MyBasicRange maRangeY; + MyBasicRange maRangeX; + MyBasicRange maRangeY; }; /** Compute the set difference of the two given ranges @@ -246,9 +246,9 @@ namespace basegfx @return the input vector */ - ::std::vector< B2IRange >& computeSetDifference( ::std::vector< B2IRange >& o_rResult, - const B2IRange& rFirst, - const B2IRange& rSecond ); + ::std::vector< B2IRange >& computeSetDifference( ::std::vector< B2IRange >& o_rResult, + const B2IRange& rFirst, + const B2IRange& rSecond ); } // end of namespace basegfx diff --git a/basegfx/inc/basegfx/range/b2irectangle.hxx b/basegfx/inc/basegfx/range/b2irectangle.hxx index 2abc954e0196..965fe7b10bbe 100644 --- a/basegfx/inc/basegfx/range/b2irectangle.hxx +++ b/basegfx/inc/basegfx/range/b2irectangle.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/basegfx/inc/basegfx/range/b3drange.hxx b/basegfx/inc/basegfx/range/b3drange.hxx index 8e1cf8aa9f02..eeec1fa29e16 100644 --- a/basegfx/inc/basegfx/range/b3drange.hxx +++ b/basegfx/inc/basegfx/range/b3drange.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -42,31 +42,31 @@ namespace basegfx class B3DRange { - typedef ::basegfx::BasicRange< double, DoubleTraits > MyBasicRange; + typedef ::basegfx::BasicRange< double, DoubleTraits > MyBasicRange; - MyBasicRange maRangeX; - MyBasicRange maRangeY; - MyBasicRange maRangeZ; + MyBasicRange maRangeX; + MyBasicRange maRangeY; + MyBasicRange maRangeZ; - public: - B3DRange() + public: + B3DRange() { } - + explicit B3DRange(const B3DTuple& rTuple) - : maRangeX(rTuple.getX()), + : maRangeX(rTuple.getX()), maRangeY(rTuple.getY()), maRangeZ(rTuple.getZ()) { } - + B3DRange(double x1, double y1, double z1, double x2, double y2, double z2) - : maRangeX(x1), + : maRangeX(x1), maRangeY(y1), maRangeZ(z1) { @@ -77,15 +77,15 @@ namespace basegfx B3DRange(const B3DTuple& rTuple1, const B3DTuple& rTuple2) - : maRangeX(rTuple1.getX()), + : maRangeX(rTuple1.getX()), maRangeY(rTuple1.getY()), maRangeZ(rTuple1.getZ()) { expand(rTuple2); } - + B3DRange(const B3DRange& rRange) - : maRangeX(rRange.maRangeX), + : maRangeX(rRange.maRangeX), maRangeY(rRange.maRangeY), maRangeZ(rRange.maRangeZ) { @@ -93,49 +93,49 @@ namespace basegfx explicit B3DRange(const B3IRange& rRange); - bool isEmpty() const + bool isEmpty() const { return ( - maRangeX.isEmpty() - || maRangeY.isEmpty() + maRangeX.isEmpty() + || maRangeY.isEmpty() || maRangeZ.isEmpty() ); } - void reset() - { - maRangeX.reset(); - maRangeY.reset(); - maRangeZ.reset(); + void reset() + { + maRangeX.reset(); + maRangeY.reset(); + maRangeZ.reset(); } - - bool operator==( const B3DRange& rRange ) const - { - return (maRangeX == rRange.maRangeX + + bool operator==( const B3DRange& rRange ) const + { + return (maRangeX == rRange.maRangeX && maRangeY == rRange.maRangeY - && maRangeZ == rRange.maRangeZ); + && maRangeZ == rRange.maRangeZ); } - bool operator!=( const B3DRange& rRange ) const - { - return (maRangeX != rRange.maRangeX + bool operator!=( const B3DRange& rRange ) const + { + return (maRangeX != rRange.maRangeX || maRangeY != rRange.maRangeY - || maRangeZ != rRange.maRangeZ); + || maRangeZ != rRange.maRangeZ); } - B3DRange& operator=(const B3DRange& rRange) - { - maRangeX = rRange.maRangeX; - maRangeY = rRange.maRangeY; - maRangeZ = rRange.maRangeZ; - return *this; + B3DRange& operator=(const B3DRange& rRange) + { + maRangeX = rRange.maRangeX; + maRangeY = rRange.maRangeY; + maRangeZ = rRange.maRangeZ; + return *this; } bool equal(const B3DRange& rRange) const { - return (maRangeX.equal(rRange.maRangeX) + return (maRangeX.equal(rRange.maRangeX) && maRangeY.equal(rRange.maRangeY) - && maRangeZ.equal(rRange.maRangeZ)); + && maRangeZ.equal(rRange.maRangeZ)); } double getMinX() const @@ -191,7 +191,7 @@ namespace basegfx maRangeZ.getMinimum() ); } - + B3DPoint getMaximum() const { return B3DPoint( @@ -209,7 +209,7 @@ namespace basegfx maRangeZ.getRange() ); } - + B3DPoint getCenter() const { return B3DPoint( @@ -218,26 +218,26 @@ namespace basegfx maRangeZ.getCenter() ); } - + double getCenterX() const { return maRangeX.getCenter(); } - + double getCenterY() const { return maRangeY.getCenter(); } - + double getCenterZ() const { return maRangeZ.getCenter(); } - + bool isInside(const B3DTuple& rTuple) const { return ( - maRangeX.isInside(rTuple.getX()) + maRangeX.isInside(rTuple.getX()) && maRangeY.isInside(rTuple.getY()) && maRangeZ.isInside(rTuple.getZ()) ); @@ -246,7 +246,7 @@ namespace basegfx bool isInside(const B3DRange& rRange) const { return ( - maRangeX.isInside(rRange.maRangeX) + maRangeX.isInside(rRange.maRangeX) && maRangeY.isInside(rRange.maRangeY) && maRangeZ.isInside(rRange.maRangeZ) ); @@ -255,7 +255,7 @@ namespace basegfx bool overlaps(const B3DRange& rRange) const { return ( - maRangeX.overlaps(rRange.maRangeX) + maRangeX.overlaps(rRange.maRangeX) && maRangeY.overlaps(rRange.maRangeY) && maRangeZ.overlaps(rRange.maRangeZ) ); @@ -270,23 +270,23 @@ namespace basegfx void expand(const B3DRange& rRange) { - maRangeX.expand(rRange.maRangeX); - maRangeY.expand(rRange.maRangeY); - maRangeZ.expand(rRange.maRangeZ); + maRangeX.expand(rRange.maRangeX); + maRangeY.expand(rRange.maRangeY); + maRangeZ.expand(rRange.maRangeZ); } void intersect(const B3DRange& rRange) { - maRangeX.intersect(rRange.maRangeX); - maRangeY.intersect(rRange.maRangeY); - maRangeZ.intersect(rRange.maRangeZ); + maRangeX.intersect(rRange.maRangeX); + maRangeY.intersect(rRange.maRangeY); + maRangeZ.intersect(rRange.maRangeZ); } void grow(double fValue) { - maRangeX.grow(fValue); - maRangeY.grow(fValue); - maRangeZ.grow(fValue); + maRangeX.grow(fValue); + maRangeY.grow(fValue); + maRangeZ.grow(fValue); } void transform(const B3DHomMatrix& rMatrix); diff --git a/basegfx/inc/basegfx/range/b3dvolume.hxx b/basegfx/inc/basegfx/range/b3dvolume.hxx index 50cac5188271..4891444dc87e 100644 --- a/basegfx/inc/basegfx/range/b3dvolume.hxx +++ b/basegfx/inc/basegfx/range/b3dvolume.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/basegfx/inc/basegfx/range/b3ibox.hxx b/basegfx/inc/basegfx/range/b3ibox.hxx index 7c349becd43c..a219ef41181b 100644 --- a/basegfx/inc/basegfx/range/b3ibox.hxx +++ b/basegfx/inc/basegfx/range/b3ibox.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -39,22 +39,22 @@ namespace basegfx { class B3IBox { - BasicBox maRangeX; - BasicBox maRangeY; - BasicBox maRangeZ; + BasicBox maRangeX; + BasicBox maRangeY; + BasicBox maRangeZ; - public: - B3IBox() + public: + B3IBox() { } - + explicit B3IBox(const B3ITuple& rTuple) : maRangeX(rTuple.getX()), maRangeY(rTuple.getY()), maRangeZ(rTuple.getZ()) { } - + B3IBox(sal_Int32 x1, sal_Int32 y1, sal_Int32 z1, @@ -86,37 +86,37 @@ namespace basegfx { } - bool isEmpty() const + bool isEmpty() const { return maRangeX.isEmpty() || maRangeY.isEmpty() || maRangeZ.isEmpty(); } - void reset() - { - maRangeX.reset(); - maRangeY.reset(); - maRangeZ.reset(); + void reset() + { + maRangeX.reset(); + maRangeY.reset(); + maRangeZ.reset(); } - - bool operator==( const B3IBox& rBox ) const - { - return (maRangeX == rBox.maRangeX + + bool operator==( const B3IBox& rBox ) const + { + return (maRangeX == rBox.maRangeX && maRangeY == rBox.maRangeY - && maRangeZ == rBox.maRangeZ); + && maRangeZ == rBox.maRangeZ); } - bool operator!=( const B3IBox& rBox ) const - { - return (maRangeX != rBox.maRangeX + bool operator!=( const B3IBox& rBox ) const + { + return (maRangeX != rBox.maRangeX || maRangeY != rBox.maRangeY - || maRangeZ != rBox.maRangeZ); + || maRangeZ != rBox.maRangeZ); } - void operator=(const B3IBox& rBox) - { - maRangeX = rBox.maRangeX; - maRangeY = rBox.maRangeY; - maRangeZ = rBox.maRangeZ; + void operator=(const B3IBox& rBox) + { + maRangeX = rBox.maRangeX; + maRangeY = rBox.maRangeY; + maRangeZ = rBox.maRangeZ; } sal_Int32 getMinX() const @@ -172,7 +172,7 @@ namespace basegfx maRangeZ.getMinimum() ); } - + B3IPoint getMaximum() const { return B3IPoint( @@ -190,7 +190,7 @@ namespace basegfx maRangeZ.getRange() ); } - + B3DPoint getCenter() const { return B3DPoint( @@ -199,11 +199,11 @@ namespace basegfx maRangeZ.getCenter() ); } - + bool isInside(const B3ITuple& rTuple) const { return ( - maRangeX.isInside(rTuple.getX()) + maRangeX.isInside(rTuple.getX()) && maRangeY.isInside(rTuple.getY()) && maRangeZ.isInside(rTuple.getZ()) ); @@ -212,7 +212,7 @@ namespace basegfx bool isInside(const B3IBox& rBox) const { return ( - maRangeX.isInside(rBox.maRangeX) + maRangeX.isInside(rBox.maRangeX) && maRangeY.isInside(rBox.maRangeY) && maRangeZ.isInside(rBox.maRangeZ) ); @@ -221,7 +221,7 @@ namespace basegfx bool overlaps(const B3IBox& rBox) const { return ( - maRangeX.overlaps(rBox.maRangeX) + maRangeX.overlaps(rBox.maRangeX) && maRangeY.overlaps(rBox.maRangeY) && maRangeZ.overlaps(rBox.maRangeZ) ); @@ -236,23 +236,23 @@ namespace basegfx void expand(const B3IBox& rBox) { - maRangeX.expand(rBox.maRangeX); - maRangeY.expand(rBox.maRangeY); - maRangeZ.expand(rBox.maRangeZ); + maRangeX.expand(rBox.maRangeX); + maRangeY.expand(rBox.maRangeY); + maRangeZ.expand(rBox.maRangeZ); } void intersect(const B3IBox& rBox) { - maRangeX.intersect(rBox.maRangeX); - maRangeY.intersect(rBox.maRangeY); - maRangeZ.intersect(rBox.maRangeZ); + maRangeX.intersect(rBox.maRangeX); + maRangeY.intersect(rBox.maRangeY); + maRangeZ.intersect(rBox.maRangeZ); } void grow(sal_Int32 nValue) { - maRangeX.grow(nValue); - maRangeY.grow(nValue); - maRangeZ.grow(nValue); + maRangeX.grow(nValue); + maRangeY.grow(nValue); + maRangeZ.grow(nValue); } }; } // end of namespace basegfx diff --git a/basegfx/inc/basegfx/range/b3irange.hxx b/basegfx/inc/basegfx/range/b3irange.hxx index 32d48812d2cd..b2c8e7f30360 100644 --- a/basegfx/inc/basegfx/range/b3irange.hxx +++ b/basegfx/inc/basegfx/range/b3irange.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -39,31 +39,31 @@ namespace basegfx { class B3IRange { - typedef ::basegfx::BasicRange< sal_Int32, Int32Traits > MyBasicRange; + typedef ::basegfx::BasicRange< sal_Int32, Int32Traits > MyBasicRange; - MyBasicRange maRangeX; - MyBasicRange maRangeY; - MyBasicRange maRangeZ; + MyBasicRange maRangeX; + MyBasicRange maRangeY; + MyBasicRange maRangeZ; - public: - B3IRange() + public: + B3IRange() { } - + explicit B3IRange(const B3ITuple& rTuple) - : maRangeX(rTuple.getX()), + : maRangeX(rTuple.getX()), maRangeY(rTuple.getY()), maRangeZ(rTuple.getZ()) { } - + B3IRange(sal_Int32 x1, sal_Int32 y1, sal_Int32 z1, sal_Int32 x2, sal_Int32 y2, sal_Int32 z2) - : maRangeX(x1), + : maRangeX(x1), maRangeY(y1), maRangeZ(z1) { @@ -74,7 +74,7 @@ namespace basegfx B3IRange(const B3ITuple& rTuple1, const B3ITuple& rTuple2) - : maRangeX(rTuple1.getX()), + : maRangeX(rTuple1.getX()), maRangeY(rTuple1.getY()), maRangeZ(rTuple1.getZ()) { @@ -82,44 +82,44 @@ namespace basegfx } B3IRange(const B3IRange& rRange) - : maRangeX(rRange.maRangeX), + : maRangeX(rRange.maRangeX), maRangeY(rRange.maRangeY), maRangeZ(rRange.maRangeZ) { } - bool isEmpty() const + bool isEmpty() const { return maRangeX.isEmpty() || maRangeY.isEmpty() || maRangeZ.isEmpty(); } - void reset() - { - maRangeX.reset(); - maRangeY.reset(); - maRangeZ.reset(); + void reset() + { + maRangeX.reset(); + maRangeY.reset(); + maRangeZ.reset(); } - - bool operator==( const B3IRange& rRange ) const - { - return (maRangeX == rRange.maRangeX + + bool operator==( const B3IRange& rRange ) const + { + return (maRangeX == rRange.maRangeX && maRangeY == rRange.maRangeY - && maRangeZ == rRange.maRangeZ); + && maRangeZ == rRange.maRangeZ); } - bool operator!=( const B3IRange& rRange ) const - { - return (maRangeX != rRange.maRangeX + bool operator!=( const B3IRange& rRange ) const + { + return (maRangeX != rRange.maRangeX || maRangeY != rRange.maRangeY - || maRangeZ != rRange.maRangeZ); + || maRangeZ != rRange.maRangeZ); } - B3IRange& operator=(const B3IRange& rRange) - { - maRangeX = rRange.maRangeX; - maRangeY = rRange.maRangeY; - maRangeZ = rRange.maRangeZ; - return *this; + B3IRange& operator=(const B3IRange& rRange) + { + maRangeX = rRange.maRangeX; + maRangeY = rRange.maRangeY; + maRangeZ = rRange.maRangeZ; + return *this; } sal_Int32 getMinX() const @@ -175,7 +175,7 @@ namespace basegfx maRangeZ.getMinimum() ); } - + B3IPoint getMaximum() const { return B3IPoint( @@ -193,7 +193,7 @@ namespace basegfx maRangeZ.getRange() ); } - + B3DPoint getCenter() const { return B3DPoint( @@ -202,11 +202,11 @@ namespace basegfx maRangeZ.getCenter() ); } - + bool isInside(const B3ITuple& rTuple) const { return ( - maRangeX.isInside(rTuple.getX()) + maRangeX.isInside(rTuple.getX()) && maRangeY.isInside(rTuple.getY()) && maRangeZ.isInside(rTuple.getZ()) ); @@ -215,7 +215,7 @@ namespace basegfx bool isInside(const B3IRange& rRange) const { return ( - maRangeX.isInside(rRange.maRangeX) + maRangeX.isInside(rRange.maRangeX) && maRangeY.isInside(rRange.maRangeY) && maRangeZ.isInside(rRange.maRangeZ) ); @@ -224,7 +224,7 @@ namespace basegfx bool overlaps(const B3IRange& rRange) const { return ( - maRangeX.overlaps(rRange.maRangeX) + maRangeX.overlaps(rRange.maRangeX) && maRangeY.overlaps(rRange.maRangeY) && maRangeZ.overlaps(rRange.maRangeZ) ); @@ -239,23 +239,23 @@ namespace basegfx void expand(const B3IRange& rRange) { - maRangeX.expand(rRange.maRangeX); - maRangeY.expand(rRange.maRangeY); - maRangeZ.expand(rRange.maRangeZ); + maRangeX.expand(rRange.maRangeX); + maRangeY.expand(rRange.maRangeY); + maRangeZ.expand(rRange.maRangeZ); } void intersect(const B3IRange& rRange) { - maRangeX.intersect(rRange.maRangeX); - maRangeY.intersect(rRange.maRangeY); - maRangeZ.intersect(rRange.maRangeZ); + maRangeX.intersect(rRange.maRangeX); + maRangeY.intersect(rRange.maRangeY); + maRangeZ.intersect(rRange.maRangeZ); } void grow(sal_Int32 nValue) { - maRangeX.grow(nValue); - maRangeY.grow(nValue); - maRangeZ.grow(nValue); + maRangeX.grow(nValue); + maRangeY.grow(nValue); + maRangeZ.grow(nValue); } }; } // end of namespace basegfx diff --git a/basegfx/inc/basegfx/range/b3ivolume.hxx b/basegfx/inc/basegfx/range/b3ivolume.hxx index 67fe3d2959f6..18f003e11c3e 100644 --- a/basegfx/inc/basegfx/range/b3ivolume.hxx +++ b/basegfx/inc/basegfx/range/b3ivolume.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/basegfx/inc/basegfx/range/basicbox.hxx b/basegfx/inc/basegfx/range/basicbox.hxx index 0159acc9e8e0..3625dd9b48b5 100644 --- a/basegfx/inc/basegfx/range/basicbox.hxx +++ b/basegfx/inc/basegfx/range/basicbox.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/basegfx/inc/basegfx/range/basicrange.hxx b/basegfx/inc/basegfx/range/basicrange.hxx index 8711f95b754c..d8f149f205c8 100644 --- a/basegfx/inc/basegfx/range/basicrange.hxx +++ b/basegfx/inc/basegfx/range/basicrange.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -39,12 +39,12 @@ namespace basegfx template< typename T, typename Traits > class BasicRange { protected: - T mnMinimum; - T mnMaximum; - + T mnMinimum; + T mnMaximum; + public: - typedef T ValueType; - typedef Traits TraitsType; + typedef T ValueType; + typedef Traits TraitsType; BasicRange() : mnMinimum(Traits::maxVal()), @@ -148,13 +148,13 @@ namespace basegfx 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); } - bool operator!=( const BasicRange& rRange ) const - { + bool operator!=( const BasicRange& rRange ) const + { return (mnMinimum != rRange.mnMinimum || mnMaximum != rRange.mnMaximum); } @@ -162,13 +162,13 @@ namespace basegfx { mnMinimum = rRange.mnMinimum; mnMaximum = rRange.mnMaximum; - return *this; + return *this; } bool equal(const BasicRange& rRange) const { return ( - fTools::equal(mnMinimum, rRange.mnMinimum) && + fTools::equal(mnMinimum, rRange.mnMinimum) && fTools::equal(mnMaximum, rRange.mnMaximum)); } @@ -207,7 +207,7 @@ namespace basegfx { mnMinimum = rRange.mnMinimum; } - + if(rRange.mnMaximum > mnMaximum) { mnMaximum = rRange.mnMaximum; @@ -229,7 +229,7 @@ namespace basegfx { mnMinimum = rRange.mnMinimum; } - + if(rRange.mnMaximum < mnMaximum) { mnMaximum = rRange.mnMaximum; diff --git a/basegfx/inc/basegfx/range/rangeexpander.hxx b/basegfx/inc/basegfx/range/rangeexpander.hxx index 509757d79750..6d8e2562e2ad 100644 --- a/basegfx/inc/basegfx/range/rangeexpander.hxx +++ b/basegfx/inc/basegfx/range/rangeexpander.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -53,9 +53,9 @@ namespace basegfx */ template< typename RangeType > class RangeExpander { - public: - typedef RangeType ValueType; - typedef void result_type; + public: + typedef RangeType ValueType; + typedef void result_type; explicit RangeExpander( ValueType& rBounds ) : mrBounds( rBounds ) diff --git a/basegfx/inc/basegfx/raster/bpixelraster.hxx b/basegfx/inc/basegfx/raster/bpixelraster.hxx index b479384bb806..7516a82b5ca2 100644 --- a/basegfx/inc/basegfx/raster/bpixelraster.hxx +++ b/basegfx/inc/basegfx/raster/bpixelraster.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -49,10 +49,10 @@ namespace basegfx BPixelRaster& operator=(const BPixelRaster&); protected: - sal_uInt32 mnWidth; - sal_uInt32 mnHeight; - sal_uInt32 mnCount; - BPixel* mpContent; + sal_uInt32 mnWidth; + sal_uInt32 mnHeight; + sal_uInt32 mnCount; + BPixel* mpContent; public: // reset @@ -63,7 +63,7 @@ namespace basegfx // constructor/destructor BPixelRaster(sal_uInt32 nWidth, sal_uInt32 nHeight) - : mnWidth(nWidth), + : mnWidth(nWidth), mnHeight(nHeight), mnCount(nWidth * nHeight), mpContent(new BPixel[mnCount]) @@ -85,12 +85,12 @@ namespace basegfx 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 { #ifdef DBG_UTIL - if(nIndex >= mnCount) + if(nIndex >= mnCount) { OSL_ENSURE(false, "getBPixel: Access out of range (!)"); return BPixel::getEmptyBPixel(); @@ -103,7 +103,7 @@ namespace basegfx BPixel& getBPixel(sal_uInt32 nIndex) { #ifdef DBG_UTIL - if(nIndex >= mnCount) + if(nIndex >= mnCount) { OSL_ENSURE(false, "getBPixel: Access out of range (!)"); return mpContent[0L]; diff --git a/basegfx/inc/basegfx/raster/bzpixelraster.hxx b/basegfx/inc/basegfx/raster/bzpixelraster.hxx index 9e3cd6db36f1..06b2d41e9cc8 100644 --- a/basegfx/inc/basegfx/raster/bzpixelraster.hxx +++ b/basegfx/inc/basegfx/raster/bzpixelraster.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -43,7 +43,7 @@ namespace basegfx { protected: // additionally, host a ZBuffer - sal_uInt16* mpZBuffer; + sal_uInt16* mpZBuffer; public: // reset @@ -55,7 +55,7 @@ namespace basegfx // constructor/destructor BZPixelRaster(sal_uInt32 nWidth, sal_uInt32 nHeight) - : BPixelRaster(nWidth, nHeight), + : BPixelRaster(nWidth, nHeight), mpZBuffer(new sal_uInt16[mnCount]) { rtl_zeroMemory(mpZBuffer, sizeof(sal_uInt16) * mnCount); @@ -70,7 +70,7 @@ namespace basegfx const sal_uInt16& getZ(sal_uInt32 nIndex) const { #ifdef DBG_UTIL - if(nIndex >= mnCount) + if(nIndex >= mnCount) { OSL_ENSURE(false, "getZ: Access out of range (!)"); return mpZBuffer[0L]; @@ -83,7 +83,7 @@ namespace basegfx sal_uInt16& getZ(sal_uInt32 nIndex) { #ifdef DBG_UTIL - if(nIndex >= mnCount) + if(nIndex >= mnCount) { OSL_ENSURE(false, "getZ: Access out of range (!)"); return mpZBuffer[0L]; diff --git a/basegfx/inc/basegfx/raster/rasterconvert3d.hxx b/basegfx/inc/basegfx/raster/rasterconvert3d.hxx index 0644fd1923d8..bd5d71778663 100644 --- a/basegfx/inc/basegfx/raster/rasterconvert3d.hxx +++ b/basegfx/inc/basegfx/raster/rasterconvert3d.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -53,18 +53,18 @@ namespace basegfx class ip_single { private: - double mfVal; - double mfInc; + double mfVal; + double mfInc; public: - ip_single() - : mfVal(0.0), - mfInc(0.0) + ip_single() + : mfVal(0.0), + mfInc(0.0) {} - ip_single(double fVal, double fInc) - : mfVal(fVal), - mfInc(fInc) + ip_single(double fVal, double fInc) + : mfVal(fVal), + mfInc(fInc) {} double getVal() const { return mfVal; } @@ -79,17 +79,17 @@ namespace basegfx class ip_double { private: - ip_single maX; - ip_single maY; + ip_single maX; + ip_single maY; public: - ip_double() - : maX(), + ip_double() + : maX(), maY() {} - ip_double(double fXVal, double fXInc, double fYVal, double fYInc) - : maX(fXVal, fXInc), + ip_double(double fXVal, double fXInc, double fYVal, double fYInc) + : maX(fXVal, fXInc), maY(fYVal, fYInc) {} @@ -105,19 +105,19 @@ namespace basegfx class ip_triple { private: - ip_single maX; - ip_single maY; - ip_single maZ; + ip_single maX; + ip_single maY; + ip_single maZ; public: - ip_triple() - : maX(), + ip_triple() + : maX(), maY(), maZ() {} - ip_triple(double fXVal, double fXInc, double fYVal, double fYInc, double fZVal, double fZInc) - : maX(fXVal, fXInc), + ip_triple(double fXVal, double fXInc, double fYVal, double fYInc, double fZVal, double fZInc) + : maX(fXVal, fXInc), maY(fYVal, fYInc), maZ(fZVal, fZInc) {} @@ -136,15 +136,15 @@ namespace basegfx namespace basegfx { - #define SCANLINE_EMPTY_INDEX (0xffffffff) + #define SCANLINE_EMPTY_INDEX (0xffffffff) class InterpolatorProvider3D { private: - ::std::vector< ip_triple > maColorInterpolators; - ::std::vector< ip_triple > maNormalInterpolators; - ::std::vector< ip_double > maTextureInterpolators; - ::std::vector< ip_triple > maInverseTextureInterpolators; + ::std::vector< ip_triple > maColorInterpolators; + ::std::vector< ip_triple > maNormalInterpolators; + ::std::vector< ip_double > maTextureInterpolators; + ::std::vector< ip_triple > maInverseTextureInterpolators; protected: sal_uInt32 addColorInterpolator(const BColor& rA, const BColor& rB, double fInvYDelta) @@ -213,19 +213,19 @@ namespace basegfx class RasterConversionLineEntry3D { private: - ip_single maX; - ip_single maZ; - sal_Int32 mnY; - sal_uInt32 mnCount; + ip_single maX; + ip_single maZ; + sal_Int32 mnY; + sal_uInt32 mnCount; - sal_uInt32 mnColorIndex; - sal_uInt32 mnNormalIndex; - sal_uInt32 mnTextureIndex; - sal_uInt32 mnInverseTextureIndex; + sal_uInt32 mnColorIndex; + sal_uInt32 mnNormalIndex; + sal_uInt32 mnTextureIndex; + sal_uInt32 mnInverseTextureIndex; public: RasterConversionLineEntry3D(const double& rfX, const double& rfDeltaX, const double& rfZ, const double& rfDeltaZ, sal_Int32 nY, sal_uInt32 nCount) - : maX(rfX, rfDeltaX), + : maX(rfX, rfDeltaX), maZ(rfZ, rfDeltaZ), mnY(nY), mnCount(nCount), @@ -312,7 +312,7 @@ namespace basegfx { private: // the line entries for an area conversion run - ::std::vector< RasterConversionLineEntry3D > maLineEntries; + ::std::vector< RasterConversionLineEntry3D > maLineEntries; struct lineComparator { diff --git a/basegfx/inc/basegfx/tools/b2dclipstate.hxx b/basegfx/inc/basegfx/tools/b2dclipstate.hxx index 4550df124588..bc3d1c1e664b 100644 --- a/basegfx/inc/basegfx/tools/b2dclipstate.hxx +++ b/basegfx/inc/basegfx/tools/b2dclipstate.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -78,7 +78,7 @@ namespace basegfx /// unshare this poly-range with all internally shared instances void makeUnique(); - + /// Set clip to 'null' - nothing is visible void makeNull(); /// returns true when clip is 'null' - nothing is visible diff --git a/basegfx/inc/basegfx/tools/canvastools.hxx b/basegfx/inc/basegfx/tools/canvastools.hxx index 1dae369e80c8..1841d1f0ed82 100644 --- a/basegfx/inc/basegfx/tools/canvastools.hxx +++ b/basegfx/inc/basegfx/tools/canvastools.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -54,7 +54,7 @@ namespace com { namespace sun { namespace star { namespace rendering class XPolyPolygon2D; } } } } -namespace com { namespace sun { namespace star { namespace awt +namespace com { namespace sun { namespace star { namespace awt { struct Point; struct Size; @@ -80,101 +80,101 @@ namespace basegfx // Polygon conversions // =================================================================== - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D > - xPolyPolygonFromB2DPolygon( const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XGraphicDevice >& xGraphicDevice, - const ::basegfx::B2DPolygon& rPoly ); + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D > + xPolyPolygonFromB2DPolygon( const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XGraphicDevice >& xGraphicDevice, + const ::basegfx::B2DPolygon& rPoly ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D > - xPolyPolygonFromB2DPolyPolygon( const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XGraphicDevice >& xGraphicDevice, - const ::basegfx::B2DPolyPolygon& rPolyPoly ); + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D > + xPolyPolygonFromB2DPolyPolygon( const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XGraphicDevice >& xGraphicDevice, + const ::basegfx::B2DPolyPolygon& rPolyPoly ); - ::com::sun::star::uno::Sequence< - ::com::sun::star::uno::Sequence< - ::com::sun::star::geometry::RealBezierSegment2D > > + ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Sequence< + ::com::sun::star::geometry::RealBezierSegment2D > > bezierSequenceSequenceFromB2DPolyPolygon( const ::basegfx::B2DPolyPolygon& rPolyPoly ); - ::com::sun::star::uno::Sequence< - ::com::sun::star::uno::Sequence< - ::com::sun::star::geometry::RealPoint2D > > + ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Sequence< + ::com::sun::star::geometry::RealPoint2D > > pointSequenceSequenceFromB2DPolyPolygon( const ::basegfx::B2DPolyPolygon& rPolyPoly ); - ::basegfx::B2DPolygon polygonFromPoint2DSequence( - const ::com::sun::star::uno::Sequence< + ::basegfx::B2DPolygon polygonFromPoint2DSequence( + const ::com::sun::star::uno::Sequence< ::com::sun::star::geometry::RealPoint2D >& rPoints ); - ::basegfx::B2DPolyPolygon polyPolygonFromPoint2DSequenceSequence( - const ::com::sun::star::uno::Sequence< + ::basegfx::B2DPolyPolygon polyPolygonFromPoint2DSequenceSequence( + const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::geometry::RealPoint2D > >& rPoints ); - ::basegfx::B2DPolygon polygonFromBezier2DSequence( - const ::com::sun::star::uno::Sequence< + ::basegfx::B2DPolygon polygonFromBezier2DSequence( + const ::com::sun::star::uno::Sequence< ::com::sun::star::geometry::RealBezierSegment2D >& rPoints ); - ::basegfx::B2DPolyPolygon polyPolygonFromBezier2DSequenceSequence( - const ::com::sun::star::uno::Sequence< + ::basegfx::B2DPolyPolygon polyPolygonFromBezier2DSequenceSequence( + const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::geometry::RealBezierSegment2D > >& rPoints ); ::basegfx::B2DPolyPolygon b2DPolyPolygonFromXPolyPolygon2D( - const ::com::sun::star::uno::Reference< + const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D >& rPoly ); // Matrix conversions // =================================================================== - ::com::sun::star::geometry::AffineMatrix2D& - affineMatrixFromHomMatrix( ::com::sun::star::geometry::AffineMatrix2D& matrix, - const ::basegfx::B2DHomMatrix& transform); + ::com::sun::star::geometry::AffineMatrix2D& + affineMatrixFromHomMatrix( ::com::sun::star::geometry::AffineMatrix2D& matrix, + const ::basegfx::B2DHomMatrix& transform); ::com::sun::star::geometry::AffineMatrix3D& affineMatrixFromHomMatrix3D( - ::com::sun::star::geometry::AffineMatrix3D& matrix, + ::com::sun::star::geometry::AffineMatrix3D& matrix, const ::basegfx::B3DHomMatrix& transform); - ::basegfx::B2DHomMatrix& - homMatrixFromAffineMatrix( ::basegfx::B2DHomMatrix& transform, - const ::com::sun::star::geometry::AffineMatrix2D& matrix ); + ::basegfx::B2DHomMatrix& + homMatrixFromAffineMatrix( ::basegfx::B2DHomMatrix& transform, + const ::com::sun::star::geometry::AffineMatrix2D& matrix ); ::basegfx::B2DHomMatrix homMatrixFromAffineMatrix( const ::com::sun::star::geometry::AffineMatrix2D& matrix ); ::basegfx::B3DHomMatrix homMatrixFromAffineMatrix3D( const ::com::sun::star::geometry::AffineMatrix3D& matrix ); - ::com::sun::star::geometry::Matrix2D& + ::com::sun::star::geometry::Matrix2D& matrixFromHomMatrix( ::com::sun::star::geometry::Matrix2D& matrix, - const ::basegfx::B2DHomMatrix& transform); + const ::basegfx::B2DHomMatrix& transform); - ::basegfx::B2DHomMatrix& - homMatrixFromMatrix( ::basegfx::B2DHomMatrix& transform, + ::basegfx::B2DHomMatrix& + homMatrixFromMatrix( ::basegfx::B2DHomMatrix& transform, const ::com::sun::star::geometry::Matrix2D& matrix ); // Geometry conversions // =================================================================== - ::com::sun::star::geometry::RealSize2D size2DFromB2DSize( const ::basegfx::B2DVector& ); - ::com::sun::star::geometry::RealPoint2D point2DFromB2DPoint( const ::basegfx::B2DPoint& ); - ::com::sun::star::geometry::RealRectangle2D rectangle2DFromB2DRectangle( const ::basegfx::B2DRange& ); - ::com::sun::star::geometry::RealRectangle3D rectangle3DFromB3DRectangle( const ::basegfx::B3DRange& ); - - ::basegfx::B2DVector b2DSizeFromRealSize2D( const ::com::sun::star::geometry::RealSize2D& ); - ::basegfx::B2DPoint b2DPointFromRealPoint2D( const ::com::sun::star::geometry::RealPoint2D& ); - ::basegfx::B2DRange b2DRectangleFromRealRectangle2D( const ::com::sun::star::geometry::RealRectangle2D& ); - ::basegfx::B3DRange b3DRectangleFromRealRectangle3D( const ::com::sun::star::geometry::RealRectangle3D& ); + ::com::sun::star::geometry::RealSize2D size2DFromB2DSize( const ::basegfx::B2DVector& ); + ::com::sun::star::geometry::RealPoint2D point2DFromB2DPoint( const ::basegfx::B2DPoint& ); + ::com::sun::star::geometry::RealRectangle2D rectangle2DFromB2DRectangle( const ::basegfx::B2DRange& ); + ::com::sun::star::geometry::RealRectangle3D rectangle3DFromB3DRectangle( const ::basegfx::B3DRange& ); - ::com::sun::star::geometry::IntegerSize2D integerSize2DFromB2ISize( const ::basegfx::B2IVector& ); - ::com::sun::star::geometry::IntegerPoint2D integerPoint2DFromB2IPoint( const ::basegfx::B2IPoint& ); - ::com::sun::star::geometry::IntegerRectangle2D integerRectangle2DFromB2IRectangle( const ::basegfx::B2IRange& ); + ::basegfx::B2DVector b2DSizeFromRealSize2D( const ::com::sun::star::geometry::RealSize2D& ); + ::basegfx::B2DPoint b2DPointFromRealPoint2D( const ::com::sun::star::geometry::RealPoint2D& ); + ::basegfx::B2DRange b2DRectangleFromRealRectangle2D( const ::com::sun::star::geometry::RealRectangle2D& ); + ::basegfx::B3DRange b3DRectangleFromRealRectangle3D( const ::com::sun::star::geometry::RealRectangle3D& ); - ::basegfx::B2IVector b2ISizeFromIntegerSize2D( const ::com::sun::star::geometry::IntegerSize2D& ); - ::basegfx::B2IPoint b2IPointFromIntegerPoint2D( const ::com::sun::star::geometry::IntegerPoint2D& ); - ::basegfx::B2IRange b2IRectangleFromIntegerRectangle2D( const ::com::sun::star::geometry::IntegerRectangle2D& ); + ::com::sun::star::geometry::IntegerSize2D integerSize2DFromB2ISize( const ::basegfx::B2IVector& ); + ::com::sun::star::geometry::IntegerPoint2D integerPoint2DFromB2IPoint( const ::basegfx::B2IPoint& ); + ::com::sun::star::geometry::IntegerRectangle2D integerRectangle2DFromB2IRectangle( const ::basegfx::B2IRange& ); - ::com::sun::star::awt::Size awtSizeFromB2ISize( const ::basegfx::B2IVector& ); - ::com::sun::star::awt::Point awtPointFromB2IPoint( const ::basegfx::B2IPoint& ); - ::com::sun::star::awt::Rectangle awtRectangleFromB2IRectangle( const ::basegfx::B2IRange& ); + ::basegfx::B2IVector b2ISizeFromIntegerSize2D( const ::com::sun::star::geometry::IntegerSize2D& ); + ::basegfx::B2IPoint b2IPointFromIntegerPoint2D( const ::com::sun::star::geometry::IntegerPoint2D& ); + ::basegfx::B2IRange b2IRectangleFromIntegerRectangle2D( const ::com::sun::star::geometry::IntegerRectangle2D& ); + + ::com::sun::star::awt::Size awtSizeFromB2ISize( const ::basegfx::B2IVector& ); + ::com::sun::star::awt::Point awtPointFromB2IPoint( const ::basegfx::B2IPoint& ); + ::com::sun::star::awt::Rectangle awtRectangleFromB2IRectangle( const ::basegfx::B2IRange& ); - ::basegfx::B2IVector b2ISizeFromAwtSize( const ::com::sun::star::awt::Size& ); - ::basegfx::B2IPoint b2IPointFromAwtPoint( const ::com::sun::star::awt::Point& ); - ::basegfx::B2IRange b2IRectangleFromAwtRectangle( const ::com::sun::star::awt::Rectangle& ); + ::basegfx::B2IVector b2ISizeFromAwtSize( const ::com::sun::star::awt::Size& ); + ::basegfx::B2IPoint b2IPointFromAwtPoint( const ::com::sun::star::awt::Point& ); + ::basegfx::B2IRange b2IRectangleFromAwtRectangle( const ::com::sun::star::awt::Rectangle& ); // Geometry comparisons // =================================================================== @@ -203,8 +203,8 @@ namespace basegfx @return the closest integer range, which completely contains rRange. */ - ::basegfx::B2IRange b2ISurroundingRangeFromB2DRange( const ::basegfx::B2DRange& rRange ); - + ::basegfx::B2IRange b2ISurroundingRangeFromB2DRange( const ::basegfx::B2DRange& rRange ); + /** Return smalltest B2DRange with integer values, which completely contains given floating point range. @@ -214,8 +214,8 @@ namespace basegfx @return the closest B2DRange with integer coordinates, which completely contains rRange. */ - ::basegfx::B2DRange b2DSurroundingIntegerRangeFromB2DRange( const ::basegfx::B2DRange& rRange ); - + ::basegfx::B2DRange b2DSurroundingIntegerRangeFromB2DRange( const ::basegfx::B2DRange& rRange ); + } } diff --git a/basegfx/inc/basegfx/tools/debugplotter.hxx b/basegfx/inc/basegfx/tools/debugplotter.hxx index 0a0f4d5bafa4..c1718f9ab1a4 100644 --- a/basegfx/inc/basegfx/tools/debugplotter.hxx +++ b/basegfx/inc/basegfx/tools/debugplotter.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -35,7 +35,7 @@ #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolypolygon.hxx> #include <rtl/string.hxx> -#include <boost/utility.hpp> // for noncopyable +#include <boost/utility.hpp> // for noncopyable #include <vector> #include <utility> #include <iosfwd> @@ -60,48 +60,48 @@ namespace basegfx public: /** Create new debug output object - @param pTitle + @param pTitle Title of the debug output, will appear in trace output */ explicit DebugPlotter( const sal_Char* pTitle ); /** Create new debug output object - @param pTitle + @param pTitle Title of the debug output, will appear in trace output @param rOutputStream Stream to write output to. Must stay valid over the lifetime of this object! - */ + */ DebugPlotter( const sal_Char* pTitle, ::std::ostream& rOutputStream ); ~DebugPlotter(); - void plot( const B2DPoint& rPoint, - const sal_Char* pTitle ); - void plot( const B2DVector& rVec, - const sal_Char* pTitle ); - void plot( const B2DCubicBezier& rBezier, - const sal_Char* pTitle ); - void plot( const B2DRange& rRange, - const sal_Char* pTitle ); - void plot( const B2DPolygon& rPoly, - const sal_Char* pTitle ); - void plot( const B2DPolyPolygon& rPoly, - const sal_Char* pTitle ); + void plot( const B2DPoint& rPoint, + const sal_Char* pTitle ); + void plot( const B2DVector& rVec, + const sal_Char* pTitle ); + void plot( const B2DCubicBezier& rBezier, + const sal_Char* pTitle ); + void plot( const B2DRange& rRange, + const sal_Char* pTitle ); + void plot( const B2DPolygon& rPoly, + const sal_Char* pTitle ); + void plot( const B2DPolyPolygon& rPoly, + const sal_Char* pTitle ); private: void print( const sal_Char* ); - ::rtl::OString maTitle; - ::std::vector< ::std::pair< B2DPoint, ::rtl::OString > > maPoints; - ::std::vector< ::std::pair< B2DVector, ::rtl::OString > > maVectors; - ::std::vector< ::std::pair< B2DRange, ::rtl::OString > > maRanges; - ::std::vector< ::std::pair< B2DPolygon, ::rtl::OString > > maPolygons; + ::rtl::OString maTitle; + ::std::vector< ::std::pair< B2DPoint, ::rtl::OString > > maPoints; + ::std::vector< ::std::pair< B2DVector, ::rtl::OString > > maVectors; + ::std::vector< ::std::pair< B2DRange, ::rtl::OString > > maRanges; + ::std::vector< ::std::pair< B2DPolygon, ::rtl::OString > > maPolygons; - ::std::ostream* mpOutputStream; + ::std::ostream* mpOutputStream; }; } diff --git a/basegfx/inc/basegfx/tools/gradienttools.hxx b/basegfx/inc/basegfx/tools/gradienttools.hxx index dea18fe67565..a84d6f8cc1ba 100644 --- a/basegfx/inc/basegfx/tools/gradienttools.hxx +++ b/basegfx/inc/basegfx/tools/gradienttools.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -99,11 +99,11 @@ namespace basegfx Gradient angle (from ODF) */ ODFGradientInfo& createLinearODFGradientInfo(ODFGradientInfo& o_rGradientInfo, - const B2DRange& rTargetArea, - sal_uInt32 nSteps, - double fBorder, + const B2DRange& rTargetArea, + sal_uInt32 nSteps, + double fBorder, double fAngle); - + /** Calculate linear gradient blend value This method generates you the lerp alpha value for @@ -158,9 +158,9 @@ namespace basegfx Gradient angle (from ODF) */ ODFGradientInfo& createAxialODFGradientInfo(ODFGradientInfo& o_rGradientInfo, - const B2DRange& rTargetArea, - sal_uInt32 nSteps, - double fBorder, + const B2DRange& rTargetArea, + sal_uInt32 nSteps, + double fBorder, double fAngle); /** Calculate axial gradient blend value @@ -189,7 +189,7 @@ namespace basegfx return t; } - + /** Create matrix for ODF's radial gradient definition @param o_rGradientInfo @@ -213,11 +213,11 @@ namespace basegfx Gradient angle (from ODF) */ ODFGradientInfo& createRadialODFGradientInfo(ODFGradientInfo& o_rGradientInfo, - const B2DRange& rTargetArea, + const B2DRange& rTargetArea, const B2DVector& rOffset, - sal_uInt32 nSteps, + sal_uInt32 nSteps, double fBorder); - + /** Calculate radial gradient blend value This method generates you the lerp alpha value for @@ -272,10 +272,10 @@ namespace basegfx Gradient angle (from ODF) */ ODFGradientInfo& createEllipticalODFGradientInfo(ODFGradientInfo& o_rGradientInfo, - const B2DRange& rTargetArea, + const B2DRange& rTargetArea, const B2DVector& rOffset, - sal_uInt32 nSteps, - double fBorder, + sal_uInt32 nSteps, + double fBorder, double fAngle); /** Calculate elliptical gradient blend value @@ -320,10 +320,10 @@ namespace basegfx Gradient angle (from ODF) */ ODFGradientInfo& createSquareODFGradientInfo(ODFGradientInfo& o_rGradientInfo, - const B2DRange& rTargetArea, + const B2DRange& rTargetArea, const B2DVector& rOffset, - sal_uInt32 nSteps, - double fBorder, + sal_uInt32 nSteps, + double fBorder, double fAngle); /** Calculate square gradient blend value @@ -381,10 +381,10 @@ namespace basegfx Gradient angle (from ODF) */ ODFGradientInfo& createRectangularODFGradientInfo(ODFGradientInfo& o_rGradientInfo, - const B2DRange& rTargetArea, + const B2DRange& rTargetArea, const B2DVector& rOffset, - sal_uInt32 nSteps, - double fBorder, + sal_uInt32 nSteps, + double fBorder, double fAngle); /** Calculate rectangular gradient blend value diff --git a/basegfx/inc/basegfx/tools/keystoplerp.hxx b/basegfx/inc/basegfx/tools/keystoplerp.hxx index 1762e09a60ef..a8d22931193f 100644 --- a/basegfx/inc/basegfx/tools/keystoplerp.hxx +++ b/basegfx/inc/basegfx/tools/keystoplerp.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/basegfx/inc/basegfx/tools/lerp.hxx b/basegfx/inc/basegfx/tools/lerp.hxx index dd513400835b..8147b763944c 100644 --- a/basegfx/inc/basegfx/tools/lerp.hxx +++ b/basegfx/inc/basegfx/tools/lerp.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -47,11 +47,11 @@ namespace basegfx @param t As usual, t must be in the [0,1] range */ - template< typename ValueType > ValueType lerp( const ValueType& rFrom, - const ValueType& rTo, - double t ) + template< typename ValueType > ValueType lerp( const ValueType& rFrom, + const ValueType& rTo, + double t ) { - // This is only to suppress a double->int warning. All other + // This is only to suppress a double->int warning. All other // types should be okay here. return static_cast<ValueType>( (1.0-t)*rFrom + t*rTo ); } diff --git a/basegfx/inc/basegfx/tools/rectcliptools.hxx b/basegfx/inc/basegfx/tools/rectcliptools.hxx index 7e2ff80876ca..18bd6c57ec2c 100644 --- a/basegfx/inc/basegfx/tools/rectcliptools.hxx +++ b/basegfx/inc/basegfx/tools/rectcliptools.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -37,7 +37,7 @@ namespace basegfx { namespace tools { - namespace RectClipFlags + namespace RectClipFlags { static const sal_uInt32 LEFT = (sal_Int32)0x01; static const sal_uInt32 RIGHT = (sal_Int32)0x02; @@ -53,9 +53,9 @@ namespace basegfx outside one or more of the four half planes defining the rectangle (see RectClipFlags for possible values) */ - template< class Point, class Rect > inline + template< class Point, class Rect > inline sal_uInt32 getCohenSutherlandClipFlags( const Point& rP, - const Rect& rR ) + const Rect& rR ) { // maxY | minY | maxX | minX sal_uInt32 clip = (rP.getX() < rR.getMinX()) << 0; diff --git a/basegfx/inc/basegfx/tools/tools.hxx b/basegfx/inc/basegfx/tools/tools.hxx index 8b519e0b1371..888dd319b37d 100644 --- a/basegfx/inc/basegfx/tools/tools.hxx +++ b/basegfx/inc/basegfx/tools/tools.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -43,7 +43,7 @@ namespace basegfx This function clips a line given by two points against the given rectangle. The resulting line is returned in the given points. - + @param io_rStart Start point of the line. On return, contains the clipped start point. @@ -58,9 +58,9 @@ namespace basegfx @return true, when at least part of the line is visible after the clip, false otherwise */ - bool liangBarskyClip2D( ::basegfx::B2DPoint& io_rStart, - ::basegfx::B2DPoint& io_rEnd, - const ::basegfx::B2DRange& rClipRect ); + bool liangBarskyClip2D( ::basegfx::B2DPoint& io_rStart, + ::basegfx::B2DPoint& io_rEnd, + const ::basegfx::B2DRange& rClipRect ); /** Expand given parallelogram, such that it extends beyond bound rect in a given direction. @@ -120,11 +120,11 @@ namespace basegfx @param rFitTarget The rectangle to fit the parallelogram into. */ - void infiniteLineFromParallelogram( ::basegfx::B2DPoint& io_rLeftTop, - ::basegfx::B2DPoint& io_rLeftBottom, - ::basegfx::B2DPoint& io_rRightTop, - ::basegfx::B2DPoint& io_rRightBottom, - const ::basegfx::B2DRange& rFitTarget ); + void infiniteLineFromParallelogram( ::basegfx::B2DPoint& io_rLeftTop, + ::basegfx::B2DPoint& io_rLeftBottom, + ::basegfx::B2DPoint& io_rRightTop, + ::basegfx::B2DPoint& io_rRightBottom, + const ::basegfx::B2DRange& rFitTarget ); } } diff --git a/basegfx/inc/basegfx/tools/unopolypolygon.hxx b/basegfx/inc/basegfx/tools/unopolypolygon.hxx index a5bc22b2d5bb..95282f5f1a84 100644 --- a/basegfx/inc/basegfx/tools/unopolypolygon.hxx +++ b/basegfx/inc/basegfx/tools/unopolypolygon.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -39,10 +39,10 @@ namespace basegfx -{ +{ namespace unotools { - typedef ::cppu::WeakComponentImplHelper3< + typedef ::cppu::WeakComponentImplHelper3< ::com::sun::star::rendering::XLinePolyPolygon2D, ::com::sun::star::rendering::XBezierPolyPolygon2D, ::com::sun::star::lang::XServiceInfo > UnoPolyPolygonBase; @@ -89,9 +89,9 @@ namespace unotools throw ::com::sun::star::lang::IndexOutOfBoundsException(); } - B2DPolyPolygon getSubsetPolyPolygon( sal_Int32 nPolygonIndex, - sal_Int32 nNumberOfPolygons, - sal_Int32 nPointIndex, + B2DPolyPolygon getSubsetPolyPolygon( sal_Int32 nPolygonIndex, + sal_Int32 nNumberOfPolygons, + sal_Int32 nPointIndex, sal_Int32 nNumberOfPoints ) const; /// Get cow copy of internal polygon. not thread-safe outside this object. diff --git a/basegfx/inc/basegfx/tuple/b2dtuple.hxx b/basegfx/inc/basegfx/tuple/b2dtuple.hxx index 6a4ab1e32f9d..d8c1eb16630f 100644 --- a/basegfx/inc/basegfx/tuple/b2dtuple.hxx +++ b/basegfx/inc/basegfx/tuple/b2dtuple.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -48,64 +48,64 @@ namespace basegfx class B2DTuple { protected: - double mfX; - double mfY; - - public: - /** Create a 2D Tuple + double mfX; + double mfY; + + public: + /** Create a 2D Tuple The tuple is initialized to (0.0, 0.0) */ - B2DTuple() - : mfX(0.0), - mfY(0.0) + B2DTuple() + : mfX(0.0), + mfY(0.0) {} - /** Create a 2D Tuple + /** Create a 2D Tuple @param fX This parameter is used to initialize the X-coordinate of the 2D Tuple. - + @param fY This parameter is used to initialize the Y-coordinate of the 2D Tuple. */ - B2DTuple(double fX, double fY) - : mfX( fX ), - mfY( fY ) + B2DTuple(double fX, double fY) + : mfX( fX ), + mfY( fY ) {} - /** Create a copy of a 2D Tuple + /** Create a copy of a 2D Tuple @param rTup The 2D Tuple which will be copied. */ - B2DTuple(const B2DTuple& rTup) - : mfX( rTup.mfX ), - mfY( rTup.mfY ) + B2DTuple(const B2DTuple& rTup) + : mfX( rTup.mfX ), + mfY( rTup.mfY ) {} - /** Create a copy of a 2D integer Tuple + /** Create a copy of a 2D integer Tuple @param rTup The 2D Tuple which will be copied. */ explicit B2DTuple(const B2ITuple& rTup); - ~B2DTuple() + ~B2DTuple() {} /// Get X-Coordinate of 2D Tuple double getX() const - { - return mfX; + { + return mfX; } /// Get Y-Coordinate of 2D Tuple double getY() const - { - return mfY; + { + return mfY; } /// Set X-Coordinate of 2D Tuple @@ -121,8 +121,8 @@ namespace basegfx } /// Array-access to 2D Tuple - const double& operator[] (int nPos) const - { + const double& operator[] (int nPos) const + { // Here, normally one if(...) should be used. In the assumption that // both double members can be accessed as an array a shortcut is used here. // if(0 == nPos) return mfX; return mfY; @@ -131,7 +131,7 @@ namespace basegfx /// Array-access to 2D Tuple double& operator[] (int nPos) - { + { // Here, normally one if(...) should be used. In the assumption that // both double members can be accessed as an array a shortcut is used here. // if(0 == nPos) return mfX; return mfY; @@ -142,99 +142,99 @@ namespace basegfx ////////////////////////////////////////////////////////////////////// bool equalZero() const - { - return (this == &getEmptyTuple() || + { + return (this == &getEmptyTuple() || (fTools::equalZero(mfX) && fTools::equalZero(mfY))); } bool equalZero(const double& rfSmallValue) const - { - return (this == &getEmptyTuple() || + { + return (this == &getEmptyTuple() || (fTools::equalZero(mfX, rfSmallValue) && fTools::equalZero(mfY, rfSmallValue))); } bool equal(const B2DTuple& rTup) const - { + { return ( this == &rTup || - (fTools::equal(mfX, rTup.mfX) && + (fTools::equal(mfX, rTup.mfX) && fTools::equal(mfY, rTup.mfY))); } bool equal(const B2DTuple& rTup, const double& rfSmallValue) const - { + { return ( this == &rTup || - (fTools::equal(mfX, rTup.mfX, rfSmallValue) && + (fTools::equal(mfX, rTup.mfX, rfSmallValue) && fTools::equal(mfY, rTup.mfY, rfSmallValue))); } // operators ////////////////////////////////////////////////////////////////////// - B2DTuple& operator+=( const B2DTuple& rTup ) - { + B2DTuple& operator+=( const B2DTuple& rTup ) + { mfX += rTup.mfX; - mfY += rTup.mfY; - return *this; + mfY += rTup.mfY; + return *this; } - B2DTuple& operator-=( const B2DTuple& rTup ) - { + B2DTuple& operator-=( const B2DTuple& rTup ) + { mfX -= rTup.mfX; - mfY -= rTup.mfY; - return *this; + mfY -= rTup.mfY; + return *this; } - B2DTuple& operator/=( const B2DTuple& rTup ) - { + B2DTuple& operator/=( const B2DTuple& rTup ) + { mfX /= rTup.mfX; - mfY /= rTup.mfY; - return *this; + mfY /= rTup.mfY; + return *this; } - B2DTuple& operator*=( const B2DTuple& rTup ) - { + B2DTuple& operator*=( const B2DTuple& rTup ) + { mfX *= rTup.mfX; - mfY *= rTup.mfY; - return *this; + mfY *= rTup.mfY; + return *this; } - B2DTuple& operator*=(double t) - { - mfX *= t; - mfY *= t; - return *this; + B2DTuple& operator*=(double t) + { + mfX *= t; + mfY *= t; + return *this; } - B2DTuple& operator/=(double t) - { + B2DTuple& operator/=(double t) + { const double fVal(1.0 / t); - mfX *= fVal; - mfY *= fVal; - return *this; + mfX *= fVal; + mfY *= fVal; + return *this; } - B2DTuple operator-(void) const - { - return B2DTuple(-mfX, -mfY); + B2DTuple operator-(void) const + { + return B2DTuple(-mfX, -mfY); } - - bool operator==( const B2DTuple& rTup ) const - { + + bool operator==( const B2DTuple& rTup ) const + { return equal(rTup); } - bool operator!=( const B2DTuple& rTup ) const - { + bool operator!=( const B2DTuple& rTup ) const + { return !equal(rTup); } - - B2DTuple& operator=( const B2DTuple& rTup ) - { + + B2DTuple& operator=( const B2DTuple& rTup ) + { mfX = rTup.mfX; - mfY = rTup.mfY; - return *this; + mfY = rTup.mfY; + return *this; } void correctValues(const double fCompareValue = 0.0); @@ -245,109 +245,109 @@ namespace basegfx // external operators ////////////////////////////////////////////////////////////////////////// - inline B2DTuple minimum(const B2DTuple& rTupA, const B2DTuple& rTupB) - { + inline B2DTuple minimum(const B2DTuple& rTupA, const B2DTuple& rTupB) + { B2DTuple aMin( (rTupB.getX() < rTupA.getX()) ? rTupB.getX() : rTupA.getX(), - (rTupB.getY() < rTupA.getY()) ? rTupB.getY() : rTupA.getY()); + (rTupB.getY() < rTupA.getY()) ? rTupB.getY() : rTupA.getY()); return aMin; } - inline B2DTuple maximum(const B2DTuple& rTupA, const B2DTuple& rTupB) - { + inline B2DTuple maximum(const B2DTuple& rTupA, const B2DTuple& rTupB) + { B2DTuple aMax( (rTupB.getX() > rTupA.getX()) ? rTupB.getX() : rTupA.getX(), - (rTupB.getY() > rTupA.getY()) ? rTupB.getY() : rTupA.getY()); + (rTupB.getY() > rTupA.getY()) ? rTupB.getY() : rTupA.getY()); return aMax; } - inline B2DTuple absolute(const B2DTuple& rTup) - { + inline B2DTuple absolute(const B2DTuple& rTup) + { B2DTuple aAbs( (0.0 > rTup.getX()) ? -rTup.getX() : rTup.getX(), - (0.0 > rTup.getY()) ? -rTup.getY() : rTup.getY()); + (0.0 > rTup.getY()) ? -rTup.getY() : rTup.getY()); return aAbs; } - inline B2DTuple interpolate(const B2DTuple& rOld1, const B2DTuple& rOld2, double t) - { + inline B2DTuple interpolate(const B2DTuple& rOld1, const B2DTuple& rOld2, double t) + { B2DTuple aInt( ((rOld2.getX() - rOld1.getX()) * t) + rOld1.getX(), - ((rOld2.getY() - rOld1.getY()) * t) + rOld1.getY()); + ((rOld2.getY() - rOld1.getY()) * t) + rOld1.getY()); return aInt; } - inline B2DTuple average(const B2DTuple& rOld1, const B2DTuple& rOld2) - { + inline B2DTuple average(const B2DTuple& rOld1, const B2DTuple& rOld2) + { B2DTuple aAvg( (rOld1.getX() + rOld2.getX()) * 0.5, - (rOld1.getY() + rOld2.getY()) * 0.5); + (rOld1.getY() + rOld2.getY()) * 0.5); return aAvg; } - + inline B2DTuple average(const B2DTuple& rOld1, const B2DTuple& rOld2, const B2DTuple& rOld3) - { + { B2DTuple aAvg( (rOld1.getX() + rOld2.getX() + rOld3.getX()) * (1.0 / 3.0), - (rOld1.getY() + rOld2.getY() + rOld3.getY()) * (1.0 / 3.0)); + (rOld1.getY() + rOld2.getY() + rOld3.getY()) * (1.0 / 3.0)); return aAvg; } inline B2DTuple operator+(const B2DTuple& rTupA, const B2DTuple& rTupB) - { - B2DTuple aSum(rTupA); - aSum += rTupB; - return aSum; + { + B2DTuple aSum(rTupA); + aSum += rTupB; + return aSum; } inline B2DTuple operator-(const B2DTuple& rTupA, const B2DTuple& rTupB) - { - B2DTuple aSub(rTupA); - aSub -= rTupB; - return aSub; + { + B2DTuple aSub(rTupA); + aSub -= rTupB; + return aSub; } inline B2DTuple operator/(const B2DTuple& rTupA, const B2DTuple& rTupB) - { - B2DTuple aDiv(rTupA); - aDiv /= rTupB; - return aDiv; + { + B2DTuple aDiv(rTupA); + aDiv /= rTupB; + return aDiv; } inline B2DTuple operator*(const B2DTuple& rTupA, const B2DTuple& rTupB) - { - B2DTuple aMul(rTupA); - aMul *= rTupB; - return aMul; + { + B2DTuple aMul(rTupA); + aMul *= rTupB; + return aMul; } inline B2DTuple operator*(const B2DTuple& rTup, double t) - { - B2DTuple aNew(rTup); - aNew *= t; - return aNew; + { + B2DTuple aNew(rTup); + aNew *= t; + return aNew; } inline B2DTuple operator*(double t, const B2DTuple& rTup) - { - B2DTuple aNew(rTup); - aNew *= t; - return aNew; + { + B2DTuple aNew(rTup); + aNew *= t; + return aNew; } inline B2DTuple operator/(const B2DTuple& rTup, double t) - { - B2DTuple aNew(rTup); - aNew /= t; - return aNew; + { + B2DTuple aNew(rTup); + aNew /= t; + return aNew; } inline B2DTuple operator/(double t, const B2DTuple& rTup) { - B2DTuple aNew(t, t); - B2DTuple aTmp(rTup); - aNew /= aTmp; - return aNew; + B2DTuple aNew(t, t); + B2DTuple aTmp(rTup); + aNew /= aTmp; + return aNew; } /** Round double to nearest integer for 2D tuple diff --git a/basegfx/inc/basegfx/tuple/b2i64tuple.hxx b/basegfx/inc/basegfx/tuple/b2i64tuple.hxx index a75e13755820..5d78c407b4da 100644 --- a/basegfx/inc/basegfx/tuple/b2i64tuple.hxx +++ b/basegfx/inc/basegfx/tuple/b2i64tuple.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -46,57 +46,57 @@ namespace basegfx class B2I64Tuple { protected: - sal_Int64 mnX; - sal_Int64 mnY; - - public: - /** Create a 2D Tuple + sal_Int64 mnX; + sal_Int64 mnY; + + public: + /** Create a 2D Tuple The tuple is initialized to (0, 0) */ - B2I64Tuple() - : mnX(0), - mnY(0) + B2I64Tuple() + : mnX(0), + mnY(0) {} - /** Create a 2D Tuple + /** Create a 2D Tuple @param fX This parameter is used to initialize the X-coordinate of the 2D Tuple. - + @param fY This parameter is used to initialize the Y-coordinate of the 2D Tuple. */ - B2I64Tuple(sal_Int64 fX, sal_Int64 fY) - : mnX( fX ), - mnY( fY ) + B2I64Tuple(sal_Int64 fX, sal_Int64 fY) + : mnX( fX ), + mnY( fY ) {} - /** Create a copy of a 2D Tuple + /** Create a copy of a 2D Tuple @param rTup The 2D Tuple which will be copied. */ - B2I64Tuple(const B2I64Tuple& rTup) - : mnX( rTup.mnX ), - mnY( rTup.mnY ) + B2I64Tuple(const B2I64Tuple& rTup) + : mnX( rTup.mnX ), + mnY( rTup.mnY ) {} - ~B2I64Tuple() + ~B2I64Tuple() {} /// Get X-Coordinate of 2D Tuple sal_Int64 getX() const - { - return mnX; + { + return mnX; } /// Get Y-Coordinate of 2D Tuple sal_Int64 getY() const - { - return mnY; + { + return mnY; } /// Set X-Coordinate of 2D Tuple @@ -112,8 +112,8 @@ namespace basegfx } /// Array-access to 2D Tuple - const sal_Int64& operator[] (int nPos) const - { + const sal_Int64& operator[] (int nPos) const + { // Here, normally one if(...) should be used. In the assumption that // both sal_Int64 members can be accessed as an array a shortcut is used here. // if(0 == nPos) return mnX; return mnY; @@ -122,7 +122,7 @@ namespace basegfx /// Array-access to 2D Tuple sal_Int64& operator[] (int nPos) - { + { // Here, normally one if(...) should be used. In the assumption that // both sal_Int64 members can be accessed as an array a shortcut is used here. // if(0 == nPos) return mnX; return mnY; @@ -132,70 +132,70 @@ namespace basegfx // operators ////////////////////////////////////////////////////////////////////// - B2I64Tuple& operator+=( const B2I64Tuple& rTup ) - { + B2I64Tuple& operator+=( const B2I64Tuple& rTup ) + { mnX += rTup.mnX; - mnY += rTup.mnY; - return *this; + mnY += rTup.mnY; + return *this; } - B2I64Tuple& operator-=( const B2I64Tuple& rTup ) - { + B2I64Tuple& operator-=( const B2I64Tuple& rTup ) + { mnX -= rTup.mnX; - mnY -= rTup.mnY; - return *this; + mnY -= rTup.mnY; + return *this; } - B2I64Tuple& operator/=( const B2I64Tuple& rTup ) - { + B2I64Tuple& operator/=( const B2I64Tuple& rTup ) + { mnX /= rTup.mnX; - mnY /= rTup.mnY; - return *this; + mnY /= rTup.mnY; + return *this; } - B2I64Tuple& operator*=( const B2I64Tuple& rTup ) - { + B2I64Tuple& operator*=( const B2I64Tuple& rTup ) + { mnX *= rTup.mnX; - mnY *= rTup.mnY; - return *this; + mnY *= rTup.mnY; + return *this; } - B2I64Tuple& operator*=(sal_Int64 t) - { - mnX *= t; - mnY *= t; - return *this; + B2I64Tuple& operator*=(sal_Int64 t) + { + mnX *= t; + mnY *= t; + return *this; } - B2I64Tuple& operator/=(sal_Int64 t) - { - mnX /= t; - mnY /= t; - return *this; + B2I64Tuple& operator/=(sal_Int64 t) + { + mnX /= t; + mnY /= t; + return *this; } - B2I64Tuple operator-(void) const - { - return B2I64Tuple(-mnX, -mnY); + B2I64Tuple operator-(void) const + { + return B2I64Tuple(-mnX, -mnY); } - + bool equalZero() const { return mnX == 0 && mnY == 0; } - bool operator==( const B2I64Tuple& rTup ) const - { + bool operator==( const B2I64Tuple& rTup ) const + { return this == &rTup || (rTup.mnX == mnX && rTup.mnY == mnY); } - bool operator!=( const B2I64Tuple& rTup ) const - { + bool operator!=( const B2I64Tuple& rTup ) const + { return !(*this == rTup); } - - B2I64Tuple& operator=( const B2I64Tuple& rTup ) - { + + B2I64Tuple& operator=( const B2I64Tuple& rTup ) + { mnX = rTup.mnX; - mnY = rTup.mnY; - return *this; + mnY = rTup.mnY; + return *this; } static const B2I64Tuple& getEmptyTuple(); @@ -204,109 +204,109 @@ namespace basegfx // external operators ////////////////////////////////////////////////////////////////////////// - inline B2I64Tuple minimum(const B2I64Tuple& rTupA, const B2I64Tuple& rTupB) - { + inline B2I64Tuple minimum(const B2I64Tuple& rTupA, const B2I64Tuple& rTupB) + { B2I64Tuple aMin( (rTupB.getX() < rTupA.getX()) ? rTupB.getX() : rTupA.getX(), - (rTupB.getY() < rTupA.getY()) ? rTupB.getY() : rTupA.getY()); + (rTupB.getY() < rTupA.getY()) ? rTupB.getY() : rTupA.getY()); return aMin; } - inline B2I64Tuple maximum(const B2I64Tuple& rTupA, const B2I64Tuple& rTupB) - { + inline B2I64Tuple maximum(const B2I64Tuple& rTupA, const B2I64Tuple& rTupB) + { B2I64Tuple aMax( (rTupB.getX() > rTupA.getX()) ? rTupB.getX() : rTupA.getX(), - (rTupB.getY() > rTupA.getY()) ? rTupB.getY() : rTupA.getY()); + (rTupB.getY() > rTupA.getY()) ? rTupB.getY() : rTupA.getY()); return aMax; } - inline B2I64Tuple absolute(const B2I64Tuple& rTup) - { + inline B2I64Tuple absolute(const B2I64Tuple& rTup) + { B2I64Tuple aAbs( (0 > rTup.getX()) ? -rTup.getX() : rTup.getX(), - (0 > rTup.getY()) ? -rTup.getY() : rTup.getY()); + (0 > rTup.getY()) ? -rTup.getY() : rTup.getY()); return aAbs; } - inline B2DTuple interpolate(const B2I64Tuple& rOld1, const B2I64Tuple& rOld2, double t) - { + inline B2DTuple interpolate(const B2I64Tuple& rOld1, const B2I64Tuple& rOld2, double t) + { B2DTuple aInt( ((rOld2.getX() - rOld1.getX()) * t) + rOld1.getX(), - ((rOld2.getY() - rOld1.getY()) * t) + rOld1.getY()); + ((rOld2.getY() - rOld1.getY()) * t) + rOld1.getY()); return aInt; } - inline B2DTuple average(const B2I64Tuple& rOld1, const B2I64Tuple& rOld2) - { + inline B2DTuple average(const B2I64Tuple& rOld1, const B2I64Tuple& rOld2) + { B2DTuple aAvg( (rOld1.getX() + rOld2.getX()) * 0.5, - (rOld1.getY() + rOld2.getY()) * 0.5); + (rOld1.getY() + rOld2.getY()) * 0.5); return aAvg; } - + inline B2DTuple average(const B2I64Tuple& rOld1, const B2I64Tuple& rOld2, const B2I64Tuple& rOld3) - { + { B2DTuple aAvg( (rOld1.getX() + rOld2.getX() + rOld3.getX()) * (1.0 / 3.0), - (rOld1.getY() + rOld2.getY() + rOld3.getY()) * (1.0 / 3.0)); + (rOld1.getY() + rOld2.getY() + rOld3.getY()) * (1.0 / 3.0)); return aAvg; } inline B2I64Tuple operator+(const B2I64Tuple& rTupA, const B2I64Tuple& rTupB) - { - B2I64Tuple aSum(rTupA); - aSum += rTupB; - return aSum; + { + B2I64Tuple aSum(rTupA); + aSum += rTupB; + return aSum; } inline B2I64Tuple operator-(const B2I64Tuple& rTupA, const B2I64Tuple& rTupB) - { - B2I64Tuple aSub(rTupA); - aSub -= rTupB; - return aSub; + { + B2I64Tuple aSub(rTupA); + aSub -= rTupB; + return aSub; } inline B2I64Tuple operator/(const B2I64Tuple& rTupA, const B2I64Tuple& rTupB) - { - B2I64Tuple aDiv(rTupA); - aDiv /= rTupB; - return aDiv; + { + B2I64Tuple aDiv(rTupA); + aDiv /= rTupB; + return aDiv; } inline B2I64Tuple operator*(const B2I64Tuple& rTupA, const B2I64Tuple& rTupB) - { - B2I64Tuple aMul(rTupA); - aMul *= rTupB; - return aMul; + { + B2I64Tuple aMul(rTupA); + aMul *= rTupB; + return aMul; } inline B2I64Tuple operator*(const B2I64Tuple& rTup, sal_Int64 t) - { - B2I64Tuple aNew(rTup); - aNew *= t; - return aNew; + { + B2I64Tuple aNew(rTup); + aNew *= t; + return aNew; } inline B2I64Tuple operator*(sal_Int64 t, const B2I64Tuple& rTup) - { - B2I64Tuple aNew(rTup); - aNew *= t; - return aNew; + { + B2I64Tuple aNew(rTup); + aNew *= t; + return aNew; } inline B2I64Tuple operator/(const B2I64Tuple& rTup, sal_Int64 t) - { - B2I64Tuple aNew(rTup); - aNew /= t; - return aNew; + { + B2I64Tuple aNew(rTup); + aNew /= t; + return aNew; } inline B2I64Tuple operator/(sal_Int64 t, const B2I64Tuple& rTup) { - B2I64Tuple aNew(t, t); - B2I64Tuple aTmp(rTup); - aNew /= aTmp; - return aNew; + B2I64Tuple aNew(t, t); + B2I64Tuple aTmp(rTup); + aNew /= aTmp; + return aNew; } } // end of namespace basegfx diff --git a/basegfx/inc/basegfx/tuple/b2ituple.hxx b/basegfx/inc/basegfx/tuple/b2ituple.hxx index 636862f365b8..2611d386e7d6 100644 --- a/basegfx/inc/basegfx/tuple/b2ituple.hxx +++ b/basegfx/inc/basegfx/tuple/b2ituple.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -45,57 +45,57 @@ namespace basegfx class B2ITuple { protected: - sal_Int32 mnX; - sal_Int32 mnY; - - public: - /** Create a 2D Tuple + sal_Int32 mnX; + sal_Int32 mnY; + + public: + /** Create a 2D Tuple The tuple is initialized to (0, 0) */ - B2ITuple() - : mnX(0), - mnY(0) + B2ITuple() + : mnX(0), + mnY(0) {} - /** Create a 2D Tuple + /** Create a 2D Tuple @param fX This parameter is used to initialize the X-coordinate of the 2D Tuple. - + @param fY This parameter is used to initialize the Y-coordinate of the 2D Tuple. */ - B2ITuple(sal_Int32 fX, sal_Int32 fY) - : mnX( fX ), - mnY( fY ) + B2ITuple(sal_Int32 fX, sal_Int32 fY) + : mnX( fX ), + mnY( fY ) {} - /** Create a copy of a 2D Tuple + /** Create a copy of a 2D Tuple @param rTup The 2D Tuple which will be copied. */ - B2ITuple(const B2ITuple& rTup) - : mnX( rTup.mnX ), - mnY( rTup.mnY ) + B2ITuple(const B2ITuple& rTup) + : mnX( rTup.mnX ), + mnY( rTup.mnY ) {} - ~B2ITuple() + ~B2ITuple() {} /// Get X-Coordinate of 2D Tuple sal_Int32 getX() const - { - return mnX; + { + return mnX; } /// Get Y-Coordinate of 2D Tuple sal_Int32 getY() const - { - return mnY; + { + return mnY; } /// Set X-Coordinate of 2D Tuple @@ -111,8 +111,8 @@ namespace basegfx } /// Array-access to 2D Tuple - const sal_Int32& operator[] (int nPos) const - { + const sal_Int32& operator[] (int nPos) const + { // Here, normally one if(...) should be used. In the assumption that // both sal_Int32 members can be accessed as an array a shortcut is used here. // if(0 == nPos) return mnX; return mnY; @@ -121,7 +121,7 @@ namespace basegfx /// Array-access to 2D Tuple sal_Int32& operator[] (int nPos) - { + { // Here, normally one if(...) should be used. In the assumption that // both sal_Int32 members can be accessed as an array a shortcut is used here. // if(0 == nPos) return mnX; return mnY; @@ -131,70 +131,70 @@ namespace basegfx // operators ////////////////////////////////////////////////////////////////////// - B2ITuple& operator+=( const B2ITuple& rTup ) - { + B2ITuple& operator+=( const B2ITuple& rTup ) + { mnX += rTup.mnX; - mnY += rTup.mnY; - return *this; + mnY += rTup.mnY; + return *this; } - B2ITuple& operator-=( const B2ITuple& rTup ) - { + B2ITuple& operator-=( const B2ITuple& rTup ) + { mnX -= rTup.mnX; - mnY -= rTup.mnY; - return *this; + mnY -= rTup.mnY; + return *this; } - B2ITuple& operator/=( const B2ITuple& rTup ) - { + B2ITuple& operator/=( const B2ITuple& rTup ) + { mnX /= rTup.mnX; - mnY /= rTup.mnY; - return *this; + mnY /= rTup.mnY; + return *this; } - B2ITuple& operator*=( const B2ITuple& rTup ) - { + B2ITuple& operator*=( const B2ITuple& rTup ) + { mnX *= rTup.mnX; - mnY *= rTup.mnY; - return *this; + mnY *= rTup.mnY; + return *this; } - B2ITuple& operator*=(sal_Int32 t) - { - mnX *= t; - mnY *= t; - return *this; + B2ITuple& operator*=(sal_Int32 t) + { + mnX *= t; + mnY *= t; + return *this; } - B2ITuple& operator/=(sal_Int32 t) - { - mnX /= t; - mnY /= t; - return *this; + B2ITuple& operator/=(sal_Int32 t) + { + mnX /= t; + mnY /= t; + return *this; } - B2ITuple operator-(void) const - { - return B2ITuple(-mnX, -mnY); + B2ITuple operator-(void) const + { + return B2ITuple(-mnX, -mnY); } - + bool equalZero() const { return mnX == 0 && mnY == 0; } - bool operator==( const B2ITuple& rTup ) const - { + bool operator==( const B2ITuple& rTup ) const + { return this == &rTup || (rTup.mnX == mnX && rTup.mnY == mnY); } - bool operator!=( const B2ITuple& rTup ) const - { + bool operator!=( const B2ITuple& rTup ) const + { return !(*this == rTup); } - - B2ITuple& operator=( const B2ITuple& rTup ) - { + + B2ITuple& operator=( const B2ITuple& rTup ) + { mnX = rTup.mnX; - mnY = rTup.mnY; - return *this; + mnY = rTup.mnY; + return *this; } static const B2ITuple& getEmptyTuple(); @@ -205,16 +205,16 @@ namespace basegfx class B2DTuple; - B2ITuple minimum(const B2ITuple& rTupA, const B2ITuple& rTupB); - - B2ITuple maximum(const B2ITuple& rTupA, const B2ITuple& rTupB); + B2ITuple minimum(const B2ITuple& rTupA, const B2ITuple& rTupB); - B2ITuple absolute(const B2ITuple& rTup); + B2ITuple maximum(const B2ITuple& rTupA, const B2ITuple& rTupB); - B2DTuple interpolate(const B2ITuple& rOld1, const B2ITuple& rOld2, double t); + B2ITuple absolute(const B2ITuple& rTup); - B2DTuple average(const B2ITuple& rOld1, const B2ITuple& rOld2); + B2DTuple interpolate(const B2ITuple& rOld1, const B2ITuple& rOld2, double t); + B2DTuple average(const B2ITuple& rOld1, const B2ITuple& rOld2); + B2DTuple average(const B2ITuple& rOld1, const B2ITuple& rOld2, const B2ITuple& rOld3); B2ITuple operator+(const B2ITuple& rTupA, const B2ITuple& rTupB); diff --git a/basegfx/inc/basegfx/tuple/b3dtuple.hxx b/basegfx/inc/basegfx/tuple/b3dtuple.hxx index dd2329f1c4bd..b8d975537dd7 100644 --- a/basegfx/inc/basegfx/tuple/b3dtuple.hxx +++ b/basegfx/inc/basegfx/tuple/b3dtuple.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -48,78 +48,78 @@ namespace basegfx class B3DTuple { protected: - double mfX; - double mfY; - double mfZ; + double mfX; + double mfY; + double mfZ; public: - /** Create a 3D Tuple + /** Create a 3D Tuple The tuple is initialized to (0.0, 0.0, 0.0) */ B3DTuple() - : mfX(0.0), + : mfX(0.0), mfY(0.0), mfZ(0.0) {} - /** Create a 3D Tuple + /** Create a 3D Tuple @param fX This parameter is used to initialize the X-coordinate of the 3D Tuple. - + @param fY This parameter is used to initialize the Y-coordinate of the 3D Tuple. - + @param fZ This parameter is used to initialize the Z-coordinate of the 3D Tuple. */ B3DTuple(double fX, double fY, double fZ) - : mfX(fX), + : mfX(fX), mfY(fY), mfZ(fZ) {} - /** Create a copy of a 3D Tuple + /** Create a copy of a 3D Tuple @param rTup The 3D Tuple which will be copied. */ - B3DTuple(const B3DTuple& rTup) - : mfX( rTup.mfX ), + B3DTuple(const B3DTuple& rTup) + : mfX( rTup.mfX ), mfY( rTup.mfY ), - mfZ( rTup.mfZ ) + mfZ( rTup.mfZ ) {} - /** Create a copy of a 3D integer Tuple + /** Create a copy of a 3D integer Tuple @param rTup The 3D Tuple which will be copied. */ explicit B3DTuple(const B3ITuple& rTup); - ~B3DTuple() + ~B3DTuple() {} /// get X-Coordinate of 3D Tuple double getX() const - { - return mfX; + { + return mfX; } /// get Y-Coordinate of 3D Tuple double getY() const - { - return mfY; + { + return mfY; } /// get Z-Coordinate of 3D Tuple double getZ() const - { - return mfZ; + { + return mfZ; } /// set X-Coordinate of 3D Tuple @@ -141,8 +141,8 @@ namespace basegfx } /// Array-access to 3D Tuple - const double& operator[] (int nPos) const - { + const double& operator[] (int nPos) const + { // Here, normally two if(...)'s should be used. In the assumption that // both double members can be accessed as an array a shortcut is used here. // if(0 == nPos) return mfX; if(1 == nPos) return mfY; return mfZ; @@ -151,7 +151,7 @@ namespace basegfx /// Array-access to 3D Tuple double& operator[] (int nPos) - { + { // Here, normally two if(...)'s should be used. In the assumption that // both double members can be accessed as an array a shortcut is used here. // if(0 == nPos) return mfX; if(1 == nPos) return mfY; return mfZ; @@ -162,26 +162,26 @@ namespace basegfx ////////////////////////////////////////////////////////////////////// bool equalZero() const - { - return (this == &getEmptyTuple() || - (::basegfx::fTools::equalZero(mfX) - && ::basegfx::fTools::equalZero(mfY) + { + return (this == &getEmptyTuple() || + (::basegfx::fTools::equalZero(mfX) + && ::basegfx::fTools::equalZero(mfY) && ::basegfx::fTools::equalZero(mfZ))); } bool equalZero(const double& rfSmallValue) const - { - return (this == &getEmptyTuple() || - (::basegfx::fTools::equalZero(mfX, rfSmallValue) + { + return (this == &getEmptyTuple() || + (::basegfx::fTools::equalZero(mfX, rfSmallValue) && ::basegfx::fTools::equalZero(mfY, rfSmallValue) && ::basegfx::fTools::equalZero(mfZ, rfSmallValue))); } bool equal(const B3DTuple& rTup) const - { + { return ( this == &rTup || - (::basegfx::fTools::equal(mfX, rTup.mfX) && + (::basegfx::fTools::equal(mfX, rTup.mfX) && ::basegfx::fTools::equal(mfY, rTup.mfY) && ::basegfx::fTools::equal(mfZ, rTup.mfZ))); } @@ -190,84 +190,84 @@ namespace basegfx { return ( this == &rTup || - (::basegfx::fTools::equal(mfX, rTup.mfX, rfSmallValue) && - ::basegfx::fTools::equal(mfY, rTup.mfY, rfSmallValue) && + (::basegfx::fTools::equal(mfX, rTup.mfX, rfSmallValue) && + ::basegfx::fTools::equal(mfY, rTup.mfY, rfSmallValue) && ::basegfx::fTools::equal(mfZ, rTup.mfZ, rfSmallValue))); } // operators ////////////////////////////////////////////////////////////////////// - B3DTuple& operator+=( const B3DTuple& rTup ) - { + B3DTuple& operator+=( const B3DTuple& rTup ) + { mfX += rTup.mfX; - mfY += rTup.mfY; - mfZ += rTup.mfZ; - return *this; + mfY += rTup.mfY; + mfZ += rTup.mfZ; + return *this; } - B3DTuple& operator-=( const B3DTuple& rTup ) - { + B3DTuple& operator-=( const B3DTuple& rTup ) + { mfX -= rTup.mfX; - mfY -= rTup.mfY; - mfZ -= rTup.mfZ; - return *this; + mfY -= rTup.mfY; + mfZ -= rTup.mfZ; + return *this; } - B3DTuple& operator/=( const B3DTuple& rTup ) - { + B3DTuple& operator/=( const B3DTuple& rTup ) + { mfX /= rTup.mfX; - mfY /= rTup.mfY; - mfZ /= rTup.mfZ; - return *this; + mfY /= rTup.mfY; + mfZ /= rTup.mfZ; + return *this; } - B3DTuple& operator*=( const B3DTuple& rTup ) - { + B3DTuple& operator*=( const B3DTuple& rTup ) + { mfX *= rTup.mfX; - mfY *= rTup.mfY; - mfZ *= rTup.mfZ; - return *this; + mfY *= rTup.mfY; + mfZ *= rTup.mfZ; + return *this; } - B3DTuple& operator*=(double t) - { - mfX *= t; - mfY *= t; - mfZ *= t; - return *this; + B3DTuple& operator*=(double t) + { + mfX *= t; + mfY *= t; + mfZ *= t; + return *this; } - B3DTuple& operator/=(double t) - { + B3DTuple& operator/=(double t) + { const double fVal(1.0 / t); - mfX *= fVal; - mfY *= fVal; - mfZ *= fVal; - return *this; + mfX *= fVal; + mfY *= fVal; + mfZ *= fVal; + return *this; } - B3DTuple operator-(void) const - { - return B3DTuple(-mfX, -mfY, -mfZ); + B3DTuple operator-(void) const + { + return B3DTuple(-mfX, -mfY, -mfZ); } - bool operator==( const B3DTuple& rTup ) const - { + bool operator==( const B3DTuple& rTup ) const + { return equal(rTup); } - bool operator!=( const B3DTuple& rTup ) const - { + bool operator!=( const B3DTuple& rTup ) const + { return !equal(rTup); } - - B3DTuple& operator=( const B3DTuple& rTup ) - { + + B3DTuple& operator=( const B3DTuple& rTup ) + { mfX = rTup.mfX; - mfY = rTup.mfY; - mfZ = rTup.mfZ; - return *this; + mfY = rTup.mfY; + mfZ = rTup.mfZ; + return *this; } void correctValues(const double fCompareValue = 0.0) @@ -283,7 +283,7 @@ namespace basegfx { mfY = 0.0; } - + if(::basegfx::fTools::equalZero(mfZ)) { mfZ = 0.0; @@ -295,12 +295,12 @@ namespace basegfx { mfX = fCompareValue; } - + if(::basegfx::fTools::equal(mfY, fCompareValue)) { mfY = fCompareValue; } - + if(::basegfx::fTools::equal(mfZ, fCompareValue)) { mfZ = fCompareValue; @@ -314,114 +314,114 @@ namespace basegfx // external operators ////////////////////////////////////////////////////////////////////////// - inline B3DTuple minimum(const B3DTuple& rTupA, const B3DTuple& rTupB) - { + inline B3DTuple minimum(const B3DTuple& rTupA, const B3DTuple& rTupB) + { B3DTuple aMin( (rTupB.getX() < rTupA.getX()) ? rTupB.getX() : rTupA.getX(), (rTupB.getY() < rTupA.getY()) ? rTupB.getY() : rTupA.getY(), - (rTupB.getZ() < rTupA.getZ()) ? rTupB.getZ() : rTupA.getZ()); + (rTupB.getZ() < rTupA.getZ()) ? rTupB.getZ() : rTupA.getZ()); return aMin; } - inline B3DTuple maximum(const B3DTuple& rTupA, const B3DTuple& rTupB) - { + inline B3DTuple maximum(const B3DTuple& rTupA, const B3DTuple& rTupB) + { B3DTuple aMax( (rTupB.getX() > rTupA.getX()) ? rTupB.getX() : rTupA.getX(), (rTupB.getY() > rTupA.getY()) ? rTupB.getY() : rTupA.getY(), - (rTupB.getZ() > rTupA.getZ()) ? rTupB.getZ() : rTupA.getZ()); + (rTupB.getZ() > rTupA.getZ()) ? rTupB.getZ() : rTupA.getZ()); return aMax; } - inline B3DTuple absolute(const B3DTuple& rTup) - { + inline B3DTuple absolute(const B3DTuple& rTup) + { B3DTuple aAbs( (0.0 > rTup.getX()) ? -rTup.getX() : rTup.getX(), (0.0 > rTup.getY()) ? -rTup.getY() : rTup.getY(), - (0.0 > rTup.getZ()) ? -rTup.getZ() : rTup.getZ()); + (0.0 > rTup.getZ()) ? -rTup.getZ() : rTup.getZ()); return aAbs; } - inline B3DTuple interpolate(const B3DTuple& rOld1, const B3DTuple& rOld2, double t) - { + inline B3DTuple interpolate(const B3DTuple& rOld1, const B3DTuple& rOld2, double t) + { B3DTuple aInt( ((rOld2.getX() - rOld1.getX()) * t) + rOld1.getX(), ((rOld2.getY() - rOld1.getY()) * t) + rOld1.getY(), - ((rOld2.getZ() - rOld1.getZ()) * t) + rOld1.getZ()); + ((rOld2.getZ() - rOld1.getZ()) * t) + rOld1.getZ()); return aInt; } - inline B3DTuple average(const B3DTuple& rOld1, const B3DTuple& rOld2) - { + inline B3DTuple average(const B3DTuple& rOld1, const B3DTuple& rOld2) + { B3DTuple aAvg( (rOld1.getX() + rOld2.getX()) * 0.5, (rOld1.getY() + rOld2.getY()) * 0.5, - (rOld1.getZ() + rOld2.getZ()) * 0.5); + (rOld1.getZ() + rOld2.getZ()) * 0.5); return aAvg; } - + inline B3DTuple average(const B3DTuple& rOld1, const B3DTuple& rOld2, const B3DTuple& rOld3) - { + { B3DTuple aAvg( (rOld1.getX() + rOld2.getX() + rOld3.getX()) * (1.0 / 3.0), (rOld1.getY() + rOld2.getY() + rOld3.getY()) * (1.0 / 3.0), - (rOld1.getZ() + rOld2.getZ() + rOld3.getZ()) * (1.0 / 3.0)); + (rOld1.getZ() + rOld2.getZ() + rOld3.getZ()) * (1.0 / 3.0)); return aAvg; } - + inline B3DTuple operator+(const B3DTuple& rTupA, const B3DTuple& rTupB) - { - B3DTuple aSum(rTupA); - aSum += rTupB; - return aSum; + { + B3DTuple aSum(rTupA); + aSum += rTupB; + return aSum; } inline B3DTuple operator-(const B3DTuple& rTupA, const B3DTuple& rTupB) - { - B3DTuple aSub(rTupA); - aSub -= rTupB; - return aSub; + { + B3DTuple aSub(rTupA); + aSub -= rTupB; + return aSub; } inline B3DTuple operator/(const B3DTuple& rTupA, const B3DTuple& rTupB) - { - B3DTuple aDiv(rTupA); - aDiv /= rTupB; - return aDiv; + { + B3DTuple aDiv(rTupA); + aDiv /= rTupB; + return aDiv; } inline B3DTuple operator*(const B3DTuple& rTupA, const B3DTuple& rTupB) - { - B3DTuple aMul(rTupA); - aMul *= rTupB; - return aMul; + { + B3DTuple aMul(rTupA); + aMul *= rTupB; + return aMul; } inline B3DTuple operator*(const B3DTuple& rTup, double t) - { - B3DTuple aNew(rTup); - aNew *= t; - return aNew; + { + B3DTuple aNew(rTup); + aNew *= t; + return aNew; } inline B3DTuple operator*(double t, const B3DTuple& rTup) - { - B3DTuple aNew(rTup); - aNew *= t; - return aNew; + { + B3DTuple aNew(rTup); + aNew *= t; + return aNew; } inline B3DTuple operator/(const B3DTuple& rTup, double t) - { - B3DTuple aNew(rTup); - aNew /= t; - return aNew; + { + B3DTuple aNew(rTup); + aNew /= t; + return aNew; } inline B3DTuple operator/(double t, const B3DTuple& rTup) { - B3DTuple aNew(rTup); - aNew /= t; - return aNew; + B3DTuple aNew(rTup); + aNew /= t; + return aNew; } /** Round double to nearest integer for 3D tuple diff --git a/basegfx/inc/basegfx/tuple/b3i64tuple.hxx b/basegfx/inc/basegfx/tuple/b3i64tuple.hxx index b4b3416ce887..1fd4e1eb3a2c 100644 --- a/basegfx/inc/basegfx/tuple/b3i64tuple.hxx +++ b/basegfx/inc/basegfx/tuple/b3i64tuple.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -46,71 +46,71 @@ namespace basegfx class B3I64Tuple { protected: - sal_Int64 mnX; - sal_Int64 mnY; - sal_Int64 mnZ; + sal_Int64 mnX; + sal_Int64 mnY; + sal_Int64 mnZ; public: - /** Create a 3D Tuple + /** Create a 3D Tuple The tuple is initialized to (0, 0, 0) */ B3I64Tuple() - : mnX(0), + : mnX(0), mnY(0), mnZ(0) {} - /** Create a 3D Tuple + /** Create a 3D Tuple @param nX This parameter is used to initialize the X-coordinate of the 3D Tuple. - + @param nY This parameter is used to initialize the Y-coordinate of the 3D Tuple. - + @param nZ This parameter is used to initialize the Z-coordinate of the 3D Tuple. */ B3I64Tuple(sal_Int64 nX, sal_Int64 nY, sal_Int64 nZ) - : mnX(nX), + : mnX(nX), mnY(nY), mnZ(nZ) {} - /** Create a copy of a 3D Tuple + /** Create a copy of a 3D Tuple @param rTup The 3D Tuple which will be copied. */ - B3I64Tuple(const B3I64Tuple& rTup) - : mnX( rTup.mnX ), + B3I64Tuple(const B3I64Tuple& rTup) + : mnX( rTup.mnX ), mnY( rTup.mnY ), - mnZ( rTup.mnZ ) + mnZ( rTup.mnZ ) {} - ~B3I64Tuple() + ~B3I64Tuple() {} /// get X-Coordinate of 3D Tuple sal_Int64 getX() const - { - return mnX; + { + return mnX; } /// get Y-Coordinate of 3D Tuple sal_Int64 getY() const - { - return mnY; + { + return mnY; } /// get Z-Coordinate of 3D Tuple sal_Int64 getZ() const - { - return mnZ; + { + return mnZ; } /// set X-Coordinate of 3D Tuple @@ -132,8 +132,8 @@ namespace basegfx } /// Array-access to 3D Tuple - const sal_Int64& operator[] (int nPos) const - { + const sal_Int64& operator[] (int nPos) const + { // Here, normally two if(...)'s should be used. In the assumption that // both sal_Int64 members can be accessed as an array a shortcut is used here. // if(0 == nPos) return mnX; if(1 == nPos) return mnY; return mnZ; @@ -142,7 +142,7 @@ namespace basegfx /// Array-access to 3D Tuple sal_Int64& operator[] (int nPos) - { + { // Here, normally two if(...)'s should be used. In the assumption that // both sal_Int64 members can be accessed as an array a shortcut is used here. // if(0 == nPos) return mnX; if(1 == nPos) return mnY; return mnZ; @@ -152,81 +152,81 @@ namespace basegfx // operators ////////////////////////////////////////////////////////////////////// - B3I64Tuple& operator+=( const B3I64Tuple& rTup ) - { + B3I64Tuple& operator+=( const B3I64Tuple& rTup ) + { mnX += rTup.mnX; - mnY += rTup.mnY; - mnZ += rTup.mnZ; - return *this; + mnY += rTup.mnY; + mnZ += rTup.mnZ; + return *this; } - B3I64Tuple& operator-=( const B3I64Tuple& rTup ) - { + B3I64Tuple& operator-=( const B3I64Tuple& rTup ) + { mnX -= rTup.mnX; - mnY -= rTup.mnY; - mnZ -= rTup.mnZ; - return *this; + mnY -= rTup.mnY; + mnZ -= rTup.mnZ; + return *this; } - B3I64Tuple& operator/=( const B3I64Tuple& rTup ) - { + B3I64Tuple& operator/=( const B3I64Tuple& rTup ) + { mnX /= rTup.mnX; - mnY /= rTup.mnY; - mnZ /= rTup.mnZ; - return *this; + mnY /= rTup.mnY; + mnZ /= rTup.mnZ; + return *this; } - B3I64Tuple& operator*=( const B3I64Tuple& rTup ) - { + B3I64Tuple& operator*=( const B3I64Tuple& rTup ) + { mnX *= rTup.mnX; - mnY *= rTup.mnY; - mnZ *= rTup.mnZ; - return *this; + mnY *= rTup.mnY; + mnZ *= rTup.mnZ; + return *this; } - B3I64Tuple& operator*=(sal_Int64 t) - { - mnX *= t; - mnY *= t; - mnZ *= t; - return *this; + B3I64Tuple& operator*=(sal_Int64 t) + { + mnX *= t; + mnY *= t; + mnZ *= t; + return *this; } - B3I64Tuple& operator/=(sal_Int64 t) - { - mnX /= t; - mnY /= t; - mnZ /= t; - return *this; + B3I64Tuple& operator/=(sal_Int64 t) + { + mnX /= t; + mnY /= t; + mnZ /= t; + return *this; } - B3I64Tuple operator-(void) const - { - return B3I64Tuple(-mnX, -mnY, -mnZ); + B3I64Tuple operator-(void) const + { + return B3I64Tuple(-mnX, -mnY, -mnZ); } bool equalZero() const - { - return (this == &getEmptyTuple() || + { + return (this == &getEmptyTuple() || (mnX == 0 && mnY == 0 && mnZ == 0)); } - bool operator==( const B3I64Tuple& rTup ) const - { + bool operator==( const B3I64Tuple& rTup ) const + { return this == &rTup || (rTup.mnX == mnX && rTup.mnY == mnY && rTup.mnZ == mnZ); } - bool operator!=( const B3I64Tuple& rTup ) const - { + bool operator!=( const B3I64Tuple& rTup ) const + { return !(*this == rTup); } - - B3I64Tuple& operator=( const B3I64Tuple& rTup ) - { + + B3I64Tuple& operator=( const B3I64Tuple& rTup ) + { mnX = rTup.mnX; - mnY = rTup.mnY; - mnZ = rTup.mnZ; - return *this; + mnY = rTup.mnY; + mnZ = rTup.mnZ; + return *this; } static const B3I64Tuple& getEmptyTuple(); @@ -235,115 +235,115 @@ namespace basegfx // external operators ////////////////////////////////////////////////////////////////////////// - inline B3I64Tuple minimum(const B3I64Tuple& rTupA, const B3I64Tuple& rTupB) - { + inline B3I64Tuple minimum(const B3I64Tuple& rTupA, const B3I64Tuple& rTupB) + { B3I64Tuple aMin( (rTupB.getX() < rTupA.getX()) ? rTupB.getX() : rTupA.getX(), (rTupB.getY() < rTupA.getY()) ? rTupB.getY() : rTupA.getY(), - (rTupB.getZ() < rTupA.getZ()) ? rTupB.getZ() : rTupA.getZ()); + (rTupB.getZ() < rTupA.getZ()) ? rTupB.getZ() : rTupA.getZ()); return aMin; } - inline B3I64Tuple maximum(const B3I64Tuple& rTupA, const B3I64Tuple& rTupB) - { + inline B3I64Tuple maximum(const B3I64Tuple& rTupA, const B3I64Tuple& rTupB) + { B3I64Tuple aMax( (rTupB.getX() > rTupA.getX()) ? rTupB.getX() : rTupA.getX(), (rTupB.getY() > rTupA.getY()) ? rTupB.getY() : rTupA.getY(), - (rTupB.getZ() > rTupA.getZ()) ? rTupB.getZ() : rTupA.getZ()); + (rTupB.getZ() > rTupA.getZ()) ? rTupB.getZ() : rTupA.getZ()); return aMax; } - inline B3I64Tuple absolute(const B3I64Tuple& rTup) - { + inline B3I64Tuple absolute(const B3I64Tuple& rTup) + { B3I64Tuple aAbs( (0 > rTup.getX()) ? -rTup.getX() : rTup.getX(), (0 > rTup.getY()) ? -rTup.getY() : rTup.getY(), - (0 > rTup.getZ()) ? -rTup.getZ() : rTup.getZ()); + (0 > rTup.getZ()) ? -rTup.getZ() : rTup.getZ()); return aAbs; } - inline B3DTuple interpolate(const B3I64Tuple& rOld1, const B3I64Tuple& rOld2, double t) - { + inline B3DTuple interpolate(const B3I64Tuple& rOld1, const B3I64Tuple& rOld2, double t) + { B3DTuple aInt( ((rOld2.getX() - rOld1.getX()) * t) + rOld1.getX(), ((rOld2.getY() - rOld1.getY()) * t) + rOld1.getY(), - ((rOld2.getZ() - rOld1.getZ()) * t) + rOld1.getZ()); + ((rOld2.getZ() - rOld1.getZ()) * t) + rOld1.getZ()); return aInt; } - inline B3DTuple average(const B3I64Tuple& rOld1, const B3I64Tuple& rOld2) - { + inline B3DTuple average(const B3I64Tuple& rOld1, const B3I64Tuple& rOld2) + { B3DTuple aAvg( (rOld1.getX() + rOld2.getX()) * 0.5, (rOld1.getY() + rOld2.getY()) * 0.5, - (rOld1.getZ() + rOld2.getZ()) * 0.5); + (rOld1.getZ() + rOld2.getZ()) * 0.5); return aAvg; } - + inline B3DTuple average(const B3I64Tuple& rOld1, const B3I64Tuple& rOld2, const B3I64Tuple& rOld3) - { + { B3DTuple aAvg( (rOld1.getX() + rOld2.getX() + rOld3.getX()) * (1.0 / 3.0), (rOld1.getY() + rOld2.getY() + rOld3.getY()) * (1.0 / 3.0), - (rOld1.getZ() + rOld2.getZ() + rOld3.getZ()) * (1.0 / 3.0)); + (rOld1.getZ() + rOld2.getZ() + rOld3.getZ()) * (1.0 / 3.0)); return aAvg; } - + inline B3I64Tuple operator+(const B3I64Tuple& rTupA, const B3I64Tuple& rTupB) - { - B3I64Tuple aSum(rTupA); - aSum += rTupB; - return aSum; + { + B3I64Tuple aSum(rTupA); + aSum += rTupB; + return aSum; } inline B3I64Tuple operator-(const B3I64Tuple& rTupA, const B3I64Tuple& rTupB) - { - B3I64Tuple aSub(rTupA); - aSub -= rTupB; - return aSub; + { + B3I64Tuple aSub(rTupA); + aSub -= rTupB; + return aSub; } inline B3I64Tuple operator/(const B3I64Tuple& rTupA, const B3I64Tuple& rTupB) - { - B3I64Tuple aDiv(rTupA); - aDiv /= rTupB; - return aDiv; + { + B3I64Tuple aDiv(rTupA); + aDiv /= rTupB; + return aDiv; } inline B3I64Tuple operator*(const B3I64Tuple& rTupA, const B3I64Tuple& rTupB) - { - B3I64Tuple aMul(rTupA); - aMul *= rTupB; - return aMul; + { + B3I64Tuple aMul(rTupA); + aMul *= rTupB; + return aMul; } inline B3I64Tuple operator*(const B3I64Tuple& rTup, sal_Int64 t) - { - B3I64Tuple aNew(rTup); - aNew *= t; - return aNew; + { + B3I64Tuple aNew(rTup); + aNew *= t; + return aNew; } inline B3I64Tuple operator*(sal_Int64 t, const B3I64Tuple& rTup) - { - B3I64Tuple aNew(rTup); - aNew *= t; - return aNew; + { + B3I64Tuple aNew(rTup); + aNew *= t; + return aNew; } inline B3I64Tuple operator/(const B3I64Tuple& rTup, sal_Int64 t) - { - B3I64Tuple aNew(rTup); - aNew /= t; - return aNew; + { + B3I64Tuple aNew(rTup); + aNew /= t; + return aNew; } inline B3I64Tuple operator/(sal_Int64 t, const B3I64Tuple& rTup) { - B3I64Tuple aNew(t, t, t); - B3I64Tuple aTmp(rTup); - aNew /= aTmp; - return aNew; + B3I64Tuple aNew(t, t, t); + B3I64Tuple aTmp(rTup); + aNew /= aTmp; + return aNew; } } // end of namespace basegfx diff --git a/basegfx/inc/basegfx/tuple/b3ituple.hxx b/basegfx/inc/basegfx/tuple/b3ituple.hxx index 619ce145b6b9..d8787af93f9a 100644 --- a/basegfx/inc/basegfx/tuple/b3ituple.hxx +++ b/basegfx/inc/basegfx/tuple/b3ituple.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -46,71 +46,71 @@ namespace basegfx class B3ITuple { protected: - sal_Int32 mnX; - sal_Int32 mnY; - sal_Int32 mnZ; + sal_Int32 mnX; + sal_Int32 mnY; + sal_Int32 mnZ; public: - /** Create a 3D Tuple + /** Create a 3D Tuple The tuple is initialized to (0, 0, 0) */ B3ITuple() - : mnX(0), + : mnX(0), mnY(0), mnZ(0) {} - /** Create a 3D Tuple + /** Create a 3D Tuple @param nX This parameter is used to initialize the X-coordinate of the 3D Tuple. - + @param nY This parameter is used to initialize the Y-coordinate of the 3D Tuple. - + @param nZ This parameter is used to initialize the Z-coordinate of the 3D Tuple. */ B3ITuple(sal_Int32 nX, sal_Int32 nY, sal_Int32 nZ) - : mnX(nX), + : mnX(nX), mnY(nY), mnZ(nZ) {} - /** Create a copy of a 3D Tuple + /** Create a copy of a 3D Tuple @param rTup The 3D Tuple which will be copied. */ - B3ITuple(const B3ITuple& rTup) - : mnX( rTup.mnX ), + B3ITuple(const B3ITuple& rTup) + : mnX( rTup.mnX ), mnY( rTup.mnY ), - mnZ( rTup.mnZ ) + mnZ( rTup.mnZ ) {} - ~B3ITuple() + ~B3ITuple() {} /// get X-Coordinate of 3D Tuple sal_Int32 getX() const - { - return mnX; + { + return mnX; } /// get Y-Coordinate of 3D Tuple sal_Int32 getY() const - { - return mnY; + { + return mnY; } /// get Z-Coordinate of 3D Tuple sal_Int32 getZ() const - { - return mnZ; + { + return mnZ; } /// set X-Coordinate of 3D Tuple @@ -132,8 +132,8 @@ namespace basegfx } /// Array-access to 3D Tuple - const sal_Int32& operator[] (int nPos) const - { + const sal_Int32& operator[] (int nPos) const + { // Here, normally two if(...)'s should be used. In the assumption that // both sal_Int32 members can be accessed as an array a shortcut is used here. // if(0 == nPos) return mnX; if(1 == nPos) return mnY; return mnZ; @@ -142,7 +142,7 @@ namespace basegfx /// Array-access to 3D Tuple sal_Int32& operator[] (int nPos) - { + { // Here, normally two if(...)'s should be used. In the assumption that // both sal_Int32 members can be accessed as an array a shortcut is used here. // if(0 == nPos) return mnX; if(1 == nPos) return mnY; return mnZ; @@ -152,81 +152,81 @@ namespace basegfx // operators ////////////////////////////////////////////////////////////////////// - B3ITuple& operator+=( const B3ITuple& rTup ) - { + B3ITuple& operator+=( const B3ITuple& rTup ) + { mnX += rTup.mnX; - mnY += rTup.mnY; - mnZ += rTup.mnZ; - return *this; + mnY += rTup.mnY; + mnZ += rTup.mnZ; + return *this; } - B3ITuple& operator-=( const B3ITuple& rTup ) - { + B3ITuple& operator-=( const B3ITuple& rTup ) + { mnX -= rTup.mnX; - mnY -= rTup.mnY; - mnZ -= rTup.mnZ; - return *this; + mnY -= rTup.mnY; + mnZ -= rTup.mnZ; + return *this; } - B3ITuple& operator/=( const B3ITuple& rTup ) - { + B3ITuple& operator/=( const B3ITuple& rTup ) + { mnX /= rTup.mnX; - mnY /= rTup.mnY; - mnZ /= rTup.mnZ; - return *this; + mnY /= rTup.mnY; + mnZ /= rTup.mnZ; + return *this; } - B3ITuple& operator*=( const B3ITuple& rTup ) - { + B3ITuple& operator*=( const B3ITuple& rTup ) + { mnX *= rTup.mnX; - mnY *= rTup.mnY; - mnZ *= rTup.mnZ; - return *this; + mnY *= rTup.mnY; + mnZ *= rTup.mnZ; + return *this; } - B3ITuple& operator*=(sal_Int32 t) - { - mnX *= t; - mnY *= t; - mnZ *= t; - return *this; + B3ITuple& operator*=(sal_Int32 t) + { + mnX *= t; + mnY *= t; + mnZ *= t; + return *this; } - B3ITuple& operator/=(sal_Int32 t) - { - mnX /= t; - mnY /= t; - mnZ /= t; - return *this; + B3ITuple& operator/=(sal_Int32 t) + { + mnX /= t; + mnY /= t; + mnZ /= t; + return *this; } - B3ITuple operator-(void) const - { - return B3ITuple(-mnX, -mnY, -mnZ); + B3ITuple operator-(void) const + { + return B3ITuple(-mnX, -mnY, -mnZ); } bool equalZero() const - { - return (this == &getEmptyTuple() || + { + return (this == &getEmptyTuple() || (mnX == 0 && mnY == 0 && mnZ == 0)); } - bool operator==( const B3ITuple& rTup ) const - { + bool operator==( const B3ITuple& rTup ) const + { return this == &rTup || (rTup.mnX == mnX && rTup.mnY == mnY && rTup.mnZ == mnZ); } - bool operator!=( const B3ITuple& rTup ) const - { + bool operator!=( const B3ITuple& rTup ) const + { return !(*this == rTup); } - - B3ITuple& operator=( const B3ITuple& rTup ) - { + + B3ITuple& operator=( const B3ITuple& rTup ) + { mnX = rTup.mnX; - mnY = rTup.mnY; - mnZ = rTup.mnZ; - return *this; + mnY = rTup.mnY; + mnZ = rTup.mnZ; + return *this; } static const B3ITuple& getEmptyTuple(); @@ -235,115 +235,115 @@ namespace basegfx // external operators ////////////////////////////////////////////////////////////////////////// - inline B3ITuple minimum(const B3ITuple& rTupA, const B3ITuple& rTupB) - { + inline B3ITuple minimum(const B3ITuple& rTupA, const B3ITuple& rTupB) + { B3ITuple aMin( (rTupB.getX() < rTupA.getX()) ? rTupB.getX() : rTupA.getX(), (rTupB.getY() < rTupA.getY()) ? rTupB.getY() : rTupA.getY(), - (rTupB.getZ() < rTupA.getZ()) ? rTupB.getZ() : rTupA.getZ()); + (rTupB.getZ() < rTupA.getZ()) ? rTupB.getZ() : rTupA.getZ()); return aMin; } - inline B3ITuple maximum(const B3ITuple& rTupA, const B3ITuple& rTupB) - { + inline B3ITuple maximum(const B3ITuple& rTupA, const B3ITuple& rTupB) + { B3ITuple aMax( (rTupB.getX() > rTupA.getX()) ? rTupB.getX() : rTupA.getX(), (rTupB.getY() > rTupA.getY()) ? rTupB.getY() : rTupA.getY(), - (rTupB.getZ() > rTupA.getZ()) ? rTupB.getZ() : rTupA.getZ()); + (rTupB.getZ() > rTupA.getZ()) ? rTupB.getZ() : rTupA.getZ()); return aMax; } - inline B3ITuple absolute(const B3ITuple& rTup) - { + inline B3ITuple absolute(const B3ITuple& rTup) + { B3ITuple aAbs( (0 > rTup.getX()) ? -rTup.getX() : rTup.getX(), (0 > rTup.getY()) ? -rTup.getY() : rTup.getY(), - (0 > rTup.getZ()) ? -rTup.getZ() : rTup.getZ()); + (0 > rTup.getZ()) ? -rTup.getZ() : rTup.getZ()); return aAbs; } - inline B3DTuple interpolate(const B3ITuple& rOld1, const B3ITuple& rOld2, double t) - { + inline B3DTuple interpolate(const B3ITuple& rOld1, const B3ITuple& rOld2, double t) + { B3DTuple aInt( ((rOld2.getX() - rOld1.getX()) * t) + rOld1.getX(), ((rOld2.getY() - rOld1.getY()) * t) + rOld1.getY(), - ((rOld2.getZ() - rOld1.getZ()) * t) + rOld1.getZ()); + ((rOld2.getZ() - rOld1.getZ()) * t) + rOld1.getZ()); return aInt; } - inline B3DTuple average(const B3ITuple& rOld1, const B3ITuple& rOld2) - { + inline B3DTuple average(const B3ITuple& rOld1, const B3ITuple& rOld2) + { B3DTuple aAvg( (rOld1.getX() + rOld2.getX()) * 0.5, (rOld1.getY() + rOld2.getY()) * 0.5, - (rOld1.getZ() + rOld2.getZ()) * 0.5); + (rOld1.getZ() + rOld2.getZ()) * 0.5); return aAvg; } - + inline B3DTuple average(const B3ITuple& rOld1, const B3ITuple& rOld2, const B3ITuple& rOld3) - { + { B3DTuple aAvg( (rOld1.getX() + rOld2.getX() + rOld3.getX()) * (1.0 / 3.0), (rOld1.getY() + rOld2.getY() + rOld3.getY()) * (1.0 / 3.0), - (rOld1.getZ() + rOld2.getZ() + rOld3.getZ()) * (1.0 / 3.0)); + (rOld1.getZ() + rOld2.getZ() + rOld3.getZ()) * (1.0 / 3.0)); return aAvg; } - + inline B3ITuple operator+(const B3ITuple& rTupA, const B3ITuple& rTupB) - { - B3ITuple aSum(rTupA); - aSum += rTupB; - return aSum; + { + B3ITuple aSum(rTupA); + aSum += rTupB; + return aSum; } inline B3ITuple operator-(const B3ITuple& rTupA, const B3ITuple& rTupB) - { - B3ITuple aSub(rTupA); - aSub -= rTupB; - return aSub; + { + B3ITuple aSub(rTupA); + aSub -= rTupB; + return aSub; } inline B3ITuple operator/(const B3ITuple& rTupA, const B3ITuple& rTupB) - { - B3ITuple aDiv(rTupA); - aDiv /= rTupB; - return aDiv; + { + B3ITuple aDiv(rTupA); + aDiv /= rTupB; + return aDiv; } inline B3ITuple operator*(const B3ITuple& rTupA, const B3ITuple& rTupB) - { - B3ITuple aMul(rTupA); - aMul *= rTupB; - return aMul; + { + B3ITuple aMul(rTupA); + aMul *= rTupB; + return aMul; } inline B3ITuple operator*(const B3ITuple& rTup, sal_Int32 t) - { - B3ITuple aNew(rTup); - aNew *= t; - return aNew; + { + B3ITuple aNew(rTup); + aNew *= t; + return aNew; } inline B3ITuple operator*(sal_Int32 t, const B3ITuple& rTup) - { - B3ITuple aNew(rTup); - aNew *= t; - return aNew; + { + B3ITuple aNew(rTup); + aNew *= t; + return aNew; } inline B3ITuple operator/(const B3ITuple& rTup, sal_Int32 t) - { - B3ITuple aNew(rTup); - aNew /= t; - return aNew; + { + B3ITuple aNew(rTup); + aNew /= t; + return aNew; } inline B3ITuple operator/(sal_Int32 t, const B3ITuple& rTup) { - B3ITuple aNew(t, t, t); - B3ITuple aTmp(rTup); - aNew /= aTmp; - return aNew; + B3ITuple aNew(t, t, t); + B3ITuple aTmp(rTup); + aNew /= aTmp; + return aNew; } } // end of namespace basegfx diff --git a/basegfx/inc/basegfx/vector/b2dsize.hxx b/basegfx/inc/basegfx/vector/b2dsize.hxx index 7af1d3b2ea84..4681a30405b8 100644 --- a/basegfx/inc/basegfx/vector/b2dsize.hxx +++ b/basegfx/inc/basegfx/vector/b2dsize.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/basegfx/inc/basegfx/vector/b2dvector.hxx b/basegfx/inc/basegfx/vector/b2dvector.hxx index b2efaa52f5f2..109145b556d6 100644 --- a/basegfx/inc/basegfx/vector/b2dvector.hxx +++ b/basegfx/inc/basegfx/vector/b2dvector.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -48,73 +48,73 @@ namespace basegfx */ class B2DVector : public ::basegfx::B2DTuple { - public: - /** Create a 2D Vector + public: + /** Create a 2D Vector The vector is initialized to (0.0, 0.0) */ - B2DVector() - : B2DTuple() + B2DVector() + : B2DTuple() {} - /** Create a 2D Vector + /** Create a 2D Vector @param fX This parameter is used to initialize the X-coordinate of the 2D Vector. - + @param fY This parameter is used to initialize the Y-coordinate of the 2D Vector. */ - B2DVector(double fX, double fY) - : B2DTuple(fX, fY) + B2DVector(double fX, double fY) + : B2DTuple(fX, fY) {} - /** Create a copy of a 2D Vector + /** Create a copy of a 2D Vector @param rVec The 2D Vector which will be copied. */ - B2DVector(const B2DVector& rVec) - : B2DTuple(rVec) + B2DVector(const B2DVector& rVec) + : B2DTuple(rVec) {} - /** Create a copy of a 2D Vector + /** Create a copy of a 2D Vector @param rVec The 2D Vector which will be copied. */ - B2DVector(const ::basegfx::B2IVector& rVec) - : B2DTuple(rVec) + B2DVector(const ::basegfx::B2IVector& rVec) + : B2DTuple(rVec) {} /** constructor with tuple to allow copy-constructing from B2DTuple-based classes */ - B2DVector(const ::basegfx::B2DTuple& rTuple) - : B2DTuple(rTuple) + B2DVector(const ::basegfx::B2DTuple& rTuple) + : B2DTuple(rTuple) {} - ~B2DVector() + ~B2DVector() {} /** *=operator to allow usage from B2DVector, too */ - B2DVector& operator*=( const B2DVector& rPnt ) - { + B2DVector& operator*=( const B2DVector& rPnt ) + { mfX *= rPnt.mfX; - mfY *= rPnt.mfY; - return *this; + mfY *= rPnt.mfY; + return *this; } /** *=operator to allow usage from B2DVector, too */ - B2DVector& operator*=(double t) - { - mfX *= t; - mfY *= t; - return *this; + B2DVector& operator*=(double t) + { + mfX *= t; + mfY *= t; + return *this; } /** assignment operator to allow assigning the results @@ -195,7 +195,7 @@ namespace basegfx static const B2DVector& getEmptyVector(); }; - + // external operators ////////////////////////////////////////////////////////////////////////// @@ -250,14 +250,14 @@ namespace basegfx bool areParallel( const B2DVector& rVecA, const B2DVector& rVecB ); /** Transform vector by given transformation matrix. - + Since this is a vector, translational components of the matrix are disregarded. */ B2DVector operator*( const B2DHomMatrix& rMat, const B2DVector& rVec ); /** Test continuity between given vectors. - + The two given vectors are assumed to describe control points on a common point. Calculate if there is a continuity between them. */ diff --git a/basegfx/inc/basegfx/vector/b2enums.hxx b/basegfx/inc/basegfx/vector/b2enums.hxx index f364c8e1d51d..7159d3594676 100644 --- a/basegfx/inc/basegfx/vector/b2enums.hxx +++ b/basegfx/inc/basegfx/vector/b2enums.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -33,43 +33,43 @@ namespace basegfx { - /** Descriptor for the mathematical orientations of two 2D Vectors + /** Descriptor for the mathematical orientations of two 2D Vectors */ enum B2VectorOrientation { /// mathematically positive oriented ORIENTATION_POSITIVE = 0, - + /// mathematically negative oriented ORIENTATION_NEGATIVE, - + /// mathematically neutral, thus parallel ORIENTATION_NEUTRAL }; - /** Descriptor for the mathematical continuity of two 2D Vectors + /** Descriptor for the mathematical continuity of two 2D Vectors */ enum B2VectorContinuity { /// none CONTINUITY_NONE = 0, - + /// mathematically negative oriented CONTINUITY_C1, - + /// mathematically neutral, thus parallel CONTINUITY_C2 }; - /** Descriptor for possible line joins between two line segments + /** Descriptor for possible line joins between two line segments */ enum B2DLineJoin { - B2DLINEJOIN_NONE, // no rounding - B2DLINEJOIN_MIDDLE, // calc middle value between joints - B2DLINEJOIN_BEVEL, // join edges with line - B2DLINEJOIN_MITER, // extend till cut - B2DLINEJOIN_ROUND // create arc + B2DLINEJOIN_NONE, // no rounding + B2DLINEJOIN_MIDDLE, // calc middle value between joints + B2DLINEJOIN_BEVEL, // join edges with line + B2DLINEJOIN_MITER, // extend till cut + B2DLINEJOIN_ROUND // create arc }; } // end of namespace basegfx diff --git a/basegfx/inc/basegfx/vector/b2isize.hxx b/basegfx/inc/basegfx/vector/b2isize.hxx index a1738548742f..e904513dde8a 100644 --- a/basegfx/inc/basegfx/vector/b2isize.hxx +++ b/basegfx/inc/basegfx/vector/b2isize.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/basegfx/inc/basegfx/vector/b2ivector.hxx b/basegfx/inc/basegfx/vector/b2ivector.hxx index 8327f9236d96..1b32569ec675 100644 --- a/basegfx/inc/basegfx/vector/b2ivector.hxx +++ b/basegfx/inc/basegfx/vector/b2ivector.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -47,64 +47,64 @@ namespace basegfx */ class B2IVector : public ::basegfx::B2ITuple { - public: - /** Create a 2D Vector + public: + /** Create a 2D Vector The vector is initialized to (0, 0) */ - B2IVector() - : B2ITuple() + B2IVector() + : B2ITuple() {} - /** Create a 2D Vector + /** Create a 2D Vector @param nX This parameter is used to initialize the X-coordinate of the 2D Vector. - + @param nY This parameter is used to initialize the Y-coordinate of the 2D Vector. */ - B2IVector(sal_Int32 nX, sal_Int32 nY) - : B2ITuple(nX, nY) + B2IVector(sal_Int32 nX, sal_Int32 nY) + : B2ITuple(nX, nY) {} - /** Create a copy of a 2D Vector + /** Create a copy of a 2D Vector @param rVec The 2D Vector which will be copied. */ - B2IVector(const B2IVector& rVec) - : B2ITuple(rVec) + B2IVector(const B2IVector& rVec) + : B2ITuple(rVec) {} /** constructor with tuple to allow copy-constructing from B2ITuple-based classes */ - B2IVector(const ::basegfx::B2ITuple& rTuple) - : B2ITuple(rTuple) + B2IVector(const ::basegfx::B2ITuple& rTuple) + : B2ITuple(rTuple) {} - ~B2IVector() + ~B2IVector() {} /** *=operator to allow usage from B2IVector, too */ - B2IVector& operator*=( const B2IVector& rPnt ) - { + B2IVector& operator*=( const B2IVector& rPnt ) + { mnX *= rPnt.mnX; - mnY *= rPnt.mnY; - return *this; + mnY *= rPnt.mnY; + return *this; } /** *=operator to allow usage from B2IVector, too */ - B2IVector& operator*=(sal_Int32 t) - { - mnX *= t; - mnY *= t; - return *this; + B2IVector& operator*=(sal_Int32 t) + { + mnX *= t; + mnY *= t; + return *this; } /** assignment operator to allow assigning the results @@ -171,7 +171,7 @@ namespace basegfx static const B2IVector& getEmptyVector(); }; - + // external operators ////////////////////////////////////////////////////////////////////////// @@ -213,14 +213,14 @@ namespace basegfx bool areParallel( const B2IVector& rVecA, const B2IVector& rVecB ); /** Transform vector by given transformation matrix. - + Since this is a vector, translational components of the matrix are disregarded. */ B2IVector operator*( const B2DHomMatrix& rMat, const B2IVector& rVec ); /** Test continuity between given vectors. - + The two given vectors are assumed to describe control points on a common point. Calculate if there is a continuity between them. */ diff --git a/basegfx/inc/basegfx/vector/b3dsize.hxx b/basegfx/inc/basegfx/vector/b3dsize.hxx index 757314cadcf1..ab1fa4d5a4f4 100644 --- a/basegfx/inc/basegfx/vector/b3dsize.hxx +++ b/basegfx/inc/basegfx/vector/b3dsize.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/basegfx/inc/basegfx/vector/b3dvector.hxx b/basegfx/inc/basegfx/vector/b3dvector.hxx index 17c61b0437e2..9942e19569a8 100644 --- a/basegfx/inc/basegfx/vector/b3dvector.hxx +++ b/basegfx/inc/basegfx/vector/b3dvector.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -49,80 +49,80 @@ namespace basegfx class B3DVector : public ::basegfx::B3DTuple { public: - /** Create a 3D Vector + /** Create a 3D Vector The vector is initialized to (0.0, 0.0, 0.0) */ B3DVector() - : B3DTuple() + : B3DTuple() {} - /** Create a 3D Vector + /** Create a 3D Vector @param fX This parameter is used to initialize the X-coordinate of the 3D Vector. - + @param fY This parameter is used to initialize the Y-coordinate of the 3D Vector. - + @param fZ This parameter is used to initialize the Z-coordinate of the 3D Vector. */ B3DVector(double fX, double fY, double fZ) - : B3DTuple(fX, fY, fZ) + : B3DTuple(fX, fY, fZ) {} - /** Create a copy of a 3D Vector + /** Create a copy of a 3D Vector @param rVec The 3D Vector which will be copied. */ - B3DVector(const B3DVector& rVec) - : B3DTuple(rVec) + B3DVector(const B3DVector& rVec) + : B3DTuple(rVec) {} /** constructor with tuple to allow copy-constructing from B3DTuple-based classes */ - B3DVector(const ::basegfx::B3DTuple& rTuple) - : B3DTuple(rTuple) + B3DVector(const ::basegfx::B3DTuple& rTuple) + : B3DTuple(rTuple) {} - ~B3DVector() + ~B3DVector() {} /** *=operator to allow usage from B3DVector, too */ - B3DVector& operator*=( const B3DVector& rPnt ) - { + B3DVector& operator*=( const B3DVector& rPnt ) + { mfX *= rPnt.mfX; - mfY *= rPnt.mfY; - mfZ *= rPnt.mfZ; - return *this; + mfY *= rPnt.mfY; + mfZ *= rPnt.mfZ; + return *this; } /** *=operator to allow usage from B3DVector, too */ - B3DVector& operator*=(double t) - { - mfX *= t; - mfY *= t; - mfZ *= t; - return *this; + B3DVector& operator*=(double t) + { + mfX *= t; + mfY *= t; + mfZ *= t; + return *this; } /** assignment operator to allow assigning the results of B3DTuple calculations */ - B3DVector& operator=( const ::basegfx::B3DTuple& rVec ) - { + B3DVector& operator=( const ::basegfx::B3DTuple& rVec ) + { mfX = rVec.getX(); - mfY = rVec.getY(); - mfZ = rVec.getZ(); - return *this; + mfY = rVec.getY(); + mfZ = rVec.getZ(); + return *this; } /** Calculate the length of this 3D Vector @@ -309,7 +309,7 @@ namespace basegfx bool areParallel( const B3DVector& rVecA, const B3DVector& rVecB ); /** Transform vector by given transformation matrix. - + Since this is a vector, translational components of the matrix are disregarded. */ diff --git a/basegfx/inc/basegfx/vector/b3isize.hxx b/basegfx/inc/basegfx/vector/b3isize.hxx index 5aa85d904751..f22a46a11a5e 100644 --- a/basegfx/inc/basegfx/vector/b3isize.hxx +++ b/basegfx/inc/basegfx/vector/b3isize.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/basegfx/inc/basegfx/vector/b3ivector.hxx b/basegfx/inc/basegfx/vector/b3ivector.hxx index 5cbd869cad5f..23ebc6bcca4a 100644 --- a/basegfx/inc/basegfx/vector/b3ivector.hxx +++ b/basegfx/inc/basegfx/vector/b3ivector.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -47,80 +47,80 @@ namespace basegfx class B3IVector : public ::basegfx::B3ITuple { public: - /** Create a 3D Vector + /** Create a 3D Vector The vector is initialized to (0, 0, 0) */ B3IVector() - : B3ITuple() + : B3ITuple() {} - /** Create a 3D Vector + /** Create a 3D Vector @param nX This parameter is used to initialize the X-coordinate of the 3D Vector. - + @param nY This parameter is used to initialize the Y-coordinate of the 3D Vector. - + @param nZ This parameter is used to initialize the Z-coordinate of the 3D Vector. */ B3IVector(sal_Int32 nX, sal_Int32 nY, sal_Int32 nZ) - : B3ITuple(nX, nY, nZ) + : B3ITuple(nX, nY, nZ) {} - /** Create a copy of a 3D Vector + /** Create a copy of a 3D Vector @param rVec The 3D Vector which will be copied. */ - B3IVector(const B3IVector& rVec) - : B3ITuple(rVec) + B3IVector(const B3IVector& rVec) + : B3ITuple(rVec) {} /** constructor with tuple to allow copy-constructing from B3ITuple-based classes */ - B3IVector(const ::basegfx::B3ITuple& rTuple) - : B3ITuple(rTuple) + B3IVector(const ::basegfx::B3ITuple& rTuple) + : B3ITuple(rTuple) {} - ~B3IVector() + ~B3IVector() {} /** *=operator to allow usage from B3IVector, too */ - B3IVector& operator*=( const B3IVector& rPnt ) - { + B3IVector& operator*=( const B3IVector& rPnt ) + { mnX *= rPnt.mnX; - mnY *= rPnt.mnY; - mnZ *= rPnt.mnZ; - return *this; + mnY *= rPnt.mnY; + mnZ *= rPnt.mnZ; + return *this; } /** *=operator to allow usage from B3IVector, too */ - B3IVector& operator*=(sal_Int32 t) - { - mnX *= t; - mnY *= t; - mnZ *= t; - return *this; + B3IVector& operator*=(sal_Int32 t) + { + mnX *= t; + mnY *= t; + mnZ *= t; + return *this; } /** assignment operator to allow assigning the results of B3ITuple calculations */ - B3IVector& operator=( const ::basegfx::B3ITuple& rVec ) - { + B3IVector& operator=( const ::basegfx::B3ITuple& rVec ) + { mnX = rVec.getX(); - mnY = rVec.getY(); - mnZ = rVec.getZ(); - return *this; + mnY = rVec.getY(); + mnZ = rVec.getZ(); + return *this; } /** Calculate the length of this 3D Vector @@ -230,7 +230,7 @@ namespace basegfx ////////////////////////////////////////////////////////////////////////// /** Transform vector by given transformation matrix. - + Since this is a vector, translational components of the matrix are disregarded. */ |