00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include "vrmlToEgg.h"
00016
00017 #include "vrmlToEggConverter.h"
00018 #include "pystub.h"
00019
00020
00021
00022
00023
00024
00025 VRMLToEgg::
00026 VRMLToEgg() :
00027 SomethingToEgg("VRML", ".wrl")
00028 {
00029 add_units_options();
00030 add_normals_options();
00031 add_transform_options();
00032
00033 set_program_description
00034 ("This program converts VRML 2.0 model files to egg. Animated files, "
00035 "and VRML 1.0 files, are not supported.");
00036
00037 redescribe_option
00038 ("cs",
00039 "Specify the coordinate system of the input " + _format_name +
00040 " file. Normally, this is y-up.");
00041
00042 _coordinate_system = CS_yup_right;
00043 }
00044
00045
00046
00047
00048
00049
00050 void VRMLToEgg::
00051 run() {
00052 nout << "Reading " << _input_filename << "\n";
00053
00054 _data->set_coordinate_system(_coordinate_system);
00055
00056 VRMLToEggConverter converter;
00057 converter.set_egg_data(_data);
00058 converter._allow_errors = _allow_errors;
00059
00060 apply_parameters(converter);
00061
00062 if (!converter.convert_file(_input_filename)) {
00063 nout << "Errors in conversion.\n";
00064 exit(1);
00065 }
00066
00067 write_egg_file();
00068 nout << "\n";
00069 }
00070
00071
00072 int main(int argc, char *argv[]) {
00073
00074 pystub();
00075
00076 VRMLToEgg prog;
00077 prog.parse_command_line(argc, argv);
00078 prog.run();
00079 return 0;
00080 }