Browse Source

format_coordinate_system()

David Rose 14 years ago
parent
commit
651a95df40
2 changed files with 10 additions and 3 deletions
  1. 7 0
      panda/src/linmath/coordinateSystem.cxx
  2. 3 3
      panda/src/linmath/coordinateSystem.h

+ 7 - 0
panda/src/linmath/coordinateSystem.cxx

@@ -65,6 +65,13 @@ parse_coordinate_system_string(const string &str) {
   return CS_invalid;
   return CS_invalid;
 }
 }
 
 
+string
+format_coordinate_system(CoordinateSystem cs) {
+  ostringstream strm;
+  strm << cs;
+  return strm.str();
+}
+
 bool
 bool
 is_right_handed(CoordinateSystem cs) {
 is_right_handed(CoordinateSystem cs) {
   if (cs == CS_default) {
   if (cs == CS_default) {

+ 3 - 3
panda/src/linmath/coordinateSystem.h

@@ -40,12 +40,12 @@ enum CoordinateSystem {
 };
 };
 
 
 EXPCL_PANDA_LINMATH CoordinateSystem get_default_coordinate_system();
 EXPCL_PANDA_LINMATH CoordinateSystem get_default_coordinate_system();
-
-END_PUBLISH
-
 EXPCL_PANDA_LINMATH CoordinateSystem parse_coordinate_system_string(const string &str);
 EXPCL_PANDA_LINMATH CoordinateSystem parse_coordinate_system_string(const string &str);
+EXPCL_PANDA_LINMATH string format_coordinate_system(CoordinateSystem cs);
 EXPCL_PANDA_LINMATH bool is_right_handed(CoordinateSystem cs = CS_default);
 EXPCL_PANDA_LINMATH bool is_right_handed(CoordinateSystem cs = CS_default);
 
 
+END_PUBLISH
+
 #define IS_LEFT_HANDED_COORDSYSTEM(cs) ((cs==CS_zup_left) || (cs==CS_yup_left))
 #define IS_LEFT_HANDED_COORDSYSTEM(cs) ((cs==CS_zup_left) || (cs==CS_yup_left))
 
 
 EXPCL_PANDA_LINMATH ostream &operator << (ostream &out, CoordinateSystem cs);
 EXPCL_PANDA_LINMATH ostream &operator << (ostream &out, CoordinateSystem cs);