VTK  9.7.20261108
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#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
45
46VTK_ABI_NAMESPACE_BEGIN
48class vtkDataArray;
49class vtkDataSet;
53class vtkVolume;
55
56class VTKVIEWSSCIVIS_EXPORT VTK_MARSHALAUTO vtkVolumeRepresentation
58{
59public:
62 void PrintSelf(ostream& os, vtkIndent indent) override;
63
71
73
86 void SetScalarOpacityUnitDistance(double distance);
89
91
104
106
111 void SetShade(bool val);
112 bool GetShade();
114
116
124 void ColorByPointArray(const char* arrayName);
125 void ColorByCellArray(const char* arrayName);
128
130
145 void SetColorMap(vtkScalarsToColors* map) override;
146 void SetVisibility(bool val) override;
147 bool GetVisibility() override;
148 bool GetBounds(double bounds[6]) override;
149 const char* GetRenderedArrayName() override;
152 const char* arrayName, int fieldAssoc, double range[2], int component = -1) override;
155
157
174
175protected:
178
180
181 bool AddToView(vtkScivisView* view) override;
182 bool RemoveFromView(vtkScivisView* view) override;
183
184private:
186 void operator=(const vtkVolumeRepresentation&) = delete;
187
193 void CreateDefaultTransferFunctions();
194
199 vtkDataSet* GetInputDataSet();
200
205 vtkDataArray* GetRenderedScalars(int& fieldAssoc);
206
210 bool IsColoringBy(const char* arrayName, int scalarMode);
211
212 vtkNew<vtkSmartVolumeMapper> VolumeMapper;
213 vtkNew<vtkVolume> Volume;
214 vtkNew<vtkVolumeProperty> VolumeProperty;
215 bool DefaultTransferFunctionsCreated;
216 bool UserSetColorTransferFunction;
217 bool UserSetScalarOpacity;
218};
219
220VTK_ABI_NAMESPACE_END
221#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:321
#define VTK_MARSHALAUTO