view TaskManager/Test/test_render/SceneGraphRoot.h @ 201:b257e27d995c

add SceneGraphIterator
author gongo@gendarme.cr.ie.u-ryukyu.ac.jp
date Mon, 26 Jan 2009 16:46:59 +0900
parents eb20274baa7c
children 0f1ff7b06157
line wrap: on
line source

#ifndef INCLUDED_SCENE_GRAPH_ROOT
#define INCLUDED_SCENE_GRAPH_ROOT

#ifndef INCLUDED_SCENE_GRAPH
#  include "SceneGraph.h"
#endif

#ifndef INCLUDED_CAMERA
#  include "Camera.h"
#endif

#ifndef INCLUDED_SCENE_GRAPH_ITERATOR
#  include "SceneGraphIterator.h"
#endif

class SceneGraphRoot {
public:
    /* Constructor, Destructor */
    SceneGraphRoot(void);
    ~SceneGraphRoot(void);

    /* Variables */
    // xml から読み込んだ、オリジナルの SceneGraph
    SceneGraphPtr *sg_src;

    // move, collision 用の SceneGraph (tree)
    SceneGraphPtr sg_exec_list;

    // 描画用の SceneGraph List (tree)
    SceneGraphPtr sg_draw_list;

    // 現在存在する SceneGraph (double linked list)
    SceneGraphPtr sg_available_list;

    // コントローラーオブジェクト (Keyboard, Joystick, ..)
    Pad *controller;

    // カメラオブジェクト
    Camera *camera;

    // SceneGraphIterator
    SceneGraphIteratorPtr iterator;

    /**
     * Functions
     */
    /* User API */
    void createFromXMLfile(const char *);
    SceneGraphPtr createSceneGraph(int id);
    SceneGraphPtr createSceneGraph(void);
    void setSceneData(SceneGraphPtr sg);
    Pad *getController(void);
    SceneGraphIteratorPtr getIterator(void);
    SceneGraphIteratorPtr getIterator(SceneGraphPtr list);

    /* Other System API */
    void allExecute(int screen_w, int screen_h);
    void checkRemove(void);
    SceneGraphPtr getExecuteSceneGraph(void);
    SceneGraphPtr getDrawSceneGraph(void);
    void updateControllerState(void);

    /* System API */
    void registSceneGraph(SceneGraphPtr sg);
    void addNext(SceneGraphPtr sg);
};

typedef SceneGraphRoot *SceneGraphRootPtr;

#endif

extern SceneGraphRootPtr sgroot;