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-2023 BY FEI S.A.S, *** 00017 *** BORDEAUX, FRANCE *** 00018 *** ALL RIGHTS RESERVED *** 00019 **=======================================================================*/ 00020 00021 #ifndef _SO_RENDER_AREA_CORE_ 00022 #define _SO_RENDER_AREA_CORE_ 00023 00024 #include <Inventor/sys/port.h> 00025 00026 #if defined(_WIN32) && !defined(OIV_DISABLE_AUTOLINK) && !defined(ViewerComponents_EXPORTS) && !defined(Inventor_EXPORTS) 00027 # if !defined(__VIEWER_COMPONENTS_LIB) 00028 # if defined(_DEBUG) 00029 # define __VIEWER_COMPONENTS_LIB "fei_inventor_ViewerComponentsD.lib" 00030 # else 00031 # define __VIEWER_COMPONENTS_LIB "fei_inventor_ViewerComponents.lib" 00032 # endif 00033 # endif 00034 # pragma comment(lib, __VIEWER_COMPONENTS_LIB) 00035 #endif 00036 00037 #include <Inventor/misc/SoRefCounter.h> 00038 #include <Inventor/SbLinear.h> 00039 #include <Inventor/actions/SoGLRenderAction.h> 00040 #include <Inventor/SbPImpl.h> 00041 #include <Inventor/nodes/SoInteractiveComplexity.h> 00042 #include <Inventor/ViewerComponents/SiRenderAreaAntialiasing.h> 00043 #include <Inventor/ViewerComponents/SiRenderAreaTransparency.h> 00044 #include <Inventor/ViewerComponents/SiRenderAreaStereo.h> 00045 #include <Inventor/ViewerComponents/SiRenderAreaInteractive.h> 00046 #include <Inventor/ViewerComponents/SiRenderArea.h> 00047 #include <Inventor/ViewerComponents/SiRenderAreaStillSuperSampling.h> 00048 00049 class SoGLContext; 00050 class SoSceneManager; 00051 class SoEvent; 00052 class SoStereoParameters; 00053 00054 SO_PIMPL_BASE_PUBLIC_DECLARATION(SoRenderAreaCore); 00055 00077 class SoRenderAreaCore : public SoRefCounter, public SiRenderAreaAntialiasing, public SiRenderAreaTransparency, 00078 public SiRenderAreaStereo, public SiRenderAreaInteractive, public SiRenderArea, 00079 public SiRenderAreaStillSuperSampling 00080 { 00081 00082 SO_PIMPL_BASE_PUBLIC_HEADER(SoRenderAreaCore); 00083 00084 public: 00085 00089 SoRenderAreaCore(SoGLContext* glContext); 00090 00096 virtual void setSceneGraph(SoNode *newScene); 00097 00101 virtual SoNode* getSceneGraph() const; 00102 00107 virtual SbBool processEvent(const SoEvent *event); 00108 00113 virtual SbBool processEvents(const std::vector<const SoEvent*>& eventList); 00114 00121 virtual RenderStatus render(); 00122 00127 virtual void setSize(const SbVec2i32& size); 00128 00132 virtual SbVec2i32 getSize() const; 00133 00137 virtual void setGLRenderAction( SoGLRenderAction* glAction ); 00138 00142 virtual SoGLRenderAction* getGLRenderAction() const; 00143 00153 virtual void setTransparencyType( SoGLRenderAction::TransparencyType type ); 00154 00158 virtual SoGLRenderAction::TransparencyType getTransparencyType() const; 00159 00163 SoSceneManager* getSceneManager() const; 00164 00165 #if 1 SoDEPRECATED 00171 virtual void setInteractiveMode(SoInteractiveComplexity::InteractiveMode mode); 00172 SoDEPRECATED 00177 virtual SoInteractiveComplexity::InteractiveMode getInteractiveMode() const; 00178 #endif 00192 virtual void setStereoParameters(SoStereoParameters* parameters); 00193 00197 virtual SoStereoParameters* getStereoParameters() const; 00198 00212 virtual void activateStereo(bool activate); 00213 00217 virtual bool isStereoActivated() const; 00218 00223 virtual void setAntialiasingMode(SoSceneManager::AntialiasingMode mode); 00224 00228 virtual SoSceneManager::AntialiasingMode getAntialiasingMode() const; 00229 00235 virtual void setAntialiasingQuality(float quality); 00236 00240 virtual float getAntialiasingQuality() const; 00241 00249 virtual void setClearPolicy(ClearPolicy policy); 00250 00254 virtual ClearPolicy getClearPolicy() const; 00255 00264 virtual void setClearColor(const SbColorRGBA& color); 00265 00269 virtual SbColorRGBA getClearColor() const; 00270 00277 virtual void setClearDepth(float depth); 00278 00282 virtual float getClearDepth() const; 00283 00287 virtual SbEventHandler<RenderEventArg&>& onStartRender(); 00288 00296 virtual void setStillSuperSamplingQuality(float quality); 00297 00301 virtual float getStillSuperSamplingQuality() const; 00302 00310 virtual void setStillSuperSamplingDelay(unsigned int delay); 00311 00315 virtual unsigned int getStillSuperSamplingDelay() const; 00316 00317 private: 00318 00322 void invalidateGLContext(); 00323 00327 SoGLContext* getGLContext() const; 00328 00329 00335 SoRenderAreaCore(); 00336 00337 private: 00338 00342 virtual ~SoRenderAreaCore(); 00343 00344 }; 00345 00346 #endif // _SO_RENDER_AREA_CORE_ 00347 00348 00349