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 
73  //***************************************************************************
74  // Forwarded to Actor.
75  virtual void SetCoordinateSystem(int);
76 
78 
81  void SetIsosurfaceValue(int i, double value);
82  void SetNumberOfIsosurfaces(int number);
84 
85  //***************************************************************************
86  // Forwarded to vtkSmartVolumeMapper/vtkMultiBlockVolumeMapper.
87  void SetRequestedRenderMode(int);
88  void SetBlendMode(int);
89  void SetCropping(int);
90  void SetGlobalIlluminationReach(float);
91  void SetVolumetricScatteringBlending(float);
92 
94 
97  vtkSetVector3Macro(CroppingOrigin, double);
98  vtkGetVector3Macro(CroppingOrigin, double);
100 
102 
105  vtkSetVector3Macro(CroppingScale, double);
106  vtkGetVector3Macro(CroppingScale, double);
108 
109  //***************************************************************************
110  // For 2D transfer functions
111  void SetUseTransfer2D(bool);
112  void SetUseGradientForTransfer2D(bool);
113  void SelectColorArray2(int, int, int, int, const char* name);
114  void SelectColorArray2Component(int component);
115  void SetTransferFunction2D(vtkPVTransferFunction2D* transfer2d);
116 
117 protected:
119  ~vtkImageVolumeRepresentation() override;
120 
124  int FillInputPortInformation(int port, vtkInformation* info) override;
125 
127 
133  bool AddToView(vtkView* view) override;
134 
140  bool RemoveFromView(vtkView* view) override;
141 
145  virtual void UpdateMapperParameters();
146 
150  virtual vtkPVLODVolume* GetRenderedProp() { return this->Actor; };
151 
154 
156 
157  int WholeExtent[6] = { 0, -1, 0, -1, 0, -1 };
158  double CroppingOrigin[3] = { 0, 0, 0 };
159  double CroppingScale[3] = { 1, 1, 1 };
160 
161  // 2D transfer function support
162  bool UseTransfer2D = false;
163  bool UseGradientForTransfer2D = true;
164  vtkPVTransferFunction2D* TransferFunction2D = nullptr;
165  int ColorArray2FieldAssociation = -1;
166  int ColorArray2Component = -1;
167  std::string ColorArray2Name;
168 
169 private:
171  void operator=(const vtkImageVolumeRepresentation&) = delete;
172 };
173 
174 #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.