Panda3D
|
00001 // Filename: lodNodeType.cxx 00002 // Created by: drose (08Jun07) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #include "lodNodeType.h" 00016 #include "string_utils.h" 00017 00018 ostream & 00019 operator << (ostream &out, LODNodeType lnt) { 00020 switch (lnt) { 00021 case LNT_pop: 00022 return out << "pop"; 00023 00024 case LNT_fade: 00025 return out << "fade"; 00026 } 00027 00028 pgraph_cat->error() 00029 << "Invalid LODNodeType value: " << (int)lnt << "\n"; 00030 nassertr(false, out); 00031 return out; 00032 } 00033 00034 istream & 00035 operator >> (istream &in, LODNodeType &lnt) { 00036 string word; 00037 in >> word; 00038 if (cmp_nocase_uh(word, "pop") == 0) { 00039 lnt = LNT_pop; 00040 } else if (cmp_nocase_uh(word, "fade") == 0) { 00041 lnt = LNT_fade; 00042 } else { 00043 pgraph_cat->error() 00044 << "Invalid LODNodeType string: " << word << "\n"; 00045 lnt = LNT_pop; 00046 } 00047 return in; 00048 }