1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2  *
3  * This library is open source and may be redistributed and/or modified under
4  * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5  * (at your option) any later version.  The full license is in LICENSE file
6  * included with this distribution, and on the openscenegraph.org website.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11  * OpenSceneGraph Public License for more details.
12 */
13 #include <osg/Array>
14 #include <osg/Notify>
15 
16 using namespace osg;
17 
18 static const char* s_ArrayNames[] =
19 {
20     "Array",        // 0
21     "ByteArray",    // 1
22     "ShortArray",   // 2
23     "IntArray",     // 3
24 
25     "UByteArray",   // 4
26     "UShortArray",  // 5
27     "UIntArray",    // 6
28 
29     "FloatArray",   // 7
30     "DoubleArray",  // 8
31 
32     "Vec2bArray",   // 9
33     "Vec3bArray",   //10
34     "Vec4bArray",   //11
35 
36     "Vec2sArray",   //12
37     "Vec3sArray",   //13
38     "Vec4sArray",   //14
39 
40     "Vec2iArray",   //15
41     "Vec3iArray",   //16
42     "Vec4iArray",   //17
43 
44     "Vec2ubArray",  //18
45     "Vec3ubArray",  //19
46     "Vec4ubArray",  //20
47 
48     "Vec2usArray",  //21
49     "Vec3usArray",  //22
50     "Vec4usArray",  //23
51 
52     "Vec2uiArray",  //24
53     "Vec3uiArray",  //25
54     "Vec4uiArray",  //26
55 
56     "Vec2Array",    //27
57     "Vec3Array",    //28
58     "Vec4Array",    //29
59 
60     "Vec2dArray",   //30
61     "Vec3dArray",   //31
62     "Vec4dArray",   //32
63 
64     "MatrixArray",  //33
65     "MatrixdArray", //34
66 
67     "QuatArray",    //35
68 
69     "UInt64Array",  //36
70     "Int64Array",   //37
71 };
72 
className() const73 const char* Array::className() const
74 {
75     if (_arrayType>=ArrayType && _arrayType<=LastArrayType)
76         return s_ArrayNames[_arrayType];
77     else {
78         OSG_DEBUG << "Array::className(): Unknown array type " << _arrayType << std::endl;
79         return "UnknownArray";
80     }
81 }
82 
83