diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2010-01-10 00:46:28 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2010-01-10 00:46:28 +0000 |
| commit | b52865a71a9f83da9719a3ec5f50a4a2cd7cdace (patch) | |
| tree | 6d8def69ad0aa28aa4414dc9d501707444a5419b /src/ui/tool/control-point-selection.h | |
| parent | Implement selection linear grow (diff) | |
| download | inkscape-b52865a71a9f83da9719a3ec5f50a4a2cd7cdace.tar.gz inkscape-b52865a71a9f83da9719a3ec5f50a4a2cd7cdace.zip | |
* Implement node snapping.
* Fix minor bug in linear grow.
* Add --fixes.
* Move some node selection-related functions to ControlPointSelection.
Fixed bugs:
- https://launchpad.net/bugs/170561
- https://launchpad.net/bugs/171893
- https://launchpad.net/bugs/182585
- https://launchpad.net/bugs/446773
(bzr r8846.2.9)
Diffstat (limited to 'src/ui/tool/control-point-selection.h')
| -rw-r--r-- | src/ui/tool/control-point-selection.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/ui/tool/control-point-selection.h b/src/ui/tool/control-point-selection.h index 0f0daffaa..38df5c7e5 100644 --- a/src/ui/tool/control-point-selection.h +++ b/src/ui/tool/control-point-selection.h @@ -14,6 +14,7 @@ #include <memory> #include <tr1/unordered_map> +#include <tr1/unordered_set> #include <boost/shared_ptr.hpp> #include <boost/weak_ptr.hpp> #include <boost/optional.hpp> @@ -43,12 +44,12 @@ public: typedef std::list<sigc::connection> connlist_type; typedef std::unordered_map< SelectableControlPoint *, boost::shared_ptr<connlist_type> > map_type; + typedef std::unordered_set< SelectableControlPoint * > set_type; + typedef set_type Set; // convenience alias - // boilerplate typedefs typedef map_type::iterator iterator; typedef map_type::const_iterator const_iterator; typedef map_type::size_type size_type; - typedef SelectableControlPoint *value_type; typedef SelectableControlPoint *key_type; @@ -80,6 +81,15 @@ public: // find iterator find(const key_type &k) { return _points.find(k); } + // Sometimes it is very useful to keep a list of all selectable points. + set_type const &allPoints() const { return _all_points; } + set_type &allPoints() { return _all_points; } + // ...for example in these methods. Another useful case is snapping. + void selectAll(); + void selectArea(Geom::Rect const &); + void invertSelection(); + void spatialGrow(SelectableControlPoint *origin, int dir); + virtual bool event(GdkEvent *); void transform(Geom::Matrix const &m); @@ -113,6 +123,7 @@ private: void _keyboardTransform(Geom::Matrix const &); void _commitTransform(CommitEvent ce); map_type _points; + set_type _all_points; boost::optional<double> _rot_radius; TransformHandleSet *_handles; SelectableControlPoint *_grabbed_point; |
