#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 = glm::vec3; using ColourAlpha = glm::vec4; using Colours = std::map>; using TextureFragmentCoords = std::array; AssetFactory(); [[nodiscard]] static std::shared_ptr loadXML(const std::filesystem::path &); [[nodiscard]] ColourAlpha parseColour(std::string_view) const; [[nodiscard]] TextureFragmentCoords getTextureCoords(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; };