Commit 45994bd4 authored by Matt Larsen's avatar Matt Larsen Committed by Kitware Robot
Browse files

Merge topic 'fix/multi_mapper'

2780bf4d removing extra ;
75f911cf

 Fixing default sample distance
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !1255
parents b0a4d545 2780bf4d
......@@ -81,10 +81,18 @@ 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