VTK  9.0.20200928
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 "vtkImageSliceMapper.h"
30 #include "vtkRenderingOpenGL2Module.h" // For export macro
31 
32 class vtkRenderWindow;
34 class vtkActor;
35 
36 class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLImageSliceMapper : public vtkImageSliceMapper
37 {
38 public:
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
46  void Render(vtkRenderer* ren, vtkImageSlice* prop) override;
47 
53  void ReleaseGraphicsResources(vtkWindow*) override;
54 
55 protected:
57  ~vtkOpenGLImageSliceMapper() override;
58 
64  void RecursiveRenderTexturedPolygon(vtkRenderer* ren, vtkImageProperty* property,
65  vtkImageData* image, int extent[6], bool recursive);
66 
71  void RenderTexturedPolygon(vtkRenderer* ren, vtkImageProperty* property, vtkImageData* image,
72  int extent[6], bool recursive);
73 
78  void RenderPolygon(vtkActor* actor, vtkPoints* points, const int extent[6], vtkRenderer* ren);
79 
84  void RenderBackground(vtkActor* actor, vtkPoints* points, const int extent[6], vtkRenderer* ren);
85 
93  void ComputeTextureSize(
94  const int extent[6], int& xdim, int& ydim, int imageSize[2], int textureSize[2]) override;
95 
100  bool TextureSizeOK(const int size[2], vtkRenderer* ren);
101 
102  vtkRenderWindow* RenderWindow; // RenderWindow used for previous render
103  int TextureSize[2];
107 
111 
113 
114 private:
116  void operator=(const vtkOpenGLImageSliceMapper&) = delete;
117 };
118 
119 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:33
vtkOpenGLImageSliceMapper::LastSliceNumber
int LastSliceNumber
Definition: vtkOpenGLImageSliceMapper.h:106
vtkOpenGLImageSliceMapper::LastOrientation
int LastOrientation
Definition: vtkOpenGLImageSliceMapper.h:105
vtkOpenGLImageSliceMapper::PolyDataActor
vtkActor * PolyDataActor
Definition: vtkOpenGLImageSliceMapper.h:108
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:32
vtkX3D::image
Definition: vtkX3D.h:380
vtkImageSliceMapper
map a slice of a vtkImageData to the screen
Definition: vtkImageSliceMapper.h:39
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:38
vtkX3D::points
Definition: vtkX3D.h:452
vtkImageSliceMapper::Render
void Render(vtkRenderer *renderer, vtkImageSlice *prop) override
This should only be called by the renderer.
vtkImageSlice
represents an image in a 3D scene
Definition: vtkImageSlice.h:46
vtkImageProperty
image display properties
Definition: vtkImageProperty.h:36
vtkOpenGLImageSliceMapper::LoadTime
vtkTimeStamp LoadTime
Definition: vtkOpenGLImageSliceMapper.h:112
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:45
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:47
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkImageSliceMapper::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this mapper.
vtkX3D::size
Definition: vtkX3D.h:259
vtkOpenGLImageSliceMapper
OpenGL mapper for image slice display.
Definition: vtkOpenGLImageSliceMapper.h:36
vtkOpenGLImageSliceMapper::TextureBytesPerPixel
int TextureBytesPerPixel
Definition: vtkOpenGLImageSliceMapper.h:104
vtkOpenGLImageSliceMapper::BackingPolyDataActor
vtkActor * BackingPolyDataActor
Definition: vtkOpenGLImageSliceMapper.h:109
vtkOpenGLImageSliceMapper::RenderWindow
vtkRenderWindow * RenderWindow
Definition: vtkOpenGLImageSliceMapper.h:102
vtkImageSliceMapper::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkImageSliceMapper.h
vtkImageSliceMapper::New
static vtkImageSliceMapper * New()
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:67
vtkOpenGLImageSliceMapper::BackgroundPolyDataActor
vtkActor * BackgroundPolyDataActor
Definition: vtkOpenGLImageSliceMapper.h:110
vtkOpenGLRenderWindow
OpenGL rendering window.
Definition: vtkOpenGLRenderWindow.h:53
vtkX3D::extent
Definition: vtkX3D.h:351
vtkImageMapper3D::ComputeTextureSize
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),...
vtkRenderWindow
create a window for renderers to draw into
Definition: vtkRenderWindow.h:94