Version: 6.3.1
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes

VISU_OpenGLPointSpriteMapper Class Reference

OpenGL Point Sprites PolyData Mapper. More...

#include <VISU_OpenGLPointSpriteMapper.hxx>

Inheritance diagram for VISU_OpenGLPointSpriteMapper:
Inheritance graph

Public Types

enum  RenderModes { Accumulate = 0, Occlude }
 

The Point Sprites rendering mode.

More...
enum  PrimitiveTypes { PointSprite = 0, OpenGLPoint, GeomSphere }

Public Member Functions

 vtkTypeRevisionMacro (VISU_OpenGLPointSpriteMapper, MAPPER_SUPERCLASS)
 vtkGetMacro (DefaultPointSize, float)
 Set the initial point size to be used.
void SetAverageCellSize (float theSize)
 Set Average Cell Size.
 vtkGetMacro (AverageCellSize, float)
 Get Average Cell Size.
 vtkSetMacro (RenderMode, int)
 Set the Render Mode for the mapper.
 vtkGetMacro (RenderMode, int)
 Get the Render Mode for the mapper.
virtual void RenderPiece (vtkRenderer *ren, vtkActor *a)
 Implement superclass render method.
void ReleaseGraphicsResources (vtkWindow *)
 Release any graphics resources that are being consumed by this mapper.
virtual int Draw (vtkRenderer *ren, vtkActor *a)
 Draw method for OpenGL.
 vtkSetMacro (UseOpenGLMapper, bool)
 Set usage of #vtkOpenGLPolyDataMapper.
 vtkGetMacro (UseOpenGLMapper, bool)
 Get usage of #vtkOpenGLPolyDataMapper.
 vtkSetMacro (UsePointSprites, bool)
 Set usage of Point Sprites.
 vtkGetMacro (UsePointSprites, bool)
 Get usage of Point Sprites.
 vtkSetMacro (UseTextures, bool)
 Set usage of textures for Point Sprites.
 vtkGetMacro (UseTextures, bool)
 Get usage of textures for Point Sprites.
 vtkSetMacro (UseShader, bool)
 Set usage of vertex shader.
 vtkGetMacro (UseShader, bool)
 Get usage of vertex shader.
 vtkGetMacro (PointSpriteMode, int)
 Point Sprite drawing mode.
void SetPointSpriteMode (int)
 vtkGetMacro (PrimitiveType, int)
 Get the Primitive type.
void SetPrimitiveType (int)
 Set the Primitive type.
void SetPointSpriteClamp (float)
 Set Point Sprite Clamp.
 vtkGetMacro (PointSpriteClamp, float)
 Get Point Sprite Clamp.
void SetPointSpriteSize (float)
 Set Point Sprite Const Size.
 vtkGetMacro (PointSpriteSize, float)
 Get Point Sprite Const Size.
void SetPointSpriteMinSize (float)
 Set Point Sprite Minimum Size.
 vtkGetMacro (PointSpriteMinSize, float)
 Get Point Sprite Minimum Size.
void SetPointSpriteMaxSize (float)
 Set Point Sprite Maximum Size.
 vtkGetMacro (PointSpriteMaxSize, float)
 Get Point Sprite Maximum Size.
void SetPointSpriteMagnification (float)
 Set Point Sprite Magnification.
 vtkGetMacro (PointSpriteMagnification, float)
 Get Point Sprite Magnification.
void SetPointSpriteAlphaThreshold (float)
 Set Point Sprite AlphaThreshold.
 vtkGetMacro (PointSpriteAlphaThreshold, float)
 Get Point Sprite AlphaThreshold.
 vtkSetMacro (PointSpriteOpacity, float)
 Set Point Sprite Opacity.
 vtkGetMacro (PointSpriteOpacity, float)
 Get Point Sprite Opacity.
void SetImageData (vtkImageData *theImageData)
 Set ImageData for Point Sprite Texture.
vtkImageData * GetImageData ()
 Get ImageData for Point Sprite Texture.

Static Public Member Functions

static
VISU_OpenGLPointSpriteMapper
New ()
static float GetMaximumSupportedSize ()
 Return the maximum point size supported by the graphics hardware.

Protected Member Functions

 VISU_OpenGLPointSpriteMapper ()
 ~VISU_OpenGLPointSpriteMapper ()
bool InitExtensions ()
 Initializing OpenGL extensions.
void InitPointSprites ()
 Activate Point Sprites.
void CleanupPointSprites ()
 Deactivate Point Sprites.
void InitTextures ()
 Initializing textures for Point Sprites.
void InitShader ()
 Initializing of the Vertex Shader.
void SetShaderVariable (const char *variable, float value)
 Set Vertex Shader variable.
void PrintInfoLog (GLhandleARB)
 Getting information about Vertex Shader compiling and linking.

Private Attributes

bool UseOpenGLMapper
bool UsePointSprites
bool UseTextures
bool UseShader
int RenderMode
int ListId
vtkIdType TotalCells
int ExtensionsInitialized
float DefaultPointSize
GLhandleARB VertexProgram
int PrimitiveType
int PointSpriteMode
float PointSpriteClamp
float PointSpriteSize
float PointSpriteMinSize
float PointSpriteMaxSize
float PointSpriteMagnification
GLuint PointSpriteTexture
float PointSpriteAlphaThreshold
float PointSpriteOpacity
float AverageCellSize
vtkSmartPointer< vtkImageData > ImageData

Detailed Description

VISU_OpenGLPointSpriteMapper is a class that maps polygonal data (i.e., vtkPolyData) to graphics primitives. It is performing the mapping to the rendering/graphics hardware/software. It is now possible to set a memory limit for the pipeline in the mapper. If the total estimated memory usage of the pipeline is larger than this limit, the mapper will divide the data into pieces and render each in a for loop.


Member Enumeration Documentation

Accumulate : Uses glBlendFunc(GL_SRC_ALPHA, GL_ONE), and no depth testing so that points are accumulated. Suitable for Galaxy plots. Occlude : No blending. Particles are solid spheres and depth testing is used as usual. Suitable for most particle simulations without the need for opacity.

Enumerator:
Accumulate 
Occlude 
Enumerator:
PointSprite 
OpenGLPoint 
GeomSphere 

Constructor & Destructor Documentation

VISU_OpenGLPointSpriteMapper::VISU_OpenGLPointSpriteMapper ( ) [protected]
VISU_OpenGLPointSpriteMapper::~VISU_OpenGLPointSpriteMapper ( ) [protected]

Member Function Documentation

static VISU_OpenGLPointSpriteMapper* VISU_OpenGLPointSpriteMapper.New ( ) [static]
VISU_OpenGLPointSpriteMapper.vtkTypeRevisionMacro ( VISU_OpenGLPointSpriteMapper  ,
MAPPER_SUPERCLASS   
)
VISU_OpenGLPointSpriteMapper.vtkGetMacro ( DefaultPointSize  ,
float   
)

This value forms the base upon which the distance attenuation acts. Usually the pointsize is set to the maximum supported by the graphics card for sprite display, then the quadratic factors are adjusted to bring the size down. Get the initial point size to be used.

void VISU_OpenGLPointSpriteMapper::SetAverageCellSize ( float  theSize)

References AverageCellSize, and Tolerance.

VISU_OpenGLPointSpriteMapper.vtkGetMacro ( AverageCellSize  ,
float   
)
VISU_OpenGLPointSpriteMapper.vtkSetMacro ( RenderMode  ,
int   
)
VISU_OpenGLPointSpriteMapper.vtkGetMacro ( RenderMode  ,
int   
)
void VISU_OpenGLPointSpriteMapper::RenderPiece ( vtkRenderer *  ren,
vtkActor *  a 
) [virtual]
void VISU_OpenGLPointSpriteMapper::ReleaseGraphicsResources ( vtkWindow *  win)

References ListId.

int VISU_OpenGLPointSpriteMapper::Draw ( vtkRenderer *  ren,
vtkActor *  a 
) [virtual]
float VISU_OpenGLPointSpriteMapper::GetMaximumSupportedSize ( ) [static]
VISU_OpenGLPointSpriteMapper.vtkSetMacro ( UseOpenGLMapper  ,
bool   
)

This flags prevents using of the VISU_OpenGLPointSpriteMapper (#vtkOpenGLPolyDataMapper is using instead).

VISU_OpenGLPointSpriteMapper.vtkGetMacro ( UseOpenGLMapper  ,
bool   
)
VISU_OpenGLPointSpriteMapper.vtkSetMacro ( UsePointSprites  ,
bool   
)
VISU_OpenGLPointSpriteMapper.vtkGetMacro ( UsePointSprites  ,
bool   
)
VISU_OpenGLPointSpriteMapper.vtkSetMacro ( UseTextures  ,
bool   
)

Works only if usage of Point Sprites is turned on.

VISU_OpenGLPointSpriteMapper.vtkGetMacro ( UseTextures  ,
bool   
)
VISU_OpenGLPointSpriteMapper.vtkSetMacro ( UseShader  ,
bool   
)

Works only if usage of Point Sprites is turned on.

VISU_OpenGLPointSpriteMapper.vtkGetMacro ( UseShader  ,
bool   
)
VISU_OpenGLPointSpriteMapper.vtkGetMacro ( PointSpriteMode  ,
int   
)

0 - Results - different colors, different sizes. 1 - Geometry - fixed color, fixed size. 2 - Outside - different colors, fixed size.

void VISU_OpenGLPointSpriteMapper::SetPointSpriteMode ( int  theMode)

References PointSpriteMode.

VISU_OpenGLPointSpriteMapper.vtkGetMacro ( PrimitiveType  ,
int   
)
void VISU_OpenGLPointSpriteMapper::SetPrimitiveType ( int  thePrimitiveType)

References PrimitiveType.

void VISU_OpenGLPointSpriteMapper::SetPointSpriteClamp ( float  theClamp)

References PointSpriteClamp, and Tolerance.

VISU_OpenGLPointSpriteMapper.vtkGetMacro ( PointSpriteClamp  ,
float   
)
void VISU_OpenGLPointSpriteMapper::SetPointSpriteSize ( float  theSize)

References PointSpriteSize, and Tolerance.

VISU_OpenGLPointSpriteMapper.vtkGetMacro ( PointSpriteSize  ,
float   
)
void VISU_OpenGLPointSpriteMapper::SetPointSpriteMinSize ( float  theMinSize)

References PointSpriteMinSize, and Tolerance.

VISU_OpenGLPointSpriteMapper.vtkGetMacro ( PointSpriteMinSize  ,
float   
)
void VISU_OpenGLPointSpriteMapper::SetPointSpriteMaxSize ( float  theMaxSize)

References PointSpriteMaxSize, and Tolerance.

VISU_OpenGLPointSpriteMapper.vtkGetMacro ( PointSpriteMaxSize  ,
float   
)
void VISU_OpenGLPointSpriteMapper::SetPointSpriteMagnification ( float  theMagnification)
VISU_OpenGLPointSpriteMapper.vtkGetMacro ( PointSpriteMagnification  ,
float   
)
void VISU_OpenGLPointSpriteMapper::SetPointSpriteAlphaThreshold ( float  theAlphaThreshold)
VISU_OpenGLPointSpriteMapper.vtkGetMacro ( PointSpriteAlphaThreshold  ,
float   
)
VISU_OpenGLPointSpriteMapper.vtkSetMacro ( PointSpriteOpacity  ,
float   
)
VISU_OpenGLPointSpriteMapper.vtkGetMacro ( PointSpriteOpacity  ,
float   
)
void VISU_OpenGLPointSpriteMapper::SetImageData ( vtkImageData *  theImageData)
vtkImageData * VISU_OpenGLPointSpriteMapper::GetImageData ( )
bool VISU_OpenGLPointSpriteMapper::InitExtensions ( ) [protected]
void VISU_OpenGLPointSpriteMapper::InitPointSprites ( ) [protected]
void VISU_OpenGLPointSpriteMapper::CleanupPointSprites ( ) [protected]
void VISU_OpenGLPointSpriteMapper::InitTextures ( ) [protected]
void VISU_OpenGLPointSpriteMapper::InitShader ( ) [protected]
void VISU_OpenGLPointSpriteMapper::SetShaderVariable ( const char *  variable,
float  value 
) [protected]
void VISU_OpenGLPointSpriteMapper::PrintInfoLog ( GLhandleARB  obj) [protected]

Field Documentation

vtkSmartPointer<vtkImageData> VISU_OpenGLPointSpriteMapper.ImageData [private]
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS