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) override;
43 
47  void Render(vtkRenderer *ren, vtkImageSlice *prop) override;
48 
54  void ReleaseGraphicsResources(vtkWindow *) override;
55 
56 protected:
58  ~vtkOpenGLImageSliceMapper() override;
59 
65  void RecursiveRenderTexturedPolygon(
66  vtkRenderer *ren, vtkImageProperty *property,
67  vtkImageData *image, int extent[6], bool recursive);
68 
73  void RenderTexturedPolygon(
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 
87  void RenderBackground(
88  vtkActor *actor, vtkPoints *points, const int extent[6], vtkRenderer *ren);
89 
93  void BindFragmentProgram(vtkRenderer *ren, vtkImageProperty *property);
94 
98  vtkStdString BuildFragmentProgram(vtkImageProperty *property);
99 
107  void ComputeTextureSize(
108  const int extent[6], int &xdim, int &ydim,
109  int imageSize[2], int textureSize[2]) override;
110 
115  bool TextureSizeOK(const int size[2], vtkRenderer *ren);
116 
120  void CheckOpenGLCapabilities(vtkOpenGLRenderWindow *renWin);
121 
122  vtkRenderWindow *RenderWindow; // RenderWindow used for previous render
123  int TextureSize[2];
127 
131 
134 
137 
138 private:
140  void operator=(const vtkOpenGLImageSliceMapper&) = delete;
141 };
142 
143 #endif
OpenGL rendering window.
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this mapper.
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:40
static vtkImageSliceMapper * New()
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:51
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.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
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
void Render(vtkRenderer *renderer, vtkImageSlice *prop) override
This should only be called by the renderer.
map a slice of a vtkImageData to the screen
represent and manipulate 3D points
Definition: vtkPoints.h:39