00001 // Filename: somethingToEgg.h 00002 // Created by: drose (15Feb00) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 #ifndef SOMETHINGTOEGG_H 00020 #define SOMETHINGTOEGG_H 00021 00022 #include "pandatoolbase.h" 00023 00024 #include "eggConverter.h" 00025 #include "distanceUnit.h" 00026 #include "animationConvert.h" 00027 00028 class SomethingToEggConverter; 00029 00030 //////////////////////////////////////////////////////////////////// 00031 // Class : SomethingToEgg 00032 // Description : This is the general base class for a file-converter 00033 // program that reads some model file format and 00034 // generates an egg file. 00035 //////////////////////////////////////////////////////////////////// 00036 class SomethingToEgg : public EggConverter { 00037 public: 00038 SomethingToEgg(const string &format_name, 00039 const string &preferred_extension = string(), 00040 bool allow_last_param = true, 00041 bool allow_stdout = true); 00042 00043 void add_units_options(); 00044 void add_animation_options(); 00045 void add_merge_externals_options(); 00046 00047 protected: 00048 void apply_units_scale(EggData &data); 00049 void apply_parameters(SomethingToEggConverter &converter); 00050 00051 virtual bool handle_args(Args &args); 00052 virtual bool post_command_line(); 00053 virtual void post_process_egg_file(); 00054 00055 static bool dispatch_animation_convert(const string &opt, const string &arg, void *var); 00056 00057 00058 Filename _input_filename; 00059 00060 DistanceUnit _input_units; 00061 DistanceUnit _output_units; 00062 00063 AnimationConvert _animation_convert; 00064 string _character_name; 00065 double _start_frame; 00066 double _end_frame; 00067 double _frame_inc; 00068 double _neutral_frame; 00069 double _input_frame_rate; 00070 double _output_frame_rate; 00071 bool _got_start_frame; 00072 bool _got_end_frame; 00073 bool _got_frame_inc; 00074 bool _got_neutral_frame; 00075 bool _got_input_frame_rate; 00076 bool _got_output_frame_rate; 00077 00078 bool _merge_externals; 00079 bool _allow_errors; 00080 }; 00081 00082 #endif 00083 00084