Index: /GTP/trunk/Lib/Geom/shared/GTGeometry/include/hoja.h
===================================================================
--- /GTP/trunk/Lib/Geom/shared/GTGeometry/include/hoja.h	(revision 832)
+++ /GTP/trunk/Lib/Geom/shared/GTGeometry/include/hoja.h	(revision 834)
@@ -10,4 +10,5 @@
 		float  Normal[3];
 		float  Cuantas_hojas;
+		float Centro[3];
 		int padre;
 		int hijoi;
@@ -15,5 +16,16 @@
 		int visible;
 		int raiz;
-	
+
+		bool existe;
+		int hoja_cerca;
+		float dist;
+		long int hoja_cop;
+		float coplanar;
+		float criterio;
+		long int hoja_crit;
+
+		
+		// Identificadores de los triángulos que forman la hoja
+		long int id_triangulo[2];
 		
 	public :
@@ -23,5 +35,6 @@
 		virtual ~Hoja (void); // Destructor
 
-
+		float Distancia (Hoja&);
+		float Coplanaridad (Hoja&);
 };
 
Index: /GTP/trunk/Lib/Geom/shared/GTGeometry/src/libs/leaves/Arbol.cpp
===================================================================
--- /GTP/trunk/Lib/Geom/shared/GTGeometry/src/libs/leaves/Arbol.cpp	(revision 831)
+++ /GTP/trunk/Lib/Geom/shared/GTGeometry/src/libs/leaves/Arbol.cpp	(revision 834)
@@ -522,5 +522,5 @@
 	{
 		j=i;
-		while (Hojas[j].padre != -1) j= Hojas[j].padre;
+		while (Hojas[j].padre > -1) j= Hojas[j].padre;
 		Hojas[i].raiz = j;
 
Index: /GTP/trunk/Lib/Geom/shared/GTGeometry/src/libs/leaves/Hoja.cpp
===================================================================
--- /GTP/trunk/Lib/Geom/shared/GTGeometry/src/libs/leaves/Hoja.cpp	(revision 830)
+++ /GTP/trunk/Lib/Geom/shared/GTGeometry/src/libs/leaves/Hoja.cpp	(revision 834)
@@ -1,3 +1,3 @@
-#include <GL\glut.h>
+#include <math.h>
 #include "Hoja.h"
 
@@ -7,15 +7,15 @@
 //--------------------------------------------------------------------------------------------------------------------------------
 Hoja::Hoja(void) 
-{
-	
-	Vert_Hoja[0] = Vert_Hoja[1] = Vert_Hoja[2] = Vert_Hoja[3] = 0;
+{	
+	Vert_Hoja[0] = Vert_Hoja[1] = Vert_Hoja[2] = Vert_Hoja[3] =0; 
+	Centro[0] = Centro[1] = Centro[2] = 0;
 	Normal[0] = Normal[1] = Normal[2] = 0;
+	hoja_cerca=-1;
+	Cuantas_hojas = 1;
+	dist = coplanar = criterio = hoja_cop = hoja_crit =-1;
+	existe = true;
 	padre=-1;
-	Cuantas_hojas = 1;
 	hijoi = hijod = -1;
 	raiz= visible= -1;
-//	prev = next = -1;
-	
-		
 }
 
@@ -27,7 +27,19 @@
 Hoja::Hoja (const Hoja& aHoja)
 {
-
-
 	Cuantas_hojas = aHoja.Cuantas_hojas;;
+	hoja_cerca = aHoja.hoja_cerca;
+	hoja_crit = aHoja.hoja_crit;
+	dist = aHoja.dist;
+	existe = aHoja.existe;
+	coplanar = aHoja.coplanar;
+	hoja_cop = aHoja.hoja_cop;
+	criterio = aHoja.criterio;
+	for ( int i=0;i<3;i++){
+		Centro[i] = aHoja.Centro[i];
+		Normal[i] = aHoja.Normal[i];
+	}
+	for (i = 0L; i < 4; i++)
+		Vert_Hoja[i] = aHoja.Vert_Hoja[i]; 
+	
 	padre = aHoja.padre;
 	hijoi = aHoja.hijoi;
@@ -35,11 +47,4 @@
 	visible = aHoja.visible;
 	raiz = aHoja.raiz;
-	
-	for (int i = 0L; i < 4; i++)
-		Vert_Hoja[i] = aHoja.Vert_Hoja[i]; 
-	for ( i = 0L; i < 3; i++)
-		Normal[i] = aHoja.Normal[i]; 
-	
-
 }
 
@@ -47,5 +52,5 @@
 
 //--------------------------------------------------------------------------------------------------------------------------------
-// Destructor. We must deallocate the memory allocated for pointers to Vert_Hoja and edges
+// Destructor. We must deallocate the memory allocated for pointers to vertices and edges
 //--------------------------------------------------------------------------------------------------------------------------------
 Hoja::~Hoja (void)
@@ -54,2 +59,56 @@
 
 
+//--------------------------------------------------------------------------------------------------------------------------------
+//  CALCULA LA DISTANCIA ENTRE HOJAS
+//--------------------------------------------------------------------------------------------------------------------------------
+
+float Hoja::Distancia (Hoja& Hoja1)
+{
+	float dist =0;
+	float x1,y1,z1;
+
+	x1 = Hoja1.Centro[0]; y1 = Hoja1.Centro[1] ; z1 = Hoja1.Centro[2];
+
+
+	//DISTANCIA ENTRE CENTROS
+
+	dist = ((Centro[0]-x1)*(Centro[0]-x1)) + ((Centro[1]-y1)*(Centro[1]-y1)) + ((Centro[2]-z1)*(Centro[2]-z1));
+
+	return (dist);
+}
+
+
+//--------------------------------------------------------------------------------------------------------------------------------
+//  CALCULA LA COPLANARIDAD ENTRE HOJAS
+//--------------------------------------------------------------------------------------------------------------------------------
+
+float Hoja::Coplanaridad (Hoja& Hoja1)
+{
+	float cop =0;
+	float modulo1, modulo2;
+	float x1,y1,z1, nx1, ny1, nz1;
+	float nx, ny, nz;
+
+	//hoja pasada como parametro, normalizo las componentes
+	x1 = Hoja1.Normal[0]; y1 = Hoja1.Normal[1] ; z1 = Hoja1.Normal[2];
+	modulo1 = sqrt ( (x1*x1) + (y1*y1) + (z1*z1));
+	nx1 = x1 / modulo1;
+	ny1 = y1 / modulo1;
+	nz1 = z1 / modulo1;
+
+	// hoja desde la que llamo
+
+	modulo2 = sqrt ( (Normal[0]*Normal[0]) + (Normal[1]*Normal[1]) + (Normal[2]*Normal[2]));
+	nx = Normal[0] / modulo2;
+	ny = Normal[1] / modulo2;
+	nz = Normal[2] / modulo2;
+
+	// producto escalar : si es proximo a 0, perpendiculares, a 1, coplanares
+
+	cop = (nx1*nx) + (ny1*ny) + (nz1*nz);
+
+
+	return (fabs(cop));
+
+}
+
Index: /GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoTreeSimplifier.cpp
===================================================================
--- /GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoTreeSimplifier.cpp	(revision 774)
+++ /GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoTreeSimplifier.cpp	(revision 834)
@@ -176,7 +176,7 @@
 		v2=mesh->mSubMesh[meshLeaves].mIndex[j+1];
 		v3=mesh->mSubMesh[meshLeaves].mIndex[j+2];
-		Hojasa[pos].Vertices[0]=v1;
-		Hojasa[pos].Vertices[1]=v2;
-		Hojasa[pos].Vertices[2]=v3;
+		Hojasa[pos].Vert_Hoja[0]=v1;
+		Hojasa[pos].Vert_Hoja[1]=v2;
+		Hojasa[pos].Vert_Hoja[2]=v3;
 		num_triangulo++;
 		Hojasa[pos].id_triangulo[0]=num_triangulo;
@@ -184,5 +184,5 @@
 		// Segundo triángulo
 		v3=mesh->mSubMesh[meshLeaves].mIndex[j+5];
-		Hojasa[pos].Vertices[3]=v3;
+		Hojasa[pos].Vert_Hoja[3]=v3;
 		num_triangulo++;
 		Hojasa[pos].id_triangulo[1]=num_triangulo;
@@ -231,39 +231,39 @@
 	
 	//x1
-	max_x	=	max(max(Vertex[Hoja1.Vertices[0]][0],
-									Vertex[Hoja1.Vertices[1]][0]),
-				  		max(Vertex[Hoja1.Vertices[2]][0],
-									Vertex[Hoja1.Vertices[3]][0]));
-	
-	min_x	=	min(min(Vertex[Hoja1.Vertices[0]][0],
-									Vertex[Hoja1.Vertices[1]][0]),
-				  		min(Vertex[Hoja1.Vertices[2]][0],
-									Vertex[Hoja1.Vertices[3]][0]));
+	max_x	=	max(max(Vertex[Hoja1.Vert_Hoja[0]][0],
+									Vertex[Hoja1.Vert_Hoja[1]][0]),
+				  		max(Vertex[Hoja1.Vert_Hoja[2]][0],
+									Vertex[Hoja1.Vert_Hoja[3]][0]));
+	
+	min_x	=	min(min(Vertex[Hoja1.Vert_Hoja[0]][0],
+									Vertex[Hoja1.Vert_Hoja[1]][0]),
+				  		min(Vertex[Hoja1.Vert_Hoja[2]][0],
+									Vertex[Hoja1.Vert_Hoja[3]][0]));
 
 	Hoja1.Centro[0] = (max_x + min_x)/2;
 
 	//y1
-	max_y	=	max(max(Vertex[Hoja1.Vertices[0]][1],
-									Vertex[Hoja1.Vertices[1]][1]),
-				  		max(Vertex[Hoja1.Vertices[2]][1],
-									Vertex[Hoja1.Vertices[3]][1]));
-	
-	min_y	=	min(min(Vertex[Hoja1.Vertices[0]][1],
-									Vertex[Hoja1.Vertices[1]][1]),
-				  		min(Vertex[Hoja1.Vertices[2]][1],
-									Vertex[Hoja1.Vertices[3]][1]));
+	max_y	=	max(max(Vertex[Hoja1.Vert_Hoja[0]][1],
+									Vertex[Hoja1.Vert_Hoja[1]][1]),
+				  		max(Vertex[Hoja1.Vert_Hoja[2]][1],
+									Vertex[Hoja1.Vert_Hoja[3]][1]));
+	
+	min_y	=	min(min(Vertex[Hoja1.Vert_Hoja[0]][1],
+									Vertex[Hoja1.Vert_Hoja[1]][1]),
+				  		min(Vertex[Hoja1.Vert_Hoja[2]][1],
+									Vertex[Hoja1.Vert_Hoja[3]][1]));
 
 	Hoja1.Centro[1]	=	(max_y + min_y) / 2;
 	
 	//z1
-	max_z	=	max(max(Vertex[Hoja1.Vertices[0]][2],
-									Vertex[Hoja1.Vertices[1]][2]),
-				  		max(Vertex[Hoja1.Vertices[2]][2],
-									Vertex[Hoja1.Vertices[3]][2]));
-	
-	min_z	=	min(min(Vertex[Hoja1.Vertices[0]][2],
-									Vertex[Hoja1.Vertices[1]][2]),
-				  		min(Vertex[Hoja1.Vertices[2]][2],
-									Vertex[Hoja1.Vertices[3]][2]));
+	max_z	=	max(max(Vertex[Hoja1.Vert_Hoja[0]][2],
+									Vertex[Hoja1.Vert_Hoja[1]][2]),
+				  		max(Vertex[Hoja1.Vert_Hoja[2]][2],
+									Vertex[Hoja1.Vert_Hoja[3]][2]));
+	
+	min_z	=	min(min(Vertex[Hoja1.Vert_Hoja[0]][2],
+									Vertex[Hoja1.Vert_Hoja[1]][2]),
+				  		min(Vertex[Hoja1.Vert_Hoja[2]][2],
+									Vertex[Hoja1.Vert_Hoja[3]][2]));
 
 	Hoja1.Centro[2]	=	(max_z + min_z) / 2;
@@ -279,7 +279,7 @@
 	float threex, threey, threez;
 
-	onex=Vertex[aHoja.Vertices[0]][0]; oney= Vertex[aHoja.Vertices[0]][1]; onez = Vertex[aHoja.Vertices[0]][2];
-	twox = Vertex[aHoja.Vertices[1]][0]; twoy = Vertex[aHoja.Vertices[1]][1]; twoz = Vertex[aHoja.Vertices[1]][2];
-	threex = Vertex[aHoja.Vertices[2]][0]; threey = Vertex[aHoja.Vertices[2]][1]; threez = Vertex[aHoja.Vertices[2]][2];
+	onex=Vertex[aHoja.Vert_Hoja[0]][0]; oney= Vertex[aHoja.Vert_Hoja[0]][1]; onez = Vertex[aHoja.Vert_Hoja[0]][2];
+	twox = Vertex[aHoja.Vert_Hoja[1]][0]; twoy = Vertex[aHoja.Vert_Hoja[1]][1]; twoz = Vertex[aHoja.Vert_Hoja[1]][2];
+	threex = Vertex[aHoja.Vert_Hoja[2]][0]; threey = Vertex[aHoja.Vert_Hoja[2]][1]; threez = Vertex[aHoja.Vert_Hoja[2]][2];
 	
 	aHoja.Normal[0] = ((twoz-onez)*(threey-oney)) - ((twoy-oney)*(threez-onez));
@@ -304,14 +304,14 @@
 	float dist1, dist2, dist3, dist4, distmp, dista, distb, dist;
 
-	onex=Vertex[aHoja.Vertices[0]][0]; oney= Vertex[aHoja.Vertices[0]][1]; onez = Vertex[aHoja.Vertices[0]][2];
-	twox = Vertex[aHoja.Vertices[1]][0]; twoy = Vertex[aHoja.Vertices[1]][1]; twoz = Vertex[aHoja.Vertices[1]][2];
-	threex = Vertex[aHoja.Vertices[2]][0]; threey = Vertex[aHoja.Vertices[2]][1]; threez = Vertex[aHoja.Vertices[2]][2];
-	fourx = Vertex[aHoja.Vertices[3]][0]; foury = Vertex[aHoja.Vertices[3]][1]; fourz = Vertex[aHoja.Vertices[3]][2];
-	
-
-	x1 = Vertex[h2.Vertices[0]][0]; y1 = Vertex[h2.Vertices[0]][1]; z1 = Vertex[h2.Vertices[0]][2];
-	x2 = Vertex[h2.Vertices[1]][0]; y2 = Vertex[h2.Vertices[1]][1]; z2 = Vertex[h2.Vertices[1]][2];
-	x3 = Vertex[h2.Vertices[2]][0]; y3 = Vertex[h2.Vertices[2]][1]; z3 = Vertex[h2.Vertices[2]][2];
-	x4 = Vertex[h2.Vertices[3]][0]; y4 = Vertex[h2.Vertices[3]][1]; z4 = Vertex[h2.Vertices[3]][2];
+	onex=Vertex[aHoja.Vert_Hoja[0]][0]; oney= Vertex[aHoja.Vert_Hoja[0]][1]; onez = Vertex[aHoja.Vert_Hoja[0]][2];
+	twox = Vertex[aHoja.Vert_Hoja[1]][0]; twoy = Vertex[aHoja.Vert_Hoja[1]][1]; twoz = Vertex[aHoja.Vert_Hoja[1]][2];
+	threex = Vertex[aHoja.Vert_Hoja[2]][0]; threey = Vertex[aHoja.Vert_Hoja[2]][1]; threez = Vertex[aHoja.Vert_Hoja[2]][2];
+	fourx = Vertex[aHoja.Vert_Hoja[3]][0]; foury = Vertex[aHoja.Vert_Hoja[3]][1]; fourz = Vertex[aHoja.Vert_Hoja[3]][2];
+	
+
+	x1 = Vertex[h2.Vert_Hoja[0]][0]; y1 = Vertex[h2.Vert_Hoja[0]][1]; z1 = Vertex[h2.Vert_Hoja[0]][2];
+	x2 = Vertex[h2.Vert_Hoja[1]][0]; y2 = Vertex[h2.Vert_Hoja[1]][1]; z2 = Vertex[h2.Vert_Hoja[1]][2];
+	x3 = Vertex[h2.Vert_Hoja[2]][0]; y3 = Vertex[h2.Vert_Hoja[2]][1]; z3 = Vertex[h2.Vert_Hoja[2]][2];
+	x4 = Vertex[h2.Vert_Hoja[3]][0]; y4 = Vertex[h2.Vert_Hoja[3]][1]; z4 = Vertex[h2.Vert_Hoja[3]][2];
 
 	// guardo las distancias mínimas de cada vértice a los 4 contrarios.
@@ -648,11 +648,11 @@
 	//inicializo al primero de los vértices de las hojas
 
-	xmax = Vertex[Hojasa[0].Vertices[0]][0];
+	xmax = Vertex[Hojasa[0].Vert_Hoja[0]][0];
 	xmin = xmax;
 
-	ymax = Vertex[Hojasa[0].Vertices[0]][1];
+	ymax = Vertex[Hojasa[0].Vert_Hoja[0]][1];
 	ymin = ymax;
 
-	zmax = Vertex[Hojasa[0].Vertices[0]][2];
+	zmax = Vertex[Hojasa[0].Vert_Hoja[0]][2];
 	zmin = zmax;
 
@@ -674,12 +674,12 @@
 		{
 			
-		if ( xmax < Vertex[Hojasa[i].Vertices[j]][0]) xmax = Vertex[Hojasa[i].Vertices[j]][0];
-		if ( xmin > Vertex[Hojasa[i].Vertices[j]][0]) xmin = Vertex[Hojasa[i].Vertices[j]][0];
-
-		if ( ymax < Vertex[Hojasa[i].Vertices[j]][1]) ymax = Vertex[Hojasa[i].Vertices[j]][1];
-		if ( ymin > Vertex[Hojasa[i].Vertices[j]][1]) ymin = Vertex[Hojasa[i].Vertices[j]][1];
+		if ( xmax < Vertex[Hojasa[i].Vert_Hoja[j]][0]) xmax = Vertex[Hojasa[i].Vert_Hoja[j]][0];
+		if ( xmin > Vertex[Hojasa[i].Vert_Hoja[j]][0]) xmin = Vertex[Hojasa[i].Vert_Hoja[j]][0];
+
+		if ( ymax < Vertex[Hojasa[i].Vert_Hoja[j]][1]) ymax = Vertex[Hojasa[i].Vert_Hoja[j]][1];
+		if ( ymin > Vertex[Hojasa[i].Vert_Hoja[j]][1]) ymin = Vertex[Hojasa[i].Vert_Hoja[j]][1];
 		
-		if ( zmax < Vertex[Hojasa[i].Vertices[j]][2]) zmax = Vertex[Hojasa[i].Vertices[j]][2];
-		if ( zmin > Vertex[Hojasa[i].Vertices[j]][2]) zmin = Vertex[Hojasa[i].Vertices[j]][2];
+		if ( zmax < Vertex[Hojasa[i].Vert_Hoja[j]][2]) zmax = Vertex[Hojasa[i].Vert_Hoja[j]][2];
+		if ( zmin > Vertex[Hojasa[i].Vert_Hoja[j]][2]) zmin = Vertex[Hojasa[i].Vert_Hoja[j]][2];
 
 		}
@@ -900,7 +900,7 @@
 
 
-	a = Vertex[Hoja1.Vertices[0]][0];
-	b = Vertex[Hoja1.Vertices[0]][1];
-	c = Vertex[Hoja1.Vertices[0]][2];
+	a = Vertex[Hoja1.Vert_Hoja[0]][0];
+	b = Vertex[Hoja1.Vert_Hoja[0]][1];
+	c = Vertex[Hoja1.Vert_Hoja[0]][2];
 
 	dist[0] = ((Hoja2.Centro[0]-a)*(Hoja2.Centro[0]-a)) + ((Hoja2.Centro[1]-b)*(Hoja2.Centro[1]-b)) +
@@ -908,14 +908,14 @@
 
 	
-	a = Vertex[Hoja1.Vertices[1]][0];
-	b = Vertex[Hoja1.Vertices[1]][1];
-	c = Vertex[Hoja1.Vertices[1]][2];
+	a = Vertex[Hoja1.Vert_Hoja[1]][0];
+	b = Vertex[Hoja1.Vert_Hoja[1]][1];
+	c = Vertex[Hoja1.Vert_Hoja[1]][2];
 
 	dist[1] = ((Hoja2.Centro[0]-a)*(Hoja2.Centro[0]-a)) + ((Hoja2.Centro[1]-b)*(Hoja2.Centro[1]-b)) +
 		   ((Hoja2.Centro[2]-c)*(Hoja2.Centro[2]-c));
 
-	a = Vertex[Hoja1.Vertices[2]][0];
-	b = Vertex[Hoja1.Vertices[2]][1];
-	c = Vertex[Hoja1.Vertices[2]][2];
+	a = Vertex[Hoja1.Vert_Hoja[2]][0];
+	b = Vertex[Hoja1.Vert_Hoja[2]][1];
+	c = Vertex[Hoja1.Vert_Hoja[2]][2];
 
 	dist[2] = ((Hoja2.Centro[0]-a)*(Hoja2.Centro[0]-a)) + ((Hoja2.Centro[1]-b)*(Hoja2.Centro[1]-b)) +
@@ -923,7 +923,7 @@
 
 
-	a = Vertex[Hoja1.Vertices[3]][0];
-	b = Vertex[Hoja1.Vertices[3]][1];
-	c = Vertex[Hoja1.Vertices[3]][2];
+	a = Vertex[Hoja1.Vert_Hoja[3]][0];
+	b = Vertex[Hoja1.Vert_Hoja[3]][1];
+	c = Vertex[Hoja1.Vert_Hoja[3]][2];
 
 	dist[3] = ((Hoja2.Centro[0]-a)*(Hoja2.Centro[0]-a)) + ((Hoja2.Centro[1]-b)*(Hoja2.Centro[1]-b)) +
@@ -934,13 +934,13 @@
 	DosMayores(dist, indices);
 	
-	Hojasa[counth].Vertices[0] = Hoja1.Vertices[indices[0]]; 
-	Hojasa[counth].Vertices[1] = Hoja1.Vertices[indices[1]]; 
+	Hojasa[counth].Vert_Hoja[0] = Hoja1.Vert_Hoja[indices[0]]; 
+	Hojasa[counth].Vert_Hoja[1] = Hoja1.Vert_Hoja[indices[1]]; 
 	
 	// segunda hoja los dos ultimos vertices
 
 	
-	a = Vertex[Hoja2.Vertices[0]][0];
-	b = Vertex[Hoja2.Vertices[0]][1];
-	c = Vertex[Hoja2.Vertices[0]][2];
+	a = Vertex[Hoja2.Vert_Hoja[0]][0];
+	b = Vertex[Hoja2.Vert_Hoja[0]][1];
+	c = Vertex[Hoja2.Vert_Hoja[0]][2];
 
 	dist[0] = ((Hoja1.Centro[0]-a)*(Hoja1.Centro[0]-a)) + ((Hoja1.Centro[1]-b)*(Hoja1.Centro[1]-b)) +
@@ -948,14 +948,14 @@
 
 	
-	a = Vertex[Hoja2.Vertices[1]][0];
-	b = Vertex[Hoja2.Vertices[1]][1];
-	c = Vertex[Hoja2.Vertices[1]][2];
+	a = Vertex[Hoja2.Vert_Hoja[1]][0];
+	b = Vertex[Hoja2.Vert_Hoja[1]][1];
+	c = Vertex[Hoja2.Vert_Hoja[1]][2];
 
 	dist[1] = ((Hoja2.Centro[0]-a)*(Hoja2.Centro[0]-a)) + ((Hoja1.Centro[1]-b)*(Hoja1.Centro[1]-b)) +
 		   ((Hoja2.Centro[2]-c)*(Hoja2.Centro[2]-c));
 
-	a = Vertex[Hoja2.Vertices[2]][0];
-	b = Vertex[Hoja2.Vertices[2]][1];
-	c = Vertex[Hoja2.Vertices[2]][2];
+	a = Vertex[Hoja2.Vert_Hoja[2]][0];
+	b = Vertex[Hoja2.Vert_Hoja[2]][1];
+	c = Vertex[Hoja2.Vert_Hoja[2]][2];
 
 	dist[2] = ((Hoja1.Centro[0]-a)*(Hoja1.Centro[0]-a)) + ((Hoja1.Centro[1]-b)*(Hoja1.Centro[1]-b)) +
@@ -963,7 +963,7 @@
 
 
-	a = Vertex[Hoja2.Vertices[3]][0];
-	b = Vertex[Hoja2.Vertices[3]][1];
-	c = Vertex[Hoja2.Vertices[3]][2];
+	a = Vertex[Hoja2.Vert_Hoja[3]][0];
+	b = Vertex[Hoja2.Vert_Hoja[3]][1];
+	c = Vertex[Hoja2.Vert_Hoja[3]][2];
 
 	dist[3] = ((Hoja1.Centro[0]-a)*(Hoja1.Centro[0]-a)) + ((Hoja1.Centro[1]-b)*(Hoja1.Centro[1]-b)) +
@@ -974,6 +974,6 @@
 	DosMayores(dist, indices);
 	
-	Hojasa[counth].Vertices[2] = Hoja2.Vertices[indices[0]]; 
-	Hojasa[counth].Vertices[3] = Hoja2.Vertices[indices[1]]; 
+	Hojasa[counth].Vert_Hoja[2] = Hoja2.Vert_Hoja[indices[0]]; 
+	Hojasa[counth].Vert_Hoja[3] = Hoja2.Vert_Hoja[indices[1]]; 
 
 
@@ -1057,8 +1057,8 @@
 
 	// Nuevos vértices
-	pasosimp.mNewQuad[0]=Hojasa[counth].Vertices[0];
-	pasosimp.mNewQuad[1]=Hojasa[counth].Vertices[1];
-	pasosimp.mNewQuad[2]=Hojasa[counth].Vertices[2];
-	pasosimp.mNewQuad[3]=Hojasa[counth].Vertices[3];
+	pasosimp.mNewQuad[0]=Hojasa[counth].Vert_Hoja[0];
+	pasosimp.mNewQuad[1]=Hojasa[counth].Vert_Hoja[1];
+	pasosimp.mNewQuad[2]=Hojasa[counth].Vert_Hoja[2];
+	pasosimp.mNewQuad[3]=Hojasa[counth].Vert_Hoja[3];
 
 	// Insertar el paso de simplificación
@@ -1104,10 +1104,10 @@
 		if ( Hojasa[j].existe == true) // si la hoja aun existe
 		{
-			mesh->mSubMesh[idMeshLeaves].mIndex[indice]=Hojasa[j].Vertices[0];
-			mesh->mSubMesh[idMeshLeaves].mIndex[indice+1]=Hojasa[j].Vertices[1];
-			mesh->mSubMesh[idMeshLeaves].mIndex[indice+2]=Hojasa[j].Vertices[2];
-			mesh->mSubMesh[idMeshLeaves].mIndex[indice+3]=Hojasa[j].Vertices[2];
-			mesh->mSubMesh[idMeshLeaves].mIndex[indice+4]=Hojasa[j].Vertices[1];
-			mesh->mSubMesh[idMeshLeaves].mIndex[indice+5]=Hojasa[j].Vertices[3];
+			mesh->mSubMesh[idMeshLeaves].mIndex[indice]=Hojasa[j].Vert_Hoja[0];
+			mesh->mSubMesh[idMeshLeaves].mIndex[indice+1]=Hojasa[j].Vert_Hoja[1];
+			mesh->mSubMesh[idMeshLeaves].mIndex[indice+2]=Hojasa[j].Vert_Hoja[2];
+			mesh->mSubMesh[idMeshLeaves].mIndex[indice+3]=Hojasa[j].Vert_Hoja[2];
+			mesh->mSubMesh[idMeshLeaves].mIndex[indice+4]=Hojasa[j].Vert_Hoja[1];
+			mesh->mSubMesh[idMeshLeaves].mIndex[indice+5]=Hojasa[j].Vert_Hoja[3];
 			indice=indice+6;
 		}
Index: P/trunk/Lib/Geom/shared/GTGeometry/src/hoja.cpp
===================================================================
--- /GTP/trunk/Lib/Geom/shared/GTGeometry/src/hoja.cpp	(revision 774)
+++ 	(revision )
@@ -1,117 +1,0 @@
-#include <math.h>
-#include "Hoja.h"
-
-//--------------------------------------------------------------------------------------------------------------------------------
-// Void constructor
-// Parameters --> None
-//--------------------------------------------------------------------------------------------------------------------------------
-Hoja::Hoja(void) 
-{
-	
-	Vertices[0] = Vertices[1] = Vertices[2] = Vertices[3] =0; 
-	Centro[0] = Centro[1] = Centro[2] = 0;
-	Normal[0] = Normal[1] = Normal[2] = 0;
-	hoja_cerca=-1;
-	Cuantas_hojas = 1;
-	
-	dist			=	-1;
-	coplanar	=	-1;
-	criterio	=	-1;
-	hoja_cop	=	-1;
-	hoja_crit =	-1;
-	
-	existe = true;
-		
-}
-
-
-//--------------------------------------------------------------------------------------------------------------------------------
-// Copy constructor
-// Parameters --> const Hoja& aHoja : The Hoja to copy
-//--------------------------------------------------------------------------------------------------------------------------------
-Hoja::Hoja (const Hoja& aHoja)
-{
-
-
-	Cuantas_hojas = aHoja.Cuantas_hojas;;
-	hoja_cerca = aHoja.hoja_cerca;
-	hoja_crit = aHoja.hoja_crit;
-	dist = aHoja.dist;
-	existe = aHoja.existe;
-	coplanar = aHoja.coplanar;
-	hoja_cop = aHoja.hoja_cop;
-	criterio = aHoja.criterio;
-	for ( int i=0;i<3;i++){
-		Centro[i] = aHoja.Centro[i];
-		Normal[i] = aHoja.Normal[i];
-	}
-	for (i = 0L; i < 4; i++)
-		Vertices[i] = aHoja.Vertices[i]; 
-	
-
-}
-
-
-
-//--------------------------------------------------------------------------------------------------------------------------------
-// Destructor. We must deallocate the memory allocated for pointers to vertices and edges
-//--------------------------------------------------------------------------------------------------------------------------------
-Hoja::~Hoja (void)
-{
-}
-
-
-//--------------------------------------------------------------------------------------------------------------------------------
-//  CALCULA LA DISTANCIA ENTRE HOJAS
-//--------------------------------------------------------------------------------------------------------------------------------
-
-float Hoja::Distancia (Hoja& Hoja1)
-{
-	float dist =0;
-	float x1,y1,z1;
-
-	x1 = Hoja1.Centro[0]; y1 = Hoja1.Centro[1] ; z1 = Hoja1.Centro[2];
-
-
-	//DISTANCIA ENTRE CENTROS
-
-	dist = ((Centro[0]-x1)*(Centro[0]-x1)) + ((Centro[1]-y1)*(Centro[1]-y1)) + ((Centro[2]-z1)*(Centro[2]-z1));
-
-	return (dist);
-}
-
-
-//--------------------------------------------------------------------------------------------------------------------------------
-//  CALCULA LA COPLANARIDAD ENTRE HOJAS
-//--------------------------------------------------------------------------------------------------------------------------------
-
-float Hoja::Coplanaridad (Hoja& Hoja1)
-{
-	float cop =0;
-	float modulo1, modulo2;
-	float x1,y1,z1, nx1, ny1, nz1;
-	float nx, ny, nz;
-
-	//hoja pasada como parametro, normalizo las componentes
-	x1 = Hoja1.Normal[0]; y1 = Hoja1.Normal[1] ; z1 = Hoja1.Normal[2];
-	modulo1 = sqrt ( (x1*x1) + (y1*y1) + (z1*z1));
-	nx1 = x1 / modulo1;
-	ny1 = y1 / modulo1;
-	nz1 = z1 / modulo1;
-
-	// hoja desde la que llamo
-
-	modulo2 = sqrt ( (Normal[0]*Normal[0]) + (Normal[1]*Normal[1]) + (Normal[2]*Normal[2]));
-	nx = Normal[0] / modulo2;
-	ny = Normal[1] / modulo2;
-	nz = Normal[2] / modulo2;
-
-	// producto escalar : si es proximo a 0, perpendiculares, a 1, coplanares
-
-	cop = (nx1*nx) + (ny1*ny) + (nz1*nz);
-
-
-	return (fabs(cop));
-
-}
-
Index: /GTP/trunk/Lib/Geom/shared/GTGeometry/GTGeometry.vcproj
===================================================================
--- /GTP/trunk/Lib/Geom/shared/GTGeometry/GTGeometry.vcproj	(revision 831)
+++ /GTP/trunk/Lib/Geom/shared/GTGeometry/GTGeometry.vcproj	(revision 834)
@@ -157,7 +157,4 @@
 			</File>
 			<File
-				RelativePath=".\src\hoja.cpp">
-			</File>
-			<File
 				RelativePath=".\src\policy.cpp">
 			</File>
@@ -377,7 +374,4 @@
 			</File>
 			<File
-				RelativePath=".\src\libs\leaves\hoja.h">
-			</File>
-			<File
 				RelativePath=".\include\hoja.h">
 			</File>
Index: /GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshViewUI.cpp
===================================================================
--- /GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshViewUI.cpp	(revision 829)
+++ /GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshViewUI.cpp	(revision 834)
@@ -1988,5 +1988,7 @@
 
 	//	New lod strips object.
-	lodTreeLib	=	new	Geometry::LodTreeLibrary(lodfile, geomesh);
+	lodTreeLib	=	new	Geometry::LodTreeLibrary(lodfile, geomesh,"\\\\quake\\home\\\Modelos\\betula_populifolia\\vertices.obj",
+										"\\\\quake\\home\\\Modelos\\betula_populifolia\\hojas.obj",
+										"\\\\quake\\home\\\Modelos\\betula_populifolia\\simplifica.obj");
 
 	//	Sets the slider range.
