00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
#ifndef COIN_SOINDEXEDSHAPE_H
00021
#define COIN_SOINDEXEDSHAPE_H
00022
00023
#include <Inventor/nodes/SoSubNode.h>
00024
#include <Inventor/nodes/SoVertexShape.h>
00025
#include <Inventor/fields/SoMFInt32.h>
00026
00027
class SoTextureCoordinateElement;
00028
class SoCoordinateElement;
00029
00030
00031 class COIN_DLL_API SoIndexedShape :
public SoVertexShape {
00032
typedef SoVertexShape inherited;
00033
00034 SO_NODE_ABSTRACT_HEADER(SoIndexedShape);
00035
00036
public:
00037
static void initClass(
void);
00038
00039
SoMFInt32 coordIndex;
00040
SoMFInt32 materialIndex;
00041
SoMFInt32 normalIndex;
00042
SoMFInt32 textureCoordIndex;
00043
00044
protected:
00045 SoIndexedShape(
void);
00046
virtual ~SoIndexedShape();
00047
00048
virtual void computeBBox(
SoAction * action,
SbBox3f & box,
SbVec3f & center);
00049
int getNumVerts(
const int startCoord);
00050
void setupIndices(
const int numParts,
const int numFaces,
00051
const SbBool needNormals,
const SbBool needTexCoords);
00052
00053
const int32_t * getNormalIndices(
void);
00054
const int32_t * getColorIndices(
void);
00055
const int32_t * getTexCoordIndices(
void);
00056
00057
static SbBool areTexCoordsIndexed(
SoAction * action);
00058
00059 SbBool getVertexData(
SoState * state,
00060
const SoCoordinateElement *& coords,
00061
const SbVec3f *& normals,
00062
const int32_t *& cindices,
00063
const int32_t *& nindices,
00064
const int32_t *& tindices,
00065
const int32_t *& mindices,
00066
int & numcindices,
00067
const SbBool needNormals,
00068 SbBool & normalCacheUsed);
00069
00070
private:
00071
00072
00073
00074 int32_t * tIndices;
00075 int32_t * nIndices;
00076 int32_t * mIndices;
00077 };
00078
00079
00080
#endif // !COIN_SOINDEXEDSHAPE_H