lpe-line_segment.cpp revision 5f19756f48574526dda8abedebf811c9d1456e80
/** \file
* LPE <line_segment> implementation
*/
/*
* 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-line_segment.h"
#include "lpe-tool-context.h"
namespace Inkscape {
namespace LivePathEffect {
};
static const Util::EnumDataConverter<EndType> EndTypeConverter(EndTypeData, sizeof(EndTypeData)/sizeof(*EndTypeData));
end_type(_("End type:"), _("Determines on which side the line or line segment is infinite."), "end_type", EndTypeConverter, &wr, this, END_OPEN_BOTH)
{
/* register all your parameters here, so Inkscape knows which parameters this effect has: */
}
{
}
void
{
}
{
A = initialPoint(path_in);
B = finalPoint(path_in);
boost::optional<Geom::LineSegment> intersection_segment = Geom::rect_line_intersect(dummyRect, Geom::Line(A, B));
if (!intersection_segment) {
g_print ("Possible error - no intersection with limiting bounding box.\n");
return path_in;
}
A = (*intersection_segment).initialPoint();
}
B = (*intersection_segment).finalPoint();
}
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 :