Visualization Library

A lightweight C++ OpenGL middleware for 2D/3D graphics
[Home] [Tutorials] [All Classes] [Grouped Classes]

X:/dropbox/visualizationlibrary/src/vlGraphics/Array.hpp

Go to the documentation of this file.
00001 /**************************************************************************************/
00002 /*                                                                                    */
00003 /*  Visualization Library                                                             */
00004 /*  http://www.visualizationlibrary.org                                               */
00005 /*                                                                                    */
00006 /*  Copyright (c) 2005-2010, Michele Bosi                                             */
00007 /*  All rights reserved.                                                              */
00008 /*                                                                                    */
00009 /*  Redistribution and use in source and binary forms, with or without modification,  */
00010 /*  are permitted provided that the following conditions are met:                     */
00011 /*                                                                                    */
00012 /*  - Redistributions of source code must retain the above copyright notice, this     */
00013 /*  list of conditions and the following disclaimer.                                  */
00014 /*                                                                                    */
00015 /*  - Redistributions in binary form must reproduce the above copyright notice, this  */
00016 /*  list of conditions and the following disclaimer in the documentation and/or       */
00017 /*  other materials provided with the distribution.                                   */
00018 /*                                                                                    */
00019 /*  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND   */
00020 /*  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED     */
00021 /*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE            */
00022 /*  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR  */
00023 /*  ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES    */
00024 /*  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;      */
00025 /*  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON    */
00026 /*  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT           */
00027 /*  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS     */
00028 /*  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.                      */
00029 /*                                                                                    */
00030 /**************************************************************************************/
00031 
00032 #ifndef Array_INCLUDE_ONCE
00033 #define Array_INCLUDE_ONCE
00034 
00035 #include <vlGraphics/BufferObject.hpp>
00036 #include <vlCore/half.hpp>
00037 #include <vector>
00038 
00039 namespace vl
00040 {
00041 //-----------------------------------------------------------------------------
00042 // ArrayAbstract
00043 //-----------------------------------------------------------------------------
00058   class ArrayAbstract: public Object
00059   {
00060     VL_INSTRUMENT_ABSTRACT_CLASS(vl::ArrayAbstract, Object)
00061 
00062   public:
00064     ArrayAbstract()
00065     { 
00066       VL_DEBUG_SET_OBJECT_NAME()
00067       mBufferObject = new BufferObject;
00068       mBufferObjectDirty = true;
00069       mBufferObjectUsage = vl::BU_STATIC_DRAW;
00070     }
00071 
00073     ArrayAbstract(const ArrayAbstract& other): Object(other) 
00074     {
00075       VL_DEBUG_SET_OBJECT_NAME()
00076       mBufferObject = new BufferObject;
00077       mBufferObjectDirty = true;
00078       mBufferObjectUsage = vl::BU_STATIC_DRAW;
00079       operator=(other);
00080     }
00081 
00083     void operator=(const ArrayAbstract& other) 
00084     {
00085       bufferObject()->resize( other.bufferObject()->bytesUsed() );
00086       memcpy( ptr(), other.ptr(), bytesUsed() );
00087     }
00088 
00089     virtual ref<ArrayAbstract> clone() const = 0;
00090 
00091     const BufferObject* bufferObject() const { return mBufferObject.get(); }
00092     BufferObject* bufferObject() { return mBufferObject.get(); }
00093 
00094     void clear() { if (bufferObject()) bufferObject()->clear(); }
00095 
00097     const unsigned char* ptr() const { return bufferObject() ? bufferObject()->ptr() : NULL; }
00098 
00100     unsigned char* ptr() { return bufferObject() ? bufferObject()->ptr() : NULL; }
00101 
00103     virtual size_t bytesUsed() const { return bufferObject() ? bufferObject()->bytesUsed() : 0; }
00104 
00106     virtual size_t glSize() const = 0;
00107 
00109     virtual GLenum glType() const = 0;
00110 
00112     virtual size_t size() const = 0;
00113 
00115     virtual Sphere computeBoundingSphere() const = 0;
00116 
00118     virtual AABB computeBoundingBox() const = 0;
00119 
00121     virtual void transform(const mat4& m) = 0;
00122 
00124     virtual void normalize() = 0;
00125 
00127     virtual vec4 getAsVec4(size_t vector_index) const = 0;
00128 
00130     virtual vec3 getAsVec3(size_t vector_index) const = 0;
00131 
00133     virtual vec2 getAsVec2(size_t vector_index) const = 0;
00134 
00136     virtual int compare(int a, int b) const = 0;
00137 
00139     bool isBufferObjectDirty() const { return mBufferObjectDirty; }
00140 
00142     void setBufferObjectDirty(bool dirty=true) { mBufferObjectDirty = dirty; }
00143 
00145     EBufferObjectUsage usage() const { return mBufferObjectUsage; }
00146 
00148     void setUsage(EBufferObjectUsage usage) { mBufferObjectUsage = usage; }
00149 
00152     void updateBufferObject(EBufferObjectUpdateMode mode = BUM_KeepRamBuffer)
00153     {
00154       bufferObject()->setBufferData(usage(), (mode & BUF_DiscardRamBuffer) !=  0);
00155       setBufferObjectDirty(false);
00156     }
00157 
00158   protected:
00159     ref<BufferObject> mBufferObject;
00160     EBufferObjectUsage mBufferObjectUsage;
00161     bool mBufferObjectDirty;
00162   };
00163 //-----------------------------------------------------------------------------
00164 // Array
00165 //-----------------------------------------------------------------------------
00184   template <typename T_VectorType, typename T_Scalar, size_t T_GL_Size, GLenum T_GL_Type>
00185   class Array: public ArrayAbstract
00186   {
00187     VL_INSTRUMENT_ABSTRACT_CLASS(vl::Array, ArrayAbstract)
00188 
00189   public:
00190     typedef T_Scalar scalar_type;
00191     typedef T_VectorType vector_type;
00192     static const size_t gl_size = T_GL_Size;
00193     static const GLenum gl_type = T_GL_Type;
00194 
00195     virtual size_t glSize() const { return T_GL_Size; }
00196 
00197     virtual GLenum glType() const { return T_GL_Type; }
00198 
00199     virtual size_t bytesPerVector() const { return sizeof(T_VectorType); }
00200 
00201     // ---
00202 
00203     void clear() { resize(0); bufferObject()->deleteBufferObject(); }
00204     
00205     void resize(size_t dim) { bufferObject()->resize(dim*bytesPerVector()); }
00206     
00207     size_t size() const { return bytesUsed() / bytesPerVector(); }
00208     
00209     size_t sizeBufferObject() const { return bufferObject() ? bufferObject()->byteCountBufferObject() / bytesPerVector() : 0; }
00210     
00211     size_t scalarCount() const { return size() * T_GL_Size; }
00212     
00213     size_t scalarCountBufferObject() const { return sizeBufferObject() * T_GL_Size; }
00214 
00215     // ---
00216 
00217     const T_VectorType* begin() const { return reinterpret_cast<const T_VectorType*>(ptr()); }
00218 
00219     T_VectorType* begin() { return reinterpret_cast<T_VectorType*>(ptr()); }
00220     
00221     const T_VectorType* end() const { return (reinterpret_cast<const T_VectorType*>(ptr()))+size(); }
00222 
00223     T_VectorType* end() { return (reinterpret_cast<T_VectorType*>(ptr()))+size(); }
00224 
00225     // ---
00226 
00227     T_VectorType& at(size_t i) { VL_CHECK(i<size()); return *(reinterpret_cast<T_VectorType*>(ptr())+i); }
00228 
00229     const T_VectorType& at(size_t i) const { VL_CHECK(i<size()); return *(reinterpret_cast<const T_VectorType*>(ptr())+i); }
00230 
00231     T_VectorType& operator[](size_t i) { return at(i); }
00232 
00233     const T_VectorType& operator[](size_t i) const { return at(i); }
00234 
00235     // ---
00236 
00237     virtual ref<ArrayAbstract> createArray() const { return new Array; }
00238 
00239     virtual ref<ArrayAbstract> clone() const
00240     {
00241       ref<Array> arr = createArray()->template as<Array>(); VL_CHECK(arr);
00242       if (size())
00243       {
00244         arr->resize(size());
00245         memcpy(arr->ptr(), ptr(), bytesUsed());
00246       }
00247       return arr;
00248     }
00249 
00250     // ---
00251 
00252     Sphere computeBoundingSphere() const
00253     {
00254       AABB aabb;
00255       const int count = T_GL_Size == 4 ? 3 : T_GL_Size;
00256       for(size_t i=0; i<size(); ++i)
00257       {
00258         vec3 v;
00259         const T_Scalar* pv = reinterpret_cast<const T_Scalar*>(&at(i));
00260         for( int j=0; j<count; ++j )
00261           v.ptr()[j] = (real)pv[j];
00262         aabb += v;
00263       }
00264       real radius = 0;
00265       vec3 center = aabb.center();
00266       for(size_t i=0; i<size(); ++i)
00267       {
00268         vec3 v;
00269         const T_Scalar* pv = reinterpret_cast<const T_Scalar*>(&at(i));
00270         for( int j=0; j<count; ++j )
00271           v.ptr()[j] = (real)pv[j];
00272         real r = (v-center).lengthSquared();
00273         if (r > radius)
00274           radius = r;
00275       }
00276       return Sphere( center, sqrt(radius) );
00277     }
00278 
00279     AABB computeBoundingBox() const
00280     { 
00281       AABB aabb;
00282       const int count = T_GL_Size == 4 ? 3 : T_GL_Size;
00283       for(size_t i=0; i<size(); ++i)
00284       {
00285         vec3 v;
00286         const T_Scalar* pv = reinterpret_cast<const T_Scalar*>(&at(i));
00287         for( int j=0; j<count; ++j )
00288           v.ptr()[j] = (real)pv[j];
00289         aabb += v;
00290       }
00291       return aabb;
00292     }
00293 
00294     void transform(const mat4& m)
00295     {
00296       for(size_t i=0; i<size(); ++i)
00297       {
00298         vec4 v(0,0,0,1);
00299         T_Scalar* pv = reinterpret_cast<T_Scalar*>(&at(i));
00300         // read
00301         for( size_t j=0; j<T_GL_Size; ++j )
00302           v.ptr()[j] = (real)pv[j];
00303         // transform
00304         v = m * v;
00305         // write
00306         for( size_t j=0; j<T_GL_Size; ++j )
00307           pv[j] = (T_Scalar)v.ptr()[j];
00308       }
00309     }
00310 
00311     void normalize()
00312     {
00313       for(size_t i=0; i<size(); ++i)
00314       {
00315         vec4 v(0,0,0,0);
00316         T_Scalar* pv = reinterpret_cast<T_Scalar*>(&at(i));
00317         // read
00318         for( size_t j=0; j<T_GL_Size; ++j )
00319           v.ptr()[j] = (real)pv[j];
00320         // normalize
00321         v.normalize();
00322         // write
00323         for( unsigned j=0; j<T_GL_Size; ++j )
00324           pv[j] = (T_Scalar)v.ptr()[j];
00325       }
00326     }
00327 
00328     vec4 getAsVec4(size_t vector_index) const
00329     {
00330       vec4 v(0,0,0,1);
00331       const T_Scalar* pv = reinterpret_cast<const T_Scalar*>(&at(vector_index));
00332       for( size_t j=0; j<T_GL_Size; ++j )
00333         v.ptr()[j] = (real)pv[j];
00334       return v;
00335     }
00336 
00337     vec3 getAsVec3(size_t vector_index) const
00338     {
00339       vec3 v;
00340       const T_Scalar* pv = reinterpret_cast<const T_Scalar*>(&at(vector_index));
00341       const int count = T_GL_Size <= 3 ? T_GL_Size : 3;
00342       for( int j=0; j<count; ++j )
00343         v.ptr()[j] = (real)pv[j];
00344       return v;
00345     }
00346 
00347     vec2 getAsVec2(size_t vector_index) const
00348     {
00349       vec2 v;
00350       const T_Scalar* pv = reinterpret_cast<const T_Scalar*>(&at(vector_index));
00351       const int count = T_GL_Size <= 2 ? T_GL_Size : 2;
00352       for( int j=0; j<count; ++j )
00353         v.ptr()[j] = (real)pv[j];
00354       return v;
00355     }
00356 
00357     int compare(int a, int b) const
00358     {
00359       const T_Scalar* pa = reinterpret_cast<const T_Scalar*>(&at(a));
00360       const T_Scalar* pb = reinterpret_cast<const T_Scalar*>(&at(b));
00361       for( size_t i=0; i<T_GL_Size; ++i )
00362         if ( pa[i] != pb[i] )
00363           return pa[i] < pb[i] ? -1 : +1;
00364       return 0;
00365     }
00366 
00367     void initFrom(const std::vector<T_VectorType>& vector)
00368     {
00369       resize(vector.size());
00370       if (vector.empty())
00371         return;
00372       else
00373         memcpy(ptr(),&vector[0],sizeof(vector[0])*vector.size());
00374     }
00375   };
00376 //-----------------------------------------------------------------------------
00377 // Array typedefs
00378 //-----------------------------------------------------------------------------
00379 
00380 
00382   class ArrayFloat1: public Array<GLfloat, GLfloat, 1, GL_FLOAT> { VL_INSTRUMENT_CLASS(vl::ArrayFloat1, VL_GROUP(Array<GLfloat, GLfloat, 1, GL_FLOAT>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayFloat1; } };
00384   class ArrayFloat2: public Array<fvec2,   GLfloat, 2, GL_FLOAT> { VL_INSTRUMENT_CLASS(vl::ArrayFloat2, VL_GROUP(Array<fvec2,   GLfloat, 2, GL_FLOAT>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayFloat2; } };
00386   class ArrayFloat3: public Array<fvec3,   GLfloat, 3, GL_FLOAT> { VL_INSTRUMENT_CLASS(vl::ArrayFloat3, VL_GROUP(Array<fvec3,   GLfloat, 3, GL_FLOAT>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayFloat3; } };
00388   class ArrayFloat4: public Array<fvec4,   GLfloat, 4, GL_FLOAT> { VL_INSTRUMENT_CLASS(vl::ArrayFloat4, VL_GROUP(Array<fvec4,   GLfloat, 4, GL_FLOAT>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayFloat4; } };
00389 
00391   class ArrayDouble1: public Array<GLdouble, GLdouble, 1, GL_DOUBLE> { VL_INSTRUMENT_CLASS(vl::ArrayDouble1, VL_GROUP(Array<GLdouble, GLdouble, 1, GL_DOUBLE>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayDouble1; } };
00393   class ArrayDouble2: public Array<dvec2,    GLdouble, 2, GL_DOUBLE> { VL_INSTRUMENT_CLASS(vl::ArrayDouble2, VL_GROUP(Array<dvec2,    GLdouble, 2, GL_DOUBLE>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayDouble2; } };
00395   class ArrayDouble3: public Array<dvec3,    GLdouble, 3, GL_DOUBLE> { VL_INSTRUMENT_CLASS(vl::ArrayDouble3, VL_GROUP(Array<dvec3,    GLdouble, 3, GL_DOUBLE>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayDouble3; } };
00397   class ArrayDouble4: public Array<dvec4,    GLdouble, 4, GL_DOUBLE> { VL_INSTRUMENT_CLASS(vl::ArrayDouble4, VL_GROUP(Array<dvec4,    GLdouble, 4, GL_DOUBLE>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayDouble4; } };
00398 
00400   class ArrayInt1: public Array<GLint, GLint, 1, GL_INT> { VL_INSTRUMENT_CLASS(vl::ArrayInt1, VL_GROUP(Array<GLint, GLint, 1, GL_INT>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayInt1; } };
00402   class ArrayInt2: public Array<ivec2, GLint, 2, GL_INT> { VL_INSTRUMENT_CLASS(vl::ArrayInt2, VL_GROUP(Array<ivec2, GLint, 2, GL_INT>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayInt2; } };
00404   class ArrayInt3: public Array<ivec3, GLint, 3, GL_INT> { VL_INSTRUMENT_CLASS(vl::ArrayInt3, VL_GROUP(Array<ivec3, GLint, 3, GL_INT>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayInt3; } };
00406   class ArrayInt4: public Array<ivec4, GLint, 4, GL_INT> { VL_INSTRUMENT_CLASS(vl::ArrayInt4, VL_GROUP(Array<ivec4, GLint, 4, GL_INT>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayInt4; } };
00407 
00409   class ArrayUInt1: public Array<GLuint,GLuint, 1, GL_UNSIGNED_INT> { VL_INSTRUMENT_CLASS(vl::ArrayUInt1, VL_GROUP(Array<GLuint,GLuint, 1, GL_UNSIGNED_INT>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayUInt1; } };
00411   class ArrayUInt2: public Array<uvec2, GLuint, 2, GL_UNSIGNED_INT> { VL_INSTRUMENT_CLASS(vl::ArrayUInt2, VL_GROUP(Array<uvec2, GLuint, 2, GL_UNSIGNED_INT>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayUInt2; } };
00413   class ArrayUInt3: public Array<uvec3, GLuint, 3, GL_UNSIGNED_INT> { VL_INSTRUMENT_CLASS(vl::ArrayUInt3, VL_GROUP(Array<uvec3, GLuint, 3, GL_UNSIGNED_INT>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayUInt3; } };
00415   class ArrayUInt4: public Array<uvec4, GLuint, 4, GL_UNSIGNED_INT> { VL_INSTRUMENT_CLASS(vl::ArrayUInt4, VL_GROUP(Array<uvec4, GLuint, 4, GL_UNSIGNED_INT>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayUInt4; } };
00416 
00418   class ArrayByte1: public Array<GLbyte, GLbyte, 1, GL_BYTE> { VL_INSTRUMENT_CLASS(vl::ArrayByte1, VL_GROUP(Array<GLbyte, GLbyte, 1, GL_BYTE>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayByte1; } };
00420   class ArrayByte2: public Array<bvec2,  GLbyte, 2, GL_BYTE> { VL_INSTRUMENT_CLASS(vl::ArrayByte2, VL_GROUP(Array<bvec2,  GLbyte, 2, GL_BYTE>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayByte2; } };
00422   class ArrayByte3: public Array<bvec3,  GLbyte, 3, GL_BYTE> { VL_INSTRUMENT_CLASS(vl::ArrayByte3, VL_GROUP(Array<bvec3,  GLbyte, 3, GL_BYTE>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayByte3; } };
00424   class ArrayByte4: public Array<bvec4,  GLbyte, 4, GL_BYTE> { VL_INSTRUMENT_CLASS(vl::ArrayByte4, VL_GROUP(Array<bvec4,  GLbyte, 4, GL_BYTE>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayByte4; } };
00425 
00427   class ArrayUByte1: public Array<GLubyte, GLubyte, 1, GL_UNSIGNED_BYTE> { VL_INSTRUMENT_CLASS(vl::ArrayUByte1, VL_GROUP(Array<GLubyte, GLubyte, 1, GL_UNSIGNED_BYTE>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayUByte1; } };
00429   class ArrayUByte2: public Array<ubvec2,  GLubyte, 2, GL_UNSIGNED_BYTE> { VL_INSTRUMENT_CLASS(vl::ArrayUByte2, VL_GROUP(Array<ubvec2,  GLubyte, 2, GL_UNSIGNED_BYTE>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayUByte2; } };
00431   class ArrayUByte3: public Array<ubvec3,  GLubyte, 3, GL_UNSIGNED_BYTE> { VL_INSTRUMENT_CLASS(vl::ArrayUByte3, VL_GROUP(Array<ubvec3,  GLubyte, 3, GL_UNSIGNED_BYTE>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayUByte3; } };
00433   class ArrayUByte4: public Array<ubvec4,  GLubyte, 4, GL_UNSIGNED_BYTE> { VL_INSTRUMENT_CLASS(vl::ArrayUByte4, VL_GROUP(Array<ubvec4,  GLubyte, 4, GL_UNSIGNED_BYTE>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayUByte4; } };
00434 
00436   class ArrayShort1: public Array<GLshort, GLshort, 1, GL_SHORT> { VL_INSTRUMENT_CLASS(vl::ArrayShort1, VL_GROUP(Array<GLshort, GLshort, 1, GL_SHORT>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayShort1; } };
00438   class ArrayShort2: public Array<svec2,   GLshort, 2, GL_SHORT> { VL_INSTRUMENT_CLASS(vl::ArrayShort2, VL_GROUP(Array<svec2,   GLshort, 2, GL_SHORT>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayShort2; } };
00440   class ArrayShort3: public Array<svec3,   GLshort, 3, GL_SHORT> { VL_INSTRUMENT_CLASS(vl::ArrayShort3, VL_GROUP(Array<svec3,   GLshort, 3, GL_SHORT>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayShort3; } };
00442   class ArrayShort4: public Array<svec4,   GLshort, 4, GL_SHORT> { VL_INSTRUMENT_CLASS(vl::ArrayShort4, VL_GROUP(Array<svec4,   GLshort, 4, GL_SHORT>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayShort4; } };
00443 
00445   class ArrayUShort1: public Array<GLushort, GLushort, 1, GL_UNSIGNED_SHORT> { VL_INSTRUMENT_CLASS(vl::ArrayUShort1, VL_GROUP(Array<GLushort, GLushort, 1, GL_UNSIGNED_SHORT>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayUShort1; } };
00447   class ArrayUShort2: public Array<usvec2,   GLushort, 2, GL_UNSIGNED_SHORT> { VL_INSTRUMENT_CLASS(vl::ArrayUShort2, VL_GROUP(Array<usvec2,   GLushort, 2, GL_UNSIGNED_SHORT>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayUShort2; } };
00449   class ArrayUShort3: public Array<usvec3,   GLushort, 3, GL_UNSIGNED_SHORT> { VL_INSTRUMENT_CLASS(vl::ArrayUShort3, VL_GROUP(Array<usvec3,   GLushort, 3, GL_UNSIGNED_SHORT>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayUShort3; } };
00451   class ArrayUShort4: public Array<usvec4,   GLushort, 4, GL_UNSIGNED_SHORT> { VL_INSTRUMENT_CLASS(vl::ArrayUShort4, VL_GROUP(Array<usvec4,   GLushort, 4, GL_UNSIGNED_SHORT>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayUShort4; } };
00452 
00454   class ArrayHFloat1: public Array<half,  half, 1, GL_HALF_FLOAT> { VL_INSTRUMENT_CLASS(vl::ArrayHFloat1, VL_GROUP(Array<half,  half, 1, GL_HALF_FLOAT>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayHFloat1; } };
00456   class ArrayHFloat2: public Array<hvec2, half, 2, GL_HALF_FLOAT> { VL_INSTRUMENT_CLASS(vl::ArrayHFloat2, VL_GROUP(Array<hvec2, half, 2, GL_HALF_FLOAT>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayHFloat2; } };
00458   class ArrayHFloat3: public Array<hvec3, half, 3, GL_HALF_FLOAT> { VL_INSTRUMENT_CLASS(vl::ArrayHFloat3, VL_GROUP(Array<hvec3, half, 3, GL_HALF_FLOAT>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayHFloat3; } };
00460   class ArrayHFloat4: public Array<hvec4, half, 4, GL_HALF_FLOAT> { VL_INSTRUMENT_CLASS(vl::ArrayHFloat4, VL_GROUP(Array<hvec4, half, 4, GL_HALF_FLOAT>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayHFloat4; } };
00461 
00463   class ArrayFixed1: public Array<GLuint,GLuint, 1, GL_FIXED> { VL_INSTRUMENT_CLASS(vl::ArrayFixed1, VL_GROUP(Array<GLuint,GLuint, 1, GL_FIXED>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayFixed1; } };
00465   class ArrayFixed2: public Array<uvec2, GLuint, 2, GL_FIXED> { VL_INSTRUMENT_CLASS(vl::ArrayFixed2, VL_GROUP(Array<uvec2, GLuint, 2, GL_FIXED>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayFixed2; } };
00467   class ArrayFixed3: public Array<uvec3, GLuint, 3, GL_FIXED> { VL_INSTRUMENT_CLASS(vl::ArrayFixed3, VL_GROUP(Array<uvec3, GLuint, 3, GL_FIXED>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayFixed3; } };
00469   class ArrayFixed4: public Array<uvec4, GLuint, 4, GL_FIXED> { VL_INSTRUMENT_CLASS(vl::ArrayFixed4, VL_GROUP(Array<uvec4, GLuint, 4, GL_FIXED>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayFixed4; } };
00470 
00472   class ArrayInt_2_10_10_10_REV1: public Array<GLint, GLint, 1, GL_INT_2_10_10_10_REV> { VL_INSTRUMENT_CLASS(vl::ArrayInt_2_10_10_10_REV1, VL_GROUP(Array<GLint, GLint, 1, GL_INT_2_10_10_10_REV>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayInt_2_10_10_10_REV1; } };
00474   class ArrayInt_2_10_10_10_REV2: public Array<ivec2, GLint, 2, GL_INT_2_10_10_10_REV> { VL_INSTRUMENT_CLASS(vl::ArrayInt_2_10_10_10_REV2, VL_GROUP(Array<ivec2, GLint, 2, GL_INT_2_10_10_10_REV>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayInt_2_10_10_10_REV2; } };
00476   class ArrayInt_2_10_10_10_REV3: public Array<ivec3, GLint, 3, GL_INT_2_10_10_10_REV> { VL_INSTRUMENT_CLASS(vl::ArrayInt_2_10_10_10_REV3, VL_GROUP(Array<ivec3, GLint, 3, GL_INT_2_10_10_10_REV>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayInt_2_10_10_10_REV3; } };
00478   class ArrayInt_2_10_10_10_REV4: public Array<ivec4, GLint, 4, GL_INT_2_10_10_10_REV> { VL_INSTRUMENT_CLASS(vl::ArrayInt_2_10_10_10_REV4, VL_GROUP(Array<ivec4, GLint, 4, GL_INT_2_10_10_10_REV>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayInt_2_10_10_10_REV4; } };
00479 
00481   class ArrayUInt_2_10_10_10_REV1: public Array<GLuint,GLuint, 1, GL_UNSIGNED_INT_2_10_10_10_REV> { VL_INSTRUMENT_CLASS(vl::ArrayUInt_2_10_10_10_REV1, VL_GROUP(Array<GLuint,GLuint, 1, GL_UNSIGNED_INT_2_10_10_10_REV>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayUInt_2_10_10_10_REV1; } };
00483   class ArrayUInt_2_10_10_10_REV2: public Array<uvec2, GLuint, 2, GL_UNSIGNED_INT_2_10_10_10_REV> { VL_INSTRUMENT_CLASS(vl::ArrayUInt_2_10_10_10_REV2, VL_GROUP(Array<uvec2, GLuint, 2, GL_UNSIGNED_INT_2_10_10_10_REV>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayUInt_2_10_10_10_REV2; } };
00485   class ArrayUInt_2_10_10_10_REV3: public Array<uvec3, GLuint, 3, GL_UNSIGNED_INT_2_10_10_10_REV> { VL_INSTRUMENT_CLASS(vl::ArrayUInt_2_10_10_10_REV3, VL_GROUP(Array<uvec3, GLuint, 3, GL_UNSIGNED_INT_2_10_10_10_REV>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayUInt_2_10_10_10_REV3; } };
00487   class ArrayUInt_2_10_10_10_REV4: public Array<uvec4, GLuint, 4, GL_UNSIGNED_INT_2_10_10_10_REV> { VL_INSTRUMENT_CLASS(vl::ArrayUInt_2_10_10_10_REV4, VL_GROUP(Array<uvec4, GLuint, 4, GL_UNSIGNED_INT_2_10_10_10_REV>)) virtual ref<ArrayAbstract> createArray() const { return new ArrayUInt_2_10_10_10_REV4; } };
00488 }
00489 
00490 #endif

Visualization Library 2011.09.1160 Reference Documentation
Copyright 2005-2011 Michele Bosi. All rights reserved.
Updated on Thu May 2 2013 13:40:35.
Permission is granted to use this page to write and publish articles regarding Visualization Library.