0
|
1 #ifndef INCLUDED_SG_CHANGE
|
|
2 #define INCLUDED_SG_CHANGE
|
|
3
|
|
4 #include <SDL.h>
|
|
5
|
|
6 #include "viewer_types.h"
|
|
7 #include "TaskManager.h"
|
|
8 #include "KeyStat.h"
|
|
9 #include "MainLoop.h"
|
|
10 #include "Application.h"
|
|
11 #include "SceneGraphRoot.h"
|
|
12 #include "viewer.h"
|
|
13
|
|
14 class SceneGraphRoot;
|
|
15 class Application;
|
|
16
|
|
17 class SgChange : public MainLoop {
|
|
18
|
|
19 public:
|
|
20
|
|
21 Viewer *viewer;
|
|
22 TaskManager *manager;
|
|
23
|
|
24 SgChange(Viewer *v) {
|
|
25 viewer = v;
|
|
26 manager = v->manager;
|
|
27 }
|
|
28
|
|
29 virtual ~SgChange() {}
|
|
30
|
|
31
|
|
32 SceneGraphRoot *sgroot_A;
|
|
33 SceneGraphRoot *sgroot_B;
|
|
34
|
|
35 HTaskPtr draw_finish;
|
|
36
|
|
37 void run_init();
|
|
38 void run_loop(HTaskPtr task_next);
|
|
39 void run_move(HTaskPtr task_next);
|
|
40 void run_draw(HTaskPtr task_next);
|
|
41 void rendering(HTaskPtr task_next);
|
|
42 HTaskPtr initLoop();
|
|
43
|
|
44 void pass_draw_tree();
|
|
45 void mainLoop();
|
|
46
|
|
47 void createFromXMLfile(const char *file)
|
|
48 {
|
|
49 sgroot_A->createFromXMLfile(manager, file);
|
|
50 }
|
|
51
|
|
52 SceneGraph * createSceneGraph(int id)
|
|
53 {
|
|
54 return sgroot_A->createSceneGraph(id);
|
|
55 }
|
|
56
|
|
57 SceneGraph * createSceneGraph(const char *id)
|
|
58 {
|
|
59 return sgroot_A->createSceneGraph(id);
|
|
60 }
|
|
61
|
|
62 int getSgid(const char *id)
|
|
63 {
|
|
64 return sgroot_A->getSgid(id);
|
|
65 }
|
|
66
|
|
67 SceneGraph * createSceneGraph()
|
|
68 {
|
|
69 return sgroot_A->createSceneGraph();
|
|
70 }
|
|
71
|
|
72 void setSceneData(SceneGraph *g)
|
|
73 {
|
|
74 sgroot_A->setSceneData(g);
|
|
75 }
|
|
76
|
|
77 int getLast()
|
|
78 {
|
|
79 return sgroot_A->getLast();
|
|
80 }
|
|
81 };
|
|
82
|
|
83 #endif
|
|
84
|