Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
Inkscape::Rubberband Class Reference

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::PointgetPoints () const
 
Geom::Path getPath () const
 
void setMode (Rubberband::Mode mode)
 
void setOperation (Rubberband::Operation operation)
 
void setHandle (CanvasItemCtrlType handle)
 

Static Public Member Functions

static Rubberbandget (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
 

Detailed Description

Rubberbanding selector.

Definition at line 34 of file rubberband.h.

Member Enumeration Documentation

◆ Mode

enum class Inkscape::Rubberband::Mode
strong
Enumerator
RECT 
TOUCHPATH 
TOUCHRECT 

Definition at line 37 of file rubberband.h.

◆ Operation

Enumerator
ADD 
INVERT 
REMOVE 

Definition at line 42 of file rubberband.h.

Constructor & Destructor Documentation

◆ Rubberband()

Inkscape::Rubberband::Rubberband ( SPDesktop desktop)
private

Definition at line 34 of file rubberband.cpp.

Member Function Documentation

◆ _get_deselect_handle()

CanvasItemCtrlType Inkscape::Rubberband::_get_deselect_handle ( CanvasItemCtrlType  handle)
inlineprivate

◆ _get_invert_handle()

CanvasItemCtrlType Inkscape::Rubberband::_get_invert_handle ( CanvasItemCtrlType  handle)
inlineprivate

◆ delete_canvas_items()

void Inkscape::Rubberband::delete_canvas_items ( )
private

Definition at line 38 of file rubberband.cpp.

◆ get()

◆ getMode()

Rubberband::Mode Inkscape::Rubberband::getMode ( ) const
inline

Definition at line 55 of file rubberband.h.

References _mode.

◆ getPath()

Geom::Path Inkscape::Rubberband::getPath ( ) const

Definition at line 44 of file rubberband.cpp.

References TOUCHPATH.

◆ getPoints()

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().

◆ getRectangle()

Geom::OptRect Inkscape::Rubberband::getRectangle ( ) const
Returns
Rectangle in desktop coordinates

Definition at line 204 of file rubberband.cpp.

Referenced by Inkscape::UI::Tools::ZoomTool::root_handler().

◆ isMoved()

bool Inkscape::Rubberband::isMoved ( ) const
inline

Definition at line 53 of file rubberband.h.

References _moved.

◆ isStarted()

bool Inkscape::Rubberband::isStarted ( ) const
inline

Definition at line 52 of file rubberband.h.

References _started.

Referenced by Inkscape::UI::Tools::ZoomTool::root_handler().

◆ move()

◆ setHandle()

void Inkscape::Rubberband::setHandle ( CanvasItemCtrlType  handle)
inline

◆ setMode()

void Inkscape::Rubberband::setMode ( Rubberband::Mode  mode)
inline

Definition at line 65 of file rubberband.h.

References _mode, and mode.

◆ setOperation()

void Inkscape::Rubberband::setOperation ( Rubberband::Operation  operation)
inline

Definition at line 66 of file rubberband.h.

References _operation.

◆ start()

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().

◆ stop()

Member Data Documentation

◆ _deselect_handle

CanvasItemCtrlType Inkscape::Rubberband::_deselect_handle = default_deselect_handle
private

Definition at line 84 of file rubberband.h.

Referenced by setHandle().

◆ _desktop

SPDesktop* Inkscape::Rubberband::_desktop
private

Definition at line 75 of file rubberband.h.

◆ _end

Geom::Point Inkscape::Rubberband::_end
private

Definition at line 77 of file rubberband.h.

◆ _handle

CanvasItemCtrlType Inkscape::Rubberband::_handle = default_handle
private

Definition at line 82 of file rubberband.h.

Referenced by setHandle().

◆ _instance

Inkscape::Rubberband * Inkscape::Rubberband::_instance = nullptr
staticprivate

Definition at line 73 of file rubberband.h.

◆ _invert_handle

CanvasItemCtrlType Inkscape::Rubberband::_invert_handle = default_invert_handle
private

Definition at line 83 of file rubberband.h.

Referenced by setHandle().

◆ _mode

Rubberband::Mode Inkscape::Rubberband::_mode = default_mode
private

Definition at line 105 of file rubberband.h.

Referenced by getMode(), and setMode().

◆ _moved

bool Inkscape::Rubberband::_moved = false
private

Definition at line 104 of file rubberband.h.

Referenced by isMoved().

◆ _operation

Rubberband::Operation Inkscape::Rubberband::_operation = default_operation
private

Definition at line 106 of file rubberband.h.

Referenced by setOperation().

◆ _path

Geom::Path Inkscape::Rubberband::_path
private

Definition at line 78 of file rubberband.h.

◆ _rect

CanvasItemPtr<CanvasItemRect> Inkscape::Rubberband::_rect
private

Definition at line 80 of file rubberband.h.

◆ _start

Geom::Point Inkscape::Rubberband::_start
private

Definition at line 76 of file rubberband.h.

◆ _started

bool Inkscape::Rubberband::_started = false
private

Definition at line 103 of file rubberband.h.

Referenced by isStarted().

◆ _tolerance

double Inkscape::Rubberband::_tolerance = 0.0
private

Definition at line 107 of file rubberband.h.

◆ _touchpath

CanvasItemPtr<CanvasItemBpath> Inkscape::Rubberband::_touchpath
private

Definition at line 81 of file rubberband.h.

◆ _touchpath_curve

Geom::Path Inkscape::Rubberband::_touchpath_curve
private

Definition at line 85 of file rubberband.h.

◆ default_deselect_handle

constexpr auto Inkscape::Rubberband::default_deselect_handle = CanvasItemCtrlType::RUBBERBAND_DESELECT
staticconstexpr

Definition at line 62 of file rubberband.h.

◆ default_handle

constexpr auto Inkscape::Rubberband::default_handle = CanvasItemCtrlType::RUBBERBAND_RECT
staticconstexpr

◆ default_invert_handle

constexpr auto Inkscape::Rubberband::default_invert_handle = CanvasItemCtrlType::RUBBERBAND_INVERT
staticconstexpr

Definition at line 63 of file rubberband.h.

◆ default_mode

constexpr auto Inkscape::Rubberband::default_mode = Rubberband::Mode::RECT
staticconstexpr

◆ default_operation

constexpr auto Inkscape::Rubberband::default_operation = Rubberband::Operation::ADD
staticconstexpr

Definition at line 60 of file rubberband.h.


The documentation for this class was generated from the following files: