#include "X3D_InfoReader.h" #include "X3D_MyGroupingCreator.h" #include #include #include using namespace X3DTK; using namespace std; int main(int argc, char *argv[]) { if (argc <= 1) { cerr << "usage: infoReader input" << endl; exit(0); } // DefaultLoader to load the default X3D Nodes. X3D::Loader *loader = Singleton::getInstance(); loader->setComponentCreator(new X3D::MyGroupingCreator()); // Instanciation of the new InfoReader. X3D::InfoReader *infoReader = Singleton::getInstance(); /// Instanciation of the SceneSaver. X3D::SceneSaver *saver = Singleton::getInstance(); // Loads the scene. X3D::Scene *s = loader->load(argv[1], false); // reads the graph. infoReader->read(s); /// saves the graph. saver->saveAs(s, "myfile.x3d"); // Removes the instances. Singleton::removeInstance(); Singleton::removeInstance(); return 1; }