Commit 75f911cf authored by Matt Larsen's avatar Matt Larsen
Browse files

Fixing default sample distance

parent 0200fcbf
......@@ -81,10 +81,19 @@ void MapperConnectivity::RenderCells(const vtkm::cont::DynamicCellSet& cellset,
const vtkm::Range& vtkmNotUsed(scalarRange))
{
vtkm::rendering::ConnectivityProxy tracerProxy(cellset, coords, scalarField);
if (SampleDistance != -1.f)
if (SampleDistance == -1.f)
{
tracerProxy.SetSampleDistance(SampleDistance);
// set a default distance
vtkm::Bounds bounds = coords.GetBounds();
vtkm::Float64 x2 = bounds.X.Length() * bounds.X.Length();
vtkm::Float64 y2 = bounds.Y.Length() * bounds.Y.Length();
vtkm::Float64 z2 = bounds.Z.Length() * bounds.Z.Length();
vtkm::Float64 length = vtkm::Sqrt(x2 + y2 + z2);
;
constexpr vtkm::Float64 defaultSamples = 200.;
SampleDistance = static_cast<vtkm::Float32>(length / defaultSamples);
}
tracerProxy.SetSampleDistance(SampleDistance);
tracerProxy.SetColorMap(ColorMap);
tracerProxy.Trace(camera, CanvasRT);
}
......
Markdown is supported
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