Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qssgrendererutil_p.h
Go to the documentation of this file.
1// Copyright (C) 2008-2012 NVIDIA Corporation.
2// Copyright (C) 2019 The Qt Company Ltd.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
4// Qt-Security score:significant reason:default
5
6
7#ifndef QSSG_RENDERER_UTIL_H
8#define QSSG_RENDERER_UTIL_H
9
10//
11// W A R N I N G
12// -------------
13//
14// This file is not part of the Qt API. It exists purely as an
15// implementation detail. This header file may change from version to
16// version without notice, or even be removed.
17//
18// We mean it.
19//
20
21#include <QtQuick3DUtils/private/qssgrenderbasetypes_p.h>
22
23#include <QtCore/qhashfunctions.h>
24#include <QtCore/qstring.h>
25
26QT_BEGIN_NAMESPACE
27
28class QSSGRenderPath
29{
30public:
31 QSSGRenderPath() = default;
32 explicit QSSGRenderPath(const QString &p, const QString &lightmapKey = {}) noexcept
33 : m_path(p), m_lightmapKey(lightmapKey),
34 m_key{qHashMulti(size_t(0), p, lightmapKey)}
35 {
36 }
37
38 bool isNull() const { return m_path.isNull(); }
39 bool isEmpty() const { return m_path.isEmpty(); }
40 QString path() const { return m_path; }
41
42private:
43 friend bool operator==(const QSSGRenderPath &p1, const QSSGRenderPath &p2) noexcept
44 {
45 return p1.m_key == p2.m_key
46 && p1.m_path == p2.m_path
47 && p1.m_lightmapKey == p2.m_lightmapKey;
48 }
49 friend bool operator!=(const QSSGRenderPath &p1, const QSSGRenderPath &p2) noexcept
50 {
51 return !(p1 == p2);
52 }
53 friend size_t qHash(const QSSGRenderPath &key, size_t seed) noexcept
54 {
55 return qHash(key.m_key, seed);
56 }
57
58 QString m_path;
59 QString m_lightmapKey;
60 size_t m_key = 0;
61};
62
63QT_END_NAMESPACE
64
65#endif