4#ifndef QSSGSCENEDESCRIPTION_P_H
5#define QSSGSCENEDESCRIPTION_P_H
7#include <QtQuick3DAssetUtils/private/qtquick3dassetutilsglobal_p.h>
8#include <QtQuick3DRuntimeRender/private/qssgrendergraphobject_p.h>
9#include <QtQuick3DRuntimeRender/private/qssgperframeallocator_p.h>
10#include <QtQuick3DUtils/private/qssgmesh_p.h>
12#include <QtCore/qlist.h>
13#include <QtCore/qhash.h>
14#include <QtCore/qvariant.h>
15#include <QtCore/qflags.h>
16#include <QtQml/qqmllist.h>
19#include <QtQuick3D/private/qquick3dobject_p.h>
21#include <QtQuick3D/private/qquick3dcustommaterial_p.h>
22#include <QtQuick3D/private/qquick3ddefaultmaterial_p.h>
23#include <QtQuick3D/private/qquick3dprincipledmaterial_p.h>
24#include <QtQuick3D/private/qquick3dspecularglossymaterial_p.h>
25#include <QtQuick3D/private/qquick3dmodel_p.h>
27#include <QtQuick3D/private/qquick3dorthographiccamera_p.h>
28#include <QtQuick3D/private/qquick3dperspectivecamera_p.h>
29#include <QtQuick3D/private/qquick3dcustomcamera_p.h>
31#include <QtQuick3D/private/qquick3ddirectionallight_p.h>
32#include <QtQuick3D/private/qquick3dpointlight_p.h>
33#include <QtQuick3D/private/qquick3dspotlight_p.h>
35#include <QtQuick3D/private/qquick3dtexture_p.h>
36#include <QtQuick3D/private/qquick3dcubemaptexture_p.h>
37#include <QtQuick3D/private/qquick3dtexturedata_p.h>
39#include <QtQuick3D/private/qquick3dskeleton_p.h>
40#include <QtQuick3D/private/qquick3djoint_p.h>
43#include <QtQuick3DUtils/private/qssginvasivelinkedlist_p.h>
66using rm_cvref_t = std::remove_cv_t<std::remove_reference_t<T>>;
68struct Q_QUICK3DASSETUTILS_EXPORT
Scene
135struct Q_QUICK3DASSETUTILS_EXPORT
Node
165 void cleanupChildren();
180static constexpr bool is_node_v = std::is_base_of_v<Node, T>;
184#define QSSG_DECLARE_NODE(NODE) \
185static_assert(is_node_v<NODE>, #NODE " - does not inherit from Node!"); \
186template <> struct TypeMap<NODE::type> { using type = QSSGSceneDesc::NODE; };
326 return value.toVector2D();
328 return value.toVector3D();
339 return QMetaType::Float;
341 return QMetaType::QVector2D;
343 return QMetaType::QVector3D;
345 return QMetaType::QVector4D;
347 return QMetaType::QQuaternion;
349 return QMetaType::QVector4D;
414template <
typename R,
typename...
A>
419 using Arg0 = std::tuple_element_t<0, std::tuple<
A...>>;
420 using Arg1 = std::tuple_element_t<1, std::tuple<
A...>>;
421 using Arg2 = std::tuple_element_t<2, std::tuple<
A...>>;
425template <
typename R,
typename C,
typename...
A>
432 using Arg0 = std::tuple_element_t<0, std::tuple<
A...>>;
436template <
typename T,
typename C>
446template <
typename Ret,
typename Arg>
455 if constexpr (std::is_pointer_v<typename FuncType<Setter>::Arg2>)
468template <
typename Ret,
typename Class,
typename Arg>
477 if constexpr (std::is_pointer_v<typename FuncType<Setter>::Arg0>)
491template <
typename Ret,
typename Class,
typename Arg>
508 (qobject_cast<Class *>(&that)->*
call)(
ListT{});
517 if (
const auto listView = qvariant_cast<const ListView *>(
var)) {
523 (qobject_cast<Class *>(&that)->*
call)(
ListT{});
530template <
typename Class,
typename T,
template <
typename>
typename List>
538 static_assert(std::is_same_v<ListType, QQmlListProperty<T>>,
"Expected QQmlListProperty!");
555 doSet(that, nodeList);
563 const auto *nodeList = qvariant_cast<const QSSGSceneDesc::NodeList *>(
var);
565 doSet(that, *nodeList);
572template <
typename NodeT>
573using if_node =
typename std::enable_if_t<is_node_v<NodeT>,
bool>;
574template <
typename Setter,
typename Value>
576template <
typename Setter,
typename T>
578template <
typename Setter,
typename Value>
584template<
typename Setter,
typename T, if_compatible_t<Setter, T> = false>
595template<
typename Setter,
typename T, if_compatible_t<Setter, QFlags<T>> = false>
607template<
typename Setter,
typename T, if_compatible_t<Setter, QList<T>> = false>
611 static_assert(!std::is_pointer_v<T>,
"Type cannot be a pointer!");
612 static_assert(std::is_trivially_destructible_v<T> && std::is_trivially_copy_constructible_v<T>,
613 "List parameter type needs to be trivially constructable and trivially destructible!");
616 void *
data =
nullptr;
618 const auto asize =
count *
sizeof(T);
619 data = malloc(asize);
634template<
typename Setter>
645template<
typename Setter,
typename Value, if_compatible_proxy_t<Setter, Value> = true>
649 static_assert(std::is_trivially_destructible_v<rm_cvref_t<Value>>,
"Value needs to be trivially destructible!");
658template<
typename Setter,
typename ViewValue, if_compatible_t<Setter,
typename ViewValue::type> = false>
662 static_assert(std::is_same_v<typename ViewValue::type, typename FuncType<Setter>::Arg0Base>,
"Type cannot be mapped to slot argument");
670template<
typename Setter,
typename Value, if_compatible_t<Setter, as_scene_type_t<Value> *> = true>
683template<
typename Setter,
typename NodeT, qsizetype Prealloc, if_compatible_node_list_t<Setter, NodeT> = true>
const_pointer constData() const noexcept
bool isEmpty() const noexcept
qsizetype count() const noexcept
void append(parameter_type t)
The QQmlListProperty class allows applications to expose list-like properties of QObject-derived clas...
The QQuaternion class represents a quaternion consisting of a vector and scalar.
\qmltype Object3D \inqmlmodule QtQuick3D \instantiates QQuick3DObject \inherits QtObject
\qmltype TextureData \inherits Object3D \inqmlmodule QtQuick3D \instantiates QQuick3DTextureData
\macro QT_RESTRICTED_CAST_FROM_ASCII
static auto fromValue(T &&value) noexcept(std::is_nothrow_copy_constructible_v< T > &&Private::CanUseInternalSpace< T >) -> std::enable_if_t< std::conjunction_v< std::is_copy_constructible< T >, std::is_destructible< T > >, QVariant >
The QVector4D class represents a vector or vertex in 4D space.
static void setProperty(QSSGSceneDesc::Node &node, const char *name, Setter setter, T &&value)
Q_QUICK3DASSETUTILS_EXPORT void addNode(Node &parent, Node &node)
typename std::enable_if_t< is_node_v< NodeT >, bool > if_node
typename std::enable_if_t< std::is_same_v< typename FuncType< Setter >::Ret, QQmlListProperty< as_scene_type_t< T > > >, bool > if_compatible_node_list_t
static constexpr bool is_node_v
Q_QUICK3DASSETUTILS_EXPORT QMetaType listViewMetaType()
std::remove_cv_t< std::remove_reference_t< T > > rm_cvref_t
typename std::enable_if_t< std::is_same_v< typename FuncType< Setter >::Arg2Base, rm_cvref_t< Value > >, bool > if_compatible_proxy_t
typename T::type as_scene_type_t
typename TypeMap< T >::type as_node_type_t
typename ListParam< rm_cvref_t< T > >::type listParam_t
typename std::enable_if_t< std::is_same_v< typename FuncType< Setter >::Arg0Base, rm_cvref_t< Value > >, bool > if_compatible_t
Q_QUICK3DASSETUTILS_EXPORT void destructNode(QSSGSceneDesc::Node &node)
Q_QUICK3DASSETUTILS_EXPORT void destructValue(QVariant &value)
Combined button and popup list for selecting options.
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
static QDBusError::ErrorType get(const char *name)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLuint GLenum GLsizei length
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLint GLsizei GLsizei GLenum format
QtPrivate::QRegularExpressionMatchIteratorRangeBasedForIterator begin(const QRegularExpressionMatchIterator &iterator)
#define QSSG_DECLARE_NODE(NODE)
T qvariant_cast(const QVariant &)
QFuture< QSet< QChar > > set
[10]
TargetProperty targetProperty
KeyType getKeyType() const
QVariant getValue() const
QMetaType::Type getValueQMetaType() const
ValueType getValueType() const
std::tuple_element_t< 0, std::tuple< A... > > Arg0
rm_cvref_t< Arg0 > Arg0Base
std::tuple_element_t< 0, std::tuple< A... > > Arg0
std::tuple_element_t< 2, std::tuple< A... > > Arg2
std::tuple_element_t< 1, std::tuple< A... > > Arg1
rm_cvref_t< Arg2 > Arg2Base
NodeList(void *const *data, qsizetype n)
Node(QByteArray name, Node::Type type, Node::RuntimeType rt)
Node(Node::Type type, Node::RuntimeType rt)
virtual bool set(QQuick3DObject &, const char *, const QVariant &)=0
virtual ~PropertyCall()=default
bool get(const QQuick3DObject &, const void *[]) const override
typename FuncType< Setter >::Arg0Base ListT
bool set(QQuick3DObject &that, const char *, const void *value) override
constexpr PropertyListSetter(Setter fn)
bool set(QQuick3DObject &that, const char *, const QVariant &var) override
Ret(Class::*)(Arg) Setter
void doSet(QQuick3DObject &that, const QSSGSceneDesc::NodeList &nodeList)
constexpr PropertyList(ListFunc fn)
bool set(QQuick3DObject &that, const char *, const QVariant &var) override
ListType(Class::*)() ListFunc
bool set(QQuick3DObject &that, const char *, const void *value) override
bool get(const QQuick3DObject &, const void *[]) const override
constexpr PropertyProxySetter(Setter fn)
Ret(*)(QQuick3DObject &, const char *, Arg) Setter
bool set(QQuick3DObject &that, const char *name, const QVariant &var) override
bool set(QQuick3DObject &that, const char *name, const void *value) override
bool get(const QQuick3DObject &, const void *[]) const override
bool set(QQuick3DObject &that, const char *, const QVariant &var) override
Ret(Class::*)(Arg) Setter
constexpr PropertySetter(Setter fn)
bool set(QQuick3DObject &that, const char *, const void *value) override
bool get(const QQuick3DObject &, const void *[]) const override
QSSGSceneDesc::PropertyCall * call
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent