/** \file
* LPE <perp_bisector> implementation.
*/
/*
* Authors:
* Maximilian Albert
* Johan Engelen
*
* Copyright (C) Johan Engelen 2007 <j.b.c.engelen@utwente.nl>
* Copyright (C) Maximilin Albert 2008 <maximilian.albert@gmail.com>
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include "live_effects/lpe-perp_bisector.h"
#include "sp-path.h"
#include "line-geometry.h"
#include "sp-lpe-item.h"
#include "knot-holder-entity.h"
#include "knotholder.h"
namespace Inkscape {
namespace LivePathEffect {
namespace PB {
public:
};
public:
};
public:
};
}
}
void
if (!lpe) return;
if (left) {
} else {
}
// FIXME: this should not directly ask for updating the item. It should write to SVG, which triggers updating.
}
void
KnotHolderEntityLeftEnd::knot_set(Geom::Point const &p, Geom::Point const &/*origin*/, guint state) {
bisector_end_set(p, state);
}
void
KnotHolderEntityRightEnd::knot_set(Geom::Point const &p, Geom::Point const &/*origin*/, guint state) {
bisector_end_set(p, state, false);
}
} //namescape PB
length_left(_("Length left:"), _("Specifies the left end of the bisector"), "length-left", &wr, this, 200),
length_right(_("Length right:"), _("Specifies the right end of the bisector"), "length-right", &wr, this, 200),
A(0,0), B(0,0), M(0,0), C(0,0), D(0,0), perp_dir(0,0)
{
show_orig_path = true;
_provides_knotholder_entities = true;
// register all your parameters here, so Inkscape knows which parameters this effect has:
}
{
}
void
{
/* make the path a straight line */
/**
SPCurve* curve = sp_path_get_curve_for_edit (SP_PATH(lpeitem)); // TODO: Should we use sp_shape_get_curve()?
Geom::Point A(curve->first_point());
Geom::Point B(curve->last_point());
SPCurve *c = new SPCurve();
c->moveto(A);
c->lineto(B);
// TODO: Why doesn't sp_path_set_original_curve(SP_PATH(lpeitem), c, TRUE, true) work?
SP_PATH(lpeitem)->original_curve = c->ref();
c->unref();
**/
}
{
using namespace Geom;
A = pwd2_in.firstValue();
M = (A + B)/2;
C = M + perp_dir * length_left;
D = M - perp_dir * length_right;
return output;
}
void
{
_("Adjust the \"left\" end of the bisector") );
knotholder->add(e);
}
{
_("Adjust the \"right\" end of the bisector") );
knotholder->add(e);
}
};
/* ######################## */
} //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 :