summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5a77b83)
raw | patch | inline | side by side (parent: 5a77b83)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Mon, 30 Jun 2008 19:41:29 +0000 (19:41 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Mon, 30 Jun 2008 19:41:29 +0000 (19:41 +0000) |
src/display/curve.cpp | patch | blob | history | |
src/display/curve.h | patch | blob | history |
diff --git a/src/display/curve.cpp b/src/display/curve.cpp
index af26fdda459fd7d4983c637ccdb62ce542bebb92..6c4baaa96560fc4a3ecf9c11d162a235394981b9 100644 (file)
--- a/src/display/curve.cpp
+++ b/src/display/curve.cpp
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 e67c3897ab302fc7936e3eb3b32d254f7c107ed8..7dee3dbf10316c62020759f67dcc47e52c6a13d7 100644 (file)
--- a/src/display/curve.h
+++ b/src/display/curve.h
Geom::PathVector const & get_pathvector() const;
guint get_length() const;
+ guint get_segment_count() const;
SPCurve * ref();
SPCurve * unref();