arbeit
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

rawPrim.h

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////////////////
00002 // 6/7/02       Aaron Lefohn    Scientific Computing and Imaging Institute
00003 // School of Computing          University of Utah
00004 //
00005 //  This library is free software; you can redistribute it and/or
00006 //  modify it under the terms of the GNU Lesser General Public
00007 //  License as published by the Free Software Foundation; either
00008 //  version 2.1 of the License, or (at your option) any later version.
00009 //
00010 //  This library is distributed in the hope that it will be useful,
00011 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 //  Lesser General Public License for more details.
00014 //
00015 //  You should have received a copy of the GNU Lesser General Public
00016 //  License along with this library; if not, write to the Free Software
00017 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 
00019 #if !defined(AFX_IMMEDIATEPRIM_H__1A931B0A_E8EE_4052_A04B_56E41640C78A__INCLUDED_)
00020 #define AFX_IMMEDIATEPRIM_H__1A931B0A_E8EE_4052_A04B_56E41640C78A__INCLUDED_
00021 
00022 #if _MSC_VER > 1000
00023 #pragma once
00024 #endif // _MSC_VER > 1000
00025 
00026 #include "drawableGLI.h"
00027 #include "../texCoordGen/texCoordGen.h"
00028 #include <arrayGutz.h>
00029 #include <mathGutz.h>
00030 
00031 namespace glift {
00032 
00033 class Shader;
00034 class SinglePrim;
00035 
00036 /// Typedefs
00037 typedef std::vector<SinglePrim*>                        VecSinglePrimP;
00038 typedef std::vector<gutz::arrayo1ui*>   MultiPrimIndices;
00039 
00040 
00041 class _export_ RawPrim : public DrawableGLI
00042 {
00043 public:
00044    virtual ~RawPrim() = 0;
00045 
00046    /// The handler function. Redefine if primitive should generate texture coordinates
00047    virtual MultiPrimTexCoord* genTexCoords( const Shader* shader );
00048 
00049    /// Texture coordinate interface
00050    virtual bool hasTexCoords() const = 0;
00051    virtual void bindTexCoords( const MultiPrimTexCoord* texCoords ) = 0;
00052    virtual void bindTexCoords( const MultiTexCoord* texCoords ) = 0;
00053    virtual void releaseTexCoords() = 0;
00054 
00055    /// Vertex indices interface
00056    virtual void bindIndices( const MultiPrimIndices* indices ) = 0;
00057    virtual void bindIndices( const gutz::arrayw1ui* indices ) = 0; 
00058    virtual void releaseIndices() = 0;
00059 
00060 protected:
00061    virtual void drawDef() = 0;
00062 };
00063 
00064 class _export_ SinglePrim : public RawPrim
00065 {
00066 public: 
00067    virtual ~SinglePrim();
00068 
00069    virtual MultiPrimTexCoord* genTexCoords( const Shader* shader );
00070 
00071    /// Acessors
00072    virtual const gutz::arrayo2f&  texCoord() const = 0;
00073    virtual const gutz::arrayo2f&  texCoord(int texUnit) const = 0;
00074    virtual int                             numVerts() const = 0;
00075    virtual const gutz::vec3f&      scale() const = 0;
00076 
00077 protected:      
00078    /// DrawableGLI interface
00079    virtual void drawDef() = 0;
00080 
00081 };
00082 
00083 } /// End of class namespace glift
00084 
00085 #endif /// !defined(AFX_IMMEDIATEPRIM_H__1A931B0A_E8EE_4052_A04B_56E41640C78A__INCLUDED_)

Send questions, comments, and bug reports to:
jmk