summaryrefslogtreecommitdiffstats
path: root/src/2geom/sweep.cpp
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/sweep.cpp
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/sweep.cpp')
-rw-r--r--src/2geom/sweep.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/2geom/sweep.cpp b/src/2geom/sweep.cpp
index 53b953255..227c47e09 100644
--- a/src/2geom/sweep.cpp
+++ b/src/2geom/sweep.cpp
@@ -4,6 +4,15 @@
namespace Geom {
+/**
+ * \brief Make a list of pairs of self intersections in a list of Rects.
+ *
+ * \param rs: vector of Rect.
+ *
+ * [(A = rs[i], B = rs[j]) for i,J in enumerate(pairs) for j in J]
+ * then A.left <= B.left
+ */
+
std::vector<std::vector<unsigned> > sweep_bounds(std::vector<Rect> rs) {
std::vector<Event> events; events.reserve(rs.size()*2);
std::vector<std::vector<unsigned> > pairs(rs.size());
@@ -34,6 +43,15 @@ std::vector<std::vector<unsigned> > sweep_bounds(std::vector<Rect> rs) {
return pairs;
}
+/**
+ * \brief Make a list of pairs of red-blue intersections between two lists of Rects.
+ *
+ * \param a: vector of Rect.
+ * \param b: vector of Rect.
+ *
+ * [(A = rs[i], B = rs[j]) for i,J in enumerate(pairs) for j in J]
+ * then A.left <= B.left, A in a, B in b
+ */
std::vector<std::vector<unsigned> > sweep_bounds(std::vector<Rect> a, std::vector<Rect> b) {
std::vector<std::vector<unsigned> > pairs(a.size());
if(a.empty() || b.empty()) return pairs;