File indexing completed on 2024-05-19 04:26:55
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 KIS_SAFE_ASSERT_RECOVER_RETURN(group); 0031 group->setPassThroughMode(passthrough); 0032 } 0033 0034 bool GroupLayer::passThroughMode() const 0035 { 0036 const KisGroupLayer *group = qobject_cast<const KisGroupLayer*>(this->node()); 0037 return group->passThroughMode(); 0038 } 0039 0040 QString GroupLayer::type() const 0041 { 0042 return "grouplayer"; 0043 }