# Visualization Library

A lightweight C++ OpenGL middleware for 2D/3D graphics

[Home] [Tutorials] [All Classes] [Grouped Classes]

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

# D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/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       operator=(other);
    00076     }
    00078     void operator=(const ArrayAbstract& other)
    00079     {
    00080       bufferObject()->resize( other.bufferObject()->bytesUsed() );
    00081       memcpy( ptr(), other.ptr(), bytesUsed() );
    00082     }
    00083
    00084     virtual ref<ArrayAbstract> clone() const = 0;
    00085
    00086     const BufferObject* bufferObject() const { return mBufferObject.get(); }
    00087     BufferObject* bufferObject() { return mBufferObject.get(); }
    00088
    00089     void clear() { if (bufferObject()) bufferObject()->clear(); }
    00090
    00092     const unsigned char* ptr() const { return bufferObject() ? bufferObject()->ptr() : NULL; }
    00093
    00095     unsigned char* ptr() { return bufferObject() ? bufferObject()->ptr() : NULL; }
    00096
    00098     virtual size_t bytesUsed() const { return bufferObject() ? bufferObject()->bytesUsed() : 0; }
    00099
    00101     virtual size_t glSize() const = 0;
    00102
    00104     virtual GLenum glType() const = 0;
    00105
    00107     virtual size_t size() const = 0;
    00108
    00110     virtual Sphere computeBoundingSphere() const = 0;
    00111
    00113     virtual AABB computeBoundingBox() const = 0;
    00114
    00116     virtual void transform(const mat4& m) = 0;
    00117
    00119     virtual void normalize() = 0;
    00120
    00122     virtual vec4 getAsVec4(size_t vector_index) const = 0;
    00123
    00125     virtual vec3 getAsVec3(size_t vector_index) const = 0;
    00126
    00128     virtual vec2 getAsVec2(size_t vector_index) const = 0;
    00129
    00131     virtual int compare(int a, int b) const = 0;
    00132
    00134     bool isBufferObjectDirty() const { return mBufferObjectDirty; }
    00135
    00137     void setBufferObjectDirty(bool dirty=true) { mBufferObjectDirty = dirty; }
    00138
    00140     EBufferObjectUsage usage() const { return mBufferObjectUsage; }
    00141
    00143     void setUsage(EBufferObjectUsage usage) { mBufferObjectUsage = usage; }
    00144
    00147     void updateBufferObject(EBufferObjectUpdateMode mode = BUM_KeepRamBuffer)
    00148     {
    00149       bufferObject()->setBufferData(usage(), (mode & BUF_DiscardRamBuffer) !=  0);
    00150       setBufferObjectDirty(false);
    00151     }
    00152
    00153   protected:
    00154     ref<BufferObject> mBufferObject;
    00155     EBufferObjectUsage mBufferObjectUsage;
    00156     bool mBufferObjectDirty;
    00157   };
    00158 //-----------------------------------------------------------------------------
    00159 // Array
    00160 //-----------------------------------------------------------------------------
    00179   template <typename T_VectorType, typename T_Scalar, size_t T_GL_Size, GLenum T_GL_Type>
    00180   class Array: public ArrayAbstract
    00181   {
    00182     VL_INSTRUMENT_ABSTRACT_CLASS(vl::Array, ArrayAbstract)
    00183
    00184   public:
    00185     typedef T_Scalar scalar_type;
    00186     typedef T_VectorType vector_type;
    00187     static const size_t gl_size = T_GL_Size;
    00188     static const GLenum gl_type = T_GL_Type;
    00189
    00190     virtual size_t glSize() const { return T_GL_Size; }
    00191
    00192     virtual GLenum glType() const { return T_GL_Type; }
    00193
    00194     virtual size_t bytesPerVector() const { return sizeof(T_VectorType); }
    00195
    00196     // ---
    00197
    00198     void clear() { resize(0); bufferObject()->deleteBufferObject(); }
    00199
    00200     void resize(size_t dim) { bufferObject()->resize(dim*bytesPerVector()); }
    00201
    00202     size_t size() const { return bytesUsed() / bytesPerVector(); }
    00203
    00204     size_t sizeBufferObject() const { return bufferObject() ? bufferObject()->byteCountBufferObject() / bytesPerVector() : 0; }
    00205
    00206     size_t scalarCount() const { return size() * T_GL_Size; }
    00207
    00208     size_t scalarCountBufferObject() const { return sizeBufferObject() * T_GL_Size; }
    00209
    00210     // ---
    00211
    00212     const T_VectorType* begin() const { return reinterpret_cast<const T_VectorType*>(ptr()); }
    00213
    00214     T_VectorType* begin() { return reinterpret_cast<T_VectorType*>(ptr()); }
    00215
    00216     const T_VectorType* end() const { return (reinterpret_cast<const T_VectorType*>(ptr()))+size(); }
    00217
    00218     T_VectorType* end() { return (reinterpret_cast<T_VectorType*>(ptr()))+size(); }
    00219
    00220     // ---
    00221
    00222     T_VectorType& at(size_t i) { VL_CHECK(i<size()); return *(reinterpret_cast<T_VectorType*>(ptr())+i); }
    00223
    00224     const T_VectorType& at(size_t i) const { VL_CHECK(i<size()); return *(reinterpret_cast<const T_VectorType*>(ptr())+i); }
    00225
    00226     T_VectorType& operator[](size_t i) { return at(i); }
    00227
    00228     const T_VectorType& operator[](size_t i) const { return at(i); }
    00229
    00230     // ---
    00231
    00232     virtual ref<ArrayAbstract> createArray() const { return new Array; }
    00233
    00234     virtual ref<ArrayAbstract> clone() const
    00235     {
    00236       ref<Array> arr = createArray()->as<Array>(); VL_CHECK(arr);
    00237       if (size())
    00238       {
    00239         arr->resize(size());
    00240         memcpy(arr->ptr(), ptr(), bytesUsed());
    00241       }
    00242       return arr;
    00243     }
    00244
    00245     // ---
    00246
    00247     Sphere computeBoundingSphere() const
    00248     {
    00249       AABB aabb;
    00250       const int count = T_GL_Size == 4 ? 3 : T_GL_Size;
    00251       for(size_t i=0; i<size(); ++i)
    00252       {
    00253         vec3 v;
    00254         const T_Scalar* pv = reinterpret_cast<const T_Scalar*>(&at(i));
    00255         for( int j=0; j<count; ++j )
    00256           v.ptr()[j] = (real)pv[j];
    00257         aabb += v;
    00258       }
    00259       real radius = 0;
    00260       vec3 center = aabb.center();
    00261       for(size_t i=0; i<size(); ++i)
    00262       {
    00263         vec3 v;
    00264         const T_Scalar* pv = reinterpret_cast<const T_Scalar*>(&at(i));
    00265         for( int j=0; j<count; ++j )
    00266           v.ptr()[j] = (real)pv[j];
    00267         real r = (v-center).lengthSquared();
    00268         if (r > radius)
    00269           radius = r;
    00270       }
    00271       return Sphere( center, sqrt(radius) );
    00272     }
    00273
    00274     AABB computeBoundingBox() const
    00275     {
    00276       AABB aabb;
    00277       const int count = T_GL_Size == 4 ? 3 : T_GL_Size;
    00278       for(size_t i=0; i<size(); ++i)
    00279       {
    00280         vec3 v;
    00281         const T_Scalar* pv = reinterpret_cast<const T_Scalar*>(&at(i));
    00282         for( int j=0; j<count; ++j )
    00283           v.ptr()[j] = (real)pv[j];
    00284         aabb += v;
    00285       }
    00286       return aabb;
    00287     }
    00288
    00289     void transform(const mat4& m)
    00290     {
    00291       for(size_t i=0; i<size(); ++i)
    00292       {
    00293         vec4 v(0,0,0,1);
    00294         T_Scalar* pv = reinterpret_cast<T_Scalar*>(&at(i));
    00295         // read
    00296         for( size_t j=0; j<T_GL_Size; ++j )
    00297           v.ptr()[j] = (real)pv[j];
    00298         // transform
    00299         v = m * v;
    00300         // write
    00301         for( size_t j=0; j<T_GL_Size; ++j )
    00302           pv[j] = (T_Scalar)v.ptr()[j];
    00303       }
    00304     }
    00305
    00306     void normalize()
    00307     {
    00308       for(size_t i=0; i<size(); ++i)
    00309       {
    00310         vec4 v(0,0,0,0);
    00311         T_Scalar* pv = reinterpret_cast<T_Scalar*>(&at(i));
    00312         // read
    00313         for( size_t j=0; j<T_GL_Size; ++j )
    00314           v.ptr()[j] = (real)pv[j];
    00315         // normalize
    00316         v.normalize();
    00317         // write
    00318         for( unsigned j=0; j<T_GL_Size; ++j )
    00319           pv[j] = (T_Scalar)v.ptr()[j];
    00320       }
    00321     }
    00322
    00323     vec4 getAsVec4(size_t vector_index) const
    00324     {
    00325       vec4 v(0,0,0,1);
    00326       const T_Scalar* pv = reinterpret_cast<const T_Scalar*>(&at(vector_index));
    00327       for( size_t j=0; j<T_GL_Size; ++j )
    00328         v.ptr()[j] = (real)pv[j];
    00329       return v;
    00330     }
    00331
    00332     vec3 getAsVec3(size_t vector_index) const
    00333     {
    00334       vec3 v;
    00335       const T_Scalar* pv = reinterpret_cast<const T_Scalar*>(&at(vector_index));
    00336       const int count = T_GL_Size <= 3 ? T_GL_Size : 3;
    00337       for( int j=0; j<count; ++j )
    00338         v.ptr()[j] = (real)pv[j];
    00339       return v;
    00340     }
    00341
    00342     vec2 getAsVec2(size_t vector_index) const
    00343     {
    00344       vec2 v;
    00345       const T_Scalar* pv = reinterpret_cast<const T_Scalar*>(&at(vector_index));
    00346       const int count = T_GL_Size <= 2 ? T_GL_Size : 2;
    00347       for( int j=0; j<count; ++j )
    00348         v.ptr()[j] = (real)pv[j];
    00349       return v;
    00350     }
    00351
    00352     int compare(int a, int b) const
    00353     {
    00354       const T_Scalar* pa = reinterpret_cast<const T_Scalar*>(&at(a));
    00355       const T_Scalar* pb = reinterpret_cast<const T_Scalar*>(&at(b));
    00356       for( size_t i=0; i<T_GL_Size; ++i )
    00357         if ( pa[i] != pb[i] )
    00358           return pa[i] < pb[i] ? -1 : +1;
    00359       return 0;
    00360     }
    00361
    00362     void initFrom(const std::vector<T_VectorType>& vector)
    00363     {
    00364       resize(vector.size());
    00365       if (vector.empty())
    00366         return;
    00367       else
    00368         memcpy(ptr(),&vector[0],sizeof(vector[0])*vector.size());
    00369     }
    00370   };
    00371 //-----------------------------------------------------------------------------
    00372 // Array typedefs
    00373 //-----------------------------------------------------------------------------
    00374
    00375
    00377   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; } };
    00379   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; } };
    00381   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; } };
    00383   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; } };
    00384
    00386   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; } };
    00388   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; } };
    00390   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; } };
    00392   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; } };
    00393
    00395   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; } };
    00397   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; } };
    00399   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; } };
    00401   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; } };
    00402
    00404   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; } };
    00406   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; } };
    00408   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; } };
    00410   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; } };
    00411
    00413   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; } };
    00415   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; } };
    00417   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; } };
    00419   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; } };
    00420
    00422   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; } };
    00424   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; } };
    00426   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; } };
    00428   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; } };
    00429
    00431   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; } };
    00433   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; } };
    00435   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; } };
    00437   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; } };
    00438
    00440   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; } };
    00442   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; } };
    00444   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; } };
    00446   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; } };
    00447
    00449   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; } };
    00451   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; } };
    00453   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; } };
    00455   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; } };
    00456
    00458   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; } };
    00460   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; } };
    00462   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; } };
    00464   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; } };
    00465
    00467   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; } };
    00469   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; } };
    00471   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; } };
    00473   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; } };
    00474
    00476   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; } };
    00478   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; } };
    00480   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; } };
    00482   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; } };
    00483 }
    00484
    00485 #endif

Visualization Library v2011.09.1162 Reference Documentation
Copyright 2005-2011 Michele Bosi. All rights reserved.
Updated on Thu Jan 26 2012 00:43:35.
Permission is granted to use this page to write and publish articles regarding Visualization Library.