22 for(
unsigned i = 0; i < p.
size(); i++) {
30class CentreWarp:
public Toy {
35 void draw(
cairo_t *cr, std::ostringstream *notify,
int width,
int height,
bool save, std::ostringstream *timer_stream)
override {
44 cos(B[1]*0.1)*(brush_handle.
pos[1]/100) + B[1]);
73 *notify << path_a_pw.
size();
77 void first_time(
int argc,
char** argv)
override {
78 const char *path_a_name=
"star.svgd";
80 path_a_name = argv[1];
82 assert(!paths_a.
empty());
86 path_a_pw = path_a.
toPwSb();
87 for(
unsigned dim = 0; dim < 2; dim++) {
90 const int depth = sb2[dim].us*sb2[dim].vs;
94 handles.push_back(&brush_handle);
99int main(
int argc,
char **argv) {
100 init(argc, argv,
new CentreWarp);
Path - a sequence of contiguous curves.
Conversion between Bezier control points and SBasis curves.
void cairo_pw(cairo_t *cr, Piecewise< SBasis > p)
unsigned total_pieces_inc
unsigned total_pieces_sub
Adaptor that creates 2D functions from 1D ones.
Function that interpolates linearly between two values.
bool empty() const
Check whether the vector contains any paths.
Sequence of contiguous curves, aka spline.
void close(bool closed=true)
Set whether the path is closed.
Piecewise< D2< SBasis > > toPwSb() const
Function defined as discrete pieces.
void push(const T &s, double to)
Convenience/implementation hiding function to add segment/cut pairs.
void scaleDomain(double s)
std::vector< double > cuts
Two-dimensional point that doubles as a vector.
Polynomial in symmetric power basis.
virtual void first_time(int, char **)
vector< Handle * > handles
virtual void save(FILE *f)
virtual void draw(cairo_t *cr, std::ostringstream *notify, int w, int h, bool save, std::ostringstream *timing_stream)
Lifts one dimensional objects into 2D.
PathVector read_svgd(char const *filename)
Create path vector from SVG path data stored in a file.
Various utility functions.
SBasisN< n > cos(LinearN< n > bo, int k)
D2< Piecewise< SBasis > > make_cuts_independent(Piecewise< D2< SBasis > > const &a)
D2< T > compose(D2< T > const &a, T const &b)
T dot(D2< T > const &a, D2< T > const &b)
Piecewise< D2< SBasis > > unitVector(D2< SBasis > const &vect, double tol=.01, unsigned order=3)
void cairo_d2_pw_sb(cairo_t *cr, Geom::D2< Geom::Piecewise< Geom::SBasis > > const &p)
void cairo_d2_sb(cairo_t *cr, Geom::D2< Geom::SBasis > const &p)
Obsolete 2D SBasis function class.
two-dimensional geometric operators.
some std functions to work with (pw)s-basis
Polynomial in symmetric power basis (S-basis)
parse SVG path specifications
void cairo_set_source_rgba(cairo_t *cr, colour c)
void init(int argc, char **argv, Toy *t, int width=600, int height=600)