changeset 452:1f35fc0a3472

Application.{cc,h} added
author kazz@henri.cr.ie.u-ryukyu.ac.jp
date Fri, 25 Sep 2009 22:51:39 +0900
parents 95dbf6bd8cd9
children dc50a62ffd96
files TaskManager/Test/test_render/Application.cc TaskManager/Test/test_render/Application.h
diffstat 2 files changed, 117 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TaskManager/Test/test_render/Application.cc	Fri Sep 25 22:51:39 2009 +0900
@@ -0,0 +1,85 @@
+#include "Application.h"
+#include "SceneGraph.h"
+
+// void
+// Application::set_move_func(move_func new_move)
+// {
+//     this->move = new_move;
+// }
+
+// void
+// Application::set_move_coll(coll_func new_coll)
+// {
+//     this->coll = new_coll;
+// }
+
+Application::Application(){}
+Application::~Application(){}
+// void
+// Application::apply_property(PropertyPtr p, SceneGraphPtr sgptr)
+// {
+//     sgptr->xyz[0] = p->xyz[0];
+//     sgptr->xyz[1] = p->xyz[1];
+//     sgptr->xyz[2] = p->xyz[2];
+
+//     sgptr->angle[0] = p->angle[0];
+//     sgptr->angle[1] = p->angle[1];
+//     sgptr->angle[2] = p->angle[2];
+
+//     sgptr->frame++;
+
+// }
+
+SceneGraphPtr 
+Application::scenegraph_factory(void *p, int size)
+{
+    //SceneGraphPtr sgptr =  p->scenegraph;
+    //apply_property(p, sgptr);
+
+    return NULL;
+}
+
+SceneGraphPtr 
+Application::scenegraph_connector(void *p, int size, SceneGraphPtr sg,
+				  SceneGraphPtr sg_available_list)
+{
+//     SceneGraphPtr last = sg_available_list;
+
+//     if (!last) {
+// 	sg_available_list = sg;
+//     } else {
+// 	while (last->next) {
+// 	    last = last->next;
+// 	}
+// 	last->next = sg;
+// 	sg->prev = last;
+//     }
+
+//     PropertyPtr p_curent = (PropertyPtr)sg->propertyPtr;
+//     PropertyPtr p_parent = p[p_curent->parent_id];
+//     SceneGraphPtr s_parent = p_parent->scenegraph;
+
+//     /* childrenのリストの最後に加える (brother として)*/
+//     if (s_parent->lastChild != NULL) {
+//         SceneGraphPtr last = s_parent->lastChild;
+//         last->brother = sg;
+//     }
+
+//     s_parent->lastChild = sg;
+
+//     if (s_parent->children == NULL) {
+//         s_parent->children = sg;
+//     }
+
+//     sg->parent = s_parent;
+    return NULL;
+}
+
+
+void Application::init(TaskManager *manager, int w, int h) {
+}
+
+int Application::move_task_id() {
+    return 0;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TaskManager/Test/test_render/Application.h	Fri Sep 25 22:51:39 2009 +0900
@@ -0,0 +1,32 @@
+class Application;
+typedef Application *ApplicationPtr;
+
+#ifndef INCLUDED_APPLICATION
+#define INCLUDED_APPLICATION
+
+#include "SceneGraph.h"
+
+typedef void (*move_func)(SceneGraph* node, int screen_w, int screen_h);
+typedef void (*coll_func)(SceneGraph* node, int screen_w, int screen_h, SceneGraphPtr tree);
+
+class Application {
+public:
+    Application();
+    virtual ~Application();
+    
+    void *propertyPtr;
+    int property_size;
+    void set_move_func(move_func move);
+    void set_coll_func(coll_func coll);
+    //void set_move_taskid(int id);
+    //SceneGraphPtr scenegraph_factory(PropertyPtr p);
+    //SceneGraphPtr scenegraph_connector(PropertyPtr p,SceneGraphPtr s);
+    SceneGraphPtr scenegraph_factory(void *p, int size);
+    SceneGraphPtr scenegraph_connector(void *p, int size, SceneGraphPtr s, SceneGraphPtr sg_available_list);
+    virtual void init(TaskManager *manager, int w, int h) ;
+
+    virtual int move_task_id() ;
+
+};
+
+#endif