vtkImageVolumeRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkImageVolumeRepresentation.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
35 #ifndef vtkImageVolumeRepresentation_h
36 #define vtkImageVolumeRepresentation_h
37 
38 #include "vtkNew.h" // needed for vtkNew.
39 #include "vtkRemotingViewsModule.h" // needed for exports
40 #include "vtkSmartPointer.h" // needed for vtkSmartPointer
42 
43 #include <string> // for ivar
44 
46 class vtkDataSet;
49 class vtkImageData;
51 class vtkOutlineSource;
52 class vtkPVLODVolume;
55 class vtkPolyDataMapper;
56 class vtkVolumeMapper;
57 class vtkVolumeProperty;
58 
60 {
61 public:
64  void PrintSelf(ostream& os, vtkIndent indent) override;
65 
73  vtkInformation* outInfo) override;
74 
75  //***************************************************************************
76  // Forwarded to vtkVolumeProperty.
77  void SetAmbient(double);
78  void SetDiffuse(double);
79  void SetSpecular(double);
80  void SetSpecularPower(double);
81  void SetShade(bool);
82  void SetSliceFunction(vtkImplicitFunction* slice);
83 
85 
88  void SetIsosurfaceValue(int i, double value);
89  void SetNumberOfIsosurfaces(int number);
91 
92  //***************************************************************************
93  // Forwarded to vtkSmartVolumeMapper/vtkMultiBlockVolumeMapper.
94  void SetRequestedRenderMode(int);
95  void SetBlendMode(int);
96  void SetCropping(int);
97 
99 
102  vtkSetVector3Macro(CroppingOrigin, double);
103  vtkGetVector3Macro(CroppingOrigin, double);
105 
107 
110  vtkSetVector3Macro(CroppingScale, double);
111  vtkGetVector3Macro(CroppingScale, double);
113 
114  //***************************************************************************
115  // For 2D transfer functions
116  void SetUseTransfer2D(bool);
117  void SetUseGradientForTransfer2D(bool);
118  void SelectColorArray2(int, int, int, int, const char* name);
119  void SelectColorArray2Component(int component);
120  void SetTransferFunction2D(vtkPVTransferFunction2D* transfer2d);
121 
122 protected:
124  ~vtkImageVolumeRepresentation() override;
125 
129  int FillInputPortInformation(int port, vtkInformation* info) override;
130 
132 
138  bool AddToView(vtkView* view) override;
139 
145  bool RemoveFromView(vtkView* view) override;
146 
150  virtual void UpdateMapperParameters();
151 
155  virtual vtkPVLODVolume* GetRenderedProp() { return this->Actor; };
156 
159 
161 
162  int WholeExtent[6] = { 0, -1, 0, -1, 0, -1 };
163  double CroppingOrigin[3] = { 0, 0, 0 };
164  double CroppingScale[3] = { 1, 1, 1 };
165 
166  // 2D transfer function support
167  bool UseTransfer2D = false;
168  bool UseGradientForTransfer2D = true;
169  vtkPVTransferFunction2D* TransferFunction2D = nullptr;
170  int ColorArray2FieldAssociation = -1;
171  int ColorArray2Component = -1;
172  std::string ColorArray2Name;
173 
174 private:
176  void operator=(const vtkImageVolumeRepresentation&) = delete;
177 };
178 
179 #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.