GLC_Texture Class Reference

GLC_Texture : Image texture. More...

#include <glc_texture.h>

List of all members.

Public Member Functions

Constructor / Destructor

 GLC_Texture (const QGLContext *)
 Default constructor.
 GLC_Texture (const QGLContext *, const QString &)
 Constructor with fileName.
 GLC_Texture (const QGLContext *, const QFile &)
 Constructor with QFile.
 GLC_Texture (const QGLContext *, const QImage &, const QString &fileName=QString())
 Constructor with QImage.
 GLC_Texture (const GLC_Texture &TextureToCopy)
 Copy constructor.
GLC_Textureoperator= (const GLC_Texture &)
 Overload "=" operator.
virtual ~GLC_Texture ()
 Default Destructor.
OpenGL Functions

void glLoadTexture (void)
 Load the texture.
void glcBindTexture (void)
 Bind texture in 2D mode.

Static Public Member Functions

Set Functions

static void setMaxTextureSize (const QSize &)

Private Member Functions

Private services functions

QImage loadFromFile (const QString &fileName)
 Load the image of this texture from the given fileName and return resutling image.

Private Attributes

QGLContext * m_pQGLContext
 OpenGL Context.
QString m_FileName
 Texture Name.
GLuint m_GlTextureID
 OpenGL Texture ID.
QImage m_textureImage
 QImage off the texture.
QSize m_TextureSize
 Size of the texture.
bool m_HasAlphaChannel
 Flag to know if the texture has alpha channel.

Static Private Attributes

static QSize m_MaxTextureSize
 Static member used to check texture size.
static const QSize m_MinTextureSize

Get Functions



QGLContext * context () const
 Return the QGLContext of the texture.
QString fileName () const
 Return the texture File Name.
GLuint GL_ID () const
 Return OpenGL Texture Id.
bool isLoaded () const
 Return true if the texture is loaded.
QSize size () const
 Return the texture size.
bool operator== (const GLC_Texture &) const
 Return true if texture are the same.
bool hasAlphaChannel () const
 Return true if the texture has alpha channel.
QImage imageOfTexture () const
 Return the an image of the texture.
static QSize maxSize ()
 Return the maximum texture size.

Detailed Description

GLC_Texture : Image texture.

Image texture define a texture map in 2 D coordinate system

Definition at line 43 of file glc_texture.h.


Constructor & Destructor Documentation

GLC_Texture::GLC_Texture ( const QGLContext *  pContext  ) 

Default constructor.

Definition at line 48 of file glc_texture.cpp.

GLC_Texture::GLC_Texture ( const QGLContext *  pContext,
const QString &  Filename 
)

Constructor with fileName.

Definition at line 60 of file glc_texture.cpp.

References m_FileName, and m_textureImage.

GLC_Texture::GLC_Texture ( const QGLContext *  pContext,
const QFile &  file 
)

Constructor with QFile.

Definition at line 78 of file glc_texture.cpp.

References m_FileName, and m_textureImage.

GLC_Texture::GLC_Texture ( const QGLContext *  pContext,
const QImage &  image,
const QString &  fileName = QString() 
)

Constructor with QImage.

Definition at line 98 of file glc_texture.cpp.

References m_textureImage.

GLC_Texture::GLC_Texture ( const GLC_Texture TextureToCopy  ) 

Copy constructor.

Definition at line 109 of file glc_texture.cpp.

References m_FileName, and m_textureImage.

GLC_Texture::~GLC_Texture (  )  [virtual]

Default Destructor.

Definition at line 149 of file glc_texture.cpp.

References m_GlTextureID, and m_pQGLContext.


Member Function Documentation

QGLContext* GLC_Texture::context (  )  const [inline]

Return the QGLContext of the texture.

Definition at line 79 of file glc_texture.h.

Referenced by operator>>().

QString GLC_Texture::fileName (  )  const [inline]
GLuint GLC_Texture::GL_ID (  )  const [inline]

Return OpenGL Texture Id.

Definition at line 87 of file glc_texture.h.

Referenced by GLC_Material::textureID().

void GLC_Texture::glcBindTexture ( void   ) 

Bind texture in 2D mode.

Definition at line 235 of file glc_texture.cpp.

References glLoadTexture(), and m_GlTextureID.

Referenced by GLC_Material::glExecute().

void GLC_Texture::glLoadTexture ( void   ) 

Load the texture.

Definition at line 199 of file glc_texture.cpp.

References m_GlTextureID, m_MaxTextureSize, m_pQGLContext, m_textureImage, and m_TextureSize.

Referenced by glcBindTexture(), and GLC_Material::glLoadTexture().

bool GLC_Texture::hasAlphaChannel (  )  const [inline]

Return true if the texture has alpha channel.

Definition at line 106 of file glc_texture.h.

QImage GLC_Texture::imageOfTexture (  )  const [inline]

Return the an image of the texture.

Definition at line 110 of file glc_texture.h.

Referenced by GLC_ImagePlane::GLC_ImagePlane(), and GLC_WorldTo3dxml::writeImageFileIn3dxml().

bool GLC_Texture::isLoaded (  )  const [inline]

Return true if the texture is loaded.

Definition at line 91 of file glc_texture.h.

Referenced by GLC_Material::textureIsLoaded().

QImage GLC_Texture::loadFromFile ( const QString &  fileName  )  [private]

Load the image of this texture from the given fileName and return resutling image.

Definition at line 246 of file glc_texture.cpp.

References glc::archiveEntryFileName(), glc::archiveFileName(), and glc::isArchiveString().

static QSize GLC_Texture::maxSize (  )  [inline, static]

Return the maximum texture size.

Definition at line 99 of file glc_texture.h.

GLC_Texture & GLC_Texture::operator= ( const GLC_Texture texture  ) 

Overload "=" operator.

Definition at line 128 of file glc_texture.cpp.

References m_FileName, m_GlTextureID, m_HasAlphaChannel, m_pQGLContext, m_textureImage, and m_TextureSize.

bool GLC_Texture::operator== ( const GLC_Texture texture  )  const

Return true if texture are the same.

Definition at line 163 of file glc_texture.cpp.

References m_FileName, and m_textureImage.

void GLC_Texture::setMaxTextureSize ( const QSize &  size  )  [static]

Definition at line 182 of file glc_texture.cpp.

References m_MaxTextureSize, and m_MinTextureSize.

Referenced by GLC_ImagePlane::GLC_ImagePlane().

QSize GLC_Texture::size (  )  const [inline]

Return the texture size.

Definition at line 95 of file glc_texture.h.


Member Data Documentation

QString GLC_Texture::m_FileName [private]

Texture Name.

Definition at line 155 of file glc_texture.h.

Referenced by GLC_Texture(), operator=(), and operator==().

GLuint GLC_Texture::m_GlTextureID [private]

OpenGL Texture ID.

Definition at line 158 of file glc_texture.h.

Referenced by glcBindTexture(), glLoadTexture(), operator=(), and ~GLC_Texture().

Flag to know if the texture has alpha channel.

Definition at line 167 of file glc_texture.h.

Referenced by operator=().

QSize GLC_Texture::m_MaxTextureSize [static, private]

Static member used to check texture size.

Definition at line 170 of file glc_texture.h.

Referenced by glLoadTexture(), and setMaxTextureSize().

const QSize GLC_Texture::m_MinTextureSize [static, private]

Definition at line 171 of file glc_texture.h.

Referenced by setMaxTextureSize().

QGLContext* GLC_Texture::m_pQGLContext [private]

OpenGL Context.

Definition at line 152 of file glc_texture.h.

Referenced by glLoadTexture(), operator=(), and ~GLC_Texture().

QImage GLC_Texture::m_textureImage [private]

QImage off the texture.

Definition at line 161 of file glc_texture.h.

Referenced by GLC_Texture(), glLoadTexture(), operator=(), and operator==().

QSize GLC_Texture::m_TextureSize [private]

Size of the texture.

Definition at line 164 of file glc_texture.h.

Referenced by glLoadTexture(), and operator=().


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

SourceForge.net Logo

©2005 Laurent Ribon