2020-02-18 03:00:09 +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_ScalarRenderer_h
|
|
|
|
#define vtk_m_rendering_ScalarRenderer_h
|
|
|
|
|
|
|
|
#include <vtkm/cont/DataSet.h>
|
|
|
|
#include <vtkm/rendering/Camera.h>
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
namespace vtkm
|
|
|
|
{
|
|
|
|
namespace rendering
|
|
|
|
{
|
|
|
|
|
|
|
|
class VTKM_RENDERING_EXPORT ScalarRenderer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ScalarRenderer();
|
|
|
|
|
2023-05-10 16:17:14 +00:00
|
|
|
// Note: since we are using std::unique_ptr<T> for PIMPL, the compiler does
|
|
|
|
// not know the real size of std::unique_ptr<T> at this point. Thus, we
|
|
|
|
// can not have the definition of the destructor here. We need to declare it
|
|
|
|
// here and have an implementation in .cxx. The implementation could just
|
|
|
|
// be = default.
|
2020-02-18 03:00:09 +00:00
|
|
|
~ScalarRenderer();
|
|
|
|
|
|
|
|
void SetInput(vtkm::cont::DataSet& dataSet);
|
|
|
|
|
|
|
|
void SetWidth(const vtkm::Int32 width);
|
|
|
|
void SetHeight(const vtkm::Int32 height);
|
|
|
|
void SetDefaultValue(vtkm::Float32 value);
|
|
|
|
|
2020-02-18 03:50:40 +00:00
|
|
|
struct VTKM_RENDERING_EXPORT Result
|
2020-02-18 03:00:09 +00:00
|
|
|
{
|
|
|
|
vtkm::Int32 Width;
|
|
|
|
vtkm::Int32 Height;
|
2020-02-18 15:25:00 +00:00
|
|
|
vtkm::cont::ArrayHandle<vtkm::Float32> Depths;
|
2020-02-18 03:00:09 +00:00
|
|
|
std::vector<vtkm::cont::ArrayHandle<vtkm::Float32>> Scalars;
|
|
|
|
std::vector<std::string> ScalarNames;
|
|
|
|
std::map<std::string, vtkm::Range> Ranges;
|
|
|
|
|
2020-02-18 17:45:31 +00:00
|
|
|
vtkm::cont::DataSet ToDataSet();
|
2020-02-18 03:00:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
ScalarRenderer::Result Render(const vtkm::rendering::Camera& camera);
|
|
|
|
|
|
|
|
private:
|
|
|
|
struct InternalsType;
|
2023-05-10 16:17:14 +00:00
|
|
|
std::unique_ptr<InternalsType> Internals;
|
2020-02-18 03:00:09 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
} //namespace vtkm::rendering
|
|
|
|
|
|
|
|
#endif //vtk_m_rendering_ScalarRenderer_h
|