From 74dcd1c5ccfe19a5ab9f1a2b62eb4a454efc85c0 Mon Sep 17 00:00:00 2001 From: Christopher Meyer Sewell - 188584 Date: Tue, 1 Sep 2015 15:00:31 -0600 Subject: [PATCH] Adding back point coordinate computations in isosurface worklet --- vtkm/worklet/IsosurfaceUniformGrid.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/vtkm/worklet/IsosurfaceUniformGrid.h b/vtkm/worklet/IsosurfaceUniformGrid.h index acfa03706..6ade4ed94 100644 --- a/vtkm/worklet/IsosurfaceUniformGrid.h +++ b/vtkm/worklet/IsosurfaceUniformGrid.h @@ -176,6 +176,29 @@ public: // Compute the coordinates of the uniform regular grid at each of the cell's eight vertices vtkm::Vec p[8]; + // If we have offset and spacing, can we simplify this computation + { + vtkm::Vec offset = vtkm::make_Vec(xmin+(xmax-xmin), + ymin+(ymax-ymin), + zmin+(zmax-zmin) ); + + vtkm::Vec spacing = vtkm::make_Vec( 1.0f /((float)(xdim-1)), + 1.0f /((float)(ydim-1)), + 1.0f /((float)(zdim-1))); + + vtkm::Vec firstPoint = offset * spacing * vtkm::make_Vec( x, y, z ); + vtkm::Vec secondPoint = offset * spacing * vtkm::make_Vec( x+1, y+1, z+1 ); + + p[0] = vtkm::make_Vec( firstPoint[0], firstPoint[1], firstPoint[2]); + p[1] = vtkm::make_Vec( secondPoint[0], firstPoint[1], firstPoint[2]); + p[2] = vtkm::make_Vec( secondPoint[0], secondPoint[1], firstPoint[2]); + p[3] = vtkm::make_Vec( firstPoint[0], secondPoint[1], firstPoint[2]); + p[4] = vtkm::make_Vec( firstPoint[0], firstPoint[1], secondPoint[2]); + p[5] = vtkm::make_Vec( secondPoint[0], firstPoint[1], secondPoint[2]); + p[6] = vtkm::make_Vec( secondPoint[0], secondPoint[1], secondPoint[2]); + p[7] = vtkm::make_Vec( firstPoint[0], secondPoint[1], secondPoint[2]); + } + // Get the scalar source values at the eight vertices float s[8]; s[0] = this->Source.Get(i0);