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

sglGeoStripSet.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: sglGeoStripSet.hpp
00021  *  Created: 28 August 1999
00022  *  Summary: Subclass of geoset that has primitives of varying lengths.
00023  *****************************************************************************/
00024 
00025 #ifndef __SGL_GEO_STRIP_SET_HPP
00026 #define __SGL_GEO_STRIP_SET_HPP
00027 
00028 #include <sgl.h>
00029 #include <sglGeoSet.hpp>
00030 
00031 //============================================================================
00032 
00089 class SGL_DLL_API sglGeoStripSet : public sglGeoSet
00090 {
00091 public:
00093    sglGeoStripSet();
00095    virtual ~sglGeoStripSet();
00096 
00098    virtual unsigned int getPrimSize() const {return 0;}
00099 
00101    sglDataPtr *getPrimLengths() const {return m_lengths.getDataPtr();}
00102 
00104    void setPrimLengths(sglIndexType *alist)
00105       { setPrimLengths(new sglNoRefDataPtr(alist)); }
00106 
00119    void setPrimLengths(sglDataPtr *data,
00120                        int offset = 0,
00121                        int stride = 0);
00122 
00124    int getPrimLengthsOffset() const { return m_lengths.getOffset(); }
00125 
00127    int getPrimLengthsStride() const { return m_lengths.getStride(); }
00128 
00130    virtual void addStats(sglStats &stats) const;
00131 
00132 protected:
00133    virtual bool computeBounds();
00134    virtual void updateDrawFunc();
00135 
00136 private:  // not implemented
00137    sglGeoStripSet(const sglGeoStripSet &);
00138    sglGeoStripSet &operator=(const sglGeoStripSet &);
00139 
00140    void drawVT(const vector<sglTexCoords> &tex_coords) const;
00141    void drawVNoT(const vector<sglTexCoords> &tex_coords) const;
00142    void drawVNpT(const vector<sglTexCoords> &tex_coords) const;
00143    void drawVNvT(const vector<sglTexCoords> &tex_coords) const;
00144    void drawVCoT(const vector<sglTexCoords> &tex_coords) const;
00145    void drawVCoNoT(const vector<sglTexCoords> &tex_coords) const;
00146    void drawVCoNpT(const vector<sglTexCoords> &tex_coords) const;
00147    void drawVCoNvT(const vector<sglTexCoords> &tex_coords) const;
00148    void drawVCpT(const vector<sglTexCoords> &tex_coords) const;
00149    void drawVCpNoT(const vector<sglTexCoords> &tex_coords) const;
00150    void drawVCpNpT(const vector<sglTexCoords> &tex_coords) const;
00151    void drawVCpNvT(const vector<sglTexCoords> &tex_coords) const;
00152    void drawVCvT(const vector<sglTexCoords> &tex_coords) const;
00153    void drawVCvNoT(const vector<sglTexCoords> &tex_coords) const;
00154    void drawVCvNpT(const vector<sglTexCoords> &tex_coords) const;
00155    void drawVCvNvT(const vector<sglTexCoords> &tex_coords) const;
00156 
00157 #ifndef SGL_NO_VERTEX_ARRAYS
00158    void drawVTm(const vector<sglTexCoords> &tex_coords) const;
00159    void drawVNoTm(const vector<sglTexCoords> &tex_coords) const;
00160    void drawVNpTm(const vector<sglTexCoords> &tex_coords) const;
00161    void drawVNvTm(const vector<sglTexCoords> &tex_coords) const;
00162    void drawVCoTm(const vector<sglTexCoords> &tex_coords) const;
00163    void drawVCoNoTm(const vector<sglTexCoords> &tex_coords) const;
00164    void drawVCoNpTm(const vector<sglTexCoords> &tex_coords) const;
00165    void drawVCoNvTm(const vector<sglTexCoords> &tex_coords) const;
00166    void drawVCpTm(const vector<sglTexCoords> &tex_coords) const;
00167    void drawVCpNoTm(const vector<sglTexCoords> &tex_coords) const;
00168    void drawVCpNpTm(const vector<sglTexCoords> &tex_coords) const;
00169    void drawVCpNvTm(const vector<sglTexCoords> &tex_coords) const;
00170    void drawVCvTm(const vector<sglTexCoords> &tex_coords) const;
00171    void drawVCvNoTm(const vector<sglTexCoords> &tex_coords) const;
00172    void drawVCvNpTm(const vector<sglTexCoords> &tex_coords) const;
00173    void drawVCvNvTm(const vector<sglTexCoords> &tex_coords) const;
00174 #endif
00175 
00176    class Initializer;
00177    friend class Initializer;
00178    static void setupFuncTable();
00179 
00180 protected:
00181    sglIndexPtr m_lengths;    // List of strip lengths
00182 
00183 private:
00184    static DrawFunc s_func_table[(eMULTI_TEXTURE|eCOLORS|eNORMALS)+1];
00185    static Initializer sInitializer;
00186 };
00187 
00188 #endif

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