[Libreoffice] [PATCH] unusedcode.easy: Removed unused code (basegfx::B2IVector)

Alexander Bergmann myaddons at gmx.de
Fri Jan 27 03:23:36 PST 2012


---
 basegfx/inc/basegfx/vector/b2ivector.hxx |   65 -----------------------------
 basegfx/source/vector/b2ivector.cxx      |   67 ------------------------------
 unusedcode.easy                          |    7 ---
 3 files changed, 0 insertions(+), 139 deletions(-)

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/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
diff --git a/unusedcode.easy b/unusedcode.easy
index fb2b2c1..8544095 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -842,10 +842,6 @@ basegfx::B1DRange::B1DRange(basegfx::B1IRange const&)
 basegfx::B2DPolygon::insert(unsigned int, basegfx::B2DPolygon const&, unsigned int, unsigned int)
 basegfx::B2DVector::isNormalized() const
 basegfx::B2I64Tuple::getEmptyTuple()
-basegfx::B2IVector::angle(basegfx::B2IVector const&) const
-basegfx::B2IVector::cross(basegfx::B2IVector const&) const
-basegfx::B2IVector::getEmptyVector()
-basegfx::B2IVector::getLength() const
 basegfx::B3DPolyPolygon::insert(unsigned int, basegfx::B3DPolyPolygon const&)
 basegfx::B3DPolyPolygon::insert(unsigned int, basegfx::B3DPolygon const&, unsigned int)
 basegfx::B3DPolyPolygon::makeUnique()
@@ -862,9 +858,6 @@ basegfx::exportToSvg(basegfx::B2DHomMatrix const&)
 basegfx::fround(basegfx::B1DRange const&)
 basegfx::fround(basegfx::B2DRange const&)
 basegfx::fround(basegfx::B3DRange const&)
-basegfx::getContinuity(basegfx::B2IVector const&, basegfx::B2IVector const&)
-basegfx::getOrientation(basegfx::B2IVector const&, basegfx::B2IVector const&)
-basegfx::getPerpendicular(basegfx::B2IVector const&)
 basegfx::tools::addPointsAtCuts(basegfx::B2DPolygon const&)
 basegfx::tools::addPointsAtCutsAndTouches(basegfx::B2DPolyPolygon const&, basegfx::B2DPolygon const&)
 basegfx::tools::applyLineDashing(basegfx::B3DPolyPolygon const&, std::__debug::vector<double, std::allocator<double> > const&, basegfx::B3DPolyPolygon*, basegfx::B3DPolyPolygon*, double)
-- 
1.7.8.3



More information about the LibreOffice mailing list