#pragma once #include "asset.h" #include "assimp.h" #include "persistence.h" #include "shape.h" #include "textureFragment.h" #include class Texture; class AssetFactory : public Persistence::Persistable { public: using Shapes = std::map>; using Assets = std::map>; using AssImps = std::map>; using TextureFragments = std::map>; using Colour = RGB; using ColourAlpha = RGBA; using Colours = std::map>; AssetFactory(); [[nodiscard]] static std::shared_ptr loadXML(const std::filesystem::path &); [[nodiscard]] static Assets loadAll(const std::filesystem::path &); [[nodiscard]] ColourAlpha parseColour(std::string_view) const; [[nodiscard]] GLuint getMaterialIndex(std::string_view) const; [[nodiscard]] Asset::TexturePtr getTexture() const; Shapes shapes; Assets assets; AssImps assimps; Colours colours; TextureFragments textureFragments; static Colours parseX11RGB(const char * rgbtxtpath); static void normalizeColourName(std::string &); private: friend Persistence::SelectionPtrBase>; bool persist(Persistence::PersistenceStore & store) override; void createTexutre() const; mutable Asset::TexturePtr texture; mutable std::map> textureFragmentPositions; };