Panda3D
somethingToEgg.h
1 // Filename: somethingToEgg.h
2 // Created by: drose (15Feb00)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef SOMETHINGTOEGG_H
16 #define SOMETHINGTOEGG_H
17 
18 #include "pandatoolbase.h"
19 
20 #include "eggConverter.h"
21 #include "distanceUnit.h"
22 #include "animationConvert.h"
23 
25 
26 ////////////////////////////////////////////////////////////////////
27 // Class : SomethingToEgg
28 // Description : This is the general base class for a file-converter
29 // program that reads some model file format and
30 // generates an egg file.
31 ////////////////////////////////////////////////////////////////////
32 class SomethingToEgg : public EggConverter {
33 public:
34  SomethingToEgg(const string &format_name,
35  const string &preferred_extension = string(),
36  bool allow_last_param = true,
37  bool allow_stdout = true);
38 
39  void add_units_options();
40  void add_animation_options();
42 
43 protected:
44  void apply_units_scale(EggData *data);
45  void apply_parameters(SomethingToEggConverter &converter);
46 
47  virtual bool handle_args(Args &args);
48  virtual bool post_command_line();
49  virtual void post_process_egg_file();
50 
51  static bool dispatch_animation_convert(const string &opt, const string &arg, void *var);
52 
53 
54  Filename _input_filename;
55 
56  DistanceUnit _input_units;
57  DistanceUnit _output_units;
58 
59  AnimationConvert _animation_convert;
60  string _character_name;
61  double _start_frame;
62  double _end_frame;
63  double _frame_inc;
64  double _neutral_frame;
65  double _input_frame_rate;
66  double _output_frame_rate;
67  bool _got_start_frame;
68  bool _got_end_frame;
69  bool _got_frame_inc;
70  bool _got_neutral_frame;
71  bool _got_input_frame_rate;
72  bool _got_output_frame_rate;
73 
74  bool _merge_externals;
75  bool _noexist;
76  bool _allow_errors;
77 };
78 
79 #endif
80 
81 
void add_animation_options()
Adds options appropriate to animation packages.
This is the primary interface into all the egg data, and the root of the egg file structure...
Definition: eggData.h:41
SomethingToEgg(const string &format_name, const string &preferred_extension=string(), bool allow_last_param=true, bool allow_stdout=true)
The first parameter to the constructor should be the one-word name of the file format that is to be r...
This is a general base class for programs that convert between egg files and some other format...
Definition: eggConverter.h:28
The name of a file, such as a texture file or an Egg file.
Definition: filename.h:44
void add_merge_externals_options()
Adds -f.
This is the general base class for a file-converter program that reads some model file format and gen...
This is a base class for a family of converter classes that manage a conversion from some file type t...
void add_units_options()
Adds -ui and -uo as valid options for this program.