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

CVertexGrid Class Reference

Covers the vertex grid underlying the image. More...

#include <WarpAlgorithm.h>

List of all members.

Public Methods

data access methods

Public Attributes

grid rectangle
grid resolution

Private Methods

Private Attributes


Detailed Description

The main functionality provided by this class is to encapsulate a grid of vertices which can be put at an arbitrary position and can have arbitrary orientation. But in our project, the vertex grid lies in the z=0 plane.

Moreover, the resolution of the field can be set dynamically.

See also:
CVertexGrid::SetGridData(VECTOR3D, VECTOR3D, VECTOR3D, int, int)

The data holded by this structure is modified with the warping transformation and rendered in the ContourWarpEffect class.


Constructor & Destructor Documentation

CVertexGrid::CVertexGrid ( )
 

Initializes the pointers to NULL and sets the grid resolution to 0.

CVertexGrid::CVertexGrid ( VECTOR3D vTopLeft,
VECTOR3D vTopRight,
VECTOR3D vBottomLeft,
int numCols,
int numRows )
 

Creates the field by calling SetGridData(VECTOR3D,VECTOR3D,VECTOR3D,int,int)

CVertexGrid::~CVertexGrid ( )
 

Deallocates all memory needed.


Member Function Documentation

bool CVertexGrid::SetGridData ( VECTOR3D vTopLeft,
VECTOR3D vTopRight,
VECTOR3D vBottomLeft,
int numCols,
int numRows )
 

This method initializes a rectangular vertex grid in 3D-space.

Parameters:
vTopLeft   The top left vertex of the grid
vTopRight   The top right vertex of the grid
vBottomLeft   The bottom left vertex of the grid
numCols   number of columns in grid
numRows   number of rows in grid

Returns:
false if there isn't enough memory it fails, true otherwise.

void CVertexGrid::ResetVertices ( )
 

This is achieved by copying the backup array to the vertex array

VECTOR3D & CVertexGrid::Vector ( int index ) [inline]
 

Parameters:
index   The index of the vertex in the vertex grid
Returns:
a reference to the coordinates

float * CVertexGrid::TexCoord ( int index ) [inline]
 

Parameters:
index   The index of the vertex in the vertex grid
Returns:
a pointer to the texture coordinates

VECTOR3D & CVertexGrid::Vector ( int x,
int y ) [inline]
 

Parameters:
x   Column of the vertex in the vertex grid
y   Row of the vertex in the vertex grid
Returns:
a pointer to the coordinates

float * CVertexGrid::TexCoord ( int x,
int y ) [inline]
 

Parameters:
x   Column of the vertex in the vertex grid
y   Row of the vertex in the vertex grid
Returns:
a pointer to the texture coordinates

float & CVertexGrid::TexCoord ( int x,
int y,
int index ) [inline]
 

Parameters:
x   Column of the vertex in the vertex grid
y   Row of the vertex in the vertex grid
index   specifies whether the s or t texcoord is returned.
Returns:
the texture coordinate


Member Data Documentation

VECTOR3D * CVertexGrid::m_pInitVertices [private]
 

In order to accelerate the resetting of the vertices this vertex array stores the initial positions of the vertices.

float * CVertexGrid::m_pTexCoords [private]
 

This information is only used for rendering.


The documentation for this class was generated from the following file:
Generated at Fri Apr 19 16:53:06 2002 for GLFramework by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001