Index: /trunk/src/lib/graphics/importer/static_model.cc
===================================================================
--- /trunk/src/lib/graphics/importer/static_model.cc	(revision 6030)
+++ /trunk/src/lib/graphics/importer/static_model.cc	(revision 6031)
@@ -32,6 +32,6 @@
 ////////////////////
 /**
- *  creates a new ModelFaceElement
-*/
+ * @brief creates a new ModelFaceElement
+ */
 ModelFaceElement::ModelFaceElement()
 {
@@ -44,6 +44,6 @@
 
 /**
- *  destroys a ModelFaceElement
-*/
+ * @brief destroys a ModelFaceElement
+ */
 ModelFaceElement::~ModelFaceElement()
 {
@@ -53,6 +53,6 @@
 
 /**
- *  creates a new ModelFace
-*/
+ * @brief creates a new ModelFace
+ */
 ModelFace::ModelFace()
 {
@@ -81,6 +81,6 @@
 
 /**
- *  Creates a new ModelGroup
-*/
+ * @brief Creates a new ModelGroup
+ */
 ModelGroup::ModelGroup()
 {
@@ -97,6 +97,6 @@
 
 /**
- *  deletes a ModelGroup
-*/
+ * @brief deletes a ModelGroup
+ */
 ModelGroup::~ModelGroup()
 {
@@ -118,8 +118,8 @@
 
 /**
- *  cleans up a ModelGroup
-
-   actually does the same as the delete Operator, but does not delete the predecessing group
-*/
+ * @brief cleans up a ModelGroup
+ *
+ * actually does the same as the delete Operator, but does not delete the predecessing group
+ */
 void ModelGroup::cleanup()
 {
@@ -137,41 +137,29 @@
 /////////////
 /**
- *  Creates a 3D-Model.
-
-   assigns it a Name and a Type
-*/
-StaticModel::StaticModel(const char* modelName, MODEL_TYPE type)
+ * @brief Creates a 3D-Model.
+ *
+ * assigns it a Name and a Type
+ */
+StaticModel::StaticModel(const char* modelName)
 {
   this->setClassID(CL_MODEL, "Model");
   PRINTF(4)("new 3D-Model is being created\n");
   this->setName(modelName);
-  this->type = type;
 
   this->finalized = false;
+
   // setting the start group;
   this->currentGroup = this->firstGroup = new ModelGroup;
   this->groupCount = 0;
-  this->vertexCount = 0;
-  this->normalCount = 0;
-  this->texCoordCount = 0;
   this->faceCount = 0;
-  this->triangleCount = 0;
-  this->triangles = NULL;
-
-  this->scaleFactor = 1;
-
-  this->vertices = new tArray<GLfloat>();
-  this->vTexture = new tArray<GLfloat>();
-  this->normals = new tArray<GLfloat>();
-
-  if (this->type == MODEL_VERTEX_ARRAY)
-    glEnableClientState(GL_VERTEX_ARRAY | GL_NORMAL_ARRAY | GL_TEXTURE_COORD_ARRAY);
-}
-
-/**
- *  deletes an Model.
-
-   Looks if any from model allocated space is still in use, and if so deleted it.
-*/
+
+  this->scaleFactor = 1.0f;
+}
+
+/**
+ * @brief deletes an Model.
+ *
+ * Looks if any from model allocated space is still in use, and if so deleted it.
+ */
 StaticModel::~StaticModel()
 {
@@ -190,7 +178,4 @@
   delete this->firstGroup;
 
-  // deleting Arrays (if not allready done by finalize)
-  this->deleteArrays();
-
   // deleting the MaterialList
   PRINTF(5)("Deleting Materials.\n");
@@ -207,6 +192,6 @@
 
 /**
- *  Finalizes an Object. This can be done outside of the Class.
-*/
+ * @brief Finalizes an Object. This can be done outside of the Class.
+ */
 void StaticModel::finalize()
 {
@@ -215,18 +200,7 @@
   this->buildTriangleList();
 
-  // deletes everything we allocated.
-  //if (this->type == MODEL_DISPLAY_LIST)
-    //this->deleteArrays();
-  //  this->cleanup();
-
-  /* load the ModelInfo */
-  this->pModelInfo.numVertices = this->vertexCount;
-  this->pModelInfo.pVertices = this->vertices->getArray();
-  this->pModelInfo.numTriangles = this->triangleCount;
-  this->pModelInfo.pTriangles = this->triangles;
-  this->pModelInfo.numNormals = this->normalCount;
-  this->pModelInfo.pNormals = this->normals->getArray();
-  this->pModelInfo.numTexCoor = this->vTexture->getCount();
-  this->pModelInfo.pTexCoor = this->vTexture->getArray();
+  this->pModelInfo.pVertices = this->vertices.getArray();
+  this->pModelInfo.pNormals = this->normals.getArray();
+  this->pModelInfo.pTexCoor = this->vTexture.getArray();
 
   this->finalized = true;
@@ -234,5 +208,5 @@
 
 /**
- * rebuild the Model from the Information we got.
+ * @brief rebuild the Model from the Information we got.
  */
 void StaticModel::rebuild()
@@ -240,5 +214,4 @@
   PRINTF(3)("Rebuilding Model '%s'\n", this->getName());
   this->finalize();
-
 }
 
@@ -252,5 +225,4 @@
 void StaticModel::draw () const
 {
-
   PRINTF(4)("drawing the 3D-Models\n");
   ModelGroup* tmpGroup = this->firstGroup;
@@ -262,11 +234,11 @@
     }
 
-
-/*  const GLfloat* pVertices = NULL;
-  const GLfloat* pNorm = NULL;
-
-  glBegin(GL_TRIANGLES);
-  for( int i = 0; i < this->triangleCount; ++i)
-  {
+  /*
+    const GLfloat* pVertices = NULL;
+    const GLfloat* pNorm = NULL;
+    
+    glBegin(GL_TRIANGLES);
+    for( int i = 0; i < this->triangleCount; ++i)
+    {
     //printf("int i = %i\n", i);
     pNorm = &this->normals->getArray()[this->triangles[i].indexToNormals[0]];
@@ -285,17 +257,19 @@
     glVertex3f(pVertices[0], pVertices[1], pVertices[2]);
 
-  }
-  glEnd();*/
-}
-
-/**
- *  Draws the Model number groupNumber
+    }
+    glEnd();
+  */
+}
+
+
+/**
+ * @brief Draws the Model number groupNumber
  * @param groupNumber The number of the group that will be displayed.
-
-   It does this by just calling the List that must have been created earlier.
-*/
+ *
+ * It does this by just calling the List that must have been created earlier.
+ */
 void StaticModel::draw (int groupNumber) const
 {
-  if (groupNumber >= this->groupCount)
+  if (unlikely(groupNumber >= this->groupCount))
     {
       PRINTF(2)("You requested model number %i, but this File only contains of %i Models.\n", groupNumber-1, this->groupCount);
@@ -318,13 +292,13 @@
   PRINTF(2)("Model number %i in %s not Found.\n", groupNumber, this->getName());
   return;
-
-}
-
-/**
- *  Draws the Model with a specific groupName
+}
+
+
+/**
+ * @brief Draws the Model with a specific groupName
  * @param groupName The name of the group that will be displayed.
-
-   It does this by just calling the List that must have been created earlier.
-*/
+ *
+ * It does this by just calling the List that must have been created earlier.
+ */
 void StaticModel::draw (char* groupName) const
 {
@@ -348,27 +322,8 @@
 // INIT //
 //////////
-/**
- *  deletes all the arrays
-*/
-bool StaticModel::deleteArrays()
-{
-  if (this->vertices)
-    delete this->vertices;
-  if (this->vTexture)
-    delete this->vTexture;
-  if (this->normals)
-    delete this->normals;
-  if (this->triangles)
-    delete[] this->triangles;
-
-  this->vertices = NULL;
-  this->vTexture = NULL;
-  this->normals = NULL;
-  this->triangles = NULL;
-  this->triangleCount = 0;
-}
-
-/**
- *  finalizes an Model.
+
+/**
+ * @brief finalizes an Model.
+ *
  * This funcion is needed, to delete all the Lists, and arrays that are no more
  * needed because they are already imported into openGL.
@@ -386,5 +341,5 @@
 //////////
 /**
- * adds a new Material to the Material List
+ * @brief adds a new Material to the Material List
  * @param material the Material to add
  * @returns the added material
@@ -405,8 +360,8 @@
 
 /**
- *  adds a new Material to the Material List
+ * @brief adds a new Material to the Material List
  * @param materialName the name of the Material to add
  * @returns the added material
-*/
+ */
 Material* StaticModel::addMaterial(const char* materialName)
 {
@@ -421,8 +376,8 @@
 
 /**
- *  finds a Material by its name and returns it
+ * @brief finds a Material by its name and returns it
  * @param materialName the Name of the material to search for.
  * @returns the Material if found, NULL otherwise
-*/
+ */
 Material* StaticModel::findMaterialByName(const char* materialName)
 {
@@ -435,10 +390,10 @@
 
 /**
- *  parses a group String
+ * @brief parses a group String
  * @param groupString the new Group to create
-
-   This function initializes a new Group.
-   With it you should be able to create Models with more than one SubModel inside
-*/
+ *
+ * This function initializes a new Group.
+ * With it you should be able to create Models with more than one SubModel inside
+ */
 bool StaticModel::addGroup(const char* groupString)
 {
@@ -459,9 +414,9 @@
 
 /**
- *  parses a vertex-String
+ * @brief parses a vertex-String
  * @param vertexString The String that will be parsed.
-
-   If a vertex line is found this function will inject it into the vertex-Array
-*/
+ *
+ *  If a vertex line is found this function will inject it into the vertex-Array
+ */
 bool StaticModel::addVertex (const char* vertexString)
 {
@@ -470,30 +425,33 @@
   float subbuffer3;
   sscanf (vertexString, "%f %f %f", &subbuffer1, &subbuffer2, &subbuffer3);
-  this->vertices->addEntry(subbuffer1*scaleFactor, subbuffer2*scaleFactor, subbuffer3*scaleFactor);
-  this->vertexCount++;
+  this->vertices.addEntry(subbuffer1*scaleFactor,
+			  subbuffer2*scaleFactor,
+			  subbuffer3*scaleFactor);
+  this->pModelInfo.numVertices++;
   return true;
 }
 
 /**
- *  parses a vertex-String
+ * @brief parses a vertex-String
  * @param x the X-coordinate of the Vertex to add.
  * @param y the Y-coordinate of the Vertex to add.
  * @param z the Z-coordinate of the Vertex to add.
-
-*/
+ */
 bool StaticModel::addVertex(float x, float y, float z)
 {
   PRINTF(5)("reading in a vertex: %f %f %f\n", x, y, z);
-  this->vertices->addEntry(x*scaleFactor, y*scaleFactor, z*scaleFactor);
-  this->vertexCount++;
+  this->vertices.addEntry(x*scaleFactor,
+			  y*scaleFactor,
+			  z*scaleFactor);
+  this->pModelInfo.numVertices++;
   return true;
 }
 
 /**
- *  parses a vertexNormal-String
+ * @brief parses a vertexNormal-String
  * @param normalString The String that will be parsed.
-
-   If a vertexNormal line is found this function will inject it into the vertexNormal-Array
-*/
+ *
+ * If a vertexNormal line is found this function will inject it into the vertexNormal-Array
+ */
 bool StaticModel::addVertexNormal (const char* normalString)
 {
@@ -502,34 +460,34 @@
   float subbuffer3;
   sscanf (normalString, "%f %f %f", &subbuffer1, &subbuffer2, &subbuffer3);
-  this->normals->addEntry(subbuffer1, subbuffer2, subbuffer3);
-  this->normalCount++;
+  this->normals.addEntry(subbuffer1, subbuffer2, subbuffer3);
+  this->pModelInfo.numNormals++;
   return true;
 }
 
 /**
- *  adds a VertexNormal.
+ * @brief adds a VertexNormal.
  * @param x The x coordinate of the Normal.
  * @param y The y coordinate of the Normal.
  * @param z The z coordinate of the Normal.
-
-   If a vertexNormal line is found this function will inject it into the vertexNormal-Array
-*/
+ *
+ * If a vertexNormal line is found this function will inject it into the vertexNormal-Array
+ */
 bool StaticModel::addVertexNormal(float x, float y, float z)
 {
   PRINTF(5)("found vertex-Normal %f, %f, %f\n", x, y, z);
-  this->normals->addEntry(x, y, z);
-  this->normalCount++;
+  this->normals.addEntry(x, y, z);
+  this->pModelInfo.numNormals++;
   return true;
 }
 
 /**
- *  parses a vertexTextureCoordinate-String
+ * @brief parses a vertexTextureCoordinate-String
  * @param vTextureString The String that will be parsed.
-
-   If a vertexTextureCoordinate line is found,
-   this function will inject it into the vertexTexture-Array
-
-   !! WARNING THIS IS DIFFERNT FROM addVervexTexture(float, float); because it changes the second entry to 1-v !!
-*/
+ *
+ * If a vertexTextureCoordinate line is found,
+ * this function will inject it into the vertexTexture-Array
+ *
+ * !! WARNING THIS IS DIFFERNT FROM addVervexTexture(float, float); because it changes the second entry to 1-v !!
+ */
 bool StaticModel::addVertexTexture (const char* vTextureString)
 {
@@ -537,34 +495,36 @@
   float subbuffer2;
   sscanf (vTextureString, "%f %f", &subbuffer1, &subbuffer2);
-  this->vTexture->addEntry(subbuffer1);
-  this->vTexture->addEntry(1 - subbuffer2);
-  this->texCoordCount++;
+  this->vTexture.addEntry(subbuffer1);
+  this->vTexture.addEntry(1 - subbuffer2);
+  this->pModelInfo.numTexCoor++;
   return true;
 }
 
 /**
- *  adds a Texture Coordinate
+ * @brief adds a Texture Coordinate
  * @param u The u coordinate of the TextureCoordinate.
  * @param v The y coordinate of the TextureCoordinate.
-
-   If a TextureCoordinate line is found this function will inject it into the TextureCoordinate-Array
-*/
+ *
+ * If a TextureCoordinate line is found this function will
+ *  inject it into the TextureCoordinate-Array
+ */
 bool StaticModel::addVertexTexture(float u, float v)
 {
   PRINTF(5)("found vertex-Texture %f, %f\n", u, v);
-  this->vTexture->addEntry(u);
-  this->vTexture->addEntry(v);
-  this->texCoordCount++;
+  this->vTexture.addEntry(u);
+  this->vTexture.addEntry(v);
+  this->pModelInfo.numTexCoor++;
   return true;
 }
 
 /**
- *  parses a face-string
+ * @brief parses a face-string
  * @param faceString The String that will be parsed.
-
-   If a face line is found this function will add it to the glList.
-
-   String is different from the argument addFace, in this that the first Vertex/Normal/Texcoord is 1 instead of 0
-*/
+ *
+ * If a face line is found this function will add it to the glList.
+ *
+ * String is different from the argument addFace,
+ * in this, that the first Vertex/Normal/Texcoord is 1 instead of 0
+ */
 bool StaticModel::addFace (const char* faceString)
 {
@@ -613,5 +573,5 @@
       this->currentGroup->currentFace->vertexCount++;
     }
-
+  
   this->currentGroup->faceCount += this->currentGroup->currentFace->vertexCount -2;
   this->faceCount += this->currentGroup->currentFace->vertexCount -2;
@@ -619,5 +579,5 @@
 
 /**
- *  adds a new Face
+ * @brief adds a new Face
  * @param faceElemCount the number of Vertices to add to the Face.
  * @param type The information Passed with each Vertex
@@ -663,5 +623,5 @@
 
   if (this->currentGroup->faceCount == 0)
-    this->currentGroup->faceCount ++;
+    this->currentGroup->faceCount++;
 }
 
@@ -678,22 +638,22 @@
 
   if (this->currentGroup->faceCount == 0)
-    this->currentGroup->faceCount ++;
-}
-
-/**
- *  A routine that is able to create normals.
-
-   The algorithm does the following:
-   1. It calculates creates Vectors for each normale, and sets them to zero.
-   2. It then Walks through a) all the Groups b) all the Faces c) all the FaceElements
-   3. It searches for a points two neighbours per Face, takes Vecotrs to them calculates FaceNormals and adds it to the Points Normal.
-   4. It goes through all the normale-Points and calculates the VertexNormale and includes it in the normals-Array.
-*/
+    this->currentGroup->faceCount++;
+}
+
+/**
+ * @brief A routine that is able to create normals.
+ *
+ * The algorithm does the following:
+ * 1. It calculates creates Vectors for each normale, and sets them to zero.
+ * 2. It then Walks through a) all the Groups b) all the Faces c) all the FaceElements
+ * 3. It searches for a points two neighbours per Face, takes Vecotrs to them calculates FaceNormals and adds it to the Points Normal.
+ * 4. It goes through all the normale-Points and calculates the VertexNormale and includes it in the normals-Array.
+ */
 bool StaticModel::buildVertexNormals ()
 {
   PRINTF(4)("Normals are being calculated.\n");
 
-  Vector* normArray = new Vector [vertices->getCount()/3];
-  for (int i=0; i<vertices->getCount()/3;i++)
+  Vector* normArray = new Vector [vertices.getCount()/3];
+  for (int i=0; i<vertices.getCount()/3;i++)
     normArray[i] = Vector(.0,.0,.0);
 
@@ -705,10 +665,10 @@
 
   ModelGroup* tmpGroup = firstGroup;
-  while (tmpGroup)
+  while (tmpGroup != NULL)
     {
       ModelFace* tmpFace = tmpGroup->firstFace;
-      while (tmpFace)
+      while (tmpFace != NULL)
         {
-          if (tmpFace->firstElem)
+          if (tmpFace->firstElem != NULL)
             {
               ModelFaceElement* firstElem = tmpFace->firstElem;
@@ -718,5 +678,5 @@
               ModelFaceElement* lastElem;
               // find last Element of the Chain. !! IMPORTANT:the last Element of the Chain must point to NULL, or it will resolv into an infinity-loop.
-              while (curElem)
+              while (curElem != NULL)
                 {
                   prevElem = curElem;
@@ -732,7 +692,15 @@
                   curElem->normalNumber = curElem->vertexNumber;
 
-                  curV = Vector (vertices->getArray()[curElem->vertexNumber*3], vertices->getArray()[curElem->vertexNumber*3+1], vertices->getArray()[curElem->vertexNumber*3+2]);
-                  prevV = Vector (vertices->getArray()[prevElem->vertexNumber*3], vertices->getArray()[prevElem->vertexNumber*3+1], vertices->getArray()[prevElem->vertexNumber*3+2]) - curV;
-                  nextV = Vector (vertices->getArray()[nextElem->vertexNumber*3], vertices->getArray()[nextElem->vertexNumber*3+1], vertices->getArray()[nextElem->vertexNumber*3+2]) - curV;
+                  curV = Vector (this->vertices.getArray()[curElem->vertexNumber*3],
+				 this->vertices.getArray()[curElem->vertexNumber*3+1],
+				 this->vertices.getArray()[curElem->vertexNumber*3+2]);
+
+                  prevV = Vector (this->vertices.getArray()[prevElem->vertexNumber*3],
+				  this->vertices.getArray()[prevElem->vertexNumber*3+1],
+				  this->vertices.getArray()[prevElem->vertexNumber*3+2]) - curV;
+
+                  nextV = Vector (this->vertices.getArray()[nextElem->vertexNumber*3],
+				  this->vertices.getArray()[nextElem->vertexNumber*3+1],
+				  this->vertices.getArray()[nextElem->vertexNumber*3+2]) - curV;
                   normArray[curElem->vertexNumber] = normArray[curElem->vertexNumber] + nextV.cross(prevV);
 
@@ -746,5 +714,5 @@
     }
 
-  for (int i=0; i < vertices->getCount()/3;i++)
+  for (int i=0; i < this->vertices.getCount()/3;i++)
     {
       normArray[i].normalize();
@@ -754,5 +722,5 @@
 
     }
-  delete []normArray;
+  delete[] normArray;
 }
 
@@ -766,9 +734,9 @@
 {
   // finalize the Arrays
-  this->vertices->finalizeArray();
-  this->vTexture->finalizeArray();
-  if (normals->getCount() == 0) // vertices-Array must be built for this
+  this->vertices.finalizeArray();
+  this->vTexture.finalizeArray();
+  if (normals.getCount() == 0) // vertices-Array must be built for this
     this->buildVertexNormals();
-  this->normals->finalizeArray();
+  this->normals.finalizeArray();
 
   this->currentGroup = this->firstGroup;
@@ -852,23 +820,4 @@
 }
 
-/**
- *  reads and includes the Faces/Materials into the openGL state Machine
-*/
-bool StaticModel::importToVertexArray()
-{
-  // finalize the Arrays
-  this->vertices->finalizeArray();
-  this->vTexture->finalizeArray();
-  if (normals->getCount() == 0) // vertices-Array must be built for this
-    this->buildVertexNormals();
-  this->normals->finalizeArray();
-
-  this->currentGroup = this->firstGroup;
-  glVertexPointer(3, GL_FLOAT, 0, this->vertices->getArray());
-  glNormalPointer(3, 0, this->normals->getArray());
-  glTexCoordPointer(2, GL_FLOAT, 0, this->vTexture->getArray());
-}
-
-
 
 /**
@@ -877,15 +826,15 @@
 bool StaticModel::buildTriangleList()
 {
-  if( unlikely(this->triangles != NULL))
+  if( unlikely(this->pModelInfo.pTriangles != NULL))
     return true;
   /* make sure, that all the arrays are finalized */
-  if( unlikely(!this->vertices->isFinalized()))
-    this->vertices->finalizeArray();
-  if( unlikely(!this->vTexture->isFinalized()))
-    this->vTexture->finalizeArray();
-  if( normals->getCount() == 0) // vertices-Array must be built for this
+  if( unlikely(!this->vertices.isFinalized()))
+    this->vertices.finalizeArray();
+  if( unlikely(!this->vTexture.isFinalized()))
+    this->vTexture.finalizeArray();
+  if( normals.getCount() == 0) // vertices-Array must be built for this
     this->buildVertexNormals();
-  if( unlikely(!this->normals->isFinalized()))
-    this->normals->finalizeArray();
+  if( unlikely(!this->normals.isFinalized()))
+    this->normals.finalizeArray();
 
 
@@ -896,5 +845,4 @@
   /* count the number of triangles */
   /* now iterate through all groups and build up the triangle list */
-  this->triangleCount = 0;
   this->currentGroup = this->firstGroup;
   while( this->currentGroup != NULL)
@@ -907,9 +855,9 @@
       if( tmpFace->vertexCount == 3)
       {
-        ++this->triangleCount;
+        ++this->pModelInfo.numTriangles;
       } /* if the polygon is a quad */
       else if( tmpFace->vertexCount == 4)
       {
-        this->triangleCount += 2;
+        this->pModelInfo.numTriangles += 2;
       }
       else if( tmpFace->vertexCount > 4)
@@ -923,5 +871,5 @@
   }
 
-  PRINTF(3)("got %i triangles, %i vertices\n", this->triangleCount, this->vertexCount);
+  PRINTF(3)("got %i triangles, %i vertices\n", this->pModelInfo.numTriangles, this->pModelInfo.numVertices);
 
 
@@ -929,5 +877,5 @@
 
   /* allocate memory for the new triangle structures */
-  if( (this->triangles = new sTriangleExt[this->triangleCount]) == NULL)
+  if( (this->pModelInfo.pTriangles = new sTriangleExt[this->pModelInfo.numTriangles]) == NULL)
   {
     PRINTF(1)("Could not allocate memory for triangle list\n");
@@ -950,7 +898,7 @@
         for( int j = 0; j < 3; ++j)
         {
-          this->triangles[index].indexToVertices[j] = (unsigned int)tmpElem->vertexNumber * 3;
-          this->triangles[index].indexToNormals[j] = (unsigned int)tmpElem->normalNumber * 3;
-          this->triangles[index].indexToTexCoor[j] = (unsigned int)tmpElem->texCoordNumber * 3;
+          this->pModelInfo.pTriangles[index].indexToVertices[j] = (unsigned int)tmpElem->vertexNumber * 3;
+          this->pModelInfo.pTriangles[index].indexToNormals[j] = (unsigned int)tmpElem->normalNumber * 3;
+          this->pModelInfo.pTriangles[index].indexToTexCoor[j] = (unsigned int)tmpElem->texCoordNumber * 3;
           tmpElem = tmpElem->next;
         }
@@ -960,30 +908,30 @@
       {
 
-        this->triangles[index].indexToVertices[0] = (unsigned int)tmpElem->vertexNumber * 3;
-        this->triangles[index].indexToNormals[0] = (unsigned int)tmpElem->normalNumber * 3;
-        this->triangles[index].indexToTexCoor[0] = (unsigned int)tmpElem->texCoordNumber * 3;
-
-        this->triangles[index + 1].indexToVertices[0] = (unsigned int)tmpElem->vertexNumber * 3;
-        this->triangles[index + 1].indexToNormals[0] = (unsigned int)tmpElem->normalNumber * 3;
-        this->triangles[index + 1].indexToTexCoor[0] = (unsigned int)tmpElem->texCoordNumber * 3;
+        this->pModelInfo.pTriangles[index].indexToVertices[0] = (unsigned int)tmpElem->vertexNumber * 3;
+        this->pModelInfo.pTriangles[index].indexToNormals[0] = (unsigned int)tmpElem->normalNumber * 3;
+        this->pModelInfo.pTriangles[index].indexToTexCoor[0] = (unsigned int)tmpElem->texCoordNumber * 3;
+
+        this->pModelInfo.pTriangles[index + 1].indexToVertices[0] = (unsigned int)tmpElem->vertexNumber * 3;
+        this->pModelInfo.pTriangles[index + 1].indexToNormals[0] = (unsigned int)tmpElem->normalNumber * 3;
+        this->pModelInfo.pTriangles[index + 1].indexToTexCoor[0] = (unsigned int)tmpElem->texCoordNumber * 3;
         tmpElem = tmpElem->next;
 
-        this->triangles[index].indexToVertices[1] = (unsigned int)tmpElem->vertexNumber * 3;
-        this->triangles[index].indexToNormals[1] = (unsigned int)tmpElem->normalNumber * 3;
-        this->triangles[index].indexToTexCoor[1] = (unsigned int)tmpElem->texCoordNumber * 3;
+        this->pModelInfo.pTriangles[index].indexToVertices[1] = (unsigned int)tmpElem->vertexNumber * 3;
+        this->pModelInfo.pTriangles[index].indexToNormals[1] = (unsigned int)tmpElem->normalNumber * 3;
+        this->pModelInfo.pTriangles[index].indexToTexCoor[1] = (unsigned int)tmpElem->texCoordNumber * 3;
         tmpElem = tmpElem->next;
 
-        this->triangles[index].indexToVertices[2] = (unsigned int)tmpElem->vertexNumber * 3;
-        this->triangles[index].indexToNormals[2] = (unsigned int)tmpElem->normalNumber * 3;
-        this->triangles[index].indexToTexCoor[2] = (unsigned int)tmpElem->texCoordNumber * 3;
-
-        this->triangles[index + 1].indexToVertices[2] = (unsigned int)tmpElem->vertexNumber * 3;
-        this->triangles[index + 1].indexToNormals[2] = (unsigned int)tmpElem->normalNumber * 3;
-        this->triangles[index + 1].indexToTexCoor[2] = (unsigned int)tmpElem->texCoordNumber * 3;
+        this->pModelInfo.pTriangles[index].indexToVertices[2] = (unsigned int)tmpElem->vertexNumber * 3;
+        this->pModelInfo.pTriangles[index].indexToNormals[2] = (unsigned int)tmpElem->normalNumber * 3;
+        this->pModelInfo.pTriangles[index].indexToTexCoor[2] = (unsigned int)tmpElem->texCoordNumber * 3;
+
+        this->pModelInfo.pTriangles[index + 1].indexToVertices[2] = (unsigned int)tmpElem->vertexNumber * 3;
+        this->pModelInfo.pTriangles[index + 1].indexToNormals[2] = (unsigned int)tmpElem->normalNumber * 3;
+        this->pModelInfo.pTriangles[index + 1].indexToTexCoor[2] = (unsigned int)tmpElem->texCoordNumber * 3;
         tmpElem = tmpElem->next;
 
-        this->triangles[index + 1].indexToVertices[1] = (unsigned int)tmpElem->vertexNumber * 3;
-        this->triangles[index + 1].indexToNormals[1] = (unsigned int)tmpElem->normalNumber * 3;
-        this->triangles[index + 1].indexToTexCoor[1] = (unsigned int)tmpElem->texCoordNumber * 3;
+        this->pModelInfo.pTriangles[index + 1].indexToVertices[1] = (unsigned int)tmpElem->vertexNumber * 3;
+        this->pModelInfo.pTriangles[index + 1].indexToNormals[1] = (unsigned int)tmpElem->normalNumber * 3;
+        this->pModelInfo.pTriangles[index + 1].indexToTexCoor[1] = (unsigned int)tmpElem->texCoordNumber * 3;
 
         index += 2;
@@ -1013,25 +961,25 @@
   if (elem->texCoordNumber != -1)
     {
-      if (likely(elem->texCoordNumber < this->texCoordCount))
-        glTexCoord2fv(this->vTexture->getArray() + elem->texCoordNumber * 2);
+      if (likely(elem->texCoordNumber < this->pModelInfo.numTexCoor))
+        glTexCoord2fv(this->vTexture.getArray() + elem->texCoordNumber * 2);
       else
         PRINTF(2)("TextureCoordinate %d is not in the List (max: %d)\nThe Model might be incomplete\n",
-                  elem->texCoordNumber, this->texCoordCount);
+                  elem->texCoordNumber, this->pModelInfo.numTexCoor);
     }
   if (elem->normalNumber != -1)
     {
-    if (likely(elem->normalNumber < this->normalCount))
-      glNormal3fv(this->normals->getArray() + elem->normalNumber * 3);
+    if (likely(elem->normalNumber < this->pModelInfo.numNormals))
+      glNormal3fv(this->normals.getArray() + elem->normalNumber * 3);
     else
         PRINTF(2)("Normal %d is not in the List (max: %d)\nThe Model might be incomplete",
-                  elem->normalNumber, this->normalCount);
+                  elem->normalNumber, this->pModelInfo.numNormals);
     }
   if (elem->vertexNumber != -1)
     {
-      if (likely(elem->vertexNumber < this->vertexCount))
-          glVertex3fv(this->vertices->getArray() + elem->vertexNumber * 3);
+      if (likely(elem->vertexNumber < this->pModelInfo.numVertices))
+          glVertex3fv(this->vertices.getArray() + elem->vertexNumber * 3);
       else
         PRINTF(2)("Vertex %d is not in the List (max: %d)\nThe Model might be incomplete",
-                  elem->vertexNumber, this->vertexCount);
+                  elem->vertexNumber, this->pModelInfo.numVertices);
     }
 
Index: /trunk/src/lib/graphics/importer/static_model.h
===================================================================
--- /trunk/src/lib/graphics/importer/static_model.h	(revision 6030)
+++ /trunk/src/lib/graphics/importer/static_model.h	(revision 6031)
@@ -16,17 +16,4 @@
 // FORWARD DECLARATION //
 template<class T> class tArray;
-
-
-//! an enumerator fot the different Model Types.
-/**
-   MODEL_DISPLAY_LIST means, that a DisplayList will be built out of the model. This model will be STATIC, meaning it cannot be changed after initialisation.
-   MODEL_VERTEX_ARRAY means, that a VertexArray will be built out of the model. This moel will be DYNAMIX, meaning that one can change the properties from outside of the model.
- * @todo implement this stuff
-*/
-typedef enum MODEL_TYPE {
-  MODEL_DISPLAY_LIST,
-  MODEL_VERTEX_ARRAY
-};
-
 
 // definition of different modes for setting up Faces
@@ -111,5 +98,5 @@
 {
  public:
-  StaticModel(const char* modelName = NULL, MODEL_TYPE type = MODEL_DISPLAY_LIST);
+  StaticModel(const char* modelName = NULL);
   virtual ~StaticModel();
 
@@ -120,40 +107,24 @@
   void rebuild();
 
-  /** @returns Count of the Models (Groups) in this File */
-  inline int getGroupCount() const { return this->groupCount; };
-
-  /** @returns a Pointer to the Vertex-Array, if it was deleted it returns NULL */
-  inline const GLfloat* getVertexArray() const { return this->vertices->getArray(); };
-  /** @returns the VertexCount of this Model */
-  inline unsigned int getVertexCount() const { return this->vertexCount; };
-
-  /** @returns a Pointer to the Normals-Array, if it was deleted it returns NULL */
-  inline const GLfloat* getNormalsArray() const { return this->normals->getArray(); };
-  /** @returns the NormalsCount of this Model */
-  inline unsigned int getNormalsCount() const { return this->normalCount; };
-
-  /** @returns a Pointer to the TexCoord-Array, if it was deleted it returns NULL */
-  inline const GLfloat* getTexCoordArray() const { return this->vTexture->getArray(); };
-  /** @returns the TexCoord-Count of this Model */
-  inline unsigned int getTexCoordCount() const { return this->texCoordCount; };
-
-  /** @returns the Count of Faces of this Model */
-  inline unsigned int getFaceCount() const { return this->faceCount; };
-
-
   Material* addMaterial(Material* material);
   Material* addMaterial(const char* materialName);
 
   bool addGroup(const char* groupString);
+
   bool addVertex(const char* vertexString);
   bool addVertex(float x, float y, float z);
+
   bool addFace(const char* faceString);
   bool addFace(int faceElemCount, VERTEX_FORMAT type, ...);
+
   bool addVertexNormal(const char* normalString);
   bool addVertexNormal(float x, float y, float z);
+
   bool addVertexTexture(const char* vTextureString);
   bool addVertexTexture(float u, float v);
+
   bool setMaterial(const char* mtlString);
   bool setMaterial(Material* mtl);
+
   void finalize();
 
@@ -163,5 +134,4 @@
 
   Material* findMaterialByName(const char* materialName);
-
 
  protected:
@@ -173,24 +143,17 @@
   bool importToDisplayList();
   bool buildTriangleList();
+
   bool addGLElement(ModelFaceElement* elem);
 
-  bool importToVertexArray();
-
-  bool deleteArrays();
   bool cleanup();
 
  private:
-  MODEL_TYPE                 type;            //!< A type for the Model
   bool                       finalized;       //!< Sets the Object to be finalized.
 
-  unsigned int               vertexCount;     //!< A modelwide Counter for vertices.
-  unsigned int               normalCount;     //!< A modelwide Counter for the normals.
-  unsigned int               texCoordCount;   //!< A modelwide Counter for the texCoord.
   unsigned int               faceCount;       //!< A modelwide Counter for the faces
-  unsigned int               triangleCount;   //!< Number of triangles >= faceCount
-  tArray<GLfloat>*           vertices;        //!< The Array that handles the Vertices.
-  tArray<GLfloat>*           normals;         //!< The Array that handles the Normals.
-  tArray<GLfloat>*           vTexture;        //!< The Array that handles the VertexTextureCoordinates.
-  sTriangleExt*              triangles;       //!< The Array of triangles in the model.h style
+
+  tArray<GLfloat>            vertices;        //!< The Array that handles the Vertices.
+  tArray<GLfloat>            normals;         //!< The Array that handles the Normals.
+  tArray<GLfloat>            vTexture;        //!< The Array that handles the VertexTextureCoordinates.
 
   ModelGroup*                firstGroup;      //!< The first of all groups.
