lpe-powerstroke.cpp revision b7975890f78e083b615e80a9a9432ec8f79baf17
#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;
// 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();
// output = pwd2_in + n * offset;
// append_half_circle(output, pwd2_in.lastValue(), n.lastValue() * offset);
// output.continuousConcat(reverse(pwd2_in - n * offset));
// append_half_circle(output, pwd2_in.firstValue(), -n.firstValue() * offset);
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 :