summaryrefslogtreecommitdiff
path: root/basegfx/inc/basegfx/curve/b2dbeziertools.hxx
diff options
context:
space:
mode:
authorThorsten Behrens <thb@openoffice.org>2003-11-10 12:33:07 +0000
committerThorsten Behrens <thb@openoffice.org>2003-11-10 12:33:07 +0000
commitfd1976f8025e13124d28c78358cb29be99a8074a (patch)
tree260a24c73e82966cb6198965a4de903c6dfa5ff3 /basegfx/inc/basegfx/curve/b2dbeziertools.hxx
parentfd56c146e7d072d0af39e859645ee79c2089e282 (diff)
Initial revision
Diffstat (limited to 'basegfx/inc/basegfx/curve/b2dbeziertools.hxx')
-rw-r--r--basegfx/inc/basegfx/curve/b2dbeziertools.hxx131
1 files changed, 131 insertions, 0 deletions
diff --git a/basegfx/inc/basegfx/curve/b2dbeziertools.hxx b/basegfx/inc/basegfx/curve/b2dbeziertools.hxx
new file mode 100644
index 000000000000..23231bd9a763
--- /dev/null
+++ b/basegfx/inc/basegfx/curve/b2dbeziertools.hxx
@@ -0,0 +1,131 @@
+/*************************************************************************
+ *
+ * $RCSfile: b2dbeziertools.hxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: thb $ $Date: 2003-11-10 13:33:07 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _BGFX_CURVE_B2DBEZIERTOOLS_HXX
+#define _BGFX_CURVE_B2DBEZIERTOOLS_HXX
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+ namespace polygon
+ {
+ class B2DPolygon;
+ }
+
+ namespace curve
+ {
+
+ class B2DCubicBezier;
+ class B2DQuadraticBezier;
+
+ /** Subdivide given cubic bezier segment.
+
+ This function adaptively subdivides the given bezier
+ segment into as much straight line segments, such that the
+ maximal orthogonal distance from any of the segments to
+ the true curve is less than the given error value.
+
+ @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 distanceBounds
+ Bounds on the maximal distance of the approximation to the
+ true curve
+
+ @return the number of line segments created
+ */
+ int adaptiveSubdivide( polygon::B2DPolygon& rPoly,
+ const B2DCubicBezier& rCurve,
+ double distanceBounds );
+
+ /** Subdivide given quadratic bezier segment.
+
+ This function adaptively subdivides the given bezier
+ segment into as much straight line segments, such that the
+ maximal orthogonal distance from any of the segments to
+ the true curve is less than the given error value.
+
+ @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 distanceBounds
+ Bounds on the maximal distance of the approximation to the
+ true curve
+
+ @return the number of line segments created
+ */
+ int adaptiveSubdivide( polygon::B2DPolygon& rPoly,
+ const B2DQuadraticBezier& rCurve,
+ double distanceBounds );
+
+ }
+}
+
+#endif // _BGFX_CURVE_B2DBEZIERTOOLS_HXX2