From 5cba33aedccdfa79f1c291bc1da8ff2223d5c70a Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 18 Dec 2024 19:56:38 +0000 Subject: Give UI builders an interface that can be programmatically called --- ui/builders/freeExtend.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'ui/builders/freeExtend.cpp') diff --git a/ui/builders/freeExtend.cpp b/ui/builders/freeExtend.cpp index db127e6..904e144 100644 --- a/ui/builders/freeExtend.cpp +++ b/ui/builders/freeExtend.cpp @@ -38,11 +38,11 @@ BuilderFreeExtend::click( case SDL_BUTTON_LEFT: if (p1) { if (const auto p = network->intersectRayNodes(ray)) { - network->addJoins(*p1, p->pos); + createJoin(network, *p1, p->pos); p1 = p->pos; } else if (const auto p = geoData->intersectRay(ray)) { - network->addExtend(*p1, p->first); + createExtend(network, *p1, p->first); p1 = p->first; } } @@ -57,3 +57,15 @@ BuilderFreeExtend::click( return; } } + +Link::CCollection +BuilderFreeExtend::createJoin(Network * network, GlobalPosition3D p1, GlobalPosition3D p2) const +{ + return network->addJoins(p1, p2); +} + +Link::CCollection +BuilderFreeExtend::createExtend(Network * network, GlobalPosition3D p1, GlobalPosition3D p2) const +{ + return network->addExtend(p1, p2); +} -- cgit v1.2.3