diff options
| author | Sylvain Chiron <chironsylvain@orange.fr> | 2017-07-01 11:36:41 +0000 |
|---|---|---|
| committer | Sylvain Chiron <chironsylvain@orange.fr> | 2017-07-01 11:36:41 +0000 |
| commit | fd733201b82f39655488a286c89142f321ef9dc9 (patch) | |
| tree | a12c70f213414f69467f666619b1552103f6370e /src/libavoid/tests/inlineoverlap05.cpp | |
| parent | Hackfest icon work: restore selected menu icons and make theming easier (diff) | |
| download | inkscape-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/inlineoverlap05.cpp')
| -rw-r--r-- | src/libavoid/tests/inlineoverlap05.cpp | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/src/libavoid/tests/inlineoverlap05.cpp b/src/libavoid/tests/inlineoverlap05.cpp new file mode 100644 index 000000000..109267902 --- /dev/null +++ b/src/libavoid/tests/inlineoverlap05.cpp @@ -0,0 +1,69 @@ +// From Diplexer-reduced2_libavoid-debug. +#include "libavoid/libavoid.h" +using namespace Avoid; +int main(void) { + Router *router = new Router( + PolyLineRouting | OrthogonalRouting); + router->setRoutingPenalty((PenaltyType)0, 50); + router->setRoutingPenalty((PenaltyType)1, 0); + router->setRoutingPenalty((PenaltyType)2, 0); + router->setRoutingPenalty((PenaltyType)3, 4000); + router->setRoutingPenalty((PenaltyType)4, 110); + router->setRoutingParameter(idealNudgingDistance, 25); + + Polygon poly231469760(4); + poly231469760.ps[0] = Point(6385, 9390); + poly231469760.ps[1] = Point(6385, 9560); + poly231469760.ps[2] = Point(6200, 9560); + poly231469760.ps[3] = Point(6200, 9390); + new ShapeRef(router, poly231469760, 231469760); + + Polygon poly7136376(4); + poly7136376.ps[0] = Point(6560, 9290); + poly7136376.ps[1] = Point(6560, 9460); + poly7136376.ps[2] = Point(6375, 9460); + poly7136376.ps[3] = Point(6375, 9290); + new ShapeRef(router, poly7136376, 7136376); + + Polygon poly215821749(4); + poly215821749.ps[0] = Point(6510, 9540); + poly215821749.ps[1] = Point(6510, 9710); + poly215821749.ps[2] = Point(6325, 9710); + poly215821749.ps[3] = Point(6325, 9540); + new ShapeRef(router, poly215821749, 215821749); + + Polygon poly83086994(4); + poly83086994.ps[0] = Point(5925, 9240); + poly83086994.ps[1] = Point(5925, 10085); + poly83086994.ps[2] = Point(5575, 10085); + poly83086994.ps[3] = Point(5575, 9240); + new ShapeRef(router, poly83086994, 83086994); + + ConnRef *connRef292408794 = new ConnRef(router, 292408794); + ConnEnd srcPt292408794(Point(5915, 9625), 8); + connRef292408794->setSourceEndpoint(srcPt292408794); + ConnEnd dstPt292408794(Point(6210, 9475), 4); + connRef292408794->setDestEndpoint(dstPt292408794); + connRef292408794->setRoutingType((ConnType)2); + + ConnRef *connRef40917776 = new ConnRef(router, 40917776); + ConnEnd srcPt40917776(Point(5915, 9550), 8); + connRef40917776->setSourceEndpoint(srcPt40917776); + ConnEnd dstPt40917776(Point(6385, 9375), 4); + connRef40917776->setDestEndpoint(dstPt40917776); + connRef40917776->setRoutingType((ConnType)2); + + ConnRef *connRef629564142 = new ConnRef(router, 629564142); + ConnEnd srcPt629564142(Point(5915, 9475), 8); + connRef629564142->setSourceEndpoint(srcPt629564142); + ConnEnd dstPt629564142(Point(6335, 9625), 4); + connRef629564142->setDestEndpoint(dstPt629564142); + connRef629564142->setRoutingType((ConnType)2); + + router->processTransaction(); + router->outputDiagram("output/inlineoverlap05"); + bool overlap = router->existsOrthogonalFixedSegmentOverlap(); + delete router; + return (overlap) ? 1 : 0; +}; + |
