52# include <Inventor/Qt/SoQtRenderArea.h>
54# include <Inventor/Win/SoWinRenderArea.h>
57#ifndef _SO_XT_RENDER_AREA_H_
58#define _SO_XT_RENDER_AREA_H_
62#include <Inventor/SbColor.h>
63#include <Inventor/sensors/SoNodeSensor.h>
64#include <Inventor/SoSceneManager.h>
65#include <Inventor/Xt/SoXtGLWidget.h>
66#include <Inventor/actions/SoGLRenderAction.h>
68#include <Inventor/nodes/SoCamera.h>
69#include <Inventor/nodes/SoFullSceneAntialiasing.h>
70#include <Inventor/SbElapsedTime.h>
72#include <Inventor/Gui/SoGuiRenderArea.h>
148 const char* name = NULL,
149 SbBool buildInsideParent = TRUE,
150 SbBool getMouseInput = TRUE,
151 SbBool getKeyboardInput = TRUE );
215 { m_guiRenderArea->setViewportRegion( newRegion ); }
221 {
return m_guiRenderArea->getViewportRegion(); }
239 {
return m_guiRenderArea->getTransparencyType(); }
250 SbBool fastEditDelayedObjects = FALSE);
256 {
return m_guiRenderArea->getFastEditSavePolicy(); }
288 { m_guiRenderArea->setClearBeforeRender( trueOrFalse, zbTrueOrFalse ); }
419 { appPostRenderCB = fcn; appPostRenderData = userData; }
426 { userData = appPostRenderData;
return appPostRenderCB; }
461 { m_guiRenderArea->setMPEGRecorder( recorder ); }
467 {
return m_guiRenderArea->getMPEGRecorder(); }
530 void setStereoElement();
534 SbBool isFloatingColorBufferSupported();
536 virtual SbBool isInteractive()
const;
550 float stereoBalance, stereoOffset;
551 SbBool stereoAbsoluteAdjustments;
603 virtual void redraw();
604 virtual void actualRedraw();
609 virtual void processEvent( XAnyEvent* anyevent );
610 virtual void initGraphic();
611 virtual void sizeChanged(
const SbVec2s& );
613 virtual void widgetChanged( SoWidget w );
615 SoWidget buildWidget( SoWidget parent );
618 virtual SbString getDefaultWidgetName()
const;
619 virtual SbString getDefaultTitle()
const;
620 virtual SbString getDefaultIconTitle()
const;
626 SoXtRenderAreaEventCB* defaultAppEventHandler;
627 void* defaultAppEventHandlerData;
628 SoXtRenderAreaEventCB* appEventHandler;
629 void* appEventHandlerData;
632 SbBool invokeAppCB( XAnyEvent* anyevent );
633 SbBool processInventorEvent( XAnyEvent* anyevent );
634 const SoEvent* translateAnyEvent( XAnyEvent* anyevent );
637 SoXtRenderAreaRenderCB* appPostRenderCB;
638 void* appPostRenderData;
647 void reinstallDevices( SoWidget newWidget );
649 static void selectionChangeCB(
void* p,
SoSelection* s );
650 SoWidget m_deviceWidget;
657 static void visibilityChangeCB(
void* pt,
SbBool visible );
662 void constructorCommon(
SbBool getMouseInput,
SbBool getKeyboardInput,
SbBool buildNow );
665 void constructorCommon2(
SbBool getMouseInput,
671 SbConfig* m_vrConfig;
675 ScTracking* m_tracking;
687 bool m_firstStdRedraw;
688 bool m_firstConnectedRedraw;
690 static void viewerUpdaterCB(
void*,
SoSensor* );
691 void updateFirstFrame();
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...
Allows nodes in a graph to receive input events.
<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.
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.
Abstract base class for input devices.
Translates and reports events for the keyboard device.
Translates and reports events for the mouse device.
Component for rendering Open Inventor scene graphs.
SbColor getBackgroundColor() const
Gets the background color for this window.
SoDEPRECATED void getAntialiasing(SbBool &smoothing, int &numPasses) const
Gets the antialiasing used for rendering.
virtual void setSceneGraph(SoNode *newScene)
Sets the scene graph to be rendered in this component's window.
SoGLRenderAction::InvalidateCacheMode getInvalidateCacheMode()
Returns the current cache invalidation mode.
SbBool isClearBeforeRender() const
Queries whether the window will be cleared before rendering starts.
void setClearBeforeRender(SbBool trueOrFalse, SbBool zbTrueOrFalse=TRUE)
Enables/prevents window clearing from happening before a rendering starts (default is clear TRUE).
virtual void setMPEGRecorder(SoMPEGRenderer *recorder)
Sets the recorder used for MPEG encoding.
void render()
Calling this forces the render area to be redrawn now.
uint32_t getRedrawPriority() const
Gets the priority of the redraw sensor.
void sendEvent(XAnyEvent *anEvent)
Sends the event to be processed by the renderArea.
SoSceneManager * getSceneManager() const
Gets the normal scene manager.
void registerDevice(SoXtDevice *d)
Registers interest in devices.
const SbGLShareContext getShareContext()
Returns the information needed to make OpenGL render contexts share OpenGL objects,...
SbBool isClearZBufferBeforeRender() const
Queries whether the depth buffer (sometimes called the Z buffer) will be cleared before rendering sta...
SoGLRenderAction::TransparencyType getTransparencyType() const
Gets the algorithm for rendering transparent objects.
void setFastEditSavePolicy(SoGLRenderAction::FastEditSavePolicy policy, SbBool fastEditDelayedObjects=FALSE)
Sets fast editing save policy to use when rendering.
~SoXtRenderArea()
Destructor.
void setInvalidateCacheMode(SoGLRenderAction::InvalidateCacheMode icm)
Enables or disables the invalidation of render caches.
const SbViewportRegion & getViewportRegion() const
Gets current viewport region to use for rendering.
void setBackgroundIndex(int index)
Sets the window background color when in color index mode.
virtual SoNode * getSceneGraph()
Gets the scene graph to be rendered in this component's window.
SoDEPRECATED void setAntialiasing(SbBool smoothing, int numPasses)
Enables smoothing and/or multi-pass antialiasing for rendering.
virtual SoMPEGRenderer * getMPEGRecorder() const
Returns the recorder used for the MPEG encoding.
void setAutoRedraw(SbBool trueOrFalse)
The render area will automatically redraw whenever something in the scene graph changes.
void setRedrawPriority(uint32_t priority)
Sets the priority of the redraw sensor.
void unregisterDevice(SoXtDevice *d)
Unregisters interest in devices.
SoXtRenderArea(SoWidget 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 getFloatingColorBuffer(SbBool &enable, FloatColorBufferSize &size)
Returns TRUE if floating point rendering is used and its precision.
void setBackgroundColor(const SbColor &c)
Sets the background color for this window.
SoXtRenderAreaRenderCB * getPostRenderCallback(const void *&userData) const
Gets the post-render callback function and data.
SoGLRenderAction::FastEditSavePolicy getFastEditSavePolicy() const
Returns fast editing save policy used when rendering.
SoGLRenderAction * getGLRenderAction() const
Gets the current GL render action.
void setSceneManager(SoSceneManager *sm)
Sets the normal scene manager.
void setTransparencyType(SoGLRenderAction::TransparencyType type)
Sets the algorithm for rendering transparent objects.
static uint32_t getDefaultRedrawPriority()
Gets the default priority number of the redraw sensor.
void setPostRenderCallback(SoXtRenderAreaRenderCB *fcn, void *userData=NULL)
Specifies a function to be called after the Open Inventor render traversal and immediately before the...
void setColorMap(int startIndex, int num, const SbColor *colors)
Sets the colors to use when displaying in color index mode.
void setGLRenderAction(SoGLRenderAction *ra)
Sets the GL render action to use.
SbBool SoXtRenderAreaRenderCB(void *userData, SoXtRenderArea *rendArea)
void setEventCallback(SoXtRenderAreaEventCB *fcn, void *userData=NULL)
X events which occur in the render area window are either directly handled by the viewer (when this i...
int getBackgroundIndex() const
Gets the window background color when in color index mode.
SbBool SoXtRenderAreaEventCB(void *userData, XAnyEvent *anyevent)
SbBool isAutoRedraw() const
Queries whether the render area will automatically redraw whenever something in the scene graph chang...
void setViewportRegion(const SbViewportRegion &newRegion)
Sets viewport region to use for rendering.
void setFloatingColorBuffer(SbBool enable, FloatColorBufferSize size=FLOAT_16_COLOR_BUFFER)
Enables/disables floating point rendering using 16- or 32-bit components.
void redrawOnSelectionChange(SoSelection *s)
Call this convenience method to have this render area redraw whenever the selection list changes in t...
void scheduleRedraw()
Schedules a redraw to happen sometime soon (as opposed to immediately).