IvfTexture.h

00001 //
00002 // Copyright 1999-2006 by Structural Mechanics, Lund University.
00003 //
00004 // This library is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU Library General Public
00006 // License as published by the Free Software Foundation; either
00007 // version 2 of the License, or (at your option) any later version.
00008 //
00009 // This library is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 // Library General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU Library General Public
00015 // License along with this library; if not, write to the Free Software
00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00017 // USA.
00018 //
00019 // Please report all bugs and problems to "ivf@byggmek.lth.se".
00020 //
00021 //
00022 // Written by Jonas Lindemann
00023 //
00024 
00025 #ifndef _CIvfTexture_h_
00026 #define _CIvfTexture_h_
00027 
00028 #include <ivf/IvfObject.h>
00029 #include <ivf/IvfImage.h>
00030 
00031 IvfSmartPointer(CIvfTexture);
00032 
00062 class IVF_API CIvfTexture : public CIvfObject {
00063 public:
00065         CIvfTexture ();
00066 
00068         virtual ~CIvfTexture ();
00069 
00070         IvfClassInfo("CIvfTexture",CIvfObject);
00071 
00080         void setTextureEnvColor(float red, float green, float blue, float alfa);
00081 
00090         void setEnvColor(float red, float green, float blue, float alfa);
00091 
00093         void getTextureEnvColor(float &red, float &green, float &blue, float &alfa);
00094 
00096         void getEnvColor(float &red, float &green, float &blue, float &alfa);
00097 
00099         void setGenerateMipmaps(bool flag);
00100 
00108         void setTextureMode(GLenum mode);
00109 
00117         void setMode(GLenum mode);
00118 
00132         void setFilters(GLenum minFilter, GLenum magFilter);
00133 
00144         void setTextureRepeat(GLenum repeatS, GLenum repeatT);
00145 
00156         void setRepeat(GLenum repeatS, GLenum repeatT);
00157 
00164         void setTextureModifier(double scaleX, double scaleY, double rotate);
00165 
00172         void setModifier(double scaleX, double scaleY, double rotate);
00173 
00180         void setTextureTranslate(double x, double y);
00181 
00188         void setTranslate(double x, double y);
00189 
00196         void setImage(CIvfImage* image);
00197         
00204         void setImageMap(void* imageMap);
00205 
00212         void setSize(int width, int height);
00213 
00215         void getSize(int &width, int &height);
00216 
00218         bool isBound();
00219 
00227         void apply();
00228 
00235         void bind();
00236 
00244         GLuint getName();
00245 
00252         void setLoadImages(bool flag);
00253 
00261         void setGenerateName(bool flag);
00262 
00269         void setName(GLuint name);
00270 
00277         void activate();
00278 
00285         void deactivate();
00286 
00288         bool isActive();
00289 
00290 private:
00291         GLenum m_wrapT;
00292         GLenum m_wrapS;
00293         GLenum m_textureMode;
00294         GLenum m_magFilter;
00295         GLenum m_minFilter;
00296         GLuint m_textureName;
00297         float m_textureEnvColor[4];
00298         bool m_generateMipmaps;
00299         bool m_bound;
00300         bool m_generateName;
00301         bool m_loadImages;
00302         CIvfImagePtr m_ivfImage;
00303         void* m_imageMap;
00304         int m_width;
00305         int m_height;
00306         double m_texScaleX;
00307         double m_texScaleY;
00308         double m_texRotate;
00309         double m_texTransX;
00310         double m_texTransY;
00311         bool m_active;
00312 };
00317 #endif

Generated on Fri Sep 1 15:36:46 2006 for Interactive Visualisation Framework - Ivf++ by  doxygen 1.4.6-NO