summaryrefslogtreecommitdiffstats
path: root/src/sp-conn-end-pair.cpp
diff options
context:
space:
mode:
authormjwybrow <mjwybrow@users.sourceforge.net>2006-02-10 04:23:35 +0000
committermjwybrow <mjwybrow@users.sourceforge.net>2006-02-10 04:23:35 +0000
commitbf26c1cb6feedab295da4823ef571a7e66fc36ed (patch)
tree1c99174b02c8a3c84d4f53403d16b3978bd23e3b /src/sp-conn-end-pair.cpp
parentAdd unit conversion. (diff)
downloadinkscape-bf26c1cb6feedab295da4823ef571a7e66fc36ed.tar.gz
inkscape-bf26c1cb6feedab295da4823ef571a7e66fc36ed.zip
* src/sp-conn-end-pair.cpp, src/sp-conn-end-pair.h,
src/conn-avoid-ref.cpp, src/conn-avoid-ref.h, src/libavoid/connector.cpp, src/libavoid/connector.h, src/libavoid/visibility.cpp: Add some code to allow querying of items and connectors to find out what is attached to them. This will allow graph layout algorithms (currently being work on by Tim Dwyer) to determine a graph structure from the diagram. (bzr r107)
Diffstat (limited to 'src/sp-conn-end-pair.cpp')
-rw-r--r--src/sp-conn-end-pair.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/sp-conn-end-pair.cpp b/src/sp-conn-end-pair.cpp
index ff1005a16..bb5d89107 100644
--- a/src/sp-conn-end-pair.cpp
+++ b/src/sp-conn-end-pair.cpp
@@ -211,9 +211,30 @@ SPConnEndPair::update(void)
_connRef->lateSetup(src, dst);
_connRef->setCallback(&emitPathInvalidationNotification, _path);
}
+ // Store the ID of the objects attached to the connector.
+ storeIds();
}
}
-
+
+
+void SPConnEndPair::storeIds(void)
+{
+ if (_connEnd[0]->href) {
+ GQuark itemId = g_quark_from_string(_connEnd[0]->href);
+ _connRef->setEndPointId(Avoid::VertID::src, itemId);
+ }
+ else {
+ _connRef->setEndPointId(Avoid::VertID::src, 0);
+ }
+ if (_connEnd[1]->href) {
+ GQuark itemId = g_quark_from_string(_connEnd[1]->href);
+ _connRef->setEndPointId(Avoid::VertID::tar, itemId);
+ }
+ else {
+ _connRef->setEndPointId(Avoid::VertID::tar, 0);
+ }
+}
+
bool
SPConnEndPair::isAutoRoutingConn(void)