00001 #pragma once
00002
00003 #include <Inventor/sys/port.h>
00004
00005 #if defined( _WIN32 ) && !defined( OIV_DISABLE_AUTOLINK ) && !defined( QtViewerComponents_EXPORTS )
00006 #if !defined( __QT_VIEWER_COMPONENTS_LIB )
00007 #if defined( _DEBUG )
00008 #define __QT_VIEWER_COMPONENTS_LIB "fei_inventor_QtViewerComponentsD.lib"
00009 #else
00010 #define __QT_VIEWER_COMPONENTS_LIB "fei_inventor_QtViewerComponents.lib"
00011 #endif
00012 #endif
00013 #pragma comment( lib, __QT_VIEWER_COMPONENTS_LIB )
00014 #endif
00015
00016 #include <Inventor/ViewerComponents/SoRenderAreaCore.h>
00017
00018 #include <QQuickFramebufferObject>
00019
00020 namespace openinventor {
00021 namespace inventor {
00022 namespace viewercomponents {
00023 namespace qt {
00024 namespace qml {
00025
00026 class QmlRenderer;
00027
00045 class QTVIEWERCOMPONENTS_API RenderArea : public QQuickFramebufferObject,
00046 public SiRenderArea
00047 {
00048 Q_OBJECT
00049
00050 public:
00051 RenderArea();
00052
00053 virtual ~RenderArea();
00054
00058 void setSceneGraph( SoNode* sceneGraph ) override;
00059
00063 SoNode* getSceneGraph() const override;
00064
00069 void setClearPolicy( ClearPolicy policy ) override;
00070
00074 ClearPolicy getClearPolicy() const override;
00075
00080 void setClearColor( const SbColorRGBA& color ) override;
00081
00085 SbColorRGBA getClearColor() const override;
00086
00091 void setClearDepth( float depth ) override;
00092
00096 float getClearDepth() const override;
00097
00101 void setSize( const SbVec2i32& size ) override;
00102
00106 SbVec2i32 getSize() const override;
00107
00111 virtual void setGLRenderAction( SoGLRenderAction* glAction );
00112
00117 SoGLRenderAction* getGLRenderAction() const;
00118
00123 virtual void setTransparencyType( SoGLRenderAction::TransparencyType type);
00124
00128 virtual SoGLRenderAction::TransparencyType getTransparencyType() const;
00129
00134 void setAntialiasingMode( SoSceneManager::AntialiasingMode mode );
00135
00139 SoSceneManager::AntialiasingMode getAntialiasingMode() const;
00140
00146 void setAntialiasingQuality( float quality );
00147
00151 float getAntialiasingQuality() const;
00152
00160 void setStillSuperSamplingQuality( float quality );
00161
00165 float getStillSuperSamplingQuality() const;
00166
00174 void setStillSuperSamplingDelay( unsigned int delay );
00175
00179 unsigned int getStillSuperSamplingDelay() const;
00180
00188 void activateStereo( bool activated );
00189
00197 bool isStereoActivated() const;
00198
00207 void setStereoParameters( SoStereoParameters* parameters );
00208
00214 SoStereoParameters* getStereoParameters() const;
00215
00222 bool isRawStereoAvailable();
00223
00224 private:
00229 RenderStatus render() override;
00230
00234 virtual bool event( QEvent* e );
00235
00239 SbEventHandler<RenderEventArg&>& onStartRender() override;
00240
00241
00242
00243
00244 Renderer* createRenderer() const override;
00245
00246 virtual void createRenderAreaCore( SbVec2i32 region );
00247
00252 mutable SoRef<SoRenderAreaCore> m_renderAreaCore;
00253
00255 SoNode* m_sceneGraph;
00256 ClearPolicy m_clearPolicy;
00257 SbColorRGBA m_color;
00258 float m_depth;
00259 SbVec2i32 m_size;
00260 bool m_stereo;
00261
00265 SoGLRenderAction* m_glRenderAction;
00266
00270 SoGLRenderAction::TransparencyType m_transparencyType;
00271
00275 SoSceneManager::AntialiasingMode m_antialiasingMode;
00276
00280 float m_antialiasingQuality;
00281
00285 unsigned int m_stillAntialiasingDelay;
00286
00290 float m_stillAntialiasingQuality;
00291
00292 public Q_SLOTS:
00293 void onWindowChanged( QQuickWindow* window );
00294 void onScreenChanged();
00295
00296 private : friend class QmlRenderer;
00297
00298 };
00299
00300 }
00301 }
00302 }
00303 }
00304 }
00305