Inkscape
Vector Graphics Editor
|
#include <point.h>
Private Member Functions | |
void | on_value_changed () |
Private Attributes | |
Geom::Point | defvalue |
bool | liveupdate |
KnotHolderEntity * | _knot_entity = nullptr |
Inkscape::CanvasItemCtrlShape | knot_shape = Inkscape::CANVAS_ITEM_CTRL_SHAPE_DIAMOND |
std::uint32_t | knot_color = 0xffffff00 |
std::optional< Glib::ustring > | handle_tip |
Friends | |
class | PointParamKnotHolderEntity |
Additional Inherited Members | |
![]() | |
using | D1Value = Coord |
using | D1Reference = Coord & |
using | D1ConstReference = Coord const & |
![]() | |
static Point | polar (Coord angle, Coord radius) |
Construct a point from its polar coordinates. | |
static Point | polar (Coord angle) |
Construct an unit vector from its angle. | |
![]() | |
sigc::scoped_connection | selection_changed_connection |
Glib::ustring | param_key |
Glib::ustring | param_tooltip |
Inkscape::UI::Widget::Registry * | param_wr |
Glib::ustring | param_label |
bool | oncanvas_editable |
bool | widget_is_visible |
bool | widget_is_enabled |
![]() | |
void | param_write_to_repr (const char *svgd) |
![]() | |
bool | _updating = false |
Inkscape::Display::TemporaryItem * | ownerlocator = nullptr |
Effect * | param_effect |
![]() | |
std::ostream & | operator<< (std::ostream &out, Point const &p) |
Output operator for points. | |
Coord | L2 (Point const &p) |
Compute the second (Euclidean) norm of p. | |
constexpr Coord | L2sq (Point const &p) |
Compute the square of the Euclidean norm of p. | |
constexpr Point | rot90 (Point const &p) |
Returns p * Geom::rotate_degrees(90), but more efficient. | |
Point | lerp (Coord t, Point const &a, Point const &b) |
Linear interpolation between two points. | |
Point | middle_point (Point const &p1, Point const &p2) |
Return a point halfway between the specified ones. | |
constexpr Coord | dot (Point const &a, Point const &b) |
Compute the dot product of a and b. | |
constexpr Coord | cross (Point const &a, Point const &b) |
Compute the 2D cross product. | |
Coord | distance (Point const &a, Point const &b) |
Compute the (Euclidean) distance between points. | |
Coord | distanceSq (Point const &a, Point const &b) |
Compute the square of the distance between points. | |
bool | are_near (Point const &a, Point const &b, double eps=EPSILON) |
Test whether two points are no further apart than some threshold. | |
bool | are_collinear (Point const &p1, Point const &p2, Point const &p3, double eps=EPSILON) |
Test whether three points lie approximately on the same line. | |
Coord | L1 (Point const &p) |
Compute the first norm (Manhattan distance) of p. | |
Coord | LInfty (Point const &p) |
Compute the infinity norm (maximum norm) of p. | |
bool | is_zero (Point const &p) |
True if the point has both coordinates zero. | |
bool | is_unit_vector (Point const &p, Coord eps) |
True if the point has a length near 1. | |
Coord | atan2 (Point const &p) |
Return the angle between the point and the +X axis. | |
Coord | angle_between (Point const &a, Point const &b) |
Compute the angle between a and b relative to the origin. | |
Point | unit_vector (Point const &a) |
Create a normalized version of a point. | |
Point | abs (Point const &b) |
Return the "absolute value" of the point's vector. | |
Point | constrain_angle (Point const &A, Point const &B, unsigned int n, Point const &dir) |
Snap the angle B - A - dir to multiples of \(2\pi/n\). | |
Inkscape::LivePathEffect::PointParam::PointParam | ( | const Glib::ustring & | label, |
const Glib::ustring & | tip, | ||
const Glib::ustring & | key, | ||
Inkscape::UI::Widget::Registry * | wr, | ||
Effect * | effect, | ||
std::optional< Glib::ustring > | handle_tip = {} , |
||
Geom::Point | default_value = Geom::Point(0,0) , |
||
bool | live_update = true |
||
) |
|
override |
Definition at line 39 of file point.cpp.
References _knot_entity, KnotHolderEntity::parent_holder, and KnotHolder::remove().
|
delete |
|
finalvirtual |
Reimplemented from Inkscape::LivePathEffect::Parameter.
Definition at line 245 of file point.cpp.
References KnotHolder::add(), Inkscape::CANVAS_ITEM_CTRL_TYPE_LPE, and KnotHolderEntity::item.
Definition at line 54 of file point.h.
References handle_tip, and Inkscape::LivePathEffect::Parameter::param_tooltip.
|
private |
Definition at line 172 of file point.cpp.
References Inkscape::LivePathEffect::Parameter::param_effect, and Inkscape::LivePathEffect::Effect::refresh_widgets.
Referenced by param_newWidget().
|
delete |
Geom::Point Inkscape::LivePathEffect::PointParam::param_get_default | ( | ) | const |
Definition at line 59 of file point.cpp.
References defvalue.
Referenced by Inkscape::LivePathEffect::LPELattice2::doBeforeEffect().
|
finalvirtual |
Implements Inkscape::LivePathEffect::Parameter.
Definition at line 137 of file point.cpp.
References defvalue, and Inkscape::SVGOStringStream::str().
|
finalvirtual |
Implements Inkscape::LivePathEffect::Parameter.
Definition at line 129 of file point.cpp.
References Inkscape::SVGOStringStream::str(), and Geom::Point::x().
Definition at line 83 of file point.cpp.
References _knot_entity, SPKnot::flags, SPKnot::hide(), KnotHolderEntity::knot, SPKnot::show(), SP_KNOT_VISIBLE, and KnotHolderEntity::update_knot().
Referenced by Inkscape::LivePathEffect::LPELattice2::doBeforeEffect().
|
finalvirtual |
Implements Inkscape::LivePathEffect::Parameter.
Definition at line 151 of file point.cpp.
References Inkscape::LivePathEffect::Effect::getRepr(), Inkscape::LivePathEffect::Effect::getSPDoc(), on_value_changed(), Inkscape::UI::pack_start(), Inkscape::LivePathEffect::Parameter::param_effect, Inkscape::LivePathEffect::Parameter::param_key, Inkscape::LivePathEffect::Parameter::param_label, Inkscape::LivePathEffect::Parameter::param_tooltip, Inkscape::LivePathEffect::Parameter::param_wr, and Geom::Point::x().
Implements Inkscape::LivePathEffect::Parameter.
Definition at line 114 of file point.cpp.
References param_setValue(), sp_svg_number_read_d(), and Geom::Point::x().
|
finalvirtual |
Implements Inkscape::LivePathEffect::Parameter.
Definition at line 47 of file point.cpp.
References defvalue, and param_setValue().
Referenced by Inkscape::LivePathEffect::LPELattice2::doBeforeEffect(), Inkscape::LivePathEffect::LPETransform2Pts::doOnApply(), Inkscape::LivePathEffect::LPETransform2Pts::reset(), Inkscape::LivePathEffect::LPELattice2::resetGrid(), Inkscape::LivePathEffect::LPEPerspectiveEnvelope::resetGrid(), and Inkscape::LivePathEffect::LPETransform2Pts::updateIndex().
Definition at line 53 of file point.cpp.
References liveupdate.
Referenced by Inkscape::LivePathEffect::LPELattice2::setDefaults().
void Inkscape::LivePathEffect::PointParam::param_setValue | ( | Geom::Point | newpoint, |
bool | write = false |
||
) |
Definition at line 100 of file point.cpp.
References _knot_entity, liveupdate, Inkscape::LivePathEffect::Parameter::param_write_to_repr(), Inkscape::SVGOStringStream::str(), KnotHolderEntity::update_knot(), and Geom::Point::x().
Referenced by Inkscape::LivePathEffect::LPECopyRotate::doBeforeEffect(), Inkscape::LivePathEffect::LPEMirrorSymmetry::doBeforeEffect(), Inkscape::LivePathEffect::LPEPerspectiveEnvelope::doBeforeEffect(), Inkscape::LivePathEffect::LPESlice::doBeforeEffect(), Inkscape::LivePathEffect::LPETransform2Pts::doBeforeEffect(), Inkscape::LivePathEffect::LPECopyRotate::doOnApply(), Inkscape::LivePathEffect::LPEMirrorSymmetry::doOnApply(), Inkscape::LivePathEffect::LPEParallel::doOnApply(), Inkscape::LivePathEffect::LPESlice::doOnApply(), Inkscape::LivePathEffect::LPELattice2::horizontal(), Inkscape::LivePathEffect::LPEPerspectiveEnvelope::horizontal(), Inkscape::LivePathEffect::LPEdoEffectStackTest::LPEdoEffectStackTest(), param_readSVGValue(), param_set_default(), param_transform_multiply(), Inkscape::LivePathEffect::LPELattice2::vertical(), and Inkscape::LivePathEffect::LPEPerspectiveEnvelope::vertical().
|
finalvirtual |
Reimplemented from Inkscape::LivePathEffect::Parameter.
Definition at line 145 of file point.cpp.
References param_setValue(), and Geom::Point::x().
Referenced by Inkscape::LivePathEffect::LPEPerspectiveEnvelope::transform_multiply(), and Inkscape::LivePathEffect::LPETransform2Pts::transform_multiply().
|
finalvirtual |
Implements Inkscape::LivePathEffect::Parameter.
Definition at line 70 of file point.cpp.
References param_update_default(), sp_svg_number_read_d(), and Geom::Point::x().
void Inkscape::LivePathEffect::PointParam::param_update_default | ( | Geom::Point | default_point | ) |
Definition at line 64 of file point.cpp.
References defvalue, and Geom::Point::x().
Referenced by Inkscape::LivePathEffect::LPECopyRotate::doOnApply(), Inkscape::LivePathEffect::LPEMirrorSymmetry::doOnApply(), Inkscape::LivePathEffect::LPEParallel::doOnApply(), Inkscape::LivePathEffect::LPESlice::doOnApply(), Inkscape::LivePathEffect::LPETransform2Pts::doOnApply(), param_update_default(), Inkscape::LivePathEffect::LPETransform2Pts::reset(), Inkscape::LivePathEffect::LPELattice::resetDefaults(), Inkscape::LivePathEffect::LPELattice2::setDefaults(), Inkscape::LivePathEffect::LPEPerspectiveEnvelope::setDefaults(), and Inkscape::LivePathEffect::LPETransform2Pts::updateIndex().
|
inlinefinalvirtual |
Implements Inkscape::LivePathEffect::Parameter.
Definition at line 73 of file point.h.
References Inkscape::LivePathEffect::POINT.
|
inlinefinalvirtual |
Reimplemented from Inkscape::LivePathEffect::Parameter.
void Inkscape::LivePathEffect::PointParam::set_oncanvas_looks | ( | Inkscape::CanvasItemCtrlShape | shape, |
std::uint32_t | color | ||
) |
Definition at line 177 of file point.cpp.
References knot_color, and knot_shape.
Referenced by Inkscape::LivePathEffect::LPEdoEffectStackTest::LPEdoEffectStackTest().
|
private |
Definition at line 82 of file point.h.
Referenced by param_hide_knot(), param_setValue(), and ~PointParam().
|
private |
Definition at line 80 of file point.h.
Referenced by param_get_default(), param_getDefaultSVGValue(), param_set_default(), and param_update_default().
|
private |
Definition at line 85 of file point.h.
Referenced by handleTip().
|
private |
Definition at line 84 of file point.h.
Referenced by set_oncanvas_looks().
|
private |
Definition at line 83 of file point.h.
Referenced by set_oncanvas_looks().
|
private |
Definition at line 81 of file point.h.
Referenced by param_set_liveupdate(), and param_setValue().