16#include <gtkmm/entry.h>
17#include <gtkmm/grid.h>
29#include <glibmm/i18n.h>
35 elastic(_(
"Elastic"), _(
"Elastic transform mode"),
"elastic", &wr, this, false),
36 from_original_width(_(
"From original width"), _(
"From original width"),
"from_original_width", &wr, this, false),
37 lock_length(_(
"Lock length"), _(
"Lock length to current distance"),
"lock_length", &wr, this, false),
38 lock_angle(_(
"Lock angle"), _(
"Lock angle"),
"lock_angle", &wr, this, false),
39 flip_horizontal(_(
"Flip horizontal"), _(
"Flip horizontal"),
"flip_horizontal", &wr, this, false),
40 flip_vertical(_(
"Flip vertical"), _(
"Flip vertical"),
"flip_vertical", &wr, this, false),
41 start(_(
"Start"), _(
"Start point"),
"start", &wr, this,
"Start point"),
42 end(_(
"End"), _(
"End point"),
"end", &wr, this,
"End point"),
43 stretch(_(
"Stretch"), _(
"Stretch the result"),
"stretch", &wr, this, 1),
44 offset(_(
"Offset"), _(
"Offset from knots"),
"offset", &wr, this, 0),
45 first_knot(_(
"First Knot"), _(
"First Knot"),
"first_knot", &wr, this, 1),
46 last_knot(_(
"Last Knot"), _(
"Last Knot"),
"last_knot", &wr, this, 1),
47 helper_size(_(
"Helper size:"), _(
"Rotation helper size"),
"helper_size", &wr, this, 3),
48 from_original_width_toggler(false),
53 previous_angle(
Geom::rad_from_deg(0)),
95 auto sp_path = cast<SPPath>(splpeitem);
97 pathvector = sp_path->curveForEdit()->get_pathvector();
133 using namespace Geom;
139 auto sp_path = cast<SPPath>(splpeitem);
141 pathvector = sp_path->curveForEdit()->get_pathvector();
195 auto sp_path = cast<SPPath>(splpeitem);
197 pathvector = sp_path->curveForEdit()->get_pathvector();
235 for (
Geom::Path::iterator curve_it = pv_it.begin(); curve_it != pv_it.end_closed(); ++curve_it) {
237 return curve_it->initialPoint();
250 for (
Geom::Path::iterator curve_it = pv_it.begin(); curve_it != pv_it.end_closed(); ++curve_it) {
293 auto const vbox = Gtk::make_managed<Gtk::Box>(Gtk::Orientation::VERTICAL, 6);
296 auto const grid = Gtk::make_managed<Gtk::Grid>();
297 grid->set_column_spacing(50);
298 grid->set_row_spacing(6);
300 std::map<std::string, std::pair<int, int>> widget_positions = {
301 {
"elastic", {0, 0}}, {
"from_original_width", {1, 0}},
302 {
"flip_vertical", {0, 1}}, {
"flip_horizontal", {1, 1}},
303 {
"lock_length", {0, 2}}, {
"lock_angle", {1, 2}}
307 if (!param->widget_is_visible)
continue;
309 auto const widg = param->param_newWidget();
314 if (param->param_key ==
"first_knot" || param->param_key ==
"last_knot") {
316 Gtk::manage(&scalar);
318 scalar.getSpinButton().set_width_chars(3);
319 }
else if (widget_positions.find(param->param_key) != widget_positions.end()) {
320 auto [col, row] = widget_positions[param->param_key];
321 grid->attach(*widg, col, row, 1, 1);
330 if (
auto const tip = param->param_getTooltip()) {
331 widg->set_tooltip_markup(*tip);
333 widg->set_tooltip_text({});
334 widg->set_has_tooltip(
false);
338 auto const reset = Gtk::make_managed<Gtk::Button>(Glib::ustring(_(
"Reset")));
395 trans = Geom::Point::polar(transformed.
angle() + Geom::rad_from_deg(-90),
offset) + trans;
399 output.
concat(pwd2_in * m);
407 using namespace Geom;
417 svgd =
"M -5.39,8.78 -9.13,5.29 -10.38,10.28 Z M -7.22,7.07 -3.43,3.37 m -1.95,-12.16 -3.74,3.5 -1.26,-5 z m -1.83,1.71 3.78,3.7 M 5.24,8.78 8.98,5.29 10.24,10.28 Z M 7.07,7.07 3.29,3.37 M 5.24,-8.78 l 3.74,3.5 1.26,-5 z M 7.07,-7.07 3.29,-3.37";
420 hp_vec.push_back(pathv_move);
424 svgd =
"M 0,9.94 C -2.56,9.91 -5.17,8.98 -7.07,7.07 c -3.91,-3.9 -3.91,-10.24 0,-14.14 1.97,-1.97 4.51,-3.02 7.07,-3.04 2.56,0.02 5.1,1.07 7.07,3.04 3.91,3.9 3.91,10.24 0,14.14 C 5.17,8.98 2.56,9.91 0,9.94 Z";
428 hp_vec.push_back(pathv_turn);
430 hp_vec.push_back(pathv);
3x3 matrix representing an affine transformation.
Wrapper for angular values.
virtual Point initialPoint() const =0
Retrieve the start of the curve.
Adaptor that creates 2D functions from 1D ones.
constexpr C middle() const
void push_back(Path const &path)
Append a path at the end.
Point finalPoint() const
Get the last point in the last path of the vector.
Point initialPoint() const
Get the first point in the first path of the vector.
bool empty() const
Check whether the vector contains any paths.
Sequence of contiguous curves, aka spline.
Curve const & finalCurve() const
Point initialPoint() const
Get the first point in the path.
void appendNew(Args &&... args)
Append a new curve to the path.
void start(Point const &p)
Function defined as discrete pieces.
void concat(const Piecewise< T > &other)
Two-dimensional point that doubles as a vector.
Straight ray from a specific point to infinity.
Rotation around the origin.
void param_setValue(bool newvalue)
std::vector< Parameter * > param_vector
void registerParameter(Parameter *param)
bool apply_to_clippath_and_mask
void original_bbox(SPLPEItem const *lpeitem, bool absolute=false, bool clip_mask=false, Geom::Affine base_transform=Geom::identity())
Geom::Interval boundingbox_Y
Geom::Interval boundingbox_X
void param_update_default(Geom::Point default_point)
void param_setValue(Geom::Point newpoint, bool write=false)
void param_set_default() final
void param_transform_multiply(Geom::Affine const &, bool set) final
void param_set_digits(unsigned digits)
void param_set_range(double min, double max)
void param_set_increments(double step, double page)
void param_make_integer(bool yes=true)
void param_set_value(double val)
bool pathEffectsEnabled() const
bool optimizeTransforms()
returns false when LPE write unoptimiced
static char const *const parent
size_t count_path_nodes(Geom::Path const &path)
Specific geometry functions for Inkscape, not provided my lib2geom.
Macro for icon names used in Inkscape.
Various utility functions.
Angle distance(Angle const &a, Angle const &b)
bool are_near(Affine const &a1, Affine const &a2, Coord eps=EPSILON)
void pack_start(Gtk::Box &box, Gtk::Widget &child, bool const expand, bool const fill, unsigned const padding)
Adds child to box, packed with reference to the start of box.
Helpers for using Gtk::Boxes, encapsulating large changes between GTK3 & GTK4.
Geom::PathVector sp_svg_read_pathv(char const *str)