diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2008-06-30 19:41:29 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2008-06-30 19:41:29 +0000 |
| commit | acfd550034c5507503ef5f59315117b487baaa17 (patch) | |
| tree | 370485dd5997cc90575b8c3fae97602663fd3f70 /src | |
| parent | Temporary "fix" for the recent pattern crash caused by invalid path data - pl... (diff) | |
| download | inkscape-acfd550034c5507503ef5f59315117b487baaa17.tar.gz inkscape-acfd550034c5507503ef5f59315117b487baaa17.zip | |
add SPCurve::get_segment_count
(bzr r6100)
Diffstat (limited to 'src')
| -rw-r--r-- | src/display/curve.cpp | 16 | ||||
| -rw-r--r-- | src/display/curve.h | 1 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/display/curve.cpp b/src/display/curve.cpp index af26fdda4..6c4baaa96 100644 --- a/src/display/curve.cpp +++ b/src/display/curve.cpp @@ -283,6 +283,22 @@ SPCurve::get_length() const return _end; } +/* + * Returns the number of segments of all paths summed + */ +guint +SPCurve::get_segment_count() const +{ + guint nr = 0; + for(Geom::PathVector::const_iterator it = _pathv.begin(); it != _pathv.end(); ++it) { + nr += (*it).size(); + + if (it->closed()) nr += 1; + } + return nr; +} + + /** * Increase _refcount of curve. * diff --git a/src/display/curve.h b/src/display/curve.h index e67c3897a..7dee3dbf1 100644 --- a/src/display/curve.h +++ b/src/display/curve.h @@ -45,6 +45,7 @@ public: Geom::PathVector const & get_pathvector() const; guint get_length() const; + guint get_segment_count() const; SPCurve * ref(); SPCurve * unref(); |
