![]() |
http://www.sim.no/ http://www.coin3d.org/ |
00001 #ifndef COIN_SOTEXTURECOORDINATEELEMENT_H 00002 #define COIN_SOTEXTURECOORDINATEELEMENT_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/elements/SoReplacedElement.h> 00028 #include <Inventor/SbVec2f.h> 00029 #include <Inventor/SbVec3f.h> 00030 #include <Inventor/SbVec4f.h> 00031 00032 /* 00033 * TODO 00034 * - conversion between 2D and 4D (like Open Inventor) 00035 */ 00036 00037 typedef const SbVec4f & SoTextureCoordinateFunctionCB(void * userdata, 00038 const SbVec3f & point, 00039 const SbVec3f & normal); 00040 00041 class COIN_DLL_API SoTextureCoordinateElement : public SoReplacedElement { 00042 typedef SoReplacedElement inherited; 00043 00044 SO_ELEMENT_HEADER(SoTextureCoordinateElement); 00045 public: 00046 static void initClass(void); 00047 protected: 00048 virtual ~SoTextureCoordinateElement(); 00049 00050 public: 00051 00052 enum CoordType { 00053 NONE = 0, 00054 TEXGEN = 0, 00055 EXPLICIT = 1, 00056 FUNCTION = 2, 00057 DEFAULT = 3 00058 }; 00059 00060 virtual void init(SoState * state); 00061 00062 static void setDefault(SoState * const state, SoNode * const node); 00063 static void setFunction(SoState * const state, SoNode * const node, 00064 SoTextureCoordinateFunctionCB * const func, 00065 void * const userdata); 00066 00067 static void set2(SoState * const state, SoNode * const node, 00068 const int32_t numCoords, const SbVec2f * const coords); 00069 static void set3(SoState * const state, SoNode * const node, 00070 const int32_t numCoords, const SbVec3f * const coords); 00071 static void set4(SoState * const state, SoNode * const node, 00072 const int32_t numCoords, const SbVec4f * const coords); 00073 00074 static CoordType getType(SoState * const state); 00075 virtual CoordType getType(void) const; 00076 00077 static const SoTextureCoordinateElement *getInstance(SoState * const state); 00078 00079 const SbVec4f &get(const SbVec3f & point, 00080 const SbVec3f & normal) const; 00081 int32_t getNum(void) const; 00082 SbBool is2D(void) const; 00083 int32_t getDimension(void) const; 00084 00085 const SbVec2f &get2(const int index) const; 00086 const SbVec3f &get3(const int index) const; 00087 const SbVec4f &get4(const int index) const; 00088 00089 const SbVec2f *getArrayPtr2(void) const; 00090 const SbVec3f *getArrayPtr3(void) const; 00091 const SbVec4f *getArrayPtr4(void) const; 00092 00093 protected: 00094 CoordType whatKind; 00095 SoTextureCoordinateFunctionCB *funcCB; 00096 void *funcCBData; 00097 int32_t numCoords; 00098 const SbVec2f *coords2; 00099 const SbVec3f *coords3; 00100 const SbVec4f *coords4; 00101 SbBool coordsDimension; 00102 SbVec2f convert2; 00103 SbVec3f convert3; 00104 SbVec4f convert4; 00105 }; 00106 00107 #endif // !COIN_SOTEXTURECOORDINATEELEMENT_H
Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.
Generated on 7 Jan 2016 for Coin by Doxygen 1.6.1.