From 6fd12c5310e70fad1564d5b040b9bb952cd14eb1 Mon Sep 17 00:00:00 2001 From: Tamito Kajiyama Date: Tue, 21 May 2013 22:59:44 +0000 Subject: Added new method Stroke.remove_all_vertices() for removing all vertices from the stroke. Patch from flokkievids in the BA Freestyle thread, thanks! --- source/blender/freestyle/intern/stroke/Stroke.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source/blender/freestyle/intern/stroke/Stroke.cpp') diff --git a/source/blender/freestyle/intern/stroke/Stroke.cpp b/source/blender/freestyle/intern/stroke/Stroke.cpp index 79443742573..159e4a39849 100644 --- a/source/blender/freestyle/intern/stroke/Stroke.cpp +++ b/source/blender/freestyle/intern/stroke/Stroke.cpp @@ -644,6 +644,15 @@ void Stroke::Resample(float iSampling) } } +void Stroke::RemoveAllVertices() +{ + vertex_container::iterator it = _Vertices.begin(), itend = _Vertices.end(); + for (; it != itend; ++it) + delete (*it); + _Vertices.clear(); + UpdateLength(); +} + void Stroke::RemoveVertex(StrokeVertex *iVertex) { vertex_container::iterator it = _Vertices.begin(), itend = _Vertices.end(); -- cgit v1.2.3