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