vtkPVImageSliceMapper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPVImageSliceMapper.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm 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 =========================================================================*/
30 #ifndef vtkPVImageSliceMapper_h
31 #define vtkPVImageSliceMapper_h
32 
33 #include "vtkMapper.h"
34 #include "vtkRemotingViewsModule.h" // needed for exports
35 #include "vtkStructuredData.h" // needed for VTK_*_PLANE
36 
37 class vtkImageData;
38 class vtkRenderer;
39 
40 class vtkOpenGLTexture;
41 class vtkActor;
42 class vtkPainter;
43 
45 {
46 public:
47  static vtkPVImageSliceMapper* New();
49  void PrintSelf(ostream& os, vtkIndent indent) override;
50 
54  void Render(vtkRenderer* ren, vtkActor* act) override;
55 
56  void ReleaseGraphicsResources(vtkWindow*) override;
57 
59 
62  void SetPainter(vtkPainter*);
63  vtkGetObjectMacro(Painter, vtkPainter);
65 
67 
70  void SetInputData(vtkImageData* in);
71  virtual vtkImageData* GetInput();
73 
75 
78  vtkSetMacro(Slice, int);
79  vtkGetMacro(Slice, 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 
98  vtkSetClampMacro(SliceMode, int, XY_PLANE, XZ_PLANE);
99  vtkGetMacro(SliceMode, int);
100  void SetSliceModeToYZPlane() { this->SetSliceMode(YZ_PLANE); }
101  void SetSliceModeToXZPlane() { this->SetSliceMode(XZ_PLANE); }
102  void SetSliceModeToXYPlane() { this->SetSliceMode(XY_PLANE); }
104 
106 
110  vtkSetClampMacro(UseXYPlane, int, 0, 1);
111  vtkBooleanMacro(UseXYPlane, int);
112  vtkGetMacro(UseXYPlane, int);
114 
118  void Update(int port) override;
119  void Update() override { this->Superclass::Update(); }
120  int Update(int port, vtkInformationVector* requests) override
121  {
122  return this->Superclass::Update(port, requests);
123  }
124  int Update(vtkInformation* requests) override { return this->Superclass::Update(requests); }
125 
127 
130  vtkSetMacro(Piece, int);
131  vtkGetMacro(Piece, int);
132  vtkSetMacro(NumberOfPieces, int);
133  vtkGetMacro(NumberOfPieces, int);
134  vtkSetMacro(NumberOfSubPieces, int);
135  vtkGetMacro(NumberOfSubPieces, int);
137 
139 
142  vtkSetMacro(GhostLevel, int);
143  vtkGetMacro(GhostLevel, int);
145 
147 
151  double* GetBounds() override;
152  void GetBounds(double bounds[6]) override { this->Superclass::GetBounds(bounds); };
154 
158  void ShallowCopy(vtkAbstractMapper* m) override;
159 
160 protected:
162  ~vtkPVImageSliceMapper() override;
163 
164  // Tell the executive that we accept vtkImageData.
165  int FillInputPortInformation(int, vtkInformation*) override;
166 
170  virtual void RenderPiece(vtkRenderer* ren, vtkActor* act);
171 
173  int SetupScalars(vtkImageData*);
174  void RenderInternal(vtkRenderer* ren, vtkActor* act);
177 
179 
180  int Piece;
184 
186  int Slice;
188 
189 private:
191  void operator=(const vtkPVImageSliceMapper&) = delete;
192 };
193 
194 #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