Code

Rename LPE: mirror reflect --> mirror symmetry
[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 namespace PB {
26   // we need a separate namespace to avoid clashes with LPETangentToCurve
27   class KnotHolderEntityLeftEnd;
28   class KnotHolderEntityRightEnd;
29   void bisector_end_set(SPItem *item, NR::Point const &p, bool left);
30 }
32 class LPEPerpBisector : public Effect {
33 public:
34     LPEPerpBisector(LivePathEffectObject *lpeobject);
35     virtual ~LPEPerpBisector();
37     virtual EffectType effectType () { return PERP_BISECTOR; }
39     void doOnApply (SPLPEItem *lpeitem);
41     virtual Geom::Piecewise<Geom::D2<Geom::SBasis> >
42       doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd2_in);
44     /* the knotholder entity functions must be declared friends */
45     friend class PB::KnotHolderEntityLeftEnd;
46     friend class PB::KnotHolderEntityRightEnd;
47     friend void PB::bisector_end_set(SPItem *item, NR::Point const &p, bool left = true);
49 private:
50     ScalarParam length_left;
51     ScalarParam length_right;
53     Geom::Point A; // start of path
54     Geom::Point B; // end of path
55     Geom::Point M; // midpoint
56     Geom::Point C; // left end of bisector
57     Geom::Point D; // right end of bisector
58     Geom::Point perp_dir;
60     LPEPerpBisector(const LPEPerpBisector&);
61     LPEPerpBisector& operator=(const LPEPerpBisector&);
62 };
64 } //namespace LivePathEffect
65 } //namespace Inkscape
67 #endif