MeVisLabToolboxReference
MeVisLab/Standard/Sources/Inventor/SoShader/Inventor/elements/SoSamplerInfoElement.h
Go to the documentation of this file.
00001 // **InsertLicense** code
00002 
00006 
00007 
00008 #ifndef  _SO_SAMPLER_INFO_ELEMENT_
00009 #define  _SO_SAMPLER_INFO_ELEMENT_
00010 
00011 #include "SoShaderSystem.h"
00012 #include <Inventor/elements/SoAccumulatedElement.h>
00013 #include <list>
00014 #include <limits.h>
00015 
00017 class SbSamplerInfo
00018 {
00019    public:
00020 
00022       enum TextureType {
00023          TT_FLOAT,
00024          TT_INTEGER,
00025       };
00026    
00028       SbString name;
00030       SbBool valid;
00032       TextureType type;
00033    
00034       SbSamplerInfo() {
00035          valid = FALSE;
00036       }
00037       SbSamplerInfo(const SbString &name, TextureType type) {
00038          this->valid = TRUE;
00039          this->name = name;
00040          this->type = type;
00041       }
00042    
00043       SbBool isValid() const {
00044          return valid;
00045       }
00046    
00047       int operator==(const SbSamplerInfo &i) const {
00048          return (name == i.name);
00049       }
00050 };
00051 
00053 class INVENTOR_SHADER_API SoSamplerInfoElement : public SoAccumulatedElement
00054 {
00055    typedef SoAccumulatedElement inherited;
00056 
00057    SO_ELEMENT_HEADER(SoSamplerInfoElement);
00058 
00059    public:
00060 
00062       virtual void   init(SoState *state);
00063       
00065       static  void   add(SoState *state, SoNode *node, const SbSamplerInfo &info);
00066 
00068       static  void   set(SoState *state, SoNode *node, const SbSamplerInfo &info);
00069 
00071       static  void   clear(SoState *state, SoNode *node);
00072       
00074       static  const SbSamplerInfo &get(SoState *state);
00075 
00077       virtual void   push(SoState *state);
00078 
00079    SoINTERNAL public:
00080   
00082       static  void   initClass();
00083 
00084    protected:
00085 
00087       std::list<SbSamplerInfo> _info;
00088 };
00089 
00090 #endif  // _SO_SAMPLER_INFO_ELEMENT_