00001 /*============================================================================== 00002 ** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ** 00003 ** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ** 00004 ** ** 00005 ** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ** 00006 ** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ** 00007 ** WRITTEN AUTHORIZATION OF FEI S.A.S. ** 00008 ** ** 00009 ** RESTRICTED RIGHTS LEGEND ** 00010 ** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ** 00011 ** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ** 00012 ** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ** 00013 ** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ** 00014 ** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ** 00015 ** ** 00016 ** COPYRIGHT (C) 1996-2022 BY FEI S.A.S, ** 00017 ** BORDEAUX, FRANCE ** 00018 ** ALL RIGHTS RESERVED ** 00019 ==============================================================================*/ 00020 00021 #pragma once 00022 00023 #include <Inventor/nodes/SoNode.h> 00024 #include <Inventor/fields/SoSFInt32.h> 00025 #include <Inventor/fields/SoSFEnum.h> 00026 #include <Inventor/fields/SoSFNode.h> 00027 #include <Inventor/fields/SoSFBool.h> 00028 #include <Inventor/SbEnums.h> 00029 #include <Inventor/nodes/SoShaderParameter.h> 00030 00031 class SoTexture; 00032 00093 class SoShaderParameterImage : public SoShaderParameter 00094 { 00095 SO_NODE_HEADER(SoShaderParameterImage); 00096 RENDERER_RESOURCE(SoShaderParameterImage); 00097 00098 public: 00103 SoSFNode texture; 00104 00109 SoSFInt32 layer; 00110 00114 enum AccessMode 00115 { 00119 READ = SbEnums::READ, 00120 00124 WRITE = SbEnums::WRITE, 00125 00129 READ_WRITE = SbEnums::READ_WRITE, 00130 }; 00131 00137 SoSFEnum accessMode; 00138 00139 SoShaderParameterImage(); 00140 00141 private: 00142 void GLRender(SoGLRenderAction* action); 00143 00144 private: 00145 static void initClass(); 00146 static void exitClass(); 00147 00148 void setAssignedUnit(int unit) 00149 { 00150 m_assignedUnit = unit; 00151 } 00152 00153 int getAssignedUnit() const 00154 { 00155 return m_assignedUnit; 00156 } 00157 00158 static const SbString& getGLSLFormatLayout(SoTexture* texture); 00159 00160 private: 00161 virtual ~SoShaderParameterImage(); 00162 00163 private: 00164 int m_assignedUnit; 00165 }; 00166 00167