From 292cae8670f00e056a2c06d1778fc0f59e444fcf Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 7 Feb 2008 18:57:19 +0000 Subject: [PATCH] Bug fix: make MarchingCube's Gouraud display show all surfaces, and not only the last one. --- .../demo/Surface_mesher/qt4-demo/volume.cpp | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Surface_mesher/demo/Surface_mesher/qt4-demo/volume.cpp b/Surface_mesher/demo/Surface_mesher/qt4-demo/volume.cpp index 080dbb32d6e..add8ee3e3d2 100644 --- a/Surface_mesher/demo/Surface_mesher/qt4-demo/volume.cpp +++ b/Surface_mesher/demo/Surface_mesher/qt4-demo/volume.cpp @@ -309,17 +309,22 @@ void Volume::display_marchin_cube() timer.start(); m_surface_mc.clear(); + if(mc.ntrigs()!=0) + mc.clean_all(); + mc.set_resolution(nx,ny,nz); + mc.init_all(); + mc.set_ext_data(static_cast(m_image.image()->data)); + + const double xr = m_image.xmax() / nx; + const double yr = m_image.ymax() / ny; + const double zr = m_image.zmax() / nz; + for(int isovalue_id = 0; isovalue_id < isovalues_list->numberOfIsoValues(); ++isovalue_id) { status_message(QString("Marching cubes, isovalue #%1...").arg(isovalue_id)); - if(mc.ntrigs()!=0) - mc.clean_all(); - mc.set_resolution(nx,ny,nz); - mc.init_all(); - // set data // for(unsigned int i=0;i(m_image.image()->data)); // compute scaling ratio - const double xr = m_image.xmax() / nx; - const double yr = m_image.ymax() / ny; - const double zr = m_image.zmax() / nz; - + if(isovalue_id > 0) + mc.init_temps(); mc.run(isovalues_list->isovalue(isovalue_id), xr, yr, zr); mc.clean_temps();