Code

Set merge from trunk
[inkscape.git] / src / live_effects / lpe-tangent_to_curve.h
1 #ifndef INKSCAPE_LPE_TANGENT_TO_CURVE_H
2 #define INKSCAPE_LPE_TANGENT_TO_CURVE_H
4 /** \file
5  * LPE <tangent_to_curve> implementation, see lpe-tangent_to_curve.cpp.
6  */
8 /*
9  * Authors:
10  *   Johan Engelen
11  *   Maximilian Albert
12  *
13  * Copyright (C) Johan Engelen 2007 <j.b.c.engelen@utwente.nl>
14  * Copyright (C) Maximilian Albert 2008 <maximilian.albert@gmail.com>
15  *
16  * Released under GNU GPL, read the file 'COPYING' for more information
17  */
19 #include "live_effects/effect.h"
20 #include "live_effects/parameter/parameter.h"
21 #include "live_effects/parameter/point.h"
23 namespace Inkscape {
24 namespace LivePathEffect {
26 namespace TtC {
27   // we need a separate namespace to avoid clashes with LPEPerpBisector
28   class KnotHolderEntityLeftEnd;
29   class KnotHolderEntityRightEnd;
30   class KnotHolderEntityAttachPt;
31 }
33 class LPETangentToCurve : public Effect {
34 public:
35     LPETangentToCurve(LivePathEffectObject *lpeobject);
36     virtual ~LPETangentToCurve();
38     virtual Geom::Piecewise<Geom::D2<Geom::SBasis> >
39       doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd2_in);
41     /* the knotholder entity classes must be declared friends */
42     friend class TtC::KnotHolderEntityLeftEnd;
43     friend class TtC::KnotHolderEntityRightEnd;
44     friend class TtC::KnotHolderEntityAttachPt;
46 private:
47     ScalarParam angle;
49     ScalarParam t_attach;
50     ScalarParam length_left;
51     ScalarParam length_right;
53     Geom::Point ptA; // point of attachment to the curve
54     Geom::Point derivA;
56     Geom::Point C; // left end of tangent
57     Geom::Point D; // right end of tangent
59     LPETangentToCurve(const LPETangentToCurve&);
60     LPETangentToCurve& operator=(const LPETangentToCurve&);
61 };
63 } //namespace LivePathEffect
64 } //namespace Inkscape
66 #endif