diff options
Diffstat (limited to 'src/2geom/basic-intersection.h')
| -rw-r--r-- | src/2geom/basic-intersection.h | 94 |
1 files changed, 44 insertions, 50 deletions
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 <njh@njhurst.com> + * Marco Cecchetti <mrcekets at gmail.com> + * Jean-François Barraud <jf.barraud@gmail.com> * - * 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<std::pair<double, double> >& xs, - D2<SBasis> const & A, - D2<SBasis> const & B); +void find_intersections(std::vector<std::pair<double, double> > &xs, + D2<Bezier> const &A, + D2<Bezier> const &B, + double precision = EPSILON); + +void find_intersections(std::vector<std::pair<double, double> > &xs, + D2<SBasis> const &A, + D2<SBasis> const &B, + double precision = EPSILON); + +void find_intersections(std::vector< std::pair<double, double> > &xs, + std::vector<Point> const &A, + std::vector<Point> const &B, + double precision = EPSILON); + +void find_self_intersections(std::vector<std::pair<double, double> > &xs, + D2<SBasis> const &A, + double precision = EPSILON); + +void find_self_intersections(std::vector<std::pair<double, double> > &xs, + D2<Bezier> const &A, + double precision = EPSILON); -void find_intersections(std::vector< std::pair<double, double> > & xs, - std::vector<Point> const& A, - std::vector<Point> const& B, - double precision = 1e-5); - -//why not allowing precision to be set here? -void find_self_intersections(std::vector<std::pair<double, double> >& xs, - D2<SBasis> const & A); - - -//--not implemented -//void find_self_intersections(std::vector<std::pair<double, double> >& xs, -// std::vector<Point> 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<double, double> > & xs, -// std::vector<Point> const& A, -// std::vector<Point> const& B, -// double precision = 1e-5); -// #else /* * find_intersection * @@ -96,10 +86,14 @@ void find_self_intersections(std::vector<std::pair<double, double> >& xs, void find_intersections_bezier_clipping (std::vector< std::pair<double, double> > & xs, std::vector<Point> const& A, std::vector<Point> const& B, - double precision = 1e-5); + double precision = EPSILON); //#endif - +void subdivide(D2<Bezier> const &a, + D2<Bezier> const &b, + std::vector< std::pair<double, double> > const &xs, + std::vector< D2<Bezier> > &av, + std::vector< D2<Bezier> > &bv); /* * find_collinear_normal @@ -115,7 +109,7 @@ void find_intersections_bezier_clipping (std::vector< std::pair<double, double> void find_collinear_normal (std::vector< std::pair<double, double> >& xs, std::vector<Point> const& A, std::vector<Point> const& B, - double precision = 1e-5); + double precision = EPSILON); void polish_intersections(std::vector<std::pair<double, double> > &xs, D2<SBasis> const &A, @@ -125,19 +119,19 @@ void polish_intersections(std::vector<std::pair<double, double> > &xs, /** * Compute the Hausdorf distance from A to B only. */ -double hausdorfl(D2<SBasis>& A, D2<SBasis> const& B, +double hausdorfl(D2<SBasis>& A, D2<SBasis> 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<SBasis>& A, D2<SBasis> const& B, +double hausdorf(D2<SBasis> &A, D2<SBasis> 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: |
