From 3ffd21aa6e7c4cf44633f3e1d583097007b3fb80 Mon Sep 17 00:00:00 2001 From: mjwybrow Date: Wed, 1 Mar 2006 01:48:07 +0000 Subject: * src/conn-avoid-ref.cpp, src/libavoid/connector.h, src/libavoid/shape.cpp, src/libavoid/graph.cpp, src/libavoid/shape.h, src/libavoid/graph.h, src/libavoid/router.cpp, src/libavoid/router.h, src/libavoid/connector.cpp, src/libavoid/debug.h: Some speed improvements and interface cleanups to libavoid. (bzr r192) --- src/libavoid/shape.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/libavoid/shape.cpp') diff --git a/src/libavoid/shape.cpp b/src/libavoid/shape.cpp index f2fd6d6b3..84f0312ee 100644 --- a/src/libavoid/shape.cpp +++ b/src/libavoid/shape.cpp @@ -100,6 +100,31 @@ ShapeRef::~ShapeRef() } +void ShapeRef::setNewPoly(Polygn& poly) +{ + assert(_firstVert != NULL); + assert(_poly.pn == poly.pn); + + VertInf *curr = _firstVert; + for (int pt_i = 0; pt_i < _poly.pn; pt_i++) + { + assert(curr->visListSize == 0); + assert(curr->invisListSize == 0); + + // Reset with the new polygon point. + curr->Reset(poly.ps[pt_i]); + curr->pathNext = NULL; + curr->pathDist = 0; + + curr = curr->shNext; + } + assert(curr == _firstVert); + + freePoly(_poly); + _poly = copyPoly(poly); +} + + void ShapeRef::makeActive(void) { assert(!_active); -- cgit v1.2.3