Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
powerstrokepointarray.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
2#ifndef INKSCAPE_LIVEPATHEFFECT_POWERSTROKE_POINT_ARRAY_H
3#define INKSCAPE_LIVEPATHEFFECT_POWERSTROKE_POINT_ARRAY_H
4
5/*
6 * Inkscape::LivePathEffectParameters
7 *
8 * Copyright (C) Johan Engelen 2007 <j.b.c.engelen@utwente.nl>
9 *
10 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
11 */
12
13#include <glib.h>
14#include <2geom/point.h>
15
17
19
20namespace Inkscape {
21
22namespace LivePathEffect {
23
24class PowerStrokePointArrayParam : public ArrayParam<Geom::Point> {
25public:
26 PowerStrokePointArrayParam( const Glib::ustring& label,
27 const Glib::ustring& tip,
28 const Glib::ustring& key,
30 Effect* effect);
32
35
36 Gtk::Widget * param_newWidget() override;
37
38 void param_transform_multiply(Geom::Affine const& postmul, bool /*set*/) override;
39
40 void set_oncanvas_looks(CanvasItemCtrlShape shape, uint32_t color);
41
42 float median_width();
45
46 bool providesKnotHolderEntities() const override { return true; }
47 void addKnotHolderEntities(KnotHolder *knotholder, SPItem *item) override;
48 void param_update_default(const gchar * default_value) override{};
49
50 void set_pwd2(Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd2_in, Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd2_normal_in);
53
55 std::vector<Geom::Point> reverse_controlpoints(bool write);
56 void set_scale_width(double scale_width){_scale_width = scale_width;};
60 bool unplaced = false;
61 size_t current_path = Glib::ustring::npos;
62private:
65
68};
69
71public:
74
75 void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state) override;
76 void knot_ungrabbed(Geom::Point const &p, Geom::Point const &origin, guint state) override;
77 Geom::Point knot_get() const override;
79 void knot_click(guint state) override;
80
82 bool valid_index(unsigned int index) const {
83 return (_pparam->_vector.size() > index);
84 };
85
86private:
88 unsigned int _index;
89};
90
91} //namespace LivePathEffect
92
93} //namespace Inkscape
94
95#endif
Cartesian point / 2D vector and related operations.
Point origin
Definition aa.cpp:227
3x3 matrix representing an affine transformation.
Definition affine.h:70
Adaptor that creates 2D functions from 1D ones.
Definition d2.h:55
Sequence of subpaths.
Definition pathvector.h:122
Function defined as discrete pieces.
Definition piecewise.h:71
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
bool valid_index(unsigned int index) const
Checks whether the index falls within the size of the parameter's vector.
void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state) override
Geom::Piecewise< Geom::D2< Geom::SBasis > > const & get_pwd2() const
Geom::Piecewise< Geom::D2< Geom::SBasis > > last_pwd2_normal
PowerStrokePointArrayParam & operator=(const PowerStrokePointArrayParam &)=delete
void addKnotHolderEntities(KnotHolder *knotholder, SPItem *item) override
PowerStrokePointArrayParam(const PowerStrokePointArrayParam &)=delete
Geom::Piecewise< Geom::D2< Geom::SBasis > > last_pwd2
void recalculate_controlpoints(Geom::PathVector pv)
call this method to recalculate the controlpoints such that they stay at the same location relative t...
void set_oncanvas_looks(CanvasItemCtrlShape shape, uint32_t color)
Geom::Point knot_reposition(size_t index, Geom::PathVector pathv)
void set_pwd2(Geom::Piecewise< Geom::D2< Geom::SBasis > > const &pwd2_in, Geom::Piecewise< Geom::D2< Geom::SBasis > > const &pwd2_normal_in)
std::vector< Geom::Point > reverse_controlpoints(bool write)
call this method to recalculate the controlpoints when path is reversed.
void param_update_default(const gchar *default_value) override
void param_transform_multiply(Geom::Affine const &postmul, bool) override
Geom::Piecewise< Geom::D2< Geom::SBasis > > const & get_pwd2_normal() const
KnotHolderEntity definition.
Base class for visual SVG elements.
Definition sp-item.h:109
unsigned int guint32
SPItem * item
double offset
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