From c883d7627a479c8c5b6a9f77b9841fa5631572ad Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Mon, 27 Apr 2015 19:39:29 -0400 Subject: 2Geom sync - initial commit (bzr r14059.2.1) --- src/2geom/basic-intersection.h | 94 ++++++++++++++++++++---------------------- 1 file changed, 44 insertions(+), 50 deletions(-) (limited to 'src/2geom/basic-intersection.h') diff --git a/src/2geom/basic-intersection.h b/src/2geom/basic-intersection.h index 5a813ae99..0b0bf8930 100644 --- a/src/2geom/basic-intersection.h +++ b/src/2geom/basic-intersection.h @@ -1,11 +1,12 @@ -/** - * \file - * \brief Basic intersection routines - * +/** @file + * @brief Basic intersection routines + *//* * Authors: - * ? + * Nathan Hurst + * Marco Cecchetti + * Jean-François Barraud * - * Copyright ?-? authors + * Copyright 2008-2009 Authors * * This library is free software; you can redistribute it and/or * modify it either under the terms of the GNU Lesser General Public @@ -32,10 +33,11 @@ * */ -#ifndef SEEN_GEOM_BASICINTERSECTION_H -#define SEEN_GEOM_BASICINTERSECTION_H +#ifndef LIB2GEOM_SEEN_BASIC_INTERSECTION_H +#define LIB2GEOM_SEEN_BASIC_INTERSECTION_H #include <2geom/point.h> +#include <2geom/bezier.h> #include <2geom/sbasis.h> #include <2geom/d2.h> @@ -47,41 +49,29 @@ namespace Geom { -//why not allowing precision to be set here? -void find_intersections(std::vector >& xs, - D2 const & A, - D2 const & B); +void find_intersections(std::vector > &xs, + D2 const &A, + D2 const &B, + double precision = EPSILON); + +void find_intersections(std::vector > &xs, + D2 const &A, + D2 const &B, + double precision = EPSILON); + +void find_intersections(std::vector< std::pair > &xs, + std::vector const &A, + std::vector const &B, + double precision = EPSILON); + +void find_self_intersections(std::vector > &xs, + D2 const &A, + double precision = EPSILON); + +void find_self_intersections(std::vector > &xs, + D2 const &A, + double precision = EPSILON); -void find_intersections(std::vector< std::pair > & xs, - std::vector const& A, - std::vector const& B, - double precision = 1e-5); - -//why not allowing precision to be set here? -void find_self_intersections(std::vector >& xs, - D2 const & A); - - -//--not implemented -//void find_self_intersections(std::vector >& xs, -// std::vector const & A); - - -//TODO: this should be moved to .cpp, shouldn't it? -// #ifdef USE_RECURSIVE_INTERSECTOR -// /* -// * find_intersection -// * -// * input: A, B - set of control points of two Bezier curve -// * input: precision - required precision of computation -// * output: xs - set of pairs of parameter values -// * at which crossing happens -// */ -// void find_intersections_bezier_recursive (std::vector< std::pair > & xs, -// std::vector const& A, -// std::vector const& B, -// double precision = 1e-5); -// #else /* * find_intersection * @@ -96,10 +86,14 @@ void find_self_intersections(std::vector >& xs, void find_intersections_bezier_clipping (std::vector< std::pair > & xs, std::vector const& A, std::vector const& B, - double precision = 1e-5); + double precision = EPSILON); //#endif - +void subdivide(D2 const &a, + D2 const &b, + std::vector< std::pair > const &xs, + std::vector< D2 > &av, + std::vector< D2 > &bv); /* * find_collinear_normal @@ -115,7 +109,7 @@ void find_intersections_bezier_clipping (std::vector< std::pair void find_collinear_normal (std::vector< std::pair >& xs, std::vector const& A, std::vector const& B, - double precision = 1e-5); + double precision = EPSILON); void polish_intersections(std::vector > &xs, D2 const &A, @@ -125,19 +119,19 @@ void polish_intersections(std::vector > &xs, /** * Compute the Hausdorf distance from A to B only. */ -double hausdorfl(D2& A, D2 const& B, +double hausdorfl(D2& A, D2 const &B, double m_precision, - double *a_t=0, double* b_t=0); + double *a_t=NULL, double *b_t=NULL); /** * Compute the symmetric Hausdorf distance. */ -double hausdorf(D2& A, D2 const& B, +double hausdorf(D2 &A, D2 const &B, double m_precision, - double *a_t=0, double* b_t=0); + double *a_t=NULL, double *b_t=NULL); } -#endif // !SEEN_GEOM_BASICINTERSECTION_H +#endif // !LIB2GEOM_SEEN_BASIC_INTERSECTION_H /* Local Variables: -- cgit v1.2.3