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 "vtkRenderingOpenGL2Module.h" // For export macro
29 #include "vtkImageSliceMapper.h"
30 
31 class vtkRenderWindow;
33 class vtkActor;
34 
36  public vtkImageSliceMapper
37 {
38 public:
41  virtual void PrintSelf(ostream& os, vtkIndent indent);
42 
44  void Render(vtkRenderer *ren, vtkImageSlice *prop);
45 
50 
51 protected:
54 
56 
59  void RecursiveRenderTexturedPolygon(
60  vtkRenderer *ren, vtkImageProperty *property,
61  vtkImageData *image, int extent[6], bool recursive);
63 
65 
67  void RenderTexturedPolygon(
68  vtkRenderer *ren, vtkImageProperty *property,
69  vtkImageData *image, int extent[6], bool recursive);
71 
74  void RenderPolygon(vtkActor *actor, vtkPoints *points, const int extent[6], vtkRenderer *ren);
75 
77 
80  void RenderBackground(
81  vtkActor *actor, vtkPoints *points, const int extent[6], vtkRenderer *ren);
83 
85  void BindFragmentProgram(vtkRenderer *ren, vtkImageProperty *property);
86 
88  vtkStdString BuildFragmentProgram(vtkImageProperty *property);
89 
91 
96  void ComputeTextureSize(
97  const int extent[6], int &xdim, int &ydim,
98  int imageSize[2], int textureSize[2]);
100 
103  bool TextureSizeOK(const int size[2]);
104 
106  void CheckOpenGLCapabilities(vtkOpenGLRenderWindow *renWin);
107 
108  long FragmentShaderIndex; // OpenGL ID for fragment shader
109  vtkRenderWindow *RenderWindow; // RenderWindow used for previous render
110  int TextureSize[2];
111  int TextureBytesPerPixel;
112  int LastOrientation;
113  int LastSliceNumber;
114 
118 
119  vtkTimeStamp LoadTime;
120  int LoadCount;
121 
122  bool UseClampToEdge;
123  bool UseFragmentProgram;
124 
125 private:
126  vtkOpenGLImageSliceMapper(const vtkOpenGLImageSliceMapper&); // Not implemented.
127  void operator=(const vtkOpenGLImageSliceMapper&); // Not implemented.
128 };
129 
130 #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()
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:50
#define VTKRENDERINGOPENGL2_EXPORT
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
vtkWeakPointer< vtkRenderWindow > RenderWindow
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