File indexing completed on 2024-05-12 15:59:05

0001 /*
0002  *  SPDX-FileCopyrightText: 2017 Wolthera van Hövell tot Westerflier <griffinvalley@gmail.com>
0003  *
0004  *  SPDX-License-Identifier: LGPL-2.0-or-later
0005  */
0006 #include "GroupLayer.h"
0007 #include <kis_group_layer.h>
0008 #include <kis_image.h>
0009 
0010 GroupLayer::GroupLayer(KisImageSP image, QString name, QObject *parent) :
0011     Node(image, new KisGroupLayer(image, name, OPACITY_OPAQUE_U8), parent)
0012 {
0013 
0014 }
0015 
0016 GroupLayer::GroupLayer(KisGroupLayerSP layer, QObject *parent):
0017     Node(layer->image(), layer, parent)
0018 {
0019 
0020 }
0021 
0022 GroupLayer::~GroupLayer()
0023 {
0024 
0025 }
0026 
0027 void GroupLayer::setPassThroughMode(bool passthrough)
0028 {
0029     KisGroupLayer *group = dynamic_cast<KisGroupLayer*>(this->node().data());
0030     group->setPassThroughMode(passthrough);
0031 }
0032 
0033 bool GroupLayer::passThroughMode() const
0034 {
0035     const KisGroupLayer *group = qobject_cast<const KisGroupLayer*>(this->node());
0036     return group->passThroughMode();
0037 }
0038 
0039 QString GroupLayer::type() const
0040 {
0041     return "grouplayer";
0042 }