comparison Renderer/Engine/SceneGraphRoot.cc @ 1249:fd9b7519a17b draft

add createFromCOLLADAfile
author Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
date Fri, 11 Nov 2011 18:05:47 +0900
parents 636dfdc30176
children 6da91e7cbffb
comparison
equal deleted inserted replaced
1235:1bb43068289b 1249:fd9b7519a17b
221 /* ポリゴン(SceneGraph)生成 */ 221 /* ポリゴン(SceneGraph)生成 */
222 tmp = new SceneGraph(manager, cur); 222 tmp = new SceneGraph(manager, cur);
223 registSceneGraph(tmp); 223 registSceneGraph(tmp);
224 } 224 }
225 xmlFreeDoc(doc); 225 xmlFreeDoc(doc);
226 }
227
228 void
229 SceneGraphRoot::createFromCOLLADAfile(Taskmanager *manager, const char *xmlColladafile)
230 {
231 /*make parse dom*/
232 xmlDocPtr doc;
233 xmlNodePtr cur;
234 SceneGraphPtr tmp;
235
236 doc = xmlParseFile(xmlColladafile);
237 cur = xmlDocGetRootElement(doc);
238
239 /*エラー処理……だけど何書けばいいのか謎。とりあえず-1返してみる*/
240 if(xmlStrcmp(cur-name, (xmlChar*)"COLLADA")){
241 return -1;
242 };
243
244 /* node analyze */
245 for(cur=cur->children; cur; cur=cur->next){
246
247 if(xmlStrcmp(cur->name,(xmlChar*)"library_imeges") != 0){
248
249 }
250 if(xmlStrcmp(cur->name,(xmlChar*)"library_effects") != 0){
251
252 }
253 if(xmlStrcmp(cur->name,(xmlChar*)"library_geometries") != 0){
254
255 }
256 if(xmlStrcmp(cur->name,(xmlChar*)"library_visual_scenes")!=0){
257 }
258
259 tmp = new SceneGraph(manager, cur);
260 registSceneGraph(tmp);
261 }
262 xmlFreeDoc(doc);
226 } 263 }
227 264
228 void 265 void
229 SceneGraphRoot::createFromXMLmemory(TaskManager *manager, SceneGraph *node, char *data, int len) 266 SceneGraphRoot::createFromXMLmemory(TaskManager *manager, SceneGraph *node, char *data, int len)
230 { 267 {