Panda3D

Loading...
Searching...
No Matches
eggCoordinateSystem.cxx
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 eggCoordinateSystem.cxx
10 * @author drose
11 * @date 1999-01-20
12 */
13
14#include "eggCoordinateSystem.h"
15
16#include "indent.h"
17
18 TypeHandle EggCoordinateSystem::_type_handle;
19
20
21/**
22 * Writes the coordinate system definition to the indicated output stream in
23 * Egg format.
24 */
25 void EggCoordinateSystem::
26 write(std::ostream &out, int indent_level) const {
27 if (get_value() != CS_default &&
28 get_value() != CS_invalid) {
29 indent(out, indent_level)
30 << "<CoordinateSystem> { ";
31 switch (get_value()) {
32 case CS_zup_right:
33 out << "Z-Up";
34 break;
35
36 case CS_yup_right:
37 out << "Y-Up";
38 break;
39
40 case CS_zup_left:
41 out << "Z-Up-Left";
42 break;
43
44 case CS_yup_left:
45 out << "Y-Up-Left";
46 break;
47
48 default:
49 out << "/* Invalid coordinate system " << (int)get_value() << " */";
50 }
51 out << " }\n\n";
52 }
53}
EggCoordinateSystem::write
virtual void write(std::ostream &out, int indent_level) const
Writes the coordinate system definition to the indicated output stream in Egg format.
Definition eggCoordinateSystem.cxx:26
TypeHandle
TypeHandle is the identifier used to differentiate C++ class types.
Definition typeHandle.h:81
eggCoordinateSystem.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
indent
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
Definition indent.cxx:20
indent.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.