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

sglIndexedGeoStripSet.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: sglIndexedGeoStripSet.hpp
00021  *  Created: 28 August 1999
00022  *  Summary: GeoSet where vertex data is indexed via a single index list.
00023  *****************************************************************************/
00024 
00025 #ifndef __SGL_INDEXED_GEO_STRIP_SET_HPP
00026 #define __SGL_INDEXED_GEO_STRIP_SET_HPP
00027 
00028 #include <sgl.h>
00029 #include <sglIndexedGeoSet.hpp>
00030 
00031 //============================================================================
00032 
00088 class SGL_DLL_API sglIndexedGeoStripSet : public sglIndexedGeoSet
00089 {
00090 public:
00092    sglIndexedGeoStripSet();
00094    virtual ~sglIndexedGeoStripSet();
00095 
00097    virtual unsigned int getPrimSize() const {return 0;}
00098 
00100    sglDataPtr *getPrimLengths() const {return m_lengths.getDataPtr();}
00101 
00103    void setPrimLengths(sglIndexType *alist)
00104       { setPrimLengths(new sglNoRefDataPtr(alist)); }
00105 
00118    void setPrimLengths(sglDataPtr *data,
00119                        int offset = 0,
00120                        int stride = 0);
00121 
00123    int getPrimLengthsOffset() const { return m_lengths.getOffset(); }
00124 
00126    int getPrimLengthsStride() const { return m_lengths.getStride(); }
00127 
00129    virtual void addStats(sglStats &stats) const;
00130 
00131 protected:
00132    virtual bool computeBounds();
00133    virtual void updateDrawFunc();
00134 
00135 private: // not implemented
00136    sglIndexedGeoStripSet(const sglIndexedGeoStripSet &);
00137    sglIndexedGeoStripSet &operator=(const sglIndexedGeoStripSet &);
00138 
00139    void drawVT(const vector<sglTexCoords> &tex_coords) const;
00140    void drawVNoT(const vector<sglTexCoords> &tex_coords) const;
00141    void drawVNpT(const vector<sglTexCoords> &tex_coords) const;
00142    void drawVNvT(const vector<sglTexCoords> &tex_coords) const;
00143    void drawVCoT(const vector<sglTexCoords> &tex_coords) const;
00144    void drawVCoNoT(const vector<sglTexCoords> &tex_coords) const;
00145    void drawVCoNpT(const vector<sglTexCoords> &tex_coords) const;
00146    void drawVCoNvT(const vector<sglTexCoords> &tex_coords) const;
00147    void drawVCpT(const vector<sglTexCoords> &tex_coords) const;
00148    void drawVCpNoT(const vector<sglTexCoords> &tex_coords) const;
00149    void drawVCpNpT(const vector<sglTexCoords> &tex_coords) const;
00150    void drawVCpNvT(const vector<sglTexCoords> &tex_coords) const;
00151    void drawVCvT(const vector<sglTexCoords> &tex_coords) const;
00152    void drawVCvNoT(const vector<sglTexCoords> &tex_coords) const;
00153    void drawVCvNpT(const vector<sglTexCoords> &tex_coords) const;
00154    void drawVCvNvT(const vector<sglTexCoords> &tex_coords) const;
00155 
00156    class Initializer;
00157    friend class Initializer;
00158    static void setupFuncTable();
00159 
00160 protected:
00161    sglIndexPtr m_lengths; // List of strip lengths
00162 
00163 private:
00164    static DrawFunc s_func_table[(eCOLORS|eNORMALS)+1];
00165    static Initializer sInitializer;
00166 };
00167 
00168 #endif

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