annotate Renderer/Engine/SceneGraphRoot.h @ 580:ec9dd24c2dc8 draft

add all object in file in dynamic_create
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 24 Oct 2009 16:32:29 +0900
parents 341f1f881a9b
children 65e52fd2c2e2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
1 #ifndef INCLUDED_SCENE_GRAPH_ROOT
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
2 #define INCLUDED_SCENE_GRAPH_ROOT
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
3
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
4 #include "SceneGraph.h"
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
5 #include "SceneGraphArray.h"
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
6 #include "Camera.h"
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
7 #include "SceneGraphIterator.h"
562
d65f21b18165 name search
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 558
diff changeset
8 #include <sys/types.h>
d65f21b18165 name search
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 558
diff changeset
9
d65f21b18165 name search
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 558
diff changeset
10 typedef struct {
d65f21b18165 name search
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 558
diff changeset
11 caddr_t file_mmap;
d65f21b18165 name search
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 558
diff changeset
12 off_t size;
d65f21b18165 name search
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 558
diff changeset
13 } st_mmap_t;
d65f21b18165 name search
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 558
diff changeset
14
d65f21b18165 name search
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 558
diff changeset
15 class Application;
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
16
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
17 class SceneGraphRoot {
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
18 public:
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
19 /* Constructor, Destructor */
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
20 SceneGraphRoot(float w, float h);
558
00428ba0ba03 boss1_action
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 541
diff changeset
21 ~SceneGraphRoot();
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
22
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
23 /* Variables */
562
d65f21b18165 name search
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 558
diff changeset
24 TaskManager *tmanager;
d65f21b18165 name search
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 558
diff changeset
25
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
26 // xml から読み込んだ、オリジナルの SceneGraph
575
341f1f881a9b Linda API worked. (slightly unreliable)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 565
diff changeset
27 // Static Singleton
341f1f881a9b Linda API worked. (slightly unreliable)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 565
diff changeset
28 // SceneGraphPtr *sg_src;
341f1f881a9b Linda API worked. (slightly unreliable)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 565
diff changeset
29 // int sg_src_length;
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
30
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
31 // move, collision 用の SceneGraph (tree)
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
32 SceneGraphPtr sg_exec_tree;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
33
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
34 // 描画用の SceneGraph List (tree)
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
35 SceneGraphPtr sg_draw_tree;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
36
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
37 // sg_exec_tree に対応する list
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
38 SceneGraphPtr sg_available_list;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
39
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
40 // sg_draw_tree に対応する list
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
41 // draw_tree は描画後削除される
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
42 SceneGraphPtr sg_remove_list;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
43
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
44 SceneGraphArrayPtr sg_array1;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
45 SceneGraphArrayPtr sg_array2;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
46 SceneGraphArrayPtr sg_curArray;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
47
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
48 // コントローラーオブジェクト (Keyboard, Joystick, ..)
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
49 Pad *controller;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
50
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
51 // カメラオブジェクト
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
52 Camera *camera;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
53
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
54 // SceneGraphIterator
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
55 SceneGraphIteratorPtr iterator;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
56
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
57 /**
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
58 * Functions
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
59 */
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
60 /* User API */
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
61 void createFromXMLfile(TaskManager *manager, const char *);
580
ec9dd24c2dc8 add all object in file in dynamic_create
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 575
diff changeset
62 void createFromXMLmemory(TaskManager *manager, SceneGraph * node, char *data, int len);
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
63 SceneGraphPtr createSceneGraph(int id);
558
00428ba0ba03 boss1_action
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 541
diff changeset
64 SceneGraphPtr createSceneGraph();
562
d65f21b18165 name search
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 558
diff changeset
65 SceneGraphPtr createSceneGraph(const char *name);
d65f21b18165 name search
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 558
diff changeset
66 int getSgid(const char *name);
d65f21b18165 name search
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 558
diff changeset
67
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
68 void setSceneData(SceneGraphPtr sg);
558
00428ba0ba03 boss1_action
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 541
diff changeset
69 Pad *getController();
00428ba0ba03 boss1_action
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 541
diff changeset
70 SceneGraphIteratorPtr getIterator();
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
71 SceneGraphIteratorPtr getIterator(SceneGraphPtr list);
558
00428ba0ba03 boss1_action
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 541
diff changeset
72 CameraPtr getCamera();
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
73
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
74 /* Other System API */
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
75 void allExecute(int screen_w, int screen_h);
558
00428ba0ba03 boss1_action
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 541
diff changeset
76 void checkRemove();
00428ba0ba03 boss1_action
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 541
diff changeset
77 SceneGraphPtr getExecuteSceneGraph();
00428ba0ba03 boss1_action
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 541
diff changeset
78 SceneGraphPtr getDrawSceneGraph();
00428ba0ba03 boss1_action
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 541
diff changeset
79 void updateControllerState();
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
80
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
81 void speExecute(int screen_w, int screen_h);
562
d65f21b18165 name search
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 558
diff changeset
82 void speExecute(int screen_w, int screen_h, Application *app);
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
83
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
84 /* System API */
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
85 void registSceneGraph(SceneGraphPtr sg);
562
d65f21b18165 name search
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 558
diff changeset
86 void registSceneGraphList(SceneGraphPtr sg);
d65f21b18165 name search
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 558
diff changeset
87 void addSceneGraphList(TaskManager *manager, SceneGraphPtr tmp);
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
88 void addNext(SceneGraphPtr sg);
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
89 void allRemove(SceneGraphPtr list);
565
5193d51294a2 linda API
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 562
diff changeset
90
575
341f1f881a9b Linda API worked. (slightly unreliable)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 565
diff changeset
91 int getLast() ;
565
5193d51294a2 linda API
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 562
diff changeset
92
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
93 };
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
94
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
95 typedef SceneGraphRoot *SceneGraphRootPtr;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
96
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
97
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
98 // 大域変数は無くすこと
562
d65f21b18165 name search
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 558
diff changeset
99 extern SceneGraphRoot *sgroot;
d65f21b18165 name search
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 558
diff changeset
100
d65f21b18165 name search
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 558
diff changeset
101 #endif
558
00428ba0ba03 boss1_action
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 541
diff changeset
102
00428ba0ba03 boss1_action
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 541
diff changeset
103 /* end */