PeriDyno 1.0.0
Loading...
Searching...
No Matches
SceneGraphFactory.h
Go to the documentation of this file.
1
16#pragma once
17#include <atomic>
18#include <mutex>
19
20#include "SceneGraph.h"
21
22namespace dyno
23{
24 typedef std::function<std::shared_ptr<SceneGraph>()> SceneGraphCreator;
25
27 {
28 public:
30
31 std::shared_ptr<SceneGraph> active();
32
38 std::shared_ptr<SceneGraph> createNewScene();
39
40 std::shared_ptr<SceneGraph> createDefaultScene();
41
43
44 void pushScene(std::shared_ptr<SceneGraph> scn);
45
46 void popScene();
47 void popAllScenes();
48
49 private:
50 SceneGraphFactory() = default;
51 ~SceneGraphFactory() = default;
54
55 std::stack<std::shared_ptr<SceneGraph>> mSceneGraphs;
56
57 private:
58 static std::atomic<SceneGraphFactory*> pInstance;
59 static std::mutex mMutex;
60
62 };
63
64}
SceneGraphFactory(const SceneGraphFactory &)=delete
static std::atomic< SceneGraphFactory * > pInstance
std::shared_ptr< SceneGraph > createNewScene()
Create a new SceneGraph.
SceneGraphFactory & operator=(const SceneGraphFactory &)=delete
std::shared_ptr< SceneGraph > createDefaultScene()
static SceneGraphFactory * instance()
void pushScene(std::shared_ptr< SceneGraph > scn)
std::stack< std::shared_ptr< SceneGraph > > mSceneGraphs
SceneGraphCreator mDefaultCreator
void setDefaultCreator(SceneGraphCreator creator)
std::shared_ptr< SceneGraph > active()
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
std::function< std::shared_ptr< SceneGraph >()> SceneGraphCreator