VTK  9.7.20260812
vtkVolumeRepresentation.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
3
32
33#ifndef vtkVolumeRepresentation_h
34#define vtkVolumeRepresentation_h
35
37#include "vtkNew.h" // For ivars
38#include "vtkViewsRenderingModule.h" // For export macro
39
40VTK_ABI_NAMESPACE_BEGIN
45class vtkVolume;
47
48class VTKVIEWSRENDERING_EXPORT vtkVolumeRepresentation : public vtkDataRepresentation
49{
50public:
53 void PrintSelf(ostream& os, vtkIndent indent) override;
54
62
64
77 void SetScalarOpacityUnitDistance(double distance);
80
82
95
97
100 void SetShade(bool val);
101 bool GetShade();
102 void SetAmbient(double val);
103 double GetAmbient();
104 void SetDiffuse(double val);
105 double GetDiffuse();
106 void SetSpecular(double val);
107 double GetSpecular();
108 void SetSpecularPower(double val);
110 void SetInterpolationType(int val);
113
115
118 void SetBlendMode(int mode);
123
125
128 void SetVisibility(bool val);
130 void SetPosition(double x, double y, double z);
132 void SetOrientation(double x, double y, double z);
134 void SetScale(double x, double y, double z);
135 double* GetScale() VTK_SIZEHINT(3);
137
139
146
151
152protected:
155
157
158 bool AddToView(vtkView* view) override;
159 bool RemoveFromView(vtkView* view) override;
160
161private:
163 void operator=(const vtkVolumeRepresentation&) = delete;
164
165 void CreateDefaultTransferFunctions();
166
167 vtkNew<vtkSmartVolumeMapper> VolumeMapper;
168 vtkNew<vtkVolume> VolumeActor;
169 vtkNew<vtkVolumeProperty> VolumeProperty;
170 vtkNew<vtkScalarBarActor> ScalarBar;
171 bool ScalarBarVisible;
172 bool DefaultTransferFunctionsCreated;
173 bool UserSetColorTransferFunction;
174 bool UserSetScalarOpacity;
175};
176
177VTK_ABI_NAMESPACE_END
178#endif
Defines a transfer function for mapping a property to an RGB color value.
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Allocate and hold a VTK object.
Definition vtkNew.h:168
Defines a 1D piecewise function.
Create a scalar bar with labels.
Adaptive volume mapper.
represents the common properties for rendering a volume.
double * GetScale()
Visibility and actor transforms.
void SetDiffuse(double val)
Volume shading properties.
void ResetScalarOpacity()
Give a transfer function back to the representation: discard the one set with SetColorTransferFunctio...
double GetDiffuse()
Volume shading properties.
double GetScalarOpacityUnitDistance()
Transfer functions for color and opacity.
void SetInterpolationType(int val)
Volume shading properties.
void ResetColorTransferFunction()
Give a transfer function back to the representation: discard the one set with SetColorTransferFunctio...
void SetScalarOpacityUnitDistance(double distance)
Transfer functions for color and opacity.
double GetSpecular()
Volume shading properties.
void SetPosition(double x, double y, double z)
Visibility and actor transforms.
vtkColorTransferFunction * GetColorTransferFunction()
Transfer functions for color and opacity.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
bool GetVisibility()
Visibility and actor transforms.
void SetRequestedRenderMode(int mode)
Volume mapper properties.
vtkMTimeType GetMTime() override
The representation stores its properties on the volume mapper, volume and scalar bar it owns rather t...
void SetVisibility(bool val)
Visibility and actor transforms.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses should override this to connect inputs to the internal pipeline as necessary.
void SetScale(double x, double y, double z)
Visibility and actor transforms.
void SetAmbient(double val)
Volume shading properties.
vtkScalarBarActor * GetScalarBarActor()
Scalar bar control.
void SetSpecular(double val)
Volume shading properties.
void SetColorTransferFunction(vtkColorTransferFunction *ctf)
Transfer functions for color and opacity.
void SetBlendMode(int mode)
Volume mapper properties.
void ResetTransferFunctions()
Give a transfer function back to the representation: discard the one set with SetColorTransferFunctio...
double GetSpecularPower()
Volume shading properties.
int GetBlendMode()
Volume mapper properties.
int GetRequestedRenderMode()
Volume mapper properties.
void SetOrientation(double x, double y, double z)
Visibility and actor transforms.
static vtkVolumeRepresentation * New()
bool GetScalarBarVisibility()
Scalar bar control.
double GetAmbient()
Volume shading properties.
bool GetShade()
Volume shading properties.
void SetScalarOpacity(vtkPiecewiseFunction *pf)
Transfer functions for color and opacity.
bool AddToView(vtkView *view) override
Adds the representation to the view.
bool RemoveFromView(vtkView *view) override
Removes the representation to the view.
double * GetPosition()
Visibility and actor transforms.
vtkPiecewiseFunction * GetScalarOpacity()
Transfer functions for color and opacity.
void SetShade(bool val)
Volume shading properties.
void SetSpecularPower(double val)
Volume shading properties.
vtkVolume * GetVolume()
Provide access to the internal volume for advanced usage.
double * GetOrientation()
Visibility and actor transforms.
void SetScalarBarVisibility(bool val)
Scalar bar control.
int GetInterpolationType()
Volume shading properties.
represents a volume (data & properties) in a rendered scene
Definition vtkVolume.h:130
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:318
#define VTK_SIZEHINT(...)