random_racer::MeshBeautifier Class Reference

This class is used in the VRSTerrainLoader to generate texture coordinates and colors for every vertex of the mesh. More...

#include <MeshBeautifier.h>

Inheritance diagram for random_racer::MeshBeautifier:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 MeshBeautifier (VRSTerrainLoader *loader, int minHeight, int maxHeight)
 Ctor.
virtual ~MeshBeautifier ()
 Dtor.
template<class ITER, class COLORV, class TEXV>
void generateColorsAndTexCoords (const ITER &begin, const ITER &end, TEXV *textureVector, COLORV *colorVector, const VRS::Vector &translation)
 Does what this class is intended to do.
void initializeSceneThing (VRS::SO< VRS::SceneThing > thing)
 Initializes a SceneThing with textures, materials, etc.

Private Member Functions

unsigned int calculateAbsHeight (int minHeight, int maxHeight)
 Calculate the Absolute Height of the Terrain depending on the given Min.
void terLoadTextureCommand (const std::string &string)
 A Console Command to change the Texture instant.

Private Attributes

VRS::SO< VRS::Image > m_gradientImage
 Stores the Gradient Image, necessary to get the color for the vertices.
VRS::SO< VRS::Texture2DGL > m_texture
 Stores the Textures.
VRS::SO< VRS::Texture2DGL > m_textureTemp
 To change between two textures we need a another variable to swap the texture.
VRS::SO< VRS::SceneThing > m_thing
 Stores the SceneThing to change the texture.
VRS::SO< VRS::FaceStyle > m_faceStyle
 Stores the FaceStyle.
VRSTerrainLoaderm_loader
 Stores the Pointer to the Loader, to change the color and texture instant.
unsigned int m_imageGradientWidth
 Stores the Gradient Width and Stores the Absolute Height of the Terrain.
unsigned int m_absHeight
int m_minHeight
 Stores the Min.
int m_maxHeight
bool m_newTexture
 newTexture: true if we want to change the texture debug: true if we just want see the geometry (no texture and color) removed: true if we removed the texture from the Scenegraph grid: true if we want just see the mesh grid
bool m_debug
bool m_removed
bool m_grid

Detailed Description

This class is used in the VRSTerrainLoader to generate texture coordinates and colors for every vertex of the mesh.

Definition at line 24 of file MeshBeautifier.h.


Constructor & Destructor Documentation

random_racer::MeshBeautifier::MeshBeautifier ( VRSTerrainLoader loader,
int  minHeight,
int  maxHeight 
)

Ctor.

Definition at line 26 of file MeshBeautifier.cpp.

References calculateAbsHeight(), random_racer::Console::get(), random_racer::ResourceManager::get(), m_absHeight, m_debug, m_faceStyle, m_gradientImage, m_grid, m_imageGradientWidth, m_loader, m_maxHeight, m_minHeight, m_newTexture, m_removed, m_texture, m_textureTemp, and terLoadTextureCommand().

Here is the call graph for this function:

random_racer::MeshBeautifier::~MeshBeautifier (  )  [virtual]

Dtor.

Definition at line 65 of file MeshBeautifier.cpp.


Member Function Documentation

unsigned int random_racer::MeshBeautifier::calculateAbsHeight ( int  minHeight,
int  maxHeight 
) [private]

Calculate the Absolute Height of the Terrain depending on the given Min.

and Max. Height

Definition at line 70 of file MeshBeautifier.cpp.

Referenced by MeshBeautifier().

Here is the caller graph for this function:

void random_racer::MeshBeautifier::terLoadTextureCommand ( const std::string &  string  )  [private]

A Console Command to change the Texture instant.

As parameter use the the name of the texture to show the texture with its gradient or debug to just see the geometry. The texture have to be in the jpg format and the name of the gradient have to be in this structure: gradient_textureName.rgb

Definition at line 97 of file MeshBeautifier.cpp.

References random_racer::VRSTerrainLoader::beautifyMesh(), random_racer::ResourceManager::get(), random_racer::Console::get(), m_debug, m_gradientImage, m_grid, m_imageGradientWidth, m_loader, m_newTexture, m_removed, and m_textureTemp.

Referenced by MeshBeautifier().

Here is the call graph for this function:

Here is the caller graph for this function:

template<class ITER, class COLORV, class TEXV>
void random_racer::MeshBeautifier::generateColorsAndTexCoords ( const ITER &  begin,
const ITER &  end,
TEXV *  textureVector,
COLORV *  colorVector,
const VRS::Vector &  translation 
)

Does what this class is intended to do.

(Read the class description)

void random_racer::MeshBeautifier::initializeSceneThing ( VRS::SO< VRS::SceneThing >  thing  ) 

Initializes a SceneThing with textures, materials, etc.


Member Data Documentation

VRS::SO<VRS::Image> random_racer::MeshBeautifier::m_gradientImage [private]

Stores the Gradient Image, necessary to get the color for the vertices.

Definition at line 29 of file MeshBeautifier.h.

Referenced by MeshBeautifier(), and terLoadTextureCommand().

VRS::SO<VRS::Texture2DGL> random_racer::MeshBeautifier::m_texture [private]

Stores the Textures.

Definition at line 34 of file MeshBeautifier.h.

Referenced by MeshBeautifier().

VRS::SO<VRS::Texture2DGL> random_racer::MeshBeautifier::m_textureTemp [private]

To change between two textures we need a another variable to swap the texture.

Definition at line 40 of file MeshBeautifier.h.

Referenced by MeshBeautifier(), and terLoadTextureCommand().

VRS::SO<VRS::SceneThing> random_racer::MeshBeautifier::m_thing [private]

Stores the SceneThing to change the texture.

Definition at line 45 of file MeshBeautifier.h.

VRS::SO<VRS::FaceStyle> random_racer::MeshBeautifier::m_faceStyle [private]

Stores the FaceStyle.

Definition at line 50 of file MeshBeautifier.h.

Referenced by MeshBeautifier().

VRSTerrainLoader* random_racer::MeshBeautifier::m_loader [private]

Stores the Pointer to the Loader, to change the color and texture instant.

Definition at line 56 of file MeshBeautifier.h.

Referenced by MeshBeautifier(), and terLoadTextureCommand().

unsigned int random_racer::MeshBeautifier::m_imageGradientWidth [private]

Stores the Gradient Width and Stores the Absolute Height of the Terrain.

Definition at line 61 of file MeshBeautifier.h.

Referenced by MeshBeautifier(), and terLoadTextureCommand().

unsigned int random_racer::MeshBeautifier::m_absHeight [private]

Definition at line 61 of file MeshBeautifier.h.

Referenced by MeshBeautifier().

int random_racer::MeshBeautifier::m_minHeight [private]

Stores the Min.

and Max. Height of the Terrain

Definition at line 66 of file MeshBeautifier.h.

Referenced by MeshBeautifier().

int random_racer::MeshBeautifier::m_maxHeight [private]

Definition at line 66 of file MeshBeautifier.h.

Referenced by MeshBeautifier().

bool random_racer::MeshBeautifier::m_newTexture [private]

newTexture: true if we want to change the texture debug: true if we just want see the geometry (no texture and color) removed: true if we removed the texture from the Scenegraph grid: true if we want just see the mesh grid

Definition at line 74 of file MeshBeautifier.h.

Referenced by MeshBeautifier(), and terLoadTextureCommand().

bool random_racer::MeshBeautifier::m_debug [private]

Definition at line 74 of file MeshBeautifier.h.

Referenced by MeshBeautifier(), and terLoadTextureCommand().

bool random_racer::MeshBeautifier::m_removed [private]

Definition at line 74 of file MeshBeautifier.h.

Referenced by MeshBeautifier(), and terLoadTextureCommand().

bool random_racer::MeshBeautifier::m_grid [private]

Definition at line 74 of file MeshBeautifier.h.

Referenced by MeshBeautifier(), and terLoadTextureCommand().


The documentation for this class was generated from the following files:
Generated on Fri May 11 21:02:10 2007 for Random Racer by  doxygen 1.5.1