VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
vtkOpenGLImageSliceMapper Class Reference

OpenGL mapper for image slice display. More...

#include <vtkOpenGLImageSliceMapper.h>

Inheritance diagram for vtkOpenGLImageSliceMapper:
Inheritance graph
[legend]
Collaboration diagram for vtkOpenGLImageSliceMapper:
Collaboration graph
[legend]

List of all members.

Public Types

typedef vtkImageSliceMapper Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkOpenGLImageSliceMapperNewInstance () const
virtual void PrintSelf (ostream &os, vtkIndent indent)
void Render (vtkRenderer *ren, vtkImageSlice *prop)
void ReleaseGraphicsResources (vtkWindow *)

Static Public Member Functions

static vtkOpenGLImageSliceMapperNew ()
static int IsTypeOf (const char *type)
static vtkOpenGLImageSliceMapperSafeDownCast (vtkObjectBase *o)

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 vtkOpenGLImageSliceMapper ()
 ~vtkOpenGLImageSliceMapper ()
void RenderPolygon (vtkPoints *points, const int extent[6], bool textured)
void BindFragmentProgram (vtkRenderer *ren, vtkImageProperty *property)
vtkStdString BuildFragmentProgram (vtkImageProperty *property)
bool TextureSizeOK (const int size[2])
void CheckOpenGLCapabilities (vtkOpenGLRenderWindow *renWin)
void RenderColorAndLighting (double red, double green, double blue, double alpha, double ambient, double diffuse)
void RecursiveRenderTexturedPolygon (vtkRenderer *ren, vtkImageProperty *property, vtkImageData *image, int extent[6], bool recursive)
void RenderTexturedPolygon (vtkRenderer *ren, vtkImageProperty *property, vtkImageData *image, int extent[6], bool recursive)
void RenderBackground (vtkPoints *points, const int extent[6], bool textured)
void ComputeTextureSize (const int extent[6], int &xdim, int &ydim, int imageSize[2], int textureSize[2])

Protected Attributes

long TextureIndex
long BackgroundTextureIndex
long FragmentShaderIndex
vtkRenderWindowRenderWindow
int TextureSize [2]
int TextureBytesPerPixel
int LastOrientation
int LastSliceNumber
vtkTimeStamp LoadTime
int LoadCount
bool UsePowerOfTwoTextures
bool UseClampToEdge
bool UseFragmentProgram

Detailed Description

OpenGL mapper for image slice display.

vtkOpenGLImageSliceMapper is a concrete implementation of the abstract class vtkImageSliceMapper that interfaces to the OpenGL library.

Thanks:
Thanks to David Gobbi at the Seaman Family MR Centre and Dept. of Clinical Neurosciences, Foothills Medical Centre, Calgary, for providing this class.

Definition at line 39 of file vtkOpenGLImageSliceMapper.h.


Member Typedef Documentation

Reimplemented from vtkImageSliceMapper.

Definition at line 44 of file vtkOpenGLImageSliceMapper.h.


Constructor & Destructor Documentation


Member Function Documentation

Create an object with Debug turned off, modified time initialized to zero, and reference counting on.

Reimplemented from vtkImageSliceMapper.

static int vtkOpenGLImageSliceMapper::IsTypeOf ( const char *  name) [static]

Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkImageSliceMapper.

virtual int vtkOpenGLImageSliceMapper::IsA ( const char *  name) [virtual]

Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkImageSliceMapper.

Reimplemented from vtkImageSliceMapper.

virtual vtkObjectBase* vtkOpenGLImageSliceMapper::NewInstanceInternal ( ) const [protected, virtual]

Reimplemented from vtkImageSliceMapper.

Reimplemented from vtkImageSliceMapper.

virtual void vtkOpenGLImageSliceMapper::PrintSelf ( ostream &  os,
vtkIndent  indent 
) [virtual]

Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkImageSliceMapper.

void vtkOpenGLImageSliceMapper::Render ( vtkRenderer ren,
vtkImageSlice prop 
) [virtual]

Implement base class method. Perform the render.

Reimplemented from vtkImageSliceMapper.

Release any graphics resources that are being consumed by this mapper, the image texture in particular. Using the same texture in multiple render windows is NOT currently supported.

Reimplemented from vtkImageSliceMapper.

void vtkOpenGLImageSliceMapper::RenderColorAndLighting ( double  red,
double  green,
double  blue,
double  alpha,
double  ambient,
double  diffuse 
) [protected]

Call the OpenGL code that does color and lighting.

void vtkOpenGLImageSliceMapper::RecursiveRenderTexturedPolygon ( vtkRenderer ren,
vtkImageProperty property,
vtkImageData image,
int  extent[6],
bool  recursive 
) [protected]

Recursive internal method, will call the non-recursive method as many times as necessary if the texture must be broken up into pieces that are small enough for the GPU to render

void vtkOpenGLImageSliceMapper::RenderTexturedPolygon ( vtkRenderer ren,
vtkImageProperty property,
vtkImageData image,
int  extent[6],
bool  recursive 
) [protected]

Non-recursive internal method, generate a single texture and its corresponding geometry.

void vtkOpenGLImageSliceMapper::RenderPolygon ( vtkPoints points,
const int  extent[6],
bool  textured 
) [protected]

Basic polygon rendering, if the textured parameter is set the tcoords are included, otherwise they aren't.

void vtkOpenGLImageSliceMapper::RenderBackground ( vtkPoints points,
const int  extent[6],
bool  textured 
) [protected]

Render the background, which means rendering everything within the plane of the image except for the polygon that displays the image data.

void vtkOpenGLImageSliceMapper::BindFragmentProgram ( vtkRenderer ren,
vtkImageProperty property 
) [protected]

Bind the fragment program, and generate it first if necessary.

Build the fragment program to use with the texture.

void vtkOpenGLImageSliceMapper::ComputeTextureSize ( const int  extent[6],
int xdim,
int ydim,
int  imageSize[2],
int  textureSize[2] 
) [protected, virtual]

Given an extent that describes a slice (it must have unit thickness in one of the three directions), return the dimension indices that correspond to the texture "x" and "y", provide the x, y image size, and provide the texture size (padded to a power of two if the hardware requires).

Reimplemented from vtkImageMapper3D.

bool vtkOpenGLImageSliceMapper::TextureSizeOK ( const int  size[2]) [protected]

Test whether a given texture size is supported. This includes a check of whether the texture will fit into texture memory.

Check various OpenGL capabilities


Member Data Documentation

Definition at line 119 of file vtkOpenGLImageSliceMapper.h.

Definition at line 120 of file vtkOpenGLImageSliceMapper.h.

Definition at line 121 of file vtkOpenGLImageSliceMapper.h.

Definition at line 122 of file vtkOpenGLImageSliceMapper.h.

Definition at line 123 of file vtkOpenGLImageSliceMapper.h.

Definition at line 124 of file vtkOpenGLImageSliceMapper.h.

Definition at line 125 of file vtkOpenGLImageSliceMapper.h.

Definition at line 126 of file vtkOpenGLImageSliceMapper.h.

Definition at line 128 of file vtkOpenGLImageSliceMapper.h.

Definition at line 129 of file vtkOpenGLImageSliceMapper.h.

Definition at line 131 of file vtkOpenGLImageSliceMapper.h.

Definition at line 132 of file vtkOpenGLImageSliceMapper.h.

Definition at line 133 of file vtkOpenGLImageSliceMapper.h.


The documentation for this class was generated from the following file: