Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

nvtraverser::RenderTraverser Class Reference

Pure virtual render traverser class. More...

#include <RenderTraverser.h>

Inheritance diagram for nvtraverser::RenderTraverser:

Inheritance graph
[legend]
Collaboration diagram for nvtraverser::RenderTraverser:

Collaboration graph
[legend]
List of all members.

Public Types

enum  JitterTechnique { JT_ACCUM = 0x01, JT_READ_PIXELS = 0x02, JT_PBUFFER = 0x04 }
enum  RenderTechnique {
  RT_POINTS = 0x01, RT_WIREFRAME = 0x02, RT_SHADED = 0x04, RT_TEXTURED = 0x10,
  RT_EFFECTED = 0x20
}
enum  TransparencyTechnique { TT_NONE = 0x01, TT_STIPPLED = 0x02, TT_BLENDED = 0x04, TT_ORDER_INDEPENDENT = 0x08 }
enum  OITTechnique { OT_TEXTURE = 0x01, OT_PBUFFER = 0x02 }
enum  GeometryCacheTechnique { GCT_NONE = 0x01, GCT_DL = 0x02, GCT_VBO = 0x04 }

Public Methods

virtual NVSG_API JitterTechnique getJitterTechnique (void) const=0
 Get the current jitter technique. More...

virtual NVSG_API bool isJitterTechniqueSupported (JitterTechnique jt) const=0
 Test on supported jitter techniques. More...

virtual NVSG_API bool setJitterTechnique (JitterTechnique jt)=0
 Set the jitter technique the render should use. More...

virtual NVSG_API RenderTechnique getRenderTechnique (void) const=0
 Get the current render technique. More...

virtual NVSG_API bool isRenderTechniqueSupported (RenderTechnique rt) const=0
 Test on supported render techhniques. More...

virtual NVSG_API bool setRenderTechnique (RenderTechnique rt)=0
 Set the render technique the render should use. More...

virtual NVSG_API TransparencyTechnique getTransparencyTechnique (void) const=0
 Get the current transparency technique. More...

virtual NVSG_API bool isTransparencyTechniqueSupported (TransparencyTechnique tt) const=0
 Test on supported transparency techhniques. More...

virtual NVSG_API bool setTransparencyTechnique (TransparencyTechnique tt)=0
 Set the transparency technique the render should use. More...

virtual NVSG_API OITTechnique getOITTechnique (void) const=0
 Get the current OIT (Order Independent Transparency) technique. More...

virtual NVSG_API bool isOITTechniqueSupported (OITTechnique ot) const=0
 Test on supported OIT techhniques. More...

virtual NVSG_API bool setOITTechnique (OITTechnique ot)=0
 Set the OIT technique the render should use. More...

virtual NVSG_API size_t getOITMaxPasses (void) const=0
 Get maximum OIT passes. More...

virtual NVSG_API bool setOITMaxPasses (size_t maxPasses)=0
 Set the number of maxumum passes to archieve the desired transparency effect. More...

virtual NVSG_API float getOITThreshold (void) const=0
 Get the current threshold. More...

virtual NVSG_API bool setOITThreshold (float threshold)=0
 Set the threshold. More...

virtual NVSG_API GeometryCacheTechnique getGeometryCacheTechnique (void) const=0
 Get the current geoemtry caching technique. More...

virtual NVSG_API bool isGeometryCacheTechniqueSupported (GeometryCacheTechnique gct) const=0
 Test on supported geometry caching techhniques. More...

virtual NVSG_API bool setGeometryCacheTechnique (GeometryCacheTechnique gct)=0
 Set the geometry caching technique the render should use. More...

virtual NVSG_API void getTextureSizeLimits (size_t &width, size_t &height) const=0
 Get the texture size limits. More...

virtual NVSG_API void setTextureSizeLimits (size_t width, size_t height)=0
 Set the texture size limits. More...

NVSG_API void setLineAntiAliasing (bool onOff)
 Set the anti-aliasing mode for wire frame drawings. More...

NVSG_API bool getLineAntiAliasing (void) const
 Get the anti-aliasing mode for wire frame drawings. More...

NVSG_API float getLineWidth (void) const
 Get the line width for wire frame drawings. More...

NVSG_API void setLineWidth (float width)
 Set the line width for wire frame drawings. More...

NVSG_API void setPointAntiAliasing (bool onOff)
 Set the anti-aliasing mode for point mode drawings. More...

NVSG_API bool getPointAntiAliasing (void) const
 Get the anti-aliasing mode for point mode drawings. More...

NVSG_API float getPointSize (void) const
 Get the point size for point mode drawings. More...

NVSG_API void setPointSize (float size)
 Set the point size for point mode drawings. More...


Protected Methods

NVSG_API RenderTraverser (void)
 Default constructor. More...

virtual NVSG_API ~RenderTraverser (void)
 Default destructor. More...

virtual NVSG_API void handleParallelCamera (const nvsg::ParallelCamera *p, const nvsg::Node *root)
 Provide special treatment of a ParallelCamera object. More...

virtual NVSG_API void handlePerspectiveCamera (const nvsg::PerspectiveCamera *p, const nvsg::Node *root)
 Provide special treatment of a PerspectiveCamera object. More...

virtual NVSG_API void postTraverseGroup (const nvsg::Group *p)
 This function will be called from the framework immediately after a Group has been traversed. More...

virtual NVSG_API void traverseLight (const nvsg::LightSource *p)
 This function will be called from the framework when a LightSource node is visited. More...

virtual NVSG_API void disableLightSource (const nvsg::LightSource *p)=0
 This function is called from the RenderTraverser framework whenever a LightSource is to be disabled. More...

NVSG_API size_t getCurrentLightIndex () const
 Get the zero based index of the current light. More...


Protected Attributes

std::map< const nvsg::StateAttribute *,
nvutil::Incarnation
m_perStateAttributeIncarnationMap
 Map between StateAttribute and Incarnation. More...


Detailed Description

Pure virtual render traverser class.

Use this pure virtual class as a base class to derive your own render traverser. Render traverser are not allowed to apply changes to the given scenegraph. This base class containes the model matrix and inverse model matrix stack. This is very handy, because you do not have to ask e.g. OpenGL which would be normally very expensive. So your special render traverser has to take care of these stacks.

Note:
The render traverser object must not survive the render area it works on. For e.g. RenderArea and GLTraverser make sure to make the render area current before destroying the traverser.


Member Enumeration Documentation

enum nvtraverser::RenderTraverser::JitterTechnique
 

Enumeration values:
JT_ACCUM  Render to accumulation buffer.
JT_READ_PIXELS  Render to backbuffer and use e.g. OpenGL read pixels to read it back.
JT_PBUFFER  Render to PBuffer.

enum nvtraverser::RenderTraverser::RenderTechnique
 

Enumeration values:
RT_POINTS  Render scene as points only.
RT_WIREFRAME  Render scene as wireframe only.
RT_SHADED  Render scene in simple shading mode.
RT_TEXTURED  Render scene in simple shading mode plus textures.
RT_EFFECTED  Render scene fully effected and shaded.

enum nvtraverser::RenderTraverser::TransparencyTechnique
 

Enumeration values:
TT_NONE  Ignore transparency, draw opaque.
TT_STIPPLED  Use stipple patterns to simulate transparency.
TT_BLENDED  Use blending to render transparent objects.
TT_ORDER_INDEPENDENT  Use the "Order Independent Transparency" approach to render transparent objects.

enum nvtraverser::RenderTraverser::OITTechnique
 

Enumeration values:
OT_TEXTURE  Use textures for OIT.
OT_PBUFFER  Use PBuffers for OIT.

enum nvtraverser::RenderTraverser::GeometryCacheTechnique
 

Enumeration values:
GCT_NONE  no geometry caching.
GCT_DL  cache geometries in display lists.
GCT_VBO  cache geometries in vertex buffer objects.


Constructor & Destructor Documentation

NVSG_API nvtraverser::RenderTraverser::RenderTraverser void    [protected]
 

Default constructor.

virtual NVSG_API nvtraverser::RenderTraverser::~RenderTraverser void    [protected, virtual]
 

Default destructor.


Member Function Documentation

virtual NVSG_API JitterTechnique nvtraverser::RenderTraverser::getJitterTechnique void    const [pure virtual]
 

Get the current jitter technique.

Returns:
The currently used technique.

Implemented in nvtraverser::GLTraverser.

virtual NVSG_API bool nvtraverser::RenderTraverser::isJitterTechniqueSupported JitterTechnique    jt const [pure virtual]
 

Test on supported jitter techniques.

Use this method to test if this special jitter technique is currently available.

Returns:
true - supported, false - not supported
Parameters:
jt  Jitter technique.

Implemented in nvtraverser::GLTraverser.

virtual NVSG_API bool nvtraverser::RenderTraverser::setJitterTechnique JitterTechnique    jt [pure virtual]
 

Set the jitter technique the render should use.

Returns:
true - everything went fine, false - not set
Parameters:
jt  Jitter technique

Implemented in nvtraverser::GLTraverser.

virtual NVSG_API RenderTechnique nvtraverser::RenderTraverser::getRenderTechnique void    const [pure virtual]
 

Get the current render technique.

Implemented in nvtraverser::GLTraverser.

virtual NVSG_API bool nvtraverser::RenderTraverser::isRenderTechniqueSupported RenderTechnique    rt const [pure virtual]
 

Test on supported render techhniques.

Use this technique to test if this special render technique is currently available.

Returns:
true - supported, false - not supported.
Parameters:
rt  Render technique.

Implemented in nvtraverser::GLTraverser.

virtual NVSG_API bool nvtraverser::RenderTraverser::setRenderTechnique RenderTechnique    rt [pure virtual]
 

Set the render technique the render should use.

Returns:
true - everything went fine, false - not set
Parameters:
rt  Render technique.

Implemented in nvtraverser::GLTraverser.

virtual NVSG_API TransparencyTechnique nvtraverser::RenderTraverser::getTransparencyTechnique void    const [pure virtual]
 

Get the current transparency technique.

Implemented in nvtraverser::GLTraverser.

virtual NVSG_API bool nvtraverser::RenderTraverser::isTransparencyTechniqueSupported TransparencyTechnique    tt const [pure virtual]
 

Test on supported transparency techhniques.

Use this technique to test if this special transparency technique is currently available.

Returns:
true - supported, jalse - not supported.
Parameters:
tt  Transparency technique.

Implemented in nvtraverser::GLTraverser.

virtual NVSG_API bool nvtraverser::RenderTraverser::setTransparencyTechnique TransparencyTechnique    tt [pure virtual]
 

Set the transparency technique the render should use.

Returns:
true - everything went fine, false - not set
Parameters:
tt  Transparency technique.

Implemented in nvtraverser::GLTraverser.

virtual NVSG_API OITTechnique nvtraverser::RenderTraverser::getOITTechnique void    const [pure virtual]
 

Get the current OIT (Order Independent Transparency) technique.

Implemented in nvtraverser::GLTraverser.

virtual NVSG_API bool nvtraverser::RenderTraverser::isOITTechniqueSupported OITTechnique    ot const [pure virtual]
 

Test on supported OIT techhniques.

Use this technique to test if this special OIT technique is currently available.

Returns:
true - supported, jalse - not supported.
Parameters:
ot  OIT technique

Implemented in nvtraverser::GLTraverser.

virtual NVSG_API bool nvtraverser::RenderTraverser::setOITTechnique OITTechnique    ot [pure virtual]
 

Set the OIT technique the render should use.

Returns:
true - everything went fine, false - not set
Parameters:
ot  OIT technique

Implemented in nvtraverser::GLTraverser.

virtual NVSG_API size_t nvtraverser::RenderTraverser::getOITMaxPasses void    const [pure virtual]
 

Get maximum OIT passes.

Returns:
Maximum rendering passes to archive the desired effect.

Implemented in nvtraverser::GLTraverser.

virtual NVSG_API bool nvtraverser::RenderTraverser::setOITMaxPasses size_t    maxPasses [pure virtual]
 

Set the number of maxumum passes to archieve the desired transparency effect.

Returns:
true - everything went fine, false - not set
Parameters:
maxPasses  Maximum passes to render, even when threshold is not reached.

Implemented in nvtraverser::GLTraverser.

virtual NVSG_API float nvtraverser::RenderTraverser::getOITThreshold void    const [pure virtual]
 

Get the current threshold.

Returns:
threshold [0,1]

Implemented in nvtraverser::GLTraverser.

virtual NVSG_API bool nvtraverser::RenderTraverser::setOITThreshold float    threshold [pure virtual]
 

Set the threshold.

The thereshold tells the refinement step of the OIT algorithm if it needs another pass or if it is good enough to show the rendered result. The value lies between 0 and 1 (0%-100%). The refinement step compares the percentage of drawn pixels with the threshold and stops if it is smaller than the user defined value.

Returns:
true - everything went fine, false - not set
Parameters:
threshold  Threshold [0,1]

Implemented in nvtraverser::GLTraverser.

virtual NVSG_API GeometryCacheTechnique nvtraverser::RenderTraverser::getGeometryCacheTechnique void    const [pure virtual]
 

Get the current geoemtry caching technique.

Implemented in nvtraverser::GLTraverser.

virtual NVSG_API bool nvtraverser::RenderTraverser::isGeometryCacheTechniqueSupported GeometryCacheTechnique    gct const [pure virtual]
 

Test on supported geometry caching techhniques.

Returns:
true - supported, false - not supported.
Parameters:
gct  GeometryCache technique.

Implemented in nvtraverser::GLTraverser.

virtual NVSG_API bool nvtraverser::RenderTraverser::setGeometryCacheTechnique GeometryCacheTechnique    gct [pure virtual]
 

Set the geometry caching technique the render should use.

Returns:
true - everything went fine, false - not set
Parameters:
gct  GeometryCache technique.

Implemented in nvtraverser::GLTraverser.

virtual NVSG_API void nvtraverser::RenderTraverser::getTextureSizeLimits size_t &    width,
size_t &    height
const [pure virtual]
 

Get the texture size limits.

Textures are downscaled to those limits if they are larger.

Parameters:
width  texture width limit
height  texture height limit

Implemented in nvtraverser::GLTraverser.

virtual NVSG_API void nvtraverser::RenderTraverser::setTextureSizeLimits size_t    width,
size_t    height
[pure virtual]
 

Set the texture size limits.

Textures are downscaled to those limits if they are larger.

Note:
Setting width or height to 0 (zero), disables the respective texture size limit.
Parameters:
width  texture width limit
height  texture height limit

Implemented in nvtraverser::GLTraverser.

void nvtraverser::RenderTraverser::setLineAntiAliasing bool    onOff [inline]
 

Set the anti-aliasing mode for wire frame drawings.

Parameters:
onOff  enables/disables line anti-aliasing

bool nvtraverser::RenderTraverser::getLineAntiAliasing void    const [inline]
 

Get the anti-aliasing mode for wire frame drawings.

Returns:
true, if line anti-aliasing is on, otherwise false.

float nvtraverser::RenderTraverser::getLineWidth void    const [inline]
 

Get the line width for wire frame drawings.

Returns:
the line width for wire frame drawings.

void nvtraverser::RenderTraverser::setLineWidth float    width [inline]
 

Set the line width for wire frame drawings.

Parameters:
width  line width to set

void nvtraverser::RenderTraverser::setPointAntiAliasing bool    onOff [inline]
 

Set the anti-aliasing mode for point mode drawings.

Parameters:
onOff  enables/disables point anti-aliasing

bool nvtraverser::RenderTraverser::getPointAntiAliasing void    const [inline]
 

Get the anti-aliasing mode for point mode drawings.

Returns:
true, if point anti-aliasing is on, otherwise false.

float nvtraverser::RenderTraverser::getPointSize void    const [inline]
 

Get the point size for point mode drawings.

Returns:
the point size for point mode drawings.

void nvtraverser::RenderTraverser::setPointSize float    size [inline]
 

Set the point size for point mode drawings.

Parameters:
size  point size to set

virtual NVSG_API void nvtraverser::RenderTraverser::handleParallelCamera const nvsg::ParallelCamera   p,
const nvsg::Node   root
[protected, virtual]
 

Provide special treatment of a ParallelCamera object.

The function initializes the model view transformation stack and calls the base class handler function.

Reimplemented from nvtraverser::ModelViewTraverser.

Reimplemented in nvtraverser::GLTraverser.

virtual NVSG_API void nvtraverser::RenderTraverser::handlePerspectiveCamera const nvsg::PerspectiveCamera   p,
const nvsg::Node   root
[protected, virtual]
 

Provide special treatment of a PerspectiveCamera object.

The function initializes the model view transformation stack and calls the base class handler function.

Reimplemented from nvtraverser::ModelViewTraverser.

Reimplemented in nvtraverser::GLTraverser.

virtual NVSG_API void nvtraverser::RenderTraverser::postTraverseGroup const nvsg::Group   p [protected, virtual]
 

This function will be called from the framework immediately after a Group has been traversed.

Remarks:
Custom traversers can override this function for any tasks that need to be done immediately after the Group pointed to by p has been traversed.

Reimplemented from nvtraverser::Traverser.

virtual NVSG_API void nvtraverser::RenderTraverser::traverseLight const nvsg::LightSource   p [protected, virtual]
 

This function will be called from the framework when a LightSource node is visited.

remarks Custom traversers can override this function for special tasks that need to be performed when visiting a LightSource node.

Reimplemented from nvtraverser::Traverser.

virtual NVSG_API void nvtraverser::RenderTraverser::disableLightSource const nvsg::LightSource   p [protected, pure virtual]
 

This function is called from the RenderTraverser framework whenever a LightSource is to be disabled.

Implemented in nvtraverser::GLTraverser.

size_t nvtraverser::RenderTraverser::getCurrentLightIndex   const [inline, protected]
 

Get the zero based index of the current light.

This index can be used to refer to the device dependent light in order to switch the light on, when a specific light handler routine is called, or off, after leaving the light's parent Group node.


Member Data Documentation

std::map<const nvsg::StateAttribute*, nvutil::Incarnation> nvtraverser::RenderTraverser::m_perStateAttributeIncarnationMap [protected]
 

Map between StateAttribute and Incarnation.


The documentation for this class was generated from the following file:
Generated on Tue Mar 1 13:20:40 2005 for NVSGSDK by NVIDIA