Inkscape
Vector Graphics Editor
|
#include <canvas-item-guideline.h>
Public Member Functions | |
CanvasItemGuideLine (CanvasItemGroup *group, Glib::ustring label, Geom::Point const &origin, Geom::Point const &normal) | |
Create a control guide line. | |
void | set_origin (Geom::Point const &origin) |
Sets origin of guide line (place where handle is located). | |
void | set_normal (Geom::Point const &normal) |
Sets orientation of guide line. | |
double | closest_distance_to (Geom::Point const &p) |
Returns distance between point in canvas units and nearest point on guideLine. | |
bool | contains (Geom::Point const &p, double tolerance=0) override |
Returns true if point p (in canvas units) is within tolerance (canvas units) distance of guideLine (or 1 if tolerance is zero). | |
void | set_visible (bool visible) override |
void | set_stroke (uint32_t color) override |
void | set_label (Glib::ustring &&label) |
void | set_locked (bool locked) |
void | set_inverted (bool inverted) |
Sets the inverted nature of the line. | |
CanvasItemGuideHandle * | dot () const |
Returns the pointer to the origin control (the "dot") | |
![]() | |
CanvasItem (CanvasItemContext *context) | |
CanvasItem (CanvasItemGroup *parent) | |
CanvasItem (CanvasItem const &)=delete | |
CanvasItem & | operator= (CanvasItem const &)=delete |
void | unlink () |
UI::Widget::Canvas * | get_canvas () const |
CanvasItemGroup * | get_parent () const |
bool | is_descendant_of (CanvasItem const *ancestor) const |
void | set_z_position (int zpos) |
void | raise_to_top () |
void | lower_to_bottom () |
void | request_update () |
void | update (bool propagate) |
virtual void | visit_page_rects (std::function< void(Geom::Rect const &)> const &) const |
Geom::OptRect const & | get_bounds () const |
void | grab (EventMask event_mask, Glib::RefPtr< Gdk::Cursor > const &={}) |
void | ungrab () |
void | render (Inkscape::CanvasItemBuffer &buf) const |
bool | is_visible () const |
void | request_redraw () |
virtual void | set_fill (uint32_t rgba) |
void | set_fill (CanvasItemColor color) |
void | set_fill_pattern (Cairo::RefPtr< Cairo::Pattern > pattern) |
void | set_stroke (CanvasItemColor color) |
void | set_stroke_width (double width) |
Set the stroke width. | |
void | set_outline (uint32_t color) |
Set the outline color. | |
void | set_outline_width (double width) |
Set the outline width. | |
double | get_effective_outline () const |
Get the effective outline. | |
void | set_name (std::string &&name) |
std::string const & | get_name () const |
void | update_canvas_item_ctrl_sizes (int size_index) |
void | set_pickable (bool pickable) |
bool | is_pickable () const |
sigc::connection | connect_event (sigc::slot< bool(CanvasEvent const &)> const &slot) |
virtual bool | handle_event (CanvasEvent const &event) |
void | canvas_item_print_tree (int level=0, int zorder=0) const |
Protected Member Functions | |
~CanvasItemGuideLine () override=default | |
void | _update (bool propagate) override |
Update and redraw control guideLine. | |
void | _render (Inkscape::CanvasItemBuffer &buf) const override |
Render guideLine to screen via Cairo. | |
![]() | |
virtual | ~CanvasItem () |
Geom::Affine const & | affine () const |
virtual void | _mark_net_invisible () |
virtual void | _invalidate_ctrl_handles () |
template<typename F > | |
void | defer (F &&f) |
Protected Attributes | |
Geom::Point | _origin |
Geom::Point | _normal = Geom::Point(0, 1) |
Glib::ustring | _label |
bool | _locked = true |
bool | _inverted = false |
CanvasItemPtr< CanvasItemGuideHandle > | _origin_ctrl |
![]() | |
CanvasItemContext * | _context |
CanvasItemGroup * | _parent |
Geom::OptRect | _bounds |
bool | _need_update = false |
bool | _visible = true |
bool | _net_visible = true |
bool | _pickable = false |
uint32_t | _fill = CANVAS_ITEM_COLORS[CANVAS_ITEM_SECONDARY] |
Cairo::RefPtr< Cairo::Pattern > | _fill_pattern |
uint32_t | _stroke = CANVAS_ITEM_COLORS[CANVAS_ITEM_PRIMARY] |
double | _stroke_width = 1.0 |
uint32_t | _outline = 0x0 |
double | _outline_width = 0 |
std::string | _name |
sigc::signal< bool(CanvasEvent const &)> | _event_signal |
Static Protected Attributes | |
static constexpr uint32_t | CONTROL_LOCKED_COLOR = 0x00000080 |
static constexpr double | LABEL_SEP = 2.0 |
Additional Inherited Members | |
![]() | |
boost::intrusive::list_member_hook | member_hook |
Definition at line 33 of file canvas-item-guideline.h.
Inkscape::CanvasItemGuideLine::CanvasItemGuideLine | ( | CanvasItemGroup * | group, |
Glib::ustring | label, | ||
Geom::Point const & | origin, | ||
Geom::Point const & | normal | ||
) |
Create a control guide line.
Points are in document units.
Definition at line 31 of file canvas-item-guideline.cpp.
References _label, Inkscape::CanvasItem::_name, _origin, _origin_ctrl, Inkscape::CanvasItem::_pickable, and set_locked().
|
overrideprotecteddefault |
|
overrideprotectedvirtual |
Render guideLine to screen via Cairo.
Implements Inkscape::CanvasItem.
Definition at line 129 of file canvas-item-guideline.cpp.
References _inverted, _label, _normal, _origin, _origin_ctrl, Inkscape::CanvasItem::_stroke, Inkscape::CanvasItem::affine(), Geom::are_near(), buf, desktop, Geom::Point::floor(), Geom::Line::from_origin_and_vector(), Inkscape::CanvasItem::get_canvas(), Inkscape::UI::Widget::Canvas::get_desktop(), Geom::intersection(), SPDesktop::is_yaxisdown(), LABEL_SEP, origin, Geom::Line::pointAt(), Geom::rot90(), SP_RGBA32_A_F(), SP_RGBA32_B_F(), SP_RGBA32_G_F(), SP_RGBA32_R_F(), Geom::Affine::withoutTranslation(), Geom::Point::x(), and Geom::Point::y().
|
overrideprotectedvirtual |
Update and redraw control guideLine.
Implements Inkscape::CanvasItem.
Definition at line 117 of file canvas-item-guideline.cpp.
References Inkscape::CanvasItem::_bounds, Geom::infinity(), and Inkscape::CanvasItem::request_redraw().
double Inkscape::CanvasItemGuideLine::closest_distance_to | ( | Geom::Point const & | p | ) |
Returns distance between point in canvas units and nearest point on guideLine.
Definition at line 86 of file canvas-item-guideline.cpp.
References _normal, _origin, Inkscape::CanvasItem::affine(), Geom::distance(), Geom::Line::from_origin_and_vector(), and Geom::rot90().
Referenced by contains().
|
overridevirtual |
Returns true if point p (in canvas units) is within tolerance (canvas units) distance of guideLine (or 1 if tolerance is zero).
Reimplemented from Inkscape::CanvasItem.
Definition at line 97 of file canvas-item-guideline.cpp.
References closest_distance_to().
CanvasItemGuideHandle * Inkscape::CanvasItemGuideLine::dot | ( | ) | const |
Returns the pointer to the origin control (the "dot")
Definition at line 109 of file canvas-item-guideline.cpp.
References _origin_ctrl.
void Inkscape::CanvasItemGuideLine::set_inverted | ( | bool | inverted | ) |
Sets the inverted nature of the line.
Definition at line 75 of file canvas-item-guideline.cpp.
References _inverted, and Inkscape::CanvasItem::request_update().
void Inkscape::CanvasItemGuideLine::set_label | ( | Glib::ustring && | label | ) |
Definition at line 233 of file canvas-item-guideline.cpp.
References _label, Inkscape::CanvasItem::defer(), label, and Inkscape::CanvasItem::request_update().
void Inkscape::CanvasItemGuideLine::set_locked | ( | bool | locked | ) |
Definition at line 242 of file canvas-item-guideline.cpp.
References _locked, _origin_ctrl, Inkscape::CanvasItem::_stroke, Inkscape::CANVAS_ITEM_CTRL_SHAPE_CIRCLE, Inkscape::CANVAS_ITEM_CTRL_SHAPE_CROSS, CONTROL_LOCKED_COLOR, and Inkscape::CanvasItem::defer().
Referenced by CanvasItemGuideLine().
void Inkscape::CanvasItemGuideLine::set_normal | ( | Geom::Point const & | normal | ) |
Sets orientation of guide line.
Definition at line 64 of file canvas-item-guideline.cpp.
References _normal, and Inkscape::CanvasItem::request_update().
void Inkscape::CanvasItemGuideLine::set_origin | ( | Geom::Point const & | origin | ) |
Sets origin of guide line (place where handle is located).
Definition at line 52 of file canvas-item-guideline.cpp.
References _origin, _origin_ctrl, origin, and Inkscape::CanvasItem::request_update().
|
overridevirtual |
Reimplemented from Inkscape::CanvasItem.
Definition at line 225 of file canvas-item-guideline.cpp.
References _origin_ctrl, and Inkscape::CanvasItem::set_stroke().
|
overridevirtual |
Reimplemented from Inkscape::CanvasItem.
Definition at line 219 of file canvas-item-guideline.cpp.
References _origin_ctrl, Inkscape::CanvasItem::set_visible(), and visible.
|
protected |
Definition at line 66 of file canvas-item-guideline.h.
Referenced by _render(), and set_inverted().
|
protected |
Definition at line 64 of file canvas-item-guideline.h.
Referenced by _render(), CanvasItemGuideLine(), and set_label().
|
protected |
Definition at line 65 of file canvas-item-guideline.h.
Referenced by set_locked().
|
protected |
Definition at line 63 of file canvas-item-guideline.h.
Referenced by _render(), closest_distance_to(), and set_normal().
|
protected |
Definition at line 62 of file canvas-item-guideline.h.
Referenced by _render(), CanvasItemGuideLine(), closest_distance_to(), and set_origin().
|
protected |
Definition at line 67 of file canvas-item-guideline.h.
Referenced by _render(), CanvasItemGuideLine(), dot(), set_locked(), set_origin(), set_stroke(), and set_visible().
|
staticconstexprprotected |
Definition at line 69 of file canvas-item-guideline.h.
Referenced by set_locked().
|
staticconstexprprotected |
Definition at line 70 of file canvas-item-guideline.h.
Referenced by _render().