Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

SoIndexedShape.h

00001 /**************************************************************************\
00002  *
00003  *  This file is part of the Coin 3D visualization library.
00004  *  Copyright (C) 1998-2002 by Systems in Motion. All rights reserved.
00005  *
00006  *  This library is free software; you can redistribute it and/or
00007  *  modify it under the terms of the GNU Lesser General Public License
00008  *  version 2.1 as published by the Free Software Foundation. See the
00009  *  file LICENSE.LGPL at the root directory of the distribution for
00010  *  more details.
00011  *
00012  *  If you want to use Coin for applications not compatible with the
00013  *  LGPL, please contact SIM to acquire a Professional Edition license.
00014  *
00015  *  Systems in Motion, Prof Brochs gate 6, 7030 Trondheim, NORWAY
00016  *  http://www.sim.no support@sim.no Voice: +47 22114160 Fax: +47 22207097
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   // FIXME: these are not in use, but we can't kill them until Coin
00072   // v2, or we'd break ABI compatibility.  20010910 mortene.
00073   int32_t * tIndices;
00074   int32_t * nIndices;
00075   int32_t * mIndices;
00076 };
00077 
00078 
00079 #endif // !COIN_SOINDEXEDSHAPE_H

Generated at Tue Mar 5 03:31:14 2002 for Coin by doxygen1.2.9 written by Dimitri van Heesch, © 1997-2001