Panda3D
eggReader.h
1 // Filename: eggReader.h
2 // Created by: drose (14Feb00)
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 EGGREADER_H
16 #define EGGREADER_H
17 
18 #include "pandatoolbase.h"
19 
20 #include "eggSingleBase.h"
21 #include "filename.h"
22 
23 class PNMFileType;
24 
25 ////////////////////////////////////////////////////////////////////
26 // Class : EggReader
27 // Description : This is the base class for a program that reads egg
28 // files, but doesn't write an egg file.
29 ////////////////////////////////////////////////////////////////////
30 class EggReader : virtual public EggSingleBase {
31 public:
32  EggReader();
33 
34  void add_texture_options();
35  void add_delod_options(double default_delod = -1.0);
36 
37  virtual EggReader *as_reader();
38  virtual void pre_process_egg_file();
39 
40 protected:
41  virtual bool handle_args(Args &args);
42  virtual bool post_command_line();
43 
44  bool do_reader_options();
45 
46 private:
47  bool copy_textures();
48  bool do_delod(EggNode *node);
49 
50 protected:
51  bool _force_complete;
52 
53 private:
54  Filename _tex_dirname;
55  bool _got_tex_dirname;
56  string _tex_extension;
57  bool _got_tex_extension;
58  PNMFileType *_tex_type;
59  double _delod;
60 };
61 
62 #endif
63 
64 
void add_delod_options(double default_delod=-1.0)
Adds -delod as a valid option for this program.
Definition: eggReader.cxx:114
void add_texture_options()
Adds -td, -te, etc.
Definition: eggReader.cxx:77
This is the base class of a family of classes that represent particular image file types that PNMImag...
Definition: pnmFileType.h:35
virtual EggReader * as_reader()
Returns this object as an EggReader pointer, if it is in fact an EggReader, or NULL if it is not...
Definition: eggReader.cxx:150
This specialization of EggBase is intended for programs that read and/or write a single egg file...
Definition: eggSingleBase.h:40
The name of a file, such as a texture file or an Egg file.
Definition: filename.h:44
virtual void pre_process_egg_file()
Performs any processing of the egg file that is appropriate after reading it in.
Definition: eggReader.cxx:164
This is the base class for a program that reads egg files, but doesn't write an egg file...
Definition: eggReader.h:30
A base class for things that may be directly added into the egg hierarchy.
Definition: eggNode.h:38