13#ifndef INKSCAPE_UI_TOOL_CONTROL_POINT_SELECTION_H
14#define INKSCAPE_UI_TOOL_CONTROL_POINT_SELECTION_H
18#include <unordered_map>
19#include <unordered_set>
22#include <sigc++/sigc++.h>
36struct ButtonReleaseEvent;
39class TransformHandleSet;
40class SelectableControlPoint;
44 ,
public sigc::trackable
49 using set_type = std::unordered_set<SelectableControlPoint*>;
69 std::pair<iterator, bool>
insert(
const value_type& x,
bool notify =
true,
bool to_update =
true);
70 template <
class InputIterator>
71 void insert(InputIterator first, InputIterator last) {
72 for (; first != last; ++first) {
73 insert(*first,
false,
false);
154 std::unordered_map<SelectableControlPoint *, Geom::Affine>
_last_trans;
Cartesian point / 2D vector and related operations.
3x3 matrix representing an affine transformation.
Axis-aligned rectangle that can be empty.
Sequence of contiguous curves, aka spline.
Two-dimensional point that doubles as a vector.
Group of selected control points.
std::pair< iterator, bool > insert(const value_type &x, bool notify=true, bool to_update=true)
Add a control point to the selection.
SelectableControlPoint * _farthest_point
std::optional< Geom::Point > firstSelectedPoint() const
The first selected point is the first selection a user makes, but only if they selected exactly one p...
std::list< SelectableControlPoint * > _points_list
void _updateTransformHandles(bool preserve_center)
bool transformHandlesEnabled()
sigc::signal< void()> signal_update
Fires when the display needs to be updated to reflect changes.
TransformHandleSet * _handles
void getUnselectedPoints(std::vector< Inkscape::SnapCandidatePoint > &pts)
void selectArea(Geom::Path const &, bool invert=false)
Select all points inside the given rectangle (in desktop coordinates).
sigc::signal< void(std::vector< SelectableControlPoint * >, bool)> signal_selection_changed
const_iterator end() const
std::optional< double > _mouseover_rot_radius
void _pointDragged(Geom::Point &, MotionEvent const &)
set_type::const_iterator const_iterator
void toggleTransformHandlesMode()
set_type::size_type size_type
set_type const & allPoints() const
bool _keyboardRotate(KeyPressEvent const &, int)
Rotates the selected points in the given direction according to the modifier state from the supplied ...
void align(Geom::Dim2 d, AlignTargetNode target=AlignTargetNode::MID_NODE)
Align control points on the specified axis.
void _commitHandlesTransform(CommitEvent ce)
std::unordered_map< SelectableControlPoint *, Geom::Point > _original_positions
~ControlPointSelection() override
void erase(iterator pos, bool to_update=true)
Remove a point from the selection.
bool _keyboardMove(KeyPressEvent const &, Geom::Point const &)
Moves the selected points along the supplied unit vector according to the modifier state of the suppl...
std::unordered_set< SelectableControlPoint * > set_type
void _keyboardTransform(Geom::Affine const &)
Geom::OptRect pointwiseBounds()
Get the bounds of the selection.
SelectableControlPoint * _grabbed_point
SelectableControlPoint * value_type
std::optional< double > _rot_radius
std::optional< Geom::Point > _first_point
bool _keyboardFlip(Geom::Dim2)
unsigned _one_node_handles
bool _keyboardScale(KeyPressEvent const &, int)
std::unordered_map< SelectableControlPoint *, Geom::Affine > _last_trans
iterator find(const key_type &k)
const_iterator begin() const
void invertSelection()
Unselect all selected points and select all unselected points.
void restoreTransformHandles()
void getOriginalPoints(std::vector< Inkscape::SnapCandidatePoint > &pts)
void insert(InputIterator first, InputIterator last)
SelectableControlPoint * key_type
bool event(Inkscape::UI::Tools::ToolBase *tool, CanvasEvent const &event) override
Handle input event. Returns true if handled.
double _rotationRadius(Geom::Point const &)
Computes the distance to the farthest corner of the bounding box.
unsigned _handles_visible
bool _pointClicked(SelectableControlPoint *, ButtonReleaseEvent const &)
void _pointGrabbed(SelectableControlPoint *)
set_type::iterator iterator
void showTransformHandles(bool v, bool one_node)
void transform(Geom::Affine const &m)
Transform all selected control points by the given affine transformation.
sigc::signal< void(CommitEvent)> signal_commit
Fires when a change that needs to be committed to XML happens.
void clear()
Remove all points from the selection, making it empty.
void spatialGrow(SelectableControlPoint *origin, int dir)
void selectAll()
Select all points that this selection can contain.
void distribute(Geom::Dim2 d)
Equdistantly distribute control points by moving them in the specified dimension.
void hideTransformHandles()
Tool component that processes events and does something in response to them.
Desktop-bound selectable control object.
To do: update description of desktop.
Contains forward declarations of 2geom types.
Dim2
2D axis enumeration (X or Y).
Manipulator - edits something on-canvas.
CommitEvent
This is used to provide sensible messages on the undo stack.
Helper class to stream background task notifications as a series of messages.
Node types and other small enums.
Some utility classes to store various kinds of snap candidates.
void invert(const double v[16], double alpha[16])
Abstract base class for events.
Movement of the mouse pointer.