My Project
Loading...
Searching...
No Matches
chai3d::cNormalMap Class Reference

This class implements a normal map. More...

#include <CNormalMap.h>

Inheritance diagram for chai3d::cNormalMap:

Public Member Functions

 cNormalMap ()
 Constructor of cNormalMap.
 
virtual ~cNormalMap ()
 Destructor of cNormalMap.
 
virtual std::string getClassName ()
 This method returns the name of the object class.
 
cNormalMapPtr copy ()
 This method creates a copy of itself.
 
virtual void createMap (cTexture1dPtr a_texture)
 This method creates a normal map from a texture object.
 
virtual void createMap (cImagePtr a_image)
 This method creates a normal map from an image object.
 
void flip (const bool a_flipU, const bool a_flipV)
 This method flips normals along U and/or V axis.
 
- Public Member Functions inherited from chai3d::cTexture2d
 cTexture2d ()
 Constructor of cTexture2d.
 
virtual ~cTexture2d ()
 Destructor of cTexture2d.
 
cTexture2dPtr copy ()
 This method creates a copy of itself.
 
virtual void renderInitialize (cRenderOptions &a_options)
 This method enables texturing and sets this texture as the current texture.
 
virtual void renderFinalize (cRenderOptions &a_options)
 This method disable texture once triangles have been rendered.
 
virtual void setWrapModeT (const GLint &a_wrapModeT)
 This method set the texture wrap mode of t.
 
GLint getWrapModeT () const
 This method returns the texture wrap mode of t.
 
- Public Member Functions inherited from chai3d::cTexture1d
 cTexture1d ()
 Constructor of cTexture1d.
 
virtual ~cTexture1d ()
 Destructor of cTexture1d.
 
void setTextureUnit (const GLenum a_textureUnit)
 This method set the texture unit where a_textureUnit is GL_TEXTUREi_ARB, where 0i<GL_MAX_TEXTURE_UNITS_ARB.
 
GLenum getTextureUnit () const
 This method returns the texture unit value.
 
void setTextureId (const GLuint a_textureId)
 This method sets the texture ID.
 
GLuint getTextureId ()
 This method returns the texture ID.
 
cTexture1dPtr copy ()
 This method creates a copy of itself.
 
virtual bool loadFromFile (const std::string &a_fileName)
 This method load a texture image from a file.
 
virtual bool saveToFile (const std::string &a_fileName)
 This method save a texture image to a file.
 
virtual void markForUpdate ()
 This method marks this texture for GPU update.
 
virtual void markForDeleteAndUpdate ()
 This method marks this texture for GPU deletion and reinitialization.
 
void setEnvironmentMode (const GLint &a_environmentMode)
 This method sets the environment mode (GL_MODULATE, GL_DECAL, GL_BLEND, GL_REPLACE).
 
GLint getEnvironmentMode ()
 This method returns the environment mode status.
 
virtual void setWrapModeS (const GLint &a_wrapModeS)
 This method set the texture wrap mode of s.
 
GLint getWrapModeS () const
 This method returns the texture wrap mode of s.
 
void setMagFunction (const GLint a_magFunction)
 This method sets the magnification function value.
 
GLint getMagFunction () const
 This method returns the current magnification function value.
 
void setMinFunction (const GLint a_minFunction)
 This method sets the minification function value.
 
GLint getMinFunction () const
 This method returns the current minification function value.
 
void setSphericalMappingEnabled (const bool a_enabled)
 This method enables of disables the spherical mapping mode.
 
bool getSphericalMappingEnabled () const
 This method returns thestatus of the spherical mapping mode.
 
void setUseMipmaps (bool a_useMipmaps)
 This method enables or disables the use of mipmaps.
 
bool getUseMipmaps ()
 This returns the the status of mipmaps.
 
bool setImage (cImagePtr a_image)
 This method assigns an image to this texture.
 
- Public Member Functions inherited from chai3d::cGenericTexture
 cGenericTexture ()
 Constructor of cGenericTexture.
 
virtual ~cGenericTexture ()
 Destructor of cGenericTexture.
 
void setEnabled (bool a_enabled)
 This method enables or disables texture mapping.
 
bool getEnabled () const
 This method returns true if the texture map is enabled, false otherwise.
 
- Public Member Functions inherited from chai3d::cGenericType
 cGenericType ()
 Constructor of cGenericType.
 
virtual ~cGenericType ()
 Destructor of cGenericType.
 
virtual int getObjectCounter ()
 This method return the value of the object counter.
 

Static Public Member Functions

static cNormalMapPtr create ()
 Shared cNormalMap allocator.
 
- Static Public Member Functions inherited from chai3d::cTexture2d
static cTexture2dPtr create ()
 Shared cTexture2d allocator.
 
- Static Public Member Functions inherited from chai3d::cTexture1d
static cTexture1dPtr create ()
 Shared cTexture1d allocator.
 
- Static Public Member Functions inherited from chai3d::cGenericTexture
static cGenericTexturePtr create ()
 Shared cGenericTexture allocator.
 

Additional Inherited Members

- Public Attributes inherited from chai3d::cTexture1d
cImagePtr m_image
 Image object associated with texture (use this to get data about the texture itself).
 
cColorf m_color
 Environmental color.
 
- Public Attributes inherited from chai3d::cGenericType
std::string m_name
 Object name.
 
std::string m_filename
 Object filename.
 
void * m_userPtr
 This pointer can be used for any user purpose.
 
int m_userIndex
 This integer can be used for any user purpose.
 
- Protected Member Functions inherited from chai3d::cTexture2d
virtual void reset ()
 This method resets all internal variables. This function should be called only by constructors.
 
virtual void update (cRenderOptions &a_options)
 This method updates this texture to GPU.
 
- Protected Attributes inherited from chai3d::cTexture2d
GLint m_wrapModeT
 Texture wrap parameter along t (GL_REPEAT or GL_CLAMP).
 
- Protected Attributes inherited from chai3d::cTexture1d
bool m_deleteTextureFlag
 If true, texture bitmap needs to be deleted from GPU memory.
 
bool m_updateTextureFlag
 If true, texture bitmap needs to be updated to GPU memory.
 
GLuint m_textureID
 OpenGL texture ID number.
 
GLint m_wrapModeS
 Texture wrap parameter along s (GL_REPEAT or GL_CLAMP).
 
GLint m_magFunction
 Texture magnification function value. (GL_NEAREST or GL_LINEAR).
 
GLint m_minFunction
 Texture minification function value. (GL_NEAREST or GL_LINEAR).
 
bool m_useMipmaps
 If true, mipmaps are enabled.
 
bool m_useSphericalMapping
 If true, spherical mapping is enable.
 
GLint m_environmentMode
 OpenGL texture mode (GL_MODULATE, GL_DECAL, GL_BLEND, or GL_REPLACE).
 
GLenum m_textureUnit
 Texture unit number.
 
GLint m_magFunctionMipmapsOFF
 Texture magnification function when mipmapping is OFF.
 
GLint m_minFunctionMipmapsOFF
 Texture minification function when mipmapping is OFF.
 
GLint m_magFunctionMipmapsON
 Texture magnification function when mipmapping is ON.
 
GLint m_minFunctionMipmapsON
 Texture minification function when mipmapping is ON.
 
- Protected Attributes inherited from chai3d::cGenericTexture
bool m_enabled
 If true, this texture is enabled, false otherwise.
 
std::string m_name
 Texture name.
 
std::string m_filename
 Texture filename.
 
- Static Protected Attributes inherited from chai3d::cGenericType
static int s_objectCounter = 0
 Static class counter.
 

Detailed Description

This class implements a normal map which is used for haptic and graphic bump mapping rendering.

Constructor & Destructor Documentation

◆ cNormalMap()

chai3d::cNormalMap::cNormalMap ( )

Constructor of cNormalMap.

◆ ~cNormalMap()

chai3d::cNormalMap::~cNormalMap ( )
virtual

Destructor of cNormalMap.

Member Function Documentation

◆ create()

static cNormalMapPtr chai3d::cNormalMap::create ( )
inlinestatic

◆ getClassName()

virtual std::string chai3d::cNormalMap::getClassName ( )
inlinevirtual

Reimplemented from chai3d::cTexture2d.

◆ copy()

cNormalMapPtr chai3d::cNormalMap::copy ( )

This method creates a copy of itself.

Returns
Pointer to new object.

◆ createMap() [1/2]

void chai3d::cNormalMap::createMap ( cTexture1dPtr  a_texture)
virtual

This method creates a normal map from a image texture. The image gradient data is computed using the gray-scale level of each pixel.

Parameters
a_textureInput image.

◆ createMap() [2/2]

void chai3d::cNormalMap::createMap ( cImagePtr  a_image)
virtual

This method creates a normal map from a 2D image texture. The image gradient is computed using the gray-scale level of each pixel.

Parameters
a_imageInput image.

◆ flip()

void chai3d::cNormalMap::flip ( const bool  a_flipU,
const bool  a_flipV 
)

This method flips normals along the U and/or V axis.

Parameters
a_flipUIf true, normal texture is flipped along U axis.
a_flipVIf true, normal texture is flipped along V axis.

The documentation for this class was generated from the following files: