OpenGL Volumizer 2.7 Reference Pages


NAME
vzPTRenderAction - Projected Tetrahedra Render Action.

INHERITS FROM
vzRenderAction

HEADER FILE
#include <Volumizer2/PTRenderAction.h>

PUBLIC METHOD SUMMARY
vzPTRenderAction (  );
~vzPTRenderAction (  );
virtual void draw ( vzShape* shape);
virtual void drawCells ( vzShape* shape, bool useTransferFunction=false);
virtual void drawBoundary ( vzShape* shape, bool useTransferFunction=false);
virtual void manage ( vzShape* shape);
virtual void beginDraw ( unsigned int rendererFlags);
virtual void endDraw (  );
virtual void unmanage ( vzShape* shape);
void setSorter ( vzSorter sorter);

CLASS DESCRIPTION
vzPTRenderAction implements a direct volume rendering algorithm for irregular grids.

vzPTRenderAction uses the Projected Tetrahedra Algorithm to volume render a given irregular grid. The volumetric geometry for the grid is first tessellated into a tetrahedral mesh. This tetrahedral mesh is sorted in a back-to-front order. Each tetrahedron is then rendered one at a time using the projected tetrahedra algorithm. Each tetrahedron is projected to screen space and approximated with a set of triangles. Per vertex data associated with the grid is linearly interpolated for the projected vertices and is used to set color and opacity values for that vertex.


EXAMPLES
The following code represents a sample use of the vzPTRenderAction class:
vzPTRenderAction renderer();

renderer.setSorter(VZ_CONCAVE);

renderer.manage(shape1);                  // manage two shapes.
renderer.manage(shape2);                  // 

renderer.beginDraw(0);
renderer.draw (shape1);                    // draw shape 1
renderer.draw (shape2);                    // draw shape 2
renderer.endDraw();
Note that the volume shapes are rendered in the order the draw() methods are called, so it is the application's reponsibility to sort them in the correct visibility order.

vzGeometry *geometry = myInitGeometry();

vzPTLUTShader *shader = new vzPTLUTShader();

vzAppearance *appearance = new vzAppearance(shader);

vzShape *shape = new vzShape(geometry, appearance);

vzParameterVertexData *vertexData = myInitVertexData();
vzParameterLookupTable *lut = myInitLUT();

appearance->setParameter("vertex_data", vertexData);
appearance->setParameter("lookup_table", lut);

METHOD DESCRIPTIONS

   vzPTRenderAction()
vzPTRenderAction (  );

Constructor for PTRenderAction class.

   ~vzPTRenderAction()
~vzPTRenderAction (  );

Destructor for PTRenderAction class.

   beginDraw()
virtual void beginDraw ( unsigned int rendererFlags);

This method is used to tell the render action that the application is now ready to issue draw commands on the shapes. Following this, all the methods invoked on the render action must be draw() methods until the invocation of the next endDraw().

   draw()
virtual void draw ( vzShape* shape);

This method renders a vzShape. If the shape being drawn has not already been managed, then the render action will implicitly call manage().

   drawBoundary()
virtual void drawBoundary ( vzShape* shape, bool useTransferFunction=false);

This method renders the boundary of the geometry in vzShape as polygons. If useTransferFunction is true, then the transfer function will be applied to the rendered geometry to assign per-vertex color values.

   drawCells()
virtual void drawCells ( vzShape* shape, bool useTransferFunction=false);

This method renders the cells of the geometry in vzShape as polygons. If useTransferFunction is true, then the transfer function will be applied to the rendered geometry to assign per-vertex color values.

   endDraw()
virtual void endDraw (  );

This method tells the render action that the application is finished executing draw() commands. Following this, any calls to draw() are not legal until a new beginDraw() command is issued.

   manage()
virtual void manage ( vzShape* shape);

Manages the specified shape, so that later it can be drawn. This call increases the reference count for the shape. The effects of this command are not immediate, but are rather delayed until the next call to draw().

   setSorter()
void setSorter ( vzSorter sorter);

Set the sorter mode for the next call to draw().

   unmanage()
virtual void unmanage ( vzShape* shape);

Removes the specified shape from the list of currently managed shapes. Unmanaging a shape frees up its resources to be used for drawing other shapes.

SEE ALSO
PTRenderAction, vzPTRenderAction, vzRenderAction, vzShape

Back to Index