Inkscape
Vector Graphics Editor
|
Function defined as discrete pieces. More...
#include <piecewise.h>
Public Types | |
typedef T::output_type | output_type |
Public Member Functions | |
Piecewise () | |
Piecewise (const T &s) | |
unsigned | input_dim () |
Piecewise (const output_type &v) | |
void | reserve (unsigned i) |
T const & | operator[] (unsigned i) const |
T & | operator[] (unsigned i) |
output_type | operator() (double t) const |
output_type | valueAt (double t) const |
output_type | firstValue () const |
output_type | lastValue () const |
std::vector< output_type > | valueAndDerivatives (double t, unsigned n_derivs) const |
The size of the returned vector equals n_derivs+1. | |
Piecewise< T > | operator() (SBasis f) |
Piecewise< T > | operator() (Piecewise< SBasis >f) |
unsigned | size () const |
bool | empty () const |
void | clear () |
void | push (const T &s, double to) |
Convenience/implementation hiding function to add segment/cut pairs. | |
void | push (T &&s, double to) |
void | push_cut (double c) |
void | push_seg (const T &s) |
void | push_seg (T &&s) |
unsigned | segN (double t, int low=0, int high=-1) const |
Returns the segment index which corresponds to a 'global' piecewise time. | |
double | segT (double t, int i=-1) const |
Returns the time within a segment, given the 'global' piecewise time. | |
double | mapToDomain (double t, unsigned i) const |
void | offsetDomain (double o) |
void | scaleDomain (double s) |
Interval | domain () const |
void | setDomain (Interval dom) |
void | concat (const Piecewise< T > &other) |
void | continuousConcat (const Piecewise< T > &other) |
bool | invariants () const |
Public Attributes | |
std::vector< double > | cuts |
std::vector< T > | segs |
Private Member Functions | |
BOOST_CLASS_REQUIRE (T, Geom, FragmentConcept) | |
Related Symbols | |
(Note that these are not member symbols.) | |
template<typename T > | |
FragmentConcept< T >::BoundsType | bounds_fast (const Piecewise< T > &f) |
... | |
template<typename T > | |
FragmentConcept< T >::BoundsType | bounds_exact (const Piecewise< T > &f) |
... | |
template<typename T > | |
FragmentConcept< T >::BoundsType | bounds_local (const Piecewise< T > &f, const OptInterval &_m) |
... | |
template<typename T > | |
T | elem_portion (const Piecewise< T > &a, unsigned i, double from, double to) |
Returns a portion of a piece of a Piecewise<T>, given the piece's index and a to/from time. | |
template<typename T > | |
Piecewise< T > | partition (const Piecewise< T > &pw, std::vector< double > const &c) |
Piecewise<T> partition(const Piecewise<T> &pw, std::vector<double> const &c); Further subdivides the Piecewise<T> such that there is a cut at every value in c. | |
template<typename T > | |
Piecewise< T > | portion (const Piecewise< T > &pw, double from, double to) |
Returns a Piecewise<T> with a defined domain of [min(from, to), max(from, to)]. | |
template<typename T > | |
Piecewise< T > | remove_short_cuts (Piecewise< T > const &f, double tol) |
... | |
template<typename T > | |
Piecewise< T > | remove_short_cuts_extending (Piecewise< T > const &f, double tol) |
... | |
template<typename T > | |
std::vector< double > | roots (const Piecewise< T > &pw) |
... | |
template<typename T > | |
Piecewise< T > | operator+ (Piecewise< T > const &a, typename T::output_type b) |
... | |
template<typename T > | |
Piecewise< T > | operator- (Piecewise< T > const &a) |
... | |
template<typename T > | |
Piecewise< T > | operator* (Piecewise< T > const &a, double b) |
... | |
template<typename T > | |
Piecewise< T > | operator* (Piecewise< T > const &a, T b) |
... | |
template<typename T > | |
Piecewise< T > | operator/ (Piecewise< T > const &a, double b) |
... | |
template<typename T > | |
Piecewise< T > | operator+ (Piecewise< T > const &a, Piecewise< T > const &b) |
... | |
template<typename T > | |
Piecewise< T > | operator- (Piecewise< T > const &a, Piecewise< T > const &b) |
... | |
template<typename T1 , typename T2 > | |
Piecewise< T2 > | operator* (Piecewise< T1 > const &a, Piecewise< T2 > const &b) |
... | |
template<typename T > | |
Piecewise< T > & | operator*= (Piecewise< T > &a, Piecewise< T > const &b) |
... | |
template<typename T > | |
Piecewise< T > | compose (Piecewise< T > const &f, SBasis const &g) |
... | |
template<typename T > | |
Piecewise< T > | compose (Piecewise< T > const &f, Piecewise< SBasis > const &g) |
... | |
Piecewise< SBasis > | pw_compose_inverse (SBasis const &f, SBasis const &g, unsigned order, double zero) |
Compose an SBasis with the inverse of another. | |
template<typename T > | |
Piecewise< T > | integral (Piecewise< T > const &a) |
... | |
template<typename T > | |
Piecewise< T > | derivative (Piecewise< T > const &a) |
... | |
template<typename T > | |
Piecewise< T > | reverse (Piecewise< T > const &f) |
... | |
template<typename T > | |
Piecewise< T > | lerp (double t, Piecewise< T > const &a, Piecewise< T > b) |
Interpolates between a and b. | |
Piecewise< SBasis > | dot (Piecewise< D2< SBasis > > const &a, Piecewise< D2< SBasis > > const &b) |
Calculates the 'dot product' or 'inner product' of a and b . | |
Piecewise< SBasis > | dot (Piecewise< D2< SBasis > > const &a, Point const &b) |
Calculates the 'dot product' or 'inner product' of a and b . | |
Piecewise< SBasis > | atan2 (Piecewise< D2< SBasis > > const &vect, double tol, unsigned order) |
Return a function which gives the angle of vect at each point. | |
Piecewise< SBasis > | atan2 (D2< SBasis > const &vect, double tol, unsigned order) |
Return a function which gives the angle of vect at each point. | |
D2< Piecewise< SBasis > > | tan2 (Piecewise< SBasis > const &angle, double tol, unsigned order) |
tan2 is the pseudo-inverse of atan2. | |
Piecewise< D2< SBasis > > | unitVector (D2< SBasis > const &V_in, double tol, unsigned order) |
Return a Piecewise<D2<SBasis> > which points in the same direction as V_in, but has unit_length. | |
Piecewise< D2< SBasis > > | unitVector (Piecewise< D2< SBasis > > const &V, double tol, unsigned order) |
Return a Piecewise<D2<SBasis> > which points in the same direction as V_in, but has unit_length. | |
Piecewise< SBasis > | arcLengthSb (Piecewise< D2< SBasis > > const &M, double tol) |
returns a function giving the arclength at each point in M. | |
Piecewise< SBasis > | arcLengthSb (D2< SBasis > const &M, double tol) |
returns a function giving the arclength at each point in M. | |
Piecewise< SBasis > | curvature (D2< SBasis > const &M, double tol) |
returns a function giving the curvature at each point in M. | |
Piecewise< SBasis > | curvature (Piecewise< D2< SBasis > > const &V, double tol) |
returns a function giving the curvature at each point in M. | |
Piecewise< D2< SBasis > > | arc_length_parametrization (D2< SBasis > const &M, unsigned order, double tol) |
Reparameterise M to have unit speed. | |
Piecewise< D2< SBasis > > | arc_length_parametrization (Piecewise< D2< SBasis > > const &M, unsigned order, double tol) |
Reparameterise M to have unit speed. | |
double | length (Piecewise< D2< SBasis > > const &s, double tol) |
Calculates the length of a Piecewise<D2<SBasis> > through gsl integration. | |
unsigned | centroid (Piecewise< D2< SBasis > > const &p, Point ¢roid, double &area) |
Centroid using sbasis integration. | |
Function defined as discrete pieces.
The Piecewise class manages a sequence of elements of a type as segments and the ’cuts’ between them. These cuts are time values which separate the pieces. This function representation allows for more interesting functions, as it provides a viable output for operations such as inversion, which may require multiple SBasis to properly invert the original.
As for technical details, while the actual SBasis segments begin on the first cut and end on the last, the function is defined throughout all inputs by ex- tending the first and last segments. The exact switching between segments is arbitrarily such that beginnings (t=0) have preference over endings (t=1). This only matters if it is discontinuous at the location.
\[ f(t) \rightarrow \left\{ \begin{array}{cc} s_1,& t <= c_2 \\ s_2,& c_2 <= t <= c_3\\ \ldots \\ s_n,& c_n <= t \end{array}\right. \]
Definition at line 71 of file piecewise.h.
typedef T::output_type Geom::Piecewise< T >::output_type |
Definition at line 89 of file piecewise.h.
|
inline |
Definition at line 79 of file piecewise.h.
|
inlineexplicit |
Definition at line 81 of file piecewise.h.
References Geom::Piecewise< T >::push_cut(), and Geom::Piecewise< T >::push_seg().
|
inlineexplicit |
Definition at line 91 of file piecewise.h.
References Geom::Piecewise< T >::push_cut(), and Geom::Piecewise< T >::push_seg().
|
private |
|
inline |
Definition at line 133 of file piecewise.h.
References Geom::Piecewise< T >::cuts, and Geom::Piecewise< T >::segs.
Referenced by Inkscape::UI::Tools::PencilTool::_sketchInterpolate(), Inkscape::LivePathEffect::LPERecursiveSkeleton::doEffect_pwd2(), and Inkscape::LivePathEffect::PathParam::ensure_pwd2().
|
inline |
Definition at line 235 of file piecewise.h.
References Geom::Piecewise< T >::cuts, Geom::Piecewise< T >::empty(), Geom::Piecewise< T >::push_cut(), Geom::Piecewise< T >::segs, and Geom::Piecewise< T >::size().
Referenced by Geom::Piecewise< T >::arc_length_parametrization(), Inkscape::LivePathEffect::LPESketch::computePerturbation(), Geom::cos(), Geom::divide(), Geom::divide(), Inkscape::LivePathEffect::LPETaperStroke::doBeforeEffect(), LPEToy::doEffect_path(), Inkscape::LivePathEffect::Effect::doEffect_path(), doEffect_pwd2(), Inkscape::LivePathEffect::LPEDynastroke::doEffect_pwd2(), Inkscape::LivePathEffect::LPEExtrude::doEffect_pwd2(), Inkscape::LivePathEffect::LPEPatternAlongPath::doEffect_pwd2(), Inkscape::LivePathEffect::LPERecursiveSkeleton::doEffect_pwd2(), Inkscape::LivePathEffect::LPERuler::doEffect_pwd2(), Inkscape::LivePathEffect::LPESketch::doEffect_pwd2(), Inkscape::LivePathEffect::LPETransform2Pts::doEffect_pwd2(), Inkscape::LivePathEffect::PathParam::ensure_pwd2(), Geom::fuse_nearby_ends(), main(), Geom::paths_to_pw(), pw_inverse(), Geom::reciprocalOnDomain(), Inkscape::LivePathEffect::LPECurveStitch::resetDefaults(), Geom::sqrt_internal(), Inkscape::LivePathEffect::stretch_along(), Inkscape::Extension::Internal::PrintEmf::stroke(), Inkscape::Extension::Internal::PrintWmf::stroke(), and Geom::Piecewise< T >::unitVector().
|
inline |
Definition at line 251 of file piecewise.h.
References Geom::Piecewise< T >::cuts, Geom::Piecewise< T >::empty(), Geom::Piecewise< T >::push(), Geom::Piecewise< T >::reserve(), Geom::Piecewise< T >::segs, and Geom::Piecewise< T >::size().
Referenced by Inkscape::LivePathEffect::LPEExtrude::doEffect_pwd2().
|
inline |
Definition at line 215 of file piecewise.h.
References Geom::Piecewise< T >::cuts.
Referenced by Geom::computeLinfinityNeighborhood(), computeLinfinityNeighborhood(), Inkscape::LivePathEffect::LPECurveStitch::doEffect_path(), Inkscape::LivePathEffect::LPEEmbroderyStitch::doEffect_path(), Inkscape::LivePathEffect::LPEInterpolate::doEffect_path(), Inkscape::LivePathEffect::LPEPowerStroke::doEffect_path(), Inkscape::LivePathEffect::LPEPatternAlongPath::doEffect_pwd2(), Inkscape::LivePathEffect::LPERecursiveSkeleton::doEffect_pwd2(), Geom::Piecewise< T >::lerp(), Geom::monotonic_smash_intersect(), plot_graph(), smash_intersect(), Geom::sqrt(), and Inkscape::LivePathEffect::stretch_along().
|
inline |
Definition at line 132 of file piecewise.h.
References Geom::Piecewise< T >::segs.
Referenced by Geom::Piecewise< T >::bounds_exact(), Geom::Piecewise< T >::bounds_fast(), Geom::Piecewise< T >::bounds_local(), Geom::Piecewise< T >::compose(), Geom::Piecewise< T >::concat(), Geom::Piecewise< T >::continuousConcat(), Inkscape::LivePathEffect::LPEPowerStroke::doEffect_path(), Inkscape::LivePathEffect::LPEBendPath::doEffect_pwd2(), Geom::Piecewise< T >::operator*(), Geom::Piecewise< T >::operator*(), Geom::operator+=(), Geom::operator-=(), Geom::Piecewise< T >::operator/(), Geom::Piecewise< T >::partition(), Geom::Piecewise< T >::portion(), Geom::Piecewise< T >::remove_short_cuts(), Geom::Piecewise< T >::remove_short_cuts_extending(), Inkscape::LivePathEffect::PowerStrokePointArrayParam::reverse_controlpoints(), Geom::Piecewise< T >::setDomain(), and Geom::touching_circle().
|
inline |
Definition at line 106 of file piecewise.h.
References Geom::Piecewise< T >::cuts, and Geom::Piecewise< T >::valueAt().
Referenced by Inkscape::LivePathEffect::LPEInterpolate::calculate_trajectory(), Geom::computeLinfinityNeighborhood(), computeLinfinityNeighborhood(), Inkscape::LivePathEffect::LPEPowerStroke::doEffect_path(), Inkscape::LivePathEffect::LPEDynastroke::doEffect_pwd2(), Inkscape::LivePathEffect::LPEExtrude::doEffect_pwd2(), Inkscape::LivePathEffect::LPERuler::doEffect_pwd2(), Inkscape::LivePathEffect::LPESketch::doEffect_pwd2(), Geom::fuse_nearby_ends(), and smash_intersect().
|
inline |
Definition at line 87 of file piecewise.h.
|
inline |
Definition at line 265 of file piecewise.h.
References Geom::Piecewise< T >::cuts, and Geom::Piecewise< T >::segs.
Referenced by Geom::Piecewise< T >::partition(), and Geom::Piecewise< T >::portion().
|
inline |
Definition at line 109 of file piecewise.h.
References Geom::Piecewise< T >::cuts, and Geom::Piecewise< T >::valueAt().
Referenced by Inkscape::LivePathEffect::LPEInterpolate::calculate_trajectory(), Geom::computeLinfinityNeighborhood(), computeLinfinityNeighborhood(), Inkscape::LivePathEffect::LPEEmbroderyStitch::doEffect_path(), Inkscape::LivePathEffect::LPEPowerStroke::doEffect_path(), Inkscape::LivePathEffect::LPEDynastroke::doEffect_pwd2(), Inkscape::LivePathEffect::LPEExtrude::doEffect_pwd2(), Inkscape::LivePathEffect::LPERuler::doEffect_pwd2(), Inkscape::LivePathEffect::LPESketch::doEffect_pwd2(), Geom::fuse_nearby_ends(), smash_intersect(), and stretch_endpoints().
|
inline |
Definition at line 191 of file piecewise.h.
References Geom::Piecewise< T >::cuts.
Referenced by Geom::multi_roots(), and Geom::roots().
|
inline |
Definition at line 196 of file piecewise.h.
References Geom::Piecewise< T >::cuts, and Geom::Piecewise< T >::size().
Referenced by Geom::computeLinfinityNeighborhood(), computeLinfinityNeighborhood(), Geom::distance(), and Geom::distance().
|
inline |
Definition at line 101 of file piecewise.h.
References Geom::Piecewise< T >::valueAt().
Piecewise< T > Geom::Piecewise< T >::operator() | ( | Piecewise< SBasis > | f | ) |
Definition at line 850 of file piecewise.h.
References Geom::compose().
Piecewise< T > Geom::Piecewise< T >::operator() | ( | SBasis | f | ) |
Definition at line 848 of file piecewise.h.
References Geom::compose().
|
inline |
Definition at line 100 of file piecewise.h.
References Geom::Piecewise< T >::segs.
|
inline |
Definition at line 99 of file piecewise.h.
References Geom::Piecewise< T >::segs.
|
inline |
Convenience/implementation hiding function to add segment/cut pairs.
Asserts that basic size and order invariants are correct
Definition at line 141 of file piecewise.h.
References Geom::Piecewise< T >::cuts, Geom::Piecewise< T >::push_cut(), Geom::Piecewise< T >::push_seg(), and Geom::Piecewise< T >::segs.
Referenced by Inkscape::UI::Tools::PencilTool::_addFreehandPoint(), Geom::Piecewise< T >::arc_length_parametrization(), Geom::Piecewise< T >::continuousConcat(), convole(), Inkscape::LivePathEffect::LPELattice::doEffect_pwd2(), Inkscape::LivePathEffect::LPELattice2::doEffect_pwd2(), Inkscape::LivePathEffect::LPESketch::doEffect_pwd2(), Geom::operator+=(), Geom::operator-=(), Geom::Piecewise< T >::partition(), Geom::Piecewise< T >::portion(), Geom::reciprocalOnDomain(), Geom::Piecewise< T >::remove_short_cuts(), Geom::Piecewise< T >::remove_short_cuts_extending(), sore_tooth(), Geom::Path::toPwSb(), and zaggy().
|
inline |
Definition at line 146 of file piecewise.h.
References Geom::Piecewise< T >::cuts, Geom::Piecewise< T >::push_cut(), Geom::Piecewise< T >::push_seg(), and Geom::Piecewise< T >::segs.
|
inline |
Definition at line 152 of file piecewise.h.
References c, and Geom::Piecewise< T >::cuts.
Referenced by Inkscape::UI::Tools::PencilTool::_addFreehandPoint(), Geom::Piecewise< T >::arc_length_parametrization(), Geom::Piecewise< T >::concat(), Inkscape::LivePathEffect::LPEEmbroderyStitch::doEffect_path(), Inkscape::LivePathEffect::LPELattice::doEffect_pwd2(), Inkscape::LivePathEffect::LPELattice2::doEffect_pwd2(), Inkscape::LivePathEffect::LPERoughHatches::doEffect_pwd2(), Inkscape::LivePathEffect::LPESketch::doEffect_pwd2(), Geom::Piecewise< T >::dot(), Geom::operator*(), Geom::operator+=(), Geom::operator-=(), Geom::Piecewise< T >::partition(), Geom::Piecewise< T >::Piecewise(), Geom::Piecewise< T >::Piecewise(), Geom::Piecewise< T >::portion(), Geom::Piecewise< T >::push(), Geom::Piecewise< T >::push(), Geom::reciprocalOnDomain(), Geom::Piecewise< T >::remove_short_cuts(), Geom::Piecewise< T >::remove_short_cuts_extending(), Geom::Piecewise< T >::reverse(), Geom::rot90(), sore_tooth(), Geom::Path::toPwSb(), and zaggy().
|
inline |
Definition at line 157 of file piecewise.h.
References Geom::Piecewise< T >::segs.
Referenced by Geom::divide(), Inkscape::LivePathEffect::LPEEmbroderyStitch::doEffect_path(), Inkscape::LivePathEffect::LPERoughHatches::doEffect_pwd2(), Geom::Piecewise< T >::operator*(), Geom::Piecewise< T >::operator*(), Geom::Piecewise< T >::operator*(), Geom::Piecewise< T >::operator+(), Geom::Piecewise< T >::operator-(), Geom::Piecewise< T >::operator/(), Geom::Piecewise< T >::partition(), Geom::Piecewise< T >::Piecewise(), Geom::Piecewise< T >::Piecewise(), Geom::Piecewise< T >::portion(), Geom::Piecewise< T >::push(), Geom::Piecewise< T >::push(), Geom::reciprocalOnDomain(), Geom::Piecewise< T >::reverse(), and Geom::sectionize().
|
inline |
Definition at line 158 of file piecewise.h.
References Geom::Piecewise< T >::segs.
|
inline |
Definition at line 97 of file piecewise.h.
References Geom::Piecewise< T >::cuts, and Geom::Piecewise< T >::segs.
Referenced by Geom::Piecewise< T >::continuousConcat(), Geom::Piecewise< T >::partition(), Geom::Piecewise< T >::portion(), Geom::Piecewise< T >::remove_short_cuts(), Geom::Piecewise< T >::remove_short_cuts_extending(), and Geom::Piecewise< T >::reverse().
|
inline |
Definition at line 204 of file piecewise.h.
References Geom::Piecewise< T >::cuts, Geom::Piecewise< T >::segs, and Geom::Piecewise< T >::size().
Referenced by Geom::distance().
|
inline |
Returns the segment index which corresponds to a 'global' piecewise time.
Also takes optional low/high parameters to expedite the search for the segment.
Definition at line 163 of file piecewise.h.
References Geom::Piecewise< T >::cuts, and Geom::Piecewise< T >::size().
Referenced by Geom::Piecewise< T >::bounds_local(), Geom::Piecewise< T >::portion(), Geom::Piecewise< T >::segT(), Geom::Piecewise< T >::valueAndDerivatives(), and Geom::Piecewise< T >::valueAt().
|
inline |
Returns the time within a segment, given the 'global' piecewise time.
Also takes an optional index parameter which may be used for efficiency or to find the time on a segment outside its range. If it is left to its default, -1, it will call segN to find the index.
Definition at line 185 of file piecewise.h.
References Geom::Piecewise< T >::cuts, and Geom::Piecewise< T >::segN().
Referenced by Geom::Piecewise< T >::bounds_local(), Geom::Piecewise< T >::partition(), Geom::Piecewise< T >::portion(), Geom::Piecewise< T >::valueAndDerivatives(), and Geom::Piecewise< T >::valueAt().
|
inline |
Definition at line 218 of file piecewise.h.
References Geom::Piecewise< T >::cuts, Geom::Piecewise< T >::empty(), Geom::GenericInterval< C >::extent(), Geom::GenericInterval< C >::max(), Geom::GenericInterval< C >::min(), and Geom::Piecewise< T >::size().
Referenced by Geom::Piecewise< T >::compose(), Inkscape::LivePathEffect::LPESketch::computePerturbation(), Geom::cos(), Geom::cos(), Geom::Piecewise< T >::curvature(), Geom::divide(), Geom::divide(), Inkscape::LivePathEffect::LPEInterpolate::doEffect_path(), Inkscape::LivePathEffect::LPEDynastroke::doEffect_pwd2(), Inkscape::LivePathEffect::LPERoughHatches::doEffect_pwd2(), Geom::Piecewise< T >::lerp(), smash_intersect(), Geom::sqrt(), Geom::sqrt_internal(), Geom::Piecewise< T >::unitVector(), and Geom::Piecewise< T >::unitVector().
|
inline |
Definition at line 131 of file piecewise.h.
References Geom::Piecewise< T >::segs.
Referenced by Geom::abs(), Geom::Piecewise< T >::arc_length_parametrization(), Geom::Piecewise< T >::bounds_exact(), Geom::Piecewise< T >::bounds_fast(), cairo_pw(), cairo_pw(), Geom::Piecewise< T >::compose(), Geom::Piecewise< T >::concat(), Geom::Piecewise< T >::continuousConcat(), Geom::cos(), Geom::Piecewise< T >::curvature(), Geom::divide(), Geom::divide(), Inkscape::LivePathEffect::LPELattice2::doEffect_pwd2(), Geom::Piecewise< T >::dot(), Geom::Piecewise< T >::elem_portion(), Inkscape::LivePathEffect::find_cusps(), Geom::level_set(), Geom::multi_roots(), Geom::Piecewise< T >::offsetDomain(), Geom::Piecewise< T >::operator*(), Geom::Piecewise< T >::operator*(), Geom::Piecewise< T >::operator*(), Geom::operator*=(), Geom::Piecewise< T >::operator+(), Geom::operator+=(), Geom::Piecewise< T >::operator-(), Geom::operator-(), Geom::operator-=(), Geom::Piecewise< T >::operator/(), Geom::operator/=(), Geom::Piecewise< T >::partition(), plot(), plot(), plot(), plot3d(), Geom::Piecewise< T >::portion(), Geom::prolongateByConstants(), prolongateByConstants(), pw_inverse(), Geom::reciprocalOnDomain(), Geom::Piecewise< T >::remove_short_cuts(), Geom::Piecewise< T >::remove_short_cuts_extending(), Geom::Piecewise< T >::reverse(), Geom::Piecewise< T >::roots(), Geom::roots(), Geom::Piecewise< T >::scaleDomain(), Geom::sectionize(), Geom::Piecewise< T >::segN(), Geom::Piecewise< T >::setDomain(), Geom::sqrt(), and Geom::Piecewise< T >::unitVector().
|
inline |
The size of the returned vector equals n_derivs+1.
Definition at line 116 of file piecewise.h.
References Geom::Piecewise< T >::cuts, Geom::Piecewise< T >::segN(), Geom::Piecewise< T >::segs, and Geom::Piecewise< T >::segT().
|
inline |
Definition at line 102 of file piecewise.h.
References Geom::Piecewise< T >::segN(), Geom::Piecewise< T >::segs, and Geom::Piecewise< T >::segT().
Referenced by Geom::D2< T >::cubics_fitting_curvature(), Inkscape::LivePathEffect::LPEEmbroderyStitch::doEffect_path(), Inkscape::LivePathEffect::LPEInterpolate::doEffect_path(), Geom::Piecewise< T >::firstValue(), Inkscape::LivePathEffect::PowerStrokePointArrayParam::knot_get(), Inkscape::LivePathEffect::PowerStrokePointArrayParamKnotHolderEntity::knot_set(), Geom::Piecewise< T >::lastValue(), Geom::Piecewise< T >::operator()(), Inkscape::LivePathEffect::PowerStrokePointArrayParam::reverse_controlpoints(), and Inkscape::LivePathEffect::TextParam::setPosAndAnchor().
|
related |
Reparameterise M to have unit speed.
M | the Element. |
tol | the maximum error allowed. |
order | the maximum degree to use for approximation , D2 |
Definition at line 402 of file sbasis-geometric.cpp.
References Geom::arcLengthSb(), Geom::are_near(), Geom::SBasis::at0(), Geom::SBasis::at1(), Geom::compose(), Geom::compose_inverse(), Geom::Piecewise< T >::cuts, order, Geom::Piecewise< T >::push(), Geom::Piecewise< T >::push_cut(), Geom::Piecewise< T >::segs, and Geom::Piecewise< T >::size().
|
related |
Reparameterise M to have unit speed.
M | the Element. |
tol | the maximum error allowed. |
order | the maximum degree to use for approximation |
Definition at line 434 of file sbasis-geometric.cpp.
References Geom::arc_length_parametrization(), Geom::Piecewise< T >::concat(), order, and result.
|
related |
returns a function giving the arclength at each point in M.
M | the Element. |
tol | the maximum error allowed. , D2 |
Definition at line 338 of file sbasis-geometric.cpp.
References Geom::arcLengthSb().
|
related |
returns a function giving the arclength at each point in M.
M | the Element. |
tol | the maximum error allowed. |
Definition at line 324 of file sbasis-geometric.cpp.
References Geom::derivative(), Geom::dot(), Geom::integral(), Geom::length(), and Geom::sqrt().
|
related |
Return a function which gives the angle of vect at each point.
vect | a piecewise parameteric curve. |
tol | the maximum error allowed. |
order | the maximum degree to use for approximation , D2 |
Definition at line 188 of file sbasis-geometric.cpp.
References Geom::atan2(), and order.
|
related |
Return a function which gives the angle of vect at each point.
vect | a piecewise parameteric curve. |
tol | the maximum error allowed. |
order | the maximum degree to use for approximation |
Definition at line 157 of file sbasis-geometric.cpp.
References Geom::D2< T >::at0(), Geom::cutAtRoots(), Geom::derivative(), Geom::divide(), Geom::integral(), order, RescaleForNonVanishingEnds(), and result.
|
related |
...
Definition at line 300 of file piecewise.h.
References Geom::bounds_exact(), Geom::Piecewise< T >::empty(), and Geom::Piecewise< T >::size().
|
related |
...
Definition at line 284 of file piecewise.h.
References Geom::bounds_fast(), Geom::Piecewise< T >::empty(), and Geom::Piecewise< T >::size().
|
related |
...
Definition at line 316 of file piecewise.h.
References Geom::bounds_exact(), Geom::bounds_local(), Geom::Piecewise< T >::empty(), Geom::GenericInterval< C >::isSingular(), Geom::GenericInterval< C >::max(), Geom::GenericInterval< C >::min(), Geom::Piecewise< T >::segN(), and Geom::Piecewise< T >::segT().
|
related |
Centroid using sbasis integration.
p | the Element. |
centroid | on return contains the centroid of the shape |
area | on return contains the signed area of the shape. |
This approach uses green's theorem to compute the area and centroid using integrals. For curved shapes this is much faster than converting to polyline. Note that without an uncross operation the output is not the absolute area.
Returned values: 0 for normal execution; 2 if area is zero, meaning centroid is meaningless.
Definition at line 521 of file sbasis-geometric.cpp.
References Geom::area(), Geom::D2< T >::at0(), Geom::SBasis::at0(), Geom::D2< T >::at1(), Geom::SBasis::at1(), Geom::centroid(), Geom::cross(), Geom::derivative(), Geom::dot(), Geom::integral(), Geom::multiply(), and Geom::rot90().
|
related |
...
Definition at line 815 of file piecewise.h.
References Geom::compose(), Geom::Piecewise< T >::cuts, result, Geom::Piecewise< T >::segs, and Geom::Piecewise< T >::setDomain().
...
Definition at line 761 of file piecewise.h.
References Geom::are_near(), Geom::bounds_fast(), bs, Geom::compose(), Geom::compose_findSegIdx(), Geom::compose_pullback(), Geom::Piecewise< T >::cuts, Geom::Piecewise< T >::empty(), Geom::EPSILON, Geom::SBasis::isZero(), result, Geom::Piecewise< T >::segs, Geom::Piecewise< T >::size(), and width.
returns a function giving the curvature at each point in M.
M | the Element. |
tol | the maximum error allowed. , D2 |
Definition at line 364 of file sbasis-geometric.cpp.
References Geom::cross(), Geom::derivative(), Geom::divide(), Geom::dot(), and Geom::unitVector().
|
related |
returns a function giving the curvature at each point in M.
M | the Element. |
tol | the maximum error allowed. |
Definition at line 380 of file sbasis-geometric.cpp.
References Geom::curvature(), Geom::cutAtRoots(), Geom::Piecewise< T >::cuts, result, Geom::Piecewise< T >::segs, Geom::Piecewise< T >::setDomain(), and Geom::Piecewise< T >::size().
...
Definition at line 877 of file piecewise.h.
References Geom::Piecewise< T >::cuts, Geom::derivative(), result, and Geom::Piecewise< T >::segs.
|
related |
Calculates the 'dot product' or 'inner product' of a
and b
.
\[ f(t) \rightarrow \left\{ \begin{array}{c} a_1 \bullet b_1 \\ a_2 \bullet b_2 \\ \ldots \\ a_n \bullet b_n \\ \end{array}\right. \]
Definition at line 106 of file d2-sbasis.cpp.
References Geom::Piecewise< T >::cuts, Geom::dot(), result, Geom::Piecewise< T >::segs, and Geom::Piecewise< T >::size().
|
related |
Calculates the 'dot product' or 'inner product' of a
and b
.
\[ f(t) \rightarrow \left\{ \begin{array}{c} a_1 \bullet b \\ a_2 \bullet b \\ \ldots \\ a_n \bullet b \\ \end{array}\right. \]
Definition at line 131 of file d2-sbasis.cpp.
References Geom::dot(), Geom::Piecewise< T >::push_cut(), and result.
|
related |
Returns a portion of a piece of a Piecewise<T>, given the piece's index and a to/from time.
Definition at line 341 of file piecewise.h.
References Geom::Piecewise< T >::cuts, Geom::portion(), and Geom::Piecewise< T >::size().
...
Definition at line 858 of file piecewise.h.
References Geom::Bezier::at0(), c, Geom::Piecewise< T >::cuts, Geom::integral(), result, and Geom::Piecewise< T >::segs.
Calculates the length of a Piecewise<D2<SBasis> > through gsl integration.
s | the Element. |
tol | the maximum error allowed. |
If you only want the total length, this routine faster and more accurate than constructing an arcLengthSb.
Definition at line 498 of file sbasis-geometric.cpp.
References Geom::length_integrating(), and result.
|
related |
Interpolates between a and b.
Definition at line 925 of file piecewise.h.
References Geom::Piecewise< T >::cuts, Geom::Piecewise< T >::domain(), and Geom::Piecewise< T >::setDomain().
...
Definition at line 587 of file piecewise.h.
References Geom::Piecewise< T >::cuts, Geom::Piecewise< T >::empty(), Geom::Piecewise< T >::push_seg(), Geom::Piecewise< T >::segs, and Geom::Piecewise< T >::size().
...
Definition at line 605 of file piecewise.h.
References Geom::Piecewise< T >::cuts, Geom::Piecewise< T >::empty(), Geom::Piecewise< T >::push_seg(), Geom::Piecewise< T >::segs, and Geom::Piecewise< T >::size().
|
related |
...
Definition at line 709 of file piecewise.h.
References Geom::Piecewise< T >::cuts, Geom::Piecewise< T >::push_seg(), Geom::Piecewise< T >::segs, and Geom::Piecewise< T >::size().
|
related |
...
Definition at line 662 of file piecewise.h.
References Geom::Piecewise< T >::cuts, Geom::Piecewise< T >::push_seg(), and Geom::Piecewise< T >::segs.
|
related |
...
Definition at line 522 of file piecewise.h.
References Geom::Piecewise< T >::cuts, Geom::Piecewise< T >::segs, and Geom::Piecewise< T >::size().
...
Definition at line 571 of file piecewise.h.
References Geom::Piecewise< T >::cuts, Geom::Piecewise< T >::segs, and Geom::Piecewise< T >::size().
|
related |
...
Definition at line 680 of file piecewise.h.
References Geom::Piecewise< T >::cuts, Geom::Piecewise< T >::push_seg(), and Geom::Piecewise< T >::segs.
...
Definition at line 623 of file piecewise.h.
References Geom::Piecewise< T >::cuts, Geom::Piecewise< T >::empty(), Geom::Piecewise< T >::push_seg(), Geom::Piecewise< T >::segs, and Geom::Piecewise< T >::size().
|
related |
Piecewise<T> partition(const Piecewise<T> &pw, std::vector<double> const &c); Further subdivides the Piecewise<T> such that there is a cut at every value in c.
Precondition: c sorted lower to higher.
//Given Piecewise<T> a and b: Piecewise<T> ac = a.partition(b.cuts); Piecewise<T> bc = b.partition(a.cuts); //ac.cuts should be equivalent to bc.cuts
Definition at line 359 of file piecewise.h.
References c, Geom::Piecewise< T >::cuts, Geom::Piecewise< T >::empty(), Geom::Piecewise< T >::invariants(), Geom::portion(), Geom::Piecewise< T >::push(), Geom::Piecewise< T >::push_cut(), Geom::Piecewise< T >::push_seg(), Geom::Piecewise< T >::reserve(), Geom::Piecewise< T >::segs, Geom::Piecewise< T >::segT(), and Geom::Piecewise< T >::size().
|
related |
Returns a Piecewise<T> with a defined domain of [min(from, to), max(from, to)].
Definition at line 427 of file piecewise.h.
References Geom::Piecewise< T >::cuts, Geom::Piecewise< T >::empty(), Geom::Piecewise< T >::invariants(), Geom::portion(), Geom::Piecewise< T >::push(), Geom::Piecewise< T >::push_cut(), Geom::Piecewise< T >::push_seg(), Geom::Piecewise< T >::reserve(), Geom::Piecewise< T >::segN(), Geom::Piecewise< T >::segs, Geom::Piecewise< T >::segT(), and Geom::Piecewise< T >::size().
|
related |
Compose an SBasis with the inverse of another.
WARNING: It's up to the user to check that the second SBasis is indeed invertible (i.e. strictly increasing or decreasing).
Definition at line 158 of file piecewise.cpp.
References Geom::SBasis::at0(), Geom::SBasis::at1(), Geom::compose(), Geom::compose_inverse(), order, Geom::portion(), Geom::pw_compose_inverse(), result, Geom::reverse(), Geom::SBasis::size(), and Geom::SBasis::tailError().
|
related |
...
Definition at line 464 of file piecewise.h.
References Geom::Piecewise< T >::cuts, Geom::Piecewise< T >::empty(), Geom::Piecewise< T >::push(), Geom::Piecewise< T >::push_cut(), Geom::Piecewise< T >::reserve(), and Geom::Piecewise< T >::size().
|
related |
...
Definition at line 484 of file piecewise.h.
References Geom::Piecewise< T >::cuts, Geom::Piecewise< T >::empty(), Geom::Piecewise< T >::push(), Geom::Piecewise< T >::push_cut(), Geom::Piecewise< T >::reserve(), and Geom::Piecewise< T >::size().
...
Definition at line 905 of file piecewise.h.
References Geom::Piecewise< T >::cuts, end, Geom::Piecewise< T >::push_cut(), Geom::Piecewise< T >::push_seg(), Geom::Piecewise< T >::reserve(), Geom::reverse(), Geom::Piecewise< T >::segs, Geom::Piecewise< T >::size(), and start.
|
related |
...
Definition at line 505 of file piecewise.h.
References Geom::Piecewise< T >::cuts, Geom::roots(), and Geom::Piecewise< T >::size().
|
related |
tan2 is the pseudo-inverse of atan2.
It takes an angle and returns a unit_vector that points in the direction of angle.
angle | a piecewise function of angle wrt t. |
tol | the maximum error allowed. |
order | the maximum degree to use for approximation , D2 |
Definition at line 210 of file sbasis-geometric.cpp.
References Geom::cos(), order, and Geom::sin().
|
related |
Return a Piecewise<D2<SBasis> > which points in the same direction as V_in, but has unit_length.
V_in | the original path. |
tol | the maximum error allowed. |
order | the maximum degree to use for approximation |
unitVector(x,y) is computed as (b,-a) where a and b are solutions of: ax+by=0 (eqn1) and a^2+b^2=1 (eqn2)
, D2
Definition at line 225 of file sbasis-geometric.cpp.
References Geom::SBasis::at(), Geom::D2< T >::at0(), Geom::Linear::at0(), Geom::D2< T >::at1(), Geom::Linear::at1(), Geom::compose(), Geom::Piecewise< T >::concat(), Geom::dot(), order, RescaleForNonVanishingEnds(), result, Geom::Piecewise< T >::setDomain(), Geom::SBasis::size(), Geom::SBasis::tailError(), Geom::unit_vector(), and Geom::unitVector().
|
related |
Return a Piecewise<D2<SBasis> > which points in the same direction as V_in, but has unit_length.
V_in | the original path. |
tol | the maximum error allowed. |
order | the maximum degree to use for approximation |
unitVector(x,y) is computed as (b,-a) where a and b are solutions of: ax+by=0 (eqn1) and a^2+b^2=1 (eqn2)
Definition at line 305 of file sbasis-geometric.cpp.
References Geom::cutAtRoots(), Geom::Piecewise< T >::cuts, order, result, Geom::Piecewise< T >::segs, Geom::Piecewise< T >::setDomain(), Geom::Piecewise< T >::size(), and Geom::unitVector().
std::vector<double> Geom::Piecewise< T >::cuts |
Definition at line 75 of file piecewise.h.
Referenced by Geom::Piecewise< T >::arc_length_parametrization(), cairo_pw(), cairo_pw(), Geom::Piecewise< T >::clear(), Geom::Piecewise< T >::compose(), Geom::Piecewise< T >::compose(), Geom::computeLinfinityNeighborhood(), computeLinfinityNeighborhood(), Geom::computeLinfinityNeighborhood(), computeLinfinityNeighborhood(), Geom::Piecewise< T >::concat(), Geom::Piecewise< T >::continuousConcat(), convole(), convole(), Geom::cos(), Geom::cross(), Geom::Piecewise< T >::curvature(), Geom::Piecewise< T >::derivative(), Geom::divide(), Geom::divide(), Inkscape::LivePathEffect::LPEInterpolate::doEffect_path(), doEffect_pwd2(), Inkscape::LivePathEffect::LPEBendPath::doEffect_pwd2(), Inkscape::LivePathEffect::LPEDynastroke::doEffect_pwd2(), Inkscape::LivePathEffect::LPEEnvelope::doEffect_pwd2(), Inkscape::LivePathEffect::LPERoughHatches::doEffect_pwd2(), doEffect_pwd2(), Geom::Piecewise< T >::domain(), Geom::Piecewise< T >::dot(), Geom::Piecewise< T >::elem_portion(), Inkscape::LivePathEffect::find_cusps(), Geom::Piecewise< T >::firstValue(), Geom::Piecewise< T >::integral(), Geom::interpolate(), Geom::Piecewise< T >::invariants(), Geom::Piecewise< T >::lastValue(), Geom::Piecewise< T >::lerp(), Geom::level_set(), linearizeCusps(), Geom::Piecewise< T >::mapToDomain(), Geom::max(), Geom::Piecewise< T >::offsetDomain(), Geom::Piecewise< T >::operator*(), Geom::Piecewise< T >::operator*(), Geom::Piecewise< T >::operator*(), Geom::Piecewise< T >::operator+(), Geom::Piecewise< T >::operator+(), Geom::Piecewise< T >::operator-(), Geom::Piecewise< T >::operator-(), Geom::operator-(), Geom::Piecewise< T >::operator/(), Geom::Piecewise< T >::partition(), plot(), plot(), plot(), plot(), plot3d(), plot_graph(), Geom::Piecewise< T >::portion(), Geom::prolongateByConstants(), prolongateByConstants(), Geom::Piecewise< T >::push(), Geom::Piecewise< T >::push(), Geom::Piecewise< T >::push_cut(), pw_inverse(), Geom::reciprocalOnDomain(), Geom::Piecewise< T >::remove_short_cuts(), Geom::Piecewise< T >::remove_short_cuts_extending(), Geom::Piecewise< T >::reserve(), Geom::Piecewise< T >::reverse(), Geom::Piecewise< T >::roots(), Geom::Piecewise< T >::scaleDomain(), Geom::sectionize(), Geom::Piecewise< T >::segN(), Geom::Piecewise< T >::segT(), Geom::Piecewise< T >::setDomain(), Inkscape::LivePathEffect::TextParam::setPosAndAnchor(), Geom::split_at_discontinuities(), Geom::sqrt(), Geom::Piecewise< T >::unitVector(), and Geom::Piecewise< T >::valueAndDerivatives().
std::vector<T> Geom::Piecewise< T >::segs |
Definition at line 76 of file piecewise.h.
Referenced by Geom::abs(), Geom::Piecewise< T >::arc_length_parametrization(), Geom::Piecewise< T >::clear(), Geom::Piecewise< T >::compose(), Geom::Piecewise< T >::compose(), Geom::computeLinfinityNeighborhood(), computeLinfinityNeighborhood(), Geom::computeLinfinityNeighborhood(), computeLinfinityNeighborhood(), Geom::Piecewise< T >::concat(), Geom::Piecewise< T >::continuousConcat(), Geom::cos(), Geom::cross(), Geom::Piecewise< T >::curvature(), Geom::Piecewise< T >::derivative(), Inkscape::LivePathEffect::LPEEmbroderyStitch::doEffect_path(), Inkscape::LivePathEffect::LPEPowerStroke::doEffect_path(), Inkscape::LivePathEffect::LPEDynastroke::doEffect_pwd2(), Inkscape::LivePathEffect::LPERuler::doEffect_pwd2(), Inkscape::LivePathEffect::LPESketch::doEffect_pwd2(), Geom::Piecewise< T >::dot(), Geom::Piecewise< T >::empty(), Geom::fuse_nearby_ends(), Geom::Piecewise< T >::integral(), Geom::Piecewise< T >::invariants(), Geom::max(), Geom::multi_roots(), Geom::Piecewise< T >::operator*(), Geom::Piecewise< T >::operator*(), Geom::Piecewise< T >::operator*(), Geom::Piecewise< T >::operator+(), Geom::Piecewise< T >::operator+(), Geom::Piecewise< T >::operator-(), Geom::Piecewise< T >::operator-(), Geom::operator-(), Geom::Piecewise< T >::operator/(), Geom::Piecewise< T >::operator[](), Geom::Piecewise< T >::operator[](), Geom::Piecewise< T >::partition(), plot(), plot(), plot(), Geom::Piecewise< T >::portion(), Geom::prolongateByConstants(), prolongateByConstants(), Geom::Piecewise< T >::push(), Geom::Piecewise< T >::push(), Geom::Piecewise< T >::push_seg(), Geom::Piecewise< T >::push_seg(), pw_inverse(), Geom::reciprocalOnDomain(), recursive_curvature_fitter(), Geom::Piecewise< T >::reserve(), Geom::Piecewise< T >::reverse(), Geom::roots(), Geom::Piecewise< T >::scaleDomain(), single_curvature_fitter(), Geom::Piecewise< T >::size(), Geom::split_at_discontinuities(), Geom::sqrt(), Geom::truncateResult(), Geom::Piecewise< T >::unitVector(), Geom::Piecewise< T >::valueAndDerivatives(), and Geom::Piecewise< T >::valueAt().