Inkscape
Vector Graphics Editor
|
#include <snap-indicator.h>
Public Member Functions | |
SnapIndicator (SPDesktop *desktop) | |
virtual | ~SnapIndicator () |
void | set_new_snaptarget (Inkscape::SnappedPoint const &p, bool pre_snap=false) |
void | remove_snaptarget (bool only_if_presnap=false) |
void | set_new_snapsource (Inkscape::SnapCandidatePoint const &p) |
void | remove_snapsource () |
void | set_new_debugging_point (Geom::Point const &p) |
void | remove_debugging_points () |
Protected Attributes | |
TemporaryItem * | _snaptarget |
TemporaryItem * | _snaptarget_tooltip |
TemporaryItem * | _snaptarget_bbox |
TemporaryItem * | _snapsource |
std::list< TemporaryItem * > | _alignment_snap_indicators |
std::list< TemporaryItem * > | _distribution_snap_indicators |
std::list< TemporaryItem * > | _debugging_points |
bool | _snaptarget_is_presnap |
SPDesktop * | _desktop |
Private Member Functions | |
SnapIndicator (const SnapIndicator &)=delete | |
SnapIndicator & | operator= (const SnapIndicator &)=delete |
void | make_distribution_indicators (SnappedPoint const &p, double fontsize, double scale) |
void | make_alignment_indicator (Geom::Point const &p1, Geom::Point const &p2, guint32 color, double fontsize, double scale) |
guint32 | get_guide_color (SnapTargetType t) |
Inkscape::CanvasItemCurve * | make_stub_line_h (Geom::Point const &p) |
Inkscape::CanvasItemCurve * | make_stub_line_v (Geom::Point const &p) |
Definition at line 34 of file snap-indicator.h.
Inkscape::Display::SnapIndicator::SnapIndicator | ( | SPDesktop * | desktop | ) |
Definition at line 110 of file snap-indicator.cpp.
|
virtual |
Definition at line 120 of file snap-indicator.cpp.
References remove_snapsource(), and remove_snaptarget().
|
privatedelete |
|
private |
Definition at line 336 of file snap-indicator.cpp.
References Inkscape::SNAPTARGET_ALIGNMENT_BBOX_CORNER, Inkscape::SNAPTARGET_ALIGNMENT_BBOX_EDGE_MIDPOINT, Inkscape::SNAPTARGET_ALIGNMENT_BBOX_MIDPOINT, Inkscape::SNAPTARGET_ALIGNMENT_HANDLE, Inkscape::SNAPTARGET_ALIGNMENT_INTERSECTION, Inkscape::SNAPTARGET_ALIGNMENT_PAGE_BLEED_CORNER, Inkscape::SNAPTARGET_ALIGNMENT_PAGE_EDGE_CENTER, Inkscape::SNAPTARGET_ALIGNMENT_PAGE_EDGE_CORNER, Inkscape::SNAPTARGET_ALIGNMENT_PAGE_MARGIN_CENTER, and Inkscape::SNAPTARGET_ALIGNMENT_PAGE_MARGIN_CORNER.
Referenced by set_new_snaptarget().
|
private |
Definition at line 395 of file snap-indicator.cpp.
References _alignment_snap_indicators, _desktop, Inkscape::Util::Unit::abbr, SPDesktop::add_temporary_canvasitem(), Inkscape::CANVAS_ITEM_CTRL_TYPE_POINT, Inkscape::Util::Quantity::convert(), SPDesktop::current_zoom(), distance(), SPDesktop::doc(), Inkscape::ustring::format_classic(), Inkscape::Preferences::get(), Inkscape::Preferences::getBool(), SPDesktop::getCanvasTemp(), SPDocument::getDisplayUnit(), Geom::L2(), offset, scale, Inkscape::CanvasItemCurve::set_bg_alpha(), Inkscape::CanvasItem::set_stroke(), Geom::unit_vector(), Geom::Point::x(), and Geom::Point::y().
Referenced by set_new_snaptarget().
|
private |
Definition at line 473 of file snap-indicator.cpp.
References _desktop, _distribution_snap_indicators, Inkscape::Util::Unit::abbr, SPDesktop::add_temporary_canvasitem(), Inkscape::Util::Quantity::convert(), SPDesktop::current_zoom(), distance(), SPDesktop::doc(), Inkscape::ustring::format_classic(), Inkscape::Preferences::get(), Inkscape::Display::get_x_and_sign(), Inkscape::Display::get_y_and_sign(), Inkscape::SnappedPoint::getBBoxes(), Inkscape::SnappedPoint::getBBoxes2(), Inkscape::Preferences::getBool(), SPDesktop::getCanvasTemp(), SPDocument::getDisplayUnit(), Inkscape::SnappedPoint::getDistributionDistance(), Inkscape::SnappedPoint::getDistributionDistance2(), Inkscape::SnappedPoint::getTarget(), make_stub_line_h(), make_stub_line_v(), scale, sign(), Inkscape::SNAPTARGET_DISTRIBUTION_DOWN, Inkscape::SNAPTARGET_DISTRIBUTION_LEFT, Inkscape::SNAPTARGET_DISTRIBUTION_RIGHT, Inkscape::SNAPTARGET_DISTRIBUTION_UP, Inkscape::SNAPTARGET_DISTRIBUTION_X, Inkscape::SNAPTARGET_DISTRIBUTION_XY, Inkscape::SNAPTARGET_DISTRIBUTION_Y, and SPDesktop::w2d().
Referenced by set_new_snaptarget().
|
private |
Definition at line 465 of file snap-indicator.cpp.
References _desktop, SPDesktop::current_zoom(), and SPDesktop::getCanvasTemp().
Referenced by make_distribution_indicators().
|
private |
Definition at line 457 of file snap-indicator.cpp.
References _desktop, SPDesktop::current_zoom(), and SPDesktop::getCanvasTemp().
Referenced by make_distribution_indicators().
|
privatedelete |
void Inkscape::Display::SnapIndicator::remove_debugging_points | ( | ) |
Definition at line 328 of file snap-indicator.cpp.
References _debugging_points, _desktop, and SPDesktop::remove_temporary_canvasitem().
void Inkscape::Display::SnapIndicator::remove_snapsource | ( | ) |
Definition at line 319 of file snap-indicator.cpp.
References _desktop, _snapsource, and SPDesktop::remove_temporary_canvasitem().
Referenced by SnapManager::displaySnapsource(), set_new_snapsource(), set_new_snaptarget(), and ~SnapIndicator().
void Inkscape::Display::SnapIndicator::remove_snaptarget | ( | bool | only_if_presnap = false | ) |
Definition at line 259 of file snap-indicator.cpp.
References _alignment_snap_indicators, _desktop, _distribution_snap_indicators, _snaptarget, _snaptarget_bbox, _snaptarget_is_presnap, _snaptarget_tooltip, item, and SPDesktop::remove_temporary_canvasitem().
Referenced by Inkscape::UI::Tools::PencilTool::_endpointSnap(), Inkscape::UI::ControlPointSelection::_pointUngrabbed(), SnapManager::findBestSnap(), KnotHolder::knot_ungrabbed_handler(), SnapManager::preSnap(), set_new_snaptarget(), Inkscape::snap_rectangular_box(), SnapManager::snapTransformed(), and ~SnapIndicator().
void Inkscape::Display::SnapIndicator::set_new_debugging_point | ( | Geom::Point const & | p | ) |
Definition at line 310 of file snap-indicator.cpp.
References _debugging_points, _desktop, SPDesktop::add_temporary_canvasitem(), Inkscape::CANVAS_ITEM_CTRL_TYPE_SHAPER, SPDesktop::getCanvasTemp(), and Inkscape::LARGE.
void Inkscape::Display::SnapIndicator::set_new_snapsource | ( | Inkscape::SnapCandidatePoint const & | p | ) |
Definition at line 293 of file snap-indicator.cpp.
References _desktop, _snapsource, SPDesktop::add_temporary_canvasitem(), Inkscape::CANVAS_ITEM_CTRL_TYPE_POINT, Inkscape::Preferences::get(), Inkscape::Preferences::getBool(), SPDesktop::getCanvasTemp(), Inkscape::SnapCandidatePoint::getPoint(), and remove_snapsource().
Referenced by SnapManager::displaySnapsource().
void Inkscape::Display::SnapIndicator::set_new_snaptarget | ( | Inkscape::SnappedPoint const & | p, |
bool | pre_snap = false |
||
) |
Definition at line 128 of file snap-indicator.cpp.
References _desktop, _snaptarget, _snaptarget_bbox, _snaptarget_is_presnap, _snaptarget_tooltip, SPDesktop::add_temporary_canvasitem(), Inkscape::CANVAS_ITEM_CTRL_TYPE_MARKER, Inkscape::Preferences::get(), get_guide_color(), Inkscape::SnappedPoint::getAlignmentTarget(), Inkscape::SnappedPoint::getAlignmentTarget2(), Inkscape::SnappedPoint::getAlignmentTargetType(), Inkscape::Preferences::getBool(), SPDesktop::getCanvasTemp(), Inkscape::Preferences::getDouble(), Inkscape::SnappedPoint::getPoint(), Inkscape::SnappedPoint::getSnapped(), Inkscape::SnappedPoint::getSource(), Inkscape::SnappedPoint::getTarget(), Inkscape::SnappedPoint::getTargetBBox(), SPDesktop::getTool(), make_alignment_indicator(), make_distribution_indicators(), remove_snapsource(), remove_snaptarget(), scale, Inkscape::CanvasItem::set_pickable(), Inkscape::CanvasItemCtrl::set_selected(), Inkscape::SNAPSOURCE_GRID_PITCH, Inkscape::SNAPSOURCE_UNDEFINED, Inkscape::SNAPTARGET_ALIGNMENT_INTERSECTION, Inkscape::SNAPTARGET_CONSTRAINT, Inkscape::SNAPTARGET_DISTRIBUTION_CATEGORY, Inkscape::SNAPTARGET_UNDEFINED, Inkscape::Display::source2string, Inkscape::Display::target2string, and SPDesktop::w2d().
Referenced by SnapManager::constrainedSnap(), SnapManager::findBestSnap(), SnapManager::multipleOfGridPitch(), SnapManager::preSnap(), Inkscape::snap_rectangular_box(), and SnapManager::snapTransformed().
|
protected |
Definition at line 54 of file snap-indicator.h.
Referenced by make_alignment_indicator(), and remove_snaptarget().
|
protected |
Definition at line 56 of file snap-indicator.h.
Referenced by remove_debugging_points(), and set_new_debugging_point().
|
protected |
Definition at line 58 of file snap-indicator.h.
Referenced by make_alignment_indicator(), make_distribution_indicators(), make_stub_line_h(), make_stub_line_v(), remove_debugging_points(), remove_snapsource(), remove_snaptarget(), set_new_debugging_point(), set_new_snapsource(), and set_new_snaptarget().
|
protected |
Definition at line 55 of file snap-indicator.h.
Referenced by make_distribution_indicators(), and remove_snaptarget().
|
protected |
Definition at line 52 of file snap-indicator.h.
Referenced by remove_snapsource(), and set_new_snapsource().
|
protected |
Definition at line 49 of file snap-indicator.h.
Referenced by remove_snaptarget(), and set_new_snaptarget().
|
protected |
Definition at line 51 of file snap-indicator.h.
Referenced by remove_snaptarget(), and set_new_snaptarget().
|
protected |
Definition at line 57 of file snap-indicator.h.
Referenced by remove_snaptarget(), and set_new_snaptarget().
|
protected |
Definition at line 50 of file snap-indicator.h.
Referenced by remove_snaptarget(), and set_new_snaptarget().