![]() |
http://www.sim.no/ http://www.coin3d.org/ |
00001 #ifndef COIN_SOMULTITEXTUREIMAGEELEMENT_H 00002 #define COIN_SOMULTITEXTUREIMAGEELEMENT_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/elements/SoTextureImageElement.h> 00029 #include <Inventor/SbVec2s.h> 00030 #include <Inventor/SbVec3s.h> 00031 #include <Inventor/SbColor.h> 00032 00033 class SoState; 00034 class SoMultiTextureImageElementP; 00035 00036 class COIN_DLL_API SoMultiTextureImageElement : public SoElement { 00037 typedef SoElement inherited; 00038 00039 SO_ELEMENT_HEADER(SoMultiTextureImageElement); 00040 public: 00041 static void initClass(void); 00042 protected: 00043 virtual ~SoMultiTextureImageElement(); 00044 00045 public: 00046 00047 virtual void init(SoState * state); 00048 static void setDefault(SoState * const state, SoNode * const node, const int unit); 00049 00050 static void set(SoState * const state, SoNode * const node, 00051 const int unit, 00052 const SbVec2s & size, const int numComponents, 00053 const unsigned char * bytes, 00054 const SoTextureImageElement::Wrap wrapS, 00055 const SoTextureImageElement::Wrap wrapT, 00056 const SoTextureImageElement::Model model, const SbColor & blendColor); 00057 static void set(SoState * const state, SoNode * const node, 00058 const int unit, 00059 const SbVec3s & size, const int numComponents, 00060 const unsigned char * bytes, 00061 const SoTextureImageElement::Wrap wrapS, 00062 const SoTextureImageElement::Wrap wrapT, 00063 const SoTextureImageElement::Wrap wrapR, 00064 const SoTextureImageElement::Model model, const SbColor & blendColor); 00065 00066 static const unsigned char *get(SoState * const state, 00067 const int unit, 00068 SbVec2s & size, 00069 int & numComponents, 00070 SoTextureImageElement::Wrap & wrapS, 00071 SoTextureImageElement::Wrap & wrapT, 00072 SoTextureImageElement::Model & model, 00073 SbColor & blendColor); 00074 static const unsigned char *get(SoState * const state, 00075 const int unit, 00076 SbVec3s & size, 00077 int & numComponents, 00078 SoTextureImageElement::Wrap & wrapS, 00079 SoTextureImageElement::Wrap & wrapT, 00080 SoTextureImageElement::Wrap & wrapR, 00081 SoTextureImageElement::Model & model, 00082 SbColor & blendColor); 00083 00084 static const unsigned char *getImage(SoState * const state, 00085 const int unit, 00086 SbVec2s & size, 00087 int & numComponents); 00088 static const unsigned char *getImage(SoState * const state, 00089 const int unit, 00090 SbVec3s &size, 00091 int &numComponents); 00092 00093 static const SbColor & getBlendColor(SoState * const state, const int unit); 00094 static SoTextureImageElement::Model getModel(SoState * const state, const int unit); 00095 static SoTextureImageElement::Wrap getWrapS(SoState * const state, const int unit); 00096 static SoTextureImageElement::Wrap getWrapT(SoState * const state, const int unit); 00097 static SoTextureImageElement::Wrap getWrapR(SoState * const state, const int unit); 00098 00099 static SbBool containsTransparency(SoState * const state); 00100 00101 static const unsigned char * getDefault(SbVec2s & size, int & numComponents); 00102 static const unsigned char * getDefault(SbVec3s & size, int & numComponents); 00103 00104 virtual void push(SoState * state); 00105 virtual SbBool matches(const SoElement * elem) const; 00106 SoElement * copyMatchInfo(void) const; 00107 00108 virtual void setElt(const int unit, 00109 const uint32_t nodeid, 00110 const SbVec2s & size, const int numComponents, 00111 const unsigned char * bytes, 00112 const SoTextureImageElement::Wrap wrapS, 00113 const SoTextureImageElement::Wrap wrapT, 00114 const SoTextureImageElement::Model model, 00115 const SbColor & blendColor); 00116 virtual void setElt(const int unit, 00117 const uint32_t nodeid, 00118 const SbVec3s & size, const int numComponents, 00119 const unsigned char * bytes, 00120 const SoTextureImageElement::Wrap wrapS, 00121 const SoTextureImageElement::Wrap wrapT, 00122 const SoTextureImageElement::Wrap wrapR, 00123 const SoTextureImageElement::Model model, 00124 const SbColor & blendColor); 00125 00126 virtual SbBool hasTransparency(const int unit) const; 00127 00128 class UnitData { 00129 public: 00130 uint32_t nodeid; 00131 SbVec3s size; 00132 int numComponents; 00133 const unsigned char * bytes; 00134 SoTextureImageElement::Wrap wrapS, wrapT, wrapR; 00135 SoTextureImageElement::Model model; 00136 SbColor blendColor; 00137 }; 00138 00139 protected: 00140 const UnitData & getUnitData(const int unit) const; 00141 00142 private: 00143 void setDefaultValues(const int unit); 00144 SoMultiTextureImageElementP * pimpl; 00145 }; 00146 00147 #endif // !COIN_SOMULTITEXTUREIMAGEELEMENT_H
Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.
Generated on Wed Mar 24 01:53:59 2010 for Coin by Doxygen 1.6.2-20100208.