From 6b61296109001d15cd1e2a43c38385b5fdba81c7 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Sun, 4 Oct 2015 03:31:27 +0200 Subject: Add improvements to measure tool: more responsive add option to handle only active layer or all add a option to hide/show first and last segment add a option to compute only one global sice (bzr r14393.1.1) --- src/document.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/document.h') diff --git a/src/document.h b/src/document.h index dd1e295a2..be3f106d8 100644 --- a/src/document.h +++ b/src/document.h @@ -262,7 +262,7 @@ public: std::vector getItemsInBox(unsigned int dkey, Geom::Rect const &box) const; std::vector getItemsPartiallyInBox(unsigned int dkey, Geom::Rect const &box) const; SPItem *getItemAtPoint(unsigned int key, Geom::Point const &p, bool into_groups, SPItem *upto = NULL) const; - std::vector getItemsAtPoints(unsigned const key, std::vector points) const; + std::vector getItemsAtPoints(unsigned const key, std::vector points, bool all_layers = true, size_t limit = 0) const; SPItem *getGroupAtPoint(unsigned int key, Geom::Point const &p) const; void changeUriAndHrefs(char const *uri); -- cgit v1.2.3 From 93650897c928bfa9ca9b737cfbff55c25271d5d3 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Tue, 8 Dec 2015 00:34:32 +0100 Subject: cppification : GHashMaps replaced by stl maps. getResouceList now gives a std::set. Should give some performance improvements (quite a few linear lookups are now logarithmic) (bzr r14504.1.6) --- src/document.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/document.h') diff --git a/src/document.h b/src/document.h index be3f106d8..c7d3abf90 100644 --- a/src/document.h +++ b/src/document.h @@ -27,6 +27,7 @@ #include #include #include +#include namespace Avoid { class Router; @@ -258,7 +259,7 @@ public: int ensureUpToDate(); bool addResource(char const *key, SPObject *object); bool removeResource(char const *key, SPObject *object); - const GSList *getResourceList(char const *key) const; + const std::set getResourceList(char const *key) const; std::vector getItemsInBox(unsigned int dkey, Geom::Rect const &box) const; std::vector getItemsPartiallyInBox(unsigned int dkey, Geom::Rect const &box) const; SPItem *getItemAtPoint(unsigned int key, Geom::Point const &p, bool into_groups, SPItem *upto = NULL) const; -- cgit v1.2.3 From cfd295134c9804bf98fba835361000a891c2fa56 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Tue, 8 Dec 2015 23:18:50 +0100 Subject: cppification: GSList replaced by vectors (undo/redo) (bzr r14504.1.14) --- src/document.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/document.h') diff --git a/src/document.h b/src/document.h index c7d3abf90..cf8ebc3cb 100644 --- a/src/document.h +++ b/src/document.h @@ -122,7 +122,7 @@ public: // Instance of the connector router Avoid::Router *router; - GSList *_collection_queue; + std::vector _collection_queue; bool oldSignalsConnected; -- cgit v1.2.3 From 7c5342d04a8c59714becfdf0ceb8ea1de4686736 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Sun, 7 Feb 2016 01:12:34 +0100 Subject: Fix for bug 1540518. Improved performance based on previous meassure code comment Fixed bugs: - https://launchpad.net/bugs/1540518 (bzr r14635) --- src/document.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/document.h') diff --git a/src/document.h b/src/document.h index cf8ebc3cb..b4a8a8e8e 100644 --- a/src/document.h +++ b/src/document.h @@ -260,8 +260,8 @@ public: bool addResource(char const *key, SPObject *object); bool removeResource(char const *key, SPObject *object); const std::set getResourceList(char const *key) const; - std::vector getItemsInBox(unsigned int dkey, Geom::Rect const &box) const; - std::vector getItemsPartiallyInBox(unsigned int dkey, Geom::Rect const &box) const; + std::vector getItemsInBox(unsigned int dkey, Geom::Rect const &box, bool into_groups = false) const; + std::vector getItemsPartiallyInBox(unsigned int dkey, Geom::Rect const &box, bool into_groups = false) const; SPItem *getItemAtPoint(unsigned int key, Geom::Point const &p, bool into_groups, SPItem *upto = NULL) const; std::vector getItemsAtPoints(unsigned const key, std::vector points, bool all_layers = true, size_t limit = 0) const; SPItem *getGroupAtPoint(unsigned int key, Geom::Point const &p) const; -- cgit v1.2.3 From f200503cc154d84f3e4aa87400c1c045bfa80937 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Tue, 16 Feb 2016 02:42:58 +0100 Subject: Performance improvements when working in large files At each mouse move, a list of all elements in the document was computed (to get the correct cursor, in text mode for instance). This list is now cached. (bzr r14655) --- src/document.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/document.h') diff --git a/src/document.h b/src/document.h index b4a8a8e8e..b57cf205d 100644 --- a/src/document.h +++ b/src/document.h @@ -28,6 +28,7 @@ #include #include #include +#include namespace Avoid { class Router; @@ -262,8 +263,8 @@ public: const std::set getResourceList(char const *key) const; std::vector getItemsInBox(unsigned int dkey, Geom::Rect const &box, bool into_groups = false) const; std::vector getItemsPartiallyInBox(unsigned int dkey, Geom::Rect const &box, bool into_groups = false) const; - SPItem *getItemAtPoint(unsigned int key, Geom::Point const &p, bool into_groups, SPItem *upto = NULL) const; - std::vector getItemsAtPoints(unsigned const key, std::vector points, bool all_layers = true, size_t limit = 0) const; + SPItem *getItemAtPoint(unsigned int key, Geom::Point const &p, bool into_groups, SPItem *upto = NULL) ; + std::vector getItemsAtPoints(unsigned const key, std::vector points, bool all_layers = true, size_t limit = 0) ; SPItem *getGroupAtPoint(unsigned int key, Geom::Point const &p) const; void changeUriAndHrefs(char const *uri); @@ -277,6 +278,9 @@ private: void do_change_uri(char const *const filename, bool const rebase); void setupViewport(SPItemCtx *ctx); void importDefsNode(SPDocument *source, Inkscape::XML::Node *defs, Inkscape::XML::Node *target_defs); + bool build_flat_item_list(unsigned int dkey, SPGroup *group, gboolean into_groups, bool take_insensitive = false, SPItem *upto = NULL); + std::deque _node_cache; + bool _node_cache_valid; }; /* -- cgit v1.2.3 From 109ec952f041590ee5f42ac6e7d6bd5c212c9441 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Thu, 18 Feb 2016 00:38:22 +0100 Subject: Fixes some regressions from rev14655 Fixed bugs: - https://launchpad.net/bugs/1546531 (bzr r14658) --- src/document.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/document.h') diff --git a/src/document.h b/src/document.h index b57cf205d..825049cd5 100644 --- a/src/document.h +++ b/src/document.h @@ -263,8 +263,8 @@ public: const std::set getResourceList(char const *key) const; std::vector getItemsInBox(unsigned int dkey, Geom::Rect const &box, bool into_groups = false) const; std::vector getItemsPartiallyInBox(unsigned int dkey, Geom::Rect const &box, bool into_groups = false) const; - SPItem *getItemAtPoint(unsigned int key, Geom::Point const &p, bool into_groups, SPItem *upto = NULL) ; - std::vector getItemsAtPoints(unsigned const key, std::vector points, bool all_layers = true, size_t limit = 0) ; + SPItem *getItemAtPoint(unsigned int key, Geom::Point const &p, bool into_groups, SPItem *upto = NULL) const; + std::vector getItemsAtPoints(unsigned const key, std::vector points, bool all_layers = true, size_t limit = 0) const ; SPItem *getGroupAtPoint(unsigned int key, Geom::Point const &p) const; void changeUriAndHrefs(char const *uri); @@ -278,9 +278,9 @@ private: void do_change_uri(char const *const filename, bool const rebase); void setupViewport(SPItemCtx *ctx); void importDefsNode(SPDocument *source, Inkscape::XML::Node *defs, Inkscape::XML::Node *target_defs); - bool build_flat_item_list(unsigned int dkey, SPGroup *group, gboolean into_groups, bool take_insensitive = false, SPItem *upto = NULL); - std::deque _node_cache; - bool _node_cache_valid; + void build_flat_item_list(unsigned int dkey, SPGroup *group, gboolean into_groups) const; + mutable std::deque _node_cache; + mutable bool _node_cache_valid; }; /* -- cgit v1.2.3