Changeset 1078 for GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshLoader.cpp
- Timestamp:
- 07/05/06 17:15:14 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshLoader.cpp
r1071 r1078 642 642 // Read a mesh file. 643 643 //--------------------------------------------------------------------------- 644 645 #include "GeoLodStripsLibrary.h" 646 #include "GeoLodStripsConstructor.h" 647 644 648 void GeoMeshLoader::readMesh(FILE *f, Mesh *geoMesh, int option) 645 649 { … … 670 674 chunkID == M_MESH_BOUNDS || 671 675 chunkID == M_SUBMESH_NAME_TABLE || 672 chunkID == M_EDGE_LISTS)) 676 chunkID == M_EDGE_LISTS || 677 chunkID == 0xabcd || 678 chunkID == 0xdcba)) 673 679 { 674 680 switch(chunkID) 675 681 { 682 case 0xabcd: 683 cout << "LODSTRIPS_Chunk" << endl; 684 int aux,v,c; 685 LODRegisterType lod_register; 686 LODData dataaux; 687 int tam; 688 689 fread(&tam, sizeof(int), 1, f); 690 lodstripsdata.mFileVertices.clear(); 691 for (v=0; v<tam; v++) 692 { 693 fread(&aux, sizeof(int), 1, f); 694 lodstripsdata.mFileVertices.push_back(aux); 695 } 696 697 lodstripsdata.mFileChangesLOD.clear(); 698 fread(&tam, sizeof(int), 1, f); 699 for (c=0; c<tam; c++) 700 { 701 fread(&dataaux, sizeof(LODData), 1, f); 702 lod_register.strip= dataaux.strip; 703 lod_register.position= dataaux.nP; 704 lod_register.vertexRepetition= dataaux.nL1; 705 lod_register.edgeRepetition= dataaux.nL2; 706 //lod_register.obligatory=false; 707 //lod_register.obligatory= dataaux.obligatory; 708 709 lodstripsdata.mFileChangesLOD.push_back(lod_register); 710 } 711 712 lodstripsdata.mData.clear(); 713 fread(&tam, sizeof(int), 1, f); 714 for (int b=0; b<tam; b++) 715 { 716 fread(&aux, sizeof(int), 1, f); 717 lodstripsdata.mData.push_back(aux); 718 } 719 720 lodstripsdata.p_changes.clear(); 721 fread(&tam, sizeof(int), 1, f); 722 for (int p=0; p<tam; p++) 723 { 724 fread(&aux, sizeof(int), 1, f); 725 lodstripsdata.p_changes.push_back(aux); 726 } 727 728 break; 729 730 case 0xdcba: 731 cout << "LODTREES_Chunk" << endl; 732 int size; 733 fread(&size, sizeof(int), 1, f); 734 treesimpseq.mSteps.clear(); 735 for (int i=0; i<size; i++) 736 { 737 Geometry::TreeSimplificationSequence::Step auxstep; 738 fread(&auxstep.mV0,sizeof(int),1,f); 739 fread(&auxstep.mV1,sizeof(int),1,f); 740 fread(&auxstep.mT0,sizeof(int),1,f); 741 fread(&auxstep.mT1,sizeof(int),1,f); 742 fread(auxstep.mNewQuad,sizeof(int),4,f); 743 treesimpseq.mSteps.push_back(auxstep); 744 } 745 746 break; 747 748 676 749 case M_GEOMETRY: 677 750
Note: See TracChangeset
for help on using the changeset viewer.