annotate Renderer/Test/property_chain.cc @ 770:aed3d2501c38

property_chain is under construction
author hiroki@henri.cr.ie.u-ryukyu.ac.jp
date Sun, 14 Feb 2010 04:18:38 +0900
parents 2a00c1f470b7
children 720720e4e8df
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
769
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
1 #include <math.h>
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
2 #include <stdlib.h>
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
3 #include "SceneGraphRoot.h"
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
4 #include "MainLoop.h"
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
5 #include "property_chain.h"
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
6 #include "types.h"
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
7 #include "Func.h"
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
8 #include "sys.h"
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
9 #include "SgChange.h"
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
10
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
11 #define FALSE 0
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
12 #define TRUE !FALSE
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
13 static const int PROPERTY_LENGTH = 51;
770
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
14 static double m = 100.0;
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
15 static double k = 7000.0;
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
16 static double g = 9.8;
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
17 static double dt = 0.003;
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
18 static double chain_width = 10;
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
19 static double safe = 0.995;
769
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
20
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
21 typedef struct {
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
22 double x, y, next_x, next_y;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
23 double vx, vy, next_vx, next_vy;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
24 int can_move;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
25 } CHAIN_VARS;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
26
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
27 typedef struct {
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
28 float xyz[3];
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
29 float angle[3];
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
30 float stack_xyz[3];
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
31 float next_xyz[3];
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
32 float v_xyz[3];
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
33 int property_index;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
34 int parent_index;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
35 int have_parent;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
36 int can_move;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
37 memaddr parent;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
38 memaddr children;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
39 memaddr node;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
40 const char *name;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
41 } *PropertyPtr, Property;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
42
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
43
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
44 Property *property, *update_property;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
45
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
46 // prototype
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
47 static void collision(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h, SceneGraphPtr tree);
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
48 static void move(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h);
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
49 static void createSceneGraphFromProperty(SchedTask *s, void *sgroot, void *arg1);
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
50 static void set_property(Property *p, SceneGraphPtr sg, int index);
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
51 static void apply_property(SceneGraphPtr sg, Property *p);
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
52 static void regist_task(SceneGraphRoot *sgroot);
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
53 static void set_relation(SceneGraphPtr parent, SceneGraphPtr child);
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
54
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
55 static void
770
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
56 init_chain(Property *p, int index) {
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
57 for (int i = 0; i < 3; i++) {
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
58 p->xyz[i] = 0;
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
59 p->angle[i] = 0;
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
60 p->stack_xyz[i] = 0;
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
61 p->next_xyz[i] = 0;
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
62 p->v_xyz[i] = 0;
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
63 }
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
64
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
65 p->property_index = index;
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
66 p->parent_index = 0;
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
67 p->have_parent = 0;
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
68 p->can_move = TRUE;
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
69 p->parent = NULL;
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
70 p->children = NULL;
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
71 p->node = NULL;
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
72 }
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
73
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
74 static void
769
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
75 move(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h)
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
76 {
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
77 SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
78 HTaskPtr property_task = sgroot->move_exec_task;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
79
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
80 property_task->add_inData(property, sizeof(Property)*PROPERTY_LENGTH);
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
81 property_task->add_outData(update_property, sizeof(Property)*PROPERTY_LENGTH);
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
82 property_task->set_cpu(SPE_ANY);
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
83 property_task->set_post(createSceneGraphFromProperty, (void *)sgroot, 0);
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
84 property_task->spawn();
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
85 }
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
86
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
87 static void
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
88 collision(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h,
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
89 SceneGraphPtr tree)
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
90 {
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
91 }
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
92
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
93 static void
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
94 createSceneGraphFromProperty(SchedTask *s, void *sgroot_, void *arg1)
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
95 {
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
96 SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
97 SceneGraphPtr camera = sgroot->camera;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
98 SceneGraphPtr p_node;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
99
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
100 // ここが allExecute の tree をたどって clone して行くところに相当する
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
101 Property *p;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
102
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
103 for (int i = 0; i < PROPERTY_LENGTH; i++) {
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
104 p = &update_property[i];
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
105 SceneGraphPtr node = sgroot->createSceneGraph(p->name);
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
106 if (strcmp(node->name, "Earth") == 0) {
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
107 node->set_move_collision(move, collision);
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
108 }
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
109 apply_property(node, p);
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
110 }
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
111
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
112 for (int j = 0; j < PROPERTY_LENGTH; j++) {
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
113 p = &update_property[j];
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
114 p_node = (SceneGraphPtr)p->node;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
115 if (p->have_parent) {
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
116 SceneGraphPtr parent = (SceneGraphPtr)update_property[p->parent_index].node;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
117 parent->addChild(p_node);
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
118 get_matrix(p_node->matrix, p_node->angle, p_node->xyz, parent->matrix);
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
119 get_matrix(p_node->real_matrix, p_node->angle, p_node->xyz, parent->real_matrix);
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
120 } else {
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
121 get_matrix(p_node->matrix, p_node->angle, p_node->xyz, camera->matrix);
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
122 get_matrix(p_node->real_matrix, p_node->angle, p_node->xyz, camera->real_matrix);
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
123 }
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
124 }
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
125
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
126 sgroot->setSceneData((SceneGraphPtr)update_property[0].node);
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
127
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
128 Property *tmp = property;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
129 property = update_property;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
130 update_property = tmp;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
131
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
132 sgroot->move_finish();
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
133 }
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
134
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
135 static void
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
136 apply_property(SceneGraphPtr node, Property *p)
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
137 {
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
138 for (int i = 0; i < 3; i++) {
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
139 node->xyz[i] = p->xyz[i];
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
140 node->angle[i] = p->angle[i];
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
141 node->stack_xyz[i] = p->stack_xyz[i];
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
142 }
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
143 p->node = (memaddr)node;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
144 node->property = (memaddr)p;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
145 }
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
146
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
147 /*
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
148 ここで必要な値をプロパティに格納
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
149 */
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
150 static void
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
151 set_property(Property *p, SceneGraphPtr node, int index)
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
152 {
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
153 for (int i = 0; i < 3; i++) {
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
154 p->xyz[i] = node->xyz[i];
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
155 p->angle[i] = node->angle[i];
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
156 p->stack_xyz[i] = node->stack_xyz[i];
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
157 }
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
158 p->parent = (memaddr)node->parent;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
159 p->children = (memaddr)node->children;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
160 p->name = node->name;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
161 p->property_index = index;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
162
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
163 p->node = (memaddr)node;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
164 node->property = (memaddr)p;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
165 }
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
166
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
167 static void
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
168 regist_task(SceneGraphRoot *sgroot)
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
169 {
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
170 TaskManager *manager = sgroot->tmanager;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
171 HTaskPtr task = manager->create_task(UniverseTask);
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
172 // sgroot->setExecTask(task); とやるべき?
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
173 sgroot->move_exec_task = task;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
174 }
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
175
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
176 static void
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
177 set_relation(SceneGraphPtr parent, SceneGraphPtr child)
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
178 {
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
179 /*
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
180 child->property->parent_index = parent->property->property_index;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
181 child->property->have_parent = 1;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
182 */
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
183
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
184 Property *p = (Property *)parent->property;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
185 Property *c = (Property *)child->property;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
186 c->parent_index = p->property_index;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
187 c->have_parent = 1;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
188
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
189 }
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
190
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
191 MainLoopPtr
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
192 property_universe::init(Viewer *viewer, int screen_w, int screen_h)
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
193 {
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
194 // SgChange を使うための2行
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
195 SgChange *sgroot = new SgChange(viewer);
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
196 sgroot->run_init();
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
197 // 上で書いた regist_task() を登録
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
198 // sgroot->appTaskRegist(regist_task); がいいかな
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
199 sgroot->sgroot_A->appTaskRegist(regist_task);
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
200
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
201 int root_obj_index = 0;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
202 property = (Property *)sgroot->manager->allocate(sizeof(Property)*PROPERTY_LENGTH);
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
203 update_property = (Property *)sgroot->manager->allocate(sizeof(Property)*PROPERTY_LENGTH);
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
204
770
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
205 // property の初期化 application ごとに固有
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
206 for(int i = 0; i < PROPERTY_LENGTH; i++) {
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
207 init_chain(property[i], i);
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
208 }
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
209
769
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
210 SceneGraphPtr root_chain, chain;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
211 sgroot->createFromXMLfile("xml_file/chain.xml");
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
212 root_chain = sgroot->createSceneGraph("CHAIN");
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
213 root_chain->xyz[0] = screen_w / 2;
770
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
214 root_chain->xyz[1] = 0.0f;
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
215 root_chain->set_move_collision(move, colliison);
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
216
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
217
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
218 for (int i = 1; i < PROPERTY_LENGTH; i++) {
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
219 chain = sgroot->createSceneGraph("CHAIN");
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
220 chain->xyz[0] = 0;
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
221 chain->xyz[1] = chain_width * i;
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
222 chain->angle[1] = -90 * (i % 2);
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
223
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
224 root_chain->addChild(chain);
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
225 // この段階じゃ set_relation はダメか
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
226 set_relation(root_chain, chain);
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
227 }
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
228
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
229
769
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
230
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
231 SceneGraphPtr moon;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
232 moon = sgroot->createSceneGraph("Moon");
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
233
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
234 earth->addChild(moon);
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
235
770
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
236 // root の set_property は一通り SceneGraph を作成してから実行
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
237 // addChild したら set_relation しないとだめ、あんまりにもだめ
769
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
238 set_property(&property[root_obj_index], earth, 0);
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
239 set_property(&property[1], moon, 1);
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
240 set_relation(earth, moon);
770
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
241
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
242 /*
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
243 apply_property は post_func の createSceneGraphFromProperty 中で使う
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
244 apply_property は sgroot に持たせてもいいと思います○
aed3d2501c38 property_chain is under construction
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 769
diff changeset
245 */
769
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
246
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
247 sgroot->setSceneData(earth);
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
248
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
249 return sgroot;
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
250 }
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
251
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
252 extern Application *
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
253 application() {
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
254 return new property_universe();
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
255 }
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
256
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
257 const char *usr_help_str = "Usage: ./test_nogl [OPTION]\n";
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
258
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
259 extern int init(TaskManager *manager, int argc, char *argv[]);
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
260 extern void task_initialize();
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
261 static void TMend(TaskManager *manager);
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
262
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
263 int
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
264 TMmain(TaskManager *manager, int argc, char *argv[])
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
265 {
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
266 task_initialize();
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
267 manager->set_TMend(TMend);
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
268 return init(manager, argc, argv);
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
269
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
270 }
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
271
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
272 void
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
273 TMend(TaskManager *manager)
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
274 {
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
275 printf("test_nogl end\n");
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
276 }
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
277
2a00c1f470b7 add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
278 /* end */