summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c5cda41)
raw | patch | inline | side by side (parent: c5cda41)
author | tgdwyer <tgdwyer@users.sourceforge.net> | |
Mon, 17 Jul 2006 05:16:14 +0000 (05:16 +0000) | ||
committer | tgdwyer <tgdwyer@users.sourceforge.net> | |
Mon, 17 Jul 2006 05:16:14 +0000 (05:16 +0000) |
src/graphlayout/graphlayout.cpp | patch | blob | history | |
src/libcola/connected_components.cpp | patch | blob | history |
index 1b77b5afaea2f9bf3fbd2ef25e0095eaa69f303a..dc9dc3ea96d9c28388ffa8e8cd074fd9ac7c8ac7 100644 (file)
map<string,unsigned>::iterator v_pair=nodelookup.find(iv->id);
if(v_pair!=nodelookup.end()) {
unsigned v=v_pair->second;
- cout << "Edge: (" << u <<","<<v<<")"<<endl;
+ //cout << "Edge: (" << u <<","<<v<<")"<<endl;
es.push_back(make_pair(u,v));
if(conn->style->marker[SP_MARKER_LOC_END].set) {
if(directed && strcmp(conn->style->marker[SP_MARKER_LOC_END].value,"none")) {
connectedComponents(rs,es,scx,scy,cs);
for(unsigned i=0;i<cs.size();i++) {
Component* c=cs[i];
- printf("Component %d:\n",i);
- for(unsigned j=0;j<c->edges.size();j++) {
- Edge& e=c->edges[j];
- printf("(%d,%d) ",e.first,e.second);
- }
if(c->edges.size()<2) continue;
- cout << endl;
ConstrainedMajorizationLayout alg(c->rects,c->edges,eweights,ideal_connector_length);
alg.setupConstraints(NULL,NULL,avoid_overlaps,
NULL,NULL,&c->scx,&c->scy,NULL,NULL);
index f626649cd713f70fd06b700b826823591868056a..7e72d46a786086b992f43f46e05739ddb97bef60 100644 (file)
urx=max(urx,rects[i]->getMaxX());
ury=max(ury,rects[i]->getMaxY());
}
- printf("Bounding Box=(%f,%f,%f,%f)\n",llx,urx,lly,ury);
return new Rectangle(llx,urx,lly,ury);
}
vs[i].r=rs[i];
remaining.insert(&vs[i]);
}
- for(vector<Edge>::const_iterator e=es.begin();e!=es.end();e++) {
- vs[e->first].neighbours.push_back(&vs[e->second]);
- vs[e->second].neighbours.push_back(&vs[e->first]);
+ vector<Edge>::const_iterator ei;
+ SimpleConstraints::const_iterator ci;
+ for(ei=es.begin();ei!=es.end();ei++) {
+ vs[ei->first].neighbours.push_back(&vs[ei->second]);
+ vs[ei->second].neighbours.push_back(&vs[ei->first]);
}
map<unsigned,pair<Component*,unsigned> > cmap;
while(!remaining.empty()) {
dfs(v,remaining,component,cmap);
components.push_back(component);
}
- for(vector<Edge>::const_iterator e=es.begin();e!=es.end();e++) {
- pair<Component*,unsigned> u=cmap[e->first],
- v=cmap[e->second];
+ for(ei=es.begin();ei!=es.end();ei++) {
+ pair<Component*,unsigned> u=cmap[ei->first],
+ v=cmap[ei->second];
assert(u.first==v.first);
u.first->edges.push_back(make_pair(u.second,v.second));
}
- for(SimpleConstraints::const_iterator ci=scx.begin();ci!=scx.end();ci++) {
+ for(ci=scx.begin();ci!=scx.end();ci++) {
SimpleConstraint *c=*ci;
pair<Component*,unsigned> u=cmap[c->left],
v=cmap[c->right];
u.first->scx.push_back(
new SimpleConstraint(u.second,v.second,c->gap));
}
- for(SimpleConstraints::const_iterator ci=scy.begin();ci!=scy.end();ci++) {
+ for(ci=scy.begin();ci!=scy.end();ci++) {
SimpleConstraint *c=*ci;
pair<Component*,unsigned> u=cmap[c->left],
v=cmap[c->right];