FVVLib  1.0.0 beta 4
Public Member Functions
FVVMeshData Class Reference

Interface to access indexed indexed triangle set mesh data. More...

List of all members.

Public Member Functions

virtual int GetNumberOfVertices () const =0
 Get the number of vertices in the vertex array. This is also equal to the number of normals.
virtual int GetNumberOfTriangleIndices () const =0
 Get the number of indices in the triangle index array.
virtual const float * GetVertexArray () const =0
 Get the array of vertices.
virtual const float * GetNormalArray () const =0
 Get the array of normals.
virtual const int * GetTriangleIndexArray () const =0
 Get the array of triangle indices.
virtual ~FVVMeshData ()

Detailed Description

Interface to access indexed indexed triangle set mesh data.

Vector_Normal_Face.png
Figure 1. The diagram of vertex array and normal array.


If N is the number of vertices as retrieved by GetNumberOfVertices(), the vertex and normal arrays will have 3xN elements.
To access the Nth vertex or normal: vertexArray[ 3 x N ] or normalArray[ 3 x N ].
The data in the vertex and normal arrays is indexed in the same way, i.e. the vertex indexed by vertexArray[ 3 x N ] has the corresponding normal normalArray[ 3 x N ].
The x, y, and z values can be index by vertexArray[ 3 x N ], vertexArray[ 3 x N + 1 ], and vertexArray[ 3 x N + 2 ] respectively.


Constructor & Destructor Documentation

virtual ~FVVMeshData ( ) [virtual]

Member Function Documentation

int GetNumberOfVertices ( ) const [pure virtual]

Get the number of vertices in the vertex array. This is also equal to the number of normals.

Returns:
The number of vertices.
int GetNumberOfTriangleIndices ( ) const [pure virtual]

Get the number of indices in the triangle index array.

Returns:
The number of triangle indices.
const float * GetVertexArray ( ) const [pure virtual]

Get the array of vertices.

A vertex has 3 components (x, y, z).
The size of the vertex array is: GetNumberOfVertices() * 3.

Returns:
Pointer to the first element in the vertex array.
const float * GetNormalArray ( ) const [pure virtual]

Get the array of normals.

A normal has 3 components (nx, ny, nz).
The size of the normal array is: GetNumberOfVertices() * 3.

Returns:
Pointer to the first element in the normal array.
const int * GetTriangleIndexArray ( ) const [pure virtual]

Get the array of triangle indices.

An index has three components (v1, v2, v3).
The size of the index array is: GetNumberOfTriangleIndices() * 3.

Returns:
Pointer to the first element in the triangle index array.