Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
spray-tool.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
2#ifndef INKSCAPE_UI_TOOLS_SPRAY_TOOl_H
3#define INKSCAPE_UI_TOOLS_SPRAY_TOOl_H
4
5/*
6 * Spray Tool
7 *
8 * Authors:
9 * Pierre-Antoine MARC
10 * Pierre CACLIN
11 * Aurel-Aimé MARMION
12 * Julien LERAY
13 * Benoît LAVORATA
14 * Vincent MONTAGNE
15 * Pierre BARBRY-BLOT
16 * Jabiertxo ARRAIZA
17 * Adrian Boguszewski
18 *
19 * Copyright (C) 2009 authors
20 *
21 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
22 */
23
24#include <2geom/pathvector.h>
25
27#include "object/object-set.h"
28#include "ui/tools/tool-base.h"
29
30namespace Inkscape { class CanvasItemBpath; }
31
32#define TC_MIN_PRESSURE 0.0
33#define TC_MAX_PRESSURE 1.0
34#define TC_DEFAULT_PRESSURE 0.35
35
36namespace Inkscape::UI::Tools {
37
38enum
39{
45};
46
47class SprayTool : public ToolBase
48{
49public:
51 ~SprayTool() override;
52
53 /* extended input data */
54 double pressure;
55
56 /* attributes */
57 bool usepressurewidth = false;
58 bool usepressurepopulation = false;;
59 bool usepressurescale = false;
60 bool usetilt = false;
61 bool usetext = false;
62
63 double width = 0.2;
64 double ratio = 0.0;
65 double tilt = 0.0;
66 double rotation_variation = 0.0;
67 double population = 0.0;
68 double scale_variation = 1.0;
69 double scale = 1.0;
70 double mean = 0.2;
71 double standard_deviation = 0.2;
72
73 int distrib = 1;
74
75 int mode = 0;
76
77 bool is_drawing = false;
78
79 bool is_dilating = false;
80 bool has_dilated = false;
84 std::vector<SPItem*> items;
85 bool no_overlap = false;
86 bool picker = false;
87 bool pick_center = false;
88 bool pick_inverse_value = false;
89 bool pick_fill = false;
90 bool pick_stroke = false;
91 bool pick_no_overlap = false;
92 bool over_transparent = true;
94 double offset = 0.0;
95 int pick = 0;
96 bool do_trace = false;
97 bool pick_to_size = false;
98 bool pick_to_presence = false;
99 bool pick_to_color = false;
100 bool pick_to_opacity = false;
101 bool single_click = false;
102 double single_scale = 0;
103 double single_angle = 0;
104 double last_pressure = 0;
105 bool invert_picked = false;
106 double gamma_picked = 0.0;
107 double rand_picked = 0.0;
109
110 sigc::scoped_connection release_connection;
111
112 void set(Preferences::Entry const &val) override;
113 virtual void setCloneTilerPrefs();
114 bool root_handler(CanvasEvent const &event) override;
115 void update_cursor(bool /*with_shift*/);
116
119
120private:
122};
123
124} // namespace Inkscape::UI::Tools
125
126#endif // INKSCAPE_UI_TOOLS_SPRAY_TOOl_H
127
128/*
129 Local Variables:
130 mode:c++
131 c-file-style:"stroustrup"
132 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
133 indent-tabs-mode:nil
134 fill-column:99
135 End:
136*/
137// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
138
std::unique_ptr< T, CanvasItemUnlinkDeleter > CanvasItemPtr
Smart pointer used to hold CanvasItems, like std::unique_ptr.
Sequence of subpaths.
Definition pathvector.h:122
Two-dimensional point that doubles as a vector.
Definition point.h:66
Data type representing a typeless value of a preference.
sigc::scoped_connection release_connection
Definition spray-tool.h:110
std::vector< SPItem * > items
Definition spray-tool.h:84
CanvasItemPtr< CanvasItemBpath > shapes_area
Definition spray-tool.h:83
bool root_handler(CanvasEvent const &event) override
CanvasItemPtr< CanvasItemBpath > dilate_area
Definition spray-tool.h:82
Base class for Event processors.
Definition tool-base.h:95
To do: update description of desktop.
Definition desktop.h:149
Base class for visual SVG elements.
Definition sp-item.h:109
Helper class to stream background task notifications as a series of messages.
PathVector - a sequence of subpaths.
Abstract base class for events.
SPDesktop * desktop