vtkPVImageSliceMapper.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
3 // SPDX-License-Identifier: BSD-3-Clause
19 #ifndef vtkPVImageSliceMapper_h
20 #define vtkPVImageSliceMapper_h
21 
22 #include "vtkMapper.h"
23 #include "vtkRemotingViewsModule.h" // needed for exports
24 #include "vtkStructuredData.h" // needed for VTK_*_PLANE
25 
26 class vtkImageData;
27 class vtkRenderer;
28 
29 class vtkOpenGLTexture;
30 class vtkActor;
31 class vtkPainter;
32 
34 {
35 public:
36  static vtkPVImageSliceMapper* New();
38  void PrintSelf(ostream& os, vtkIndent indent) override;
39 
43  void Render(vtkRenderer* ren, vtkActor* act) override;
44 
45  void ReleaseGraphicsResources(vtkWindow*) override;
46 
48 
51  void SetPainter(vtkPainter*);
52  vtkGetObjectMacro(Painter, vtkPainter);
54 
56 
59  void SetInputData(vtkImageData* in);
60  virtual vtkImageData* GetInput();
62 
64 
67  vtkSetMacro(Slice, int);
68  vtkGetMacro(Slice, int);
70 
71  enum
72  {
73  XY_PLANE = VTK_XY_PLANE,
74  YZ_PLANE = VTK_YZ_PLANE,
75  XZ_PLANE = VTK_XZ_PLANE,
76  };
77 
79 
87  vtkSetClampMacro(SliceMode, int, XY_PLANE, XZ_PLANE);
88  vtkGetMacro(SliceMode, int);
89  void SetSliceModeToYZPlane() { this->SetSliceMode(YZ_PLANE); }
90  void SetSliceModeToXZPlane() { this->SetSliceMode(XZ_PLANE); }
91  void SetSliceModeToXYPlane() { this->SetSliceMode(XY_PLANE); }
93 
95 
99  vtkSetClampMacro(UseXYPlane, int, 0, 1);
100  vtkBooleanMacro(UseXYPlane, int);
101  vtkGetMacro(UseXYPlane, int);
103 
107  void Update(int port) override;
108  void Update() override { this->Superclass::Update(); }
109  int Update(int port, vtkInformationVector* requests) override
110  {
111  return this->Superclass::Update(port, requests);
112  }
113  int Update(vtkInformation* requests) override { return this->Superclass::Update(requests); }
114 
116 
119  vtkSetMacro(Piece, int);
120  vtkGetMacro(Piece, int);
121  vtkSetMacro(NumberOfPieces, int);
122  vtkGetMacro(NumberOfPieces, int);
123  vtkSetMacro(NumberOfSubPieces, int);
124  vtkGetMacro(NumberOfSubPieces, int);
126 
128 
131  vtkSetMacro(GhostLevel, int);
132  vtkGetMacro(GhostLevel, int);
134 
136 
140  double* GetBounds() override;
141  void GetBounds(double bounds[6]) override { this->Superclass::GetBounds(bounds); };
143 
147  void ShallowCopy(vtkAbstractMapper* m) override;
148 
149 protected:
151  ~vtkPVImageSliceMapper() override;
152 
153  // Tell the executive that we accept vtkImageData.
154  int FillInputPortInformation(int, vtkInformation*) override;
155 
159  virtual void RenderPiece(vtkRenderer* ren, vtkActor* act);
160 
162  int SetupScalars(vtkImageData*);
163  void RenderInternal(vtkRenderer* ren, vtkActor* act);
166 
168 
169  int Piece;
173 
175  int Slice;
177 
178 private:
180  void operator=(const vtkPVImageSliceMapper&) = delete;
181 };
182 
183 #endif
void ShallowCopy(vtkAbstractMapper *m)
virtual void ReleaseGraphicsResources(vtkWindow *)
#define VTKREMOTINGVIEWS_EXPORT
#define VTK_XZ_PLANE
int Update(vtkInformation *requests) override
void SetSliceModeToYZPlane()
Set/Get the current slice mode: XY, XZ or YZ plane.
void GetBounds(double bounds[6]) override
Return bounding box (array of six doubles) of data expressed as (xmin,xmax, ymin,ymax, zmin,zmax).
#define VTK_XY_PLANE
vtkOpenGLTexture * Texture
void PrintSelf(ostream &os, vtkIndent indent)
Mapper for vtkImageData that renders the image using a texture applied to a quad. ...
virtual double * GetBounds()=0
virtual void Update()
void SetSliceModeToXYPlane()
Set/Get the current slice mode: XY, XZ or YZ plane.
virtual int FillInputPortInformation(int port, vtkInformation *info)
#define VTK_YZ_PLANE
virtual double * GetBounds()
static vtkAlgorithm * New()
port
vtkDataSet * GetInput()
void SetSliceModeToXZPlane()
Set/Get the current slice mode: XY, XZ or YZ plane.
virtual void Render(vtkRenderer *ren, vtkActor *a)=0
void operator=(const vtkObjectBase &)
int Update(int port, vtkInformationVector *requests) override