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

sglMonoIndexedGeoSet.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: sglMonoIndexedGeoSet.hpp
00021  *  Created: 28 August 1999
00022  *  Summary: GeoSet where vertex data is indexed via a single index list.
00023  *****************************************************************************/
00024 
00025 #ifndef __SGL_MONO_INDEXED_GEOSET_HPP
00026 #define __SGL_MONO_INDEXED_GEOSET_HPP
00027 
00028 #include <sgl.h>
00029 #include <sglGeoSet.hpp>
00030 
00031 #include <vector>
00032 
00033 //============================================================================
00034 
00092 class SGL_DLL_API sglMonoIndexedGeoSet : public sglGeoSet
00093 {
00094 public:
00096    sglMonoIndexedGeoSet();
00098    virtual ~sglMonoIndexedGeoSet();
00099 
00101    void setIndexList(sglIndexType *alist)
00102       { setIndexList(new sglNoRefDataPtr(alist)); }
00103 
00117    void setIndexList(sglDataPtr *data,
00118                      int offset = 0,
00119                      int stride = 0);
00120 
00122    sglDataPtr *getIndexList() const {return m_index.getDataPtr();}
00123 
00125    int getIndexOffset() const { return m_index.getOffset(); }
00126 
00128    int getIndexStride() const { return m_index.getStride(); }
00129 
00134    void setDisablePrefetch(bool val);
00136    bool getDisablePrefetch() {return m_disable_prefetch;}
00137 
00138 protected:
00139    virtual bool computeBounds();
00140    virtual void computeNoBounds();
00141    virtual void updateDrawFunc();
00142 
00143 private: // not implemented
00144    sglMonoIndexedGeoSet(const sglMonoIndexedGeoSet &);
00145    sglMonoIndexedGeoSet &operator=(const sglMonoIndexedGeoSet &);
00146 
00147    void drawVT(const vector<sglTexCoords> &tex_coords) const;
00148    void drawVNoT(const vector<sglTexCoords> &tex_coords) const;
00149    void drawVNpT(const vector<sglTexCoords> &tex_coords) const;
00150    void drawVNvT(const vector<sglTexCoords> &tex_coords) const;
00151    void drawVCoT(const vector<sglTexCoords> &tex_coords) const;
00152    void drawVCoNoT(const vector<sglTexCoords> &tex_coords) const;
00153    void drawVCoNpT(const vector<sglTexCoords> &tex_coords) const;
00154    void drawVCoNvT(const vector<sglTexCoords> &tex_coords) const;
00155    void drawVCpT(const vector<sglTexCoords> &tex_coords) const;
00156    void drawVCpNoT(const vector<sglTexCoords> &tex_coords) const;
00157    void drawVCpNpT(const vector<sglTexCoords> &tex_coords) const;
00158    void drawVCpNvT(const vector<sglTexCoords> &tex_coords) const;
00159    void drawVCvT(const vector<sglTexCoords> &tex_coords) const;
00160    void drawVCvNoT(const vector<sglTexCoords> &tex_coords) const;
00161    void drawVCvNpT(const vector<sglTexCoords> &tex_coords) const;
00162    void drawVCvNvT(const vector<sglTexCoords> &tex_coords) const;
00163 
00164 #ifndef SGL_NO_VERTEX_ARRAYS
00165    void drawVTm(const vector<sglTexCoords> &tex_coords) const;
00166    void drawVNoTm(const vector<sglTexCoords> &tex_coords) const;
00167    void drawVNpTm(const vector<sglTexCoords> &tex_coords) const;
00168    void drawVNvTm(const vector<sglTexCoords> &tex_coords) const;
00169    void drawVCoTm(const vector<sglTexCoords> &tex_coords) const;
00170    void drawVCoNoTm(const vector<sglTexCoords> &tex_coords) const;
00171    void drawVCoNpTm(const vector<sglTexCoords> &tex_coords) const;
00172    void drawVCoNvTm(const vector<sglTexCoords> &tex_coords) const;
00173    void drawVCpTm(const vector<sglTexCoords> &tex_coords) const;
00174    void drawVCpNoTm(const vector<sglTexCoords> &tex_coords) const;
00175    void drawVCpNpTm(const vector<sglTexCoords> &tex_coords) const;
00176    void drawVCpNvTm(const vector<sglTexCoords> &tex_coords) const;
00177    void drawVCvTm(const vector<sglTexCoords> &tex_coords) const;
00178    void drawVCvNoTm(const vector<sglTexCoords> &tex_coords) const;
00179    void drawVCvNpTm(const vector<sglTexCoords> &tex_coords) const;
00180    void drawVCvNvTm(const vector<sglTexCoords> &tex_coords) const;
00181 
00182    void drawPrefetchVT(const vector<sglTexCoords> &tex_coords) const;
00183    void drawPrefetchVNoT(const vector<sglTexCoords> &tex_coords) const;
00184    void drawPrefetchVNvT(const vector<sglTexCoords> &tex_coords) const;
00185    void drawPrefetchVCoT(const vector<sglTexCoords> &tex_coords) const;
00186    void drawPrefetchVCoNoT(const vector<sglTexCoords> &tex_coords) const;
00187    void drawPrefetchVCoNvT(const vector<sglTexCoords> &tex_coords) const;
00188    void drawPrefetchVCvT(const vector<sglTexCoords> &tex_coords) const;
00189    void drawPrefetchVCvNoT(const vector<sglTexCoords> &tex_coords) const;
00190    void drawPrefetchVCvNvT(const vector<sglTexCoords> &tex_coords) const;
00191 
00192    void drawPrefetchVTm(const vector<sglTexCoords> &tex_coords) const;
00193    void drawPrefetchVNoTm(const vector<sglTexCoords> &tex_coords) const;
00194    void drawPrefetchVNvTm(const vector<sglTexCoords> &tex_coords) const;
00195    void drawPrefetchVCoTm(const vector<sglTexCoords> &tex_coords) const;
00196    void drawPrefetchVCoNoTm(const vector<sglTexCoords> &tex_coords) const;
00197    void drawPrefetchVCoNvTm(const vector<sglTexCoords> &tex_coords) const;
00198    void drawPrefetchVCvTm(const vector<sglTexCoords> &tex_coords) const;
00199    void drawPrefetchVCvNoTm(const vector<sglTexCoords> &tex_coords) const;
00200    void drawPrefetchVCvNvTm(const vector<sglTexCoords> &tex_coords) const;
00201 #endif
00202 
00203    class Initializer;
00204    friend class Initializer;
00205    static void setupFuncTable();
00206 
00207 protected:
00208    sglIndexPtr     m_index;    // List of indexes
00209    bool            m_disable_prefetch;
00210 
00211 #ifndef SGL_NO_VERTEX_ARRAYS
00212    vector<sglIndexType>  m_index_min;
00213    vector<sglIndexType>  m_index_max;
00214 #endif
00215 
00216 private:
00217    static DrawFunc s_func_table[(ePREFETCH|eMULTI_TEXTURE|eCOLORS|eNORMALS)+1];
00218    static Initializer sInitializer;
00219 };
00220 
00221 #endif

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