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-2020 BY FEI S.A.S, *** 00017 *** BORDEAUX, FRANCE *** 00018 *** ALL RIGHTS RESERVED *** 00019 **=======================================================================*/ 00020 00021 #ifndef SI_RENDERAREA 00022 #define SI_RENDERAREA 00023 00024 #include <Inventor/nodes/SoNode.h> 00025 #include <Inventor/SbColorRGBA.h> 00026 #include <Inventor/SbVec.h> 00027 #include <Inventor/SbEventArg.h> 00028 #include <Inventor/SbEventHandler.h> 00029 00043 class SiRenderArea 00044 { 00045 00046 public: 00047 00054 virtual void setSceneGraph(SoNode *newScene) = 0; 00055 00059 virtual SoNode* getSceneGraph() const = 0; 00060 00064 enum ClearPolicy 00065 { 00067 NONE, 00069 COLORBUFFER, 00071 DEPTHBUFFER, 00073 COLORBUFFER_AND_DEPTHBUFFER 00074 }; 00075 00082 virtual void setClearPolicy(ClearPolicy policy) = 0; 00083 00087 virtual ClearPolicy getClearPolicy() const = 0; 00088 00095 virtual void setClearColor(const SbColorRGBA& color) = 0; 00096 00100 virtual SbColorRGBA getClearColor() const = 0; 00101 00108 virtual void setClearDepth(float depth) = 0; 00109 00113 virtual float getClearDepth() const = 0; 00114 00118 virtual void setSize(const SbVec2i32& size) = 0; 00119 00123 virtual SbVec2i32 getSize() const = 0; 00124 00128 enum RenderStatus 00129 { 00131 ABORTED, 00135 INTERACTIVE, 00139 STILL 00140 }; 00141 00146 virtual RenderStatus render() = 0; 00147 00151 struct RenderEventArg : public SbEventArg 00152 { 00153 public: 00154 RenderEventArg(SiRenderArea* source) : 00155 m_source(source) 00156 {} 00157 00158 SiRenderArea* getSource() const 00159 { 00160 return m_source; 00161 } 00162 private: 00163 SiRenderArea* m_source; 00164 }; 00165 00169 virtual SbEventHandler<RenderEventArg&>& onStartRender() = 0; 00170 }; 00171 00172 #endif // SI_RENDERAREA 00173