Mercurial > hg > Members > kono > Cerium
view example/scenegraph/xml/xml.cpp @ 344:81da25cb3e02
example-scenegraph
author | admin@mcbk.cr.ie.u-ryukyu.ac.jp |
---|---|
date | Fri, 03 Jul 2009 19:52:52 +0900 |
parents | |
children | 2972f0bdd18c |
line wrap: on
line source
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <sys/time.h> #include "TaskManager.h" /** * 2つの XML ファイルを読み込んで、それを表示する。 * move を使って SceneGraph の値を変える。 * 1つの型に複数のインスタンスを対応させる。 * それぞれの型にランダムアクセスする。 * 型 ID の割り当て。 */ void TMend(void); static double getTime(void) { struct timeval tv; gettimeofday(&tv, NULL); return tv.tv_sec + (double)tv.tv_usec*1e-6; } const char *usr_help_str = "Usage: ./sort [option]\n \ options\n\ -cpu Number of SPE used (default 1)\n\ -l, --length Sorted number of data (default 1200)\n\ -h, --help Print this message"; int init(int argc, char **argv) { for (int i = 1; argv[i]; ++i) { if (strcmp(argv[i], "--length") == 0 || strcmp(argv[i], "-l") == 0) { length = atoi(argv[++i]); } } return 0; } int TMmain(int argc, char *argv[]) { if (init(argc, argv) < 0) { return -1; } SceneGraphPtr sgroot = new SceneGraphRoot(this->width, this->height); SceneGraphPtr sgobj1 = sgroot->createSceneGraph(Cube); SceneGraphPtr sgobj2 = sgroot->createSceneGraph(Cone); sgobj1->createFromXMLfile("sg/sg-test.xml"); sgobj2->createFromXMLfile("sg/sg-test2.xml"); st_time = getTime(); manager->set_TMend(TMend); } void TMend(void) { ed_time = getTime(); //show_data(); printf("Time: %0.6f\n",ed_time-st_time); } void load_xml() { } static void test_move(SceneGraphPtr node) { }