Changeset 2090 for GTP/trunk/Lib/Geom/shared/GeoTool/src
- Timestamp:
- 02/05/07 13:29:55 (18 years ago)
- Location:
- GTP/trunk/Lib/Geom/shared/GeoTool/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshView.cpp
r1554 r2090 6 6 7 7 //--------------------------------------------------------------------------- 8 // Han le events.8 // Handle events. 9 9 //--------------------------------------------------------------------------- 10 10 int GeoMeshView::handle(int event) … … 46 46 if (mPan) 47 47 { 48 xshift = xshift + (x - mMouseX);48 xshift = xshift + 0.01; 49 49 } 50 50 else … … 59 59 if (mPan) 60 60 { 61 xshift = xshift - (mMouseX - x);61 xshift = xshift - 0.01; 62 62 } 63 63 else … … 72 72 if (mPan) 73 73 { 74 yshift = yshift - (y - mMouseY);74 yshift = yshift - 0.01; 75 75 } 76 76 else … … 85 85 if (mPan) 86 86 { 87 yshift = yshift + (mMouseY - y);87 yshift = yshift + 0.01; 88 88 } 89 89 else … … 884 884 geosubmesh->mIndexCount, 885 885 GL_UNSIGNED_INT, 886 886 887 mIndexArray[submesh]); 887 888 … … 1146 1147 glLoadIdentity(); 1147 1148 1148 glEnable(GL_LIGHTING);1149 1150 1149 // Frustrum. 1151 1150 glViewport(0,0,w(),h()); … … 1213 1212 { 1214 1213 enableColorStrips(); 1215 //glDisable(GL_LIGHTING);1216 1214 glPolygonMode (GL_FRONT_AND_BACK, GL_FILL); 1217 1215 drawGeoMesh(false); 1218 1216 } 1217 1218 if (mLighting) 1219 { 1220 glEnable(GL_LIGHTING); 1221 } 1219 1222 else 1220 1223 { 1221 gl Enable(GL_LIGHTING);1224 glDisable(GL_LIGHTING); 1222 1225 } 1223 1226 … … 1225 1228 { 1226 1229 disableColorStrips(); 1227 1228 //glDisable(GL_LIGHTING);1229 1230 1230 1231 GLfloat color[4]; … … 1257 1258 { 1258 1259 disableColorStrips(); 1259 //glEnable(GL_LIGHTING);1260 1260 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); 1261 1261 drawGeoMesh(false); … … 1279 1279 current_texture = ilutGLLoadImage((const ILstring)imgfile); 1280 1280 1281 if (!current_texture)1282 {1283 fltk::alert("Error loading texture!");1284 }1281 // if (!current_texture) 1282 // { 1283 // fltk::alert("Error loading texture!"); 1284 // } 1285 1285 1286 1286 ilShutDown(); … … 1295 1295 current_texture_submesh[isubmesh] = ilutGLLoadImage((const ILstring)imgfile); 1296 1296 1297 if (!current_texture_submesh[isubmesh])1298 {1299 fltk::alert("Error loading texture!");1300 }1297 // if (!current_texture_submesh[isubmesh]) 1298 // { 1299 // fltk::alert("Error loading texture!"); 1300 // } 1301 1301 1302 1302 ilShutDown(); -
GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshViewUI.cpp
r1560 r2090 4 4 #include "resource.h" 5 5 #include "GeoLodTreeConstructor.h" 6 #include <string.h> 6 7 7 8 using namespace Geometry; 8 9 using namespace std; 9 10 10 //------------------------------------------------------------------------- --11 //------------------------------------------------------------------------- 11 12 // Menu File Open Callback 12 //------------------------------------------------------------------------- --13 //------------------------------------------------------------------------- 13 14 inline void GeoMeshViewUI::cb_menuFileOpen_i(fltk::Item*, void*) 14 15 { … … 101 102 102 103 103 //------------------------------------------------------------------------- --104 //------------------------------------------------------------------------- 104 105 // Repaint the FPS label. 105 //------------------------------------------------------------------------- --106 //------------------------------------------------------------------------- 106 107 void GeoMeshViewUI::refreshFPS(int fps) 107 108 { … … 124 125 } 125 126 126 //------------------------------------------------------------------------- --127 //------------------------------------------------------------------------- 127 128 // Save callback 128 //------------------------------------------------------------------------- --129 //------------------------------------------------------------------------- 129 130 inline void GeoMeshViewUI::cb_menuFileSave_i(fltk::Item*, void*) 130 131 { … … 152 153 } 153 154 154 //------------------------------------------------------------------------- --155 //------------------------------------------------------------------------- 155 156 // Save As Callback 156 //------------------------------------------------------------------------- --157 //------------------------------------------------------------------------- 157 158 inline void GeoMeshViewUI::cb_menuFileSaveAs_i(fltk::Item*, void*) 158 159 { … … 215 216 //------------------------------------- 216 217 217 mesh_saver->save(mGeoMesh,file name_name(file_name));218 mesh_saver->save(mGeoMesh,file_name); 218 219 219 220 delete mesh_saver; … … 234 235 } 235 236 236 //------------------------------------------------------------------------- --237 //------------------------------------------------------------------------- 237 238 // Mesh info callback 238 //------------------------------------------------------------------------- --239 //------------------------------------------------------------------------- 239 240 inline void GeoMeshViewUI::cb_menuMeshInfo_i(fltk::Item*, void*) 240 241 { … … 253 254 } 254 255 255 //------------------------------------------------------------------------- --256 //------------------------------------------------------------------------- 256 257 // Mesh Export to OBJ callback 257 //------------------------------------------------------------------------- --258 //------------------------------------------------------------------------- 258 259 inline void GeoMeshViewUI::cb_menuMeshExportOBJ_i(fltk::Item*, void*) 259 260 { … … 278 279 } 279 280 280 //------------------------------------------------------------------------- --281 //------------------------------------------------------------------------- 281 282 // Transform to Shared Vertex callback 282 //------------------------------------------------------------------------- --283 //------------------------------------------------------------------------- 283 284 inline void GeoMeshViewUI::cb_menuTransformSharedVertex_i(fltk::Item*, void*) 284 285 { … … 323 324 } 324 325 325 //------------------------------------------------------------------------- --326 //------------------------------------------------------------------------- 326 327 // Quit Callback 327 //------------------------------------------------------------------------- --328 //------------------------------------------------------------------------- 328 329 inline void GeoMeshViewUI::cb_menuFileQuit_i(fltk::Item*, void*) 329 330 { … … 338 339 } 339 340 340 //------------------------------------------------------------------------- --341 //------------------------------------------------------------------------- 341 342 // Undo Callback 342 //------------------------------------------------------------------------- --343 //------------------------------------------------------------------------- 343 344 inline void GeoMeshViewUI::cb_menuEditUndo_i(fltk::Item*, void*) 344 345 { … … 354 355 } 355 356 356 //------------------------------------------------------------------------- --357 //------------------------------------------------------------------------- 357 358 // Fit Callback 358 //------------------------------------------------------------------------- --359 //------------------------------------------------------------------------- 359 360 inline void GeoMeshViewUI::cb_menuEditFit_i(fltk::Item*, void*) 360 361 { … … 370 371 } 371 372 372 //------------------------------------------------------------------------- --373 //------------------------------------------------------------------------- 373 374 // Rotate Callback 374 //------------------------------------------------------------------------- --375 //------------------------------------------------------------------------- 375 376 inline void GeoMeshViewUI::cb_menuEditRotate_i(fltk::Item *item, void*) 376 377 { … … 402 403 } 403 404 404 //------------------------------------------------------------------------- --405 //------------------------------------------------------------------------- 405 406 // Pan Callback 406 //------------------------------------------------------------------------- --407 //------------------------------------------------------------------------- 407 408 inline void GeoMeshViewUI::cb_menuEditPan_i(fltk::Item *item, void*) 408 409 { … … 434 435 } 435 436 436 //------------------------------------------------------------------------- --437 //------------------------------------------------------------------------- 437 438 // Zoom Callback 438 //------------------------------------------------------------------------- --439 //------------------------------------------------------------------------- 439 440 inline void GeoMeshViewUI::cb_menuEditZoom_i(fltk::Item*, void*) 440 441 { … … 448 449 } 449 450 450 //------------------------------------------------------------------------- --451 //------------------------------------------------------------------------- 451 452 // Wire Callback 452 //------------------------------------------------------------------------- --453 //------------------------------------------------------------------------- 453 454 inline void GeoMeshViewUI::cb_menuRenderWire_i(fltk::Item *item, void*) 454 455 { … … 476 477 } 477 478 478 //------------------------------------------------------------------------- --479 //------------------------------------------------------------------------- 479 480 // Solid Callback 480 //------------------------------------------------------------------------- --481 //------------------------------------------------------------------------- 481 482 inline void GeoMeshViewUI::cb_menuRenderSolid_i(fltk::Item *item, void*) 482 483 { … … 504 505 } 505 506 506 //--------------------------------------------------------------------------- 507 //------------------------------------------------------------------------- 508 // Lighting Callback 509 //------------------------------------------------------------------------- 510 inline void GeoMeshViewUI::cb_menuRenderLighting_i(fltk::Item *item, void*) 511 { 512 if (item->value()) 513 { 514 geoMeshView->activeLighting(); 515 } 516 else 517 { 518 geoMeshView->deactiveLighting(); 519 } 520 521 // Repaint the main window. 522 mMainWindow->redraw(); 523 } 524 525 void GeoMeshViewUI::cb_menuRenderLighting(fltk::Item* o, void* v) 526 { 527 ((GeoMeshViewUI*) (o->parent()->parent()->parent()->user_data())) 528 -> 529 cb_menuRenderLighting_i(o,v); 530 } 531 532 //------------------------------------------------------------------------- 507 533 // CW callback 508 //------------------------------------------------------------------------- --534 //------------------------------------------------------------------------- 509 535 inline void GeoMeshViewUI::cb_menuRenderCW_i(fltk::Item *item, void*) 510 536 { … … 534 560 } 535 561 536 //------------------------------------------------------------------------- --562 //------------------------------------------------------------------------- 537 563 // CCW callback 538 //------------------------------------------------------------------------- --564 //------------------------------------------------------------------------- 539 565 inline void GeoMeshViewUI::cb_menuRenderCCW_i(fltk::Item *item, void*) 540 566 { … … 564 590 } 565 591 566 //------------------------------------------------------------------------- --592 //------------------------------------------------------------------------- 567 593 // Flat callback 568 //------------------------------------------------------------------------- --594 //------------------------------------------------------------------------- 569 595 inline void GeoMeshViewUI::cb_menuRenderFlat_i(fltk::Item*, void*) 570 596 { … … 586 612 } 587 613 588 //------------------------------------------------------------------------- --614 //------------------------------------------------------------------------- 589 615 // Smooth Callback 590 //------------------------------------------------------------------------- --616 //------------------------------------------------------------------------- 591 617 inline void GeoMeshViewUI::cb_menuRenderSmooth_i(fltk::Item*, void*) 592 618 { … … 608 634 } 609 635 610 //------------------------------------------------------------------------- --636 //------------------------------------------------------------------------- 611 637 // Textures callback 612 //------------------------------------------------------------------------- --638 //------------------------------------------------------------------------- 613 639 inline void GeoMeshViewUI::cb_menuRenderTextures_i(fltk::Item*, void*) 614 640 { … … 628 654 } 629 655 630 //------------------------------------------------------------------------- --656 //------------------------------------------------------------------------- 631 657 // Stripify Callback 632 //------------------------------------------------------------------------- --658 //------------------------------------------------------------------------- 633 659 inline void GeoMeshViewUI::cb_menuStripify_i(fltk::Item*, void*) 634 660 { … … 657 683 } 658 684 659 //------------------------------------------------------------------------- --685 //------------------------------------------------------------------------- 660 686 // Simplify Callback 661 //------------------------------------------------------------------------- --687 //------------------------------------------------------------------------- 662 688 inline void GeoMeshViewUI::cb_menuSimplify_i(fltk::ItemGroup*, void*) 663 689 { … … 671 697 } 672 698 673 //------------------------------------------------------------------------- --699 //------------------------------------------------------------------------- 674 700 // Edge collapse Callback 675 //------------------------------------------------------------------------- --701 //------------------------------------------------------------------------- 676 702 inline void GeoMeshViewUI::cb_menuSimplifyEdgeCollapse_i(fltk::Item*, void*) 677 703 { … … 701 727 } 702 728 703 //------------------------------------------------------------------------- --729 //------------------------------------------------------------------------- 704 730 // Leaves collapse Callback 705 //------------------------------------------------------------------------- --731 //------------------------------------------------------------------------- 706 732 inline void GeoMeshViewUI::cb_menuSimplifyLeavesCollapse_i(fltk::Item*, void*) 707 733 { … … 730 756 } 731 757 732 //------------------------------------------------------------------------- --758 //------------------------------------------------------------------------- 733 759 // Tree select leaves simplification Callback 734 //------------------------------------------------------------------------- --760 //------------------------------------------------------------------------- 735 761 inline void GeoMeshViewUI::cb_menuSelectLeaves_i(fltk::Item*, void*) 736 762 { … … 751 777 } 752 778 753 //------------------------------------------------------------------------- --779 //------------------------------------------------------------------------- 754 780 // Auto Generate LodStrips Callback 755 //------------------------------------------------------------------------- --781 //------------------------------------------------------------------------- 756 782 inline void GeoMeshViewUI::cb_menuLodStripsGenerate_i(fltk::Item*, void*) 757 783 { … … 781 807 } 782 808 783 //------------------------------------------------------------------------- --809 //------------------------------------------------------------------------- 784 810 // Auto Generate LodStrips Callback 785 //------------------------------------------------------------------------- --811 //------------------------------------------------------------------------- 786 812 inline void GeoMeshViewUI::cb_menuLodTreesGenerate_i(fltk::Item*, void*) 787 813 { … … 812 838 813 839 814 //------------------------------------------------------------------------- --840 //------------------------------------------------------------------------- 815 841 // Visualize LodStrips Callback 816 //------------------------------------------------------------------------- --842 //------------------------------------------------------------------------- 817 843 inline void GeoMeshViewUI::cb_menuLodStripsVisualize_i(fltk::Item*, void*) 818 844 { … … 874 900 if (geoMeshLoader->GetTreeSimpSeq() && geoMeshLoader->GetLodStripsData()) 875 901 { 876 /* // select the first triangle-list submesh as leaves submesh 877 int leafsSubMeshID = -1; 878 879 for (int i=0; i<mGeoMesh->mSubMeshCount; i++) 880 { 881 if (mGeoMesh->mSubMesh[i].mType==GEO_TRIANGLE_LIST) 882 { 883 leafsSubMeshID=i; 884 break; 885 } 886 }*/ 887 888 setLodTreesLibrary(geoMeshLoader->GetLodStripsData(), geoMeshLoader->GetTreeSimpSeq(), mGeoMesh/*, leafsSubMeshID*/); 902 setLodTreesLibrary( geoMeshLoader->GetLodStripsData(), 903 geoMeshLoader->GetTreeSimpSeq(), 904 mGeoMesh); 889 905 890 906 // Sets the aplication mode. … … 923 939 } 924 940 925 //------------------------------------------------------------------------- --941 //------------------------------------------------------------------------- 926 942 // Open LodStrip trunk Callback 927 //------------------------------------------------------------------------- --943 //------------------------------------------------------------------------- 928 944 inline void GeoMeshViewUI::cb_menuLodTreesOpenLodStripTrunk_i(fltk::Item*, void*) 929 945 { … … 937 953 } 938 954 939 //------------------------------------------------------------------------- --955 //------------------------------------------------------------------------- 940 956 // Open leaves simplification Callback 941 //------------------------------------------------------------------------- --957 //------------------------------------------------------------------------- 942 958 inline void GeoMeshViewUI::cb_menuLodTreesOpenLeavesSimplification_i(fltk::Item*, void*) 943 959 { … … 964 980 965 981 966 //------------------------------------------------------------------------- --982 //------------------------------------------------------------------------- 967 983 // About Callback 968 //------------------------------------------------------------------------- --984 //------------------------------------------------------------------------- 969 985 inline void GeoMeshViewUI::cb_menuHelpAbout_i(fltk::Item*, void*) 970 986 { … … 983 999 Index *orig_indices = NULL; 984 1000 985 //------------------------------------------------------------------------- --1001 //------------------------------------------------------------------------- 986 1002 // Button Process Callback 987 //------------------------------------------------------------------------- --1003 //------------------------------------------------------------------------- 988 1004 inline void GeoMeshViewUI::cb_mButtonProcess_i(fltk::Button*, void*) 989 1005 { … … 1043 1059 mGeoMesh = mesh_aux; 1044 1060 1045 // Visualize mesh.1046 geoMeshView->setMesh(mGeoMesh);1047 1048 1061 // Simplify the mesh object. 1049 1062 if(simplifyEdgeCollapse()) … … 1051 1064 geoMeshView->restoreContext(); 1052 1065 } 1066 1067 // Visualize mesh. 1068 geoMeshView->setMesh(mGeoMesh); 1069 1053 1070 } 1054 1071 break; … … 1074 1091 else 1075 1092 { 1076 origSubMeshVB=mGeoMesh->mSubMesh[idMeshLeaves].mVertexBuffer->Clone(); 1077 orig_numindices=mGeoMesh->mSubMesh[idMeshLeaves].mIndexCount; 1078 orig_indices=new Index[orig_numindices]; 1079 for (int i=0; i<orig_numindices; i++) 1093 origSubMeshVB = mGeoMesh-> 1094 mSubMesh[idMeshLeaves].mVertexBuffer->Clone(); 1095 1096 orig_numindices = mGeoMesh->mSubMesh[idMeshLeaves].mIndexCount; 1097 orig_indices = new Index[orig_numindices]; 1098 1099 for (int i = 0; i < orig_numindices; i++) 1100 { 1080 1101 orig_indices[i]=mGeoMesh->mSubMesh[idMeshLeaves].mIndex[i]; 1102 } 1081 1103 1082 1104 std::cout << "Simplificando hojas..."; … … 1102 1124 // Gets the mesh Shared Vertex. 1103 1125 mGeoMesh = mesh_aux; 1104 1105 geoMeshView->setMesh(mGeoMesh);1106 1126 1107 1127 // Simplify the mesh object. … … 1115 1135 } 1116 1136 1137 geoMeshView->setMesh(mGeoMesh); 1117 1138 } 1118 1139 … … 1147 1168 mGeoMesh = mesh_aux; 1148 1169 1149 // Visualize mesh.1150 geoMeshView->setMesh(mGeoMesh);1151 1152 1170 // Simplify the mesh object. 1153 1171 if (simplifyEdgeCollapse()) … … 1159 1177 activeBuildProcess(); 1160 1178 } 1179 1180 // Visualize mesh. 1181 geoMeshView->setMesh(mGeoMesh); 1161 1182 } 1162 1183 … … 1259 1280 delete mUndoMesh; 1260 1281 1282 1261 1283 mUndoMesh = new Mesh(); 1262 1284 … … 1454 1476 mViewPointDriven->set_visible(); 1455 1477 mViewPointDriven->activate(); 1478 mViewPointDriven->clear(); 1456 1479 1457 1480 /* … … 1472 1495 mVerticesNumber->set_visible(); 1473 1496 mVerticesNumber->activate(); 1497 mVerticesNumber->clear(); 1474 1498 1475 1499 mMeshReduction->set_visible(); 1500 mMeshReduction->value(100); 1476 1501 1477 1502 // Allows floating point. … … 1658 1683 1659 1684 // Deactive VMI option. 1660 mViewPointDriven->deactivate();1685 //mViewPointDriven->deactivate(); 1661 1686 1662 1687 mButtonBuild->set_visible(); … … 1745 1770 } 1746 1771 1747 //-------------------------------------------------------------------------- -1772 //-------------------------------------------------------------------------- 1748 1773 // Show the mesh info browser. 1749 //-------------------------------------------------------------------------- -1774 //-------------------------------------------------------------------------- 1750 1775 void GeoMeshViewUI::showMeshInfo() 1751 1776 { 1752 char type[10]; 1777 char type[10]; 1778 unsigned int group_index; 1779 unsigned int group_count; 1780 unsigned int bone_count; 1781 fltk::ItemGroup **info_group; 1782 1783 group_index = 0; 1753 1784 1754 1785 if (mGeoMesh) … … 1759 1790 ogeometry->begin(); 1760 1791 1761 fltk::ItemGroup **oprueba; 1762 oprueba=new fltk::ItemGroup*[mGeoMesh->mSubMeshCount]; 1792 group_count = mGeoMesh->mSubMeshCount; 1793 1794 // Add one group for skeleton info. 1795 if (mGeoMesh->hasSkeleton) 1796 { 1797 group_count++; 1798 } 1799 1800 info_group = new fltk::ItemGroup*[group_count]; 1801 1802 // Write skeleton info. 1803 if (mGeoMesh->hasSkeleton) 1804 { 1805 char *group_name = new char[256]; 1806 char *skel_name = new char[256]; 1807 char *bone_assig = new char[256]; 1808 sprintf(group_name,"Skeleton"); 1809 info_group[group_index] = new fltk::ItemGroup(group_name); 1810 1811 info_group[group_index]->begin(); 1812 sprintf(skel_name,"Name: %s",mGeoMesh->mSkeletonName); 1813 new fltk::Item(skel_name); 1814 bone_count = mGeoMesh->mBones.size(); 1815 1816 for (int i = 0; i < mGeoMesh->mSubMeshCount; i++) 1817 { 1818 bone_count += mGeoMesh->mSubMesh[i].mBones.size(); 1819 } 1820 sprintf(bone_assig,"Bone assignamets: %d",bone_count); 1821 new fltk::Item(bone_assig); 1822 info_group[group_index]->end(); 1823 1824 group_index++; 1825 } 1826 1763 1827 for(int i=0; i<mGeoMesh->mSubMeshCount;i++) 1764 1828 { 1765 char *cadena=new char[256];1829 char *group_name = new char[256]; 1766 1830 1767 1831 if (geoMeshView->getLeavesSubMesh() >= 0) … … 1782 1846 1783 1847 // Submesh identifier. 1784 sprintf( cadena,"SubMesh %d %s",i,type);1848 sprintf(group_name,"SubMesh %d %s",i,type); 1785 1849 1786 oprueba[i] = new fltk::ItemGroup(cadena);1787 oprueba[i]->begin();1850 info_group[group_index] = new fltk::ItemGroup(group_name); 1851 info_group[group_index]->begin(); 1788 1852 fltk::Item *sharedGeometry; 1789 1853 if (mGeoMesh->mSubMesh[i].mSharedVertexBuffer) … … 1838 1902 1839 1903 1840 oprueba[i]->end();1904 info_group[group_index]->end(); 1841 1905 } 1842 1906 ogeometry->end(); … … 1851 1915 } 1852 1916 1853 //-------------------------------------------------------------------------- -1917 //-------------------------------------------------------------------------- 1854 1918 // Hide the mesh info browser. 1855 //-------------------------------------------------------------------------- -1919 //-------------------------------------------------------------------------- 1856 1920 void GeoMeshViewUI::hideMeshInfo() 1857 1921 { … … 1860 1924 } 1861 1925 1862 //-------------------------------------------------------------------------- -1926 //-------------------------------------------------------------------------- 1863 1927 // Hide the right panel. 1864 //-------------------------------------------------------------------------- -1928 //-------------------------------------------------------------------------- 1865 1929 void GeoMeshViewUI::hideRightPanel() 1866 1930 { … … 1875 1939 } 1876 1940 1877 //-------------------------------------------------------------------------- -1941 //-------------------------------------------------------------------------- 1878 1942 // Get the number of vertices. 1879 //-------------------------------------------------------------------------- -1943 //-------------------------------------------------------------------------- 1880 1944 size_t GeoMeshViewUI::getVertexCount(Mesh *geoMesh) 1881 1945 { … … 2013 2077 } 2014 2078 2079 // Saves OpenGL contex. 2015 2080 geoMeshView->saveContext(); 2016 2081 … … 2046 2111 2047 2112 // Simplifica el geomesh -> Parámetro es un factor LOD [0,1]. 2113 2048 2114 mMeshSimplifier->Simplify(percent); 2049 2115 … … 2059 2125 2060 2126 mGeoMesh = mMeshSimplifier->GetMesh(); 2061 2062 // Visualize mesh.2063 geoMeshView->setMesh(mGeoMesh);2064 2127 } 2065 2128 else … … 2090 2153 2091 2154 mGeoMesh = mMeshSimplifier->GetMesh(); 2092 2093 // Visualize the mesh.2094 geoMeshView->setMesh(mGeoMesh);2095 2155 } 2096 2156 … … 2263 2323 void GeoMeshViewUI::undo() 2264 2324 { 2325 Mesh *aux_mesh; 2326 2265 2327 // if the undo mesh is not initialized. 2266 2328 if (mUndoMesh != NULL) 2267 2329 { 2268 // Deletes the actual mesh. 2269 delete mGeoMesh; 2270 2271 mGeoMesh = new Mesh(); 2272 2273 // Restore the previous mesh. 2274 *mGeoMesh = *mUndoMesh; 2330 aux_mesh = mGeoMesh; 2331 mGeoMesh = mUndoMesh; 2275 2332 2276 2333 // Visualize the mesh. … … 2282 2339 // Repaint the window. 2283 2340 mMainWindow->redraw(); 2341 2342 // Deletes the actual mesh. 2343 delete aux_mesh; 2344 2345 mUndoMesh = NULL; 2284 2346 } 2285 2347 } … … 2466 2528 menuRenderSolid->clear_value(); 2467 2529 menuRenderWire->clear_value(); 2530 menuRenderLighting->set_value(); 2468 2531 geoMeshView->deactiveSolid(); 2469 2532 geoMeshView->deactiveWire(); 2533 geoMeshView->activeLighting(); 2470 2534 2471 2535 // Fit model in midle. … … 2808 2872 2809 2873 { 2874 fltk::Item* o = new fltk::Item("Transform to SV"); 2875 o->callback((fltk::Callback*)cb_menuFileTransformSharedVertex); 2876 } 2877 2878 { 2810 2879 menuLoadTextures = new fltk::ItemGroup("Load Textures"); 2811 2880 o->add(menuLoadTextures); … … 2833 2902 fltk::Item* o = menuEditFit = new fltk::Item("Fit"); 2834 2903 o->callback((fltk::Callback*)cb_menuEditFit); 2835 2836 2904 } 2837 2905 … … 2879 2947 o->type(fltk::Item::RADIO); 2880 2948 o->callback((fltk::Callback*)cb_menuRenderSolid); 2949 } 2950 2951 { 2952 fltk::Item* o = menuRenderLighting = new fltk::Item("Lighting"); 2953 o->type(fltk::Item::RADIO); 2954 o->callback((fltk::Callback*)cb_menuRenderLighting); 2881 2955 } 2882 2956
Note: See TracChangeset
for help on using the changeset viewer.