Changeset 1083 for GTP/trunk/Lib/Geom/shared/GeoTool
- Timestamp:
- 07/05/06 20:18:06 (18 years ago)
- Location:
- GTP/trunk/Lib/Geom/shared/GeoTool
- Files:
-
- 4 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Geom/shared/GeoTool/GeoTool.vcproj
r1024 r1083 141 141 </File> 142 142 <File 143 RelativePath=".\src\GeoMeshLoader.cpp">144 </File>145 <File146 RelativePath=".\src\GeoMeshSaver.cpp">147 </File>148 <File149 143 RelativePath=".\src\GeoMeshView.cpp"> 150 144 </File> … … 165 159 <File 166 160 RelativePath=".\include\GeoMaterialLoader.h"> 167 </File>168 <File169 RelativePath=".\include\GeoMeshLoader.h">170 </File>171 <File172 RelativePath=".\include\GeoMeshSaver.h">173 161 </File> 174 162 <File -
GTP/trunk/Lib/Geom/shared/GeoTool/include/GeoMeshViewUI.h
r1078 r1083 372 372 373 373 // Initialize the lodstripslibrary for visualization. 374 void setLodStripsLibrary(const Geometry::LodStripsLibraryData &, Mesh *geomesh);374 void setLodStripsLibrary(const Geometry::LodStripsLibraryData *, Mesh *geomesh); 375 375 // Initialize the lodtreelibrary for visualization. 376 void setLodTreesLibrary(const Geometry::LodStripsLibraryData &, const Geometry::TreeSimplificationSequence &, Mesh *geomesh, uint32 ileafSubMesh);376 void setLodTreesLibrary(const Geometry::LodStripsLibraryData *, const Geometry::TreeSimplificationSequence *, Mesh *geomesh, uint32 ileafSubMesh); 377 377 378 378 // Indentify the mesh of leaves. -
GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshView.cpp
r1078 r1083 892 892 current_strip = 0; 893 893 894 int begin_index = 0;895 896 894 // For each submesh. 897 895 for (int submesh = 0; submesh < geoMesh->mSubMeshCount; submesh++) … … 968 966 }*/ 969 967 970 int indices_to_render = lodStripsLib-> indices_x_submesh[submesh];971 968 int indices_to_render = lodStripsLib->GetValidIndexCount(submesh); 969 int offset = lodStripsLib->GetValidOffset(submesh); 972 970 973 971 glBegin(GL_TRIANGLE_STRIP); 974 972 //for (int index = 0; index < lodStripsLib->dataRetrievalInterface->GetNumValidIndices(); index ++) 975 for (int index = begin_index; index < indices_to_render+begin_index; index ++)973 for (int index = offset; index < indices_to_render+offset; index ++) 976 974 { 977 975 position = lodStripsLib->dataRetrievalInterface->GetIndex(index); … … 1007 1005 } 1008 1006 glEnd(); 1009 begin_index += indices_to_render;1010 1007 1011 1008 } … … 1032 1029 1033 1030 // DRAW THE TRUNK AS A LODSTRIP OBJECT 1034 1035 int begin_index = 0;1036 1037 1031 // For each submesh. 1038 1032 for (int submesh = 0; submesh < geoMesh->mSubMeshCount; submesh++) … … 1112 1106 }*/ 1113 1107 1114 int indices_to_render = lodTreeLib->trunk->indices_x_submesh[submesh]; 1108 // int indices_to_render = lodTreeLib->trunk->GetValidIndexCount(submesh); 1109 int indices_to_render = lodTreeLib->GetValidTrunkIndexCount(submesh); 1110 int begin_index = lodTreeLib->GetValidTrunkOffset(submesh); 1115 1111 1116 1112 glBegin(GL_TRIANGLE_STRIP); 1117 for (int index = begin_index; index < lodTreeLib->trunk->indices_x_submesh[submesh]; index ++)1113 for (int index = begin_index; index < indices_to_render+begin_index; index ++) 1118 1114 { 1119 1115 position = lodTreeLib->CurrentLOD_Trunk_Indices()->GetIndex(index); … … 1149 1145 } 1150 1146 glEnd(); 1151 begin_index += indices_to_render;1152 1153 1147 } 1154 1148 -
GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshViewUI.cpp
r1078 r1083 795 795 inline void GeoMeshViewUI::cb_menuLodStripsVisualize_i(fltk::Item*, void*) 796 796 { 797 fltk::FileChooser *fcho;798 const char *lod_file;799 800 797 // Sets menus application state to NONE. 801 798 mApplicationState = NONE; … … 811 808 if (mGeoMesh != NULL) 812 809 { 813 /* fcho = new fltk::FileChooser("", 814 "*.lod", 815 fltk::FileChooser::CREATE, 816 "Open Lod file"); 817 818 fcho->exec(); 819 820 // If a file was selected. 821 if (fcho->value()) 822 {*/ 810 if (geoMeshLoader->GetLodStripsData()) 811 { 823 812 // Build lod strips library. 824 setLodStripsLibrary(geoMeshLoader-> lodstripsdata, mGeoMesh);813 setLodStripsLibrary(geoMeshLoader->GetLodStripsData(), mGeoMesh); 825 814 826 815 // Sets the aplication mode. 827 816 mApplicationState = VISUALIZE_LODSTRIPS; 828 /* }829 830 // Free memory.831 delete fcho;*/ 832 833 // Hide the right panel.834 hideRightPanel(); 835 836 // Show title.837 mProcessTitle->label("Visualize LodStrips"); 838 839 // Show the Visulize LodStrips panel.840 showLodStripSlider();841 842 // Repaint the window.843 mMainWindow->redraw();844 817 818 // Hide the right panel. 819 hideRightPanel(); 820 821 // Show title. 822 mProcessTitle->label("Visualize LodStrips"); 823 824 // Show the Visulize LodStrips panel. 825 showLodStripSlider(); 826 827 // Repaint the window. 828 mMainWindow->redraw(); 829 } 830 else 831 { 832 fltk::alert("The loaded mesh does not contain LOD information.\nNothing will be done."); 833 } 845 834 } 846 835 } … … 848 837 inline void GeoMeshViewUI::cb_menuLodTreesVisualize_i(fltk::Item*, void*) 849 838 { 850 fltk::FileChooser *fcho;851 const char *lod_file;852 853 839 // Sets menus application state to NONE. 854 840 mApplicationState = NONE; … … 861 847 openMeshFile(); 862 848 863 /*if (geoMeshView->getLeavesSubmesh()==-1)864 {865 fltk::alert("No se ha seleccionado el submesh de hojas!");866 return;867 }*/868 869 849 // If an object is loaded. 870 850 if (mGeoMesh != NULL) 871 851 { 872 // POR AHORA SE SELECCIONA EL PRIMER SUBMESH QUE NO ES STRIPS COMO HOJAS 873 int leafsSubMeshID = -1; 874 875 for (int i=0; i<mGeoMesh->mSubMeshCount; i++) 852 if (geoMeshLoader->GetTreeSimpSeq() && geoMeshLoader->GetLodStripsData()) 876 853 { 877 if (mGeoMesh->mSubMesh[i].mType==GEO_TRIANGLE_LIST) 854 // select the first triangle-list submesh as leaves submesh 855 int leafsSubMeshID = -1; 856 857 for (int i=0; i<mGeoMesh->mSubMeshCount; i++) 878 858 { 879 leafsSubMeshID=i; 880 break; 859 if (mGeoMesh->mSubMesh[i].mType==GEO_TRIANGLE_LIST) 860 { 861 leafsSubMeshID=i; 862 break; 863 } 881 864 } 882 } 883 884 // If an object is loaded. 885 /* if (mGeoMesh != NULL) 886 { 887 fcho = new fltk::FileChooser("", 888 "*.mesh", 889 fltk::FileChooser::CREATE, 890 "Open Lod file"); 891 892 fcho->exec(); 893 894 // If a file was selected. 895 if (fcho->value()) 896 { 897 // Build lod strips library. 898 899 std::string lodstripFile(fcho->value()); 900 delete fcho; 901 fcho = new fltk::FileChooser("", 902 "*.leafseq", 903 fltk::FileChooser::CREATE, 904 "Open LeafSeq file"); 905 906 fcho->exec(); 907 908 if (fcho->value()) 909 { 910 std::string leafseqFile(fcho->value());*/ 911 912 //setLodTreesLibrary(lodstripFile, leafseqFile, mGeoMesh, leafsSubMeshID); 913 setLodTreesLibrary(geoMeshLoader->lodstripsdata, geoMeshLoader->treesimpseq, mGeoMesh, leafsSubMeshID); 914 915 // Sets the aplication mode. 916 mApplicationState = VISUALIZE_LODTREES; 917 /* } 918 } 919 920 // Free memory. 921 delete fcho; 922 */ 865 866 setLodTreesLibrary(geoMeshLoader->GetLodStripsData(), geoMeshLoader->GetTreeSimpSeq(), mGeoMesh, leafsSubMeshID); 867 868 // Sets the aplication mode. 869 mApplicationState = VISUALIZE_LODTREES; 870 923 871 // Hide the right panel. 924 872 hideRightPanel(); … … 933 881 // Repaint the window. 934 882 mMainWindow->redraw(); 935 /* }*/ 883 } 884 else 885 fltk::alert("The loaded mesh does not contain LOD information.\nNothing will be done."); 936 886 } 937 887 } … … 2367 2317 // Initialize the lodstripslibrary for visualization. 2368 2318 //--------------------------------------------------------------------------- 2369 void GeoMeshViewUI::setLodStripsLibrary(const Geometry::LodStripsLibraryData &loddata, Mesh *geomesh)2319 void GeoMeshViewUI::setLodStripsLibrary(const Geometry::LodStripsLibraryData *loddata, Mesh *geomesh) 2370 2320 { 2371 2321 // If there is no lod strips object. … … 2392 2342 // Initialize the lodTreelibrary for visualization. 2393 2343 //--------------------------------------------------------------------------- 2394 void GeoMeshViewUI::setLodTreesLibrary(const LodStripsLibraryData &lodstripsdata, const TreeSimplificationSequence &treesimpseq, Mesh *geomesh, uint32 ileafSubMesh)2344 void GeoMeshViewUI::setLodTreesLibrary(const LodStripsLibraryData *lodstripsdata, const TreeSimplificationSequence *treesimpseq, Mesh *geomesh, uint32 ileafSubMesh) 2395 2345 { 2396 2346 // If there is no lod strips object. 2397 2347 if (lodTreeLib) 2398 {2399 2348 delete lodTreeLib; 2400 }2401 2349 2402 2350 // New lod strips object.
Note: See TracChangeset
for help on using the changeset viewer.