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 =========================================================================*/
26 #ifndef vtkOpenGLImageSliceMapper_h
27 #define vtkOpenGLImageSliceMapper_h
28 
29 #include "vtkRenderingOpenGLModule.h" // For export macro
30 #include "vtkImageSliceMapper.h"
31 
32 class vtkWindow;
33 class vtkRenderer;
34 class vtkRenderWindow;
36 class vtkImageSlice;
37 class vtkImageProperty;
38 class vtkImageData;
39 
40 class VTKRENDERINGOPENGL_EXPORT vtkOpenGLImageSliceMapper :
41  public vtkImageSliceMapper
42 {
43 public:
46  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
47 
51  void Render(vtkRenderer *ren, vtkImageSlice *prop);
52 
59 
60 protected:
63 
67  void RenderColorAndLighting(
68  double red, double green, double blue,
69  double alpha, double ambient, double diffuse);
70 
76  void RecursiveRenderTexturedPolygon(
77  vtkRenderer *ren, vtkImageProperty *property,
78  vtkImageData *image, int extent[6], bool recursive);
79 
84  void RenderTexturedPolygon(
85  vtkRenderer *ren, vtkImageProperty *property,
86  vtkImageData *image, int extent[6], bool recursive);
87 
92  void RenderPolygon(vtkPoints *points, const int extent[6], bool textured);
93 
98  void RenderBackground(
99  vtkPoints *points, const int extent[6], bool textured);
100 
104  void BindFragmentProgram(vtkRenderer *ren, vtkImageProperty *property);
105 
109  vtkStdString BuildFragmentProgram(vtkImageProperty *property);
110 
118  void ComputeTextureSize(
119  const int extent[6], int &xdim, int &ydim,
120  int imageSize[2], int textureSize[2]);
121 
126  bool TextureSizeOK(const int size[2]);
127 
131  void CheckOpenGLCapabilities(vtkOpenGLRenderWindow *renWin);
132 
133  long TextureIndex; // OpenGL ID for texture or display list
134  long BackgroundTextureIndex; // OpenGL ID for texture or display list
135  long FragmentShaderIndex; // OpenGL ID for fragment shader
136  vtkRenderWindow *RenderWindow; // RenderWindow used for previous render
137  int TextureSize[2];
141 
144 
148 
149 private:
150  vtkOpenGLImageSliceMapper(const vtkOpenGLImageSliceMapper&) VTK_DELETE_FUNCTION;
151  void operator=(const vtkOpenGLImageSliceMapper&) VTK_DELETE_FUNCTION;
152 };
153 
154 #endif
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
OpenGL rendering window.
virtual void Render(vtkRenderer *renderer, vtkImageSlice *prop)
This should only be called by the renderer.
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:47
static vtkImageSliceMapper * New()
record modification and/or execution time
Definition: vtkTimeStamp.h:35
image display properties
abstract specification for renderers
Definition: vtkRenderer.h:63
virtual void ComputeTextureSize(const int extent[6], int &xdim, int &ydim, int imageSize[2], int textureSize[2])
Given an extent that describes a slice (it must have unit thickness in one of the three directions)...
OpenGL mapper for image slice display.
virtual void ReleaseGraphicsResources(vtkWindow *)
Release any graphics resources that are being consumed by this mapper.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
a simple class to control print indentation
Definition: vtkIndent.h:39
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
create a window for renderers to draw into
represents an image in a 3D scene
Definition: vtkImageSlice.h:52
map a slice of a vtkImageData to the screen
represent and manipulate 3D points
Definition: vtkPoints.h:39