summaryrefslogtreecommitdiffstats
path: root/src/libavoid/tests/buildOrthogonalChannelInfo1.cpp
diff options
context:
space:
mode:
authorSylvain Chiron <chironsylvain@orange.fr>2017-07-01 11:36:41 +0000
committerSylvain Chiron <chironsylvain@orange.fr>2017-07-01 11:36:41 +0000
commitfd733201b82f39655488a286c89142f321ef9dc9 (patch)
treea12c70f213414f69467f666619b1552103f6370e /src/libavoid/tests/buildOrthogonalChannelInfo1.cpp
parentHackfest icon work: restore selected menu icons and make theming easier (diff)
downloadinkscape-fd733201b82f39655488a286c89142f321ef9dc9.tar.gz
inkscape-fd733201b82f39655488a286c89142f321ef9dc9.zip
Updated libs from the Adaptagrams project: libavoid, libcola and libvspc; changed the code to match the new API
Signed-off-by: Sylvain Chiron <chironsylvain@orange.fr>
Diffstat (limited to 'src/libavoid/tests/buildOrthogonalChannelInfo1.cpp')
-rw-r--r--src/libavoid/tests/buildOrthogonalChannelInfo1.cpp65
1 files changed, 65 insertions, 0 deletions
diff --git a/src/libavoid/tests/buildOrthogonalChannelInfo1.cpp b/src/libavoid/tests/buildOrthogonalChannelInfo1.cpp
new file mode 100644
index 000000000..ef2144adc
--- /dev/null
+++ b/src/libavoid/tests/buildOrthogonalChannelInfo1.cpp
@@ -0,0 +1,65 @@
+#include "libavoid/libavoid.h"
+#include <sstream>
+using namespace Avoid;
+
+void test()
+{
+ Avoid::ConnEnd end1;
+ Avoid::ConnEnd end2;
+ Avoid::Polygon poly;
+ Avoid::Router * router1 = new Avoid::Router(Avoid::OrthogonalRouting);
+ router1->setTransactionUse(true);
+ router1->setRoutingPenalty(Avoid::segmentPenalty);
+ router1->setRoutingPenalty(Avoid::crossingPenalty);
+ router1->setRoutingPenalty(Avoid::fixedSharedPathPenalty, 9000);
+ router1->setRoutingOption(Avoid::penaliseOrthogonalSharedPathsAtConnEnds, true);
+ router1->setRoutingParameter(idealNudgingDistance, 25);
+ poly = Avoid::Polygon(4);
+ poly.setPoint(0, Avoid::Point(50760, 50691));
+ poly.setPoint(1, Avoid::Point(50760, 50775));
+ poly.setPoint(2, Avoid::Point(50640, 50775));
+ poly.setPoint(3, Avoid::Point(50640, 50691));
+ Avoid::ShapeRef * shape386142480 = new Avoid::ShapeRef(router1, poly, 386142480);
+ Avoid::ShapeConnectionPin * pin386142480_0 = new Avoid::ShapeConnectionPin(shape386142480, 1, 0.5, 0.40476190476190477, true, 0, 13);
+ pin386142480_0->setExclusive(true);
+ Avoid::ShapeConnectionPin * pin386142480_1 = new Avoid::ShapeConnectionPin(shape386142480, 2, 0.5, 1, true, 10, 2);
+ pin386142480_1->setExclusive(true);
+ poly = Avoid::Polygon(4);
+ poly.setPoint(0, Avoid::Point(51185, 50765));
+ poly.setPoint(1, Avoid::Point(51185, 50935));
+ poly.setPoint(2, Avoid::Point(50975, 50935));
+ poly.setPoint(3, Avoid::Point(50975, 50765));
+ Avoid::ShapeRef * shape300136482 = new Avoid::ShapeRef(router1, poly, 300136482);
+ Avoid::ShapeConnectionPin * pin300136482_0 = new Avoid::ShapeConnectionPin(shape300136482, 1, 0, 0.5, true, 10, 4);
+ pin300136482_0->setExclusive(true);
+ Avoid::ShapeConnectionPin * pin300136482_1 = new Avoid::ShapeConnectionPin(shape300136482, 2, 0.95238095238095233, 0.5, true, 10, 8);
+ pin300136482_1->setExclusive(true);
+ poly = Avoid::Polygon(4);
+ poly.setPoint(0, Avoid::Point(50854, 50840));
+ poly.setPoint(1, Avoid::Point(50854, 50935));
+ poly.setPoint(2, Avoid::Point(50796, 50935));
+ poly.setPoint(3, Avoid::Point(50796, 50840));
+ Avoid::ShapeRef * shape51003942 = new Avoid::ShapeRef(router1, poly, 51003942);
+ Avoid::ShapeConnectionPin * pin51003942_0 = new Avoid::ShapeConnectionPin(shape51003942, 1, 0.5, 0.10526315789473684, true, 10, 1);
+ pin51003942_0->setExclusive(true);
+ Avoid::JunctionRef * junction502411221 = new Avoid::JunctionRef(router1, Avoid::Point(50825, 50850), 502411221);
+ end1 = Avoid::ConnEnd(shape386142480, 2);
+ end2 = Avoid::ConnEnd(junction502411221);
+ new Avoid::ConnRef(router1, end1, end2);
+ end1 = Avoid::ConnEnd(junction502411221);
+ end2 = Avoid::ConnEnd(shape300136482, 1);
+ new Avoid::ConnRef(router1, end1, end2);
+ end1 = Avoid::ConnEnd(shape51003942, 1);
+ end2 = Avoid::ConnEnd(junction502411221);
+ new Avoid::ConnRef(router1, end1, end2);
+ router1->processTransaction();
+
+ router1->outputDiagram("output/buildOrthogonalChannelInfo1");
+ delete router1;
+}
+
+extern "C" int main(void)
+{
+ test();
+ return 0;
+}