Scribus
Open source desktop publishing at your fingertips
Geom::Piecewise< T > Class Template Reference

Public Types

typedef T::output_type output_type
 

Public Member Functions

 Piecewise (const T &s)
 
 Piecewise (const output_type &v)
 
operator[] (unsigned i) const
 
T & operator[] (unsigned i)
 
output_type operator() (double t) const
 
output_type valueAt (double t) const
 
Piecewise< T > operator() (SBasis f)
 
Piecewise< T > operator() (Piecewise< SBasis >f)
 
unsigned size () const
 
bool empty () const
 
void push (const T &s, double to)
 
void push_cut (double c)
 
void push_seg (const T &s)
 
unsigned segN (double t, int low=0, int high=-1) const
 
double segT (double t, int i=-1) const
 
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
 

Member Function Documentation

template<typename T>
void Geom::Piecewise< T >::push ( const T &  s,
double  to 
)
inline

Convenience/implementation hiding function to add segment/cut pairs. Asserts that basic size and order invariants are correct

template<typename T>
unsigned Geom::Piecewise< T >::segN ( double  t,
int  low = 0,
int  high = -1 
) const
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.

template<typename T>
double Geom::Piecewise< T >::segT ( double  t,
int  i = -1 
) const
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.


The documentation for this class was generated from the following file: