SWE
Public Member Functions | Static Public Member Functions | Public Attributes
Visualization Class Reference

List of all members.

Public Member Functions

 Visualization (int windowWidth, int windowHeight, const char *window_title)
 ~Visualization ()
void init (Simulation &sim, SWE_VisInfo *visInfo=0L)
void cleanUp ()
cudaGraphicsResource ** getCudaNormalsPtr ()
cudaGraphicsResource ** getCudaWaterSurfacePtr ()
void renderDisplay ()
void modifyWaterScaling (float factor)
void setRenderingMode (RenderMode mode)
void toggleRenderingMode ()
int resizeWindow (int newWidth, int newHeight)

Static Public Member Functions

static bool isExtensionSupported (const char *szTargetExtension)

Public Attributes

Cameracamera

Constructor & Destructor Documentation

Visualization::Visualization ( int  windowWidth,
int  windowHeight,
const char *  window_title 
)

Constructor. All dimensions are node-based, this means a grid consisting of 2x2 cells would have 3x3 nodes.

Parameters:
window_title title of the window created
_grid_x_size number of nodes of the grid (in x-direction)
_grid_y_size number of nodes of the grid (in y-direction)

Destructor (see note below)


Member Function Documentation

Frees all memory we used for geometry data Needs to be called before destructor gets called in order to work correctly

cudaGraphicsResource ** Visualization::getCudaNormalsPtr ( )

Returns a pointer to the cuda memory object holding the vertex normals

cudaGraphicsResource ** Visualization::getCudaWaterSurfacePtr ( )

Returns a pointer to the cuda memory object holding the vertex positions

void Visualization::init ( Simulation sim,
SWE_VisInfo visInfo = 0L 
)

Allocates memory for vertices and other geometry data.

Parameters:
siminstance of the simulation class
bool Visualization::isExtensionSupported ( const char *  szTargetExtension) [static]

Returns, whether a special extension is supported by the current graphics card

Parameters:
szTargetExtentionstring describing the extension to look for

Main rendering function. Draws the scene and updates screen

int Visualization::resizeWindow ( int  newWidth,
int  newHeight 
)

Gets called when window gets resized

Parameters:
newWidthnew window width in pixels
newHeightheight in pixels
void Visualization::setRenderingMode ( RenderMode  mode)

Sets current rendering mode

Parameters:
moderendering mode

Switches between 3 different rendering modes:

  • Shaded: Use OpenGL shading
  • Wireframe: Only render edges of each triangle
  • Watershader: Use custom GLSL shader for water surface

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