Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
216 changes: 108 additions & 108 deletions cola/libavoid/tests/2junctions.cpp
Original file line number Diff line number Diff line change
@@ -1,108 +1,108 @@
#include "libavoid/libavoid.h"
#include <sstream>
using namespace Avoid;
int 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);
router1->setRoutingOption(Avoid::penaliseOrthogonalSharedPathsAtConnEnds, true);
router1->setRoutingParameter(idealNudgingDistance, 25);
poly = Avoid::Polygon(4);
poly.setPoint(0, Avoid::Point(51410, 50640));
poly.setPoint(1, Avoid::Point(51410, 50960));
poly.setPoint(2, Avoid::Point(51050, 50960));
poly.setPoint(3, Avoid::Point(51050, 50640));
Avoid::ShapeRef * shape365249936 = new Avoid::ShapeRef(router1, poly, 365249936);
Avoid::ShapeConnectionPin * pin365249936_2 = new Avoid::ShapeConnectionPin(shape365249936, 3, 0, 0.5, true, 10, 4);
pin365249936_2->setExclusive(true);
Avoid::ShapeConnectionPin * pin365249936_4 = new Avoid::ShapeConnectionPin(shape365249936, 5, 0, 0.734375, true, 10, 4);
pin365249936_4->setExclusive(true);
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_1 = new Avoid::ShapeConnectionPin(shape386142480, 2, 0.5, 1, true, 10, 2);
pin386142480_1->setExclusive(true);
Avoid::JunctionRef * junction328922310 = new Avoid::JunctionRef(router1, Avoid::Point(50700, 50800), 328922310);
junction328922310->setPositionFixed(true);
end1 = Avoid::ConnEnd(shape365249936, 3);
end2 = Avoid::ConnEnd(junction328922310);
/*Avoid::ConnRef * conn152169328 = */ new Avoid::ConnRef(router1, end1, end2);
end1 = Avoid::ConnEnd(junction328922310);
end2 = Avoid::ConnEnd(shape386142480, 2);
/*Avoid::ConnRef * conn684888074 = */ new Avoid::ConnRef(router1, end1, end2);
end1 = Avoid::ConnEnd(shape365249936, 5);
end2 = Avoid::ConnEnd(junction328922310);
Avoid::ConnRef * conn18168360 = new Avoid::ConnRef(router1, end1, end2);
router1->processTransaction();
router1->outputDiagram("output/2junctions-1");
poly = Avoid::Polygon(4);
poly.setPoint(0, Avoid::Point(50879, 50885));
poly.setPoint(1, Avoid::Point(50879, 50960));
poly.setPoint(2, Avoid::Point(50821, 50960));
poly.setPoint(3, Avoid::Point(50821, 50885));
Avoid::ShapeRef * shape150429385 = new Avoid::ShapeRef(router1, poly, 150429385);
Avoid::ShapeConnectionPin * pin150429385_0 = new Avoid::ShapeConnectionPin(shape150429385, 1, 0.5, 0, true, 10, 1);
pin150429385_0->setExclusive(true);
Avoid::JunctionRef * junction550292508 = new Avoid::JunctionRef(router1, Avoid::Point(50850, 50875), 550292508);
router1->deleteConnector(conn18168360);
conn18168360 = nullptr;
end1 = Avoid::ConnEnd(shape365249936, 5);
end2 = Avoid::ConnEnd(junction550292508);
Avoid::ConnRef * conn795337150 = new Avoid::ConnRef(router1, end1, end2);
conn795337150->makePathInvalid();
end1 = Avoid::ConnEnd(junction550292508);
end2 = Avoid::ConnEnd(junction328922310);
Avoid::ConnRef * conn151961380 = new Avoid::ConnRef(router1, end1, end2);
conn151961380->makePathInvalid();
end1 = Avoid::ConnEnd(shape150429385, 1);
end2 = Avoid::ConnEnd(junction550292508);
Avoid::ConnRef * conn149180423 = new Avoid::ConnRef(router1, end1, end2);
conn149180423->makePathInvalid();
router1->processTransaction();
router1->outputDiagram("output/2junctions-2");
/*
junction550292508->setPositionFixed(true);
router1->deleteShape(shape365249936);
shape365249936 = nullptr;
router1->deleteShape(shape386142480);
shape386142480 = nullptr;
router1->deleteJunction(junction328922310);
junction328922310 = nullptr;
router1->deleteConnector(conn152169328);
conn152169328 = nullptr;
router1->deleteConnector(conn684888074);
conn684888074 = nullptr;
router1->deleteShape(shape150429385);
shape150429385 = nullptr;
router1->deleteJunction(junction550292508);
junction550292508 = nullptr;
router1->deleteConnector(conn795337150);
conn795337150 = nullptr;
router1->deleteConnector(conn151961380);
conn151961380 = nullptr;
router1->deleteConnector(conn149180423);
conn149180423 = nullptr;
router1->processTransaction();
*/
bool atEnds = true;
bool overlap = router1->existsOrthogonalFixedSegmentOverlap(atEnds);
delete router1;
return (overlap) ? 1 : 0;
}
extern "C" int main(void)
{
return test();
}
#include "libavoid/libavoid.h"
#include <sstream>
using namespace Avoid;

int test()
{
ConnEnd end1;
ConnEnd end2;
Polygon poly;
Router * router1 = new Router(OrthogonalRouting);
router1->setTransactionUse(true);
router1->setRoutingPenalty(segmentPenalty);
router1->setRoutingPenalty(crossingPenalty);
router1->setRoutingPenalty(fixedSharedPathPenalty);
router1->setRoutingOption(penaliseOrthogonalSharedPathsAtConnEnds, true);
router1->setRoutingParameter(idealNudgingDistance, 25);
poly = Polygon(4);
poly.setPoint(0, Point(51410, 50640));
poly.setPoint(1, Point(51410, 50960));
poly.setPoint(2, Point(51050, 50960));
poly.setPoint(3, Point(51050, 50640));
ShapeRef * shape365249936 = new ShapeRef(router1, poly, 365249936);
ShapeConnectionPin * pin365249936_2 = new ShapeConnectionPin(shape365249936, 3, 0, 0.5, true, 10, 4);
pin365249936_2->setExclusive(true);
ShapeConnectionPin * pin365249936_4 = new ShapeConnectionPin(shape365249936, 5, 0, 0.734375, true, 10, 4);
pin365249936_4->setExclusive(true);
poly = Polygon(4);
poly.setPoint(0, Point(50760, 50691));
poly.setPoint(1, Point(50760, 50775));
poly.setPoint(2, Point(50640, 50775));
poly.setPoint(3, Point(50640, 50691));
ShapeRef * shape386142480 = new ShapeRef(router1, poly, 386142480);
ShapeConnectionPin * pin386142480_1 = new ShapeConnectionPin(shape386142480, 2, 0.5, 1, true, 10, 2);
pin386142480_1->setExclusive(true);
JunctionRef * junction328922310 = new JunctionRef(router1, Point(50700, 50800), 328922310);
junction328922310->setPositionFixed(true);
end1 = ConnEnd(shape365249936, 3);
end2 = ConnEnd(junction328922310);
/*ConnRef * conn152169328 = */ new ConnRef(router1, end1, end2);
end1 = ConnEnd(junction328922310);
end2 = ConnEnd(shape386142480, 2);
/*ConnRef * conn684888074 = */ new ConnRef(router1, end1, end2);
end1 = ConnEnd(shape365249936, 5);
end2 = ConnEnd(junction328922310);
ConnRef * conn18168360 = new ConnRef(router1, end1, end2);
router1->processTransaction();

router1->outputDiagram("output/2junctions-1");
poly = Polygon(4);
poly.setPoint(0, Point(50879, 50885));
poly.setPoint(1, Point(50879, 50960));
poly.setPoint(2, Point(50821, 50960));
poly.setPoint(3, Point(50821, 50885));
ShapeRef * shape150429385 = new ShapeRef(router1, poly, 150429385);
ShapeConnectionPin * pin150429385_0 = new ShapeConnectionPin(shape150429385, 1, 0.5, 0, true, 10, 1);
pin150429385_0->setExclusive(true);
JunctionRef * junction550292508 = new JunctionRef(router1, Point(50850, 50875), 550292508);
router1->deleteConnector(conn18168360);
conn18168360 = nullptr;
end1 = ConnEnd(shape365249936, 5);
end2 = ConnEnd(junction550292508);
ConnRef * conn795337150 = new ConnRef(router1, end1, end2);
conn795337150->makePathInvalid();
end1 = ConnEnd(junction550292508);
end2 = ConnEnd(junction328922310);
ConnRef * conn151961380 = new ConnRef(router1, end1, end2);
conn151961380->makePathInvalid();
end1 = ConnEnd(shape150429385, 1);
end2 = ConnEnd(junction550292508);
ConnRef * conn149180423 = new ConnRef(router1, end1, end2);
conn149180423->makePathInvalid();
router1->processTransaction();

router1->outputDiagram("output/2junctions-2");
/*
junction550292508->setPositionFixed(true);
router1->deleteShape(shape365249936);
shape365249936 = nullptr;
router1->deleteShape(shape386142480);
shape386142480 = nullptr;
router1->deleteJunction(junction328922310);
junction328922310 = nullptr;
router1->deleteConnector(conn152169328);
conn152169328 = nullptr;
router1->deleteConnector(conn684888074);
conn684888074 = nullptr;
router1->deleteShape(shape150429385);
shape150429385 = nullptr;
router1->deleteJunction(junction550292508);
junction550292508 = nullptr;
router1->deleteConnector(conn795337150);
conn795337150 = nullptr;
router1->deleteConnector(conn151961380);
conn151961380 = nullptr;
router1->deleteConnector(conn149180423);
conn149180423 = nullptr;
router1->processTransaction();
*/
bool atEnds = true;
bool overlap = router1->existsOrthogonalFixedSegmentOverlap(atEnds);
delete router1;
return (overlap) ? 1 : 0;
}

extern "C" int main(void)
{
return test();
}
130 changes: 65 additions & 65 deletions cola/libavoid/tests/buildOrthogonalChannelInfo1.cpp
Original file line number Diff line number Diff line change
@@ -1,65 +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;
}
#include "libavoid/libavoid.h"
#include <sstream>
using namespace Avoid;

void test()
{
ConnEnd end1;
ConnEnd end2;
Polygon poly;
Router * router1 = new Router(OrthogonalRouting);
router1->setTransactionUse(true);
router1->setRoutingPenalty(segmentPenalty);
router1->setRoutingPenalty(crossingPenalty);
router1->setRoutingPenalty(fixedSharedPathPenalty, 9000);
router1->setRoutingOption(penaliseOrthogonalSharedPathsAtConnEnds, true);
router1->setRoutingParameter(idealNudgingDistance, 25);
poly = Polygon(4);
poly.setPoint(0, Point(50760, 50691));
poly.setPoint(1, Point(50760, 50775));
poly.setPoint(2, Point(50640, 50775));
poly.setPoint(3, Point(50640, 50691));
ShapeRef * shape386142480 = new ShapeRef(router1, poly, 386142480);
ShapeConnectionPin * pin386142480_0 = new ShapeConnectionPin(shape386142480, 1, 0.5, 0.40476190476190477, true, 0, 13);
pin386142480_0->setExclusive(true);
ShapeConnectionPin * pin386142480_1 = new ShapeConnectionPin(shape386142480, 2, 0.5, 1, true, 10, 2);
pin386142480_1->setExclusive(true);
poly = Polygon(4);
poly.setPoint(0, Point(51185, 50765));
poly.setPoint(1, Point(51185, 50935));
poly.setPoint(2, Point(50975, 50935));
poly.setPoint(3, Point(50975, 50765));
ShapeRef * shape300136482 = new ShapeRef(router1, poly, 300136482);
ShapeConnectionPin * pin300136482_0 = new ShapeConnectionPin(shape300136482, 1, 0, 0.5, true, 10, 4);
pin300136482_0->setExclusive(true);
ShapeConnectionPin * pin300136482_1 = new ShapeConnectionPin(shape300136482, 2, 0.95238095238095233, 0.5, true, 10, 8);
pin300136482_1->setExclusive(true);
poly = Polygon(4);
poly.setPoint(0, Point(50854, 50840));
poly.setPoint(1, Point(50854, 50935));
poly.setPoint(2, Point(50796, 50935));
poly.setPoint(3, Point(50796, 50840));
ShapeRef * shape51003942 = new ShapeRef(router1, poly, 51003942);
ShapeConnectionPin * pin51003942_0 = new ShapeConnectionPin(shape51003942, 1, 0.5, 0.10526315789473684, true, 10, 1);
pin51003942_0->setExclusive(true);
JunctionRef * junction502411221 = new JunctionRef(router1, Point(50825, 50850), 502411221);
end1 = ConnEnd(shape386142480, 2);
end2 = ConnEnd(junction502411221);
new ConnRef(router1, end1, end2);
end1 = ConnEnd(junction502411221);
end2 = ConnEnd(shape300136482, 1);
new ConnRef(router1, end1, end2);
end1 = ConnEnd(shape51003942, 1);
end2 = ConnEnd(junction502411221);
new ConnRef(router1, end1, end2);
router1->processTransaction();

router1->outputDiagram("output/buildOrthogonalChannelInfo1");
delete router1;
}

extern "C" int main(void)
{
test();
return 0;
}
4 changes: 2 additions & 2 deletions cola/libavoid/tests/checkpoints02.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ int main(void) {

bool succeeded = true;
double checkpointY = 55.07523140617849;
Avoid::PolyLine route109 = connRef109->displayRoute();
PolyLine route109 = connRef109->displayRoute();
if (fabs(route109.ps[route109.size() - 3].y - checkpointY) < 2)
{
succeeded = false;
}

Avoid::PolyLine route110 = connRef110->displayRoute();
PolyLine route110 = connRef110->displayRoute();
if (fabs(route110.ps[route110.size() - 3].y - checkpointY) < 2)
{
succeeded = false;
Expand Down
4 changes: 2 additions & 2 deletions cola/libavoid/tests/checkpoints03.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ int main(void) {
router->outputDiagram("output/checkpoints03");

bool succeeded = true;
Avoid::PolyLine route149 = connRef149->displayRoute();
Avoid::PolyLine route150 = connRef150->displayRoute();
PolyLine route149 = connRef149->displayRoute();
PolyLine route150 = connRef150->displayRoute();
if (route149.size() > 4 || route150.size() > 4)
{
// Five segments weren't merged into three. The segments in the shape
Expand Down
Loading