Moved the AttributeArray and Primitive classes into their own header and

source files.
This commit is contained in:
Robert Osfield
2002-06-27 10:50:19 +00:00
parent 726d680184
commit 532a32416f
9 changed files with 363 additions and 316 deletions

View File

@@ -20,7 +20,6 @@ Node *makeBase( void )
Vec3Array *coords = new Vec3Array(19);
Vec2Array *tcoords = new Vec2Array(19);
Vec4Array *colors = new Vec4Array(1);
int *lengths = new int[1];
(*colors)[0].set(1.0f,1.0f,1.0f,1.0f);

30
src/osg/Array.cpp Normal file
View File

@@ -0,0 +1,30 @@
#include <osg/Array>
using namespace osg;
static char* s_ArrayNames[] =
{
"AttributeArray", // 0
"ByteArray", // 1
"ShortArray", // 2
"IntArray", // 3
"UByteArray", // 4
"UShortArray", // 5
"UIntArray", // 6
"UByte4Array", // 7
"FloatArray", // 8
"Vec2Array", // 9
"Vec3Array", // 10
"Vec4Array", // 11
};
const char* AttributeArray::className() const
{
if (_arrayType>=AttributeArrayType && _arrayType<=Vec4ArrayType)
return s_ArrayNames[_arrayType];
else
return "UnkownAttributeArray";
}

View File

@@ -2,49 +2,6 @@
using namespace osg;
static char* s_ArrayNames[] =
{
"AttributeArray", // 0
"ByteArray", // 1
"ShortArray", // 2
"IntArray", // 3
"UByteArray", // 4
"UShortArray", // 5
"UIntArray", // 6
"UByte4Array", // 7
"FloatArray", // 8
"Vec2Array", // 9
"Vec3Array", // 10
"Vec4Array", // 11
};
const char* AttributeArray::className() const
{
if (_arrayType>=AttributeArrayType && _arrayType<=Vec4ArrayType)
return s_ArrayNames[_arrayType];
else
return "UnkownAttributeArray";
}
static char* s_PrimitiveNames[] =
{
"Primitive", // 0
"DrawArrays", // 1
"UByteDrawElements", // 2
"UShortDrawElements", // 3
"UIntDrawElements" // 4
};
const char* Primitive::className() const
{
if (_primitiveType>=PrimitivePrimitiveType && _primitiveType<=UIntDrawElementsPrimitiveType)
return s_PrimitiveNames[_primitiveType];
else
return "UnkownAttributeArray";
}
Geometry::Geometry()
{
_normalBinding = BIND_OFF;

View File

@@ -4,6 +4,7 @@ include $(TOPDIR)/Make/makedefs
CXXFILES =\
AlphaFunc.cpp\
AnimationPath.cpp\
Array.cpp\
Billboard.cpp\
BoundingBox.cpp\
BoundingSphere.cpp\
@@ -56,6 +57,7 @@ CXXFILES =\
PolygonMode.cpp\
PolygonOffset.cpp\
PositionAttitudeTransform.cpp\
Primitive.cpp\
Projection.cpp\
Quat.cpp\
ShadeModel.cpp\

21
src/osg/Primitive.cpp Normal file
View File

@@ -0,0 +1,21 @@
#include <osg/Primitive>
using namespace osg;
static char* s_PrimitiveNames[] =
{
"Primitive", // 0
"DrawArrays", // 1
"UByteDrawElements", // 2
"UShortDrawElements", // 3
"UIntDrawElements" // 4
};
const char* Primitive::className() const
{
if (_primitiveType>=PrimitivePrimitiveType && _primitiveType<=UIntDrawElementsPrimitiveType)
return s_PrimitiveNames[_primitiveType];
else
return "UnkownAttributeArray";
}