/
tomilov
/
sah_kd_tree
Обзор
Документация
Войти
/
tomilov
/
sah_kd_tree
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/viewer/engine_wrapper.hpp
68 строк
1 KB
Anatoliy Tomilov
WIP: tree traversing
27 авг 2024, 01:59
27 авг 2024, 01:59
4392a05
Код
Авторство
О чём код?
#pragma once #include <utils/checked_ptr.hpp> #include <utils/fast_pimpl.hpp> #include <QtCore/QObject> #include <QtQml/QJSEngine> #include <QtQml/QQmlEngine> #include <cstddef> #include <viewer/viewer_export.h> namespace engine { class Context; } // namespace engine namespace viewer { class Scenes; class Engine; class VIEWER_EXPORT EngineWrapper : public QObject { Q_OBJECT public: explicit EngineWrapper(QObject * parent = nullptr); ~EngineWrapper() override; [[nodiscard]] engine::Context & getContext(); [[nodiscard]] const engine::Context & getContext() const; [[nodiscard]] static std::initializer_list<uint32_t> getMutedMessageIdNumbers(); void init(); [[nodiscard]] const Engine & getEngine() const; [[nodiscard]] Q_INVOKABLE static QStringList getSupportedSceneFileExtensions(); private: struct Impl; static constexpr size_t kSize = 392; static constexpr size_t kAlignment = 8; utils::FastPimpl<Impl, kSize, kAlignment> impl_; }; class EngineSingletonForeign { Q_GADGET QML_FOREIGN(EngineWrapper) QML_SINGLETON QML_NAMED_ELEMENT(SahKdTreeEngine) public: static void setEngine(EngineWrapper * engine) VIEWER_EXPORT; [[nodiscard]] static EngineWrapper * create(QQmlEngine * qmlEngine, QJSEngine * jsEngine); private: inline static utils::CheckedPtr<EngineWrapper> engine = nullptr; inline static QJSEngine * jsEngine = nullptr; }; } // namespace viewer