Panda3D
eggCurve.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 eggCurve.cxx
10  * @author drose
11  * @date 2000-02-15
12  */
13 
14 #include "eggCurve.h"
15 
16 #include "string_utils.h"
17 #include "pnotify.h"
18 
19 TypeHandle EggCurve::_type_handle;
20 
21 
22 /**
23  * Returns the CurveType value associated with the given string
24  * representation, or CT_invalid if the string does not match any known
25  * CurveType value.
26  */
27 EggCurve::CurveType EggCurve::
28 string_curve_type(const std::string &string) {
29  if (cmp_nocase_uh(string, "xyz") == 0) {
30  return CT_xyz;
31  } else if (cmp_nocase_uh(string, "hpr") == 0) {
32  return CT_hpr;
33  } else if (cmp_nocase_uh(string, "t") == 0) {
34  return CT_t;
35  } else {
36  return CT_none;
37  }
38 }
39 
40 /**
41  *
42  */
43 std::ostream &operator << (std::ostream &out, EggCurve::CurveType t) {
44  switch (t) {
45  case EggCurve::CT_none:
46  return out << "none";
47  case EggCurve::CT_xyz:
48  return out << "XYZ";
49  case EggCurve::CT_hpr:
50  return out << "HPR";
51  case EggCurve::CT_t:
52  return out << "T";
53  }
54 
55  nassertr(false, out);
56  return out << "(**invalid**)";
57 }
static CurveType string_curve_type(const std::string &string)
Returns the CurveType value associated with the given string representation, or CT_invalid if the str...
Definition: eggCurve.cxx:28
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.