Make Array::className() support all Array::Type's

Array::className() had fallen out of date with respect to Array::Type.
This commit updates it, and adds documentation and a debug message to
serve as a reminder for future additions of values to Array::Type.
This commit is contained in:
Chris White
2017-06-16 09:58:32 -04:00
parent ca20eb2cba
commit eb99df894a
2 changed files with 26 additions and 4 deletions

View File

@@ -11,6 +11,7 @@
* OpenSceneGraph Public License for more details.
*/
#include <osg/Array>
#include <osg/Notify>
using namespace osg;
@@ -62,13 +63,20 @@ static const char* s_ArrayNames[] =
"MatrixArray", //33
"MatrixdArray", //34
"QuatArray", //35
"UInt64Array", //36
"Int64Array", //37
};
const char* Array::className() const
{
if (_arrayType>=ArrayType && _arrayType<=Vec4dArrayType)
if (_arrayType>=ArrayType && _arrayType<=LastArrayType)
return s_ArrayNames[_arrayType];
else
else {
OSG_DEBUG << "Array::className(): Unknown array type " << _arrayType << std::endl;
return "UnknownArray";
}
}