15 #include "vrmlTrans.h"
16 #include "parse_vrml.h"
30 _preferred_extension =
".wrl";
32 set_program_brief(
"reads and writes VRML 2.0 files");
33 set_program_description
34 (
"This program reads a VRML 2.0 file (.wrl) and writes an "
35 "essentially equivalent .wrl file. It is primarily useful for "
36 "debugging the VRML parser that is part of the Pandatool library.");
39 add_runline(
"[opts] input.wrl > output.wrl");
40 add_runline(
"[opts] input.wrl output.wrl");
41 add_runline(
"[opts] -o output.wrl input.wrl");
45 "Specify the filename to which the resulting .wrl file will be written. "
46 "If this option is omitted, the last parameter name is taken to be the "
47 "name of the output file.",
48 &VRMLTrans::dispatch_filename, &_got_output_filename, &_output_filename);
59 nout <<
"Reading " << _input_filename <<
"\n";
61 VrmlScene *scene = parse_vrml(_input_filename);
63 nout <<
"Unable to read.\n";
78 if (!check_last_arg(args, 1)) {
83 nout <<
"You must specify the .wrl file to read on the command line.\n";
86 }
else if (args.size() != 1) {
87 nout <<
"You must specify only one .wrl file to read on the command line.\n";
91 _input_filename = args[0];
97 int main(
int argc,
char *argv[]) {
virtual void parse_command_line(int argc, char **argv)
Dispatches on each of the options on the command line, and passes the remaining parameters to handle_...
A program to read a VRML file and output an essentially similar VRML file.
This is our own Panda specialization on the default STL vector.
This is the bare functionality (intended to be inherited from along with ProgramBase or some derivati...
ostream & get_output()
Returns an output stream that corresponds to the user's intended egg file output–either stdout...