vtkImageSliceRepresentation.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
13 #ifndef vtkImageSliceRepresentation_h
14 #define vtkImageSliceRepresentation_h
15 
16 #include "vtkNew.h" // for vtkNew.
18 #include "vtkRemotingViewsModule.h" //needed for exports
19 #include "vtkStructuredData.h" // for VTK_*_PLANE
20 
21 class vtkImageData;
23 class vtkPVLODActor;
24 class vtkScalarsToColors;
25 
26 class VTKREMOTINGVIEWS_EXPORT vtkImageSliceRepresentation : public vtkPVDataRepresentation
27 {
28 public:
31  void PrintSelf(ostream& os, vtkIndent indent) override;
32 
34 
39  int idx, int port, int connection, int fieldAssociation, const char* name) override;
41  int idx, int port, int connection, int fieldAssociation, int fieldAttributeType) override
42  {
44  idx, port, connection, fieldAssociation, fieldAttributeType);
45  }
46  void SetInputArrayToProcess(int idx, vtkInformation* info) override
47  {
49  }
50  void SetInputArrayToProcess(int idx, int port, int connection, const char* fieldAssociation,
51  const char* attributeTypeorName) override
52  {
54  idx, port, connection, fieldAssociation, attributeTypeorName);
55  }
57 
65  vtkInformation* outInfo) override;
66 
72  void SetVisibility(bool val) override;
73 
75 
78  virtual void SetSlice(unsigned int);
79  vtkGetMacro(Slice, unsigned int);
81 
82  enum
83  {
84  XY_PLANE = VTK_XY_PLANE,
85  YZ_PLANE = VTK_YZ_PLANE,
86  XZ_PLANE = VTK_XZ_PLANE
87  };
88 
90 
93  virtual void SetSliceMode(int);
94  vtkGetMacro(SliceMode, int);
96 
97  //---------------------------------------------------------------------------
98  // Forwarded to Actor.
99  void SetOrientation(double, double, double);
100  void SetOrigin(double, double, double);
101  void SetPickable(int val);
102  void SetPosition(double, double, double);
103  void SetScale(double, double, double);
104 
105  //---------------------------------------------------------------------------
106  // Forwarded to vtkProperty.
107  void SetOpacity(double val);
108 
109  //---------------------------------------------------------------------------
110  // Forwarded to vtkPVImageSliceMapper.
111  void SetLookupTable(vtkScalarsToColors* val);
112  void SetMapScalars(int val);
113  void SetUseXYPlane(int val);
114 
118  vtkPVLODActor* GetActor() { return this->Actor; }
119 
120 protected:
122  ~vtkImageSliceRepresentation() override;
123 
127  void UpdateSliceData(vtkInformationVector**);
128 
132  int FillInputPortInformation(int port, vtkInformation* info) override;
133 
145 
151  bool AddToView(vtkView* view) override;
152 
158  bool RemoveFromView(vtkView* view) override;
159 
161  unsigned int Slice;
162 
166 
167  // meta-data about the input image to pass on to render view for hints
168  // when redistributing data.
169  double WholeBounds[6];
170 
171 private:
173  void operator=(const vtkImageSliceRepresentation&) = delete;
174 };
175 
176 #endif
vtkDataRepresentation::New
static vtkDataRepresentation * New()
vtkPVDataRepresentation.h
vtkInformationVector
vtkPVDataRepresentation::AddToView
bool AddToView(vtkView *view) override
Making these methods public.
vtkPVDataRepresentation::SetVisibility
virtual void SetVisibility(bool val)
Get/Set the visibility for this representation.
Definition: vtkPVDataRepresentation.h:89
vtkPVDataRepresentation::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Overridden to invoke vtkCommand::UpdateDataEvent.
vtkStructuredData.h
port
port
vtkImageSliceRepresentation::SliceMapper
vtkPVImageSliceMapper * SliceMapper
Definition: vtkImageSliceRepresentation.h:163
vtkPVDataRepresentation::RemoveFromView
bool RemoveFromView(vtkView *view) override
Making these methods public.
vtkImageSliceRepresentation::SetInputArrayToProcess
void SetInputArrayToProcess(int idx, vtkInformation *info) override
Set the input data arrays that this algorithm will process.
Definition: vtkImageSliceRepresentation.h:46
vtkPassInputTypeAlgorithm::FillInputPortInformation
virtual int FillInputPortInformation(int port, vtkInformation *info)
vtkView
vtkImageData
vtkIndent
vtkPVDataRepresentation::ProcessViewRequest
virtual int ProcessViewRequest(vtkInformationRequestKey *request_type, vtkInformation *inInfo, vtkInformation *outInfo)
vtkAlgorithm::ProcessRequest() equivalent for rendering passes.
vtkImageSliceRepresentation::SliceData
vtkNew< vtkImageData > SliceData
Definition: vtkImageSliceRepresentation.h:165
VTK_XY_PLANE
#define VTK_XY_PLANE
vtkInformationRequestKey
vtkNew< vtkImageData >
vtkPVImageSliceMapper
Mapper for vtkImageData that renders the image using a texture applied to a quad.
Definition: vtkPVImageSliceMapper.h:33
vtkImageSliceRepresentation::SetInputArrayToProcess
void SetInputArrayToProcess(int idx, int port, int connection, const char *fieldAssociation, const char *attributeTypeorName) override
Set the input data arrays that this algorithm will process.
Definition: vtkImageSliceRepresentation.h:50
vtkScalarsToColors
VTK_YZ_PLANE
#define VTK_YZ_PLANE
vtkInformation
info
info
vtkImageSliceRepresentation
representation for showing slices from a vtkImageData.
Definition: vtkImageSliceRepresentation.h:26
vtkNew.h
vtkImageSliceRepresentation::SetInputArrayToProcess
void SetInputArrayToProcess(int idx, int port, int connection, int fieldAssociation, int fieldAttributeType) override
Set the input data arrays that this algorithm will process.
Definition: vtkImageSliceRepresentation.h:40
vtkPVDataRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
vtkImageSliceRepresentation::GetActor
vtkPVLODActor * GetActor()
Provides access to the actor used by this representation.
Definition: vtkImageSliceRepresentation.h:118
VTK_XZ_PLANE
#define VTK_XZ_PLANE
vtkImageSliceRepresentation::SliceMode
int SliceMode
Definition: vtkImageSliceRepresentation.h:160
vtkPVLODActor
an actor that supports multiple levels of detail
Definition: vtkPVLODActor.h:25
vtkPVDataRepresentation
Definition: vtkPVDataRepresentation.h:23
vtkAlgorithm::SetInputArrayToProcess
virtual void SetInputArrayToProcess(int idx, int port, int connection, int fieldAssociation, const char *name)
vtkImageSliceRepresentation::Slice
unsigned int Slice
Definition: vtkImageSliceRepresentation.h:161
vtkImageSliceRepresentation::Actor
vtkPVLODActor * Actor
Definition: vtkImageSliceRepresentation.h:164