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 *** BORDEAUX, FRANCE *** 00018 *** ALL RIGHTS RESERVED *** 00019 **=======================================================================*/ 00020 /*======================================================================= 00021 ** Author : VSG (MMM 2015) 00022 **=======================================================================*/ 00023 00024 #ifndef SB_RENDER_ENGINE_MODE_H_ 00025 #define SB_RENDER_ENGINE_MODE_H_ 00026 00027 #include <Inventor/SbBase.h> 00028 00048 class SbRenderEngineMode 00049 { 00050 public: 00052 SbRenderEngineMode() 00053 :m_renderMode(OIV_UNKNOWN_RENDERING_MODE), m_isChildrenInherited(false) 00054 {} 00055 00059 enum RenderMode 00060 { 00065 OIV_UNKNOWN_RENDERING_MODE, 00066 00068 OIV_OPENINVENTOR_RENDERING, 00069 00071 OIV_OPENGL_COMPATIBILITY_RENDERING, 00072 00074 OIV_OPENGL_CORE_RENDERING 00075 }; 00076 00083 void setRenderMode(RenderMode renderMode) 00084 { 00085 m_renderMode = renderMode; 00086 } 00087 00089 RenderMode getRenderMode() const 00090 { 00091 if ( isNotDefined() ) 00092 return OIV_OPENINVENTOR_RENDERING; 00093 return m_renderMode; 00094 } 00095 00097 void setChildrenInherit(bool isChildrenInherited) 00098 { 00099 m_isChildrenInherited = isChildrenInherited; 00100 } 00101 00103 bool isChildrenInherit() const 00104 { 00105 return m_isChildrenInherited; 00106 } 00107 00109 bool isNotDefined() const 00110 { 00111 return (m_renderMode == OIV_UNKNOWN_RENDERING_MODE); 00112 } 00113 00118 static void enableWarnings(bool flag); 00119 00124 static void postInitWarning(const char *methodName); 00125 00126 private: 00127 RenderMode m_renderMode; 00128 bool m_isChildrenInherited; 00129 static int s_isWarningsEnabled; 00130 }; 00131 00132 00133 #endif // SB_RENDER_ENGINE_MODE_H_ 00134