27#ifndef _SO_QT_RENDERAREA_
28#define _SO_QT_RENDERAREA_
30#include <QtOpenGL/QGLColormap>
32#include <Inventor/Qt/OivQtCompat.h>
33#include <Inventor/Qt/SoQtGLWidget.h>
35#include <Inventor/SbColor.h>
36#include <Inventor/SoSceneManager.h>
37#include <Inventor/actions/SoGLRenderAction.h>
38#include <Inventor/nodes/SoCamera.h>
39#include <Inventor/SbElapsedTime.h>
41#include <Inventor/Gui/SoGuiRenderArea.h>
115 const char* name = NULL,
116 SbBool buildInsideParent = TRUE,
117 SbBool getMouseInput = TRUE,
118 SbBool getKeyboardInput = TRUE );
183 { m_guiRenderArea->setViewportRegion( newRegion ); }
189 {
return m_guiRenderArea->getViewportRegion(); }
207 {
return m_guiRenderArea->getTransparencyType(); }
218 SbBool fastEditDelayedObjects = FALSE);
224 {
return m_guiRenderArea->getFastEditSavePolicy(); }
256 { m_guiRenderArea->setClearBeforeRender( trueOrFalse, zbTrueOrFalse ); }
390 { appPostRenderCB = fcn; appPostRenderData = userData; }
397 { userData = appPostRenderData;
return appPostRenderCB; }
436 { m_guiRenderArea->setMPEGRecorder( recorder ); }
442 {
return m_guiRenderArea->getMPEGRecorder(); }
478 void setStereoElement();
479 virtual SbBool isInteractive()
const;
480 void redrawCleanUp();
491 float stereoBalance, stereoOffset;
492 SbBool stereoAbsoluteAdjustments;
543 virtual void redraw();
544 virtual void actualRedraw();
549 virtual void processEvent( QEvent* anyevent );
550 virtual void initGraphic();
551 virtual void sizeChanged(
const SbVec2s& );
553 virtual void widgetChanged( QWidget* w );
555 QWidget* buildWidget(QWidget* parent);
558 virtual SbString getDefaultWidgetName()
const;
559 virtual SbString getDefaultTitle()
const;
560 virtual SbString getDefaultIconTitle()
const;
570 void *defaultAppEventHandlerData;
572 void *appEventHandlerData;
575 SbBool invokeAppCB( QEvent* anyevent );
576 SbBool processInventorEvent( QEvent* anyevent );
577 const SoEvent* translateAnyEvent( QEvent* anyevent );
581 void *appPostRenderData;
584 SbBool m_isFloatingPointRendering;
588 void onFocusEvent(
SbBool hasFocus);
593#if defined(__linux__)
600 void reinstallDevices( QWidget* newWidget );
602 static void selectionChangeCB(
void* userData,
SoSelection* s );
603 QWidget* m_deviceWidget;
611 void constructorCommon(
SbBool getMouseInput,
615 void constructorCommon2(
SbBool getMouseInput,
634 bool m_firstStdRedraw;
635 bool m_firstConnectedRedraw;
637 static void viewerUpdaterCB(
void*,
SoSensor* );
638 void updateFirstFrame();
643 void visibilityChangeCB(
SbBool visible );
Class encapsulating information about an OpenGL context: a handle on an OpenGL context and its id.
List of generic (void *) pointers.
Class for smart character strings.
Class for representing a viewport.
Abstract base class for all actions.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Antialiasing par...
Base class for all events.
Renders a scene graph using Open Inventor's Render Engine.
FastEditSavePolicy
Fast edit traversal types.
InvalidateCacheMode
Invalidate cache mode.
TransparencyType
Transparency rendering algorithm.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Common algorithm...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Base class for g...
Abstract base class for all database nodes.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Abstract base cl...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Translates and r...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Translates and r...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Component for re...
SbBool isClearZBufferBeforeRender() const
Queries whether the depth buffer (sometimes called the Z buffer) will be cleared before rendering sta...
void setClearBeforeRender(SbBool trueOrFalse, SbBool zbTrueOrFalse=TRUE)
Enables/prevents window clearing from happening before a rendering starts (default is clear TRUE).
void setRedrawPriority(uint32_t priority)
Sets the priority of the redraw sensor.
void setColorMap(QGLColormap *cmap)
Sets the colors to use when displaying in color index mode.
void setGLRenderAction(SoGLRenderAction *ra)
Sets the GL render action to use.
void scheduleRedraw()
Schedules a redraw to happen sometime soon (as opposed to immediately).
void setBackgroundColor(const SbColor &c)
Sets the background color for this window.
void setViewportRegion(const SbViewportRegion &newRegion)
Sets viewport region to use for rendering.
SoGLRenderAction::FastEditSavePolicy getFastEditSavePolicy() const
Returns fast editing save policy used when rendering.
void setPostRenderCallback(SoQtRenderAreaRenderCB *fcn, void *userData=NULL)
Specifies a function to be called after the Open Inventor render traversal and immediately before the...
void sendEvent(QEvent *anEvent)
Sends the event to be processed by the renderArea.
SoSceneManager * getSceneManager() const
Gets the normal scene manager.
virtual SoMPEGRenderer * getMPEGRecorder() const
Returns the recorder used for MPEG encoding.
void setTransparencyType(SoGLRenderAction::TransparencyType type)
Sets the algorithm for rendering transparent objects.
void setBackgroundIndex(int index)
Sets the window background color when in color index mode.
int getBackgroundIndex() const
Gets the window background color when in color index mode.
SoQtRenderArea(QWidget *parent=NULL, const char *name=NULL, SbBool buildInsideParent=TRUE, SbBool getMouseInput=TRUE, SbBool getKeyboardInput=TRUE)
Constructor which is passed arguments which tell it whether to register the mouse and keyboard device...
void setSceneManager(SoSceneManager *sm)
Sets the normal scene manager.
SbBool isAutoRedraw() const
Queries whether the render area will automatically redraw whenever something in the scene graph chang...
void registerDevice(SoQtDevice *d)
Registers interest in devices.
virtual void setMPEGRecorder(SoMPEGRenderer *recorder)
Sets the recorder used for MPEG encoding.
SoGLRenderAction::TransparencyType getTransparencyType() const
Gets the algorithm for rendering transparent objects.
void redrawOnSelectionChange(SoSelection *s)
Call this convenience method to have this render area redraw whenever the selection list changes in t...
virtual SoNode * getSceneGraph()
Gets the scene graph to be rendered in this component's window.
const SbViewportRegion & getViewportRegion() const
Gets current viewport region to use for rendering.
void unregisterDevice(SoQtDevice *d)
Unregisters interest in devices.
void setFloatingColorBuffer(SbBool enable, FloatColorBufferSize size=FLOAT_16_COLOR_BUFFER)
Enables/disables floating point rendering using 16- or 32-bit components.
void setFastEditSavePolicy(SoGLRenderAction::FastEditSavePolicy policy, SbBool fastEditDelayedObjects=FALSE)
Sets fast editing save policy to use when rendering.
void setInvalidateCacheMode(SoGLRenderAction::InvalidateCacheMode icm)
Enables or disables the invalidation of render caches.
SoGLRenderAction * getGLRenderAction() const
Gets the current GL render action.
SoGLRenderAction::InvalidateCacheMode getInvalidateCacheMode()
Returns the current cache invalidation mode.
static SbBool isFloatingColorBufferSupported()
Returns TRUE if floating point rendering is available.
~SoQtRenderArea()
Destructor.
void getFloatingColorBuffer(SbBool &enable, FloatColorBufferSize &size)
Returns TRUE if floating point rendering is used and its precision.
SoQtRenderAreaRenderCB * getPostRenderCallback(const void *&userData) const
Gets the post-render callback function and data.
const SbGLShareContext getShareContext()
Returns the information needed to make OpenGL render contexts share OpenGL objects,...
SbBool SoQtRenderAreaEventCB(void *userData, QEvent *anyevent)
External event callback functions registered with the render area should be of this type.
void render()
Calling this forces the render area to be redrawn now.
SbBool isClearBeforeRender() const
Queries whether the window will be cleared before rendering starts.
virtual void setSceneGraph(SoNode *newScene)
Sets the scene graph to be rendered in this component's window.
SbBool SoQtRenderAreaRenderCB(void *userData, SoQtRenderArea *rendArea)
External post rendering callback functions registered with the render area should be of this type.
static uint32_t getDefaultRedrawPriority()
Gets the default priority number of the redraw sensor.
void setAutoRedraw(SbBool trueOrFalse)
The render area will automatically redraw whenever something in the scene graph changes.
uint32_t getRedrawPriority() const
Gets the priority of the redraw sensor.
SbColor getBackgroundColor() const
Gets the background color for this window.
void setEventCallback(SoQtRenderAreaEventCB *fcn, void *userData=NULL)
Windows messages which occur in the render area window are either directly handled by the viewer (whe...
Manages scene graph rendering and event handling.
static uint32_t getDefaultRedrawPriority()
Gets the default priority of the redraw sensor.
Manages a list of selected objects.
Abstract base class for Open Inventor sensors.
Sensor that triggers repeatedly at regular intervals.