Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

sglTexGen.hpp

00001 /*****************************************************************************
00002  * SGL: A Scene Graph Library
00003  *
00004  * Copyright (C) 1997-2001  Scott McMillan   All Rights Reserved.
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Library General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Library General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Library General Public
00017  * License along with this library; if not, write to the Free
00018  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00019  *****************************************************************************
00020  *     File: sglTexGen.hpp
00021  *  Created: 2 May 1999
00022  *  Summary: create, modify, and query texture coordinate generator
00023  *****************************************************************************/
00024 
00025 #ifndef __SGL_TEXGEN_HPP
00026 #define __SGL_TEXGEN_HPP
00027 
00028 #include <sgl.h>
00029 #include <sglStatelet.hpp>
00030 #include <sglVector.hpp>
00031 
00032 //============================================================================
00033 
00074 class SGL_DLL_API sglTexGen : public sglTexturingStatelet
00075 {
00076 public:
00078    enum TexCoordEnum
00079    {
00081       eS = GL_S,
00082 
00084       eT = GL_T,
00085 
00087       eR = GL_R,
00088 
00090       eQ = GL_Q
00091    };
00092 
00094    enum ModeEnum
00095    {
00097       eOFF = -1,
00098 
00100       eOBJECT_LINEAR = GL_OBJECT_LINEAR,
00101 
00103       eEYE_LINEAR = GL_EYE_LINEAR,
00104 
00106       eSPHERE_MAP = GL_SPHERE_MAP,
00107 
00109       eREFLECTION_MAP = GL_REFLECTION_MAP_ARB,
00110 
00112       eNORMAL_MAP = GL_NORMAL_MAP_ARB
00113    };
00114 
00115 public:
00117    sglTexGen();
00118 
00120    virtual ~sglTexGen();
00121 
00128    void setMode(TexCoordEnum coord, ModeEnum mode);
00129 
00135    ModeEnum getMode(TexCoordEnum coord) const;
00136 
00148    void setPlane(TexCoordEnum coord,
00149                  float x, float y, float z, float w);
00150 
00158    void getPlane(TexCoordEnum coord,
00159                  float &x, float &y, float &z, float &w) const;
00160 
00161    // See sglTexturingStatelet::applyToUnit() for details.
00162    void applyToUnit(sglCurrState*, unsigned int) const;
00163 
00164    // See sglStatelet::getSorted() for details.
00165    virtual bool getSorted() const { return true; }
00166 
00167    // See sglObject::printInfo() for details.
00168    virtual void printInfo(ostream &ostrm, const char *indent_string) const;
00169 
00170 private:
00171    sglTexGen(const sglTexGen &); // not implemented
00172    sglTexGen &operator=(const sglTexGen &); // not implemented
00173 
00174    void setIndex();
00175 
00176 private:
00177    ModeEnum m_mode[4];
00178    sglVec4f m_plane[4];
00179 };
00180 
00181 #endif

Generated at Mon Jul 1 18:00:06 2002 for SGL by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001