eggBase.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. // Filename: eggBase.h
  2. // Created by: drose (14Feb00)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. //
  6. // PANDA 3D SOFTWARE
  7. // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
  8. //
  9. // All use of this software is subject to the terms of the Panda 3d
  10. // Software license. You should have received a copy of this license
  11. // along with this source code; you will also find a current copy of
  12. // the license at http://www.panda3d.org/license.txt .
  13. //
  14. // To contact the maintainers of this program write to
  15. // [email protected] .
  16. //
  17. ////////////////////////////////////////////////////////////////////
  18. #ifndef EGGBASE_H
  19. #define EGGBASE_H
  20. #include "pandatoolbase.h"
  21. #include "programBase.h"
  22. #include "eggData.h"
  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. void add_normals_options();
  36. void add_transform_options();
  37. static void convert_paths(EggNode *node, PathReplace *path_replace,
  38. const DSearchPath &additional_path);
  39. protected:
  40. void append_command_comment(EggData &_data);
  41. static void append_command_comment(EggData &_data, const string &comment);
  42. static bool dispatch_normals(ProgramBase *self, const string &opt, const string &arg, void *mode);
  43. bool ns_dispatch_normals(const string &opt, const string &arg, void *mode);
  44. static bool dispatch_scale(const string &opt, const string &arg, void *var);
  45. static bool dispatch_rotate_xyz(ProgramBase *self, const string &opt, const string &arg, void *var);
  46. bool ns_dispatch_rotate_xyz(const string &opt, const string &arg, void *var);
  47. static bool dispatch_rotate_axis(ProgramBase *self, const string &opt, const string &arg, void *var);
  48. bool ns_dispatch_rotate_axis(const string &opt, const string &arg, void *var);
  49. static bool dispatch_translate(const string &opt, const string &arg, void *var);
  50. protected:
  51. enum NormalsMode {
  52. NM_strip,
  53. NM_polygon,
  54. NM_vertex,
  55. NM_preserve
  56. };
  57. NormalsMode _normals_mode;
  58. double _normals_threshold;
  59. bool _got_transform;
  60. LMatrix4d _transform;
  61. bool _got_coordinate_system;
  62. CoordinateSystem _coordinate_system;
  63. };
  64. #endif