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-2014 BY FEI S.A.S, *** 00017 *** MERIGNAC, FRANCE *** 00018 *** ALL RIGHTS RESERVED *** 00019 **=======================================================================*/ 00020 /*======================================================================= 00021 ** Author : C. OGNIER (Dec 2004) 00022 **=======================================================================*/ 00023 00024 00025 #ifndef _SO_RENDER_TO_TEXTURE_PROPERTY_ 00026 #define _SO_RENDER_TO_TEXTURE_PROPERTY_ 00027 00028 #include <Inventor/nodes/SoNode.h> 00029 #include <Inventor/fields/SoMFNode.h> 00030 #include <Inventor/fields/SoSFEnum.h> 00031 #include <Inventor/fields/SoSFColor.h> 00032 #include <Inventor/fields/SoMFPath.h> 00033 #include <Inventor/fields/SoSFVec2s.h> 00034 #include <Inventor/fields/SoSFTrigger.h> 00035 #include <Inventor/actions/SoGLRenderAction.h> 00036 #include <Inventor/sensors/SoFieldSensor.h> 00037 #include <Inventor/components/SoGLGraphicConfigTemplate.h> 00038 #include <Inventor/sys/SoGLType.h> 00039 #include <Inventor/helpers/SbGlContextHelper.h> 00040 00041 #include <SoDeprecationRules.h> 00042 00043 namespace inventor 00044 { 00045 namespace impl 00046 { 00047 class SoTextureCubeMapImpl; 00048 class SoTexture2Impl; 00049 } 00050 } 00051 00052 00053 SO_PIMPL_PUBLIC_DECLARATION(SoRenderToTextureProperty) 00054 00055 00056 00097 class SoRenderToTextureProperty : public SoNode 00098 { 00099 SO_NODE_HEADER(SoRenderToTextureProperty); 00100 SO_PIMPL_FINAL_PUBLIC_HEADER(SoRenderToTextureProperty) 00101 00102 public: 00103 00104 SoRenderToTextureProperty(); 00105 00107 enum UpdatePolicy { 00111 EACH_FRAME, 00116 WHEN_NEEDED, 00120 ON_TRIGGER 00121 }; 00122 00124 enum Component { 00129 RGB, 00133 RGB_TRANSPARENCY, 00134 RGB_ALPHA = RGB_TRANSPARENCY, 00138 DEPTH 00139 }; 00140 00141 00142 // Fields 00158 SoMFNode node; 00159 00175 SoMFPath path; 00176 00181 SoSFEnum updatePolicy; 00182 00186 SoSFColor backgroundColor; 00187 00192 SoSFVec2s size; 00193 00198 SoSFEnum component; 00199 00204 SoSFTrigger trigger; 00205 00209 void setGLRenderAction(SoGLRenderAction* ra); 00210 00214 SoGLRenderAction* getGLRenderAction() const; 00215 00216 #if 1 SoDEPRECATED 00219 void setGraphicConfigTemplate(SoGLGraphicConfigTemplate*) {} 00220 SoDEPRECATED 00222 SoGLGraphicConfigTemplate* getGraphicConfigTemplate() { return NULL; } 00223 SoDEPRECATED 00225 void setContextForSharing(SoGLContext*) {} 00226 00227 #endif 00231 private: 00232 virtual void GLRender(SoGLRenderAction *action); 00233 00234 private: 00235 static void initClass(); 00236 static void exitClass(); 00237 00239 virtual void notify( SoNotList *list ); 00240 00241 private: 00242 ~SoRenderToTextureProperty(); 00243 00244 // friendship to access SoRenderToTextureProperty::getImpl<> 00245 friend class SoTextureCubeMap; 00246 friend class inventor::impl::SoTextureCubeMapImpl; 00247 friend class SoTexture2; 00248 friend class inventor::impl::SoTexture2Impl; 00249 00250 }; 00251 00252 #endif /* _SO_RENDER_TO_TEXTURE_PROPERTY_ */ 00253