Index: /orxonox/trunk/importer/array.cc
===================================================================
--- /orxonox/trunk/importer/array.cc	(revision 3194)
+++ /orxonox/trunk/importer/array.cc	(revision 3195)
@@ -21,5 +21,5 @@
 Array::Array ()
 {
-  initializeArray ();
+  this->initializeArray ();
 }
 
@@ -32,5 +32,5 @@
   if (verbose >= 2)
     printf("deleting array\n");
-  Entry* walker = firstEntry;
+  Entry* walker = this->firstEntry;
   Entry* previous;
   while (walker)
@@ -41,5 +41,5 @@
     }
   if (finalized)
-    delete []array;
+    delete []this->array;
 }
 
@@ -52,9 +52,9 @@
   if (verbose >= 2)
     printf ("crating new Array\n");
-  firstEntry = new Entry;
-  firstEntry->next =NULL;
-  currentEntry=firstEntry;
-  finalized = false;
-  entryCount = 0; //0 means one entry
+  this->firstEntry = new Entry;
+  this->firstEntry->next =NULL;
+  this->currentEntry=firstEntry;
+  this->finalized = false;
+  this->entryCount = 0; //0 means one entry
   return;
 }
@@ -69,13 +69,13 @@
     printf ("Finalizing array. Length: %i\n", entryCount);  
   //  if ((array = (GLfloat*)malloc( entryCount* sizeof(GLfloat))) == NULL)
-  if ((array = new GLfloat [entryCount]) == NULL)
-    printf ("could not allocate %i data Blocks\n", entryCount);
-  Entry* walker = firstEntry;
-  for (int i=0; i<entryCount; i++)
+  if ((this->array = new GLfloat [this->entryCount]) == NULL)
+    printf ("could not allocate %i data Blocks\n", this->entryCount);
+  Entry* walker = this->firstEntry;
+  for (int i=0; i<this->entryCount; i++)
     {
-      array[i] = walker->value;
+      this->array[i] = walker->value;
       walker = walker->next;
     }
-  finalized = true;
+  this->finalized = true;
 
   return;
@@ -88,14 +88,14 @@
 void Array::addEntry (GLfloat entry)
 {
-  if (!finalized)
+  if (!this->finalized)
     {
       if (verbose >= 3)
 	printf ("adding new Entry to Array: %f\n", entry);
       
-      currentEntry->value = entry;
-      currentEntry->next = new Entry;
-      currentEntry = currentEntry->next;
-      currentEntry->next = NULL;
-      ++entryCount;
+      this->currentEntry->value = entry;
+      this->currentEntry->next = new Entry;
+      this->currentEntry = currentEntry->next;
+      this->currentEntry->next = NULL;
+      ++this->entryCount;
     }
   else 
@@ -109,7 +109,7 @@
 void Array::addEntry (GLfloat entry0, GLfloat entry1, GLfloat entry2)
 {
-  addEntry (entry0);
-  addEntry (entry1);
-  addEntry (entry2);
+  this->addEntry (entry0);
+  this->addEntry (entry1);
+  this->addEntry (entry2);
 }
   
@@ -120,5 +120,5 @@
 GLfloat* Array::getArray ()
 {
-  return array;
+  return this->array;
 }
 
@@ -128,5 +128,5 @@
 int Array::getCount()
 {
-  return entryCount;
+  return this->entryCount;
 }
 
@@ -136,4 +136,4 @@
 void Array::debug ()
 {
-  printf ("entryCount=%i, address=%p\n", entryCount, array);
+  printf ("entryCount=%i, address=%p\n", this->entryCount, this->array);
 }
Index: /orxonox/trunk/importer/material.cc
===================================================================
--- /orxonox/trunk/importer/material.cc	(revision 3194)
+++ /orxonox/trunk/importer/material.cc	(revision 3195)
@@ -36,6 +36,6 @@
 PathList::PathList()
 {
-  pathName = NULL;
-  next = NULL;
+  this->pathName = NULL;
+  this->next = NULL;
 }
 
@@ -48,7 +48,7 @@
 PathList::PathList(char* pName)
 {
-  pathName = new char [strlen(pName)+1];
-  strcpy (pathName, pName);
-  next = NULL;
+  this->pathName = new char [strlen(pName)+1];
+  strcpy (this->pathName, pName);
+  this->next = NULL;
 }
 
@@ -60,8 +60,8 @@
 PathList::~PathList()
 {
-  if (pathName)
-    delete []pathName;
-  if (next)
-    delete next;
+  if (this->pathName)
+    delete []this->pathName;
+  if (this->next)
+    delete this->next;
 }
 
@@ -114,7 +114,7 @@
 Material::Material()
 {
-  init();
-  
-  setName ("");
+  this->init();
+  
+  this->setName ("");
 }
 
@@ -125,7 +125,7 @@
 Material::Material (char* mtlName)
 {
-  init();
-  
-  setName (mtlName);
+  this->init();
+  
+  this->setName (mtlName);
 }
 
@@ -136,11 +136,11 @@
 {
   if (verbose >= 2)
-    printf ("delete Material %s.\n", name);
-  if (name)
-    delete []name;
-  if (diffuseTextureSet)
-    glDeleteTextures (1, &diffuseTexture);
-  if (nextMat)
-    delete nextMat;
+    printf ("delete Material %s.\n", this->name);
+  if (this->name)
+    delete []this->name;
+  if (this->diffuseTextureSet)
+    glDeleteTextures (1, &this->diffuseTexture);
+  if (this->nextMat)
+    delete this->nextMat;
 }
 
@@ -171,20 +171,20 @@
   if (verbose >= 3)
     printf ("initializing new Material.\n");
-  nextMat = NULL;
-  name ="";
-  setIllum(1);
-  setDiffuse(0,0,0);
-  setAmbient(0,0,0);
-  setSpecular(.5,.5,.5);
-  setShininess(2.0);
-  setTransparency(0.0);
-
-  if (!pathList)
-    pathList = new PathList("");
-
-
-  diffuseTextureSet = false;
-  ambientTextureSet = false;
-  specularTextureSet = false;
+  this->nextMat = NULL;
+  this->name ="";
+  this->setIllum(1);
+  this->setDiffuse(0,0,0);
+  this->setAmbient(0,0,0);
+  this->setSpecular(.5,.5,.5);
+  this->setShininess(2.0);
+  this->setTransparency(0.0);
+
+  if (!this->pathList)
+    this->pathList = new PathList("");
+
+
+  this->diffuseTextureSet = false;
+  this->ambientTextureSet = false;
+  this->specularTextureSet = false;
 
   
@@ -227,23 +227,23 @@
   // setting diffuse color
   //  glColor3f (diffuse[0], diffuse[1], diffuse[2]);
-  glMaterialfv(GL_FRONT, GL_DIFFUSE, diffuse);
+  glMaterialfv(GL_FRONT, GL_DIFFUSE, this->diffuse);
 
   // setting ambient color
-  glMaterialfv(GL_FRONT, GL_AMBIENT, ambient);
+  glMaterialfv(GL_FRONT, GL_AMBIENT, this->ambient);
 
   // setting up Sprecular
-  glMaterialfv(GL_FRONT, GL_SPECULAR, specular);
+  glMaterialfv(GL_FRONT, GL_SPECULAR, this->specular);
 
   // setting up Shininess
-  glMaterialf(GL_FRONT, GL_SHININESS, shininess);
+  glMaterialf(GL_FRONT, GL_SHININESS, this->shininess);
   
   // setting illumination Model 
-  if (illumModel == 1)
+  if (this->illumModel == 1) //! \todo make this work, if no vertex-normals are read.
     glShadeModel(GL_FLAT);
-  else if (illumModel >= 2)
+  else if (this->illumModel >= 2)
     glShadeModel(GL_SMOOTH);
 
-  if (diffuseTextureSet)
-    glBindTexture(GL_TEXTURE_2D, diffuseTexture);
+  if (this->diffuseTextureSet)
+    glBindTexture(GL_TEXTURE_2D, this->diffuseTexture);
   else
     glBindTexture(GL_TEXTURE_2D, 0);
@@ -258,8 +258,8 @@
 void Material::setName (char* mtlName)
 {
-  name = new char [strlen(mtlName)+1];
-  strcpy(name, mtlName);
+  this->name = new char [strlen(mtlName)+1];
+  strcpy(this->name, mtlName);
   if (verbose >= 3)
-    printf("setting Material Name to %s.\n", name);
+    printf("setting Material Name to %s.\n", this->name);
 
   //  printf ("adding new Material: %s, %p\n", this->getName(), this);
@@ -271,5 +271,5 @@
 char* Material::getName (void)
 {
-  return name;
+  return this->name;
 }
 
@@ -281,6 +281,6 @@
 {
   if (verbose >= 3)
-    printf("setting illumModel of Material %s to %i\n", name, illum);
-  illumModel = illum;
+    printf("setting illumModel of Material %s to %i\n", this->name, illum);
+  this->illumModel = illum;
   //  printf ("setting illumModel to: %i\n", illumModel);
 }
@@ -290,5 +290,5 @@
 */void Material::setIllum (char* illum)
 {
-  setIllum (atoi(illum));
+  this->setIllum (atoi(illum));
 }
 
@@ -302,9 +302,9 @@
 {
   if (verbose >= 3)
-    printf ("setting Diffuse Color of Material %s to r=%f g=%f b=%f.\n", name, r, g, b);
-  diffuse[0] = r;
-  diffuse[1] = g;
-  diffuse[2] = b;  
-  diffuse[3] = 1.0;
+    printf ("setting Diffuse Color of Material %s to r=%f g=%f b=%f.\n", this->name, r, g, b);
+  this->diffuse[0] = r;
+  this->diffuse[1] = g;
+  this->diffuse[2] = b;  
+  this->diffuse[3] = 1.0;
 
 }
@@ -317,5 +317,5 @@
   float r,g,b;
   sscanf (rgb, "%f %f %f", &r, &g, &b);
-  setDiffuse (r, g, b);
+  this->setDiffuse (r, g, b);
 }
 
@@ -329,9 +329,9 @@
 {
   if (verbose >=3)
-    printf ("setting Ambient Color of Material %s to r=%f g=%f b=%f.\n", name, r, g, b);
-  ambient[0] = r;
-  ambient[1] = g;
-  ambient[2] = b;
-  ambient[3] = 1.0;
+    printf ("setting Ambient Color of Material %s to r=%f g=%f b=%f.\n", this->name, r, g, b);
+  this->ambient[0] = r;
+  this->ambient[1] = g;
+  this->ambient[2] = b;
+  this->ambient[3] = 1.0;
 }
 /**
@@ -343,5 +343,5 @@
   float r,g,b;
   sscanf (rgb, "%f %f %f", &r, &g, &b);
-  setAmbient (r, g, b);
+  this->setAmbient (r, g, b);
 }
 
@@ -355,9 +355,9 @@
 {
   if (verbose >= 3)
-    printf ("setting Specular Color of Material %s to r=%f g=%f b=%f.\n", name, r, g, b);
-  specular[0] = r;
-  specular[1] = g;
-  specular[2] = b;
-  specular[3] = 1.0;
+    printf ("setting Specular Color of Material %s to r=%f g=%f b=%f.\n", this->name, r, g, b);
+  this->specular[0] = r;
+  this->specular[1] = g;
+  this->specular[2] = b;
+  this->specular[3] = 1.0;
  }
 /**
@@ -369,5 +369,5 @@
   float r,g,b;
   sscanf (rgb, "%f %f %f", &r, &g, &b);
-  setSpecular (r, g, b);
+  this->setSpecular (r, g, b);
 }
 
@@ -378,5 +378,5 @@
 void Material::setShininess (float shini)
 {
-  shininess = shini;
+  this->shininess = shini;
 }
 /**
@@ -386,5 +386,5 @@
 void Material::setShininess (char* shini)
 {
-  setShininess (atof(shini));
+  this->setShininess (atof(shini));
 }
 
@@ -396,6 +396,6 @@
 {
   if (verbose >= 3)
-    printf ("setting Transparency of Material %s to %f.\n", name, trans);
-  transparency = trans;
+    printf ("setting Transparency of Material %s to %f.\n", this->name, trans);
+  this->transparency = trans;
 }
 /**
@@ -405,5 +405,5 @@
 void Material::setTransparency (char* trans)
 {
-  setTransparency (atof(trans));
+  this->setTransparency (atof(trans));
 }
 
@@ -414,5 +414,5 @@
 void Material::addTexturePath(char* pathName)
 {
-  pathList->addPath (pathName);
+  this->pathList->addPath (pathName);
 }
 
@@ -464,5 +464,5 @@
 
   //  diffuseTextureSet = loadBMP(dMap, &diffuseTexture);
-  diffuseTextureSet = loadImage(dMap, &diffuseTexture);
+  this->diffuseTextureSet = this->loadImage(dMap, &this->diffuseTexture);
 
 }
@@ -471,4 +471,5 @@
    \brief Sets the Materials Ambient Map
    \param aMap the Name of the Image to Use
+   \todo implement this
 */
 void Material::setAmbientMap(char* aMap)
@@ -481,4 +482,5 @@
    \brief Sets the Materials Specular Map
    \param sMap the Name of the Image to Use
+   \todo implement this
 */
 void Material::setSpecularMap(char* sMap)
@@ -491,4 +493,5 @@
    \brief Sets the Materials Bumpiness
    \param bump the Name of the Image to Use
+   \todo implemet this
 */
 void Material::setBump(char* bump)
@@ -544,5 +547,5 @@
 	    pImage->data[i+2] = temp;
 	  }
-      loadTexToGL (pImage, texture);
+      this->loadTexToGL (pImage, texture);
     }
   else
@@ -570,5 +573,5 @@
 	  if (verbose >=2)
 	    printf ("Requested bmp-image. Trying to Import.\n");
-	  return loadBMP(imgNameWithPath, texture);
+	  return this->loadBMP(imgNameWithPath, texture);
 	}
       
@@ -577,5 +580,5 @@
 	  if (verbose >=2)
 	    printf ("Requested jpeg-image. Trying to Import\n");
-	  return loadJPG(imgNameWithPath, texture);
+	  return this->loadJPG(imgNameWithPath, texture);
 	}
       else if (!strncmp(imgNameWithPath+strlen(imgNameWithPath)-4, ".tga", 4))
@@ -583,5 +586,5 @@
 	  if (verbose >=2)
 	    printf ("Requested tga-image. Trying to Import\n");
-	  return loadTGA(imgNameWithPath, texture);
+	  return this->loadTGA(imgNameWithPath, texture);
 	}
       else if (!strncmp(imgNameWithPath+strlen(imgNameWithPath)-4, ".png", 4))
@@ -589,5 +592,5 @@
 	  if (verbose >=2)
 	    printf ("Requested png-image. Trying to Import\n");
-	  return loadPNG(imgNameWithPath, texture);
+	  return this->loadPNG(imgNameWithPath, texture);
 	}
       else
@@ -704,7 +707,6 @@
       pImage->data[i+2] = temp;
     }
-  loadTexToGL (pImage, texture);
-  
-  return true;
+  this->loadTexToGL (pImage, texture);
+  
 
   if (pImage)
@@ -717,4 +719,5 @@
       free(pImage);
     }
+  return true;
 
 }
@@ -802,5 +805,5 @@
     exit(0);
   
-  loadTexToGL (pImage, texture);
+  this->loadTexToGL (pImage, texture);
   if (pImage)
     {
@@ -947,5 +950,5 @@
     }
   
-  loadTexToGL (pImage, texture);
+  this->loadTexToGL (pImage, texture);
 
   return true;
@@ -1130,5 +1133,5 @@
   while(currentpixel < pixelcount);	// Loop while there are still pixels left
 
-  loadTexToGL (pImage, texture);
+  this->loadTexToGL (pImage, texture);
 
   return true;
@@ -1265,5 +1268,5 @@
     }
   */
-  loadTexToGL (pImage, texture);  
+  this->loadTexToGL (pImage, texture);  
   
   free(pImage->data);
Index: /orxonox/trunk/importer/object.cc
===================================================================
--- /orxonox/trunk/importer/object.cc	(revision 3194)
+++ /orxonox/trunk/importer/object.cc	(revision 3195)
@@ -25,11 +25,11 @@
 {
 
-  initialize();
-
-  BoxObject();
-
-  importToGL ();
-
-  cleanup();
+  this->initialize();
+
+  this->BoxObject();
+
+  this->importToGL ();
+
+  this->cleanup();
 }
 
@@ -40,11 +40,11 @@
 Object::Object(char* fileName)
 {
-  initialize();
-
-  importFile (fileName);
-
-  importToGL ();
-
-  cleanup();
+  this->initialize();
+
+  this->importFile (fileName);
+
+  this->importToGL ();
+
+  this->cleanup();
 }
 
@@ -56,12 +56,12 @@
 Object::Object(char* fileName, float scaling)
 {
-  initialize();
-  scaleFactor = scaling;
-
-  importFile (fileName);
-
-  importToGL ();
-
-  cleanup();
+  this->initialize();
+  this->scaleFactor = scaling;
+
+  this->importFile (fileName);
+
+  this->importToGL ();
+
+  this->cleanup();
 }
 
@@ -75,5 +75,5 @@
   if (verbose >= 2)
     printf ("Deleting display Lists.\n");
-  Group* walker = firstGroup;
+  Group* walker = this->firstGroup;
   while (walker != NULL)
     {
@@ -84,15 +84,15 @@
     }
 
-  if (objPath)
-    delete []objPath;
-  if (objFileName)
-    delete []objFileName;
-  if (mtlFileName)
-    delete []mtlFileName;
+  if (this->objPath)
+    delete []this->objPath;
+  if (this->objFileName)
+    delete []this->objFileName;
+  if (this->mtlFileName)
+    delete []this->mtlFileName;
 
   if (verbose >=2)
     printf("Deleting Materials.\n");
-  if (material)
-    delete material;
+  if (this->material)
+    delete this->material;
 }
 
@@ -106,5 +106,5 @@
   if (verbose >=2)
     printf("drawing the 3D-Objects\n"); 
-  Group* walker = firstGroup;
+  Group* walker = this->firstGroup;
   while (walker != NULL)
     {
@@ -124,13 +124,13 @@
 void Object::draw (int groupNumber) const 
 {
-  if (groupNumber >= groupCount)
+  if (groupNumber >= this->groupCount)
     {
       if (verbose>=1)
-	printf ("You requested object number %i, but this File only contains of %i Objects.\n", groupNumber-1, groupCount);
+	printf ("You requested object number %i, but this File only contains of %i Objects.\n", groupNumber-1, this->groupCount);
       return;
     }
   if (verbose >=2)
     printf("drawing the requested 3D-Objects if found.\n"); 
-  Group* walker = firstGroup;
+  Group* walker = this->firstGroup;
   int counter = 0;
   while (walker != NULL)
@@ -147,5 +147,5 @@
     }
   if (verbose >= 1)
-    printf("Object number %i in %s not Found.\n", groupNumber, objFileName);
+    printf("Object number %i in %s not Found.\n", groupNumber, this->objFileName);
   return;
 
@@ -162,5 +162,5 @@
   if (verbose >=2)
     printf("drawing the requested 3D-Objects if found.\n"); 
-  Group* walker = firstGroup;
+  Group* walker = this->firstGroup;
   while (walker != NULL)
     {
@@ -175,5 +175,5 @@
     }
   if (verbose >= 2)
-    printf("Object Named %s in %s not Found.\n", groupName, objFileName);
+    printf("Object Named %s in %s not Found.\n", groupName, this->objFileName);
   return;
 }
@@ -184,5 +184,5 @@
 int Object::getGroupCount (void) const
 {
-  return groupCount;
+  return this->groupCount;
 }
 
@@ -199,18 +199,18 @@
 
   // setting the start group;
-  firstGroup = new Group;
-  currentGroup = firstGroup;
-  groupCount = 0;
+  this->firstGroup = new Group;
+  this->currentGroup = this->firstGroup;
+  this->groupCount = 0;
   
-  initGroup (firstGroup);
-  objPath = NULL;
-  objFileName = NULL;
-  mtlFileName = NULL;
-  scaleFactor = 1;
-  material = new Material();
-
-  vertices = new Array();
-  vTexture = new Array();
-  normals = new Array();
+  this->initGroup (this->currentGroup);
+  this->objPath = NULL;
+  this->objFileName = NULL;
+  this->mtlFileName = NULL;
+  this->scaleFactor = 1;
+  this->material = new Material();
+
+  this->vertices = new Array();
+  this->vTexture = new Array();
+  this->normals = new Array();
 
   return true;
@@ -233,5 +233,5 @@
 
   group->firstFace = new Face;
-  initFace (group->firstFace);
+  this->initFace (group->firstFace);
   group->currentFace = group->firstFace;
 }
@@ -263,12 +263,12 @@
     printf("cleaning up the 3D-Object to save Memory.\n");
 
-  if (vertices != NULL)
-    delete vertices;
-  if (vTexture != NULL)
-    delete vTexture;
-  if (normals != NULL)
-    delete normals;
-
-  cleanupGroup(firstGroup);
+  if (this->vertices)
+    delete this->vertices;
+  if (this->vTexture)
+    delete this->vTexture;
+  if (this->normals)
+    delete this->normals;
+
+  this->cleanupGroup(this->firstGroup);
   return true; 
 }
@@ -306,5 +306,5 @@
   if (face->firstElem != NULL)
     {
-      cleanupFaceElement(face->firstElem);
+      this->cleanupFaceElement(face->firstElem);
       delete face->firstElem;
     }
@@ -312,5 +312,5 @@
   if (face->next != NULL)
     {
-      cleanupFace (face->next);
+      this->cleanupFace (face->next);
       delete face->next;
     }
@@ -327,5 +327,5 @@
   if (faceElem->next != NULL)
     {
-      cleanupFaceElement (faceElem->next);
+      this->cleanupFaceElement (faceElem->next);
       delete faceElem->next;
     }
@@ -357,7 +357,7 @@
       name = tmpName+1;
     }
-  objPath = new char[name-fileName];
-  strncpy(objPath, fileName, name-fileName);
-  objPath[name-fileName] = '\0';
+  this->objPath = new char[name-fileName];
+  strncpy(this->objPath, fileName, name-fileName);
+  this->objPath[name-fileName] = '\0';
   if (verbose >=2)
     if (strlen(objPath)> 0)
@@ -368,8 +368,8 @@
       printf("Resolved file %s.\n", name);
   
-  if (material)
-    material->addTexturePath(objPath);
-  objFileName = new char[strlen(name)+1];
-  strcpy (objFileName, name);
+  if (this->material)
+    this->material->addTexturePath(this->objPath);
+  this->objFileName = new char[strlen(name)+1];
+  strcpy (this->objFileName, name);
   this->readFromObjFile ();
   return true;
@@ -383,8 +383,8 @@
 {
   char* fileName = new char [strlen(objPath)+strlen(objFileName)+1];
-  if (objFileName != NULL && !strcmp(objFileName, ""))
+  if (this->objFileName != NULL && !strcmp(this->objFileName, ""))
     return false;
-  strcpy(fileName, objPath);
-  strcat(fileName, objFileName);
+  strcpy(fileName, this->objPath);
+  strcat(fileName, this->objFileName);
 
   ifstream* OBJ_FILE = new ifstream(fileName);
@@ -394,6 +394,7 @@
 	printf ("unable to open .OBJ file: %s\n Loading Box Object instead.\n", fileName);
       BoxObject();
+      OBJ_FILE->close();
       delete []fileName;
-      OBJ_FILE->close();
+      delete OBJ_FILE;
       return false;
     }
@@ -405,5 +406,5 @@
       OBJ_FILE->getline(Buffer, 10000);
       if (verbose >=4)
-	printf ("Read input line: %s\n",Buffer);
+	printf ("Read input line: %s\n", Buffer);
       
 
@@ -411,5 +412,5 @@
       if (!strncmp(Buffer, "v ", 2))
 	{
-	  readVertex(Buffer+2);
+	  this->readVertex(Buffer+2);
 	}
 
@@ -417,34 +418,34 @@
       else if (!strncmp(Buffer, "f ", 2))
 	{
-	  readFace (Buffer+2);
+	  this->readFace (Buffer+2);
 	}
       
       else if (!strncmp(Buffer, "mtllib ", 7))
 	{
-	  readMtlLib (Buffer+7);
+	  this->readMtlLib (Buffer+7);
 	}
 
       else if (!strncmp(Buffer, "usemtl ", 7))
 	{
-	  readUseMtl (Buffer+7);
+	  this->readUseMtl (Buffer+7);
 	}
 
       // case VertexNormal
       else if (!strncmp(Buffer, "vn ", 3))
-      {
-	readVertexNormal(Buffer+3);
-      }
-
+	{
+	  this->readVertexNormal(Buffer+3);
+	}
+      
       // case VertexTextureCoordinate
       else if (!strncmp(Buffer, "vt ", 3))
-      {
-	readVertexTexture(Buffer+3);
-      }
+	{
+	  this->readVertexTexture(Buffer+3);
+	}
       // case group
       else if (!strncmp(Buffer, "g ", 2))
 	{
-	  readGroup (Buffer+2);
-	}
-      else if (!strncmp(Buffer, "s ", 2))
+	  this->readGroup (Buffer+2);
+	}
+      else if (!strncmp(Buffer, "s ", 2)) //! \todo smoothing groups have to be implemented
 	{
 	  if (verbose >= 2)
@@ -453,4 +454,5 @@
     }
   OBJ_FILE->close();
+  delete OBJ_FILE;
   delete []fileName;
   return true;
@@ -469,17 +471,17 @@
   if (verbose >=3)
     printf ("Read Group: %s.\n", groupString);
-  if (groupCount != 0 && currentGroup->faceCount>0)
+  if (this->groupCount != 0 && this->currentGroup->faceCount>0)
     {
       //      finalizeGroup(currentGroup);
-      currentGroup = currentGroup->next = new Group;
-      initGroup(currentGroup);
+      this->currentGroup = this->currentGroup->next = new Group;
+      this->initGroup(this->currentGroup);
     }
   // setting the group name if not default.
   if (strcmp(groupString, "default"))
     {
-      currentGroup->name = new char [strlen(groupString)+1];
-      strcpy(currentGroup->name, groupString);
-    }
-  ++groupCount;
+      this->currentGroup->name = new char [strlen(groupString)+1];
+      strcpy(this->currentGroup->name, groupString);
+    }
+  ++this->groupCount;
 
 }
@@ -499,5 +501,5 @@
   if (verbose >= 3)
     printf ("reading in a vertex: %f %f %f\n", &subbuffer1, &subbuffer2, &subbuffer3);
-  vertices->addEntry(subbuffer1*scaleFactor, subbuffer2*scaleFactor, subbuffer3*scaleFactor);
+  this->vertices->addEntry(subbuffer1*scaleFactor, subbuffer2*scaleFactor, subbuffer3*scaleFactor);
   return true;
 }
@@ -512,13 +514,13 @@
 bool Object::readFace (char* faceString)
 {
-  if (currentGroup->faceCount >0)
-    currentGroup->currentFace = currentGroup->currentFace->next = new Face;
-  initFace (currentGroup->currentFace);
-
-  FaceElement* tmpElem = currentGroup->currentFace->firstElem = new FaceElement;
+  if (this->currentGroup->faceCount >0)
+    this->currentGroup->currentFace = this->currentGroup->currentFace->next = new Face;
+  this->initFace (this->currentGroup->currentFace);
+
+  FaceElement* tmpElem = this->currentGroup->currentFace->firstElem = new FaceElement;
   tmpElem->next = NULL;
   while(strcmp (faceString, "\0"))
     {
-      if (currentGroup->currentFace->vertexCount>0)
+      if (this->currentGroup->currentFace->vertexCount>0)
 	  tmpElem = tmpElem->next = new FaceElement;
       tmpElem->next = NULL;
@@ -561,8 +563,8 @@
       if (strcmp (faceString, "\0"))
 	faceString++;
-      currentGroup->currentFace->vertexCount++;
-    }
-
-  currentGroup->faceCount += currentGroup->currentFace->vertexCount -2;
+      this->currentGroup->currentFace->vertexCount++;
+    }
+
+  this->currentGroup->faceCount += this->currentGroup->currentFace->vertexCount -2;
 }
 
@@ -581,5 +583,5 @@
   if (verbose >=3 )
     printf("found vertex-Normal %f, %f, %f\n", &subbuffer1,&subbuffer2,&subbuffer3);
-  normals->addEntry(subbuffer1, subbuffer2, subbuffer3);
+  this->normals->addEntry(subbuffer1, subbuffer2, subbuffer3);
   return true;
 }
@@ -599,6 +601,6 @@
   if (verbose >=3 )
     printf("found vertex-Texture %f, %f\n", &subbuffer1, &subbuffer2);
-  vTexture->addEntry(subbuffer1);
-  vTexture->addEntry(subbuffer2);
+  this->vTexture->addEntry(subbuffer1);
+  this->vTexture->addEntry(subbuffer2);
   return true;
 }
@@ -615,9 +617,9 @@
 bool Object::readMtlLib (char* mtlFile)
 {
-  mtlFileName = new char [strlen(mtlFile)+1];
-  strcpy(mtlFileName, mtlFile);
-  char* fileName = new char [strlen(objPath) + strlen(mtlFileName)+1];
-  strcpy(fileName, objPath);
-  strcat(fileName, mtlFileName);
+  this->mtlFileName = new char [strlen(mtlFile)+1];
+  strcpy(this->mtlFileName, mtlFile);
+  char* fileName = new char [strlen(objPath) + strlen(this->mtlFileName)+1];
+  strcpy(fileName, this->objPath);
+  strcat(fileName, this->mtlFileName);
   
 
@@ -630,6 +632,7 @@
       if (verbose >= 1)
 	printf ("unable to open file: %s\n", fileName);
+      MTL_FILE->close();
       delete []fileName;
-      MTL_FILE->close();
+      delete MTL_FILE;
       return false;
     }
@@ -704,5 +707,7 @@
 
     }
+  MTL_FILE->close();
   delete []fileName;
+  delete MTL_FILE;
   return true;
 }
@@ -714,5 +719,5 @@
 bool Object::readUseMtl (char* matString)
 {
-  if (!mtlFileName)
+  if (!this->mtlFileName)
     {
       if (verbose >= 1)
@@ -721,13 +726,13 @@
     }
       
-  if (currentGroup->faceCount >0)
-    currentGroup->currentFace = currentGroup->currentFace->next = new Face;
-  initFace (currentGroup->currentFace);
+  if (this->currentGroup->faceCount >0)
+    this->currentGroup->currentFace = this->currentGroup->currentFace->next = new Face;
+  this->initFace (this->currentGroup->currentFace);
   
-  currentGroup->currentFace->materialString = new char[strlen(matString)+1];
-  strcpy (currentGroup->currentFace->materialString, matString);
+  this->currentGroup->currentFace->materialString = new char[strlen(matString)+1];
+  strcpy (this->currentGroup->currentFace->materialString, matString);
   
-  if (currentGroup->faceCount == 0)
-    currentGroup->faceCount ++;
+  if (this->currentGroup->faceCount == 0)
+    this->currentGroup->faceCount ++;
 
 }
@@ -740,32 +745,32 @@
 
   // finalize the Arrays
-  vertices->finalizeArray();
-  vTexture->finalizeArray();
+  this->vertices->finalizeArray();
+  this->vTexture->finalizeArray();
   if (normals->getCount() == 0) // vertices-Array must be uilt for this
-    buildVertexNormals();
-  normals->finalizeArray();
-
-  currentGroup = firstGroup;
-
-  while (currentGroup != NULL)
+    this->buildVertexNormals();
+  this->normals->finalizeArray();
+
+  this->currentGroup = this->firstGroup;
+
+  while (this->currentGroup != NULL)
     {
 
       // creating a glList for the Group
-      if ((currentGroup->listNumber = glGenLists(1)) == 0)
+      if ((this->currentGroup->listNumber = glGenLists(1)) == 0)
 	{
 	  printf ("list could not be created for this Object\n");
 	  return false;
 	}
-      glNewList (currentGroup->listNumber, GL_COMPILE);
+      glNewList (this->currentGroup->listNumber, GL_COMPILE);
 
       // Putting Faces to GL
-      Face* tmpFace = currentGroup->firstFace;
+      Face* tmpFace = this->currentGroup->firstFace;
       while (tmpFace != NULL)
 	{
 	  if (tmpFace->vertexCount == 0 && tmpFace->materialString != NULL)
 	    {
-	      if (currentGroup->faceMode != -1)
+	      if (this->currentGroup->faceMode != -1)
 		glEnd();
-	      currentGroup->faceMode = 0;
+	      this->currentGroup->faceMode = 0;
 	      if (verbose >= 2)
 		printf ("using material %s for coming Faces.\n", tmpFace->materialString);
@@ -778,12 +783,12 @@
 	  else if (tmpFace->vertexCount == 3)
 	    {
-	      if (currentGroup->faceMode != 3)
+	      if (this->currentGroup->faceMode != 3)
 		{
-		  if (currentGroup->faceMode != -1)
+		  if (this->currentGroup->faceMode != -1)
 		    glEnd();
 		  glBegin(GL_TRIANGLES);
 		}
 	      
-	      currentGroup->faceMode = 3;
+	      this->currentGroup->faceMode = 3;
 	      if (verbose >=3)
 		printf ("found triag.\n");
@@ -792,11 +797,11 @@
 	  else if (tmpFace->vertexCount == 4)
 	    {
-	      if (currentGroup->faceMode != 4)
+	      if (this->currentGroup->faceMode != 4)
 		{
-		  if (currentGroup->faceMode != -1)
+		  if (this->currentGroup->faceMode != -1)
 		    glEnd();
 		  glBegin(GL_QUADS);
 		}
-	      currentGroup->faceMode = 4;
+	      this->currentGroup->faceMode = 4;
 	      if (verbose >=3 )
 		printf ("found quad.\n");
@@ -805,10 +810,10 @@
 	  else if (tmpFace->vertexCount > 4)
 	    {
-	      if (currentGroup->faceMode != -1)
+	      if (this->currentGroup->faceMode != -1)
 		glEnd();
 	      glBegin(GL_POLYGON);
 	      if (verbose >=3)
 		printf ("Polygon with %i faces found.", tmpFace->vertexCount);
-	      currentGroup->faceMode = tmpFace->vertexCount;
+	      this->currentGroup->faceMode = tmpFace->vertexCount;
 	    }
 	  
@@ -817,5 +822,5 @@
 	    {
 	      //      printf ("%s\n", tmpElem->value);
-	      addGLElement(tmpElem);
+	      this->addGLElement(tmpElem);
 	      tmpElem = tmpElem->next;
 	    }
@@ -824,5 +829,6 @@
       glEnd();
       glEndList();
-      currentGroup = currentGroup->next;
+
+      this->currentGroup = this->currentGroup->next;
     } 
 }
@@ -844,9 +850,9 @@
 
   if (elem->texCoordNumber != -1)
-    glTexCoord2fv(vTexture->getArray() + elem->texCoordNumber * 2);
+    glTexCoord2fv(this->vTexture->getArray() + elem->texCoordNumber * 2);
   if (elem->normalNumber != -1)
-    glNormal3fv(normals->getArray() + elem->normalNumber * 3);
+    glNormal3fv(this->normals->getArray() + elem->normalNumber * 3);
   if (elem->vertexNumber != -1)
-    glVertex3fv(vertices->getArray() + elem->vertexNumber * 3);
+    glVertex3fv(this->vertices->getArray() + elem->vertexNumber * 3);
 
 }
@@ -925,5 +931,5 @@
 	printf ("Found Normale number %d: (%f; %f, %f).\n", i, normArray[i].x, normArray[i].y, normArray[i].z);
 
-      normals->addEntry(normArray[i].x, normArray[i].y, normArray[i].z);
+      this->normals->addEntry(normArray[i].x, normArray[i].y, normArray[i].z);
 
     }
@@ -940,68 +946,68 @@
 void Object::BoxObject(void)
 {
-  readVertex ("-0.5 -0.5 0.5");
-  readVertex ("0.5 -0.5 0.5");
-  readVertex ("-0.5 0.5 0.5");
-  readVertex ("0.5 0.5 0.5");
-  readVertex ("-0.5 0.5 -0.5");
-  readVertex ("0.5 0.5 -0.5");
-  readVertex ("-0.5 -0.5 -0.5");
-  readVertex ("0.5 -0.5 -0.5");
-
-  readVertexTexture ("0.0 0.0");
-  readVertexTexture ("1.0 0.0");
-  readVertexTexture ("0.0 1.0");
-  readVertexTexture ("1.0 1.0");
-  readVertexTexture ("0.0 2.0");
-  readVertexTexture ("1.0 2.0");
-  readVertexTexture ("0.0 3.0");
-  readVertexTexture ("1.0 3.0");
-  readVertexTexture ("0.0 4.0");
-  readVertexTexture ("1.0 4.0");
-  readVertexTexture ("2.0 0.0");
-  readVertexTexture ("2.0 1.0");
-  readVertexTexture ("-1.0 0.0");
-  readVertexTexture ("-1.0 1.0");
-
-  readVertexNormal ("0.0 0.0 1.0");
-  readVertexNormal ("0.0 0.0 1.0");
-  readVertexNormal ("0.0 0.0 1.0");
-  readVertexNormal ("0.0 0.0 1.0");
-  readVertexNormal ("0.0 1.0 0.0");
-  readVertexNormal ("0.0 1.0 0.0");
-  readVertexNormal ("0.0 1.0 0.0");
-  readVertexNormal ("0.0 1.0 0.0");
-  readVertexNormal ("0.0 0.0 -1.0");
-  readVertexNormal ("0.0 0.0 -1.0");
-  readVertexNormal ("0.0 0.0 -1.0");
-  readVertexNormal ("0.0 0.0 -1.0");
-  readVertexNormal ("0.0 -1.0 0.0");
-  readVertexNormal ("0.0 -1.0 0.0");
-  readVertexNormal ("0.0 -1.0 0.0");
-  readVertexNormal ("0.0 -1.0 0.0");
-  readVertexNormal ("1.0 0.0 0.0");
-  readVertexNormal ("1.0 0.0 0.0");
-  readVertexNormal ("1.0 0.0 0.0");
-  readVertexNormal ("1.0 0.0 0.0");
-  readVertexNormal ("-1.0 0.0 0.0");
-  readVertexNormal ("-1.0 0.0 0.0");
-  readVertexNormal ("-1.0 0.0 0.0");
-  readVertexNormal ("-1.0 0.0 0.0");
+  this->readVertex ("-0.5 -0.5 0.5");
+  this->readVertex ("0.5 -0.5 0.5");
+  this->readVertex ("-0.5 0.5 0.5");
+  this->readVertex ("0.5 0.5 0.5");
+  this->readVertex ("-0.5 0.5 -0.5");
+  this->readVertex ("0.5 0.5 -0.5");
+  this->readVertex ("-0.5 -0.5 -0.5");
+  this->readVertex ("0.5 -0.5 -0.5");
+
+  this->readVertexTexture ("0.0 0.0");
+  this->readVertexTexture ("1.0 0.0");
+  this->readVertexTexture ("0.0 1.0");
+  this->readVertexTexture ("1.0 1.0");
+  this->readVertexTexture ("0.0 2.0");
+  this->readVertexTexture ("1.0 2.0");
+  this->readVertexTexture ("0.0 3.0");
+  this->readVertexTexture ("1.0 3.0");
+  this->readVertexTexture ("0.0 4.0");
+  this->readVertexTexture ("1.0 4.0");
+  this->readVertexTexture ("2.0 0.0");
+  this->readVertexTexture ("2.0 1.0");
+  this->readVertexTexture ("-1.0 0.0");
+  this->readVertexTexture ("-1.0 1.0");
+
+  this->readVertexNormal ("0.0 0.0 1.0");
+  this->readVertexNormal ("0.0 0.0 1.0");
+  this->readVertexNormal ("0.0 0.0 1.0");
+  this->readVertexNormal ("0.0 0.0 1.0");
+  this->readVertexNormal ("0.0 1.0 0.0");
+  this->readVertexNormal ("0.0 1.0 0.0");
+  this->readVertexNormal ("0.0 1.0 0.0");
+  this->readVertexNormal ("0.0 1.0 0.0");
+  this->readVertexNormal ("0.0 0.0 -1.0");
+  this->readVertexNormal ("0.0 0.0 -1.0");
+  this->readVertexNormal ("0.0 0.0 -1.0");
+  this->readVertexNormal ("0.0 0.0 -1.0");
+  this->readVertexNormal ("0.0 -1.0 0.0");
+  this->readVertexNormal ("0.0 -1.0 0.0");
+  this->readVertexNormal ("0.0 -1.0 0.0");
+  this->readVertexNormal ("0.0 -1.0 0.0");
+  this->readVertexNormal ("1.0 0.0 0.0");
+  this->readVertexNormal ("1.0 0.0 0.0");
+  this->readVertexNormal ("1.0 0.0 0.0");
+  this->readVertexNormal ("1.0 0.0 0.0");
+  this->readVertexNormal ("-1.0 0.0 0.0");
+  this->readVertexNormal ("-1.0 0.0 0.0");
+  this->readVertexNormal ("-1.0 0.0 0.0");
+  this->readVertexNormal ("-1.0 0.0 0.0");
 
   /* normaleLess-testingMode
-  readFace ("1 2 4 3");
-  readFace ("3 4 6 5");
-  readFace ("5 6 8 7");
-  readFace ("7 8 2 1");
-  readFace ("2 8 6 4");
-  readFace ("7 1 3 5");
+  this->readFace ("1 2 4 3");
+  this->readFace ("3 4 6 5");
+  this->readFace ("5 6 8 7");
+  this->readFace ("7 8 2 1");
+  this->readFace ("2 8 6 4");
+  this->readFace ("7 1 3 5");
   */
 
-  readFace ("1/1/1 2/2/2 4/4/3 3/3/4");
-  readFace ("3/3/5 4/4/6 6/6/7 5/5/8");
-  readFace ("5/5/9 6/6/10 8/8/11 7/7/12");
-  readFace ("7/7/13 8/8/14 2/10/15 1/9/16");
-  readFace ("2/2/17 8/11/18 6/12/19 4/4/20");
-  readFace ("7/13/21 1/1/22 3/3/23 5/14/24");
-
-}
+  this->readFace ("1/1/1 2/2/2 4/4/3 3/3/4");
+  this->readFace ("3/3/5 4/4/6 6/6/7 5/5/8");
+  this->readFace ("5/5/9 6/6/10 8/8/11 7/7/12");
+  this->readFace ("7/7/13 8/8/14 2/10/15 1/9/16");
+  this->readFace ("2/2/17 8/11/18 6/12/19 4/4/20");
+  this->readFace ("7/13/21 1/1/22 3/3/23 5/14/24");
+
+}
