1 /** @file
2 * @brief LPE perspective path effect implementation
3 */
4 /* Authors:
5 * Maximilian Albert <maximilian.albert@gmail.com>
6 * Johan Engelen <j.b.c.engelen@utwente.nl>
7 *
8 * Copyright (C) 2007 Authors
9 *
10 * Released under GNU GPL, read the file 'COPYING' for more information
11 */
13 #ifndef INKSCAPE_LPE_PERSPECTIVE_PATH_H
14 #define INKSCAPE_LPE_PERSPECTIVE_PATH_H
16 #include "live_effects/effect.h"
17 #include "live_effects/parameter/parameter.h"
18 #include "live_effects/parameter/bool.h"
19 #include "live_effects/lpegroupbbox.h"
21 #include <vector>
22 #include "2geom/point.h"
24 namespace Inkscape {
25 namespace LivePathEffect {
27 namespace PP {
28 // we need a separate namespace to avoid clashes with other LPEs
29 class KnotHolderEntityOffset;
30 }
32 class LPEPerspectivePath : public Effect, GroupBBoxEffect {
33 public:
34 LPEPerspectivePath(LivePathEffectObject *lpeobject);
35 virtual ~LPEPerspectivePath();
37 virtual void doBeforeEffect (SPLPEItem *lpeitem);
39 virtual Geom::Piecewise<Geom::D2<Geom::SBasis> > doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd2_in);
41 /* the knotholder entity classes must be declared friends */
42 friend class PP::KnotHolderEntityOffset;
44 private:
45 // add the parameters for your effect here:
46 ScalarParam scalex;
47 ScalarParam scaley;
48 // TODO: rewrite this using a PointParam instead of two ScalarParams
49 ScalarParam offsetx;
50 ScalarParam offsety;
51 BoolParam uses_plane_xy;
52 // there are all kinds of parameters. Check the /live_effects/parameter directory which types exist!
54 Geom::Point orig;
56 LPEPerspectivePath(const LPEPerspectivePath&);
57 LPEPerspectivePath& operator=(const LPEPerspectivePath&);
59 std::vector<Geom::Point> handles;
60 double tmat[3][4];
61 };
63 } //namespace LivePathEffect
64 } //namespace Inkscape
66 #endif
68 /*
69 Local Variables:
70 mode:c++
71 c-file-style:"stroustrup"
72 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
73 indent-tabs-mode:nil
74 fill-column:99
75 End:
76 */
77 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :