Krita Source Code Documentation
Loading...
Searching...
No Matches
SelectionMask.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2017 Wolthera van Hövell tot Westerflier <griffinvalley@gmail.com>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6#include "SelectionMask.h"
8#include <kis_image.h>
9#include "Selection.h"
10#include <kis_selection.h>
11
12SelectionMask::SelectionMask(KisImageSP image, QString name, QObject *parent) :
13 Node(image, new KisSelectionMask(image), parent)
14{
15 this->node()->setName(name);
16}
17
19 Node(image, mask, parent)
20{
21
22}
23
28
30{
31 const KisSelectionMask *mask = qobject_cast<const KisSelectionMask*>(this->node());
32 return new Selection(mask->selection());
33}
34
36{
37 KisSelectionMask *mask = dynamic_cast<KisSelectionMask*>(this->node().data());
39}
40
41QString SelectionMask::type() const
42{
43 return "selectionmask";
44}
Definition Node.h:24
friend class Selection
Definition Node.h:697
KisNodeSP node() const
Definition Node.cpp:827
friend class SelectionMask
Definition Node.h:704
virtual QString type() const override
type Krita has several types of nodes, split in layers and masks. Group layers can contain other laye...
~SelectionMask() override
Selection * selection() const
void setSelection(Selection *selection)
KisSelectionSP selection() const
void setName(const QString &name)
KisSelectionSP selection
Definition kis_mask.cc:44
void setSelection(KisSelectionSP selection)
Set the selection of this adjustment layer to a copy of selection.