Inkscape
Vector Graphics Editor
|
Rubberbanding selector. More...
#include <rubberband.h>
Public Types | |
enum class | Mode { RECT , TOUCHPATH , TOUCHRECT } |
enum class | Operation { ADD , INVERT , REMOVE } |
Public Member Functions | |
void | start (SPDesktop *desktop, Geom::Point const &p, bool tolerance=false) |
void | move (Geom::Point const &p) |
Geom::OptRect | getRectangle () const |
void | stop () |
bool | isStarted () const |
bool | isMoved () const |
Rubberband::Mode | getMode () const |
std::vector< Geom::Point > | getPoints () const |
Geom::Path | getPath () const |
void | setMode (Rubberband::Mode mode) |
void | setOperation (Rubberband::Operation operation) |
void | setHandle (CanvasItemCtrlType handle) |
Static Public Member Functions | |
static Rubberband * | get (SPDesktop *desktop) |
Static Public Attributes | |
static constexpr auto | default_mode = Rubberband::Mode::RECT |
static constexpr auto | default_operation = Rubberband::Operation::ADD |
static constexpr auto | default_handle = CanvasItemCtrlType::RUBBERBAND_RECT |
static constexpr auto | default_deselect_handle = CanvasItemCtrlType::RUBBERBAND_DESELECT |
static constexpr auto | default_invert_handle = CanvasItemCtrlType::RUBBERBAND_INVERT |
Private Member Functions | |
Rubberband (SPDesktop *desktop) | |
CanvasItemCtrlType | _get_deselect_handle (CanvasItemCtrlType handle) |
CanvasItemCtrlType | _get_invert_handle (CanvasItemCtrlType handle) |
void | delete_canvas_items () |
Private Attributes | |
SPDesktop * | _desktop |
Geom::Point | _start |
Geom::Point | _end |
Geom::Path | _path |
CanvasItemPtr< CanvasItemRect > | _rect |
CanvasItemPtr< CanvasItemBpath > | _touchpath |
CanvasItemCtrlType | _handle = default_handle |
CanvasItemCtrlType | _invert_handle = default_invert_handle |
CanvasItemCtrlType | _deselect_handle = default_deselect_handle |
Geom::Path | _touchpath_curve |
bool | _started = false |
bool | _moved = false |
Rubberband::Mode | _mode = default_mode |
Rubberband::Operation | _operation = default_operation |
double | _tolerance = 0.0 |
Static Private Attributes | |
static Rubberband * | _instance = nullptr |
Rubberbanding selector.
Definition at line 34 of file rubberband.h.
|
strong |
Enumerator | |
---|---|
RECT | |
TOUCHPATH | |
TOUCHRECT |
Definition at line 37 of file rubberband.h.
|
strong |
Enumerator | |
---|---|
ADD | |
INVERT | |
REMOVE |
Definition at line 42 of file rubberband.h.
|
private |
Definition at line 34 of file rubberband.cpp.
|
inlineprivate |
Definition at line 87 of file rubberband.h.
References Inkscape::RUBBERBAND_DESELECT, Inkscape::RUBBERBAND_TOUCHPATH_DESELECT, and Inkscape::RUBBERBAND_TOUCHPATH_SELECT.
Referenced by setHandle().
|
inlineprivate |
Definition at line 96 of file rubberband.h.
References Inkscape::RUBBERBAND_INVERT, Inkscape::RUBBERBAND_TOUCHPATH_INVERT, and Inkscape::RUBBERBAND_TOUCHPATH_SELECT.
Referenced by setHandle().
|
private |
Definition at line 38 of file rubberband.cpp.
|
static |
Definition at line 213 of file rubberband.cpp.
References _instance, and desktop.
Referenced by Inkscape::UI::Tools::EraserTool::_findItemsToErase(), Inkscape::UI::Tools::EraserTool::_handleKeypress(), Inkscape::UI::Tools::NodeTool::get_rubberband(), Inkscape::UI::Tools::EraserTool::root_handler(), Inkscape::UI::Tools::MeshTool::root_handler(), Inkscape::UI::Tools::SelectTool::root_handler(), Inkscape::UI::Tools::TextTool::root_handler(), Inkscape::UI::Tools::ZoomTool::root_handler(), Inkscape::UI::Tools::sp_flood_do_flood_fill(), Inkscape::UI::Tools::SelectTool::sp_select_context_abort(), and Inkscape::UI::Tools::TextTool::~TextTool().
|
inline |
Definition at line 55 of file rubberband.h.
References _mode.
Geom::Path Inkscape::Rubberband::getPath | ( | ) | const |
Definition at line 44 of file rubberband.cpp.
References TOUCHPATH.
std::vector< Geom::Point > Inkscape::Rubberband::getPoints | ( | ) | const |
Definition at line 53 of file rubberband.cpp.
Referenced by Inkscape::UI::Tools::sp_flood_do_flood_fill().
Geom::OptRect Inkscape::Rubberband::getRectangle | ( | ) | const |
Definition at line 204 of file rubberband.cpp.
Referenced by Inkscape::UI::Tools::ZoomTool::root_handler().
|
inline |
Definition at line 53 of file rubberband.h.
References _moved.
|
inline |
Definition at line 52 of file rubberband.h.
References _started.
Referenced by Inkscape::UI::Tools::ZoomTool::root_handler().
void Inkscape::Rubberband::move | ( | Geom::Point const & | p | ) |
Definition at line 102 of file rubberband.cpp.
References Geom::are_near(), css, Inkscape::Handles::Manager::get(), get_cached_pattern(), Inkscape::Handles::Manager::getCss(), INVERT, Geom::L2(), RECT, REMOVE, SP_WIND_RULE_EVENODD, TOUCHPATH, TOUCHRECT, and Inkscape::Handles::TypeState::type.
Referenced by Inkscape::UI::Tools::TextTool::root_handler(), and Inkscape::UI::Tools::ZoomTool::root_handler().
|
inline |
Definition at line 67 of file rubberband.h.
References _deselect_handle, _get_deselect_handle(), _get_invert_handle(), _handle, and _invert_handle.
|
inline |
Definition at line 65 of file rubberband.h.
|
inline |
Definition at line 66 of file rubberband.h.
References _operation.
void Inkscape::Rubberband::start | ( | SPDesktop * | desktop, |
Geom::Point const & | p, | ||
bool | tolerance = false |
||
) |
Definition at line 58 of file rubberband.cpp.
References Inkscape::Preferences::get().
Referenced by Inkscape::UI::Tools::MeshTool::root_handler().
void Inkscape::Rubberband::stop | ( | ) |
Definition at line 76 of file rubberband.cpp.
Referenced by Inkscape::UI::Tools::EraserTool::_handleKeypress(), Inkscape::UI::Tools::TextTool::root_handler(), Inkscape::UI::Tools::ZoomTool::root_handler(), Inkscape::UI::Tools::SelectTool::sp_select_context_abort(), Inkscape::UI::Tools::NodeTool::~NodeTool(), and Inkscape::UI::Tools::TextTool::~TextTool().
|
private |
Definition at line 84 of file rubberband.h.
Referenced by setHandle().
|
private |
Definition at line 75 of file rubberband.h.
|
private |
Definition at line 77 of file rubberband.h.
|
private |
Definition at line 82 of file rubberband.h.
Referenced by setHandle().
|
staticprivate |
Definition at line 73 of file rubberband.h.
|
private |
Definition at line 83 of file rubberband.h.
Referenced by setHandle().
|
private |
Definition at line 105 of file rubberband.h.
|
private |
Definition at line 104 of file rubberband.h.
Referenced by isMoved().
|
private |
Definition at line 106 of file rubberband.h.
Referenced by setOperation().
|
private |
Definition at line 78 of file rubberband.h.
|
private |
Definition at line 80 of file rubberband.h.
|
private |
Definition at line 76 of file rubberband.h.
|
private |
Definition at line 103 of file rubberband.h.
Referenced by isStarted().
|
private |
Definition at line 107 of file rubberband.h.
|
private |
Definition at line 81 of file rubberband.h.
|
private |
Definition at line 85 of file rubberband.h.
|
staticconstexpr |
Definition at line 62 of file rubberband.h.
|
staticconstexpr |
Definition at line 61 of file rubberband.h.
Referenced by Inkscape::UI::Tools::SelectTool::get_default_rubberband_state().
|
staticconstexpr |
Definition at line 63 of file rubberband.h.
|
staticconstexpr |
Definition at line 59 of file rubberband.h.
Referenced by Inkscape::UI::Tools::SelectTool::get_default_rubberband_state().
|
staticconstexpr |
Definition at line 60 of file rubberband.h.