Index: /orxonox/trunk/src/util/loading/load_param.cc
===================================================================
--- /orxonox/trunk/src/util/loading/load_param.cc	(revision 4622)
+++ /orxonox/trunk/src/util/loading/load_param.cc	(revision 4623)
@@ -27,5 +27,5 @@
    \param paramCount: how many parameters this loading-function takes
    \param multi: if false LoadParam assumes only one occurence of this parameter in root, if true it assumes multiple occurences.
-   \param ...: the parameter information
+   \param ...: the parameter information (1. Parameter, 2. Default Value for the Parameter, ...)
 */
 BaseLoadParam::BaseLoadParam(const TiXmlElement* root, BaseObject* object, const char* paramName,
@@ -55,24 +55,60 @@
   this->paramDesc = NULL;
   if (LoadClassDescription::parametersDescription)
-    {
+  {
+      //! \todo this must only be done once for each class.
       // locating the class
-      this->classDesc = LoadClassDescription::addClass(object->getClassName());
-      this->paramDesc = this->classDesc->addParam(paramName);
-
+    this->classDesc = LoadClassDescription::addClass(object->getClassName());
+
+    if ((this->paramDesc = this->classDesc->addParam(paramName)) != NULL)
+    {
+
+      this->paramDesc->paramCount = paramCount;
       this->paramDesc->types = new char*[paramCount];
-      this->paramDesc->paramCount = paramCount;
+      this->paramDesc->defaultValues = new char*[paramCount];
 
       va_list types;
       va_start (types, pointerToParam);
+      char defaultVal[512];
       for(int i = 0; i < paramCount; i++)
-        {
-          const char* tmpTypeName = va_arg (types, const char*);
-          this->paramDesc->types[i] = new char[strlen(tmpTypeName)+1];
-          strcpy(this->paramDesc->types[i], tmpTypeName);
-        }
+      {
+          // parameters parsed
+        const char* tmpTypeName = va_arg (types, const char*);
+        this->paramDesc->types[i] = new char[strlen(tmpTypeName)+1];
+        strcpy(this->paramDesc->types[i], tmpTypeName);
+
+          // default value description
+        if (!strcmp(tmpTypeName, l_INT_NAME))
+        {
+          sprintf(defaultVal, "%d", va_arg(types, l_INT_TYPE));
+        }
+        else if (!strcmp(tmpTypeName, l_LONG_NAME))
+        {
+          sprintf(defaultVal, "%0.3f", va_arg(types, l_LONG_TYPE));
+        }
+          /*          else if (!strcmp(tmpTypeName, l_SHORT_NAME))
+        {
+        sprintf(defaultVal, "%d", va_arg(types, l_SHORT_TYPE));
+      }*/
+        else if (!strcmp(tmpTypeName, l_FLOAT_NAME))
+        {
+          sprintf(defaultVal, "%0.3f", va_arg(types, double));
+        }
+        else if (!strcmp(tmpTypeName, l_STRING_NAME))
+        {
+          sprintf(defaultVal, "%s", va_arg(types, l_STRING_TYPE));
+        }
+        else if (!strcmp(tmpTypeName, l_XML_ELEM_NAME))
+        {
+          sprintf(defaultVal, "");
+        }
+
+        this->paramDesc->defaultValues[i] = new char[strlen(defaultVal)+1];
+        strcpy(this->paramDesc->defaultValues[i], defaultVal);
+      }
       va_end(types);
 
       int argCount = 0;
     }
+  }
 }
 
@@ -99,4 +135,5 @@
   this->paramName = new char[strlen(paramName)+1];
   strcpy(this->paramName, paramName);
+  this->defaultValues = NULL;
 }
 
@@ -107,8 +144,14 @@
 {
   for(int i = 0; i < this->paramCount; i++)
-    {
-      delete this->types[i];
-    }
+  {
+    delete this->types[i];
+  }
+  for(int i = 0; i < this->paramCount; i++)
+  {
+    delete this->defaultValues[i];
+  }
+
   delete []this->types;
+  delete []this->defaultValues;
   delete []this->paramName;
   delete []this->description;
@@ -139,4 +182,16 @@
   if (this->description)
     PRINT(3)(" -- %s", this->description);
+  // default values
+  if (this->paramCount > 0)
+  {
+      PRINT(3)(" (Default: ");
+    for (int i = 0; i < this->paramCount; i++)
+    {
+      if (i > 0)
+        PRINT(3)(", ");
+      PRINT(3)("%s", this->defaultValues[i]);
+    }
+    PRINT(3)(")");
+  }
   PRINT(3)("\n");
 }
Index: /orxonox/trunk/src/util/loading/load_param.h
===================================================================
--- /orxonox/trunk/src/util/loading/load_param.h	(revision 4622)
+++ /orxonox/trunk/src/util/loading/load_param.h	(revision 4623)
@@ -50,28 +50,38 @@
 */
 
-#define l_INT_TYPE       int                  //!< The type of an INT
-#define l_INT_FUNC       atoi                 //!< the function to call to parse INT
-#define l_INT_NAME       "int"                //!< the name of an INT
-
-#define l_LONG_TYPE      long                 //!< The type of a LONG
-#define l_LONG_FUNC      atol                 //!< The function to parse a LONG
-#define l_LONG_NAME      "long"               //!< The name of a LONG
-
-#define l_SHORT_TYPE     short                //!< The type of a SHORT
-#define l_SHORT_FUNC     atoi                 //!< The function to parse a SHORT
-#define l_SHORT_NAME     "short"              //!< The name of a SHORT
-
-#define l_FLOAT_TYPE     float                //!< The type of a FLOAT
-#define l_FLOAT_FUNC     atof                 //!< The function to parse a FLOAT
-#define l_FLOAT_NAME     "float"              //!< The name of a FLOAT
-
-#define l_STRING_TYPE    const char*          //!< The type of a STRING
-#define l_STRING_FUNC                         //!< The function to parse a STRING
-#define l_STRING_NAME    "string"             //!< The name of a STRING
-
-#define l_XML_ELEM_TYPE  const TiXmlElement*  //!< The type of an XML_ELEM
-#define l_XML_ELEM_FUNC                       //!< The function to parse an XML_ELEM
-#define l_XML_ELEM_NAME  "XML"                //!< The name of an XML_ELEM
-
+#define l_INT_TYPE         int                  //!< The type of an INT
+#define l_INT_FUNC         atoi                 //!< The function to call to parse INT
+#define l_INT_NAME         "int"                //!< The name of an INT
+#define l_INT_DEFAULT      0                    //!< a default Value for an INT
+
+#define l_LONG_TYPE        long                 //!< The type of a LONG
+#define l_LONG_FUNC        atol                 //!< The function to parse a LONG
+#define l_LONG_NAME        "long"               //!< The name of a LONG
+#define l_LONG_DEFAULT     0                    //!< a default Value for a LONG
+
+// #define l_SHORT_TYPE       short                //!< The type of a SHORT
+// #define l_SHORT_FUNC       atoi                 //!< The function to parse a SHORT
+// #define l_SHORT_NAME       "short"              //!< The name of a SHORT
+// #define l_SHORT_DEFAULT    0                    //!< a default Value for a SHORT
+
+#define l_FLOAT_TYPE       float                //!< The type of a FLOAT
+#define l_FLOAT_FUNC       atof                 //!< The function to parse a FLOAT
+#define l_FLOAT_NAME       "float"              //!< The name of a FLOAT
+#define l_FLOAT_DEFAULT    0.0                  //!< a default Value for a FLOAT
+
+#define l_STRING_TYPE      const char*          //!< The type of a STRING
+#define l_STRING_FUNC                           //!< The function to parse a STRING
+#define l_STRING_NAME      "string"             //!< The name of a STRING
+#define l_STRING_DEFAULT   ""                   //!< a default Value for an STRING
+
+#define l_XML_ELEM_TYPE    const TiXmlElement*  //!< The type of an XML_ELEM
+#define l_XML_ELEM_FUNC                         //!< The function to parse an XML_ELEM
+#define l_XML_ELEM_NAME    "XML"                //!< The name of an XML_ELEM
+#define l_XML_ELEM_DEFAULT NULL                 //!< The dafault Value for an XML_ELEM
+
+
+/*****************************************
+**** MACROS DEFINITIONS OF LOADABLES *****
+*****************************************/
 // 1. TYPE
 /**
@@ -80,6 +90,7 @@
 */
 #define LoadParam1(type1) \
- LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE), bool multi = false) \
-  : BaseLoadParam(root, pt2Object, paramName, 1, multi, NULL, type1##_NAME) \
+ LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE), \
+           bool multi = false, type1##_TYPE default1 = type1##_DEFAULT) \
+  : BaseLoadParam(root, pt2Object, paramName, 1, multi, NULL, type1##_NAME, default1) \
     { \
       if (loadString != NULL && root != NULL) \
@@ -97,6 +108,7 @@
 */
 #define LoadParam2(type1, type2) \
- LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE), bool multi = false) \
-  : BaseLoadParam(root, pt2Object, paramName, 2, multi, NULL, type1##_NAME, type2##_NAME) \
+ LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE), \
+           bool multi = false,  type1##_TYPE default1 = type1##_DEFAULT,  type2##_TYPE default2 = type2##_DEFAULT) \
+  : BaseLoadParam(root, pt2Object, paramName, 2, multi, NULL, type1##_NAME, default1, type2##_NAME, default2) \
     { \
       if (loadString != NULL && root != NULL) \
@@ -122,6 +134,7 @@
 */
 #define LoadParam3(type1, type2, type3) \
- LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE, type3##_TYPE), bool multi = false)\
-  : BaseLoadParam(root, pt2Object, paramName, 3, multi, NULL, type1##_NAME, type2##_NAME, type3##_NAME) \
+ LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE, type3##_TYPE), \
+           bool multi = false, type1##_TYPE default1 = type1##_DEFAULT, type2##_TYPE default2 = type2##_DEFAULT, type3##_TYPE default3 = type3##_DEFAULT)\
+  : BaseLoadParam(root, pt2Object, paramName, 3, multi, NULL, type1##_NAME, default1, type2##_NAME, default2, type3##_NAME, default3) \
     { \
       if (loadString != NULL && root != NULL) \
@@ -148,6 +161,9 @@
 */
 #define LoadParam4(type1, type2, type3, type4) \
- LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE, type3##_TYPE, type4##_TYPE), bool multi = false) \
-  : BaseLoadParam(root, pt2Object, paramName, 4, multi, NULL, type1##_NAME, type2##_NAME, type3##_NAME, type2##_NAME, type4##_NAME) \
+ LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE, type3##_TYPE, type4##_TYPE), \
+           bool multi = false, type1##_TYPE default1 = type1##_DEFAULT, type2##_TYPE default2 = type2##_DEFAULT, type3##_TYPE default3 = type3##_DEFAULT, \
+           type4##_TYPE default4 = type4##_DEFAULT) \
+  : BaseLoadParam(root, pt2Object, paramName, 4, multi, NULL, type1##_NAME, default1, type2##_NAME, default2, type3##_NAME, default3, \
+                  type4##_NAME, default4) \
     { \
       if (loadString != NULL && root != NULL) \
@@ -175,6 +191,10 @@
 */
 #define LoadParam5(type1, type2, type3, type4, type5) \
- LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE, type3##_TYPE, type4##_TYPE, type5##_TYPE), bool multi = false) \
-  : BaseLoadParam(root, pt2Object, paramName, 5, multi, NULL, type1##_NAME, type2##_NAME, type3##_NAME, type2##_NAME, type4##_NAME, type5##_NAME) \
+ LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, \
+           void(T::*function)(type1##_TYPE, type2##_TYPE, type3##_TYPE, type4##_TYPE, type5##_TYPE), \
+           bool multi = false, type1##_TYPE default1 = type1##_DEFAULT, type2##_TYPE default2 = type2##_DEFAULT, type3##_TYPE default3 = type3##_DEFAULT, \
+           type4##_TYPE default4 = type4, ##_DEFAULTtype5##_TYPE default5 = type5##_DEFAULT ) \
+  : BaseLoadParam(root, pt2Object, paramName, 5, multi, NULL, type1##_NAME, default1, type2##_NAME, default2, type3##_NAME, default3, \
+                  type4##_NAME, default4, type5##_NAME, default5) \
     { \
       if (loadString != NULL && root != NULL) \
@@ -221,8 +241,9 @@
   void print(void) const;
  private:
-  char*         paramName;             //!< The name of the parameter
-  int           paramCount;            //!< The count of parameters
+  char*         paramName;             //!< The name of the parameter.
+  int           paramCount;            //!< The count of parameters.
   char**        types;                 //!< What kind of parameters does this function take ??
-  char*         description;           //!< A longer description about this function
+  char*         description;           //!< A longer description about this function.
+  char**        defaultValues;         //!< The 'Default Values'.
 };
 
