Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_count_visitor.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2007 Boudewijn Rempt <boud@valdyas.org>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#include "kis_count_visitor.h"
8#include "kis_image.h"
9
11{
12 Q_FOREACH (const QString& nodeType, m_nodeTypes) {
13 if (node->inherits(nodeType.toLatin1()))
14 return true;
15 }
16 return false;
17}
18
20{
21 if (m_nodeTypes.isEmpty() || inList(node)) {
22
23 if (m_properties.isEmpty() || node->check(m_properties)) {
24 m_count++;
25 }
26 }
27 visitAll(node);
28
29 return true;
30}
char nodeType(const KoPathPoint *point)
bool check(KisNode *node)
const KoProperties m_properties
bool inList(KisNode *node)
const QStringList m_nodeTypes
bool visitAll(KisNode *node, bool breakOnFail=false)
bool isEmpty() const
bool check(const KoProperties &properties) const