Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
nodesatellitesarray.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
2#ifndef INKSCAPE_LIVEPATHEFFECT_NODESATELLITES_ARRAY_H
3#define INKSCAPE_LIVEPATHEFFECT_NODESATELLITES_ARRAY_H
4
5/*
6 * Inkscape::LivePathEffectParameters
7 * Copyright (C) Jabiertxo Arraiza Cenoz <jabier.arraiza@marker.es>
8 * Special thanks to Johan Engelen for the base of the effect -powerstroke-
9 * Also to ScislaC for pointing me to the idea
10 * Also su_v for his constructive feedback and time
11 * To Nathan Hurst for his review and help on refactor
12 * and finally to Liam P. White for his big help on coding,
13 * that saved me a lot of hours
14 *
15 *
16 * This parameter acts as a bridge from pathVectorNodeSatellites class to serialize it as a LPE
17 * parameter
18 *
19 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
20 */
21
22#include <glib.h>
23
28#include "ui/knot/knot-holder.h"
29
30namespace Inkscape {
31
32namespace LivePathEffect {
33
34class FilletChamferKnotHolderEntity;
35
36class NodeSatelliteArrayParam : public ArrayParam<std::vector<NodeSatellite>>
37{
38public:
39 NodeSatelliteArrayParam(const Glib::ustring &label, const Glib::ustring &tip, const Glib::ustring &key,
41
42 Gtk::Widget *param_newWidget() override
43 {
44 return nullptr;
45 }
46 void addKnotHolderEntities(KnotHolder *knotholder, SPItem *item) override;
47 virtual void addKnotHolderEntities(KnotHolder *knotholder, SPItem *item, bool mirror);
48 void addCanvasIndicators(SPLPEItem const *lpeitem, std::vector<Geom::PathVector> &hp_vec) override;
49 virtual void updateCanvasIndicators();
50 virtual void updateCanvasIndicators(bool mirror);
51 bool providesKnotHolderEntities() const override
52 {
53 return true;
54 }
55 void param_transform_multiply(Geom::Affine const &postmul, bool /*set*/) override;
56 void setUseDistance(bool use_knot_distance);
57 void setCurrentZoom(double current_zoom);
58 void setGlobalKnotHide(bool global_knot_hide);
60 void reloadKnots();
61 void updateAmmount(double amount);
62 void setPathVectorNodeSatellites(PathVectorNodeSatellites *pathVectorNodeSatellites, bool write = true);
63
64 void set_oncanvas_looks(Inkscape::CanvasItemCtrlShape shape, uint32_t color);
65
66
68 friend class LPEFilletChamfer;
70private:
73
75 guint32 _knot_color = 0xaaff8800;
77 bool _use_distance = false;
78 bool _global_knot_hide = false;
79 double _current_zoom = 0;
82};
83
85public:
87 void knot_set(Geom::Point const &p, Geom::Point const &origin,
88 guint state) override;
89 Geom::Point knot_get() const override;
91 void knot_click(guint state) override;
92 void knot_ungrabbed(Geom::Point const &p, Geom::Point const &origin, guint state) override;
96 bool valid_index(size_t index, size_t subindex) const
97 {
98 return (_pparam->_vector.size() > index && _pparam->_vector[index].size() > subindex);
99 };
100
101private:
103 size_t _index;
104 bool _updating = false;
105 mutable bool _set_circle = false;
106};
107
108} //namespace LivePathEffect
109
110} //namespace Inkscape
111
112#endif
Point origin
Definition aa.cpp:227
3x3 matrix representing an affine transformation.
Definition affine.h:70
Sequence of subpaths.
Definition pathvector.h:122
Two-dimensional point that doubles as a vector.
Definition point.h:66
std::vector< StorageType > _vector
Definition array.h:104
void knot_ungrabbed(Geom::Point const &p, Geom::Point const &origin, guint state) override
void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state) override
bool valid_index(size_t index, size_t subindex) const
Checks whether the index falls within the size of the parameter's vector.
void set_oncanvas_looks(Inkscape::CanvasItemCtrlShape shape, uint32_t color)
void addKnotHolderEntities(KnotHolder *knotholder, SPItem *item) override
void addCanvasIndicators(SPLPEItem const *lpeitem, std::vector< Geom::PathVector > &hp_vec) override
NodeSatelliteArrayParam(const NodeSatelliteArrayParam &)=delete
void setPathVectorNodeSatellites(PathVectorNodeSatellites *pathVectorNodeSatellites, bool write=true)
void param_transform_multiply(Geom::Affine const &postmul, bool) override
NodeSatelliteArrayParam & operator=(const NodeSatelliteArrayParam &)=delete
KnotHolderEntity definition.
NodeSatellite a per node holder of data.
PathVectorNodeSatellites a class to manage nodesatellites in a pathvector.
Base class for visual SVG elements.
Definition sp-item.h:109
unsigned int guint32
PathVectorNodeSatellites a class to manage nodesatellites -per node extra data- in a pathvector.
SPItem * item
Glib::ustring label
Helper class to stream background task notifications as a series of messages.
@ CANVAS_ITEM_CTRL_SHAPE_DIAMOND
static cairo_user_data_key_t key
int index