![]() |
http://www.sim.no/ http://www.coin3d.org/ |
00001 #ifndef COIN_SOPRIMITIVEVERTEXCACHE_H 00002 #define COIN_SOPRIMITIVEVERTEXCACHE_H 00003 00004 /**************************************************************************\ 00005 * 00006 * This file is part of the Coin 3D visualization library. 00007 * Copyright (C) 1998-2008 by Kongsberg SIM. All rights reserved. 00008 * 00009 * This library is free software; you can redistribute it and/or 00010 * modify it under the terms of the GNU General Public License 00011 * ("GPL") version 2 as published by the Free Software Foundation. 00012 * See the file LICENSE.GPL at the root directory of this source 00013 * distribution for additional information about the GNU GPL. 00014 * 00015 * For using Coin with software that can not be combined with the GNU 00016 * GPL, and for taking advantage of the additional benefits of our 00017 * support services, please contact Kongsberg SIM about acquiring 00018 * a Coin Professional Edition License. 00019 * 00020 * See http://www.coin3d.org/ for more information. 00021 * 00022 * Kongsberg SIM, Postboks 1283, Pirsenteret, 7462 Trondheim, NORWAY. 00023 * http://www.sim.no/ sales@sim.no coin-support@coin3d.org 00024 * 00025 \**************************************************************************/ 00026 00027 #include <Inventor/caches/SoCache.h> 00028 #include <Inventor/system/gl.h> 00029 #include <Inventor/SbVec3f.h> 00030 #include <Inventor/SbVec4f.h> 00031 #include <Inventor/SbVec2f.h> 00032 #include <Inventor/tools/SbPimplPtr.h> 00033 00034 class SoPrimitiveVertexCacheP; 00035 class SoPrimitiveVertex; 00036 class SoPointDetail; 00037 class SoState; 00038 00039 class COIN_DLL_API SoPrimitiveVertexCache : public SoCache { 00040 typedef SoCache inherited; 00041 public: 00042 SoPrimitiveVertexCache(SoState * state); 00043 virtual ~SoPrimitiveVertexCache(); 00044 00045 enum Arrays { 00046 NORMAL = 0x01, 00047 TEXCOORD = 0x02, 00048 COLOR = 0x04, 00049 ALL = (NORMAL|TEXCOORD|COLOR) 00050 }; 00051 00052 void renderTriangles(SoState * state, const int arrays = ALL) const; 00053 void renderLines(SoState * state, const int arrays = ALL) const; 00054 void renderPoints(SoState * state, const int array = ALL) const; 00055 00056 void addTriangle(const SoPrimitiveVertex * v0, 00057 const SoPrimitiveVertex * v1, 00058 const SoPrimitiveVertex * v2, 00059 const int * pointdetailidx = NULL); 00060 void addLine(const SoPrimitiveVertex * v0, 00061 const SoPrimitiveVertex * v1); 00062 void addPoint(const SoPrimitiveVertex * v); 00063 00064 int getNumVertices(void) const; 00065 const SbVec3f * getVertexArray(void) const; 00066 const SbVec3f * getNormalArray(void) const; 00067 const SbVec4f * getTexCoordArray(void) const; 00068 const SbVec2f * getBumpCoordArray(void) const; 00069 const uint8_t * getColorArray(void) const; 00070 00071 int getNumTriangleIndices(void) const; 00072 const GLint * getTriangleIndices(void) const; 00073 int32_t getTriangleIndex(const int idx) const; 00074 00075 SbBool colorPerVertex(void) const; 00076 const SbVec4f * getMultiTextureCoordinateArray(const int unit) const; 00077 00078 int getNumLineIndices(void) const; 00079 const GLint * getLineIndices(void) const; 00080 00081 int getNumPointIndices(void) const; 00082 const GLint * getPointIndices(void) const; 00083 00084 void fit(void); 00085 void depthSortTriangles(SoState * state); 00086 00087 private: 00088 SbPimplPtr<SoPrimitiveVertexCacheP> pimpl; 00089 00090 SoPrimitiveVertexCache(const SoPrimitiveVertexCache & rhs); // N/A 00091 SoPrimitiveVertexCache & operator = (const SoPrimitiveVertexCache & rhs); // N/A 00092 00093 }; 00094 00095 #endif // COIN_SOPRIMITIVEVERTEXCACHE_H
Copyright © 1998-2008 by Kongsberg SIM. All rights reserved.
Generated on Tue May 5 02:52:06 2009 for Coin by Doxygen 1.5.5.