19#include <glibmm/i18n.h>
23namespace LivePathEffect {
27 , trajectory_path(_(
"Trajectory:"), _(
"Path along which intermediate steps are created."),
"trajectory", &wr, this,
29 , number_of_steps(_(
"Steps_:"), _(
"Determines the number of steps from start to end path."),
"steps", &wr, this, 5)
30 , equidistant_spacing(_(
"E_quidistant spacing"),
31 _(
"If true, the spacing between intermediates is constant along the length of the path. If "
32 "false, the distance depends on the location of the nodes of the trajectory path."),
33 "equidistant_spacing", &wr, this, true)
90 pwd2_A -= bounds_A->midpoint();
94 pwd2_B -= bounds_B->midpoint();
110 pResult += trajectory.
valueAt(trajectory_domain.
min() + fraction * trajectory_domain.
extent());
133 if (!bounds_A || !bounds_B) {
137 auto trajectory_start = trajectory.
firstValue();
138 auto trajectory_end = trajectory.
lastValue();
140 auto midpoint_A = bounds_A->midpoint();
141 auto midpoint_B = bounds_B->midpoint();
144 Geom::Ray transformed(midpoint_A, midpoint_B);
157 return trajectory * transformation;
164 if (!is<SPPath>(
item))
167 auto const *crv = cast<SPPath>(
item)->curveForEdit();
169 if ((pathv.
size() < 2))
175 if (bounds_A && bounds_B) {
178 traj_pathv[0].start(bounds_A->midpoint());
3x3 matrix representing an affine transformation.
constexpr C extent() const
Range of real numbers that is never empty.
Axis-aligned rectangle that can be empty.
size_type size() const
Get the number of paths in the vector.
void push_back(Path const &path)
Append a path at the end.
OptRect boundsExact() const
bool empty() const
Check whether the vector contains any paths.
Sequence of contiguous curves, aka spline.
Function defined as discrete pieces.
output_type valueAt(double t) const
output_type lastValue() const
std::vector< double > cuts
output_type firstValue() const
void setDomain(Interval dom)
Straight ray from a specific point to infinity.
Rotation around the origin.
void registerParameter(Parameter *param)
virtual void resetDefaults(SPItem const *item)
Sets all parameters to their default values and writes them to SVG.
LPEInterpolate(LivePathEffectObject *lpeobject)
PathParam trajectory_path
~LPEInterpolate() override
BoolParam equidistant_spacing
Geom::PathVector doEffect_path(Geom::PathVector const &path_in) override
ScalarParam number_of_steps
void resetDefaults(SPItem const *item) override
Sets all parameters to their default values and writes them to SVG.
bool doOnOpen(SPLPEItem const *lpeitem) override
Is performed on load document or revert If the item is fixed legacy return true.
Geom::Piecewise< Geom::D2< Geom::SBasis > > calculate_trajectory(Geom::OptRect bounds_A, Geom::OptRect bounds_B)
void transform_multiply(Geom::Affine const &postmul, bool set) override
Overridden function to apply transforms for example to powerstroke, jointtype or tapperstroke.
Geom::PathVector const & get_pathvector() const
void set_new_value(Geom::PathVector const &newpath, bool write_to_svg)
void param_transform_multiply(Geom::Affine const &postmul, bool set) override
void param_set_and_write_default()
Geom::Affine get_relative_affine()
void param_set_range(double min, double max)
void param_make_integer(bool yes=true)
Base class for visual SVG elements.
bool pathEffectsEnabled() const
bool optimizeTransforms()
returns false when LPE write unoptimiced
LPE interpolate implementation, see lpe-interpolate.cpp.
OptInterval bounds_exact(Bezier const &b)
Angle distance(Angle const &a, Angle const &b)
PathVector path_from_piecewise(Piecewise< D2< SBasis > > const &B, double tol, bool only_cubicbeziers=false)
Make a path from a d2 sbasis.
Piecewise< D2< SBasis > > arc_length_parametrization(D2< SBasis > const &M, unsigned order=3, double tol=.01)
Helper class to stream background task notifications as a series of messages.
Conversion between SBasis and Bezier basis polynomials.