mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-08 21:33:55 +00:00
adding sample distance to the volume mapper
This commit is contained in:
parent
c487931f1f
commit
3fe918ce4d
@ -39,13 +39,15 @@ namespace rendering {
|
||||
struct MapperVolume::InternalsType
|
||||
{
|
||||
vtkm::rendering::CanvasRayTracer *Canvas;
|
||||
vtkm::Float32 SampleDistance;
|
||||
vtkm::cont::internal::RuntimeDeviceTracker DeviceTracker;
|
||||
std::shared_ptr<vtkm::cont::internal::SimplePolymorphicContainerBase>
|
||||
RayTracerContainer;
|
||||
|
||||
VTKM_CONT
|
||||
InternalsType()
|
||||
: Canvas(nullptr)
|
||||
: Canvas(nullptr),
|
||||
SampleDistance(-1.f)
|
||||
{ }
|
||||
|
||||
template<typename Device>
|
||||
@ -146,7 +148,7 @@ struct MapperVolume::RenderFunctor
|
||||
|
||||
tracer->GetCamera().SetParameters(this->Camera,
|
||||
*this->Self->Internals->Canvas);
|
||||
|
||||
tracer->SetSampleDistance(this->Self->Internals->SampleDistance);
|
||||
vtkm::Bounds dataBounds = this->Coordinates.GetBounds(Device());
|
||||
|
||||
tracer->SetData(this->Coordinates,
|
||||
@ -206,5 +208,10 @@ vtkm::rendering::Mapper *MapperVolume::NewCopy() const
|
||||
return new vtkm::rendering::MapperVolume(*this);
|
||||
}
|
||||
|
||||
void MapperVolume::SetSampleDistance(const vtkm::Float32 sampleDistance)
|
||||
{
|
||||
this->Internals->SampleDistance = sampleDistance;
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace vtkm::rendering
|
||||
|
@ -48,7 +48,7 @@ public:
|
||||
virtual void EndScene() VTKM_OVERRIDE;
|
||||
|
||||
vtkm::rendering::Mapper *NewCopy() const VTKM_OVERRIDE;
|
||||
|
||||
void SetSampleDistance(const vtkm::Float32 distance);
|
||||
private:
|
||||
struct InternalsType;
|
||||
std::shared_ptr<InternalsType> Internals;
|
||||
|
Loading…
Reference in New Issue
Block a user