2020-02-08 04:30:55 +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.
|
|
|
|
//============================================================================
|
|
|
|
#ifndef vtk_m_rendering_raytracing_ScalarRenderer_h
|
|
|
|
#define vtk_m_rendering_raytracing_ScalarRenderer_h
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include <vtkm/cont/DataSet.h>
|
|
|
|
|
|
|
|
#include <vtkm/rendering/raytracing/Camera.h>
|
|
|
|
#include <vtkm/rendering/raytracing/TriangleIntersector.h>
|
2023-05-10 16:17:14 +00:00
|
|
|
|
2020-02-08 04:30:55 +00:00
|
|
|
namespace vtkm
|
|
|
|
{
|
|
|
|
namespace rendering
|
|
|
|
{
|
|
|
|
namespace raytracing
|
|
|
|
{
|
|
|
|
|
|
|
|
class VTKM_RENDERING_EXPORT ScalarRenderer
|
|
|
|
{
|
2023-05-10 16:17:14 +00:00
|
|
|
private:
|
|
|
|
vtkm::cont::Invoker Invoke;
|
|
|
|
|
2020-02-08 04:30:55 +00:00
|
|
|
protected:
|
2023-05-10 16:17:14 +00:00
|
|
|
std::unique_ptr<ShapeIntersector> Intersector;
|
2020-02-08 04:30:55 +00:00
|
|
|
std::vector<vtkm::cont::Field> Fields;
|
|
|
|
|
|
|
|
template <typename Precision>
|
2022-07-05 18:58:18 +00:00
|
|
|
void RenderOnDevice(Ray<Precision>& rays,
|
|
|
|
Precision missScalar,
|
|
|
|
vtkm::rendering::raytracing::Camera& cam);
|
2020-02-09 16:57:32 +00:00
|
|
|
|
|
|
|
template <typename Precision>
|
2023-05-10 16:17:14 +00:00
|
|
|
void AddBuffer(Ray<Precision>& rays, Precision missScalar, const std::string& name);
|
2020-02-09 16:57:32 +00:00
|
|
|
|
|
|
|
template <typename Precision>
|
|
|
|
void AddDepthBuffer(Ray<Precision>& rays);
|
2020-02-08 04:30:55 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
VTKM_CONT
|
2023-05-10 23:28:30 +00:00
|
|
|
void SetShapeIntersector(std::unique_ptr<ShapeIntersector>&& intersector);
|
2020-02-08 04:30:55 +00:00
|
|
|
|
|
|
|
VTKM_CONT
|
|
|
|
void AddField(const vtkm::cont::Field& scalarField);
|
|
|
|
|
|
|
|
VTKM_CONT
|
2022-07-06 15:01:10 +00:00
|
|
|
void Render(vtkm::rendering::raytracing::Ray<vtkm::Float32>& rays,
|
|
|
|
vtkm::Float32 missScalar,
|
2022-07-05 18:58:18 +00:00
|
|
|
vtkm::rendering::raytracing::Camera& cam);
|
2020-02-08 04:30:55 +00:00
|
|
|
|
|
|
|
VTKM_CONT
|
2022-07-05 18:58:18 +00:00
|
|
|
void Render(vtkm::rendering::raytracing::Ray<vtkm::Float64>& rays,
|
|
|
|
vtkm::Float64 missScalar,
|
|
|
|
vtkm::rendering::raytracing::Camera& cam);
|
2020-02-08 04:30:55 +00:00
|
|
|
|
|
|
|
}; //class RayTracer
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} // namespace vtkm::rendering::raytracing
|
2023-05-10 16:17:14 +00:00
|
|
|
#endif //vtk_m_rendering_raytracing_ScalarRenderer_h
|