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 
44 class VTKREMOTINGVIEWS_EXPORT vtkPVImageSliceMapper : public vtkMapper
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 
89  vtkSetClampMacro(SliceMode, int, XY_PLANE, XZ_PLANE);
90  vtkGetMacro(SliceMode, int);
91  void SetSliceModeToYZPlane() { this->SetSliceMode(YZ_PLANE); }
92  void SetSliceModeToXZPlane() { this->SetSliceMode(XZ_PLANE); }
93  void SetSliceModeToXYPlane() { this->SetSliceMode(XY_PLANE); }
94 
96 
100  vtkSetClampMacro(UseXYPlane, int, 0, 1);
101  vtkBooleanMacro(UseXYPlane, int);
102  vtkGetMacro(UseXYPlane, int);
104 
108  void Update(int port) override;
109  void Update() override { this->Superclass::Update(); }
110  int Update(int port, vtkInformationVector* requests) override
111  {
112  return this->Superclass::Update(port, requests);
113  }
114  int Update(vtkInformation* requests) override { return this->Superclass::Update(requests); }
115 
117 
120  vtkSetMacro(Piece, int);
121  vtkGetMacro(Piece, int);
122  vtkSetMacro(NumberOfPieces, int);
123  vtkGetMacro(NumberOfPieces, int);
124  vtkSetMacro(NumberOfSubPieces, int);
125  vtkGetMacro(NumberOfSubPieces, int);
127 
129 
132  vtkSetMacro(GhostLevel, int);
133  vtkGetMacro(GhostLevel, int);
135 
137 
141  double* GetBounds() override;
142  void GetBounds(double bounds[6]) override { this->Superclass::GetBounds(bounds); };
144 
148  void ShallowCopy(vtkAbstractMapper* m) override;
149 
150 protected:
152  ~vtkPVImageSliceMapper() override;
153 
154  // Tell the executive that we accept vtkImageData.
155  int FillInputPortInformation(int, vtkInformation*) override;
156 
160  virtual void RenderPiece(vtkRenderer* ren, vtkActor* act);
161 
163  int SetupScalars(vtkImageData*);
164  void RenderInternal(vtkRenderer* ren, vtkActor* act);
167 
169 
170  int Piece;
174 
176  int Slice;
178 
179 private:
181  void operator=(const vtkPVImageSliceMapper&) = delete;
182 };
183 
184 #endif
void ShallowCopy(vtkAbstractMapper *m)
virtual void ReleaseGraphicsResources(vtkWindow *)
#define VTK_XZ_PLANE
int Update(vtkInformation *requests) override
void GetBounds(double bounds[6]) override
Return bounding box (array of six doubles) of data expressed as (xmin,xmax, ymin,ymax,...
#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()
virtual int FillInputPortInformation(int port, vtkInformation *info)
#define VTK_YZ_PLANE
virtual double * GetBounds()
static vtkAlgorithm * New()
vtkDataSet * GetInput()
virtual void Render(vtkRenderer *ren, vtkActor *a)=0
void operator=(const vtkObjectBase &)
int Update(int port, vtkInformationVector *requests) override