VTK  9.3.20240419
vtkOSPRayVolumeMapperNode.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
10 #ifndef vtkOSPRayVolumeMapperNode_h
11 #define vtkOSPRayVolumeMapperNode_h
12 
13 #include "vtkOSPRayCache.h" // For common cache infrastructure
14 #include "vtkRenderingRayTracingModule.h" // For export macro
15 #include "vtkVolumeMapperNode.h"
16 
17 #include "RTWrapper/RTWrapper.h" // for handle types
18 
19 VTK_ABI_NAMESPACE_BEGIN
20 class vtkDataArray;
21 class vtkDataSet;
22 class vtkVolume;
23 
24 class VTKRENDERINGRAYTRACING_EXPORT vtkOSPRayVolumeMapperNode : public vtkVolumeMapperNode
25 {
26 public:
29  void PrintSelf(ostream& os, vtkIndent indent) override;
30 
34  void Render(bool prepass) override;
35 
41  void SetSamplingRate(double rate) { this->SamplingRate = rate; }
42  double GetSamplingRate() { return this->SamplingRate; }
43 
44 protected:
47 
51  void UpdateTransferFunction(RTW::Backend* be, vtkVolume* vol, double* dataRange = nullptr);
52 
53  // TODO: SetAndGetters?
54  int NumColors;
55  double SamplingRate;
56  double SamplingStep; // base sampling step of each voxel
57 
62 
68 
69  std::vector<float> TFVals;
70  std::vector<float> TFOVals;
71  std::vector<float> IsoColors;
72 
74 
75 private:
77  void operator=(const vtkOSPRayVolumeMapperNode&) = delete;
78 };
79 VTK_ABI_NAMESPACE_END
80 #endif
#define OSPGeometricModel
Definition: RTWrapper.h:22
#define OSPVolumetricModel
Definition: RTWrapper.h:33
#define OSPInstance
Definition: RTWrapper.h:21
#define OSPVolume
Definition: RTWrapper.h:32
#define OSPTransferFunction
Definition: RTWrapper.h:34
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:155
abstract class to specify dataset behavior
Definition: vtkDataSet.h:166
a simple class to control print indentation
Definition: vtkIndent.h:108
links vtkVolumeMapper to OSPRay
void Render(bool prepass) override
Make ospray calls to render me.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetSamplingRate(double rate)
TODO: fix me should be controlled by VTK SampleDistance, otherwise should use macros and modify self.
vtkOSPRayCache< vtkOSPRayCacheItemObject > * Cache
static vtkOSPRayVolumeMapperNode * New()
void UpdateTransferFunction(RTW::Backend *be, vtkVolume *vol, double *dataRange=nullptr)
updates internal OSPRay transfer function for volume
~vtkOSPRayVolumeMapperNode() override
record modification and/or execution time
Definition: vtkTimeStamp.h:44
vtkViewNode specialized for vtkVolumeMappers
represents a volume (data & properties) in a rendered scene
Definition: vtkVolume.h:120