![]() |
http://www.sim.no/ http://www.coin3d.org/ |
00001 #ifndef COIN_SOTEXTURECOORDINATEBUNDLE_H 00002 #define COIN_SOTEXTURECOORDINATEBUNDLE_H 00003 00004 /**************************************************************************\ 00005 * 00006 * This file is part of the Coin 3D visualization library. 00007 * Copyright (C) by Kongsberg Oil & Gas Technologies. 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 Oil & Gas Technologies 00018 * about acquiring a Coin Professional Edition License. 00019 * 00020 * See http://www.coin3d.org/ for more information. 00021 * 00022 * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY. 00023 * http://www.sim.no/ sales@sim.no coin-support@coin3d.org 00024 * 00025 \**************************************************************************/ 00026 00027 #include <Inventor/bundles/SoBundle.h> 00028 #include <Inventor/SbBasic.h> 00029 #include <Inventor/system/inttypes.h> 00030 #include <Inventor/elements/SoGLTextureCoordinateElement.h> 00031 00032 #include <Inventor/SbVec4f.h> 00033 00034 class SoTextureCoordinateElement; 00035 class SoGLTextureCoordinateElement; 00036 class SoTextureCoordinateCache; 00037 class SoShape; 00038 00039 00040 class COIN_DLL_API SoTextureCoordinateBundle : public SoBundle { 00041 typedef SoBundle inherited; 00042 public: 00043 SoTextureCoordinateBundle(SoAction * const action, 00044 const SbBool forRendering, 00045 const SbBool setUpDefault = TRUE); 00046 ~SoTextureCoordinateBundle(); 00047 00048 SbBool needCoordinates(void) const; 00049 SbBool isFunction(void) const; 00050 00051 const SbVec4f &get(const int index); 00052 const SbVec4f &get(const SbVec3f &point, const SbVec3f &normal); 00053 00054 void send(const int index) const { 00055 glElt->send(index); 00056 } 00057 void send(const int index, const SbVec3f &point, 00058 const SbVec3f &normal) const { 00059 glElt->send(index, point, normal); 00060 } 00061 00062 SbBool needIndices(void) const; 00063 00064 private: 00065 const SoTextureCoordinateElement *coordElt; 00066 const SoGLTextureCoordinateElement *glElt; 00067 unsigned int flags; 00068 00069 // misc stuff for default texture coordinate mappping 00070 static const SbVec4f & defaultCB(void * userdata, 00071 const SbVec3f & point, 00072 const SbVec3f & normal); 00073 static const SbVec4f & defaultCBMulti(void * userdata, 00074 const SbVec3f & point, 00075 const SbVec3f & normal); 00076 SoShape * shapenode; 00077 SbVec3f defaultorigo; 00078 SbVec3f defaultsize; 00079 SbVec4f dummyInstance; 00080 int defaultdim0, defaultdim1; 00081 void initDefaultCallback(SoAction * action); 00082 void initDefault(SoAction * const action, const SbBool forRendering); 00083 void initDefaultMulti(SoAction * action, const int unit); 00084 }; 00085 00086 00087 #endif // !COIN_SOTEXTURECOORDINATEBUNDLE_H
Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.
Generated for Coin by Doxygen 1.5.6.