summaryrefslogtreecommitdiffstats
path: root/src/libavoid/shape.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libavoid/shape.cpp')
-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);