summaryrefslogtreecommitdiffstats
path: root/src/live_effects/lpe-skeleton.cpp
blob: 302a6a29494d275f5a0b141d9aaba2e13e96ed31 (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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
// SPDX-License-Identifier: GPL-2.0-or-later
/**
 * @file
 * Minimal dummy LPE effect implementation, used as an example for a base
 * starting class when implementing new LivePathEffects.
 *
 * In vi, three global search-and-replaces will let you rename everything
 * in this and the .h file:
 *
 *   :%s/SKELETON/YOURNAME/g
 *   :%s/Skeleton/Yourname/g
 *   :%s/skeleton/yourname/g
 */
/* Authors:
 *   Johan Engelen <j.b.c.engelen@alumnus.utwente.nl>
 *
 * Copyright (C) 2007-2012 Authors
 *
 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
 */

#include "live_effects/lpe-skeleton.h"

// TODO due to internal breakage in glibmm headers, this must be last:
#include <glibmm/i18n.h>

namespace Inkscape {
namespace LivePathEffect {

LPESkeleton::LPESkeleton(LivePathEffectObject *lpeobject) :
    Effect(lpeobject),
    // initialise your parameters here:
    number(_("Float parameter"), _("just a real number like 1.4!"), "svgname", &wr, this, 1.2)
{
    /* uncomment the following line to have the original path displayed while the item is selected */
    //show_orig_path = true;
    /* uncomment the following line to enable display of the effect-specific on-canvas handles (knotholder entities) */
    //_provides_knotholder_entities

    /* register all your parameters here, so Inkscape knows which parameters this effect has: */
    registerParameter(&number);
}

LPESkeleton::~LPESkeleton()
= default;


/* ########################
 *  Choose to implement one of the doEffect functions. You can delete or comment out the others.
 */

/*
void
LPESkeleton::doEffect (SPCurve * curve)
{
    // spice this up to make the effect actually *do* something!
}

Geom::PathVector
LPESkeleton::doEffect_path (Geom::PathVector const & path_in)
{
        Geom::PathVector path_out;

        path_out = path_in;   // spice this up to make the effect actually *do* something!

        return path_out;
}
*/

Geom::Piecewise<Geom::D2<Geom::SBasis> >
LPESkeleton::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd2_in)
{
    Geom::Piecewise<Geom::D2<Geom::SBasis> > output;

    output = pwd2_in;   // spice this up to make the effect actually *do* something!

    return output;
}

/* ########################
 *  If you want to provide effect-specific on-canvas handles (knotholder entities), define them here:
 */

/*
namespace Skeleton {

class KnotHolderEntityMyHandle : public LPEKnotHolderEntity
{
public:
    // the set() and get() methods must be implemented, click() is optional
    virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state);
    virtual Geom::Point knot_get() const;
    //virtual void knot_click(guint state);
};

} // namespace Skeleton

void
LPESkeleton::addKnotHolderEntities(KnotHolder *knotholder, SPItem *item) {
    {
        KnotHolderEntityMyHandle *e = new KnotHolderEntityMyHandle(this);
        e->create( NULL, item, knotholder,
                    _("Text describing what this handle does"),
                    //optional: knot_shape, knot_mode, knot_color);
        knotholder->add(e);
    }
};
*/

/* ######################## */

} //namespace LivePathEffect
} /* namespace Inkscape */

/*
  Local Variables:
  mode:c++
  c-file-style:"stroustrup"
  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
  indent-tabs-mode:nil
  fill-column:99
  End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :