ParaView
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 "vtkPVClientServerCoreRenderingModule.h" //needed for exports
35 #include "vtkStructuredData.h" // needed for VTK_*_PLANE
36 
37 class vtkImageData;
38 class vtkRenderer;
39 
40 #ifdef VTKGL2
41 class vtkOpenGLTexture;
42 class vtkActor;
43 #endif
44 class vtkPainter;
45 
46 class VTKPVCLIENTSERVERCORERENDERING_EXPORT vtkPVImageSliceMapper : public vtkMapper
47 {
48 public:
49  static vtkPVImageSliceMapper* New();
50  vtkTypeMacro(vtkPVImageSliceMapper, vtkMapper);
51  void PrintSelf(ostream& os, vtkIndent indent);
52 
56  virtual void Render(vtkRenderer* ren, vtkActor* act);
57 
58  virtual void ReleaseGraphicsResources(vtkWindow*);
59 
61 
64  void SetPainter(vtkPainter*);
65  vtkGetObjectMacro(Painter, vtkPainter);
67 
69 
72  void SetInputData(vtkImageData* in);
73  virtual vtkImageData* GetInput();
75 
77 
80  vtkSetMacro(Slice, int);
81  vtkGetMacro(Slice, int);
83 
84  enum
85  {
86  XY_PLANE = VTK_XY_PLANE,
87  YZ_PLANE = VTK_YZ_PLANE,
88  XZ_PLANE = VTK_XZ_PLANE,
89  };
90 
91  vtkSetClampMacro(SliceMode, int, XY_PLANE, XZ_PLANE);
92  vtkGetMacro(SliceMode, int);
93  void SetSliceModeToYZPlane() { this->SetSliceMode(YZ_PLANE); }
94  void SetSliceModeToXZPlane() { this->SetSliceMode(XZ_PLANE); }
95  void SetSliceModeToXYPlane() { this->SetSliceMode(XY_PLANE); }
96 
98 
102  vtkSetClampMacro(UseXYPlane, int, 0, 1);
103  vtkBooleanMacro(UseXYPlane, int);
104  vtkGetMacro(UseXYPlane, int);
106 
110  virtual void Update(int port);
111  virtual void Update() { this->Superclass::Update(); }
112  virtual int Update(int port, vtkInformationVector* requests)
113  {
114  return this->Superclass::Update(port, requests);
115  }
116  virtual int Update(vtkInformation* requests) { return this->Superclass::Update(requests); }
117 
119 
122  vtkSetMacro(Piece, int);
123  vtkGetMacro(Piece, int);
124  vtkSetMacro(NumberOfPieces, int);
125  vtkGetMacro(NumberOfPieces, int);
126  vtkSetMacro(NumberOfSubPieces, int);
127  vtkGetMacro(NumberOfSubPieces, int);
129 
131 
134  vtkSetMacro(GhostLevel, int);
135  vtkGetMacro(GhostLevel, int);
137 
139 
143  virtual double* GetBounds();
144  virtual void GetBounds(double bounds[6]) { this->Superclass::GetBounds(bounds); };
146 
150  virtual void ShallowCopy(vtkAbstractMapper* m);
151 
152 protected:
155 
156  // Tell the executive that we accept vtkImageData.
157  virtual int FillInputPortInformation(int, vtkInformation*);
158 
162  virtual void RenderPiece(vtkRenderer* ren, vtkActor* act);
163 
164 #ifdef VTKGL2
165  vtkOpenGLTexture* Texture;
166  int SetupScalars(vtkImageData*);
167  void RenderInternal(vtkRenderer* ren, vtkActor* act);
168  vtkTimeStamp UpdateTime;
169  vtkActor* PolyDataActor;
170 #else
171 
175  void UpdatePainterInformation();
176 
177  vtkInformation* PainterInformation;
179 
180  class vtkObserver;
181  vtkObserver* Observer;
182 #endif
183 
184  vtkPainter* Painter;
185 
186  int Piece;
190 
192  int Slice;
194 
195 private:
196  vtkPVImageSliceMapper(const vtkPVImageSliceMapper&) VTK_DELETE_FUNCTION;
197  void operator=(const vtkPVImageSliceMapper&) VTK_DELETE_FUNCTION;
198 };
199 
200 #endif
vtkTimeStamp PainterInformationUpdateTime
virtual int Update(int port, vtkInformationVector *requests)
vtkInformation * PainterInformation
virtual void GetBounds(double bounds[6])
Return bounding box (array of six doubles) of data expressed as (xmin,xmax, ymin,ymax, zmin,zmax).
virtual int Update(vtkInformation *requests)
Mapper for vtkImageData that renders the image using a texture applied to a quad. ...