summaryrefslogtreecommitdiffstats
path: root/src/2geom/region.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2007-08-30 18:32:36 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2007-08-30 18:32:36 +0000
commit13e73fa386cd7843d7079ec7c162ef43d15097c4 (patch)
treeab4c7a4f76528e9139a85aa1c1267ecf2c6df8fe /src/2geom/region.cpp
parentupdated Slovak (sk) translation in trunk (diff)
downloadinkscape-13e73fa386cd7843d7079ec7c162ef43d15097c4.tar.gz
inkscape-13e73fa386cd7843d7079ec7c162ef43d15097c4.zip
Update to 2Geom rev. 1113
(bzr r3622)
Diffstat (limited to 'src/2geom/region.cpp')
-rw-r--r--src/2geom/region.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/2geom/region.cpp b/src/2geom/region.cpp
new file mode 100644
index 000000000..cfab3a35a
--- /dev/null
+++ b/src/2geom/region.cpp
@@ -0,0 +1,42 @@
+#include "region.h"
+#include "utils.h"
+
+#include "shape.h"
+
+namespace Geom {
+
+Regions sanitize_path(Path const &p) {
+ Regions results;
+ Crossings crs = self_crossings(p);
+ for(unsigned i = 0; i < crs.size(); i++) {
+
+ }
+}
+
+Region Region::operator*(Matrix const &m) const {
+ Region r((m.flips() ? boundary.reverse() : boundary) * m, fill);
+ if(box && m.onlyScaleAndTranslation()) r.box = (*box) * m;
+ return r;
+}
+
+bool Region::invariants() const {
+ return self_crossings(boundary).empty();
+}
+
+unsigned outer_index(Regions const &ps) {
+ if(ps.size() <= 1 || ps[0].contains(ps[1])) {
+ return 0;
+ } else {
+ /* Since we've already shown that chunks[0] is not outside
+ it can be used as an exemplar inner. */
+ Point exemplar = Path(ps[0]).initialPoint();
+ for(unsigned i = 1; i < ps.size(); i++) {
+ if(ps[i].contains(exemplar)) {
+ return i;
+ }
+ }
+ }
+ return ps.size();
+}
+
+}