Open Inventor Release 2024.1.0
 
Loading...
Searching...
No Matches
RenderArea.h
Go to the documentation of this file.
1#pragma once
2
3#include <Inventor/sys/port.h>
4
5#if defined( _WIN32 ) && !defined( OIV_DISABLE_AUTOLINK ) && !defined( QtViewerComponents_EXPORTS )
6#if !defined( __QT_VIEWER_COMPONENTS_LIB )
7#if defined( _DEBUG )
8#define __QT_VIEWER_COMPONENTS_LIB "fei_inventor_QtViewerComponentsD.lib"
9#else
10#define __QT_VIEWER_COMPONENTS_LIB "fei_inventor_QtViewerComponents.lib"
11#endif
12#endif
13#pragma comment( lib, __QT_VIEWER_COMPONENTS_LIB )
14#endif
15
17
18#include <QQuickFramebufferObject>
19
20namespace openinventor {
21namespace inventor {
22namespace viewercomponents {
23namespace qt {
24namespace qml {
25
26class QmlRenderer;
27
45class QTVIEWERCOMPONENTS_API RenderArea : public QQuickFramebufferObject,
46 public SiRenderArea
47{
48 Q_OBJECT
49
50public:
52
53 virtual ~RenderArea();
54
58 void setSceneGraph( SoNode* sceneGraph ) override;
59
63 SoNode* getSceneGraph() const override;
64
69 void setClearPolicy( ClearPolicy policy ) override;
70
74 ClearPolicy getClearPolicy() const override;
75
80 void setClearColor( const SbColorRGBA& color ) override;
81
85 SbColorRGBA getClearColor() const override;
86
91 void setClearDepth( float depth ) override;
92
96 float getClearDepth() const override;
97
101 void setSize( const SbVec2i32& size ) override;
102
106 SbVec2i32 getSize() const override;
107
111 virtual void setGLRenderAction( SoGLRenderAction* glAction );
112
118
124
129
135
140
146 void setAntialiasingQuality( float quality );
147
152
160 void setStillSuperSamplingQuality( float quality );
161
166
174 void setStillSuperSamplingDelay( unsigned int delay );
175
179 unsigned int getStillSuperSamplingDelay() const;
180
188 void activateStereo( bool activated );
189
197 bool isStereoActivated() const;
198
208
215
223
224private:
229 RenderStatus render() override;
230
234 virtual bool event( QEvent* e );
235
239 SbEventHandler<RenderEventArg&>& onStartRender() override;
240
241 /*
242 * Creates the QmlRenderer used to render the scene graph.
243 */
244 Renderer* createRenderer() const override;
245
246 virtual void createRenderAreaCore( SbVec2i32 region );
247
252 mutable SoRef<SoRenderAreaCore> m_renderAreaCore;
253
255 SoNode* m_sceneGraph;
256 ClearPolicy m_clearPolicy;
257 SbColorRGBA m_color;
258 float m_depth;
259 SbVec2i32 m_size;
260 bool m_stereo;
261
265 SoGLRenderAction* m_glRenderAction;
266
270 SoGLRenderAction::TransparencyType m_transparencyType;
271
275 SoSceneManager::AntialiasingMode m_antialiasingMode;
276
280 float m_antialiasingQuality;
281
285 unsigned int m_stillAntialiasingDelay;
286
290 float m_stillAntialiasingQuality;
291
292public Q_SLOTS:
293 void onWindowChanged( QQuickWindow* window );
295
296private : friend class QmlRenderer;
297
298};
299
300} // namespace qml
301} // namespace qt
302} // namespace viewercomponents
303} // namespace inventor
304} // namespace openinventor
ColorRGBA vector class.
Definition SbColorRGBA.h:61
Class representing an event.
2D vector class.
Definition SbVec.h:517
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> RenderArea inter...
RenderStatus
Returned by the render method.
ClearPolicy
Policy values to clear color and depth buffers beforing rendering.
Renders a scene graph using Open Inventor's Render Engine.
TransparencyType
Transparency rendering algorithm.
Abstract base class for all database nodes.
Definition SoNode.h:145
Smart pointer for any class inheriting SoRefCounter.
Definition SoRef.h:90
AntialiasingMode
Enum which indicates the desired antialiasing algorithm.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Stereo parameter...
SoSceneManager::AntialiasingMode getAntialiasingMode() const
SbColorRGBA getClearColor() const override
Gets the RGBA value used when the color buffer is cleared.
SoStereoParameters * getStereoParameters() const
Returns nullptr.
void setAntialiasingQuality(float quality)
Defines the antialiasing quality value.
void setAntialiasingMode(SoSceneManager::AntialiasingMode mode)
Defines the antialiasing mode.
void setSceneGraph(SoNode *sceneGraph) override
Sets the scene graph to render.
void setClearPolicy(ClearPolicy policy) override
Defines the color buffer and depth buffer clear policy.
SoNode * getSceneGraph() const override
Gets the scene graph to render.
void setStereoParameters(SoStereoParameters *parameters)
Defines the stereo parameters.
virtual void setTransparencyType(SoGLRenderAction::TransparencyType type)
Sets the global transparency algorithm to use when rendering.
void activateStereo(bool activated)
Activate/Deactivate stereo.
void setStillSuperSamplingQuality(float quality)
Sets quality for supersampling when "still" (not interacting).
void setClearDepth(float depth) override
Defines the depth value used when the depth buffer is cleared.
ClearPolicy getClearPolicy() const override
Gets the color buffer and depth buffer clear policy.
virtual void setGLRenderAction(SoGLRenderAction *glAction)
Defines the render action used for rendering.
virtual SoGLRenderAction::TransparencyType getTransparencyType() const
Gets the global transparency algorithm to use when rendering.
SoGLRenderAction * getGLRenderAction() const
Returns the render action used for rendering.
void setStillSuperSamplingDelay(unsigned int delay)
Sets delay for supersampling when "still" (not interacting).
void setSize(const SbVec2i32 &size) override
Defines the size used for rendering.
void setClearColor(const SbColorRGBA &color) override
Defines the RGBA value used when the color buffer is cleared.
SbVec2i32 getSize() const override
Gets the size used for rendering.
float getClearDepth() const override
Gets the depth value used when the depth buffer is cleared.
size_t size() const
#define QTVIEWERCOMPONENTS_API
Definition port.h:387