All pastes #607660 Raw Edit

Unnamed

public cpp v1 · immutable
·published 2007-07-07 20:18 UTC
rendered paste body
/* *  Here be the doEffect function chain: */voidEffect::doEffect (SPCurve * curve){    NArtBpath *new_bpath = doEffect(SP_CURVE_BPATH(curve));    if (new_bpath) {        // FIXME, add function to SPCurve to change bpath? or a copy function?        if (curve->_bpath) {            g_free(curve->_bpath); //delete old bpath        }        curve->_bpath = new_bpath;    }}NArtBpath *Effect::doEffect (NArtBpath * path_in){    std::vector<Geom::Path> orig_pathv = BPath_to_2GeomPath(path_in);    std::vector<Geom::Path> result_pathv = doEffect(orig_pathv);    NArtBpath *new_bpath = BPath_from_2GeomPath(result_pathv);    return new_bpath;}std::vector<Geom::Path>Effect::doEffect (std::vector<Geom::Path> & path_in){    Geom::Piecewise<Geom::D2<Geom::SBasis> > pwd2_in;    // FIXME: find standard function to convert std::vector<Geom::Path> ==> Piecewise< D2<SBasis> >    for (unsigned int i=0; i < path_in.size(); i++) {        pwd2_in.concat( path_in[i].toPwSb() );    }    Geom::Piecewise<Geom::D2<Geom::SBasis> > pwd2_out = doEffect(pwd2_in);    std::vector<Geom::Path> path_out = Geom::path_from_piecewise( pwd2_out, LPE_CONVERSION_TOLERANCE);    return path_out;}Geom::Piecewise<Geom::D2<Geom::SBasis> >Effect::doEffect (Geom::Piecewise<Geom::D2<Geom::SBasis> > & pwd2_in){    g_warning("Effect has no doEffect implementation");    return pwd2_in;}