Changeset 2300 for GTP/trunk/Lib/Geom/shared/GeoTool/src
- Timestamp:
- 03/30/07 11:38:28 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshViewUI.cpp
r2291 r2300 1119 1119 mGeoMesh = mesh_aux; 1120 1120 1121 // Visualize mesh. 1122 geoMeshView->setMesh(mGeoMesh); 1123 1121 1124 // Simplify the mesh object. 1122 1125 if(simplifyEdgeCollapse()) … … 1172 1175 undo(); 1173 1176 1174 1175 1177 std::cout << "Simplificando tronco..."; 1176 1178 std::cout << "OK!" << std::endl; … … 1184 1186 // Gets the mesh Shared Vertex. 1185 1187 mGeoMesh = mesh_aux; 1188 1189 // Visualize mesh. 1190 geoMeshView->setMesh(mGeoMesh); 1186 1191 1187 1192 // Simplify the mesh object. … … 1198 1203 } 1199 1204 1200 break; 1205 break; 1201 1206 1202 1207 case LODSTRIPS_AUTO: … … 1227 1232 // Gets the mesh Shared Vertex. 1228 1233 mGeoMesh = mesh_aux; 1234 1235 // Visualize mesh. 1236 geoMeshView->setMesh(mGeoMesh); 1229 1237 1230 1238 // Simplify the mesh object. … … 2125 2133 bool GeoMeshViewUI::simplifyEdgeCollapse() 2126 2134 { 2127 Real percent;2135 int error; 2128 2136 2129 2137 // Free memory. … … 2133 2141 } 2134 2142 2135 // 2143 // If input field empty. 2136 2144 if (mMeshReduction->fvalue() <= 0.0) 2137 2145 { … … 2161 2169 } 2162 2170 2163 mMeshSimplifier->setMeshLeaves(idMeshLeaves);2164 2165 2171 if (mPercent->value()) 2166 2172 { … … 2169 2175 mMeshReduction->fvalue() > 0.0) 2170 2176 { 2171 percent = mMeshReduction->fvalue(); 2172 percent = percent / 100.0; 2173 2174 mMeshSimplifier->Simplify(percent); 2175 2176 // Deletes the previous mesh. 2177 delete mUndoMesh; 2178 2179 mUndoMesh = new Mesh(); 2180 2181 // Sets the undo mesh. 2182 *mUndoMesh = *mGeoMesh; 2183 2184 delete mGeoMesh; 2185 2186 mGeoMesh = mMeshSimplifier->GetMesh(); 2177 Real value; 2178 2179 value = mMeshReduction->fvalue(); 2180 value = value / 100.0; 2181 2182 error = mMeshSimplifier->Simplify(value); 2187 2183 } 2188 2184 else … … 2197 2193 { 2198 2194 // Simplification until number of vertices. 2199 uint32 v = (uint32)mMeshReduction->fvalue(); 2200 2201 mMeshSimplifier->Simplify(v); 2202 2195 uint32 value = (uint32)mMeshReduction->fvalue(); 2196 2197 error = mMeshSimplifier->Simplify(value); 2198 } 2199 2200 // If no error happens. 2201 if (error == NO_GL_ERROR) 2202 { 2203 2203 // Deletes the previous mesh. 2204 2204 delete mUndoMesh; … … 2209 2209 *mUndoMesh = *mGeoMesh; 2210 2210 2211 delete 2211 delete mGeoMesh; 2212 2212 2213 2213 mGeoMesh = mMeshSimplifier->GetMesh(); 2214 } 2215 // If and error happens. 2216 else 2217 { 2218 char error_message[512]=""; 2219 2220 if ((error & FRAMEBUFFER_ERROR) == FRAMEBUFFER_ERROR) 2221 { 2222 strcat( error_message, 2223 "GL_EXT_framebuffer_object extension not found.\n"); 2224 } 2225 2226 if ((error & VERTEX_BUFFER_ERROR) == VERTEX_BUFFER_ERROR) 2227 { 2228 strcat( error_message, 2229 "GL_ARB_vertex_buffer_object extension not found.\n"); 2230 } 2231 2232 if ((error & OCCLUSION_QUERY_ERROR) 2233 == 2234 OCCLUSION_QUERY_ERROR) 2235 { 2236 strcat( error_message, 2237 "GL_ARB_occlusion_query extension not found.\n"); 2238 } 2239 2240 if ((error & IMAGING_ERROR) == IMAGING_ERROR) 2241 { 2242 strcat( error_message, 2243 "GL_ARB_imaging extension not found.\n"); 2244 } 2245 2246 if ((error & MULTITEXTURE_ERROR) == MULTITEXTURE_ERROR) 2247 { 2248 strcat( error_message, 2249 "GL_ARB_multitexture extension not found.\n"); 2250 } 2251 2252 if ((error & SWAP_CONTROL_ERROR) == SWAP_CONTROL_ERROR) 2253 { 2254 strcat( error_message, 2255 "WGL_EXT_swap_control extension not found.\n"); 2256 } 2257 2258 strcat( error_message, 2259 "\nUpdating the video card driver may resolve the problem."); 2260 2261 fltk::alert(error_message); 2262 2263 return false; 2214 2264 } 2215 2265 … … 2261 2311 2262 2312 mUndoMesh = new Mesh(); 2263 2313 2264 2314 // Sets the undo mesh. 2265 2315 *mUndoMesh = *mGeoMesh; … … 2268 2318 2269 2319 mGeoMesh = mTreeSimplifier->GetMesh(); 2270 2320 2271 2321 geoMeshView->setMesh(mGeoMesh); 2272 2322 }
Note: See TracChangeset
for help on using the changeset viewer.