summaryrefslogtreecommitdiff
path: root/basegfx/source/curve
diff options
context:
space:
mode:
authorArmin Weiss <aw@openoffice.org>2004-02-12 16:11:42 +0000
committerArmin Weiss <aw@openoffice.org>2004-02-12 16:11:42 +0000
commitb23dfd18d71d77164ae51be108de09f3ed00f7a7 (patch)
treed3ea51cafc59d781440215e88d7b4c13d1d950b2 /basegfx/source/curve
parent634b32e4ea0c9da79e7c6c4eafc023ce0c5dfa6f (diff)
Changed usages of (G/S)etControlVector(A/B) to use the new curve convention that both vectors are relative to the point of the edge. Before, B was relative to the next edge.
Also added (G/S)etControlPoint(A/B) interface for B2DPolygon.
Diffstat (limited to 'basegfx/source/curve')
-rw-r--r--basegfx/source/curve/b2dcubicbezier.cxx22
1 files changed, 20 insertions, 2 deletions
diff --git a/basegfx/source/curve/b2dcubicbezier.cxx b/basegfx/source/curve/b2dcubicbezier.cxx
index 7ff14e13601b..ff6430d7fa13 100644
--- a/basegfx/source/curve/b2dcubicbezier.cxx
+++ b/basegfx/source/curve/b2dcubicbezier.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: b2dcubicbezier.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: thb $ $Date: 2004-01-16 10:34:19 $
+ * last change: $Author: aw $ $Date: 2004-02-12 17:11:42 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -63,6 +63,10 @@
#include <basegfx/curve/b2dcubicbezier.hxx>
#endif
+#ifndef _BGFX_VECTOR_B2DVECTOR_HXX
+#include <basegfx/vector/b2dvector.hxx>
+#endif
+
//////////////////////////////////////////////////////////////////////////////
namespace basegfx
@@ -147,6 +151,20 @@ namespace basegfx
{
// TODO
}
+
+ double B2DCubicBezier::getEdgeLength() const
+ {
+ ::basegfx::B2DVector aEdge(maEndPoint - maStartPoint);
+ return aEdge.getLength();
+ }
+
+ double B2DCubicBezier::getControlPolygonLength() const
+ {
+ ::basegfx::B2DVector aVectorA(maControlPointA - maStartPoint);
+ ::basegfx::B2DVector aVectorB(maEndPoint - maControlPointB);
+ ::basegfx::B2DVector aTop(maControlPointB - maControlPointA);
+ return (aVectorA.getLength() + aVectorB.getLength() + aTop.getLength());
+ }
} // end of namespace basegfx
// eof