Revision: 6349
http://playerstage.svn.sourceforge.net/playerstage/?rev=6349&view=rev
Author: gerkey
Date: 2008-04-17 16:54:31 -0700 (Thu, 17 Apr 2008)
Log Message:
-----------
added check for units on ConfigFile::InsertFieldValue
Modified Paths:
--------------
code/player/trunk/libplayercore/configfile.cc
Modified: code/player/trunk/libplayercore/configfile.cc
===================================================================
--- code/player/trunk/libplayercore/configfile.cc 2008-04-17 02:53:17 UTC
(rev 6348)
+++ code/player/trunk/libplayercore/configfile.cc 2008-04-17 23:54:31 UTC
(rev 6349)
@@ -250,6 +250,26 @@
int field = this->AddField(-1,name,0);
this->AddToken(ConfigFile::TokenWord, value, 0);
this->AddFieldValue(field, index, this->token_count-1);
+
+ // Work out what the length units are
+ if(!strcmp(name, "unit_length"))
+ {
+ if (strcmp(value, "m") == 0)
+ this->unit_length = 1.0;
+ else if (strcmp(value, "cm") == 0)
+ this->unit_length = 0.01;
+ else if (strcmp(value, "mm") == 0)
+ this->unit_length = 0.001;
+ }
+
+ // Work out what the angle units are
+ if(!strcmp(name, "unit_angle"))
+ {
+ if (strcmp(value, "degrees") == 0)
+ this->unit_angle = M_PI / 180;
+ else if (strcmp(value, "radians") == 0)
+ this->unit_angle = 1;
+ }
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit