Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
star-tool.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: GPL-2.0-or-later
2
#ifndef INKSCAPE_UI_TOOLS_STAR_TOOL_H
3
#define INKSCAPE_UI_TOOLS_STAR_TOOL_H
4
5
/*
6
* Star drawing context
7
*
8
* Authors:
9
* Mitsuru Oka <oka326@parkcity.ne.jp>
10
* Lauris Kaplinski <lauris@kaplinski.com>
11
*
12
* Copyright (C) 1999-2002 Lauris Kaplinski
13
* Copyright (C) 2001-2002 Mitsuru Oka
14
*
15
* Released under GNU GPL v2+, read the file 'COPYING' for more information.
16
*/
17
18
#include <cstddef>
19
#include <sigc++/sigc++.h>
20
#include <
2geom/point.h
>
21
#include "
ui/tools/tool-base.h
"
22
#include "
object/weakptr.h
"
23
24
#include "
2geom/affine.h
"
25
26
class
SPStar
;
27
28
namespace
Inkscape
{
class
Selection; }
29
30
namespace
Inkscape::UI::Tools
{
31
32
class
StarTool
:
public
ToolBase
33
{
34
public
:
35
StarTool
(
SPDesktop
*
desktop
);
36
~StarTool
()
override
;
37
38
void
set
(
Preferences::Entry
const
&val)
override
;
39
bool
root_handler
(
CanvasEvent
const
&event)
override
;
40
41
private
:
42
SPWeakPtr<SPStar>
star
;
43
44
Geom::Point
center
;
45
46
/* Number of corners */
47
int
magnitude
= 5;
48
49
/* Outer/inner radius ratio */
50
double
proportion
= 0.5;
51
52
/* flat sides or not? */
53
bool
isflatsided
=
false
;
54
55
/* rounded corners ratio */
56
double
rounded
= 0.0;
57
58
// randomization
59
double
randomized
= 0.0;
60
61
// Scale of the new object
62
Geom::Affine
_tr
=
Geom::identity
();
63
64
sigc::connection
sel_changed_connection
;
65
66
void
drag
(
Geom::Point
p,
unsigned
state);
67
void
finishItem
();
68
void
cancel
();
69
void
selection_changed
(
Selection
*selection);
70
};
71
72
}
// namespace Inkscape::UI::Tools
73
74
#endif
// INKSCAPE_UI_TOOLS_STAR_TOOL_H
75
76
/*
77
Local Variables:
78
mode:c++
79
c-file-style:"stroustrup"
80
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
81
indent-tabs-mode:nil
82
fill-column:99
83
End:
84
*/
85
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :
point.h
Cartesian point / 2D vector and related operations.
set
bool set
Definition
actions-canvas-snapping.cpp:86
affine.h
3x3 affine transformation matrix.
Geom::Affine
3x3 matrix representing an affine transformation.
Definition
affine.h:70
Geom::Point
Two-dimensional point that doubles as a vector.
Definition
point.h:66
Inkscape::Preferences::Entry
Data type representing a typeless value of a preference.
Definition
preferences.h:157
Inkscape::SPWeakPtr
A weak pointer to an SPObject: it nulls itself upon the object's destruction.
Definition
weakptr.h:14
Inkscape::Selection
The set of selected SPObjects for a given document and layer model.
Definition
selection.h:80
Inkscape::UI::Tools::StarTool
Definition
star-tool.h:33
Inkscape::UI::Tools::StarTool::drag
void drag(Geom::Point p, unsigned state)
Definition
star-tool.cpp:286
Inkscape::UI::Tools::StarTool::~StarTool
~StarTool() override
Definition
star-tool.cpp:81
Inkscape::UI::Tools::StarTool::star
SPWeakPtr< SPStar > star
Definition
star-tool.h:42
Inkscape::UI::Tools::StarTool::_tr
Geom::Affine _tr
Definition
star-tool.h:62
Inkscape::UI::Tools::StarTool::randomized
double randomized
Definition
star-tool.h:59
Inkscape::UI::Tools::StarTool::center
Geom::Point center
Definition
star-tool.h:44
Inkscape::UI::Tools::StarTool::rounded
double rounded
Definition
star-tool.h:56
Inkscape::UI::Tools::StarTool::isflatsided
bool isflatsided
Definition
star-tool.h:53
Inkscape::UI::Tools::StarTool::root_handler
bool root_handler(CanvasEvent const &event) override
Definition
star-tool.cpp:128
Inkscape::UI::Tools::StarTool::cancel
void cancel()
Definition
star-tool.cpp:375
Inkscape::UI::Tools::StarTool::finishItem
void finishItem()
Definition
star-tool.cpp:349
Inkscape::UI::Tools::StarTool::sel_changed_connection
sigc::connection sel_changed_connection
Definition
star-tool.h:64
Inkscape::UI::Tools::StarTool::proportion
double proportion
Definition
star-tool.h:50
Inkscape::UI::Tools::StarTool::magnitude
int magnitude
Definition
star-tool.h:47
Inkscape::UI::Tools::StarTool::selection_changed
void selection_changed(Selection *selection)
Callback that processes the "changed" signal on the selection; destroys old and creates new knotholde...
Definition
star-tool.cpp:104
Inkscape::UI::Tools::ToolBase
Base class for Event processors.
Definition
tool-base.h:107
SPDesktop
To do: update description of desktop.
Definition
desktop.h:149
SPStar
Definition
sp-star.h:25
Geom::identity
Affine identity()
Create an identity matrix.
Definition
affine.h:210
Inkscape::UI::Tools
Definition
desktop.h:121
Inkscape
Helper class to stream background task notifications as a series of messages.
Definition
actions-canvas-snapping.h:27
Inkscape::CanvasEvent
Abstract base class for events.
Definition
canvas-event.h:64
desktop
SPDesktop * desktop
Definition
tabs-widget.cpp:70
tool-base.h
weakptr.h
src
ui
tools
star-tool.h
Generated on Sun Jun 8 2025 04:02:07 for Inkscape by
1.9.8