Commit d476adf1 by Matt Larsen

### fixing issue with volume renderer where initial samples were outside the cell set

parent 9e466f8c
 ... ... @@ -134,7 +134,7 @@ public: { // // When searching for points, we consider the max value of the cell // to be apart of the next cell. If the point falls on the boundary of the // to be apart of the next cell. If the point falls on the boundry of the // data set, then it is technically inside a cell. This checks for that case // if (point[dim] == MaxPoint[dim]) ... ... @@ -372,8 +372,17 @@ public: } //get the initial sample position; vtkm::Vec sampleLocation; vtkm::Float32 distance = 0.00001f + minDistance; // find the distance to the first sample vtkm::Float32 distance = minDistance + 0.0001f; sampleLocation = rayOrigin + distance * rayDir; // since the calculations are slightly different, we could hit an // edge case where the first sample location may not be in the data set. // Thus, advance to the next sample location while (!Locator.IsInside(sampleLocation) && distance < maxDistance) { distance += SampleDistance; sampleLocation = rayOrigin + distance * rayDir; } /* 7----------6 /| /| ... ... @@ -557,8 +566,17 @@ public: return; //TODO: Compact? or just image subset... //get the initial sample position; vtkm::Vec sampleLocation; vtkm::Float32 distance = 0.0001f + minDistance; // find the distance to the first sample vtkm::Float32 distance = minDistance + 0.0001f; sampleLocation = rayOrigin + distance * rayDir; // since the calculations are slightly different, we could hit an // edge case where the first sample location may not be in the data set. // Thus, advance to the next sample location while (!Locator.IsInside(sampleLocation) && distance < maxDistance) { distance += SampleDistance; sampleLocation = rayOrigin + distance * rayDir; } /* 7----------6 ... ... @@ -731,7 +749,7 @@ void VolumeRendererStructured::SetData(const vtkm::cont::CoordinateSystem& coord const vtkm::cont::CellSetStructured<3>& cellset, const vtkm::Range& scalarRange) { if (coords.GetData().IsType()) if (coords.GetData().IsSameType(CartesianArrayHandle())) IsUniformDataSet = false; IsSceneDirty = true; SpatialExtent = coords.GetBounds(); ... ...
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment