summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f14c825)
raw | patch | inline | side by side (parent: f14c825)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Wed, 18 Mar 2009 20:21:03 +0000 (20:21 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Wed, 18 Mar 2009 20:21:03 +0000 (20:21 +0000) |
src/2geom/shape.cpp | patch | blob | history | |
src/2geom/shape.h | patch | blob | history |
diff --git a/src/2geom/shape.cpp b/src/2geom/shape.cpp
index 64abf48ff6287f3848acaa19007375a7e2d85bd8..9ea856133e87aecf841dbd1f504d7ea17888bfaa 100644 (file)
--- a/src/2geom/shape.cpp
+++ b/src/2geom/shape.cpp
+/**
+ * \brief Shapes are special paths on which boolops can be performed
+ *
+ * Authors:
+ * Michael G. Sloan <mgsloan@gmail.com>
+ * Nathan Hurst <njh@mail.csse.monash.edu.au>
+ * MenTaLguY <mental@rydia.net>
+ *
+ * Copyright 2007-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
+ * License version 2.1 as published by the Free Software Foundation
+ * (the "LGPL") or, at your option, under the terms of the Mozilla
+ * Public License Version 1.1 (the "MPL"). If you do not alter this
+ * notice, a recipient may use your version of this file under either
+ * the MPL or the LGPL.
+ *
+ * You should have received a copy of the LGPL along with this library
+ * in the file COPYING-LGPL-2.1; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the MPL along with this library
+ * in the file COPYING-MPL-1.1
+ *
+ * The contents of this file are subject to the Mozilla Public 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.mozilla.org/MPL/
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
+ * OF ANY KIND, either express or implied. See the LGPL or the MPL for
+ * the specific language governing rights and limitations.
+ *
+ */
+
#include <2geom/shape.h>
+
#include <2geom/utils.h>
#include <2geom/sweep.h>
#include <2geom/ord.h>
#include <algorithm>
#include <cstdlib>
+//#define SHAPE_DEBUG // turns on debug outputting to cout.
+
namespace Geom {
// A little sugar for appending a list to another
void crossing_dual(unsigned &i, unsigned &j, CrossingSet const & crs) {
Crossing cur = crs[i][j];
i = cur.getOther(i);
+#ifdef SHAPE_DEBUG
std::cout << i << "\n";
+#endif
if(crs[i].empty())
j = 0;
else
to = crs[ix][jx];
if(dir) {
// backwards
+#ifdef SHAPE_DEBUG
std::cout << "r" << ix << "[" << from.getTime(ix) << ", " << to.getTime(ix) << "]\n";
+#endif
Path p = ps[ix].portion(from.getTime(ix), to.getTime(ix)).reverse();
for(unsigned i = 0; i < p.size(); i++)
res.append(p[i], Path::STITCH_DISCONTINUOUS);
} else {
// forwards
+#ifdef SHAPE_DEBUG
std::cout << "f" << ix << "[" << from.getTime(ix) << ", " << to.getTime(ix) << "]\n";
+#endif
ps[ix].appendPortionTo(res, from.getTime(ix), to.getTime(ix));
}
dir = new_dir;
} while(!visited[ix][jx]);
+#ifdef SHAPE_DEBUG
std::cout << "added " << res.size() << "\n";
+#endif
result_paths.push_back(res);
}
for(unsigned i = 0; i < crs.size(); i++) {
diff --git a/src/2geom/shape.h b/src/2geom/shape.h
index bec5e2d2c6ea8df57666fb2e797a7b2201cd8f8e..7877bea20925e500ff1437151f767f998e0ecdf3 100644 (file)
--- a/src/2geom/shape.h
+++ b/src/2geom/shape.h
/**
- * \file
- * \brief \todo brief description
+ * \brief Shapes are special paths on which boolops can be performed
*
* Authors:
- * ? <?@?.?>
- *
- * Copyright ?-? authors
+ * Michael G. Sloan <mgsloan@gmail.com>
+ * Nathan Hurst <njh@mail.csse.monash.edu.au>
+ * MenTaLguY <mental@rydia.net>
+ *
+ * Copyright 2007-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