lpe-powerstroke.cpp revision a98e166353de7afec9b137d1a5a4e355ae77738c
#define INKSCAPE_LPE_POWERSTROKE_CPP
/** \file
* @brief PowerStroke LPE implementation. Creates curves with modifiable stroke width.
*/
/* Authors:
* Johan Engelen <j.b.c.engelen@utwente.nl>
*
* Copyright (C) 2010 Authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include "live_effects/lpe-powerstroke.h"
#include "sp-shape.h"
/// @TODO Move this to 2geom
namespace Geom {
namespace Interpolate {
class Interpolator {
public:
Interpolator() {};
virtual ~Interpolator() {};
// virtual Piecewise<D2<SBasis> > interpolateToPwD2Sb(std::vector<Point> points) = 0;
private:
Interpolator(const Interpolator&);
Interpolator& operator=(const Interpolator&);
};
class Linear : public Interpolator {
public:
Linear() {};
virtual ~Linear() {};
}
return path;
};
private:
};
// this class is terrible
class CubicBezierFit : public Interpolator {
public:
CubicBezierFit() {};
virtual ~CubicBezierFit() {};
// worst case gives us 2 segment per point
for (unsigned i = 0; i < n_points; ++i) {
}
double tolerance_sq = 0; // this value is just a random guess
if ( n_segs > 0)
{
for (int c = 0; c < n_segs; c++) {
}
}
g_free(b);
return fit;
};
private:
CubicBezierFit(const CubicBezierFit&);
CubicBezierFit& operator=(const CubicBezierFit&);
};
/// @todo invent name for this class
class CubicBezierJohan : public Interpolator {
public:
CubicBezierJohan() {};
virtual ~CubicBezierJohan() {};
}
return fit;
};
private:
CubicBezierJohan(const CubicBezierJohan&);
CubicBezierJohan& operator=(const CubicBezierJohan&);
};
} //namespace Interpolate
} //namespace Geom
namespace Inkscape {
namespace LivePathEffect {
sort_points(_("Sort points"), _("Sort offset points according to their time value along the curve."), "sort_points", &wr, this, true)
{
show_orig_path = true;
/// @todo offset_points are initialized with empty path, is that bug-save?
}
{
}
void
{
}
{
}
{
using namespace Geom;
// see if we should treat the path as being closed.
bool closed_path = false;
closed_path = true;
}
if (!closed_path) {
// perhaps use std::list instead of std::vector?
// first and last point coincide with input path (for now at least)
}
if (sort_points) {
}
// create stroke path where points (x,y) := (t, offset)
strokepath.close();
} else {
// path is closed
// perhaps use std::list instead of std::vector?
if (sort_points) {
}
// add extra points for interpolation between first and last point
// create stroke path where points (x,y) := (t, offset)
// output 2 separate paths
// find time values for which x lies outside path domain
// and only take portion of x and y that lies within those time values
}
x = reverse(x);
y = reverse(y);
}
return output;
}
/* ######################## */
} //namespace LivePathEffect
} /* namespace Inkscape */
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :