ParaView
vtkTexturePainter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkTexturePainter.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 =========================================================================*/
27 #ifndef vtkTexturePainter_h
28 #define vtkTexturePainter_h
29 
30 #include "vtkPVVTKExtensionsRenderingModule.h" // needed for export macro
31 #include "vtkPainter.h"
32 
33 class vtkImageData;
34 class vtkInformationIntegerKey;
35 class vtkInformationObjectBaseKey;
36 class vtkInformationStringKey;
37 class vtkScalarsToColors;
38 class vtkTexture;
39 
40 class VTKPVVTKEXTENSIONSRENDERING_EXPORT vtkTexturePainter : public vtkPainter
41 {
42 public:
43  static vtkTexturePainter* New();
44  vtkTypeMacro(vtkTexturePainter, vtkPainter);
45  void PrintSelf(ostream& os, vtkIndent indent);
46 
51  static vtkInformationIntegerKey* SLICE();
52 
56  static vtkInformationIntegerKey* SLICE_MODE();
57 
67  static vtkInformationIntegerKey* MAP_SCALARS();
68 
74  static vtkInformationObjectBaseKey* LOOKUP_TABLE();
75 
77 
83  static vtkInformationIntegerKey* SCALAR_MODE();
84  vtkSetMacro(ScalarMode, int);
85  vtkGetMacro(ScalarMode, int);
87 
89 
96  static vtkInformationStringKey* SCALAR_ARRAY_NAME();
97  vtkSetStringMacro(ScalarArrayName);
98  vtkGetStringMacro(ScalarArrayName);
100 
102 
106  static vtkInformationIntegerKey* SCALAR_ARRAY_INDEX();
107  vtkSetMacro(ScalarArrayIndex, int);
108  vtkGetMacro(ScalarArrayIndex, int);
110 
112 
117  vtkSetMacro(Slice, int);
118  vtkGetMacro(Slice, int);
120 
122 
126  vtkSetClampMacro(SliceMode, int, YZ_PLANE, XY_PLANE);
127  vtkGetMacro(SliceMode, int);
129 
133  void SetLookupTable(vtkScalarsToColors*);
134 
136 
141  vtkSetMacro(MapScalars, int);
142  vtkGetMacro(MapScalars, int);
144 
146 
150  static vtkInformationIntegerKey* USE_XY_PLANE();
151  vtkSetClampMacro(UseXYPlane, int, 0, 1);
152  vtkBooleanMacro(UseXYPlane, int);
153  vtkGetMacro(UseXYPlane, int);
155 
156  enum
157  {
158  YZ_PLANE = 0,
159  XZ_PLANE = 1,
160  XY_PLANE = 2,
161  };
162 
163  virtual void ReleaseGraphicsResources(vtkWindow*);
164 
165  vtkSetVector6Macro(WholeExtent, int);
166 
167 protected:
170 
175  virtual void ProcessInformation(vtkInformation*);
176 
184  virtual void RenderInternal(
185  vtkRenderer* renderer, vtkActor* actor, unsigned long typeflags, bool forceCompileOnly);
186 
191  int SetupScalars(vtkImageData* input);
192 
193  int Slice;
199  int WholeExtent[6];
201  vtkScalarsToColors* LookupTable;
202 
203  // We compute the coordinates for the quad used to draw the texture. This uses
204  // the input data bounds and the slice properties.
205  float QuadPoints[4][3];
206 
207  // This is used to load the image data to the texture.
208  vtkTexture* Texture;
209 
210  vtkTimeStamp UpdateTime;
211 
212 private:
213  vtkTexturePainter(const vtkTexturePainter&) VTK_DELETE_FUNCTION;
214  void operator=(const vtkTexturePainter&) VTK_DELETE_FUNCTION;
215 };
216 
217 #endif
vtkScalarsToColors * LookupTable
vtkTimeStamp UpdateTime
renders a slice of vtkImageData by loading the slice as a texture and then applying it to a quad...