Inkscape
Vector Graphics Editor
|
#include <canvas-item-bpath.h>
Public Member Functions | |
CanvasItemBpath (CanvasItemGroup *group) | |
Create a null control bpath. | |
CanvasItemBpath (CanvasItemGroup *group, Geom::PathVector path, bool phantom_line=false) | |
Create a control bpath. | |
void | set_bpath (Geom::PathVector path, bool phantom_line=false) |
Set a control bpath. | |
double | closest_distance_to (Geom::Point const &p) const |
Returns distance between point in canvas units and nearest point on bpath. | |
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 bpath. | |
void | set_fill (uint32_t rgba, SPWindRule fill_rule) |
Set the fill color and fill rule. | |
void | set_dashes (std::vector< double > &&dashes) |
![]() | |
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 |
virtual void | set_visible (bool visible) |
void | request_redraw () |
virtual void | set_fill (uint32_t rgba) |
void | set_fill (CanvasItemColor color) |
void | set_fill_pattern (Cairo::RefPtr< Cairo::Pattern > pattern) |
virtual void | set_stroke (uint32_t rgba) |
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 | |
~CanvasItemBpath () override=default | |
void | _update (bool propagate) override |
Update and redraw control bpath. | |
void | _render (Inkscape::CanvasItemBuffer &buf) const override |
Render bpath 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::PathVector | _path |
SPWindRule | _fill_rule = SP_WIND_RULE_EVENODD |
std::vector< double > | _dashes |
bool | _phantom_line = false |
![]() | |
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 |
Additional Inherited Members | |
![]() | |
boost::intrusive::list_member_hook | member_hook |
Definition at line 30 of file canvas-item-bpath.h.
Inkscape::CanvasItemBpath::CanvasItemBpath | ( | CanvasItemGroup * | group | ) |
Create a null control bpath.
Definition at line 30 of file canvas-item-bpath.cpp.
References Inkscape::CanvasItem::_name, and Inkscape::CanvasItem::_pickable.
Inkscape::CanvasItemBpath::CanvasItemBpath | ( | CanvasItemGroup * | group, |
Geom::PathVector | path, | ||
bool | phantom_line = false |
||
) |
Create a control bpath.
Path is in document coordinates.
Definition at line 40 of file canvas-item-bpath.cpp.
References Inkscape::CanvasItem::_name, Inkscape::CanvasItem::_pickable, and Inkscape::CanvasItem::request_update().
|
overrideprotecteddefault |
|
overrideprotectedvirtual |
Render bpath to screen via Cairo.
Implements Inkscape::CanvasItem.
Definition at line 143 of file canvas-item-bpath.cpp.
References _dashes, Inkscape::CanvasItem::_fill, Inkscape::CanvasItem::_fill_pattern, _fill_rule, Inkscape::CanvasItem::_outline, Inkscape::CanvasItem::_outline_width, _path, _phantom_line, Inkscape::CanvasItem::_stroke, Inkscape::CanvasItem::_stroke_width, Inkscape::CanvasItem::affine(), buf, feed_pathvector_to_cairo(), Inkscape::CanvasItem::get_effective_outline(), ink_cairo_set_source_color(), SP_RGBA32_A_U(), and SP_WIND_RULE_EVENODD.
|
overrideprotectedvirtual |
Update and redraw control bpath.
Implements Inkscape::CanvasItem.
Definition at line 121 of file canvas-item-bpath.cpp.
References Inkscape::CanvasItem::_bounds, _path, Inkscape::CanvasItem::affine(), bounds_exact_transformed(), Geom::PathVector::empty(), expandedBy(), Inkscape::CanvasItem::get_effective_outline(), and Inkscape::CanvasItem::request_redraw().
double Inkscape::CanvasItemBpath::closest_distance_to | ( | Geom::Point const & | p | ) | const |
Returns distance between point in canvas units and nearest point on bpath.
Definition at line 85 of file canvas-item-bpath.cpp.
References _path, Inkscape::CanvasItem::affine(), Geom::Affine::descrim(), Geom::infinity(), Geom::Affine::inverse(), and Geom::PathVector::nearestTime().
Referenced by contains().
|
overridevirtual |
Returns true if point p (in canvas units) is within tolerance (canvas units) distance of bpath.
Reimplemented from Inkscape::CanvasItem.
Definition at line 100 of file canvas-item-bpath.cpp.
References Inkscape::CanvasItem::_fill, _path, Inkscape::CanvasItem::affine(), closest_distance_to(), Geom::Affine::inverse(), and Geom::PathVector::winding().
void Inkscape::CanvasItemBpath::set_bpath | ( | Geom::PathVector | path, |
bool | phantom_line = false |
||
) |
Set a control bpath.
Path is in document coordinates.
Definition at line 53 of file canvas-item-bpath.cpp.
References _path, _phantom_line, Inkscape::CanvasItem::defer(), and Inkscape::CanvasItem::request_update().
Referenced by Inkscape::UI::Tools::endpt_handler().
void Inkscape::CanvasItemBpath::set_dashes | ( | std::vector< double > && | dashes | ) |
Definition at line 75 of file canvas-item-bpath.cpp.
References _dashes, and Inkscape::CanvasItem::defer().
void Inkscape::CanvasItemBpath::set_fill | ( | uint32_t | rgba, |
SPWindRule | fill_rule | ||
) |
Set the fill color and fill rule.
Definition at line 65 of file canvas-item-bpath.cpp.
References Inkscape::CanvasItem::_fill, _fill_rule, Inkscape::CanvasItem::defer(), fill, and Inkscape::CanvasItem::request_redraw().
Referenced by Inkscape::UI::Tools::ConnectorTool::ConnectorTool(), and Inkscape::BooleanBuilder::redraw_item().
|
protected |
Definition at line 59 of file canvas-item-bpath.h.
Referenced by _render(), and set_dashes().
|
protected |
Definition at line 58 of file canvas-item-bpath.h.
Referenced by _render(), and set_fill().
|
protected |
Definition at line 55 of file canvas-item-bpath.h.
Referenced by _render(), _update(), closest_distance_to(), contains(), and set_bpath().
|
protected |
Definition at line 60 of file canvas-item-bpath.h.
Referenced by _render(), and set_bpath().