Panda3D
Loading...
Searching...
No Matches
lodNodeType.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 lodNodeType.cxx
10 * @author drose
11 * @date 2007-06-08
12 */
13
14#include "lodNodeType.h"
15#include "string_utils.h"
16#include "config_pgraph.h"
17
18using std::istream;
19using std::ostream;
20using std::string;
21
22ostream &
23operator << (ostream &out, LODNodeType lnt) {
24 switch (lnt) {
25 case LNT_pop:
26 return out << "pop";
27
28 case LNT_fade:
29 return out << "fade";
30 }
31
32 pgraph_cat->error()
33 << "Invalid LODNodeType value: " << (int)lnt << "\n";
34 nassertr(false, out);
35 return out;
36}
37
38istream &
39operator >> (istream &in, LODNodeType &lnt) {
40 string word;
41 in >> word;
42 if (cmp_nocase_uh(word, "pop") == 0) {
43 lnt = LNT_pop;
44 } else if (cmp_nocase_uh(word, "fade") == 0) {
45 lnt = LNT_fade;
46 } else {
47 pgraph_cat->error()
48 << "Invalid LODNodeType string: " << word << "\n";
49 lnt = LNT_pop;
50 }
51 return in;
52}
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.