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