Voxelyze
Public Types | Public Member Functions
CVX_MeshRender Class Reference

Voxelyze mesh visualizer. More...

#include <VX_MeshRender.h>

List of all members.

Public Types

enum  viewColoring { MATERIAL, FAILURE, STATE_INFO }
 Defines various ways of coloring the voxels in the 3D mesh. More...

Public Member Functions

 CVX_MeshRender (CVoxelyze *voxelyzeInstance)
 Initializes this mesh visualization with the specified voxelyze instance. This voxelyze pointer must remain valid for the duration of this object.
void generateMesh ()
 Generates (or regenerates) this mesh from the linked voxelyze object. This must be called whenever voxels are added or removed in the simulation.
void updateMesh (viewColoring colorScheme=MATERIAL, CVoxelyze::stateInfoType stateType=CVoxelyze::DISPLACEMENT)
 Updates the mesh according to the current state of the linked voxelyze object and the coloring scheme specified by the arguments.
void saveObj (const char *filePath)
 Save the current deformed mesh as an obj file to the path specified. Coloring is not supported yet.
void glDraw ()
 Executes openGL drawing commands to draw this mesh in an Open GL window if USE_OPENGL is defined.

Detailed Description

Voxelyze mesh visualizer.

A simple way to generate a deformed mesh reflecting the current state of a voxelyze object. After constructing with a pointer to the desired voxelyze object the mesh is ready. If the state of the voxelyze object has changed or a different coloring is desired, simply call updateMesh(). If voxels are added or subtracted to the voxelyze object, generateMesh() must be called to regenerate the mesh before calling updateMesh or drawGl().

The mesh can be drawn in an initialized OpenGL window by defining USE_OPENGL in the preprocessor and calling glDraw from within the drawing loop. An obj mesh file can also be generated at any time.


Member Enumeration Documentation

Defines various ways of coloring the voxels in the 3D mesh.

Enumerator:
MATERIAL 

Display the material color specified by its RGB values.

FAILURE 

Display the current failure status (red=failed, yellow=yielded, white=ok)

STATE_INFO 

Display a color coded "head map" of the specified CVoxelyze::stateInfoType (displacement, kinetic energy, etc.)


Constructor & Destructor Documentation

CVX_MeshRender::CVX_MeshRender ( CVoxelyze voxelyzeInstance)

Initializes this mesh visualization with the specified voxelyze instance. This voxelyze pointer must remain valid for the duration of this object.

Parameters:
[in]voxelyzeInstanceThe voxelyze instance to link this mesh object to.

Member Function Documentation

void CVX_MeshRender::saveObj ( const char *  filePath)

Save the current deformed mesh as an obj file to the path specified. Coloring is not supported yet.

Parameters:
[in]filePathFile path to save the obj file as. Creates or overwrites.

Updates the mesh according to the current state of the linked voxelyze object and the coloring scheme specified by the arguments.

Parameters:
[in]colorSchemeThe coloring scheme.
[in]stateTypeIf colorScheme = STATE_INFO, this argument determines the state to color the object according to. Only kinetic energy, strain energy, displacement, and pressure are currently supported.

The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations Enumerator Friends