summaryrefslogtreecommitdiffstats
path: root/src/2geom/basic-intersection.h
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2008-12-13 19:56:16 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2008-12-13 19:56:16 +0000
commit9d9fc63aac9464b0b642f1818570cf6f6ca601e9 (patch)
treedb2b45bc112de64ad8fa6018a5b45230ca36ef38 /src/2geom/basic-intersection.h
parentadd sketch mode to pencil tool (diff)
downloadinkscape-9d9fc63aac9464b0b642f1818570cf6f6ca601e9.tar.gz
inkscape-9d9fc63aac9464b0b642f1818570cf6f6ca601e9.zip
update to 2geom rev.1723
(bzr r6996)
Diffstat (limited to 'src/2geom/basic-intersection.h')
-rw-r--r--src/2geom/basic-intersection.h54
1 files changed, 43 insertions, 11 deletions
diff --git a/src/2geom/basic-intersection.h b/src/2geom/basic-intersection.h
index 77374b5ff..783df370e 100644
--- a/src/2geom/basic-intersection.h
+++ b/src/2geom/basic-intersection.h
@@ -42,24 +42,39 @@
#include <vector>
#include <utility>
+#define USE_RECURSIVE_INTERSECTOR 0
namespace Geom {
-std::vector<std::pair<double, double> >
-find_intersections( D2<SBasis> const & A,
+#ifdef USE_RECURSIVE_INTERSECTOR
+void
+find_intersections( std::vector<std::pair<double, double> > &xs,
+ D2<SBasis> const & A,
D2<SBasis> const & B);
-std::vector<std::pair<double, double> >
-find_self_intersections(D2<SBasis> const & A);
+void
+find_self_intersections(std::vector<std::pair<double, double> > &xs,
+ D2<SBasis> const & A);
// Bezier form
-std::vector<std::pair<double, double> >
-find_intersections( std::vector<Point> const & A,
- std::vector<Point> const & B);
+void
+find_intersections( std::vector<std::pair<double, double> > &xs,
+ std::vector<Point> const & A,
+ std::vector<Point> const & B,
+ double precision = 1e-5);
-std::vector<std::pair<double, double> >
-find_self_intersections(std::vector<Point> const & A);
+// Bezier form
+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);
+
+void
+find_self_intersections(std::vector<std::pair<double, double> > &xs,
+ std::vector<Point> const & A);
+#else
/*
* find_intersection
@@ -72,11 +87,11 @@ find_self_intersections(std::vector<Point> const & A);
* This routine is based on the Bezier Clipping Algorithm,
* see: Sederberg, Nishita, 1990 - Curve intersection using Bezier clipping
*/
-void find_intersections (std::vector< std::pair<double, double> > & xs,
+void find_intersections_clipping (std::vector< std::pair<double, double> > & xs,
std::vector<Point> const& A,
std::vector<Point> const& B,
double precision = 1e-5);
-
+#endif
/*
* find_collinear_normal
*
@@ -93,6 +108,23 @@ void find_collinear_normal (std::vector< std::pair<double, double> >& xs,
std::vector<Point> const& B,
double precision = 1e-5);
+void polish_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<SBasis> const & A,
+ D2<SBasis> const & B);
+
+void find_self_intersections(std::vector<std::pair<double, double> >& xs,
+ D2<SBasis> const & A);
+
+
+void find_self_intersections(std::vector<std::pair<double, double> >& xs,
+ std::vector<Point> const & A);
+
+
+
/**
* Compute the Hausdorf distance from A to B only.
*/