svg-path.cpp revision 684a5fa4464dc8650d34718e955869846b34bb3f
/*
* svg-path.cpp: Parse SVG path element data into bezier path.
* Authors:
* Johan Engelen
* (old nartbpath code that has been deleted: Raph Levien <raph@artofcode.com>)
* (old nartbpath code that has been deleted: Lauris Kaplinski <lauris@ximian.com>)
*
* Copyright (C) 2000 Eazel, Inc.
* Copyright (C) 2000 Lauris Kaplinski
* Copyright (C) 2001 Ximian, Inc.
* Copyright (C) 2008 Johan Engelen
*
* Copyright (C) 2000-2008 authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include <cstring>
#include <string>
#include <cassert>
#include <glib.h> // g_assert()
#include "svg/path-string.h"
/*
* Parses the path in str. When an error is found in the pathstring, this method
* returns a truncated path up to where the error was found in the pathstring.
* Returns an empty PathVector when str==NULL
*/
{
if (!str)
return pathv; // return empty pathvector when str == NULL
try {
}
catch (Geom::SVGPathParseError &e) {
// This warning is extremely annoying when testing
//g_warning("Malformed SVG path, truncated path up to where error was found.\n Input path=\"%s\"\n Parsed path=\"%s\"", str, sp_svg_write_path(pathv));
}
return pathv;
}
// TODO: this code needs to removed and replaced by appropriate path sink
// don't serialize stitch segments
} else {
}
}
}
else if(Geom::QuadraticBezier const *quadratic_bezier = dynamic_cast<Geom::QuadraticBezier const *>(c)) {
}
}
else if(Geom::SVGEllipticalArc const *svg_elliptical_arc = dynamic_cast<Geom::SVGEllipticalArc const *>(c)) {
svg_elliptical_arc->finalPoint() );
} else {
//this case handles sbasis as well as all other curve types
//recurse to convert the new path resulting from the sbasis to svgd
}
}
}
}
if (p.closed()) {
}
}
}
}
sp_svg_write_path(str, p);
}
/*
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:fileencoding=utf-8 :