lpe-spiro.cpp revision a2fbdfc8e80d3d1845bf0d5df989726ae2ffd5bf
#define INKSCAPE_LPE_SPIRO_C
/*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include "live_effects/lpe-spiro.h"
#include <libnr/n-art-bpath.h>
#include "nodepath.h"
#include "live_effects/bezctx.h"
#include "live_effects/bezctx_intf.h"
#include "live_effects/spiro.h"
// For handling un-continuous paths:
#include "message-stack.h"
#include "inkscape.h"
#include "desktop.h"
typedef struct {
int is_open;
} bezctx_ink;
{
}
{
}
{
}
{
}
bezctx *
}
namespace Inkscape {
namespace LivePathEffect {
{
}
{
}
void
{
sp_nodepath_show_handles(np, false);
// sp_nodepath_show_helperpath(np, false);
}
void
{
int ib = 0;
int ip = 0;
bool closed = false;
// std::cout << "==" << bpath[ib].code << " ip" << ip << " ib" << ib << "\n";
if (ip != 0) { // run prev subpath
int sp_len = 0;
if (!closed) {
} else {
}
//for (int j = 0; j <= sp_len; j ++) printf ("%c\n", path[j].ty);
free(s);
ip = 0;
}
closed = false;
} else {
closed = true;
}
} else {
// this point is not last, so makes sense to find a proper type for it
if (ib < len && (bpath[ib+1].code == NR_END || bpath[ib+1].code == NR_MOVETO_OPEN || bpath[ib+1].code == NR_MOVETO)) { // end of subpath
if (closed)
} else {
else if (closed)
}
if (next) {
if (this_is_line) {
}
if (next_is_line) {
}
if (this_angle_L2 > 1e-6 &&
next_angle_L2 > 1e-6 &&
if (this_is_line && !next_is_line) {
} else if (next_is_line && !this_is_line) {
} else {
}
} else {
}
}
}
}
ip++;
ib++;
}
// FIXME: refactor the spiro code such that it cannot generate non-continous paths!
// sometimes, the code above generates a path that is not continuous. if so, undo the effect by resetting the original path.
try {
curve->get_pathvector() * Geom::identity(); // tests for continuity, this makes LPE Spiro slower of course :-(
}
catch (Geom::ContinuityError & e) {
_("An exception occurred during execution of the Spiro Path Effect.") );
}
}
}; //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 :