VTK
vtkOpenGLImageSliceMapper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkOpenGLImageSliceMapper.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 =========================================================================*/
25 #ifndef vtkOpenGLImageSliceMapper_h
26 #define vtkOpenGLImageSliceMapper_h
27 
28 #include "vtkRenderingOpenGLModule.h" // For export macro
29 #include "vtkImageSliceMapper.h"
30 
31 class vtkWindow;
32 class vtkRenderer;
33 class vtkRenderWindow;
35 class vtkImageSlice;
36 class vtkImageProperty;
37 class vtkImageData;
38 
39 class VTKRENDERINGOPENGL_EXPORT vtkOpenGLImageSliceMapper :
40  public vtkImageSliceMapper
41 {
42 public:
45  virtual void PrintSelf(ostream& os, vtkIndent indent);
46 
48  void Render(vtkRenderer *ren, vtkImageSlice *prop);
49 
54 
55 protected:
58 
60 
61  void RenderColorAndLighting(
62  double red, double green, double blue,
63  double alpha, double ambient, double diffuse);
65 
67 
70  void RecursiveRenderTexturedPolygon(
71  vtkRenderer *ren, vtkImageProperty *property,
72  vtkImageData *image, int extent[6], bool recursive);
74 
76 
78  void RenderTexturedPolygon(
79  vtkRenderer *ren, vtkImageProperty *property,
80  vtkImageData *image, int extent[6], bool recursive);
82 
85  void RenderPolygon(vtkPoints *points, const int extent[6], bool textured);
86 
88 
91  void RenderBackground(
92  vtkPoints *points, const int extent[6], bool textured);
94 
96  void BindFragmentProgram(vtkRenderer *ren, vtkImageProperty *property);
97 
99  vtkStdString BuildFragmentProgram(vtkImageProperty *property);
100 
102 
107  void ComputeTextureSize(
108  const int extent[6], int &xdim, int &ydim,
109  int imageSize[2], int textureSize[2]);
111 
114  bool TextureSizeOK(const int size[2]);
115 
117  void CheckOpenGLCapabilities(vtkOpenGLRenderWindow *renWin);
118 
119  long TextureIndex; // OpenGL ID for texture or display list
120  long BackgroundTextureIndex; // OpenGL ID for texture or display list
121  long FragmentShaderIndex; // OpenGL ID for fragment shader
122  vtkRenderWindow *RenderWindow; // RenderWindow used for previous render
123  int TextureSize[2];
127 
130 
134 
135 private:
136  vtkOpenGLImageSliceMapper(const vtkOpenGLImageSliceMapper&); // Not implemented.
137  void operator=(const vtkOpenGLImageSliceMapper&); // Not implemented.
138 };
139 
140 #endif
void PrintSelf(ostream &os, vtkIndent indent)
OpenGL rendering window.
virtual void Render(vtkRenderer *renderer, vtkImageSlice *prop)
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:46
static vtkImageSliceMapper * New()
record modification and/or execution time
Definition: vtkTimeStamp.h:34
image display properties
abstract specification for renderers
Definition: vtkRenderer.h:62
virtual void ComputeTextureSize(const int extent[6], int &xdim, int &ydim, int imageSize[2], int textureSize[2])
OpenGL mapper for image slice display.
virtual void ReleaseGraphicsResources(vtkWindow *)
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
a simple class to control print indentation
Definition: vtkIndent.h:38
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
create a window for renderers to draw into
represents an image in a 3D scene
Definition: vtkImageSlice.h:51
map a slice of a vtkImageData to the screen
represent and manipulate 3D points
Definition: vtkPoints.h:38