Commit 361c5695 authored by larsen30@llnl.gov's avatar larsen30@llnl.gov

adjusing ray start

parent 70553729
......@@ -60,6 +60,28 @@ namespace raytracing
namespace detail
{
class AdjustSample : public vtkm::worklet::WorkletMapField
{
vtkm::Float64 SampleDistance;
public:
VTKM_CONT
AdjustSample(const vtkm::Float64 sampleDistance)
: SampleDistance(sampleDistance)
{
}
using ControlSignature = void(FieldIn<>, FieldInOut<>);
using ExecutionSignature = void(_1, _2);
template <typename FloatType>
VTKM_EXEC inline void operator()(const vtkm::UInt8& status, FloatType& currentDistance) const
{
if (status != RAY_ACTIVE)
return;
currentDistance += FMod(currentDistance, (FloatType)SampleDistance);
}
}; //class AdvanceRay
template <typename FloatType>
void RayTracking<FloatType>::Compact(vtkm::cont::ArrayHandle<FloatType>& compactedDistances,
vtkm::cont::ArrayHandle<UInt8>& masks)
......@@ -1298,6 +1320,12 @@ void ConnectivityTracer::IntegrateMeshSegment(Ray<FloatType>& rays)
bool hasPathLengths = rays.HasBuffer("path_lengths");
if (this->Integrator == Volume)
{
vtkm::worklet::DispatcherMapField<detail::AdjustSample> adispatcher(SampleDistance);
adispatcher.Invoke(rays.Status, rayTracker.CurrentDistance);
}
while (RayOperations::RaysInMesh(rays))
{
//
......
......@@ -43,7 +43,7 @@ namespace raytracing
struct IsUnique
{
VTKM_EXEC_CONT
inline bool operator()(const vtkm::Int32& x) const { return (x < 0); }
inline bool operator()(const vtkm::Int32& x) const { return x < 0; }
}; //struct IsExternal
class CountFaces : public vtkm::worklet::WorkletMapField
......
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