changeset 1249:fd9b7519a17b draft

add createFromCOLLADAfile
author Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
date Fri, 11 Nov 2011 18:05:47 +0900
parents 1bb43068289b
children c41f10c1e138
files Renderer/Engine/SceneGraphRoot.cc
diffstat 1 files changed, 37 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Renderer/Engine/SceneGraphRoot.cc	Thu Oct 20 19:08:41 2011 +0900
+++ b/Renderer/Engine/SceneGraphRoot.cc	Fri Nov 11 18:05:47 2011 +0900
@@ -226,6 +226,43 @@
 }
 
 void
+SceneGraphRoot::createFromCOLLADAfile(Taskmanager *manager, const char *xmlColladafile)
+{
+	/*make parse dom*/
+	xmlDocPtr doc;
+	xmlNodePtr cur;
+	SceneGraphPtr tmp;
+
+	doc = xmlParseFile(xmlColladafile);
+	cur = xmlDocGetRootElement(doc);
+
+	/*エラー処理……だけど何書けばいいのか謎。とりあえず-1返してみる*/
+	if(xmlStrcmp(cur-name, (xmlChar*)"COLLADA")){
+		return -1;
+	};
+
+	/* node analyze */
+	for(cur=cur->children; cur; cur=cur->next){
+
+		if(xmlStrcmp(cur->name,(xmlChar*)"library_imeges") != 0){
+
+		}
+		if(xmlStrcmp(cur->name,(xmlChar*)"library_effects") != 0){
+
+		}
+		if(xmlStrcmp(cur->name,(xmlChar*)"library_geometries") != 0){
+
+		}
+		if(xmlStrcmp(cur->name,(xmlChar*)"library_visual_scenes")!=0){
+		}
+
+		tmp = new SceneGraph(manager, cur);
+		registSceneGraph(tmp);
+	}
+	xmlFreeDoc(doc);
+}
+
+void
 SceneGraphRoot::createFromXMLmemory(TaskManager *manager, SceneGraph *node, char *data, int len)
 {
     xmlDocPtr doc;