vtkImageVolumeRepresentation.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
23 #ifndef vtkImageVolumeRepresentation_h
24 #define vtkImageVolumeRepresentation_h
25 
26 #include "vtkNew.h" // needed for vtkNew.
27 #include "vtkRemotingViewsModule.h" // needed for exports
28 #include "vtkSmartPointer.h" // needed for vtkSmartPointer
30 
31 #include <string> // for ivar
32 
34 class vtkDataSet;
37 class vtkImageData;
39 class vtkOutlineSource;
40 class vtkPVLODVolume;
43 class vtkPolyDataMapper;
44 class vtkVolumeMapper;
45 class vtkVolumeProperty;
46 
48 {
49 public:
52  void PrintSelf(ostream& os, vtkIndent indent) override;
53 
61  vtkInformation* outInfo) override;
62 
63  //***************************************************************************
64  // Forwarded to vtkVolumeProperty.
65  void SetAmbient(double);
66  void SetDiffuse(double);
67  void SetSpecular(double);
68  void SetSpecularPower(double);
69  void SetShade(bool);
70  void SetAnisotropy(float);
71  void SetSliceFunction(vtkImplicitFunction* slice);
72 
74 
77  void SetIsosurfaceValue(int i, double value);
78  void SetNumberOfIsosurfaces(int number);
80 
81  //***************************************************************************
82  // Forwarded to vtkSmartVolumeMapper/vtkMultiBlockVolumeMapper.
83  void SetRequestedRenderMode(int);
84  void SetBlendMode(int);
85  void SetCropping(int);
86  void SetGlobalIlluminationReach(float);
87  void SetVolumetricScatteringBlending(float);
88 
90 
93  vtkSetVector3Macro(CroppingOrigin, double);
94  vtkGetVector3Macro(CroppingOrigin, double);
96 
98 
101  vtkSetVector3Macro(CroppingScale, double);
102  vtkGetVector3Macro(CroppingScale, double);
104 
105  //***************************************************************************
106  // For 2D transfer functions
107  void SetUseTransfer2D(bool);
108  void SetUseGradientForTransfer2D(bool);
109  void SelectColorArray2(int, int, int, int, const char* name);
110  void SelectColorArray2Component(int component);
111  void SetTransferFunction2D(vtkPVTransferFunction2D* transfer2d);
112 
113 protected:
115  ~vtkImageVolumeRepresentation() override;
116 
120  int FillInputPortInformation(int port, vtkInformation* info) override;
121 
123 
129  bool AddToView(vtkView* view) override;
130 
136  bool RemoveFromView(vtkView* view) override;
137 
141  virtual void UpdateMapperParameters();
142 
146  virtual vtkPVLODVolume* GetRenderedProp() { return this->Actor; };
147 
150 
152 
153  int WholeExtent[6] = { 0, -1, 0, -1, 0, -1 };
154  double CroppingOrigin[3] = { 0, 0, 0 };
155  double CroppingScale[3] = { 1, 1, 1 };
156 
157  // 2D transfer function support
158  bool UseTransfer2D = false;
159  bool UseGradientForTransfer2D = true;
160  vtkPVTransferFunction2D* TransferFunction2D = nullptr;
161  int ColorArray2FieldAssociation = -1;
162  int ColorArray2Component = -1;
163  std::string ColorArray2Name;
164 
165 private:
167  void operator=(const vtkImageVolumeRepresentation&) = delete;
168 };
169 
170 #endif
virtual vtkPVLODVolume * GetRenderedProp()
Used in ConvertSelection to locate the rendered prop.
#define VTKREMOTINGVIEWS_EXPORT
bool AddToView(vtkView *view) override
Making these methods public.
virtual int ProcessViewRequest(vtkInformationRequestKey *request_type, vtkInformation *inInfo, vtkInformation *outInfo)
vtkAlgorithm::ProcessRequest() equivalent for rendering passes.
virtual int FillInputPortInformation(int port, vtkInformation *info)
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Overridden to invoke vtkCommand::UpdateDataEvent.
Abstract base class for volume representations.
vtkSmartPointer< vtkVolumeMapper > VolumeMapper
an actor that supports multiple levels of detail
bool RemoveFromView(vtkView *view) override
Making these methods public.
Defines a 2D transfer function for mapping to RGBA values for volume rendering.
static vtkDataRepresentation * New()
vtkSmartPointer< vtkPVLODVolume > Actor
vtkNew< vtkPolyDataMapper > OutlineMapper
void PrintSelf(ostream &os, vtkIndent indent) override
representation for showing image datasets as a volume.