summaryrefslogtreecommitdiff
path: root/include/basegfx/vector/b3dvector.hxx
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-07-03 16:53:45 +0200
committerMichael Stahl <mstahl@redhat.com>2015-07-03 16:53:45 +0200
commita6f5770b4aaaa6506a22eae0d641ad48f9b6d239 (patch)
treea6c682cae9034bc67f23c410dd3d0227d36d680b /include/basegfx/vector/b3dvector.hxx
parent5bc343cc723f993ed112cf5c700e3f397527d671 (diff)
Revert "loplugin:unusedmethods sax,shell,stoc,basegfx"
The basegfx changes appear to break Windows builds. This reverts commit 3b32c5898ff4e744d3f18b00421b433500426d74.
Diffstat (limited to 'include/basegfx/vector/b3dvector.hxx')
-rw-r--r--include/basegfx/vector/b3dvector.hxx26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/basegfx/vector/b3dvector.hxx b/include/basegfx/vector/b3dvector.hxx
index 1e8572e12266..8a8997b16fbc 100644
--- a/include/basegfx/vector/b3dvector.hxx
+++ b/include/basegfx/vector/b3dvector.hxx
@@ -126,6 +126,18 @@ namespace basegfx
return sqrt(fLen);
}
+ /** Calculate the length in the XY-Plane for this 3D Vector
+
+ @return The XY-Plane Length of the 3D Vector
+ */
+ double getXYLength() const
+ {
+ double fLen((mfX * mfX) + (mfY * mfY));
+ if((0.0 == fLen) || (1.0 == fLen))
+ return fLen;
+ return sqrt(fLen);
+ }
+
/** Calculate the length in the XZ-Plane for this 3D Vector
@return The XZ-Plane Length of the 3D Vector
@@ -182,6 +194,20 @@ namespace basegfx
*/
B3DVector& normalize();
+ /** Test if this 3D Vector is normalized
+
+ @return
+ true if lenth of vector is equal to 1.0
+ false else
+ */
+ bool isNormalized() const
+ {
+ const double fOne(1.0);
+ const double fScalar(scalar(*this));
+
+ return (::basegfx::fTools::equal(fOne, fScalar));
+ }
+
/** get a 3D Vector which is perpendicular to this and a given 3D Vector
@attention This only works if this and the given 3D Vector are