Panda3D
eggBase.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 eggBase.h
10  * @author drose
11  * @date 2000-02-14
12  */
13 
14 #ifndef EGGBASE_H
15 #define EGGBASE_H
16 
17 #include "pandatoolbase.h"
18 
19 #include "programBase.h"
20 #include "eggData.h"
21 
22 /**
23  * This is a base class for both EggSingleBase and EggMultiBase. Don't
24  * inherit directly from this; use one of those two classes instead.
25  *
26  * This is just a base class; see EggReader, EggWriter, or EggFilter according
27  * to your particular I/O needs.
28  */
29 class EggBase : public ProgramBase {
30 public:
31  EggBase();
32 
33  void add_normals_options();
34  void add_points_options();
35  void add_transform_options();
36 
37  static void convert_paths(EggNode *node, PathReplace *path_replace,
38  const DSearchPath &additional_path);
39 
40 protected:
41  void append_command_comment(EggData *_data);
42  static void append_command_comment(EggData *_data, const std::string &comment);
43 
44  static bool dispatch_normals(ProgramBase *self, const std::string &opt, const std::string &arg, void *mode);
45  bool ns_dispatch_normals(const std::string &opt, const std::string &arg, void *mode);
46 
47  static bool dispatch_scale(const std::string &opt, const std::string &arg, void *var);
48  static bool dispatch_rotate_xyz(ProgramBase *self, const std::string &opt, const std::string &arg, void *var);
49  bool ns_dispatch_rotate_xyz(const std::string &opt, const std::string &arg, void *var);
50  static bool dispatch_rotate_axis(ProgramBase *self, const std::string &opt, const std::string &arg, void *var);
51  bool ns_dispatch_rotate_axis(const std::string &opt, const std::string &arg, void *var);
52  static bool dispatch_translate(const std::string &opt, const std::string &arg, void *var);
53 
54 protected:
55  enum NormalsMode {
56  NM_strip,
57  NM_polygon,
58  NM_vertex,
59  NM_preserve
60  };
61  NormalsMode _normals_mode;
62  double _normals_threshold;
63  vector_string _tbn_names;
64  bool _got_tbnall;
65  bool _got_tbnauto;
66 
67  bool _make_points;
68 
69  bool _got_transform;
70  LMatrix4d _transform;
71 
72  bool _got_coordinate_system;
73  CoordinateSystem _coordinate_system;
74 
75  bool _noabs;
76 };
77 
78 #endif
This is intended to be the base class for most general-purpose utility programs in the PANDATOOL tree...
Definition: programBase.h:34
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void add_normals_options()
Adds -no, -np, etc.
Definition: eggBase.cxx:59
This is the primary interface into all the egg data, and the root of the egg file structure.
Definition: eggData.h:37
static void convert_paths(EggNode *node, PathReplace *path_replace, const DSearchPath &additional_path)
Recursively walks the egg hierarchy.
Definition: eggBase.cxx:158
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This encapsulates the user's command-line request to replace existing, incorrect pathnames to models ...
Definition: pathReplace.h:36
A base class for things that may be directly added into the egg hierarchy.
Definition: eggNode.h:35
void add_transform_options()
Adds -TS, -TT, etc.
Definition: eggBase.cxx:126
This is a base class for both EggSingleBase and EggMultiBase.
Definition: eggBase.h:29
void add_points_options()
Adds -points as a valid option for this program.
Definition: eggBase.cxx:113
This class stores a list of directories that can be searched, in order, to locate a particular file.
Definition: dSearchPath.h:28