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 "vtkRenderingOpenGL2Module.h" // For export macro
30 #include "vtkImageSliceMapper.h"
31 
32 class vtkRenderWindow;
34 class vtkActor;
35 
36 class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLImageSliceMapper :
37  public vtkImageSliceMapper
38 {
39 public:
42  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
43 
47  void Render(vtkRenderer *ren, vtkImageSlice *prop);
48 
55 
56 protected:
59 
66  vtkRenderer *ren, vtkImageProperty *property,
67  vtkImageData *image, int extent[6], bool recursive);
68 
74  vtkRenderer *ren, vtkImageProperty *property,
75  vtkImageData *image, int extent[6], bool recursive);
76 
81  void RenderPolygon(vtkActor *actor, vtkPoints *points, const int extent[6], vtkRenderer *ren);
82 
88  vtkActor *actor, vtkPoints *points, const int extent[6], vtkRenderer *ren);
89 
94 
99 
108  const int extent[6], int &xdim, int &ydim,
109  int imageSize[2], int textureSize[2]);
110 
115  bool TextureSizeOK(const int size[2]);
116 
121 
122  long FragmentShaderIndex; // OpenGL ID for fragment shader
123  vtkRenderWindow *RenderWindow; // RenderWindow used for previous render
124  int TextureSize[2];
125  int TextureBytesPerPixel;
126  int LastOrientation;
127  int LastSliceNumber;
128 
132 
133  vtkTimeStamp LoadTime;
134  int LoadCount;
135 
136  bool UseClampToEdge;
137  bool UseFragmentProgram;
138 
139 private:
140  vtkOpenGLImageSliceMapper(const vtkOpenGLImageSliceMapper&) VTK_DELETE_FUNCTION;
141  void operator=(const vtkOpenGLImageSliceMapper&) VTK_DELETE_FUNCTION;
142 };
143 
144 #endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:52
topologically and geometrically regular array of data
Definition: vtkImageData.h:46
image display properties
map a slice of a vtkImageData to the screen
represents an image in a 3D scene
Definition: vtkImageSlice.h:53
a simple class to control print indentation
Definition: vtkIndent.h:40
OpenGL mapper for image slice display.
void CheckOpenGLCapabilities(vtkOpenGLRenderWindow *renWin)
Check various OpenGL capabilities.
void RecursiveRenderTexturedPolygon(vtkRenderer *ren, vtkImageProperty *property, vtkImageData *image, int extent[6], bool recursive)
Recursive internal method, will call the non-recursive method as many times as necessary if the textu...
void BindFragmentProgram(vtkRenderer *ren, vtkImageProperty *property)
Bind the fragment program, and generate it first if necessary.
bool TextureSizeOK(const int size[2])
Test whether a given texture size is supported.
void RenderPolygon(vtkActor *actor, vtkPoints *points, const int extent[6], vtkRenderer *ren)
Basic polygon rendering, if the textured parameter is set the tcoords are included,...
void RenderTexturedPolygon(vtkRenderer *ren, vtkImageProperty *property, vtkImageData *image, int extent[6], bool recursive)
Non-recursive internal method, generate a single texture and its corresponding geometry.
static vtkOpenGLImageSliceMapper * New()
vtkStdString BuildFragmentProgram(vtkImageProperty *property)
Build the fragment program to use with the texture.
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),...
void ReleaseGraphicsResources(vtkWindow *)
Release any graphics resources that are being consumed by this mapper, the image texture in particula...
void Render(vtkRenderer *ren, vtkImageSlice *prop)
Implement base class method.
void RenderBackground(vtkActor *actor, vtkPoints *points, const int extent[6], vtkRenderer *ren)
Render the background, which means rendering everything within the plane of the image except for the ...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
OpenGL rendering window.
represent and manipulate 3D points
Definition: vtkPoints.h:40
create a window for renderers to draw into
abstract specification for renderers
Definition: vtkRenderer.h:64
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:49
record modification and/or execution time
Definition: vtkTimeStamp.h:36
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
@ points
Definition: vtkX3D.h:446
@ extent
Definition: vtkX3D.h:345
@ image
Definition: vtkX3D.h:374
@ size
Definition: vtkX3D.h:253