2019-04-15 23:24:21 +00:00
|
|
|
//============================================================================
|
2016-05-19 00:51:04 +00:00
|
|
|
// Copyright (c) Kitware, Inc.
|
|
|
|
// All rights reserved.
|
|
|
|
// See LICENSE.txt for details.
|
|
|
|
//
|
|
|
|
// This software is distributed WITHOUT ANY WARRANTY; without even
|
|
|
|
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
// PURPOSE. See the above copyright notice for more information.
|
2019-04-15 23:24:21 +00:00
|
|
|
//============================================================================
|
2016-05-18 23:30:07 +00:00
|
|
|
#ifndef vtk_m_rendering_raytracing_VolumeRendererStructured_h
|
|
|
|
#define vtk_m_rendering_raytracing_VolumeRendererStructured_h
|
2016-01-20 22:40:54 +00:00
|
|
|
|
2017-07-08 20:48:38 +00:00
|
|
|
#include <vtkm/cont/DataSet.h>
|
|
|
|
|
2017-05-18 14:51:24 +00:00
|
|
|
#include <vtkm/rendering/raytracing/Ray.h>
|
2020-06-19 14:41:54 +00:00
|
|
|
#include <vtkm/rendering/vtkm_rendering_export.h>
|
2016-01-20 22:40:54 +00:00
|
|
|
|
2017-05-18 14:29:41 +00:00
|
|
|
namespace vtkm
|
|
|
|
{
|
|
|
|
namespace rendering
|
|
|
|
{
|
|
|
|
namespace raytracing
|
|
|
|
{
|
2016-05-19 23:15:06 +00:00
|
|
|
|
2020-06-19 14:41:54 +00:00
|
|
|
class VTKM_RENDERING_EXPORT VolumeRendererStructured
|
2016-01-20 22:40:54 +00:00
|
|
|
{
|
|
|
|
public:
|
2016-10-19 22:42:58 +00:00
|
|
|
VTKM_CONT
|
2019-07-31 16:20:38 +00:00
|
|
|
void SetColorMap(const vtkm::cont::ArrayHandle<vtkm::Vec4f_32>& colorMap);
|
2016-01-20 22:40:54 +00:00
|
|
|
|
2016-10-19 22:42:58 +00:00
|
|
|
VTKM_CONT
|
2017-05-26 17:53:28 +00:00
|
|
|
void SetData(const vtkm::cont::CoordinateSystem& coords,
|
|
|
|
const vtkm::cont::Field& scalarField,
|
|
|
|
const vtkm::cont::CellSetStructured<3>& cellset,
|
2017-07-08 20:48:38 +00:00
|
|
|
const vtkm::Range& scalarRange);
|
2016-01-20 22:40:54 +00:00
|
|
|
|
2017-06-17 21:28:45 +00:00
|
|
|
|
2017-07-08 20:48:38 +00:00
|
|
|
VTKM_CONT
|
|
|
|
void Render(vtkm::rendering::raytracing::Ray<vtkm::Float32>& rays);
|
|
|
|
//VTKM_CONT
|
|
|
|
///void Render(vtkm::rendering::raytracing::Ray<vtkm::Float64>& rays);
|
2017-06-17 21:28:45 +00:00
|
|
|
|
2016-01-20 22:40:54 +00:00
|
|
|
|
2016-10-19 22:42:58 +00:00
|
|
|
VTKM_CONT
|
2017-07-08 20:48:38 +00:00
|
|
|
void SetSampleDistance(const vtkm::Float32& distance);
|
2016-01-20 22:40:54 +00:00
|
|
|
|
|
|
|
protected:
|
2017-07-08 20:48:38 +00:00
|
|
|
template <typename Precision, typename Device>
|
|
|
|
VTKM_CONT void RenderOnDevice(vtkm::rendering::raytracing::Ray<Precision>& rays, Device);
|
|
|
|
|
2023-04-20 19:34:58 +00:00
|
|
|
bool IsSceneDirty = false;
|
|
|
|
bool IsUniformDataSet = true;
|
2017-06-17 21:28:45 +00:00
|
|
|
vtkm::Bounds SpatialExtent;
|
2020-06-30 21:10:48 +00:00
|
|
|
vtkm::cont::CoordinateSystem Coordinates;
|
2016-01-20 22:40:54 +00:00
|
|
|
vtkm::cont::CellSetStructured<3> Cellset;
|
2017-05-18 14:29:41 +00:00
|
|
|
const vtkm::cont::Field* ScalarField;
|
2019-07-31 16:20:38 +00:00
|
|
|
vtkm::cont::ArrayHandle<vtkm::Vec4f_32> ColorMap;
|
2023-04-20 19:34:58 +00:00
|
|
|
vtkm::Float32 SampleDistance = -1.f;
|
2016-05-26 23:04:35 +00:00
|
|
|
vtkm::Range ScalarRange;
|
2016-01-20 22:40:54 +00:00
|
|
|
};
|
2017-05-18 14:29:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} //namespace vtkm::rendering::raytracing
|
2016-05-18 05:13:36 +00:00
|
|
|
#endif
|