summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/display/curve.cpp16
-rw-r--r--src/display/curve.h1
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();