Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
drawing-shape.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_SHAPE_H
14#define INKSCAPE_DISPLAY_DRAWING_SHAPE_H
15
17#include "display/nr-style.h"
18
19class SPStyle;
20
21namespace Inkscape {
22
24 : public DrawingItem
25{
26public:
28 int tag() const override { return tag_of<decltype(*this)>; }
29
30 void setPath(std::shared_ptr<Geom::PathVector const> curve);
31 void setStyle(SPStyle const *style, SPStyle const *context_style = nullptr) override;
32 void setChildrenStyle(SPStyle const *context_style) override;
33
34protected:
35 ~DrawingShape() override = default;
36
37 unsigned _updateItem(Geom::IntRect const &area, UpdateContext const &ctx, unsigned flags, unsigned reset) override;
38 unsigned _renderItem(DrawingContext &dc, RenderContext &rc, Geom::IntRect const &area, unsigned flags, DrawingItem const *stop_at) const override;
39 void _clipItem(DrawingContext &dc, RenderContext &rc, Geom::IntRect const &area) const override;
40 DrawingItem *_pickItem(Geom::Point const &p, double delta, unsigned flags) override;
41 bool _canClip() const override { return true; }
42
43 void _renderFill(DrawingContext &dc, RenderContext &rc, Geom::IntRect const &area) const;
44 void _renderStroke(DrawingContext &dc, RenderContext &rc, Geom::IntRect const &area, unsigned flags) const;
45 void _renderMarkers(DrawingContext &dc, RenderContext &rc, Geom::IntRect const &area, unsigned flags, DrawingItem const *stop_at) const;
46
51 unsigned style_opacity : 24;
52
53 std::shared_ptr<Geom::PathVector const> _curve;
55
57 unsigned _repick_after;
58};
59
60} // namespace Inkscape
61
62#endif // INKSCAPE_DISPLAY_DRAWING_SHAPE_H
63
64/*
65 Local Variables:
66 mode:c++
67 c-file-style:"stroustrup"
68 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
69 indent-tabs-mode:nil
70 fill-column:99
71 End:
72*/
73// 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
Axis aligned, non-empty, generic rectangle.
Two-dimensional point that doubles as a vector.
Definition point.h:66
Minimal wrapper over Cairo.
SVG drawing item for display.
Drawing & drawing() const
unsigned _renderItem(DrawingContext &dc, RenderContext &rc, Geom::IntRect const &area, unsigned flags, DrawingItem const *stop_at) const override
void setPath(std::shared_ptr< Geom::PathVector const > curve)
~DrawingShape() override=default
void _clipItem(DrawingContext &dc, RenderContext &rc, Geom::IntRect const &area) const override
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 _renderStroke(DrawingContext &dc, RenderContext &rc, Geom::IntRect const &area, unsigned flags) const
std::shared_ptr< Geom::PathVector const > _curve
void setChildrenStyle(SPStyle const *context_style) override
Recursively update children style.
DrawingItem * _pickItem(Geom::Point const &p, double delta, unsigned flags) override
DrawingItem * _last_pick
void setStyle(SPStyle const *style, SPStyle const *context_style=nullptr) override
Process information related to the new style.
void _renderMarkers(DrawingContext &dc, RenderContext &rc, Geom::IntRect const &area, unsigned flags, DrawingItem const *stop_at) const
bool _canClip() const override
void _renderFill(DrawingContext &dc, RenderContext &rc, Geom::IntRect const &area) const
An SVG style object.
Definition style.h:45
RectangularCluster rc
Canvas item belonging to an SVG drawing element.
Helper class to stream background task notifications as a series of messages.
Style information for rendering.
Definition curve.h:24
SPWindRule
Definition style-enums.h:23
int delta