summaryrefslogtreecommitdiffstats
path: root/src/live_effects/lpe-envelope-perspective.h
blob: 0de9a0e350c3b91bbefcb9846b693a7bf91ea3ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#ifndef INKSCAPE_LPE_ENVELOPE_PERSPECTIVE_H
#define INKSCAPE_LPE_ENVELOPE_PERSPECTIVE_H

/** \file
 * LPE <envelope-perspective> implementation , see lpe-envelope-perspective.cpp.
 
 */
/*
 * Authors:
 *   Jabiertxof Code migration from python extensions envelope and perspective
 *   Aaron Spike, aaron@ekips.org from envelope and perspective phyton code
 *   Dmitry Platonov, shadowjack@mail.ru, 2006 perspective approach & math
 *   Jose Hevia (freon) Transform algorithm from envelope
 *   
 * Copyright (C) 2007-2014 Authors 
 *
 * Released under GNU GPL, read the file 'COPYING' for more information
 */

#include "live_effects/parameter/enum.h"
#include "live_effects/effect.h"
#include "live_effects/parameter/pointreseteable.h"
#include "live_effects/lpegroupbbox.h"

namespace Inkscape {
namespace LivePathEffect {

class LPEEnvelopePerspective : public Effect, GroupBBoxEffect {
public:

    LPEEnvelopePerspective(LivePathEffectObject *lpeobject);
    virtual ~LPEEnvelopePerspective();

    virtual void doEffect(SPCurve *curve);

    virtual Geom::Point project_point(Geom::Point p);

    virtual Geom::Point project_point(Geom::Point p,  double m[][3]);

    Geom::Point pointAtRatio(Geom::Coord ratio,Geom::Point A, Geom::Point B);

    virtual void resetDefaults(SPItem const* item);

    virtual void doBeforeEffect(SPLPEItem const* lpeitem);

    virtual Gtk::Widget * newWidget();

    virtual void calculateCurve(Geom::Point a,Geom::Point b, SPCurve *c, bool horizontal, bool move);

    virtual void setDefaults();

    virtual void resetGrid();

    //virtual void original_bbox(SPLPEItem const* lpeitem, bool absolute = false);

    //virtual void addCanvasIndicators(SPLPEItem const*/*lpeitem*/, std::vector<Geom::PathVector> &/*hp_vec*/);

    //virtual std::vector<Geom::PathVector> getHelperPaths(SPLPEItem const* lpeitem);
protected:
    void addCanvasIndicators(SPLPEItem const */*lpeitem*/, std::vector<Geom::PathVector> &hp_vec);
private:

    EnumParam<unsigned> deform_type;
    PointReseteableParam Up_Left_Point;
    PointReseteableParam Up_Right_Point;
    PointReseteableParam Down_Left_Point;
    PointReseteableParam Down_Right_Point;

    LPEEnvelopePerspective(const LPEEnvelopePerspective&);
    LPEEnvelopePerspective& operator=(const LPEEnvelopePerspective&);
};

} //namespace LivePathEffect
} //namespace Inkscape

#endif