diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-05-22 02:59:44 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-05-22 02:59:44 +0400 |
commit | 6fd12c5310e70fad1564d5b040b9bb952cd14eb1 (patch) | |
tree | cfe634ecc4852fab578d77fa1438e8bf840c2b72 /source/blender/freestyle/intern/stroke | |
parent | 07ee0e6f7db72c93040a6c78d543657e12e60864 (diff) |
Added new method Stroke.remove_all_vertices() for removing all vertices from the stroke.
Patch from flokkievids in the BA Freestyle thread, thanks!
Diffstat (limited to 'source/blender/freestyle/intern/stroke')
-rw-r--r-- | source/blender/freestyle/intern/stroke/Stroke.cpp | 9 | ||||
-rw-r--r-- | source/blender/freestyle/intern/stroke/Stroke.h | 4 |
2 files changed, 13 insertions, 0 deletions
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(); diff --git a/source/blender/freestyle/intern/stroke/Stroke.h b/source/blender/freestyle/intern/stroke/Stroke.h index deb70c21b2a..5415d003c5e 100644 --- a/source/blender/freestyle/intern/stroke/Stroke.h +++ b/source/blender/freestyle/intern/stroke/Stroke.h @@ -589,6 +589,10 @@ public: */ void Resample(float iSampling); + /*! Removes all vertices from the Stroke. + */ + void RemoveAllVertices(); + /*! Removes the stroke vertex iVertex * from the stroke. * The length and curvilinear abscissa are updated |