/** \file
* LPE <ruler> implementation, see lpe-ruler.cpp.
*/
/*
* Authors:
* Maximilian Albert
*
* Copyright (C) Maximilian Albert 2008 <maximilian.albert@gmail.com>
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include "live_effects/lpe-ruler.h"
#include "inkscape.h"
#include "desktop.h"
namespace Inkscape {
namespace LivePathEffect {
};
static const Util::EnumDataConverter<MarkDirType> MarkDirTypeConverter(MarkDirData, sizeof(MarkDirData)/sizeof(*MarkDirData));
};
static const Util::EnumDataConverter<BorderMarkType> BorderMarkTypeConverter(BorderMarkData, sizeof(BorderMarkData)/sizeof(*BorderMarkData));
mark_distance(_("_Mark distance:"), _("Distance between successive ruler marks"), "mark_distance", &wr, this, 20.0),
minor_mark_length(_("Mino_r length:"), _("Length of minor ruler marks"), "minor_mark_length", &wr, this, 7.0),
major_mark_steps(_("Major steps_:"), _("Draw a major mark every ... steps"), "major_mark_steps", &wr, this, 5),
mark_dir(_("Mark direction:"), _("Direction of marks (when viewing along the path from start to end)"), "mark_dir", MarkDirTypeConverter, &wr, this, MARKDIR_LEFT),
border_marks(_("Border marks:"), _("Choose whether to draw marks at the beginning and end of the path"), "border_marks", BorderMarkTypeConverter, &wr, this, BORDERMARK_BOTH)
{
}
{
}
{
using namespace Geom;
real_mark_length = Inkscape::Util::Quantity::convert(real_mark_length, unit.get_abbreviation(), "px");
real_minor_mark_length = Inkscape::Util::Quantity::convert(real_minor_mark_length, unit.get_abbreviation(), "px");
n_major = real_mark_length * n;
n_minor = real_minor_mark_length * n;
if (mark_dir == MARKDIR_BOTH) {
}
Point C, D;
switch (marktype) {
case MARK_MAJOR:
C = A;
D = A + n_major;
if (mark_dir == MARKDIR_BOTH)
C -= n_major;
break;
case MARK_MINOR:
C = A;
D = A + n_minor;
if (mark_dir == MARKDIR_BOTH)
C -= n_minor;
break;
default:
// do nothing
break;
}
return seg;
}
{
using namespace Geom;
//find at which times to draw a mark:
real_mark_distance = Inkscape::Util::Quantity::convert(real_mark_distance, unit.get_abbreviation(), "px");
}
//FIXME: 2geom multi_roots solver seem to sometimes "repeat" solutions.
//Here, we are supposed to have one and only one solution for each s.
}
//draw the marks
} else {
}
}
//eventually draw a mark at start
if ((border_marks == BORDERMARK_START || border_marks == BORDERMARK_BOTH) && (offset != 0.0 || i_shift != 0)){
}
//eventually draw a mark at end
//speed.lastValue() is somtimes wrong when the path is closed: a tiny line seg might added at the end to fix rounding errors...
//TODO: Find a better fix!! (How do we know if the path was closed?)
if ( A == pwd2_in.firstValue() &&
){
}
}
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 :