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
SomethingToEgg::add_merge_externals_options
void add_merge_externals_options()
Adds -f.
Definition: somethingToEgg.cxx:169
SomethingToEgg::add_animation_options
void add_animation_options()
Adds options appropriate to animation packages.
Definition: somethingToEgg.cxx:107
AnimationConvert
AnimationConvert
This enumerated type lists the methods by which animation from an animation package might be represen...
Definition: animationConvert.h:23
EggConverter
This is a general base class for programs that convert between egg files and some other format.
Definition: eggConverter.h:25
SomethingToEgg::SomethingToEgg
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...
Definition: somethingToEgg.cxx:25
animationConvert.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
EggData
This is the primary interface into all the egg data, and the root of the egg file structure.
Definition: eggData.h:37
SomethingToEggConverter
This is a base class for a family of converter classes that manage a conversion from some file type t...
Definition: somethingToEggConverter.h:38
SomethingToEgg::add_units_options
void add_units_options()
Adds -ui and -uo as valid options for this program.
Definition: somethingToEgg.cxx:87
pdeque< std::string >
distanceUnit.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
DistanceUnit
DistanceUnit
This enumerated type lists all the kinds of units we're likely to come across in model conversion pro...
Definition: distanceUnit.h:23
pandatoolbase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
SomethingToEgg
This is the general base class for a file-converter program that reads some model file format and gen...
Definition: somethingToEgg.h:29
eggConverter.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Filename
The name of a file, such as a texture file or an Egg file.
Definition: filename.h:39