Index: GTP/trunk/Lib/Geom/shared/GeoTool/media/materials/dwarf.material
===================================================================
--- GTP/trunk/Lib/Geom/shared/GeoTool/media/materials/dwarf.material	(revision 1549)
+++ GTP/trunk/Lib/Geom/shared/GeoTool/media/materials/dwarf.material	(revision 1549)
@@ -0,0 +1,49 @@
+
+material Material3
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.2 0.2 0.2 1
+			diffuse 0.8 0.8 0.8 1
+
+			texture_unit
+			{
+				texture axe.jpg
+			}
+		}
+	}
+}
+material Material1
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.2 0.2 0.2 1
+			diffuse 0.8 0.8 0.8 1
+
+			texture_unit
+			{
+				texture dwarf.jpg
+			}
+		}
+	}
+}
+material Material2
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.2 0.2 0.2 1
+			diffuse 0.8 0.8 0.8 1
+
+			texture_unit
+			{
+				texture dwarf2.jpg
+			}
+		}
+	}
+}
Index: GTP/trunk/Lib/Geom/shared/GeoTool/media/materials/jaiqua.material
===================================================================
--- GTP/trunk/Lib/Geom/shared/GeoTool/media/materials/jaiqua.material	(revision 1549)
+++ GTP/trunk/Lib/Geom/shared/GeoTool/media/materials/jaiqua.material	(revision 1549)
@@ -0,0 +1,18 @@
+
+material jaiqua
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.2 0.2 0.2 1
+			diffuse 0.8 0.8 0.8 1
+
+			texture_unit
+			{
+				texture blue_jaiqua.jpg
+			}
+		}
+	}
+}
+
Index: GTP/trunk/Lib/Geom/shared/GeoTool/media/materials/enano.material
===================================================================
--- GTP/trunk/Lib/Geom/shared/GeoTool/media/materials/enano.material	(revision 1024)
+++ 	(revision )
@@ -1,49 +1,0 @@
-
-material Material0
-{
-	technique
-	{
-		pass
-		{
-			ambient 0.2 0.2 0.2 1
-			diffuse 0.8 0.8 0.8 1
-
-			texture_unit
-			{
-				texture axe.jpg
-			}
-		}
-	}
-}
-material Material1
-{
-	technique
-	{
-		pass
-		{
-			ambient 0.2 0.2 0.2 1
-			diffuse 0.8 0.8 0.8 1
-
-			texture_unit
-			{
-				texture dwarf.jpg
-			}
-		}
-	}
-}
-material Material2
-{
-	technique
-	{
-		pass
-		{
-			ambient 0.2 0.2 0.2 1
-			diffuse 0.8 0.8 0.8 1
-
-			texture_unit
-			{
-				texture dwarf2.jpg
-			}
-		}
-	}
-}
Index: GTP/trunk/Lib/Geom/shared/GeoTool/include/GeoMeshViewUI.h
===================================================================
--- GTP/trunk/Lib/Geom/shared/GeoTool/include/GeoMeshViewUI.h	(revision 1543)
+++ GTP/trunk/Lib/Geom/shared/GeoTool/include/GeoMeshViewUI.h	(revision 1549)
@@ -435,5 +435,4 @@
 	int numSubMeshNames;
 	char **SubMeshNames;
-
 };
 
Index: GTP/trunk/Lib/Geom/shared/GeoTool/include/GeoMeshView.h
===================================================================
--- GTP/trunk/Lib/Geom/shared/GeoTool/include/GeoMeshView.h	(revision 1058)
+++ GTP/trunk/Lib/Geom/shared/GeoTool/include/GeoMeshView.h	(revision 1549)
@@ -19,4 +19,7 @@
 
 namespace Geometry{ class LodTreeLibrary; }
+
+using	namespace	Geometry;
+using	namespace	std;
 
 class GeoMeshView : public fltk::GlWindow
@@ -39,9 +42,9 @@
 
 	GeoMeshView(int 					x,
-			int						y,
-			int						w,
-			int						h,
-			const	char		*l							=	0,
-			GeoMeshViewUI	*geoMeshViewUI	=	0);
+							int						y,
+							int						w,
+							int						h,
+							const	char		*l							=	0,
+							GeoMeshViewUI	*geoMeshViewUI	=	0);
 
 	/*	This function is callalled by the zoom slider
@@ -55,5 +58,5 @@
 	 * and the initialize button in GeoMeshViewUI.
 	 */
-	void v_angle(float angle){vAng=angle;};
+	void v_angle(float angle){vAng	=	angle;};
 	
 	// Return the rotation about the vertical (y ) axis.
@@ -66,5 +69,5 @@
 	 * initialize button in GeoMeshViewUI.
 	 */
-	void h_angle(float angle){hAng=angle;};
+	void h_angle(float angle){hAng	=	angle;};
 	
 	// the rotation about the horizontal (x ) axis.
@@ -76,5 +79,5 @@
 	 * initialize button in GeoMeshViewUI.
 	 */
-	void panx(float x){xshift=x;};
+	void panx(float x){xshift	=	x;};
 	
 	/* Sets the y shift of the cube view camera.
@@ -83,5 +86,5 @@
 	 * initialize button in GeoMeshViewUI.
 	 */
-	void pany(float y){yshift=y;};
+	void pany(float y){yshift	=	y;};
 
 	//	Wire model.
@@ -116,5 +119,4 @@
 	void	activeLodTree(){mLodTree	=	true;}
 	void	deactiveLodTree(){mLodTree	=	false;}
-
 
 	//	Ilumination modes.
@@ -134,4 +136,5 @@
 #endif
 	}
+
 	void	restoreContext()
 	{
@@ -196,4 +199,6 @@
 	void	LoadTexture(const char *);
 	void	LoadTextureSubMesh(int isubmesh, const char *);
+	void	addTexFile(const char *);
+	void	changeTexFile(int isubmesh, const char *);
 
 	int getSubMeshCount(void) const { return mSubMeshCount; }
@@ -294,4 +299,7 @@
 	//	Idetifier of Visualization List.
 	GLuint	mIdVisualList;
+
+	//	List of texture files of the mesh.
+	vector<string>	mMeshTexFiles;
 };
 
Index: GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshViewUI.cpp
===================================================================
--- GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshViewUI.cpp	(revision 1543)
+++ GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshViewUI.cpp	(revision 1549)
@@ -42,4 +42,13 @@
 		strcpy(filename,fcho->value());
 		geoMeshView->LoadTexture(filename);
+
+		//	For each submesh.
+		for (int i	=	0; i < mGeoMesh->mSubMeshCount;	i++)
+		{
+			geoMeshView->changeTexFile(i,filename);
+		}
+
+		//	Refresh mesh.
+		geoMeshView->setMesh(mGeoMesh);
 	}
 }
@@ -53,19 +62,32 @@
 
 
-inline void GeoMeshViewUI::cb_menuFileLoadTextureSubMesh_i(fltk::Item *item, void *)
-{
+inline void GeoMeshViewUI::cb_menuFileLoadTextureSubMesh_i(	fltk::Item *item,
+																														void *)
+{
+	fltk::FileChooser	*fcho;
+
 	static char pattern[] = "*.{jpg|tga|png|bmp}";
 
-	const char * label = item->label();
-	int isubmesh = label[strlen(label)-1]-48;
-
-	fltk::FileChooser	*fcho =	new fltk::FileChooser("",pattern,fltk::FileChooser::CREATE,"Open image file");
+	const char *label	=	item->label();
+	int isubmesh			=	label[strlen(label)-1]-48;
+
+	fcho	=	new fltk::FileChooser("",
+																pattern,
+																fltk::FileChooser::CREATE,
+																"Open image file");
 	fcho->exec();
-	char filename[256]="";
+
+	char filename[256]	=	"";
+
 	if (fcho->value())
 	{
 		strcpy(filename,fcho->value());
-		geoMeshView->LoadTextureSubMesh(isubmesh,filename);
-	}
+
+		geoMeshView->changeTexFile(isubmesh,filename);
+
+		//	Refresh mesh.
+		geoMeshView->setMesh(mGeoMesh);
+	}
+
 }
 
@@ -957,7 +979,7 @@
 }
 
-VertexBuffer *origSubMeshVB=NULL;
-int orig_numindices=0;
-Index *orig_indices=NULL;
+VertexBuffer *origSubMeshVB	=	NULL;
+int orig_numindices					=	0;
+Index *orig_indices					=	NULL;
 
 //---------------------------------------------------------------------------
@@ -973,5 +995,5 @@
 	mProcessBar->position(0);
 
-	origSubMeshVB=NULL;
+	origSubMeshVB	=	NULL;
     
 	//	Initialize error flag.
@@ -982,5 +1004,5 @@
 	{
 		//	Choose between aplication state.
-		switch(mApplicationState)
+		switch (mApplicationState)
 		{
 			//	Stripify state.
@@ -1148,8 +1170,4 @@
 		//	Refresh geometry attributes.
 		refreshApplicationBar();
-
-		//	Set textures.
-		geoMeshView->resetTextures();
-		setTextures();
 	}
 	
@@ -1198,5 +1216,7 @@
 	{
 		//	Choose between aplication state.
-		if (mApplicationState==LODSTRIPS_AUTO || mApplicationState==LODTREES_AUTO)
+		if (mApplicationState == LODSTRIPS_AUTO
+				||
+				mApplicationState == LODTREES_AUTO)
 		{
 			file_name	=	fltk::file_chooser("Build LOD","*.mesh","");
@@ -1215,10 +1235,4 @@
 
 				//	Simplification sequence.
-				//oMeshSimpSequence = new MeshSimplificationSequence();
-
-				//	Loads a simplification sequence file.
-				//oMeshSimpSequence->Load(Serializer("SimplifSequence.txt",Serializer::READ));
-
-				//	Simplification sequence.
 				oMeshSimpSequence =	mMeshSimplifier->GetSimplificationSequence();
 
@@ -1226,8 +1240,8 @@
 				if (oMeshSimpSequence && mGeoMesh)
 				{
-					oLodStrip		=	new LodStripsConstructor(	mGeoMesh,
-							oMeshSimpSequence,
-							idMeshLeaves,
-							progress_function);
+					oLodStrip	=	new LodStripsConstructor(	mGeoMesh,
+																								oMeshSimpSequence,
+																								idMeshLeaves,
+																								progress_function);
 
 					oLodStrip->UpdateMesh();
@@ -1248,18 +1262,18 @@
 
 					mesh_saver	=	new	GeoMeshSaver();
-					//					file_name[strlen(file_name) - 4]	=	'\0';
-
-					mesh_saver->leavesSubMesh=idMeshLeaves;
-					mesh_saver->leavesVB=origSubMeshVB;
-					mesh_saver->numindices=orig_numindices;
-					mesh_saver->indices=orig_indices;
+
+					mesh_saver->leavesSubMesh	=	idMeshLeaves;
+					mesh_saver->leavesVB			=	origSubMeshVB;
+					mesh_saver->numindices		=	orig_numindices;
+					mesh_saver->indices				=	orig_indices;
+
 					mesh_saver->save(mGeoMesh,file_name);
+
 					delete	mesh_saver;
+
 					oLodStrip->Save(file_name);
 
 					//	Delete simplified mesh.
 					delete	mMeshSimplifier;
-					//	Close file.
-					//						delete	oSerializer;				
 				}
 				else
@@ -1269,22 +1283,7 @@
 				}
 
-				//	Deletes the siplification sequence object.
-				//delete	oMeshSimpSequence;
-
-				if (mApplicationState==LODTREES_AUTO)
-				{
-					//	Open file chooser dialog.
-/*					file_name	=	fltk::file_chooser("Build LOD","*","");
-					
-					if (!file_name)
-					{
-						break;
-					}*/
-
-					std::cout << "Creando secuencia de simplificacion de hojas...";
-					
+				if (mApplicationState == LODTREES_AUTO)
+				{
 					createLeavesSequence(file_name);
-					
-					std::cout << "OK!" << std::endl;		
 				}
 			}
@@ -1293,8 +1292,4 @@
 		//	Refresh data aplication.
 		refreshApplicationBar();
-
-		//	Set textures.
-		geoMeshView->resetTextures();
-		setTextures();
 	}	
 }
@@ -2278,8 +2273,4 @@
 		//	Repaint the window.
 		mMainWindow->redraw();
-
-		//	Set textures.
-		geoMeshView->resetTextures();
-		setTextures();
 	}
 }
@@ -2447,11 +2438,11 @@
 			mMB->label(char_value);
 
+			//	Set textures.
+			geoMeshView->resetTextures();
+			setTextures();
+
 			//	Visualize mesh.
 			geoMeshView->setMesh(mGeoMesh);
 			
-			//	Set textures.
-			geoMeshView->resetTextures();
-			setTextures();
-
 			//	Hide right panel.
 			hideRightPanel();
@@ -2511,9 +2502,19 @@
 		material	= string(mGeoMesh->mSubMesh[submesh].mMaterialName);
 
+		//	If exists material.
 		if (loader->existsMaterial(material))
-		{			
+		{
+			//	Gets file name.
 			filename	=	loader->getTextureFileName(material);
 
-			geoMeshView->LoadTextureSubMesh(submesh,	filename.c_str());
+			geoMeshView->addTexFile(filename.c_str());
+		}
+		//	If not exists material.
+		else
+		{
+			//	File name empty.
+			filename	=	string();
+
+			geoMeshView->addTexFile(filename.c_str());
 		}
 	}
Index: GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshView.cpp
===================================================================
--- GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshView.cpp	(revision 1543)
+++ GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshView.cpp	(revision 1549)
@@ -451,5 +451,5 @@
 void GeoMeshView::setMesh(Mesh	*geomesh)
 {
-	GLfloat color_blanco[]	=	{1.0f,1.0f,1.0f,1.0f};
+	GLfloat white_color[]	=	{1.0f,1.0f,1.0f,1.0f};
 
 	this->geoMesh			=	geomesh;
@@ -461,5 +461,5 @@
 	refreshVertices(geomesh);
 	
-	glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,color_blanco);
+	glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,white_color);
 
 	if (current_texture_submesh)
@@ -470,7 +470,9 @@
 	current_texture_submesh	=	new GLuint[getSubMeshCount()];
 
-	for (int i=0; i<getSubMeshCount(); i++)
+	for (int i	=	0; i < getSubMeshCount(); i++)
 	{
 		current_texture_submesh[i]	=	0;
+
+		LoadTextureSubMesh(i,	mMeshTexFiles[i].c_str());
 	}
 }
@@ -709,5 +711,5 @@
 			//	The end of the index array.
 			indexEnd	= &geosubmesh->mIndex[geosubmesh->mIndexCount];
-            size= indexEnd - indexBegin;
+			size= indexEnd - indexBegin;
 		}
 		else
@@ -716,8 +718,8 @@
 			indexEnd	= geosubmesh->mStrip[strip + 1];
 
-		for (index = indexBegin; index < indexEnd; index++)
-		{
-			size++;
-		}
+			for (index = indexBegin; index < indexEnd; index++)
+			{
+				size++;
+			}
 			//	Remove degenerated
 			//indexEnd--;
@@ -744,32 +746,36 @@
 
 
-	//VERTEX ARRAYS
-	glEnableClientState(GL_VERTEX_ARRAY);
-	glEnableClientState(GL_NORMAL_ARRAY);
-	if (usetex)
-		glEnableClientState(GL_TEXTURE_COORD_ARRAY);
-	else
-		glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+		//VERTEX ARRAYS
+		glEnableClientState(GL_VERTEX_ARRAY);
+		glEnableClientState(GL_NORMAL_ARRAY);
+
+		if (usetex)
+		{
+			glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+		}
+		else
+		{
+			glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+		}
 
 		glVertexPointer(3, GL_FLOAT, 0, geosubmesh->mVertexBuffer->mPosition);
 		glNormalPointer(GL_FLOAT, 0, geosubmesh->mVertexBuffer->mNormal);
+
 		if (usetex)
+		{
 			glTexCoordPointer(2, GL_FLOAT, 0, geosubmesh->mVertexBuffer->mTexCoords);
+		}
 
 		glDrawElements(	GL_TRIANGLE_STRIP,
-			size
-			,
-			GL_UNSIGNED_INT,
-			indexBegin
-			);
-
-	if (submesh==leavesSubMesh)
-	{
-		glDisable(GL_ALPHA_TEST);
-		glLightModeli(GL_LIGHT_MODEL_TWO_SIDE,0);
-	}
-
-	}
-
+										size,
+										GL_UNSIGNED_INT,
+										indexBegin);
+
+		if (submesh == leavesSubMesh)
+		{
+			glDisable(GL_ALPHA_TEST);
+			glLightModeli(GL_LIGHT_MODEL_TWO_SIDE,0);
+		}
+	}
 }//End drawTriangleStrip.
 
@@ -1221,8 +1227,25 @@
 	{
 		disableColorStrips();
+
 		//glDisable(GL_LIGHTING);
-		glColor3d(0.0, 0.0, 0.0);
-
-		GLfloat color[]	=	{0.0f,0.0f,0.0f,1.0f};
+
+		GLfloat color[4];
+
+		if (mSolid)
+		{
+			glColor3d(0.0, 0.0, 0.0);
+			color[0]	=	0.0f;
+			color[1]	=	0.0f;
+			color[2]	=	0.0f;
+			color[3]	=	1.0f;
+		}
+		else
+		{
+			glColor3d(1.0, 1.0, 1.0);
+			color[0]	=	1.0f;
+			color[1]	=	1.0f;
+			color[2]	=	1.0f;
+			color[3]	=	1.0f;
+		}
 
 		glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,color);
@@ -1282,6 +1305,21 @@
 }
 
+//	Add texture file name to the list of texture files of mesh.
+void	GeoMeshView::addTexFile(const char *imgfile)
+{
+	mMeshTexFiles.push_back(string(imgfile));
+}
+
+//	Change texture file of a given submesh.
+void	GeoMeshView::changeTexFile(int isubmesh, const char *imgfile)
+{
+	mMeshTexFiles[isubmesh]	=	string(imgfile);
+}
+
 void	GeoMeshView::resetTextures(void)
 {
+	//	Clears texture files list.
+	mMeshTexFiles.clear();
+
 	if (current_texture)
 	{
