Changeset 834 for GTP/trunk/Lib
- Timestamp:
- 04/26/06 19:02:47 (19 years ago)
- Location:
- GTP/trunk/Lib/Geom/shared
- Files:
-
- 1 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Geom/shared/GTGeometry/GTGeometry.vcproj
r831 r834 157 157 </File> 158 158 <File 159 RelativePath=".\src\hoja.cpp">160 </File>161 <File162 159 RelativePath=".\src\policy.cpp"> 163 160 </File> … … 377 374 </File> 378 375 <File 379 RelativePath=".\src\libs\leaves\hoja.h">380 </File>381 <File382 376 RelativePath=".\include\hoja.h"> 383 377 </File> -
GTP/trunk/Lib/Geom/shared/GTGeometry/include/hoja.h
r832 r834 10 10 float Normal[3]; 11 11 float Cuantas_hojas; 12 float Centro[3]; 12 13 int padre; 13 14 int hijoi; … … 15 16 int visible; 16 17 int raiz; 17 18 19 bool existe; 20 int hoja_cerca; 21 float dist; 22 long int hoja_cop; 23 float coplanar; 24 float criterio; 25 long int hoja_crit; 26 27 28 // Identificadores de los triángulos que forman la hoja 29 long int id_triangulo[2]; 18 30 19 31 public : … … 23 35 virtual ~Hoja (void); // Destructor 24 36 25 37 float Distancia (Hoja&); 38 float Coplanaridad (Hoja&); 26 39 }; 27 40 -
GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoTreeSimplifier.cpp
r774 r834 176 176 v2=mesh->mSubMesh[meshLeaves].mIndex[j+1]; 177 177 v3=mesh->mSubMesh[meshLeaves].mIndex[j+2]; 178 Hojasa[pos].Vert ices[0]=v1;179 Hojasa[pos].Vert ices[1]=v2;180 Hojasa[pos].Vert ices[2]=v3;178 Hojasa[pos].Vert_Hoja[0]=v1; 179 Hojasa[pos].Vert_Hoja[1]=v2; 180 Hojasa[pos].Vert_Hoja[2]=v3; 181 181 num_triangulo++; 182 182 Hojasa[pos].id_triangulo[0]=num_triangulo; … … 184 184 // Segundo triángulo 185 185 v3=mesh->mSubMesh[meshLeaves].mIndex[j+5]; 186 Hojasa[pos].Vert ices[3]=v3;186 Hojasa[pos].Vert_Hoja[3]=v3; 187 187 num_triangulo++; 188 188 Hojasa[pos].id_triangulo[1]=num_triangulo; … … 231 231 232 232 //x1 233 max_x = max(max(Vertex[Hoja1.Vert ices[0]][0],234 Vertex[Hoja1.Vert ices[1]][0]),235 max(Vertex[Hoja1.Vert ices[2]][0],236 Vertex[Hoja1.Vert ices[3]][0]));237 238 min_x = min(min(Vertex[Hoja1.Vert ices[0]][0],239 Vertex[Hoja1.Vert ices[1]][0]),240 min(Vertex[Hoja1.Vert ices[2]][0],241 Vertex[Hoja1.Vert ices[3]][0]));233 max_x = max(max(Vertex[Hoja1.Vert_Hoja[0]][0], 234 Vertex[Hoja1.Vert_Hoja[1]][0]), 235 max(Vertex[Hoja1.Vert_Hoja[2]][0], 236 Vertex[Hoja1.Vert_Hoja[3]][0])); 237 238 min_x = min(min(Vertex[Hoja1.Vert_Hoja[0]][0], 239 Vertex[Hoja1.Vert_Hoja[1]][0]), 240 min(Vertex[Hoja1.Vert_Hoja[2]][0], 241 Vertex[Hoja1.Vert_Hoja[3]][0])); 242 242 243 243 Hoja1.Centro[0] = (max_x + min_x)/2; 244 244 245 245 //y1 246 max_y = max(max(Vertex[Hoja1.Vert ices[0]][1],247 Vertex[Hoja1.Vert ices[1]][1]),248 max(Vertex[Hoja1.Vert ices[2]][1],249 Vertex[Hoja1.Vert ices[3]][1]));250 251 min_y = min(min(Vertex[Hoja1.Vert ices[0]][1],252 Vertex[Hoja1.Vert ices[1]][1]),253 min(Vertex[Hoja1.Vert ices[2]][1],254 Vertex[Hoja1.Vert ices[3]][1]));246 max_y = max(max(Vertex[Hoja1.Vert_Hoja[0]][1], 247 Vertex[Hoja1.Vert_Hoja[1]][1]), 248 max(Vertex[Hoja1.Vert_Hoja[2]][1], 249 Vertex[Hoja1.Vert_Hoja[3]][1])); 250 251 min_y = min(min(Vertex[Hoja1.Vert_Hoja[0]][1], 252 Vertex[Hoja1.Vert_Hoja[1]][1]), 253 min(Vertex[Hoja1.Vert_Hoja[2]][1], 254 Vertex[Hoja1.Vert_Hoja[3]][1])); 255 255 256 256 Hoja1.Centro[1] = (max_y + min_y) / 2; 257 257 258 258 //z1 259 max_z = max(max(Vertex[Hoja1.Vert ices[0]][2],260 Vertex[Hoja1.Vert ices[1]][2]),261 max(Vertex[Hoja1.Vert ices[2]][2],262 Vertex[Hoja1.Vert ices[3]][2]));263 264 min_z = min(min(Vertex[Hoja1.Vert ices[0]][2],265 Vertex[Hoja1.Vert ices[1]][2]),266 min(Vertex[Hoja1.Vert ices[2]][2],267 Vertex[Hoja1.Vert ices[3]][2]));259 max_z = max(max(Vertex[Hoja1.Vert_Hoja[0]][2], 260 Vertex[Hoja1.Vert_Hoja[1]][2]), 261 max(Vertex[Hoja1.Vert_Hoja[2]][2], 262 Vertex[Hoja1.Vert_Hoja[3]][2])); 263 264 min_z = min(min(Vertex[Hoja1.Vert_Hoja[0]][2], 265 Vertex[Hoja1.Vert_Hoja[1]][2]), 266 min(Vertex[Hoja1.Vert_Hoja[2]][2], 267 Vertex[Hoja1.Vert_Hoja[3]][2])); 268 268 269 269 Hoja1.Centro[2] = (max_z + min_z) / 2; … … 279 279 float threex, threey, threez; 280 280 281 onex=Vertex[aHoja.Vert ices[0]][0]; oney= Vertex[aHoja.Vertices[0]][1]; onez = Vertex[aHoja.Vertices[0]][2];282 twox = Vertex[aHoja.Vert ices[1]][0]; twoy = Vertex[aHoja.Vertices[1]][1]; twoz = Vertex[aHoja.Vertices[1]][2];283 threex = Vertex[aHoja.Vert ices[2]][0]; threey = Vertex[aHoja.Vertices[2]][1]; threez = Vertex[aHoja.Vertices[2]][2];281 onex=Vertex[aHoja.Vert_Hoja[0]][0]; oney= Vertex[aHoja.Vert_Hoja[0]][1]; onez = Vertex[aHoja.Vert_Hoja[0]][2]; 282 twox = Vertex[aHoja.Vert_Hoja[1]][0]; twoy = Vertex[aHoja.Vert_Hoja[1]][1]; twoz = Vertex[aHoja.Vert_Hoja[1]][2]; 283 threex = Vertex[aHoja.Vert_Hoja[2]][0]; threey = Vertex[aHoja.Vert_Hoja[2]][1]; threez = Vertex[aHoja.Vert_Hoja[2]][2]; 284 284 285 285 aHoja.Normal[0] = ((twoz-onez)*(threey-oney)) - ((twoy-oney)*(threez-onez)); … … 304 304 float dist1, dist2, dist3, dist4, distmp, dista, distb, dist; 305 305 306 onex=Vertex[aHoja.Vert ices[0]][0]; oney= Vertex[aHoja.Vertices[0]][1]; onez = Vertex[aHoja.Vertices[0]][2];307 twox = Vertex[aHoja.Vert ices[1]][0]; twoy = Vertex[aHoja.Vertices[1]][1]; twoz = Vertex[aHoja.Vertices[1]][2];308 threex = Vertex[aHoja.Vert ices[2]][0]; threey = Vertex[aHoja.Vertices[2]][1]; threez = Vertex[aHoja.Vertices[2]][2];309 fourx = Vertex[aHoja.Vert ices[3]][0]; foury = Vertex[aHoja.Vertices[3]][1]; fourz = Vertex[aHoja.Vertices[3]][2];310 311 312 x1 = Vertex[h2.Vert ices[0]][0]; y1 = Vertex[h2.Vertices[0]][1]; z1 = Vertex[h2.Vertices[0]][2];313 x2 = Vertex[h2.Vert ices[1]][0]; y2 = Vertex[h2.Vertices[1]][1]; z2 = Vertex[h2.Vertices[1]][2];314 x3 = Vertex[h2.Vert ices[2]][0]; y3 = Vertex[h2.Vertices[2]][1]; z3 = Vertex[h2.Vertices[2]][2];315 x4 = Vertex[h2.Vert ices[3]][0]; y4 = Vertex[h2.Vertices[3]][1]; z4 = Vertex[h2.Vertices[3]][2];306 onex=Vertex[aHoja.Vert_Hoja[0]][0]; oney= Vertex[aHoja.Vert_Hoja[0]][1]; onez = Vertex[aHoja.Vert_Hoja[0]][2]; 307 twox = Vertex[aHoja.Vert_Hoja[1]][0]; twoy = Vertex[aHoja.Vert_Hoja[1]][1]; twoz = Vertex[aHoja.Vert_Hoja[1]][2]; 308 threex = Vertex[aHoja.Vert_Hoja[2]][0]; threey = Vertex[aHoja.Vert_Hoja[2]][1]; threez = Vertex[aHoja.Vert_Hoja[2]][2]; 309 fourx = Vertex[aHoja.Vert_Hoja[3]][0]; foury = Vertex[aHoja.Vert_Hoja[3]][1]; fourz = Vertex[aHoja.Vert_Hoja[3]][2]; 310 311 312 x1 = Vertex[h2.Vert_Hoja[0]][0]; y1 = Vertex[h2.Vert_Hoja[0]][1]; z1 = Vertex[h2.Vert_Hoja[0]][2]; 313 x2 = Vertex[h2.Vert_Hoja[1]][0]; y2 = Vertex[h2.Vert_Hoja[1]][1]; z2 = Vertex[h2.Vert_Hoja[1]][2]; 314 x3 = Vertex[h2.Vert_Hoja[2]][0]; y3 = Vertex[h2.Vert_Hoja[2]][1]; z3 = Vertex[h2.Vert_Hoja[2]][2]; 315 x4 = Vertex[h2.Vert_Hoja[3]][0]; y4 = Vertex[h2.Vert_Hoja[3]][1]; z4 = Vertex[h2.Vert_Hoja[3]][2]; 316 316 317 317 // guardo las distancias mínimas de cada vértice a los 4 contrarios. … … 648 648 //inicializo al primero de los vértices de las hojas 649 649 650 xmax = Vertex[Hojasa[0].Vert ices[0]][0];650 xmax = Vertex[Hojasa[0].Vert_Hoja[0]][0]; 651 651 xmin = xmax; 652 652 653 ymax = Vertex[Hojasa[0].Vert ices[0]][1];653 ymax = Vertex[Hojasa[0].Vert_Hoja[0]][1]; 654 654 ymin = ymax; 655 655 656 zmax = Vertex[Hojasa[0].Vert ices[0]][2];656 zmax = Vertex[Hojasa[0].Vert_Hoja[0]][2]; 657 657 zmin = zmax; 658 658 … … 674 674 { 675 675 676 if ( xmax < Vertex[Hojasa[i].Vert ices[j]][0]) xmax = Vertex[Hojasa[i].Vertices[j]][0];677 if ( xmin > Vertex[Hojasa[i].Vert ices[j]][0]) xmin = Vertex[Hojasa[i].Vertices[j]][0];678 679 if ( ymax < Vertex[Hojasa[i].Vert ices[j]][1]) ymax = Vertex[Hojasa[i].Vertices[j]][1];680 if ( ymin > Vertex[Hojasa[i].Vert ices[j]][1]) ymin = Vertex[Hojasa[i].Vertices[j]][1];676 if ( xmax < Vertex[Hojasa[i].Vert_Hoja[j]][0]) xmax = Vertex[Hojasa[i].Vert_Hoja[j]][0]; 677 if ( xmin > Vertex[Hojasa[i].Vert_Hoja[j]][0]) xmin = Vertex[Hojasa[i].Vert_Hoja[j]][0]; 678 679 if ( ymax < Vertex[Hojasa[i].Vert_Hoja[j]][1]) ymax = Vertex[Hojasa[i].Vert_Hoja[j]][1]; 680 if ( ymin > Vertex[Hojasa[i].Vert_Hoja[j]][1]) ymin = Vertex[Hojasa[i].Vert_Hoja[j]][1]; 681 681 682 if ( zmax < Vertex[Hojasa[i].Vert ices[j]][2]) zmax = Vertex[Hojasa[i].Vertices[j]][2];683 if ( zmin > Vertex[Hojasa[i].Vert ices[j]][2]) zmin = Vertex[Hojasa[i].Vertices[j]][2];682 if ( zmax < Vertex[Hojasa[i].Vert_Hoja[j]][2]) zmax = Vertex[Hojasa[i].Vert_Hoja[j]][2]; 683 if ( zmin > Vertex[Hojasa[i].Vert_Hoja[j]][2]) zmin = Vertex[Hojasa[i].Vert_Hoja[j]][2]; 684 684 685 685 } … … 900 900 901 901 902 a = Vertex[Hoja1.Vert ices[0]][0];903 b = Vertex[Hoja1.Vert ices[0]][1];904 c = Vertex[Hoja1.Vert ices[0]][2];902 a = Vertex[Hoja1.Vert_Hoja[0]][0]; 903 b = Vertex[Hoja1.Vert_Hoja[0]][1]; 904 c = Vertex[Hoja1.Vert_Hoja[0]][2]; 905 905 906 906 dist[0] = ((Hoja2.Centro[0]-a)*(Hoja2.Centro[0]-a)) + ((Hoja2.Centro[1]-b)*(Hoja2.Centro[1]-b)) + … … 908 908 909 909 910 a = Vertex[Hoja1.Vert ices[1]][0];911 b = Vertex[Hoja1.Vert ices[1]][1];912 c = Vertex[Hoja1.Vert ices[1]][2];910 a = Vertex[Hoja1.Vert_Hoja[1]][0]; 911 b = Vertex[Hoja1.Vert_Hoja[1]][1]; 912 c = Vertex[Hoja1.Vert_Hoja[1]][2]; 913 913 914 914 dist[1] = ((Hoja2.Centro[0]-a)*(Hoja2.Centro[0]-a)) + ((Hoja2.Centro[1]-b)*(Hoja2.Centro[1]-b)) + 915 915 ((Hoja2.Centro[2]-c)*(Hoja2.Centro[2]-c)); 916 916 917 a = Vertex[Hoja1.Vert ices[2]][0];918 b = Vertex[Hoja1.Vert ices[2]][1];919 c = Vertex[Hoja1.Vert ices[2]][2];917 a = Vertex[Hoja1.Vert_Hoja[2]][0]; 918 b = Vertex[Hoja1.Vert_Hoja[2]][1]; 919 c = Vertex[Hoja1.Vert_Hoja[2]][2]; 920 920 921 921 dist[2] = ((Hoja2.Centro[0]-a)*(Hoja2.Centro[0]-a)) + ((Hoja2.Centro[1]-b)*(Hoja2.Centro[1]-b)) + … … 923 923 924 924 925 a = Vertex[Hoja1.Vert ices[3]][0];926 b = Vertex[Hoja1.Vert ices[3]][1];927 c = Vertex[Hoja1.Vert ices[3]][2];925 a = Vertex[Hoja1.Vert_Hoja[3]][0]; 926 b = Vertex[Hoja1.Vert_Hoja[3]][1]; 927 c = Vertex[Hoja1.Vert_Hoja[3]][2]; 928 928 929 929 dist[3] = ((Hoja2.Centro[0]-a)*(Hoja2.Centro[0]-a)) + ((Hoja2.Centro[1]-b)*(Hoja2.Centro[1]-b)) + … … 934 934 DosMayores(dist, indices); 935 935 936 Hojasa[counth].Vert ices[0] = Hoja1.Vertices[indices[0]];937 Hojasa[counth].Vert ices[1] = Hoja1.Vertices[indices[1]];936 Hojasa[counth].Vert_Hoja[0] = Hoja1.Vert_Hoja[indices[0]]; 937 Hojasa[counth].Vert_Hoja[1] = Hoja1.Vert_Hoja[indices[1]]; 938 938 939 939 // segunda hoja los dos ultimos vertices 940 940 941 941 942 a = Vertex[Hoja2.Vert ices[0]][0];943 b = Vertex[Hoja2.Vert ices[0]][1];944 c = Vertex[Hoja2.Vert ices[0]][2];942 a = Vertex[Hoja2.Vert_Hoja[0]][0]; 943 b = Vertex[Hoja2.Vert_Hoja[0]][1]; 944 c = Vertex[Hoja2.Vert_Hoja[0]][2]; 945 945 946 946 dist[0] = ((Hoja1.Centro[0]-a)*(Hoja1.Centro[0]-a)) + ((Hoja1.Centro[1]-b)*(Hoja1.Centro[1]-b)) + … … 948 948 949 949 950 a = Vertex[Hoja2.Vert ices[1]][0];951 b = Vertex[Hoja2.Vert ices[1]][1];952 c = Vertex[Hoja2.Vert ices[1]][2];950 a = Vertex[Hoja2.Vert_Hoja[1]][0]; 951 b = Vertex[Hoja2.Vert_Hoja[1]][1]; 952 c = Vertex[Hoja2.Vert_Hoja[1]][2]; 953 953 954 954 dist[1] = ((Hoja2.Centro[0]-a)*(Hoja2.Centro[0]-a)) + ((Hoja1.Centro[1]-b)*(Hoja1.Centro[1]-b)) + 955 955 ((Hoja2.Centro[2]-c)*(Hoja2.Centro[2]-c)); 956 956 957 a = Vertex[Hoja2.Vert ices[2]][0];958 b = Vertex[Hoja2.Vert ices[2]][1];959 c = Vertex[Hoja2.Vert ices[2]][2];957 a = Vertex[Hoja2.Vert_Hoja[2]][0]; 958 b = Vertex[Hoja2.Vert_Hoja[2]][1]; 959 c = Vertex[Hoja2.Vert_Hoja[2]][2]; 960 960 961 961 dist[2] = ((Hoja1.Centro[0]-a)*(Hoja1.Centro[0]-a)) + ((Hoja1.Centro[1]-b)*(Hoja1.Centro[1]-b)) + … … 963 963 964 964 965 a = Vertex[Hoja2.Vert ices[3]][0];966 b = Vertex[Hoja2.Vert ices[3]][1];967 c = Vertex[Hoja2.Vert ices[3]][2];965 a = Vertex[Hoja2.Vert_Hoja[3]][0]; 966 b = Vertex[Hoja2.Vert_Hoja[3]][1]; 967 c = Vertex[Hoja2.Vert_Hoja[3]][2]; 968 968 969 969 dist[3] = ((Hoja1.Centro[0]-a)*(Hoja1.Centro[0]-a)) + ((Hoja1.Centro[1]-b)*(Hoja1.Centro[1]-b)) + … … 974 974 DosMayores(dist, indices); 975 975 976 Hojasa[counth].Vert ices[2] = Hoja2.Vertices[indices[0]];977 Hojasa[counth].Vert ices[3] = Hoja2.Vertices[indices[1]];976 Hojasa[counth].Vert_Hoja[2] = Hoja2.Vert_Hoja[indices[0]]; 977 Hojasa[counth].Vert_Hoja[3] = Hoja2.Vert_Hoja[indices[1]]; 978 978 979 979 … … 1057 1057 1058 1058 // Nuevos vértices 1059 pasosimp.mNewQuad[0]=Hojasa[counth].Vert ices[0];1060 pasosimp.mNewQuad[1]=Hojasa[counth].Vert ices[1];1061 pasosimp.mNewQuad[2]=Hojasa[counth].Vert ices[2];1062 pasosimp.mNewQuad[3]=Hojasa[counth].Vert ices[3];1059 pasosimp.mNewQuad[0]=Hojasa[counth].Vert_Hoja[0]; 1060 pasosimp.mNewQuad[1]=Hojasa[counth].Vert_Hoja[1]; 1061 pasosimp.mNewQuad[2]=Hojasa[counth].Vert_Hoja[2]; 1062 pasosimp.mNewQuad[3]=Hojasa[counth].Vert_Hoja[3]; 1063 1063 1064 1064 // Insertar el paso de simplificación … … 1104 1104 if ( Hojasa[j].existe == true) // si la hoja aun existe 1105 1105 { 1106 mesh->mSubMesh[idMeshLeaves].mIndex[indice]=Hojasa[j].Vert ices[0];1107 mesh->mSubMesh[idMeshLeaves].mIndex[indice+1]=Hojasa[j].Vert ices[1];1108 mesh->mSubMesh[idMeshLeaves].mIndex[indice+2]=Hojasa[j].Vert ices[2];1109 mesh->mSubMesh[idMeshLeaves].mIndex[indice+3]=Hojasa[j].Vert ices[2];1110 mesh->mSubMesh[idMeshLeaves].mIndex[indice+4]=Hojasa[j].Vert ices[1];1111 mesh->mSubMesh[idMeshLeaves].mIndex[indice+5]=Hojasa[j].Vert ices[3];1106 mesh->mSubMesh[idMeshLeaves].mIndex[indice]=Hojasa[j].Vert_Hoja[0]; 1107 mesh->mSubMesh[idMeshLeaves].mIndex[indice+1]=Hojasa[j].Vert_Hoja[1]; 1108 mesh->mSubMesh[idMeshLeaves].mIndex[indice+2]=Hojasa[j].Vert_Hoja[2]; 1109 mesh->mSubMesh[idMeshLeaves].mIndex[indice+3]=Hojasa[j].Vert_Hoja[2]; 1110 mesh->mSubMesh[idMeshLeaves].mIndex[indice+4]=Hojasa[j].Vert_Hoja[1]; 1111 mesh->mSubMesh[idMeshLeaves].mIndex[indice+5]=Hojasa[j].Vert_Hoja[3]; 1112 1112 indice=indice+6; 1113 1113 } -
GTP/trunk/Lib/Geom/shared/GTGeometry/src/libs/leaves/Arbol.cpp
r831 r834 522 522 { 523 523 j=i; 524 while (Hojas[j].padre !=-1) j= Hojas[j].padre;524 while (Hojas[j].padre > -1) j= Hojas[j].padre; 525 525 Hojas[i].raiz = j; 526 526 -
GTP/trunk/Lib/Geom/shared/GTGeometry/src/libs/leaves/Hoja.cpp
r830 r834 1 #include < GL\glut.h>1 #include <math.h> 2 2 #include "Hoja.h" 3 3 … … 7 7 //-------------------------------------------------------------------------------------------------------------------------------- 8 8 Hoja::Hoja(void) 9 { 10 11 Vert_Hoja[0] = Vert_Hoja[1] = Vert_Hoja[2] = Vert_Hoja[3] = 0;9 { 10 Vert_Hoja[0] = Vert_Hoja[1] = Vert_Hoja[2] = Vert_Hoja[3] =0; 11 Centro[0] = Centro[1] = Centro[2] = 0; 12 12 Normal[0] = Normal[1] = Normal[2] = 0; 13 hoja_cerca=-1; 14 Cuantas_hojas = 1; 15 dist = coplanar = criterio = hoja_cop = hoja_crit =-1; 16 existe = true; 13 17 padre=-1; 14 Cuantas_hojas = 1;15 18 hijoi = hijod = -1; 16 19 raiz= visible= -1; 17 // prev = next = -1;18 19 20 20 } 21 21 … … 27 27 Hoja::Hoja (const Hoja& aHoja) 28 28 { 29 30 31 29 Cuantas_hojas = aHoja.Cuantas_hojas;; 30 hoja_cerca = aHoja.hoja_cerca; 31 hoja_crit = aHoja.hoja_crit; 32 dist = aHoja.dist; 33 existe = aHoja.existe; 34 coplanar = aHoja.coplanar; 35 hoja_cop = aHoja.hoja_cop; 36 criterio = aHoja.criterio; 37 for ( int i=0;i<3;i++){ 38 Centro[i] = aHoja.Centro[i]; 39 Normal[i] = aHoja.Normal[i]; 40 } 41 for (i = 0L; i < 4; i++) 42 Vert_Hoja[i] = aHoja.Vert_Hoja[i]; 43 32 44 padre = aHoja.padre; 33 45 hijoi = aHoja.hijoi; … … 35 47 visible = aHoja.visible; 36 48 raiz = aHoja.raiz; 37 38 for (int i = 0L; i < 4; i++)39 Vert_Hoja[i] = aHoja.Vert_Hoja[i];40 for ( i = 0L; i < 3; i++)41 Normal[i] = aHoja.Normal[i];42 43 44 49 } 45 50 … … 47 52 48 53 //-------------------------------------------------------------------------------------------------------------------------------- 49 // Destructor. We must deallocate the memory allocated for pointers to Vert_Hojaand edges54 // Destructor. We must deallocate the memory allocated for pointers to vertices and edges 50 55 //-------------------------------------------------------------------------------------------------------------------------------- 51 56 Hoja::~Hoja (void) … … 54 59 55 60 61 //-------------------------------------------------------------------------------------------------------------------------------- 62 // CALCULA LA DISTANCIA ENTRE HOJAS 63 //-------------------------------------------------------------------------------------------------------------------------------- 64 65 float Hoja::Distancia (Hoja& Hoja1) 66 { 67 float dist =0; 68 float x1,y1,z1; 69 70 x1 = Hoja1.Centro[0]; y1 = Hoja1.Centro[1] ; z1 = Hoja1.Centro[2]; 71 72 73 //DISTANCIA ENTRE CENTROS 74 75 dist = ((Centro[0]-x1)*(Centro[0]-x1)) + ((Centro[1]-y1)*(Centro[1]-y1)) + ((Centro[2]-z1)*(Centro[2]-z1)); 76 77 return (dist); 78 } 79 80 81 //-------------------------------------------------------------------------------------------------------------------------------- 82 // CALCULA LA COPLANARIDAD ENTRE HOJAS 83 //-------------------------------------------------------------------------------------------------------------------------------- 84 85 float Hoja::Coplanaridad (Hoja& Hoja1) 86 { 87 float cop =0; 88 float modulo1, modulo2; 89 float x1,y1,z1, nx1, ny1, nz1; 90 float nx, ny, nz; 91 92 //hoja pasada como parametro, normalizo las componentes 93 x1 = Hoja1.Normal[0]; y1 = Hoja1.Normal[1] ; z1 = Hoja1.Normal[2]; 94 modulo1 = sqrt ( (x1*x1) + (y1*y1) + (z1*z1)); 95 nx1 = x1 / modulo1; 96 ny1 = y1 / modulo1; 97 nz1 = z1 / modulo1; 98 99 // hoja desde la que llamo 100 101 modulo2 = sqrt ( (Normal[0]*Normal[0]) + (Normal[1]*Normal[1]) + (Normal[2]*Normal[2])); 102 nx = Normal[0] / modulo2; 103 ny = Normal[1] / modulo2; 104 nz = Normal[2] / modulo2; 105 106 // producto escalar : si es proximo a 0, perpendiculares, a 1, coplanares 107 108 cop = (nx1*nx) + (ny1*ny) + (nz1*nz); 109 110 111 return (fabs(cop)); 112 113 } 114 -
GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshViewUI.cpp
r829 r834 1988 1988 1989 1989 // New lod strips object. 1990 lodTreeLib = new Geometry::LodTreeLibrary(lodfile, geomesh); 1990 lodTreeLib = new Geometry::LodTreeLibrary(lodfile, geomesh,"\\\\quake\\home\\\Modelos\\betula_populifolia\\vertices.obj", 1991 "\\\\quake\\home\\\Modelos\\betula_populifolia\\hojas.obj", 1992 "\\\\quake\\home\\\Modelos\\betula_populifolia\\simplifica.obj"); 1991 1993 1992 1994 // Sets the slider range.
Note: See TracChangeset
for help on using the changeset viewer.