00001 #ifndef COIN_SOTEXTURE2_H
00002 #define COIN_SOTEXTURE2_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include <Inventor/nodes/SoSubNode.h>
00028 #include <Inventor/fields/SoSFEnum.h>
00029 #include <Inventor/fields/SoSFImage.h>
00030 #include <Inventor/fields/SoSFString.h>
00031 #include <Inventor/fields/SoSFColor.h>
00032 #include <Inventor/elements/SoTextureImageElement.h>
00033
00034 class SoFieldSensor;
00035 class SoSensor;
00036 class SoTexture2P;
00037
00038 class COIN_DLL_API SoTexture2 : public SoNode {
00039 typedef SoNode inherited;
00040
00041 SO_NODE_HEADER(SoTexture2);
00042
00043 public:
00044 static void initClass(void);
00045 SoTexture2(void);
00046
00047 enum Model {
00048 MODULATE = SoTextureImageElement::MODULATE,
00049 DECAL = SoTextureImageElement::DECAL,
00050 BLEND = SoTextureImageElement::BLEND
00051 };
00052
00053 enum Wrap {
00054 REPEAT = SoTextureImageElement::REPEAT,
00055 CLAMP = SoTextureImageElement::CLAMP
00056 };
00057
00058 SoSFString filename;
00059 SoSFImage image;
00060 SoSFEnum wrapS;
00061 SoSFEnum wrapT;
00062 SoSFEnum model;
00063 SoSFColor blendColor;
00064
00065 virtual void doAction(SoAction * action);
00066 virtual void GLRender(SoGLRenderAction * action);
00067 virtual void callback(SoCallbackAction * action);
00068 virtual void rayPick(SoRayPickAction * action);
00069
00070 static SbBool readImage(const SbString & fname, int & w, int & h, int & nc,
00071 unsigned char *& bytes);
00072 protected:
00073 virtual ~SoTexture2();
00074
00075 virtual SbBool readInstance(SoInput * in, unsigned short flags);
00076 virtual void notify(SoNotList * list);
00077 int getReadStatus(void);
00078 void setReadStatus(int s);
00079
00080 private:
00081 SbBool loadFilename(void);
00082 static void filenameSensorCB(void *, SoSensor *);
00083
00084 SoTexture2P * pimpl;
00085 };
00086
00087 #endif // !COIN_SOTEXTURE2_H