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

texCoordGen.h

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////////////////
00002 // 6/29/02      Aaron Lefohn    Scientific Computing and Imaging Institute
00003 // School of Computing          University of Utah
00004 //////////////////////////////////////////////////////////////////////
00005 //
00006 // MultiTexCoordGen - A "mixin" interface that specifies texture coordinate 
00007 //                                        generation for Multiple texture units.
00008 //                                                
00009 // TexCoordGen - Functor Interface that specifies texture coordinate 
00010 //                               generation for a Single texture unit. 
00011 // 
00012 //////////////////////////////////////////////////////////////////////
00013 
00014 #ifndef GLIFT_MULTI_TEX_COORD_GEN
00015 #define GLIFT_MULTI_TEX_COORD_GEN
00016 
00017 #include "../core/gliftObject.h"
00018 #include "../util/gliftDecl.h"
00019 #include <mathGutz.h>
00020 #include <arrayGutz.h>
00021 
00022 #include <vector>
00023 
00024 namespace glift {
00025 
00026 typedef std::vector<gutz::arrayw2f>     Vecarrayw2f;
00027 typedef std::vector<gutz::arrayo2f> MultiTexCoord;
00028 typedef std::vector<MultiTexCoord*> MultiPrimTexCoord;
00029 
00030 class _export_ MultiTexCoordGen
00031 {
00032 public:
00033         virtual MultiTexCoord* genTexCoords( const gutz::arrayw2f& rawTexCoord, const gutz::vec3f& primScale ) const = 0;
00034 };
00035 
00036 class _export_ TexCoordGen : public GliftObject
00037 {
00038 public:
00039         virtual ~TexCoordGen() {}
00040 
00041         /// Generate tex-coords from scratch with no vertex info
00042         virtual gutz::arrayo2f operator()() = 0;                                         
00043 
00044         /// Usage 1: Generate tex-coords from scratch based on vertices and dimensions of primitive
00045         /// Usage 2: Perturb existing texture coordinates.
00046         /// Default implementation returns empty gutz::arrayo2f
00047         virtual gutz::arrayo2f operator()( const gutz::arrayw2f& coords, const gutz::vec3f& dimen ); 
00048         
00049         /// Alternate interface
00050         gutz::arrayo2f genTexCoords() { return (*this)(); }
00051         gutz::arrayo2f genTexCoords( const gutz::arrayw2f coords, const gutz::vec3f& dimen ) { return (*this)(coords, dimen); }
00052 };
00053 
00054 } /// End of namespace glift
00055 
00056 #endif

Send questions, comments, and bug reports to:
jmk