#pragma once #include "BaseMaterialOctreeBuilder.h" #include "../../scene/Octree/MultiRootTree.h" class MultiRootOctreeBuilder : public BaseMaterialOctreeBuilder { public: MultiRootOctreeBuilder(); MultiRootOctreeBuilder(unsigned8 bitsPerChannel); ~MultiRootOctreeBuilder() override; std::string GetTreeType() override; protected: // Initialize the main tree void InitTree() override; void FinalizeTree() override; // Step to finalize the main tree (for example storing it to a file) void TerminateTree() override; // Initialize the tree for the current pass. void InitCurPassTree(glm::uvec3 coord) override; // Terminate the tree in the current pass. This means it should also be appended to the main tree and deleted void FinalizeCurPassTree(glm::uvec3 coord) override; void AddMissingNode(const glm::uvec3& coordinate, const Color& color) override; // Should add a node to the current pass tree at the given coordinate and color void AddNode(const glm::uvec3& coordinate, const Color& color) override; std::vector GetOctreeNodesPerLevel() override; std::vector GetNodesPerLevel() override; private: void UpdateMultiRoot(glm::uvec3 coordinate, glm::u8 color, unsigned32 slaveRootOffset); MultiRootTree<>* mTree; MultiRootTree<>* mCurPassTree; unsigned8 mBitsPerChannel; };