[Orxonox-commit 735] r3265 - in branches/core4/src: core core/input orxonox/objects/gametypes orxonox/objects/weaponsystem/projectiles orxonox/overlays orxonox/overlays/console orxonox/overlays/hud orxonox/overlays/stats orxonox/tools util

rgrieder at orxonox.net rgrieder at orxonox.net
Wed Jul 1 13:24:31 CEST 2009


Author: rgrieder
Date: 2009-07-01 13:24:30 +0200 (Wed, 01 Jul 2009)
New Revision: 3265

Modified:
   branches/core4/src/core/ArgumentCompletionFunctions.cc
   branches/core4/src/core/ConfigFileManager.cc
   branches/core4/src/core/IRC.cc
   branches/core4/src/core/TclThreadManager.cc
   branches/core4/src/core/input/KeyBinder.cc
   branches/core4/src/orxonox/objects/gametypes/UnderAttack.cc
   branches/core4/src/orxonox/objects/weaponsystem/projectiles/LightningGunProjectile.cc
   branches/core4/src/orxonox/overlays/OrxonoxOverlay.cc
   branches/core4/src/orxonox/overlays/console/InGameConsole.cc
   branches/core4/src/orxonox/overlays/hud/GametypeStatus.cc
   branches/core4/src/orxonox/overlays/hud/HUDBar.cc
   branches/core4/src/orxonox/overlays/hud/HUDHealthBar.cc
   branches/core4/src/orxonox/overlays/hud/HUDNavigation.cc
   branches/core4/src/orxonox/overlays/hud/HUDTimer.cc
   branches/core4/src/orxonox/overlays/hud/PongScore.cc
   branches/core4/src/orxonox/overlays/hud/TeamBaseMatchScore.cc
   branches/core4/src/orxonox/overlays/stats/CreateLines.cc
   branches/core4/src/orxonox/tools/BillboardSet.cc
   branches/core4/src/orxonox/tools/Mesh.cc
   branches/core4/src/orxonox/tools/ParticleInterface.cc
   branches/core4/src/orxonox/tools/TextureGenerator.cc
   branches/core4/src/util/Convert.h
   branches/core4/src/util/MultiTypeValue.h
   branches/core4/src/util/StringUtils.cc
Log:
- Removed superfluous convertToString and convertFromString (replaced them with multi_cast)
- Replaced all getConvertedValue with multi_cast since it doesn't involve a potential implicit cast of the argument (template type deduction always leads to the right type)
- Using NilValue<T>() instead of zeroise<T>() for better performance (detail, but just caught my eye)

Modified: branches/core4/src/core/ArgumentCompletionFunctions.cc
===================================================================
--- branches/core4/src/core/ArgumentCompletionFunctions.cc	2009-07-01 09:22:03 UTC (rev 3264)
+++ branches/core4/src/core/ArgumentCompletionFunctions.cc	2009-07-01 11:24:30 UTC (rev 3265)
@@ -142,7 +142,7 @@
             ArgumentCompletionList threads;
 
             for (std::list<unsigned int>::const_iterator it = threadnumbers.begin(); it != threadnumbers.end(); ++it)
-                threads.push_back(ArgumentCompletionListElement(getConvertedValue<unsigned int, std::string>(*it)));
+                threads.push_back(ArgumentCompletionListElement(multi_cast<std::string>(*it)));
 
             return threads;
         }

Modified: branches/core4/src/core/ConfigFileManager.cc
===================================================================
--- branches/core4/src/core/ConfigFileManager.cc	2009-07-01 09:22:03 UTC (rev 3264)
+++ branches/core4/src/core/ConfigFileManager.cc	2009-07-01 11:24:30 UTC (rev 3265)
@@ -123,9 +123,9 @@
     std::string ConfigFileEntryVectorValue::getFileEntry() const
     {
         if (this->additionalComment_ == "" || this->additionalComment_.size() == 0)
-            return (this->name_ + "[" + getConvertedValue<unsigned int, std::string>(this->index_, "0") + "]" + "=" + this->value_);
+            return (this->name_ + "[" + multi_cast<std::string>(this->index_, "0") + "]" + "=" + this->value_);
         else
-            return (this->name_ + "[" + getConvertedValue<unsigned int, std::string>(this->index_, "0") + "]=" + this->value_ + " " + this->additionalComment_);
+            return (this->name_ + "[" + multi_cast<std::string>(this->index_, "0") + "]=" + this->value_ + " " + this->additionalComment_);
     }
 
 

Modified: branches/core4/src/core/IRC.cc
===================================================================
--- branches/core4/src/core/IRC.cc	2009-07-01 09:22:03 UTC (rev 3264)
+++ branches/core4/src/core/IRC.cc	2009-07-01 11:24:30 UTC (rev 3265)
@@ -67,7 +67,7 @@
         catch (std::exception const &e)
         {   COUT(1) << "Error while initializing Tcl (IRC): " << e.what();   }
 
-        this->nickname_ = "orx" + getConvertedValue<int, std::string>((unsigned int)rand());
+        this->nickname_ = "orx" + multi_cast<std::string>(static_cast<unsigned int>(rand()));
         TclThreadManager::execute(threadID, "set nickname " + this->nickname_);
         TclThreadManager::execute(threadID, "source irc.tcl");
     }

Modified: branches/core4/src/core/TclThreadManager.cc
===================================================================
--- branches/core4/src/core/TclThreadManager.cc	2009-07-01 09:22:03 UTC (rev 3264)
+++ branches/core4/src/core/TclThreadManager.cc	2009-07-01 11:24:30 UTC (rev 3265)
@@ -93,7 +93,7 @@
     {
         boost::mutex::scoped_lock bundles_lock(TclThreadManager::getInstance().bundlesMutex_);
         TclThreadManager::getInstance().threadCounter_++;
-        std::string name = getConvertedValue<unsigned int, std::string>(TclThreadManager::getInstance().threadCounter_);
+        std::string name = multi_cast<std::string>(TclThreadManager::getInstance().threadCounter_);
 
         TclInterpreterBundle* bundle = new TclInterpreterBundle;
         bundle->id_ = TclThreadManager::getInstance().threadCounter_;
@@ -191,7 +191,7 @@
         output += "\t\t";
         {
             boost::mutex::scoped_lock queue_lock(TclThreadManager::getInstance().orxonoxInterpreterBundle_.queueMutex_);
-            output += getConvertedValue<unsigned int, std::string>(TclThreadManager::getInstance().orxonoxInterpreterBundle_.queue_.size());
+            output += multi_cast<std::string>(TclThreadManager::getInstance().orxonoxInterpreterBundle_.queue_.size());
         }
         output += "\t\t";
         output += "busy";
@@ -200,11 +200,11 @@
         boost::mutex::scoped_lock bundles_lock(TclThreadManager::getInstance().bundlesMutex_);
         for (std::map<unsigned int, TclInterpreterBundle*>::const_iterator it = TclThreadManager::getInstance().interpreterBundles_.begin(); it != TclThreadManager::getInstance().interpreterBundles_.end(); ++it)
         {
-            std::string output = getConvertedValue<unsigned int, std::string>((*it).first);
+            std::string output = multi_cast<std::string>((*it).first);
             output += "\t\t";
             {
                 boost::mutex::scoped_lock queue_lock((*it).second->queueMutex_);
-                output += getConvertedValue<unsigned int, std::string>((*it).second->queue_.size());
+                output += multi_cast<std::string>((*it).second->queue_.size());
             }
             output += "\t\t";
             {
@@ -341,7 +341,7 @@
         }
         else
         {
-            this->error("Error: No Tcl-interpreter with ID " + getConvertedValue<unsigned int, std::string>(threadID) + " existing.");
+            this->error("Error: No Tcl-interpreter with ID " + multi_cast<std::string>(threadID) + " existing.");
             return 0;
         }
     }
@@ -354,7 +354,7 @@
             if (it != list.begin())
                 output += " ";
 
-            output += getConvertedValue<unsigned int, std::string>(*it);
+            output += multi_cast<std::string>(*it);
         }
         return output;
     }
@@ -443,7 +443,7 @@
             boost::mutex::scoped_lock queue_lock(bundle->queueMutex_);
             if (bundle->queue_.size() >= TCLTHREADMANAGER_MAX_QUEUE_LENGTH)
             {
-                this->error("Error: Queue of Tcl-interpreter " + getConvertedValue<unsigned int, std::string>(threadID) + " is full, couldn't add command.");
+                this->error("Error: Queue of Tcl-interpreter " + multi_cast<std::string>(threadID) + " is full, couldn't add command.");
                 return;
             }
 
@@ -491,7 +491,7 @@
 
         if (std::find(target->queriers_.begin(), target->queriers_.end(), target->id_) != target->queriers_.end())
         {
-            this->error("Error: Circular query (" + this->dumpList(target->queriers_) + " -> " + getConvertedValue<unsigned int, std::string>(target->id_) + "), couldn't query Tcl-interpreter with ID " + getConvertedValue<unsigned int, std::string>(target->id_) + " from other interpreter with ID " + getConvertedValue<unsigned int, std::string>(querier->id_) + ".");
+            this->error("Error: Circular query (" + this->dumpList(target->queriers_) + " -> " + multi_cast<std::string>(target->id_) + "), couldn't query Tcl-interpreter with ID " + multi_cast<std::string>(target->id_) + " from other interpreter with ID " + multi_cast<std::string>(querier->id_) + ".");
             return false;
         }
 
@@ -584,7 +584,7 @@
                     }
                     else
                     {
-                        this->error("Error: Couldn't query Tcl-interpreter with ID " + getConvertedValue<unsigned int, std::string>(threadID) + ", interpreter is busy right now.");
+                        this->error("Error: Couldn't query Tcl-interpreter with ID " + multi_cast<std::string>(threadID) + ", interpreter is busy right now.");
                     }
                 }
 
@@ -664,11 +664,11 @@
         }
         catch (Tcl::tcl_error const &e)
         {
-            TclThreadManager::getInstance().error("Tcl (ID " + getConvertedValue<unsigned int, std::string>(interpreterBundle->id_) + ") error: " + e.what());
+            TclThreadManager::getInstance().error("Tcl (ID " + multi_cast<std::string>(interpreterBundle->id_) + ") error: " + e.what());
         }
         catch (std::exception const &e)
         {
-            TclThreadManager::getInstance().error("Error while executing Tcl (ID " + getConvertedValue<unsigned int, std::string>(interpreterBundle->id_) + "): " + e.what());
+            TclThreadManager::getInstance().error("Error while executing Tcl (ID " + multi_cast<std::string>(interpreterBundle->id_) + "): " + e.what());
         }
 
         boost::mutex::scoped_lock finished_lock(interpreterBundle->finishedMutex_);

Modified: branches/core4/src/core/input/KeyBinder.cc
===================================================================
--- branches/core4/src/core/input/KeyBinder.cc	2009-07-01 09:22:03 UTC (rev 3264)
+++ branches/core4/src/core/input/KeyBinder.cc	2009-07-01 11:24:30 UTC (rev 3265)
@@ -186,7 +186,7 @@
         // reinitialise all joy stick binings (doesn't overwrite the old ones)
         for (unsigned int iDev = 0; iDev < numberOfJoySticks_; iDev++)
         {
-            std::string deviceNumber = convertToString(iDev);
+            std::string deviceNumber = multi_cast<std::string>(iDev);
             // joy stick buttons
             for (unsigned int i = 0; i < JoyStickButtonCode::numberOfButtons; i++)
             {

Modified: branches/core4/src/orxonox/objects/gametypes/UnderAttack.cc
===================================================================
--- branches/core4/src/orxonox/objects/gametypes/UnderAttack.cc	2009-07-01 09:22:03 UTC (rev 3264)
+++ branches/core4/src/orxonox/objects/gametypes/UnderAttack.cc	2009-07-01 11:24:30 UTC (rev 3265)
@@ -172,7 +172,7 @@
              //prints gametime
             if ( gameTime_ <= timesequence_ && gameTime_ > 0)
             {
-                std::string message = convertToString(timesequence_) + " seconds left!";
+                std::string message = multi_cast<std::string>(timesequence_) + " seconds left!";
 /*
                 COUT(0) << message << std::endl;
                 Host::Broadcast(message);

Modified: branches/core4/src/orxonox/objects/weaponsystem/projectiles/LightningGunProjectile.cc
===================================================================
--- branches/core4/src/orxonox/objects/weaponsystem/projectiles/LightningGunProjectile.cc	2009-07-01 09:22:03 UTC (rev 3264)
+++ branches/core4/src/orxonox/objects/weaponsystem/projectiles/LightningGunProjectile.cc	2009-07-01 11:24:30 UTC (rev 3265)
@@ -55,7 +55,7 @@
     {
         this->materialBase_ = material;    
     
-        BillboardProjectile::setMaterial(material + convertToString(this->textureIndex_));
+        BillboardProjectile::setMaterial(material + multi_cast<std::string>(this->textureIndex_));
     }
 
     void LightningGunProjectile::changeTexture()

Modified: branches/core4/src/orxonox/overlays/OrxonoxOverlay.cc
===================================================================
--- branches/core4/src/orxonox/overlays/OrxonoxOverlay.cc	2009-07-01 09:22:03 UTC (rev 3264)
+++ branches/core4/src/orxonox/overlays/OrxonoxOverlay.cc	2009-07-01 11:24:30 UTC (rev 3265)
@@ -71,12 +71,12 @@
 
         // create the Ogre::Overlay
         overlay_ = Ogre::OverlayManager::getSingleton().create("OrxonoxOverlay_overlay_"
-            + convertToString(hudOverlayCounter_s++));
+            + multi_cast<std::string>(hudOverlayCounter_s++));
 
         // create background panel (can be used to show any picture)
         this->background_ = static_cast<Ogre::PanelOverlayElement*>(
             Ogre::OverlayManager::getSingleton().createOverlayElement("Panel",
-            "OrxonoxOverlay_background_" + convertToString(hudOverlayCounter_s++)));
+            "OrxonoxOverlay_background_" + multi_cast<std::string>(hudOverlayCounter_s++)));
         this->overlay_->add2D(this->background_);
 
         // Get aspect ratio from the render window. Later on, we get informed automatically

Modified: branches/core4/src/orxonox/overlays/console/InGameConsole.cc
===================================================================
--- branches/core4/src/orxonox/overlays/console/InGameConsole.cc	2009-07-01 09:22:03 UTC (rev 3264)
+++ branches/core4/src/orxonox/overlays/console/InGameConsole.cc	2009-07-01 11:24:30 UTC (rev 3265)
@@ -219,7 +219,7 @@
         this->consoleOverlayTextAreas_ = new Ogre::TextAreaOverlayElement*[LINES];
         for (int i = 0; i < LINES; i++)
         {
-            this->consoleOverlayTextAreas_[i] = static_cast<Ogre::TextAreaOverlayElement*>(ovMan->createOverlayElement("TextArea", "InGameConsoleTextArea" + convertToString(i)));
+            this->consoleOverlayTextAreas_[i] = static_cast<Ogre::TextAreaOverlayElement*>(ovMan->createOverlayElement("TextArea", "InGameConsoleTextArea" + multi_cast<std::string>(i)));
             this->consoleOverlayTextAreas_[i]->setMetricsMode(Ogre::GMM_PIXELS);
             this->consoleOverlayTextAreas_[i]->setFontName("MonofurConsole");
             this->consoleOverlayTextAreas_[i]->setCharHeight(18);

Modified: branches/core4/src/orxonox/overlays/hud/GametypeStatus.cc
===================================================================
--- branches/core4/src/orxonox/overlays/hud/GametypeStatus.cc	2009-07-01 09:22:03 UTC (rev 3264)
+++ branches/core4/src/orxonox/overlays/hud/GametypeStatus.cc	2009-07-01 11:24:30 UTC (rev 3265)
@@ -69,7 +69,7 @@
             else if (!gtinfo->hasEnded())
             {
                 if (gtinfo->isStartCountdownRunning())
-                    this->setCaption(convertToString((int)ceil(gtinfo->getStartCountdown())));
+                    this->setCaption(multi_cast<std::string>((int)ceil(gtinfo->getStartCountdown())));
                 else if (ce->isA(Class(Spectator)))
                     this->setCaption("Press [Fire] to respawn");
                 else

Modified: branches/core4/src/orxonox/overlays/hud/HUDBar.cc
===================================================================
--- branches/core4/src/orxonox/overlays/hud/HUDBar.cc	2009-07-01 09:22:03 UTC (rev 3264)
+++ branches/core4/src/orxonox/overlays/hud/HUDBar.cc	2009-07-01 11:24:30 UTC (rev 3265)
@@ -71,7 +71,7 @@
         RegisterObject(HUDBar);
 
         // create new material
-        std::string materialname = "barmaterial" + getConvertedValue<unsigned int, std::string>(materialcount_s++);
+        std::string materialname = "barmaterial" + multi_cast<std::string>(materialcount_s++);
         Ogre::MaterialPtr material = (Ogre::MaterialPtr)Ogre::MaterialManager::getSingleton().create(materialname, "General");
         material->getTechnique(0)->getPass(0)->setSceneBlending(Ogre::SBT_TRANSPARENT_ALPHA);
         this->textureUnitState_ = material->getTechnique(0)->getPass(0)->createTextureUnitState();

Modified: branches/core4/src/orxonox/overlays/hud/HUDHealthBar.cc
===================================================================
--- branches/core4/src/orxonox/overlays/hud/HUDHealthBar.cc	2009-07-01 09:22:03 UTC (rev 3264)
+++ branches/core4/src/orxonox/overlays/hud/HUDHealthBar.cc	2009-07-01 11:24:30 UTC (rev 3265)
@@ -82,7 +82,7 @@
         if (this->owner_)
         {
             this->setValue(this->owner_->getHealth() / this->owner_->getInitialHealth());
-            this->textoverlay_->setCaption(convertToString((int)this->owner_->getHealth()));
+            this->textoverlay_->setCaption(multi_cast<std::string>((int)this->owner_->getHealth()));
         }
 
         if (this->bUseBarColour_)

Modified: branches/core4/src/orxonox/overlays/hud/HUDNavigation.cc
===================================================================
--- branches/core4/src/orxonox/overlays/hud/HUDNavigation.cc	2009-07-01 09:22:03 UTC (rev 3264)
+++ branches/core4/src/orxonox/overlays/hud/HUDNavigation.cc	2009-07-01 11:24:30 UTC (rev 3265)
@@ -141,8 +141,8 @@
 
         // set text
         int dist = (int) getDist2Focus();
-        navText_->setCaption(convertToString(dist));
-        float textLength = convertToString(dist).size() * navText_->getCharHeight() * 0.3;
+        navText_->setCaption(multi_cast<std::string>(dist));
+        float textLength = multi_cast<std::string>(dist).size() * navText_->getCharHeight() * 0.3;
 
 /*
         Ogre::Camera* navCam = SpaceShip::getLocalShip()->getCamera()->cam_;

Modified: branches/core4/src/orxonox/overlays/hud/HUDTimer.cc
===================================================================
--- branches/core4/src/orxonox/overlays/hud/HUDTimer.cc	2009-07-01 09:22:03 UTC (rev 3264)
+++ branches/core4/src/orxonox/overlays/hud/HUDTimer.cc	2009-07-01 11:24:30 UTC (rev 3265)
@@ -58,7 +58,7 @@
         {
             if (gametype->getTimerIsActive())
             {
-                this->setCaption(convertToString((int)gametype->getTime() + 1));
+                this->setCaption(multi_cast<std::string>((int)gametype->getTime() + 1));
             }
         }
     }

Modified: branches/core4/src/orxonox/overlays/hud/PongScore.cc
===================================================================
--- branches/core4/src/orxonox/overlays/hud/PongScore.cc	2009-07-01 09:22:03 UTC (rev 3264)
+++ branches/core4/src/orxonox/overlays/hud/PongScore.cc	2009-07-01 11:24:30 UTC (rev 3265)
@@ -82,13 +82,13 @@
             if (player1)
             {
                 name1 = player1->getName();
-                score1 = convertToString(this->owner_->getScore(player1));
+                score1 = multi_cast<std::string>(this->owner_->getScore(player1));
             }
 
             if (player2)
             {
                 name2 = player2->getName();
-                score2 = convertToString(this->owner_->getScore(player2));
+                score2 = multi_cast<std::string>(this->owner_->getScore(player2));
             }
 
             std::string output1;

Modified: branches/core4/src/orxonox/overlays/hud/TeamBaseMatchScore.cc
===================================================================
--- branches/core4/src/orxonox/overlays/hud/TeamBaseMatchScore.cc	2009-07-01 09:22:03 UTC (rev 3264)
+++ branches/core4/src/orxonox/overlays/hud/TeamBaseMatchScore.cc	2009-07-01 11:24:30 UTC (rev 3265)
@@ -70,11 +70,11 @@
 
         if (this->owner_)
         {
-            std::string bases1 = "(" + convertToString(this->owner_->getTeamBases(0)) + ")";
-            std::string bases2 = "(" + convertToString(this->owner_->getTeamBases(1)) + ")";
+            std::string bases1 = "(" + multi_cast<std::string>(this->owner_->getTeamBases(0)) + ")";
+            std::string bases2 = "(" + multi_cast<std::string>(this->owner_->getTeamBases(1)) + ")";
 
-            std::string score1 = convertToString(this->owner_->getTeamPoints(0));
-            std::string score2 = convertToString(this->owner_->getTeamPoints(1));
+            std::string score1 = multi_cast<std::string>(this->owner_->getTeamPoints(0));
+            std::string score2 = multi_cast<std::string>(this->owner_->getTeamPoints(1));
 
             std::string output1;
             if (this->bShowLeftTeam_)

Modified: branches/core4/src/orxonox/overlays/stats/CreateLines.cc
===================================================================
--- branches/core4/src/orxonox/overlays/stats/CreateLines.cc	2009-07-01 09:22:03 UTC (rev 3264)
+++ branches/core4/src/orxonox/overlays/stats/CreateLines.cc	2009-07-01 11:24:30 UTC (rev 3265)
@@ -98,7 +98,7 @@
 
     //    while (textColumns_.size() < numberOfColumns)
     //    {
-    //        Ogre::TextAreaOverlayElement* tempTextArea = static_cast<Ogre::TextAreaOverlayElement*>(ovMan->createOverlayElement("TextArea", "StatsLineTextArea" + getName() + convertToString(lineIndex) + convertToString(colIndex)));
+    //        Ogre::TextAreaOverlayElement* tempTextArea = static_cast<Ogre::TextAreaOverlayElement*>(ovMan->createOverlayElement("TextArea", "StatsLineTextArea" + getName() + multi_cast<std::string>(lineIndex) + multi_cast<std::string>(colIndex)));
     //        textColumns_.push_back(tempTextArea);
     //        this->background_->addChild(tempTextArea);
 

Modified: branches/core4/src/orxonox/tools/BillboardSet.cc
===================================================================
--- branches/core4/src/orxonox/tools/BillboardSet.cc	2009-07-01 09:22:03 UTC (rev 3264)
+++ branches/core4/src/orxonox/tools/BillboardSet.cc	2009-07-01 11:24:30 UTC (rev 3265)
@@ -73,7 +73,7 @@
         {
             if (GameMode::showsGraphics())
             {
-                this->billboardSet_ = scenemanager->createBillboardSet("Billboard" + convertToString(BillboardSet::billboardSetCounter_s++), count);
+                this->billboardSet_ = scenemanager->createBillboardSet("Billboard" + multi_cast<std::string>(BillboardSet::billboardSetCounter_s++), count);
                 this->billboardSet_->createBillboard(position);
                 this->billboardSet_->setMaterialName(file);
             }
@@ -96,7 +96,7 @@
         {
             if (GameMode::showsGraphics())
             {
-                this->billboardSet_ = scenemanager->createBillboardSet("Billboard" + convertToString(BillboardSet::billboardSetCounter_s++), count);
+                this->billboardSet_ = scenemanager->createBillboardSet("Billboard" + multi_cast<std::string>(BillboardSet::billboardSetCounter_s++), count);
                 this->billboardSet_->createBillboard(position, colour);
                 this->billboardSet_->setMaterialName(file);
             }

Modified: branches/core4/src/orxonox/tools/Mesh.cc
===================================================================
--- branches/core4/src/orxonox/tools/Mesh.cc	2009-07-01 09:22:03 UTC (rev 3264)
+++ branches/core4/src/orxonox/tools/Mesh.cc	2009-07-01 11:24:30 UTC (rev 3265)
@@ -67,7 +67,7 @@
         {
             try
             {
-                this->entity_ = this->scenemanager_->createEntity("Mesh" + convertToString(Mesh::meshCounter_s++), meshsource);
+                this->entity_ = this->scenemanager_->createEntity("Mesh" + multi_cast<std::string>(Mesh::meshCounter_s++), meshsource);
                 this->entity_->setCastShadows(this->bCastShadows_);
 
                 this->entity_->setNormaliseNormals(true);

Modified: branches/core4/src/orxonox/tools/ParticleInterface.cc
===================================================================
--- branches/core4/src/orxonox/tools/ParticleInterface.cc	2009-07-01 09:22:03 UTC (rev 3264)
+++ branches/core4/src/orxonox/tools/ParticleInterface.cc	2009-07-01 11:24:30 UTC (rev 3265)
@@ -68,7 +68,7 @@
         {
             try
             {
-                this->particleSystem_ = this->scenemanager_->createParticleSystem("particles" + getConvertedValue<unsigned int, std::string>(ParticleInterface::counter_s++), templateName);
+                this->particleSystem_ = this->scenemanager_->createParticleSystem("particles" + multi_cast<std::string>(ParticleInterface::counter_s++), templateName);
                 this->setSpeedFactor(1.0f);
             }
             catch (...)

Modified: branches/core4/src/orxonox/tools/TextureGenerator.cc
===================================================================
--- branches/core4/src/orxonox/tools/TextureGenerator.cc	2009-07-01 09:22:03 UTC (rev 3264)
+++ branches/core4/src/orxonox/tools/TextureGenerator.cc	2009-07-01 11:24:30 UTC (rev 3265)
@@ -71,7 +71,7 @@
 
         if (it == colourMap.end())
         {
-            std::string materialName = textureName + "_Material_" + convertToString(materialCount_s++);
+            std::string materialName = textureName + "_Material_" + multi_cast<std::string>(materialCount_s++);
             Ogre::MaterialPtr material = (Ogre::MaterialPtr)Ogre::MaterialManager::getSingleton().create(materialName, "General");
             material->getTechnique(0)->getPass(0)->setSceneBlending(Ogre::SBT_TRANSPARENT_ALPHA);
             Ogre::TextureUnitState* textureUnitState = material->getTechnique(0)->getPass(0)->createTextureUnitState();

Modified: branches/core4/src/util/Convert.h
===================================================================
--- branches/core4/src/util/Convert.h	2009-07-01 09:22:03 UTC (rev 3264)
+++ branches/core4/src/util/Convert.h	2009-07-01 11:24:30 UTC (rev 3265)
@@ -360,20 +360,6 @@
         return output;
     }
 
-    // convert to string Shortcut
-    template <class FromType>
-    FORCEINLINE std::string convertToString(FromType value)
-    {
-        return getConvertedValue<FromType, std::string>(value);
-    }
-
-    // convert from string Shortcut
-    template <class ToType>
-    FORCEINLINE ToType convertFromString(std::string str)
-    {
-        return getConvertedValue<std::string, ToType>(str);
-    }
-
     ////////////////////////////////
     // Special string conversions //
     ////////////////////////////////

Modified: branches/core4/src/util/MultiTypeValue.h
===================================================================
--- branches/core4/src/util/MultiTypeValue.h	2009-07-01 09:22:03 UTC (rev 3264)
+++ branches/core4/src/util/MultiTypeValue.h	2009-07-01 11:24:30 UTC (rev 3265)
@@ -138,14 +138,14 @@
         inline operator long double()          const { return getConvertedValue<T, long double>         (this->value_, 0); }     /** @brief Returns the current value, converted to the requested type. */
         inline operator bool()                 const { return getConvertedValue<T, bool>                (this->value_, 0); }     /** @brief Returns the current value, converted to the requested type. */
         inline operator void*()                const { return getConvertedValue<T, void*>               (this->value_, 0); }     /** @brief Returns the current value, converted to the requested type. */
-        inline operator std::string()          const { return getConvertedValue<T, std::string>         (this->value_, zeroise<std::string         >()); } /** @brief Returns the current value, converted to the requested type. */
-        inline operator orxonox::Vector2()     const { return getConvertedValue<T, orxonox::Vector2>    (this->value_, zeroise<orxonox::Vector2    >()); } /** @brief Returns the current value, converted to the requested type. */
-        inline operator orxonox::Vector3()     const { return getConvertedValue<T, orxonox::Vector3>    (this->value_, zeroise<orxonox::Vector3    >()); } /** @brief Returns the current value, converted to the requested type. */
-        inline operator orxonox::Vector4()     const { return getConvertedValue<T, orxonox::Vector4>    (this->value_, zeroise<orxonox::Vector4    >()); } /** @brief Returns the current value, converted to the requested type. */
-        inline operator orxonox::ColourValue() const { return getConvertedValue<T, orxonox::ColourValue>(this->value_, zeroise<orxonox::ColourValue>()); } /** @brief Returns the current value, converted to the requested type. */
-        inline operator orxonox::Quaternion()  const { return getConvertedValue<T, orxonox::Quaternion> (this->value_, zeroise<orxonox::Quaternion >()); } /** @brief Returns the current value, converted to the requested type. */
-        inline operator orxonox::Radian()      const { return getConvertedValue<T, orxonox::Radian>     (this->value_, zeroise<orxonox::Radian     >()); } /** @brief Returns the current value, converted to the requested type. */
-        inline operator orxonox::Degree()      const { return getConvertedValue<T, orxonox::Degree>     (this->value_, zeroise<orxonox::Degree     >()); } /** @brief Returns the current value, converted to the requested type. */
+        inline operator std::string()          const { return getConvertedValue<T, std::string>         (this->value_, NilValue<std::string         >()); } /** @brief Returns the current value, converted to the requested type. */
+        inline operator orxonox::Vector2()     const { return getConvertedValue<T, orxonox::Vector2>    (this->value_, NilValue<orxonox::Vector2    >()); } /** @brief Returns the current value, converted to the requested type. */
+        inline operator orxonox::Vector3()     const { return getConvertedValue<T, orxonox::Vector3>    (this->value_, NilValue<orxonox::Vector3    >()); } /** @brief Returns the current value, converted to the requested type. */
+        inline operator orxonox::Vector4()     const { return getConvertedValue<T, orxonox::Vector4>    (this->value_, NilValue<orxonox::Vector4    >()); } /** @brief Returns the current value, converted to the requested type. */
+        inline operator orxonox::ColourValue() const { return getConvertedValue<T, orxonox::ColourValue>(this->value_, NilValue<orxonox::ColourValue>()); } /** @brief Returns the current value, converted to the requested type. */
+        inline operator orxonox::Quaternion()  const { return getConvertedValue<T, orxonox::Quaternion> (this->value_, NilValue<orxonox::Quaternion >()); } /** @brief Returns the current value, converted to the requested type. */
+        inline operator orxonox::Radian()      const { return getConvertedValue<T, orxonox::Radian>     (this->value_, NilValue<orxonox::Radian     >()); } /** @brief Returns the current value, converted to the requested type. */
+        inline operator orxonox::Degree()      const { return getConvertedValue<T, orxonox::Degree>     (this->value_, NilValue<orxonox::Degree     >()); } /** @brief Returns the current value, converted to the requested type. */
 
         /** @brief Puts the current value on the stream */
         inline void toString(std::ostream& outstream) const { outstream << this->value_; }

Modified: branches/core4/src/util/StringUtils.cc
===================================================================
--- branches/core4/src/util/StringUtils.cc	2009-07-01 09:22:03 UTC (rev 3264)
+++ branches/core4/src/util/StringUtils.cc	2009-07-01 11:24:30 UTC (rev 3265)
@@ -43,7 +43,7 @@
 
     std::string getUniqueNumberString()
     {
-        return convertToString(getUniqueNumber());
+        return multi_cast<std::string>(getUniqueNumber());
     }
 
     /**




More information about the Orxonox-commit mailing list