Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
lpe-offset.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
2#ifndef INKSCAPE_LPE_OFFSET_H
3#define INKSCAPE_LPE_OFFSET_H
4
9/*
10 * Authors:
11 * Maximilian Albert
12 * Jabiertxo Arraiza
13 *
14 * Copyright (C) Johan Engelen 2007 <j.b.c.engelen@utwente.nl>
15 * Copyright (C) Maximilian Albert 2008 <maximilian.albert@gmail.com>
16 *
17 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
18 */
19
20#include "live_effects/effect.h"
25// this is only to flatten nonzero fillrule
26#include "livarot/LivarotDefs.h"
27
28namespace Inkscape {
29namespace LivePathEffect {
30
31namespace OfS {
32// we need a separate namespace to avoid clashes with other LPEs
33class KnotHolderEntityOffsetPoint;
34}
35
37public:
39 ~LPEOffset() override;
40 void doBeforeEffect (SPLPEItem const* lpeitem) override;
41 void doAfterEffect(SPLPEItem const *, Geom::PathVector *curve) override;
42 Geom::PathVector doEffect_path(Geom::PathVector const &path_in) override;
43 bool doOnOpen(SPLPEItem const *lpeitem) override;
44 void doOnApply(SPLPEItem const* lpeitem) override;
45 void transform_multiply(Geom::Affine const &postmul, bool set) override;
46 void addKnotHolderEntities(KnotHolder * knotholder, SPItem * item) override;
47 void addCanvasIndicators(SPLPEItem const *lpeitem, std::vector<Geom::PathVector> &hp_vec) override;
48 void calculateOffset (Geom::PathVector const & path_in);
49 Geom::Path cleanupPathSelfIntersects(Geom::Path path, size_t originpos, double tolerance);
51 double sp_get_offset();
53
54private:
60
63 bool sign = true;
64 Glib::ustring prev_unit;
65 double scale = 1; //take document scale and additional parent transformations into account
72 void modified(SPObject */*obj*/, guint flags);
73 sigc::connection modified_connection;
76};
77
78} //namespace LivePathEffect
79} //namespace Inkscape
80
81#endif
82
83/*
84 Local Variables:
85 mode:c++
86 c-file-style:"stroustrup"
87 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
88 indent-tabs-mode:nil
89 fill-column:99
90 End:
91*/
92// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :
TODO: insert short description here.
FillRule
Definition LivarotDefs.h:68
3x3 matrix representing an affine transformation.
Definition affine.h:70
Sequence of subpaths.
Definition pathvector.h:122
Sequence of contiguous curves, aka spline.
Definition path.h:353
Two-dimensional point that doubles as a vector.
Definition point.h:66
void addCanvasIndicators(SPLPEItem const *lpeitem, std::vector< Geom::PathVector > &hp_vec) override
Add possible canvas indicators (i.e., helperpaths other than the original path) to hp_vec This functi...
LPEOffset & operator=(const LPEOffset &)
void modified(SPObject *, guint flags)
friend class OfS::KnotHolderEntityOffsetPoint
Definition lpe-offset.h:52
void transform_multiply(Geom::Affine const &postmul, bool set) override
Overridden function to apply transforms for example to powerstroke, jointtype or tapperstroke.
void calculateOffset(Geom::PathVector const &path_in)
Geom::Point get_default_point(Geom::PathVector pathv)
void doAfterEffect(SPLPEItem const *, Geom::PathVector *curve) override
Is performed at the end of the LPE only one time per "lpeitem" in paths/shapes is called in middle of...
void doOnApply(SPLPEItem const *lpeitem) override
Is performed a single time when the effect is freshly applied to a path.
void doBeforeEffect(SPLPEItem const *lpeitem) override
Is performed each time before the effect is updated.
Inkscape::UI::Widget::Scalar * offset_widget
Definition lpe-offset.h:69
Geom::PathVector doEffect_path(Geom::PathVector const &path_in) override
bool doOnOpen(SPLPEItem const *lpeitem) override
Is performed on load document or revert If the item is fixed legacy return true.
EnumParam< unsigned > linejoin_type
Definition lpe-offset.h:57
void addKnotHolderEntities(KnotHolder *knotholder, SPItem *item) override
Geom::Path cleanupPathSelfIntersects(Geom::Path path, size_t originpos, double tolerance)
A labelled text box, with spin buttons and optional icon, for entering arbitrary number values.
Definition scalar.h:34
Base class for visual SVG elements.
Definition sp-item.h:109
SPObject is an abstract base class of all of the document nodes at the SVG document level.
Definition sp-object.h:160
SPItem * item
Helper class to stream background task notifications as a series of messages.
Definition curve.h:24