lpe-dynastroke.cpp revision 9d588d0f572df7f3c9a6ed4662814a9af46db21f
/** \file
* LPE <dynastroke> implementation
*/
/*
* Authors:
* JF Barraud
*
* Copyright (C) JF Barraud 2007 <jf.barraud@gmail.com>
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include "live_effects/lpe-dynastroke.h"
//# include <libnr/n-art-bpath.h>
namespace Inkscape {
namespace LivePathEffect {
//TODO: define more styles like in calligtool.
//TODO: allow fancy ends.
};
static const Util::EnumDataConverter<DynastrokeMethod> DSMethodConverter(DynastrokeMethodData, DSM_END);
};
static const Util::EnumDataConverter<DynastrokeCappingType> DSCTConverter(DynastrokeCappingTypeData, DSCT_END);
// initialise your parameters here:
method(_("Method:"), _("Choose pen type"), "method", DSMethodConverter, &wr, this, DSM_THICKTHIN_FAST),
angle(_("Angle:"), _("direction of thickest strokes (opposite = thinnest)"), "angle", &wr, this, 45),
// modulo_pi(_("modulo pi"), _("Give forward and backward moves in one direction the same thickness "), "modulo_pi", &wr, this, false),
start_cap(_("Start:"), _("Choose start capping type"), "start_cap", DSCTConverter, &wr, this, DSCT_SHARP),
capping(_("Capping:"), _("left capping"), "capping", &wr, this, "M 100,5 C 50,5 0,0 0,0 0,0 50,-5 100,-5")
{
//registerParameter( dynamic_cast<Parameter *>(& modulo_pi) );
show_orig_path = true;
}
{
}
{
using namespace Geom;
// std::cout<<"do effect: debut\n";
n = rot90(n);
// for (unsigned i=0; i<n.size(); i++){
// std::cout<<n[i][X]<<"\n";
// }
// return m + unitVector(v);
#if 0
//TODO test if mag is non empty...
return output;
#else
// std::vector<double> corners = find_corners(m);
if (roundness==1.) {
// std::cout<<"round pen.\n";
}else{
switch(stroke_method) {
case DSM_ELLIPTIC_PEN:{
// std::cout<<"ellptic pen\n";
//FIXME: roundness=0???
break;
}
case DSM_THICKTHIN_FAST:{
// std::cout<<"fast thick thin pen\n";
n1 = w*n;
break;
}
case DSM_THICKTHIN_SLOW:{
// std::cout<<"slow thick thin pen\n";
//->Slower and less stable, but more accurate .
//FIXME: is force continuity usefull? compatible with corners?
// std::cout<<"ici\n";
// std::cout<<"ici2\n";
break;
}
default:{
break;
}
}//case
//
//TODO: insert relevant stitch at each corner!!
//
// if closed:
// std::cout<<"closed input.\n";
} else {
//if not closed, shape the ends:
//TODO: allow fancy ends...
// std::cout<<"shaping the ends\n";
//scale factor for a sharp start
if (grow_length < totlength){
}
// std::cout<<"shaping the ends ici\n";
//scale factor for a sharp end
if (fade_length < totlength){
}else{
}
// std::cout<<"shaping the ends ici ici\n";
// std::cout<<"shaping the ends ici ici ici\n";
// std::cout<<"shaping round start\n";
}
// std::cout<<"shaping round end\n";
}
}
// std::cout<<"gathering result: left";
// std::cout<<" + reverse(right)";
// std::cout<<". done\n";
//-----------
return output;
#endif
}
/* ######################## */
} //namespace LivePathEffect (setq default-directory "c:/Documents And Settings/jf/Mes Documents/InkscapeSVN")
} /* 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 :