exportVrml.cpp
Go to the documentation of this file.
00001 #include <iostream>
00002 #include <hrpModel/ModelLoaderUtil.h>
00003 #include "VrmlWriter.h"
00004 
00005 using namespace std;
00006 using namespace hrp;
00007 using namespace OpenHRP;
00008 
00009 int main(int argc, char* argv[])
00010 {
00011     if (argc < 2){
00012         cerr << "Usage:" << argv[0] << " <URL of the original file> [--use-inline-shape]"
00013              << std::endl;
00014         return 1;
00015     }
00016 
00017     bool use_inline = false;
00018     if (argc > 2) {
00019         for (int i = 2; i < argc; i++) {
00020             std::string arg (argv[i]);
00021             if (arg == "--use-inline-shape") {
00022                 use_inline = true;
00023             }
00024         }
00025     }
00026     CORBA::ORB_var orb;
00027   
00028     try {
00029         orb = CORBA::ORB_init(argc, argv);
00030         ModelLoader_var ml = getModelLoader(orb);
00031         BodyInfo_var binfo;
00032         binfo = ml->getBodyInfo(argv[1]);
00033 
00034         VrmlWriter writer;
00035         writer.useInlineShape(use_inline);
00036         writer.write(binfo, cout);
00037     }catch(ModelLoader::ModelLoaderException ex){
00038         std::cerr << ex.description << std::endl;
00039         return 1;
00040     }catch (CORBA::SystemException& ex){ 
00041         cerr << ex._rep_id() << endl;
00042     }
00043     return 0;
00044 }


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Thu Apr 11 2019 03:30:16