Panda3D
 All Classes Functions Variables Enumerations
eggCoordinateSystem.cxx
1 // Filename: eggCoordinateSystem.cxx
2 // Created by: drose (20Jan99)
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 #include "eggCoordinateSystem.h"
16 
17 #include "indent.h"
18 
19 TypeHandle EggCoordinateSystem::_type_handle;
20 
21 
22 ////////////////////////////////////////////////////////////////////
23 // Function: EggCoordinateSystem::write
24 // Access: Public, Virtual
25 // Description: Writes the coordinate system definition to the
26 // indicated output stream in Egg format.
27 ////////////////////////////////////////////////////////////////////
29 write(ostream &out, int indent_level) const {
30  if (get_value() != CS_default &&
31  get_value() != CS_invalid) {
32  indent(out, indent_level)
33  << "<CoordinateSystem> { ";
34  switch (get_value()) {
35  case CS_zup_right:
36  out << "Z-Up";
37  break;
38 
39  case CS_yup_right:
40  out << "Y-Up";
41  break;
42 
43  case CS_zup_left:
44  out << "Z-Up-Left";
45  break;
46 
47  case CS_yup_left:
48  out << "Y-Up-Left";
49  break;
50 
51  default:
52  out << "/* Invalid coordinate system " << (int)get_value() << " */";
53  }
54  out << " }\n\n";
55  }
56 }
virtual void write(ostream &out, int indent_level) const
Writes the coordinate system definition to the indicated output stream in Egg format.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85