1 #ifndef INKSCAPE_LPE_PERP_BISECTOR_H
2 #define INKSCAPE_LPE_PERP_BISECTOR_H
4 /** \file
5 * LPE <perp_bisector> implementation, see lpe-perp_bisector.cpp.
6 */
7 /*
8 * Authors:
9 * Maximilian Albert
10 * Johan Engelen
11 *
12 * Copyright (C) Johan Engelen 2007 <j.b.c.engelen@utwente.nl>
13 * Copyright (C) Maximilin Albert 2008 <maximilian.albert@gmail.com>
14 *
15 * Released under GNU GPL, read the file 'COPYING' for more information
16 */
18 #include "live_effects/effect.h"
19 #include "live_effects/parameter/parameter.h"
20 #include "live_effects/parameter/point.h"
22 namespace Inkscape {
23 namespace LivePathEffect {
25 namespace PB {
26 // we need a separate namespace to avoid clashes with LPETangentToCurve
27 class KnotHolderEntityEnd;
28 class KnotHolderEntityLeftEnd;
29 class KnotHolderEntityRightEnd;
30 void bisector_end_set(SPItem *item, Geom::Point const &p, bool left);
31 }
33 class LPEPerpBisector : public Effect {
34 public:
35 LPEPerpBisector(LivePathEffectObject *lpeobject);
36 virtual ~LPEPerpBisector();
38 virtual EffectType effectType () { return PERP_BISECTOR; }
40 void doOnApply (SPLPEItem *lpeitem);
42 virtual Geom::Piecewise<Geom::D2<Geom::SBasis> >
43 doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd2_in);
45 /* the knotholder entity functions must be declared friends */
46 friend class PB::KnotHolderEntityEnd;
47 friend class PB::KnotHolderEntityLeftEnd;
48 friend class PB::KnotHolderEntityRightEnd;
49 friend void PB::bisector_end_set(SPItem *item, Geom::Point const &p, bool left = true);
51 private:
52 ScalarParam length_left;
53 ScalarParam length_right;
55 Geom::Point A; // start of path
56 Geom::Point B; // end of path
57 Geom::Point M; // midpoint
58 Geom::Point C; // left end of bisector
59 Geom::Point D; // right end of bisector
60 Geom::Point perp_dir;
62 LPEPerpBisector(const LPEPerpBisector&);
63 LPEPerpBisector& operator=(const LPEPerpBisector&);
64 };
66 } //namespace LivePathEffect
67 } //namespace Inkscape
69 #endif