view example/scenegraph/xml/xml.cpp @ 346:2972f0bdd18c

remove SceneGraph::createFromXMLfile
author e065746@localhost.localdomain
date Wed, 08 Jul 2009 14:21:46 +0900
parents 81da25cb3e02
children dd3888980738
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;
  }
  SceneGraphRootPtr sgroot = new SceneGraphRoot(this->width, this->height);

  sgroot->createFromXMLfile("sg/sg-test.xml");
  sgroot->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)
{
}