[Libreoffice-commits] .: basegfx/inc basegfx/source

Michael Meeks michael at kemper.freedesktop.org
Fri Jan 27 16:23:18 PST 2012


 basegfx/inc/basegfx/tuple/b2ituple.hxx   |    7 ---
 basegfx/inc/basegfx/vector/b2ivector.hxx |   65 ------------------------------
 basegfx/source/tuple/b2ituple.cxx        |   48 ----------------------
 basegfx/source/vector/b2ivector.cxx      |   67 -------------------------------
 4 files changed, 187 deletions(-)

New commits:
commit 6e4b79042bbb6695eb88ee5d4a8f661932778a50
Author: Alexander Bergmann <myaddons at gmx.de>
Date:   Sat Jan 28 00:22:05 2012 +0000

    Actually apply substance of previous unused code removal

diff --git a/basegfx/inc/basegfx/tuple/b2ituple.hxx b/basegfx/inc/basegfx/tuple/b2ituple.hxx
index f376bb7..4072073 100644
--- a/basegfx/inc/basegfx/tuple/b2ituple.hxx
+++ b/basegfx/inc/basegfx/tuple/b2ituple.hxx
@@ -204,13 +204,6 @@ namespace basegfx
     //////////////////////////////////////////////////////////////////////////
     class B2DTuple;
 
-    BASEGFX_DLLPUBLIC B2ITuple minimum(const B2ITuple& rTupA, const B2ITuple& rTupB);
-    BASEGFX_DLLPUBLIC B2ITuple maximum(const B2ITuple& rTupA, const B2ITuple& rTupB);
-    BASEGFX_DLLPUBLIC B2ITuple absolute(const B2ITuple& rTup);
-    BASEGFX_DLLPUBLIC B2DTuple interpolate(const B2ITuple& rOld1, const B2ITuple& rOld2, double t);
-    BASEGFX_DLLPUBLIC B2DTuple average(const B2ITuple& rOld1, const B2ITuple& rOld2);
-    BASEGFX_DLLPUBLIC B2DTuple average(const B2ITuple& rOld1, const B2ITuple& rOld2, const B2ITuple& rOld3);
-
     BASEGFX_DLLPUBLIC B2ITuple operator+(const B2ITuple& rTupA, const B2ITuple& rTupB);
     BASEGFX_DLLPUBLIC B2ITuple operator-(const B2ITuple& rTupA, const B2ITuple& rTupB);
     BASEGFX_DLLPUBLIC B2ITuple operator/(const B2ITuple& rTupA, const B2ITuple& rTupB);
diff --git a/basegfx/inc/basegfx/vector/b2ivector.hxx b/basegfx/inc/basegfx/vector/b2ivector.hxx
index 1e3be78..2fcbc54 100644
--- a/basegfx/inc/basegfx/vector/b2ivector.hxx
+++ b/basegfx/inc/basegfx/vector/b2ivector.hxx
@@ -113,12 +113,6 @@ namespace basegfx
         */
         B2IVector& operator=( const ::basegfx::B2ITuple& rVec );
 
-        /** Calculate the length of this 2D Vector
-
-            @return The Length of the 2D Vector
-        */
-        double getLength() const;
-
         /** Set the length of this 2D Vector
 
             @param fLen
@@ -136,69 +130,17 @@ namespace basegfx
         */
         double scalar( const B2IVector& rVec ) const;
 
-        /** Calculate the length of the cross product with another 2D Vector
-
-            In 2D, returning an actual vector does not make much
-            sense here. The magnitude, although, can be readily
-            used for tasks such as angle calculations, since for
-            the returned value, the following equation holds:
-            retVal = getLength(this)*getLength(rVec)*sin(theta),
-            with theta being the angle between the two vectors.
-
-            @param rVec
-            The second 2D Vector
-
-            @return
-            The length of the cross product of the two involved 2D Vectors
-        */
-        double cross( const B2IVector& rVec ) const;
-
-        /** Calculate the Angle with another 2D Vector
-
-            @param rVec
-            The second 2D Vector
-
-            @return
-            The Angle value of the two involved 2D Vectors in -pi/2 < return < pi/2
-        */
-        double angle( const B2IVector& rVec ) const;
-
         /** Transform vector by given transformation matrix.
 
             Since this is a vector, translational components of the
             matrix are disregarded.
         */
         B2IVector& operator*=( const B2DHomMatrix& rMat );
-
-        static const B2IVector& getEmptyVector();
     };
 
     // external operators
     //////////////////////////////////////////////////////////////////////////
 
-    /** Calculate the orientation to another 2D Vector
-
-        @param rVecA
-        The first 2D Vector
-
-        @param rVecB
-        The second 2D Vector
-
-        @return
-        The mathematical Orientation of the two involved 2D Vectors
-    */
-    BASEGFX_DLLPUBLIC B2VectorOrientation getOrientation( const B2IVector& rVecA, const B2IVector& rVecB );
-
-    /** Calculate a perpendicular 2D Vector to the given one
-
-        @param rVec
-        The source 2D Vector
-
-        @return
-        A 2D Vector perpendicular to the one given in parameter rVec
-    */
-    BASEGFX_DLLPUBLIC B2IVector getPerpendicular( const B2IVector& rVec );
-
     /** Test two vectors which need not to be normalized for parallelism
 
         @param rVecA
@@ -220,13 +162,6 @@ namespace basegfx
     */
     BASEGFX_DLLPUBLIC 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.
-    */
-    BASEGFX_DLLPUBLIC B2VectorContinuity getContinuity( const B2IVector& rBackVector, const B2IVector& rForwardVector );
-
 } // end of namespace basegfx
 
 #endif /* _BGFX_VECTOR_B2IVECTOR_HXX */
diff --git a/basegfx/source/tuple/b2ituple.cxx b/basegfx/source/tuple/b2ituple.cxx
index b4846b2..e4bd0fb 100644
--- a/basegfx/source/tuple/b2ituple.cxx
+++ b/basegfx/source/tuple/b2ituple.cxx
@@ -42,54 +42,6 @@ namespace basegfx
     // external operators
     //////////////////////////////////////////////////////////////////////////
 
-    B2ITuple minimum(const B2ITuple& rTupA, const B2ITuple& rTupB)
-    {
-        B2ITuple aMin(
-            (rTupB.getX() < rTupA.getX()) ? rTupB.getX() : rTupA.getX(),
-            (rTupB.getY() < rTupA.getY()) ? rTupB.getY() : rTupA.getY());
-        return aMin;
-    }
-
-    B2ITuple maximum(const B2ITuple& rTupA, const B2ITuple& rTupB)
-    {
-        B2ITuple aMax(
-            (rTupB.getX() > rTupA.getX()) ? rTupB.getX() : rTupA.getX(),
-            (rTupB.getY() > rTupA.getY()) ? rTupB.getY() : rTupA.getY());
-        return aMax;
-    }
-
-    B2ITuple absolute(const B2ITuple& rTup)
-    {
-        B2ITuple aAbs(
-            (0 > rTup.getX()) ? -rTup.getX() : rTup.getX(),
-            (0 > rTup.getY()) ? -rTup.getY() : rTup.getY());
-        return aAbs;
-    }
-
-    B2DTuple interpolate(const B2ITuple& rOld1, const B2ITuple& rOld2, double t)
-    {
-        B2DTuple aInt(
-            ((rOld2.getX() - rOld1.getX()) * t) + rOld1.getX(),
-            ((rOld2.getY() - rOld1.getY()) * t) + rOld1.getY());
-        return aInt;
-    }
-
-    B2DTuple average(const B2ITuple& rOld1, const B2ITuple& rOld2)
-    {
-        B2DTuple aAvg(
-            (rOld1.getX() + rOld2.getX()) * 0.5,
-            (rOld1.getY() + rOld2.getY()) * 0.5);
-        return aAvg;
-    }
-
-    B2DTuple average(const B2ITuple& rOld1, const B2ITuple& rOld2, const B2ITuple& rOld3)
-    {
-        B2DTuple aAvg(
-            (rOld1.getX() + rOld2.getX() + rOld3.getX()) * (1.0 / 3.0),
-            (rOld1.getY() + rOld2.getY() + rOld3.getY()) * (1.0 / 3.0));
-        return aAvg;
-    }
-
     B2ITuple operator+(const B2ITuple& rTupA, const B2ITuple& rTupB)
     {
         B2ITuple aSum(rTupA);
diff --git a/basegfx/source/vector/b2ivector.cxx b/basegfx/source/vector/b2ivector.cxx
index 7297ae4..bb3ac61 100644
--- a/basegfx/source/vector/b2ivector.cxx
+++ b/basegfx/source/vector/b2ivector.cxx
@@ -39,33 +39,11 @@ namespace basegfx
         return *this;
     }
 
-
-    double B2IVector::getLength() const
-    {
-        return hypot( mnX, mnY );
-    }
-
     double B2IVector::scalar( const B2IVector& rVec ) const
     {
         return((mnX * rVec.mnX) + (mnY * rVec.mnY));
     }
 
-    double B2IVector::cross( const B2IVector& rVec ) const
-    {
-        return(mnX * rVec.getY() - mnY * rVec.getX());
-    }
-
-    double B2IVector::angle( const B2IVector& rVec ) const
-    {
-        return atan2(double( mnX * rVec.getY() - mnY * rVec.getX()),
-            double( mnX * rVec.getX() + mnY * rVec.getY()));
-    }
-
-    const B2IVector& B2IVector::getEmptyVector()
-    {
-        return (const B2IVector&) ::basegfx::B2ITuple::getEmptyTuple();
-    }
-
     B2IVector& B2IVector::operator*=( const B2DHomMatrix& rMat )
     {
         mnX = fround( rMat.get(0,0)*mnX +
@@ -102,57 +80,12 @@ namespace basegfx
         return ::basegfx::fTools::equalZero(fVal);
     }
 
-    B2VectorOrientation getOrientation( const B2IVector& rVecA, const B2IVector& rVecB )
-    {
-        double fVal(rVecA.getX() * rVecB.getY() - rVecA.getY() * rVecB.getX());
-
-        if(fVal > 0.0)
-        {
-            return ORIENTATION_POSITIVE;
-        }
-
-        if(fVal < 0.0)
-        {
-            return ORIENTATION_NEGATIVE;
-        }
-
-        return ORIENTATION_NEUTRAL;
-    }
-
-    B2IVector getPerpendicular( const B2IVector& rNormalizedVec )
-    {
-        B2IVector aPerpendicular(-rNormalizedVec.getY(), rNormalizedVec.getX());
-        return aPerpendicular;
-    }
-
     B2IVector operator*( const B2DHomMatrix& rMat, const B2IVector& rVec )
     {
         B2IVector aRes( rVec );
         return aRes*=rMat;
     }
 
-    B2VectorContinuity getContinuity(const B2IVector& rBackVector, const B2IVector& rForwardVector )
-    {
-        B2VectorContinuity eRetval(CONTINUITY_NONE);
-
-        if(!rBackVector.equalZero() && !rForwardVector.equalZero())
-        {
-            const B2IVector aInverseForwardVector(-rForwardVector.getX(), -rForwardVector.getY());
-
-            if(rBackVector == aInverseForwardVector)
-            {
-                // same direction and same length -> C2
-                eRetval = CONTINUITY_C2;
-            }
-            else if(areParallel(rBackVector, aInverseForwardVector))
-            {
-                // same direction -> C1
-                eRetval = CONTINUITY_C1;
-            }
-        }
-
-        return eRetval;
-    }
 } // end of namespace basegfx
 
 // eof


More information about the Libreoffice-commits mailing list