exportVrml.cpp
Go to the documentation of this file.
1 #include <iostream>
3 #include "VrmlWriter.h"
4 
5 using namespace std;
6 using namespace hrp;
7 using namespace OpenHRP;
8 
9 int main(int argc, char* argv[])
10 {
11  if (argc < 2){
12  cerr << "Usage:" << argv[0] << " <URL of the original file> [--use-inline-shape]"
13  << std::endl;
14  return 1;
15  }
16 
17  bool use_inline = false;
18  if (argc > 2) {
19  for (int i = 2; i < argc; i++) {
20  std::string arg (argv[i]);
21  if (arg == "--use-inline-shape") {
22  use_inline = true;
23  }
24  }
25  }
26  CORBA::ORB_var orb;
27 
28  try {
29  orb = CORBA::ORB_init(argc, argv);
30  ModelLoader_var ml = getModelLoader(orb);
31  BodyInfo_var binfo;
32  binfo = ml->getBodyInfo(argv[1]);
33 
35  writer.useInlineShape(use_inline);
36  writer.write(binfo, cout);
37  }catch(ModelLoader::ModelLoaderException ex){
38  std::cerr << ex.description << std::endl;
39  return 1;
40  }catch (CORBA::SystemException& ex){
41  cerr << ex._rep_id() << endl;
42  }
43  return 0;
44 }
HRPMODEL_API OpenHRP::ModelLoader_var getModelLoader(CosNaming::NamingContext_var cxt)
int main(int argc, char *argv[])
Definition: exportVrml.cpp:9
png_uint_32 i
Definition: png.h:2735
char * arg
Definition: cdjpeg.h:136
void * writer(void *arg)


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Sat May 8 2021 02:42:37