VTK
vtkMesaImageSliceMapper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkMesaImageSliceMapper.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 __vtkMesaImageSliceMapper_h
26 #define __vtkMesaImageSliceMapper_h
27 
28 #include "vtkImageSliceMapper.h"
29 
30 class vtkWindow;
31 class vtkRenderer;
32 class vtkRenderWindow;
34 class vtkImageSlice;
35 class vtkImageProperty;
36 class vtkImageData;
37 
39  public vtkImageSliceMapper
40 {
41 public:
42  static vtkMesaImageSliceMapper *New();
44  virtual void PrintSelf(ostream& os, vtkIndent indent);
45 
47  void Render(vtkRenderer *ren, vtkImageSlice *prop);
48 
53 
54 protected:
57 
59 
60  void RenderColorAndLighting(
61  double red, double green, double blue,
62  double alpha, double ambient, double diffuse);
64 
67  void RenderBackingPolygon();
68 
70 
73  void RecursiveRenderTexturedPolygon(
74  vtkRenderer *ren, vtkImageProperty *property,
75  vtkImageData *image, int extent[6], bool recursive);
77 
79 
81  void RenderTexturedPolygon(
82  vtkRenderer *ren, vtkImageProperty *property,
83  vtkImageData *image, int extent[6], bool recursive);
85 
87  vtkStdString BuildFragmentProgram(vtkImageProperty *property);
88 
90 
95  void ComputeTextureSize(
96  const int extent[6], int &xdim, int &ydim,
97  int imageSize[2], int textureSize[2]);
99 
102  bool TextureSizeOK(const int size[2]);
103 
105  void CheckOpenGLCapabilities(vtkMesaRenderWindow *renWin);
106 
107  long Index; // OpenGL ID for texture or display list
108  long FragmentShaderIndex; // OpenGL ID for fragment shader
109  vtkRenderWindow *RenderWindow; // RenderWindow used for previous render
110  int TextureSize[2];
114 
117 
121 
122 private:
123  vtkMesaImageSliceMapper(const vtkMesaImageSliceMapper&); // Not implemented.
124  void operator=(const vtkMesaImageSliceMapper&); // Not implemented.
125 };
126 
127 #endif