summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5e95e54)
raw | patch | inline | side by side (parent: 5e95e54)
author | tgdwyer <tgdwyer@users.sourceforge.net> | |
Mon, 17 Jul 2006 05:35:08 +0000 (05:35 +0000) | ||
committer | tgdwyer <tgdwyer@users.sourceforge.net> | |
Mon, 17 Jul 2006 05:35:08 +0000 (05:35 +0000) |
src/libcola/connected_components.cpp | patch | blob | history | |
src/libvpsc/remove_rectangle_overlap.h | patch | blob | history |
index 7e72d46a786086b992f43f46e05739ddb97bef60..0cf6ee45a2bb90f14766ce5820339eb7a87cc57c 100644 (file)
#include <map>
-#include "cola.h"
+#include <list>
#include <libvpsc/remove_rectangle_overlap.h>
+#include "cola.h"
using namespace std;
namespace cola {
unsigned id;
bool visited;
vector<Node*> neighbours;
+ list<Node*>::iterator listPos;
Rectangle* r;
};
// Depth first search traversal of graph to find connected component
void dfs(Node* v,
- set<Node*>& remaining,
+ list<Node*>& remaining,
Component* component,
map<unsigned,pair<Component*,unsigned> > &cmap) {
v->visited=true;
- remaining.erase(v);
+ remaining.erase(v->listPos);
cmap[v->id]=make_pair(component,component->node_ids.size());
component->node_ids.push_back(v->id);
component->rects.push_back(v->r);
vector<Component*> &components) {
unsigned n=rs.size();
vector<Node> vs(n);
- set<Node*> remaining;
+ list<Node*> remaining;
for(unsigned i=0;i<n;i++) {
vs[i].id=i;
vs[i].visited=false;
vs[i].r=rs[i];
- remaining.insert(&vs[i]);
+ vs[i].listPos = remaining.insert(remaining.end(),&vs[i]);
}
vector<Edge>::const_iterator ei;
SimpleConstraints::const_iterator ci;
index 82f3ef4948e6cd123efefb93b500c1ae7a06a663..baa15b5945a70ca9111c04476a3cc3434c9d6ec3 100644 (file)
*
* Released under GNU LGPL. Read the file 'COPYING' for more information.
*/
-
-class vpsc::Rectangle;
+namespace vpsc {
+ class Rectangle;
+}
void removeRectangleOverlap(unsigned n, vpsc::Rectangle *rs[], double xBorder, double yBorder);