Changeset 1024 for GTP/trunk/Lib/Geom/shared/GeoTool
- Timestamp:
- 06/20/06 13:02:00 (19 years ago)
- Location:
- GTP/trunk/Lib/Geom/shared/GeoTool
- Files:
-
- 27 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Geom/shared/GeoTool/GeoTool.vcproj
r1014 r1024 138 138 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"> 139 139 <File 140 RelativePath=".\src\GeoMaterialLoader.cpp"> 141 </File> 142 <File 140 143 RelativePath=".\src\GeoMeshLoader.cpp"> 141 144 </File> … … 161 164 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"> 162 165 <File 166 RelativePath=".\include\GeoMaterialLoader.h"> 167 </File> 168 <File 163 169 RelativePath=".\include\GeoMeshLoader.h"> 164 170 </File> -
GTP/trunk/Lib/Geom/shared/GeoTool/include/GeoMeshViewUI.h
r994 r1024 52 52 #include "../resource.h" 53 53 54 #include <GeoMaterialLoader.h> 55 54 56 // State of the button process. 55 57 enum ProcessState … … 282 284 bool fileExists(const char *fileNameMesh); 283 285 286 // Set textures to mesh model. 287 void setTextures(); 288 284 289 public: 285 290 … … 296 301 fltk::Item *menuMeshExportOBJ; 297 302 fltk::Item *menuFileTransformSharedVertex; 298 fltk::ItemGroup 299 fltk::Item 303 fltk::ItemGroup *menuLoadTextures; 304 fltk::Item *menuFileLoadTexture; 300 305 301 306 fltk::Item *menuFileQuit; -
GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshLoader.cpp
r989 r1024 427 427 // Gets material name. 428 428 fgets(materialName,255,f); 429 materialName[strlen(materialName) - 1] = '\0'; 429 430 430 431 fread(&useSharedVertices,sizeof(bool),1,f); -
GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshSaver.cpp
r1017 r1024 215 215 216 216 // Material Name. 217 strcat(geoSubMesh->mMaterialName,"\n"); 217 218 mSerializer->WriteData(geoSubMesh->mMaterialName); 218 219 -
GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshViewUI.cpp
r1017 r1024 25 25 geoMeshView->deactiveLodTree(); 26 26 27 geoMeshView->resetTextures();28 27 BuildLoadTextureSubMeshMenu(); 29 28 … … 1003 1002 } 1004 1003 1005 VertexBuffer *origSubMeshVB=NULL;1006 int orig_numindices=0;1007 Index *orig_indices=NULL;1008 1009 1004 //--------------------------------------------------------------------------- 1010 1005 // Button Process Callback … … 1018 1013 progressBarType = PROCESS; 1019 1014 mProcessBar->position(0); 1020 1021 origSubMeshVB=NULL;1022 1015 1023 1016 // Initialize error flag. … … 1086 1079 else 1087 1080 { 1088 origSubMeshVB=mGeoMesh->mSubMesh[idMeshLeaves].mVertexBuffer->Clone();1089 orig_numindices=mGeoMesh->mSubMesh[idMeshLeaves].mIndexCount;1090 orig_indices=new Index[orig_numindices];1091 for (int i=0; i<orig_numindices; i++)1092 orig_indices[i]=mGeoMesh->mSubMesh[idMeshLeaves].mIndex[i];1093 1094 1081 std::cout << "Simplificando hojas..."; 1095 1082 simplifyLeavesCollapse(); … … 1336 1323 file_name[strlen(file_name) - 4] = '\0'; 1337 1324 1338 mesh_saver->leavesSubMesh=idMeshLeaves;1339 mesh_saver->leavesVB=origSubMeshVB;1340 mesh_saver->numindices=orig_numindices;1341 mesh_saver->indices=orig_indices;1342 1325 mesh_saver->save( mGeoMesh, 1343 1326 strcat(file_name,".mesh")); … … 2502 2485 // Visualize mesh. 2503 2486 geoMeshView->setMesh(mGeoMesh); 2487 2488 // Set textures. 2489 geoMeshView->resetTextures(); 2490 setTextures(); 2504 2491 2505 2492 // Hide right panel. … … 2544 2531 // Free memory. 2545 2532 delete fcho; 2533 } 2534 2535 // Set textures to mesh model. 2536 void GeoMeshViewUI::setTextures() 2537 { 2538 GeoMaterialLoader *loader; 2539 string filename; 2540 string material; 2541 2542 loader = new GeoMaterialLoader(); 2543 2544 // For each submesh. 2545 for (int submesh = 0; submesh < mGeoMesh->mSubMeshCount; submesh++) 2546 { 2547 material = string(mGeoMesh->mSubMesh[submesh].mMaterialName); 2548 2549 if (loader->existsMaterial(material)) 2550 { 2551 // Debug. 2552 cout << "Material " 2553 << material 2554 << " found." 2555 << endl; 2556 2557 filename = loader->getTextureFileName(material); 2558 2559 // Debug. 2560 cout << "File: " 2561 << filename.c_str() 2562 << endl; 2563 2564 geoMeshView->LoadTextureSubMesh(submesh, filename.c_str()); 2565 } 2566 } 2546 2567 } 2547 2568
Note: See TracChangeset
for help on using the changeset viewer.