summaryrefslogtreecommitdiffstats
path: root/src/removeoverlap
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2010-03-14 23:58:16 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2010-03-14 23:58:16 +0000
commitbf83d5a03bf856e34bd0a6e2656a5b2dcfe8aafb (patch)
tree89db1a5074e284c958cf693302beaaafb086b702 /src/removeoverlap
parentTranslations. Polish translation update. (diff)
downloadinkscape-bf83d5a03bf856e34bd0a6e2656a5b2dcfe8aafb.tar.gz
inkscape-bf83d5a03bf856e34bd0a6e2656a5b2dcfe8aafb.zip
Move around files to remove some vanity directories.
Also remove the obsolete IDL file stub. (bzr r9194)
Diffstat (limited to 'src/removeoverlap')
-rw-r--r--src/removeoverlap/CMakeLists.txt6
-rw-r--r--src/removeoverlap/Makefile_insert5
-rw-r--r--src/removeoverlap/makefile.in17
-rw-r--r--src/removeoverlap/removeoverlap.cpp84
-rw-r--r--src/removeoverlap/removeoverlap.h20
5 files changed, 0 insertions, 132 deletions
diff --git a/src/removeoverlap/CMakeLists.txt b/src/removeoverlap/CMakeLists.txt
deleted file mode 100644
index 7f71c29dc..000000000
--- a/src/removeoverlap/CMakeLists.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-SET(removeoverlap_SRC
-removeoverlap.cpp
-)
-ADD_LIBRARY(removeoverlap STATIC ${removeoverlap_SRC})
-TARGET_LINK_LIBRARIES(removeoverlap
-2geom ${INKSCAPE_LIBS}) \ No newline at end of file
diff --git a/src/removeoverlap/Makefile_insert b/src/removeoverlap/Makefile_insert
deleted file mode 100644
index d5e90ec02..000000000
--- a/src/removeoverlap/Makefile_insert
+++ /dev/null
@@ -1,5 +0,0 @@
-## Makefile.am fragment sourced by src/Makefile.am.
-
-ink_common_sources += \
- removeoverlap/removeoverlap.cpp \
- removeoverlap/removeoverlap.h
diff --git a/src/removeoverlap/makefile.in b/src/removeoverlap/makefile.in
deleted file mode 100644
index 34e31a9a3..000000000
--- a/src/removeoverlap/makefile.in
+++ /dev/null
@@ -1,17 +0,0 @@
-# Convenience stub makefile to call the real Makefile.
-
-@SET_MAKE@
-
-OBJEXT = @OBJEXT@
-
-# Explicit so that it's the default rule.
-all:
- cd .. && $(MAKE) removeoverlap/all
-
-clean %.a %.$(OBJEXT):
- cd .. && $(MAKE) removeoverlap/$@
-
-.PHONY: all clean
-
-.SUFFIXES:
-.SUFFIXES: .a .$(OBJEXT)
diff --git a/src/removeoverlap/removeoverlap.cpp b/src/removeoverlap/removeoverlap.cpp
deleted file mode 100644
index 975b4becb..000000000
--- a/src/removeoverlap/removeoverlap.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-/** \file
- * Interface between Inkscape code (SPItem) and remove-overlaps function.
- */
-/*
-* Authors:
-* Tim Dwyer <tgdwyer@gmail.com>
-*
-* Copyright (C) 2005 Authors
-*
-* Released under GNU LGPL. Read the file 'COPYING' for more information.
-*/
-#include "util/glib-list-iterators.h"
-#include "sp-item.h"
-#include "sp-item-transform.h"
-#include "libvpsc/generate-constraints.h"
-#include "libvpsc/remove_rectangle_overlap.h"
-#include <utility>
-
-using vpsc::Rectangle;
-
-namespace {
- struct Record {
- SPItem *item;
- Geom::Point midpoint;
- Rectangle *vspc_rect;
-
- Record() {}
- Record(SPItem *i, Geom::Point m, Rectangle *r)
- : item(i), midpoint(m), vspc_rect(r) {}
- };
-}
-
-/**
-* Takes a list of inkscape items and moves them as little as possible
-* such that rectangular bounding boxes are separated by at least xGap
-* horizontally and yGap vertically
-*/
-void removeoverlap(GSList const *const items, double const xGap, double const yGap) {
- using Inkscape::Util::GSListConstIterator;
- std::list<SPItem *> selected;
- selected.insert<GSListConstIterator<SPItem *> >(selected.end(), items, NULL);
- std::vector<Record> records;
- std::vector<Rectangle *> rs;
-
- Geom::Point const gap(xGap, yGap);
- for (std::list<SPItem *>::iterator it(selected.begin());
- it != selected.end();
- ++it)
- {
- using Geom::X; using Geom::Y;
- Geom::OptRect item_box(sp_item_bbox_desktop(*it));
- if (item_box) {
- Geom::Point min(item_box->min() - .5*gap);
- Geom::Point max(item_box->max() + .5*gap);
- // A negative gap is allowed, but will lead to problems when the gap is larger than
- // the bounding box (in either X or Y direction, or both); min will have become max
- // now, which cannot be handled by Rectangle() which is called below. And how will
- // removeRectangleOverlap handle such a case?
- // That's why we will enforce some boundaries on min and max here:
- if (max[X] < min[X]) {
- min[X] = max[X] = (min[X] + max[X])/2;
- }
- if (max[Y] < min[Y]) {
- min[Y] = max[Y] = (min[Y] + max[Y])/2;
- }
- Rectangle *vspc_rect = new Rectangle(min[X], max[X], min[Y], max[Y]);
- records.push_back(Record(*it, item_box->midpoint(), vspc_rect));
- rs.push_back(vspc_rect);
- }
- }
- if (!rs.empty()) {
- removeRectangleOverlap(rs.size(), &rs[0], 0.0, 0.0);
- }
- for ( std::vector<Record>::iterator it = records.begin();
- it != records.end();
- ++it )
- {
- Geom::Point const curr = it->midpoint;
- Geom::Point const dest(it->vspc_rect->getCentreX(),
- it->vspc_rect->getCentreY());
- sp_item_move_rel(it->item, Geom::Translate(dest - curr));
- delete it->vspc_rect;
- }
-}
diff --git a/src/removeoverlap/removeoverlap.h b/src/removeoverlap/removeoverlap.h
deleted file mode 100644
index 5b16e706b..000000000
--- a/src/removeoverlap/removeoverlap.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/** \file
- * \brief Remove overlaps function
- */
-/*
- * Authors:
- * Tim Dwyer <tgdwyer@gmail.com>
- *
- * Copyright (C) 2005 Authors
- *
- * Released under GNU LGPL. Read the file 'COPYING' for more information.
- */
-
-#ifndef SEEN_REMOVEOVERLAP_H
-#define SEEN_REMOVEOVERLAP_H
-
-#include <glib/gslist.h>
-
-void removeoverlap(GSList const *items, double xGap, double yGap);
-
-#endif // SEEN_REMOVEOVERLAP_H