eggCoordinateSystem.cxx 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // Filename: eggCoordinateSystem.cxx
  2. // Created by: drose (20Jan99)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. //
  6. // PANDA 3D SOFTWARE
  7. // Copyright (c) 2001 - 2004, 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://etc.cmu.edu/panda3d/docs/license/ .
  13. //
  14. // To contact the maintainers of this program write to
  15. // [email protected] .
  16. //
  17. ////////////////////////////////////////////////////////////////////
  18. #include "eggCoordinateSystem.h"
  19. #include "indent.h"
  20. TypeHandle EggCoordinateSystem::_type_handle;
  21. ////////////////////////////////////////////////////////////////////
  22. // Function: EggCoordinateSystem::write
  23. // Access: Public, Virtual
  24. // Description: Writes the coordinate system definition to the
  25. // indicated output stream in Egg format.
  26. ////////////////////////////////////////////////////////////////////
  27. void EggCoordinateSystem::
  28. write(ostream &out, int indent_level) const {
  29. if (get_value() != CS_default &&
  30. get_value() != CS_invalid) {
  31. indent(out, indent_level)
  32. << "<CoordinateSystem> { ";
  33. switch (get_value()) {
  34. case CS_zup_right:
  35. out << "Z-Up";
  36. break;
  37. case CS_yup_right:
  38. out << "Y-Up";
  39. break;
  40. case CS_zup_left:
  41. out << "Z-Up-Left";
  42. break;
  43. case CS_yup_left:
  44. out << "Y-Up-Left";
  45. break;
  46. default:
  47. out << "/* Invalid coordinate system " << (int)get_value() << " */";
  48. }
  49. out << " }\n\n";
  50. }
  51. }