Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
drawing-group.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
/*
6 * Authors:
7 * Krzysztof KosiƄski <tweenk.pl@gmail.com>
8 *
9 * Copyright (C) 2011 Authors
10 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
11 */
12
13#ifndef INKSCAPE_DISPLAY_DRAWING_GROUP_H
14#define INKSCAPE_DISPLAY_DRAWING_GROUP_H
15
17
18namespace Inkscape {
19
21 : public DrawingItem
22{
23public:
25 int tag() const override { return tag_of<decltype(*this)>; }
26
27 bool pickChildren() { return _pick_children; }
28 void setPickChildren(bool);
29
30 void setChildTransform(Geom::Affine const &);
31
32protected:
33 ~DrawingGroup() override = default;
34
35 unsigned _updateItem(Geom::IntRect const &area, UpdateContext const &ctx, unsigned flags, unsigned reset) override;
36 unsigned _renderItem(DrawingContext &dc, RenderContext &rc, Geom::IntRect const &area, unsigned flags, DrawingItem const *stop_at) const override;
37 void _clipItem(DrawingContext &dc, RenderContext &rc, Geom::IntRect const &area) const override;
38 DrawingItem *_pickItem(Geom::Point const &p, double delta, unsigned flags) override;
39 bool _canClip() const override { return true; }
40
41 std::unique_ptr<Geom::Affine> _child_transform;
42};
43
44} // namespace Inkscape
45
46#endif // INKSCAPE_DISPLAY_DRAWING_GROUP_H
47
48/*
49 Local Variables:
50 mode:c++
51 c-file-style:"stroustrup"
52 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
53 indent-tabs-mode:nil
54 fill-column:99
55 End:
56*/
57// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
constexpr int tag_of
Convenience function to retrieve the tag (class id) of a given type.
Definition cast.h:26
3x3 matrix representing an affine transformation.
Definition affine.h:70
Axis aligned, non-empty, generic rectangle.
Two-dimensional point that doubles as a vector.
Definition point.h:66
Minimal wrapper over Cairo.
unsigned _updateItem(Geom::IntRect const &area, UpdateContext const &ctx, unsigned flags, unsigned reset) override
int tag() const override
Unlink this node and its subtree from the rendering tree and destroy.
void setPickChildren(bool)
Set whether the group returns children from pick calls.
std::unique_ptr< Geom::Affine > _child_transform
bool _canClip() const override
DrawingItem * _pickItem(Geom::Point const &p, double delta, unsigned flags) override
void setChildTransform(Geom::Affine const &)
Set additional transform for the group.
~DrawingGroup() override=default
unsigned _renderItem(DrawingContext &dc, RenderContext &rc, Geom::IntRect const &area, unsigned flags, DrawingItem const *stop_at) const override
void _clipItem(DrawingContext &dc, RenderContext &rc, Geom::IntRect const &area) const override
SVG drawing item for display.
Drawing & drawing() const
unsigned _pick_children
For groups: if true, children are returned from pick(), otherwise the group is returned.
RectangularCluster rc
Canvas item belonging to an SVG drawing element.
Helper class to stream background task notifications as a series of messages.
int delta