VTK  9.7.20260904
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
37
38#ifndef vtkVolumeRepresentation_h
39#define vtkVolumeRepresentation_h
40
41#include "vtkNew.h" // For ivars
43#include "vtkViewsScivisModule.h" // For export macro
44
45VTK_ABI_NAMESPACE_BEGIN
47class vtkDataArray;
48class vtkDataSet;
52class vtkVolume;
54
55class VTKVIEWSSCIVIS_EXPORT vtkVolumeRepresentation : public vtkScivisDataRepresentation
56{
57public:
60 void PrintSelf(ostream& os, vtkIndent indent) override;
61
69
71
84 void SetScalarOpacityUnitDistance(double distance);
87
89
102
104
109 void SetShade(bool val);
110 bool GetShade();
112
114
122 void ColorByPointArray(const char* arrayName);
123 void ColorByCellArray(const char* arrayName);
126
128
143 void SetColorMap(vtkScalarsToColors* map) override;
144 void SetVisibility(bool val) override;
145 bool GetVisibility() override;
146 bool GetBounds(double bounds[6]) override;
147 const char* GetRenderedArrayName() override;
150 const char* arrayName, int fieldAssoc, double range[2], int component = -1) override;
153
155
172
173protected:
176
178
179 bool AddToView(vtkScivisView* view) override;
180 bool RemoveFromView(vtkScivisView* view) override;
181
182private:
184 void operator=(const vtkVolumeRepresentation&) = delete;
185
191 void CreateDefaultTransferFunctions();
192
197 vtkDataSet* GetInputDataSet();
198
203 vtkDataArray* GetRenderedScalars(int& fieldAssoc);
204
208 bool IsColoringBy(const char* arrayName, int scalarMode);
209
210 vtkNew<vtkSmartVolumeMapper> VolumeMapper;
211 vtkNew<vtkVolume> VolumeActor;
212 vtkNew<vtkVolumeProperty> VolumeProperty;
213 bool DefaultTransferFunctionsCreated;
214 bool UserSetColorTransferFunction;
215 bool UserSetScalarOpacity;
216};
217
218VTK_ABI_NAMESPACE_END
219#endif
Defines a transfer function for mapping a property to an RGB color value.
abstract class to specify dataset behavior
Definition vtkDataSet.h:165
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.
Superclass for mapping scalar values to colors.
Adaptive volume mapper.
represents the common properties for rendering a volume.
~vtkVolumeRepresentation() override
const char * GetRenderedArrayName() override
The vtkScivisDataRepresentation contract.
void ResetScalarOpacity()
Give a transfer function back to the representation: discard the one set with SetColorTransferFunctio...
vtkVolumeProperty * GetVolumeProperty()
The objects this representation is built from, for everything the API above does not cover: ambient,...
void ColorByPointArray(const char *arrayName)
Which array is rendered.
double GetScalarOpacityUnitDistance()
Transfer functions for color and opacity.
bool GetBounds(double bounds[6]) override
The vtkScivisDataRepresentation contract.
void ResetColorTransferFunction()
Give a transfer function back to the representation: discard the one set with SetColorTransferFunctio...
void ColorByCellArray(const char *arrayName)
Which array is rendered.
void SetScalarOpacityUnitDistance(double distance)
Transfer functions for color and opacity.
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.
void SetColorMap(vtkScalarsToColors *map) override
The vtkScivisDataRepresentation contract.
bool RemoveFromView(vtkScivisView *view) override
Called when this representation is added to or removed from a view.
vtkMTimeType GetMTime() override
The representation stores its properties on the volume mapper and volume it owns rather than in its o...
int GetRenderedFieldAssociation() override
The vtkScivisDataRepresentation contract.
void SetVisibility(bool val) override
The vtkScivisDataRepresentation contract.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when a request asks the algorithm to do its work.
vtkSmartVolumeMapper * GetVolumeMapper()
The objects this representation is built from, for everything the API above does not cover: ambient,...
void SetColorTransferFunction(vtkColorTransferFunction *ctf)
Transfer functions for color and opacity.
bool GetDataRange(const char *arrayName, int fieldAssoc, double range[2], int component=-1) override
The vtkScivisDataRepresentation contract.
void ResetTransferFunctions()
Give a transfer function back to the representation: discard the one set with SetColorTransferFunctio...
bool GetVisibility() override
The vtkScivisDataRepresentation contract.
void ResetColorArray()
Which array is rendered.
static vtkVolumeRepresentation * New()
bool GetShade()
Whether the volume is lit.
void SetScalarOpacity(vtkPiecewiseFunction *pf)
Transfer functions for color and opacity.
vtkPiecewiseFunction * GetScalarOpacity()
Transfer functions for color and opacity.
void SetShade(bool val)
Whether the volume is lit.
vtkVolume * GetVolume()
The objects this representation is built from, for everything the API above does not cover: ambient,...
bool AddToView(vtkScivisView *view) override
Called when this representation is added to or removed from a view.
vtkScalarsToColors * GetColorMap() override
The vtkScivisDataRepresentation contract.
represents a volume (data & properties) in a rendered scene
Definition vtkVolume.h:130
#define vtkDataArray
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:318