Coin Logo http://www.sim.no/
http://www.coin3d.org/

SoTextureCubeMap.h
00001 #ifndef COIN_SOTEXTURECUBEMAP_H
00002 #define COIN_SOTEXTURECUBEMAP_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/nodes/SoSubNode.h>
00028 #include <Inventor/nodes/SoTexture.h>
00029 #include <Inventor/fields/SoSFEnum.h>
00030 #include <Inventor/fields/SoSFImage.h>
00031 #include <Inventor/fields/SoMFString.h>
00032 #include <Inventor/fields/SoSFColor.h>
00033 #include <Inventor/elements/SoTextureImageElement.h>
00034 
00035 class SoFieldSensor;
00036 class SoSensor;
00037 class SoTextureCubeMapP;
00038 
00039 class COIN_DLL_API SoTextureCubeMap : public SoTexture {
00040   typedef SoTexture inherited;
00041 
00042   SO_NODE_HEADER(SoTextureCubeMap);
00043 
00044 public:
00045   static void initClass(void);
00046   SoTextureCubeMap(void);
00047 
00048   enum Model {
00049     MODULATE = SoTextureImageElement::MODULATE,
00050     DECAL = SoTextureImageElement::DECAL,
00051     BLEND = SoTextureImageElement::BLEND,
00052     REPLACE = SoTextureImageElement::REPLACE
00053   };
00054 
00055   enum Wrap {
00056     REPEAT = SoTextureImageElement::REPEAT,
00057     CLAMP = SoTextureImageElement::CLAMP
00058   };
00059 
00060   SoMFString filenames;
00061 
00062   SoSFImage imagePosX;
00063   SoSFImage imageNegX;
00064   SoSFImage imagePosY;
00065   SoSFImage imageNegY;
00066   SoSFImage imagePosZ;
00067   SoSFImage imageNegZ;
00068 
00069   SoSFEnum wrapS;
00070   SoSFEnum wrapT;
00071   SoSFEnum model;
00072   SoSFColor blendColor;
00073 
00074   virtual void doAction(SoAction * action);
00075   virtual void GLRender(SoGLRenderAction * action);
00076   virtual void callback(SoCallbackAction * action);
00077   virtual void rayPick(SoRayPickAction * action);
00078 
00079   static SbBool readImage(const SbString & fname, int & w, int & h, int & nc,
00080                           unsigned char *& bytes);
00081 protected:
00082   virtual ~SoTextureCubeMap();
00083 
00084   virtual SbBool readInstance(SoInput * in, unsigned short flags);
00085   virtual void notify(SoNotList * list);
00086   int getReadStatus(void);
00087   void setReadStatus(int s);
00088 
00089 private:
00090   SbBool loadFilename(const SbString & filename, SoSFImage * image);
00091   static void filenameSensorCB(void *, SoSensor *);
00092   SoSFImage * getImageField(const int idx);
00093 
00094   SoTextureCubeMapP * pimpl;
00095 };
00096 
00097 #endif // !COIN_SOTEXTURECUBEMAP_H

Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.

Generated for Coin by Doxygen 1.7.5.1.