summaryrefslogtreecommitdiffstats
path: root/src/libavoid/shape.cpp
diff options
context:
space:
mode:
authormjwybrow <mjwybrow@users.sourceforge.net>2006-03-01 01:48:07 +0000
committermjwybrow <mjwybrow@users.sourceforge.net>2006-03-01 01:48:07 +0000
commit3ffd21aa6e7c4cf44633f3e1d583097007b3fb80 (patch)
treeaf77c05c53712821d9bb4011f8d168963159aa82 /src/libavoid/shape.cpp
parentAdd some items from Peter Selinger's patch to Potrace 1.7 (diff)
downloadinkscape-3ffd21aa6e7c4cf44633f3e1d583097007b3fb80.tar.gz
inkscape-3ffd21aa6e7c4cf44633f3e1d583097007b3fb80.zip
* 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)
Diffstat (limited to '')
-rw-r--r--src/libavoid/shape.cpp25
1 files changed, 25 insertions, 0 deletions
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);