summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 119f0e3)
raw | patch | inline | side by side (parent: 119f0e3)
author | tgdwyer <tgdwyer@users.sourceforge.net> | |
Mon, 13 Feb 2006 04:13:07 +0000 (04:13 +0000) | ||
committer | tgdwyer <tgdwyer@users.sourceforge.net> | |
Mon, 13 Feb 2006 04:13:07 +0000 (04:13 +0000) |
src/graphlayout/graphlayout.cpp | patch | blob | history |
index a99fdd720f6e9fdfeb09d8d3facdf6389c319fe5..238b39a23a76972e36b7535441563b6623670550 100644 (file)
typedef iterator_property_map<PositionVec::iterator, property_map<Graph, vertex_index_t>::type> PositionMap;
#endif // HAVE_BOOST_GRAPH_LIB
+bool isConnector(SPItem *i) {
+ SPPath *path = NULL;
+ if(SP_IS_PATH(i)) {
+ path = SP_PATH(i);
+ }
+ return path && path->connEndPair.isAutoRoutingConn();
+}
/**
* Takes a list of inkscape items, extracts the graph defined by
* connectors between them, and uses graph layout techniques to find
{
SPItem *u=*it;
std::cout<<"id:"<<u->id<<std::endl;
- SPPath *path = NULL;
- if(SP_IS_PATH(u)) {
- path = SP_PATH(u);
- }
- bool isConn = path && path->connEndPair.isAutoRoutingConn();
- if(!isConn) {
+ if(!isConnector(u)) {
std::cout<<" is a node."<<std::endl;
nodelookup[u->id]=add_vertex(g);
}
++it)
{
SPItem *u=*it;
- if(strncmp(u->id,"path",4)) {
+ if(!isConnector(u)) {
NR::Rect const item_box(sp_item_bbox_desktop(u));
NR::Point const curr(item_box.midpoint());
NR::Point const dest(minX+width/2.0+position[nodelookup[u->id]].x,