Code

Add checkbox for LPEs to temporarily disable them on canvas (but keep them applied...
[inkscape.git] / src / live_effects / lpe-perp_bisector.h
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 class LPEPerpBisector : public Effect {
26 public:
27     LPEPerpBisector(LivePathEffectObject *lpeobject);
28     virtual ~LPEPerpBisector();
30     virtual EffectType effectType () { return PERP_BISECTOR; }
32     void doOnApply (SPLPEItem *lpeitem);
34     virtual Geom::Piecewise<Geom::D2<Geom::SBasis> >
35       doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd2_in);
37     /* the knotholder functions below must be declared friends */
38     friend NR::Point bisector_left_end_get(SPItem *item);
39     friend NR::Point bisector_right_end_get(SPItem *item);
40     friend NR::Point path_start_get(SPItem *item);
41     friend NR::Point path_end_get(SPItem *item);
42     friend void bisector_end_set(SPItem *item, NR::Point const &p, bool left = true);
43     friend void path_set_start_end(SPItem *item, NR::Point const &p, bool start = true);
45 private:
46     ScalarParam length_left;
47     ScalarParam length_right;
49     Geom::Point A; // start of path
50     Geom::Point B; // end of path
51     Geom::Point M; // midpoint
52     Geom::Point C; // left end of bisector
53     Geom::Point D; // right end of bisector
54     Geom::Point perp_dir;
56     LPEPerpBisector(const LPEPerpBisector&);
57     LPEPerpBisector& operator=(const LPEPerpBisector&);
58 };
60 } //namespace LivePathEffect
61 } //namespace Inkscape
63 #endif