Panda3D
 All Classes Functions Variables Enumerations
lodNodeType.cxx
1 // Filename: lodNodeType.cxx
2 // Created by: drose (08Jun07)
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 "lodNodeType.h"
16 #include "string_utils.h"
17 #include "config_pgraph.h"
18 
19 ostream &
20 operator << (ostream &out, LODNodeType lnt) {
21  switch (lnt) {
22  case LNT_pop:
23  return out << "pop";
24 
25  case LNT_fade:
26  return out << "fade";
27  }
28 
29  pgraph_cat->error()
30  << "Invalid LODNodeType value: " << (int)lnt << "\n";
31  nassertr(false, out);
32  return out;
33 }
34 
35 istream &
36 operator >> (istream &in, LODNodeType &lnt) {
37  string word;
38  in >> word;
39  if (cmp_nocase_uh(word, "pop") == 0) {
40  lnt = LNT_pop;
41  } else if (cmp_nocase_uh(word, "fade") == 0) {
42  lnt = LNT_fade;
43  } else {
44  pgraph_cat->error()
45  << "Invalid LODNodeType string: " << word << "\n";
46  lnt = LNT_pop;
47  }
48  return in;
49 }