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

sglIndexedGeoSet.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: sglIndexedGeoSet.hpp
00021  *  Created: 12 August 1997
00022  *  Summary: Approximates a pfGeoSet which contains geometry data and index
00023  *         : arrays for all indexed geosets, and pointers to the graphics state
00024  *         : associated with it (sglGeoState).
00025  *****************************************************************************/
00026 
00027 #ifndef __SGL_INDEXED_GEOSET_HPP
00028 #define __SGL_INDEXED_GEOSET_HPP
00029 
00030 #include <sgl.h>
00031 #include <sglGeoSet.hpp>
00032 
00033 //============================================================================
00034 
00100 class SGL_DLL_API sglIndexedGeoSet : public sglGeoSet
00101 {
00102 public:
00104    sglIndexedGeoSet();
00106    virtual ~sglIndexedGeoSet();
00107 
00109    void setCoordIndexList(sglIndexType *alist)
00110       { setCoordIndexList(new sglNoRefDataPtr(alist)); }
00111 
00125    void setCoordIndexList(sglDataPtr *data,
00126                           int offset = 0,
00127                           int stride = 0);
00128 
00130    void setNormalIndexList(sglIndexType *alist)
00131       { setNormalIndexList(new sglNoRefDataPtr(alist)); }
00132 
00146    void setNormalIndexList(sglDataPtr *data,
00147                            int offset = 0,
00148                            int stride = 0);
00149 
00151    void setTexCoordIndexList(sglIndexType *alist)
00152       { setTexCoordIndexList(new sglNoRefDataPtr(alist)); }
00153 
00167    void setTexCoordIndexList(sglDataPtr *data,
00168                              int offset = 0,
00169                              int stride = 0);
00170 
00172    void setColorIndexList(sglIndexType *alist)
00173       { setColorIndexList(new sglNoRefDataPtr(alist)); }
00174 
00188    void setColorIndexList(sglDataPtr *data,
00189                           int offset = 0,
00190                           int stride = 0);
00191 
00193    sglDataPtr *getCoordIndexList() const {return m_vindex.getDataPtr();}
00195    sglDataPtr *getNormalIndexList() const {return m_nindex.getDataPtr();}
00197    sglDataPtr *getTexCoordIndexList() const {return m_tindex.getDataPtr();}
00199    sglDataPtr *getColorIndexList() const {return m_cindex.getDataPtr();}
00200 
00202    int getCoordIndexOffset() const { return m_vindex.getOffset(); }
00204    int getNormalIndexOffset() const { return m_nindex.getOffset(); }
00206    int getTexCoordIndexOffset() const { return m_tindex.getOffset(); }
00208    int getColorIndexOffset() const { return m_cindex.getOffset(); }
00209 
00211    int getCoordIndexStride() const { return m_vindex.getStride(); }
00213    int getNormalIndexStride() const { return m_nindex.getStride(); }
00215    int getTexCoordIndexStride() const { return m_tindex.getStride(); }
00217    int getColorIndexStride() const { return m_cindex.getStride(); }
00218 
00219 protected:
00220    virtual bool computeBounds();
00221 
00222 private:  // not implemented
00223    sglIndexedGeoSet(const sglIndexedGeoSet &);
00224    sglIndexedGeoSet &operator=(const sglIndexedGeoSet &);
00225 
00226 protected:
00227    sglIndexPtr m_vindex; // List of coordinate indexes
00228    sglIndexPtr m_nindex; // List of normal indexes
00229    sglIndexPtr m_tindex; // List of texture coordinate indexes
00230    sglIndexPtr m_cindex; // List of color indexes
00231 };
00232 
00233 #endif

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