fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / FileIO / WRL / testVRMLLoader.cpp
blob6ec4ae30b5a9b9058d9f56d759d2c51546f4174b
2 #include "OSGSceneFileHandler.h"
3 #include "OSGFieldContainerFactory.h"
6 int main (int argc, char **argv)
8 OSG::osgInit(argc,argv);
10 OSG::NodeRecPtr file;
11 std::vector<OSG::NodeRecPtr> vFile;
13 #ifdef OSG_MT_FIELDCONTAINERPTR
14 OSG::UInt32 iPre =
15 OSG::FieldContainerFactory::the()->getNumContainers();
17 fprintf(stderr, "FCs pre : %d\n", iPre);
18 #endif
20 if(argc > 1)
22 for(OSG::UInt32 i = 0; i < 2; ++i)
24 file = OSG::SceneFileHandler::the()->read(argv[1], NULL);
26 vFile.push_back(file);
27 OSG::commitChanges();
28 file = NULL;
31 #if 0
32 OSG::UInt32 iPostLoad =
33 OSG::FieldContainerFactory::the()->getContainerStore().size();
35 for(OSG::UInt32 i = iPre; i < iPostLoad; ++i)
37 fprintf(stderr, "[%d] : ", i);
39 if(OSG::FieldContainerFactory::the()->getContainerStore()[i] !=
40 OSGNULL)
42 fprintf(stderr, "%s\n",
43 OSG::FieldContainerFactory::the()->
44 getContainerStore()[i]->getType().getCName());
46 else
48 fprintf(stderr, "NULL\n");
51 #endif
53 OSG::commitChanges();
55 for(OSG::UInt32 i = 0; i < vFile.size(); ++i)
57 vFile[i] = NULL;
61 #ifdef OSG_MT_FIELDCONTAINERPTR
62 OSG::UInt32 iPost =
63 OSG::FieldContainerFactory::the()->getNumContainers();
65 fprintf(stderr, "FCs post : %d\n", iPost);
67 for(OSG::UInt32 i = iPre; i < iPost; ++i)
69 fprintf(stderr, "[%d] : ", i);
71 if(OSG::FieldContainerFactory::the()->getContainer(i) != OSGNULL)
73 fprintf(stderr, "%s\n",
74 OSG::FieldContainerFactory::the()->
75 getContainer(i)->getType().getCName());
77 else
79 fprintf(stderr, "NULL\n");
82 #endif
84 OSG::osgExit();