Debian Codegraph @

utils/fgqcanvas/canvasitem.h

raw symbols SCIP
1 //
2 // Copyright (C) 2017 James Turner [email protected]
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License as
6 // published by the Free Software Foundation; either version 2 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful, but
10 // WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
18 #ifndef CANVASITEM_H
19 #define CANVASITEM_H
20
21 #include <QQuickItem>
22 #include "fgcanvaselement.h"
23
24 class LocalTransform;
25 class QSGClipNode;
26
27 class CanvasItem : public QQuickItem
28 {
29 Q_OBJECT
30 public:
31 CanvasItem(QQuickItem* pr = nullptr);
32
33 void setTransform(const QMatrix4x4& mat);
34
35 void setClip(const QRectF &clip, ReferenceFrame rf);
36
37 void setClipReferenceFrameItem(QQuickItem* refItem);
38
39 void clearClip();
40
41 QSGNode* updatePaintNode(QSGNode *, UpdatePaintNodeData *) override final;
42 signals:
43
44 public slots:
45
46 protected:
47
48 virtual QSGNode *updateRealPaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeData *d);
49 private:
50 QSGClipNode* updateClipNode(QSGClipNode* oldClipNode, QSGNode* contentNode);
51
52 LocalTransform* m_localTransform;
53 QRectF m_clipRect;
54 bool m_hasClip = false;
55 ReferenceFrame m_clipReferenceFrame = ReferenceFrame::GLOBAL;
56 QQuickItem* m_clipReferenceFrameItem = nullptr;
57 };
58
59 #endif // CANVASITEM_H