blob: 42b8ca84774e4a8a3b50a2a7e36c4c7f91af4b40 (
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
|
// SPDX-License-Identifier: GPL-2.0-or-later
/** @file
* @brief Taper Stroke path effect (meant as a replacement for using Power Strokes for tapering)
*/
/* Authors:
* Liam P White <inkscapebrony@gmail.com>
* Copyright (C) 2014 Authors
*
* Released under GNU GPL v2+, read the file 'COPYING' for more information.
*/
#ifndef INKSCAPE_LPE_TAPERSTROKE_H
#define INKSCAPE_LPE_TAPERSTROKE_H
#include "live_effects/effect.h"
#include "live_effects/parameter/enum.h"
#include "live_effects/parameter/enumarray.h"
#include "live_effects/parameter/scalararray.h"
#include "live_effects/parameter/parameter.h"
namespace Inkscape {
namespace LivePathEffect {
namespace TpS {
// we need a separate namespace to avoid clashes with other LPEs
class KnotHolderEntityAttachBegin;
class KnotHolderEntityAttachEnd;
}
class LPETaperStroke : public Effect {
public:
LPETaperStroke(LivePathEffectObject *lpeobject);
~LPETaperStroke() override;
void doOnApply(SPLPEItem const* lpeitem) override;
void doOnRemove(SPLPEItem const* lpeitem) override;
void doBeforeEffect (SPLPEItem const* lpeitem) override;
Geom::PathVector doEffect_path (Geom::PathVector const& path_in) override;
Geom::PathVector doEffect_simplePath(Geom::Path const& path, size_t index, double start, double end);
void transform_multiply(Geom::Affine const &postmul, bool set) override;
void addKnotHolderEntities(KnotHolder * knotholder, SPItem * item) override;
protected:
friend class TpS::KnotHolderEntityAttachBegin;
friend class TpS::KnotHolderEntityAttachEnd;
ScalarArrayParam attach_start;
ScalarArrayParam attach_end;
ScalarArrayParam start_smoothing;
ScalarArrayParam end_smoothing;
private:
ScalarParam subpath;
ScalarParam line_width;
EnumParam<unsigned> join_type;
EnumArrayParam start_shape;
EnumArrayParam end_shape;
ScalarParam miter_limit;
size_t previous_size = 1;
std::vector<Geom::Point> start_attach_point;
std::vector<Geom::Point> end_attach_point;
size_t prev_subpath = Glib::ustring::npos;
Geom::PathVector pathv_out;
LPETaperStroke(const LPETaperStroke&) = delete;
LPETaperStroke& operator=(const LPETaperStroke&) = delete;
};
} //namespace LivePathEffect
} //namespace Inkscape
#endif
/*
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 :
|