diff options
| author | mjwybrow <mjwybrow@users.sourceforge.net> | 2006-03-01 01:48:07 +0000 |
|---|---|---|
| committer | mjwybrow <mjwybrow@users.sourceforge.net> | 2006-03-01 01:48:07 +0000 |
| commit | 3ffd21aa6e7c4cf44633f3e1d583097007b3fb80 (patch) | |
| tree | af77c05c53712821d9bb4011f8d168963159aa82 /src/libavoid/shape.cpp | |
| parent | Add some items from Peter Selinger's patch to Potrace 1.7 (diff) | |
| download | inkscape-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.cpp | 25 |
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); |
