mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-26 05:58:48 -05:00
Create SceneGraphNodes in memory pool
This commit is contained in:
@@ -81,12 +81,12 @@ public:
|
||||
/**
|
||||
* Attach node to the root
|
||||
*/
|
||||
void attachNode(std::unique_ptr<SceneGraphNode> node);
|
||||
void attachNode(ghoul::mm_unique_ptr<SceneGraphNode> node);
|
||||
|
||||
/**
|
||||
* Detach node from the root
|
||||
*/
|
||||
std::unique_ptr<SceneGraphNode> detachNode(SceneGraphNode& node);
|
||||
ghoul::mm_unique_ptr<SceneGraphNode> detachNode(SceneGraphNode& node);
|
||||
|
||||
/**
|
||||
* Set the camera of the scene
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include <openspace/properties/vector/ivec2property.h>
|
||||
#include <ghoul/glm.h>
|
||||
#include <ghoul/misc/boolean.h>
|
||||
#include <ghoul/misc/managedmemoryuniqueptr.h>
|
||||
#include <atomic>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
@@ -88,7 +89,7 @@ public:
|
||||
SceneGraphNode();
|
||||
~SceneGraphNode();
|
||||
|
||||
static std::unique_ptr<SceneGraphNode> createFromDictionary(
|
||||
static ghoul::mm_unique_ptr<SceneGraphNode> createFromDictionary(
|
||||
const ghoul::Dictionary& dictionary);
|
||||
|
||||
void initialize();
|
||||
@@ -101,8 +102,8 @@ public:
|
||||
void update(const UpdateData& data);
|
||||
void render(const RenderData& data, RendererTasks& tasks);
|
||||
|
||||
void attachChild(std::unique_ptr<SceneGraphNode> child);
|
||||
std::unique_ptr<SceneGraphNode> detachChild(SceneGraphNode& child);
|
||||
void attachChild(ghoul::mm_unique_ptr<SceneGraphNode> child);
|
||||
ghoul::mm_unique_ptr<SceneGraphNode> detachChild(SceneGraphNode& child);
|
||||
void clearChildren();
|
||||
void setParent(SceneGraphNode& parent);
|
||||
|
||||
@@ -156,7 +157,7 @@ private:
|
||||
void computeScreenSpaceData(RenderData& newData);
|
||||
|
||||
std::atomic<State> _state = State::Loaded;
|
||||
std::vector<std::unique_ptr<SceneGraphNode>> _children;
|
||||
std::vector<ghoul::mm_unique_ptr<SceneGraphNode>> _children;
|
||||
SceneGraphNode* _parent = nullptr;
|
||||
std::vector<SceneGraphNode*> _dependencies;
|
||||
std::vector<SceneGraphNode*> _dependentNodes;
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace openspace {
|
||||
|
||||
class MemoryManager {
|
||||
public:
|
||||
ghoul::MemoryPool<10 * 1024, false> PersistentMemory;
|
||||
ghoul::MemoryPool<2 * 1024 * 1024, false> PersistentMemory;
|
||||
ghoul::MemoryPool<10 * 1024, false> TemporaryMemory;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user