osgViewer.ViewerBase

class osgViewer.ViewerBase
Represents

c++ class

Wraps

osgViewer::ViewerBase

Bases

osg.Object

osgViewer.ViewerBase is the view base class that is inherited by both osgViewer.Viewer and osgViewer.CompositeViewer.

Methods:

:setViewerStats(osg.Stats stats)

Get the viewer’s object used to collect various frame related timing and scene graph stats.

Параметры

stats (osg.Stats) –

:getViewerStats()

Get the viewer’s osg.Stats object.

Тип результата

osg.Stats

:readConfiguration(std.string filename)

Read the viewer configuration from a configuration file.

Параметры

filename (std.string) –

Тип результата

bool

:isRealized()

Get whether at least of one of this viewers windows are realized.

Тип результата

bool

:realize()

Set up windows and associated threads.

:setUseConfigureAffinity(bool flag)

Set whether the osgViewer.ViewerBase.setUpThreading() method should call osgViewer.ViewerBase.configureAffinity() to set up up the processor affinity of viewer threads.

Параметры

flag (bool) –

:getUseConfigureAffinity()

Get whether the osgViewer.ViewerBase.setUpThreading() method should call osgViewer.ViewerBase.configureAffinity() to set up up the processor affinity of viewer threads.

Тип результата

bool

:configureAffinity()

Analyse the viewer configuration and select an appropriate Affinity for main thread, and any graphics, camera threads and database pagers that are required.

:setThreadingModel(osgViewer.ViewerBase.ThreadingModel threadingModel)

Set the threading model the rendering traversals will use.

Параметры

threadingModel (osgViewer.ViewerBase.ThreadingModel) –

:getThreadingModel()

Get the threading model the rendering traversals will use.

Тип результата

osgViewer.ViewerBase.ThreadingModel

:suggestBestThreadingModel()

Let the viewer suggest the best threading model for the viewers camera/window setup and the hardware available.

Тип результата

osgViewer.ViewerBase.ThreadingModel

:setUpThreading()

Set up the threading and processor affinity as per the viewers threading model.

:areThreadsRunning()

Return true if viewer threads are running.

Тип результата

bool

:stopThreading()

Stop any threads being run by viewer.

:startThreading()

Start any threads required by the viewer.

:setDone(bool done)

Set the done flag to signal the viewer’s work is done and should exit the frame loop.

Параметры

done (bool) –

:done()

Return true if viewer’s work is done and should exit the frame loop.

Тип результата

bool

:setEventVisitor(osgGA.EventVisitor eventVisitor)

Параметры

eventVisitor (osgGA.EventVisitor) –

:getEventVisitor()

Тип результата

osgGA.EventVisitor

:setKeyEventSetsDone(int key)

Set the key event that the viewer checks on each frame to see if the viewer’s done flag should be set to signal end of viewers main loop. Default value is Escape (osgGA.GUIEventAdapter.KEY_Escape). Setting to 0 switches off the feature.

Параметры

key (int) –

:getKeyEventSetsDone()

Get the key event that the viewer checks on each frame to see if the viewer’s done flag.

Тип результата

int

:setQuitEventSetsDone(bool flag)

If the flag is true, the viewer set its done flag when a QUIT_APPLICATION is received, false disables this feature.

Параметры

flag (bool) –

:getQuitEventSetsDone()

Returns true if the viewer respond to the QUIT_APPLICATION-event

Тип результата

bool

:setReleaseContextAtEndOfFrameHint(bool hint)

Hint to tell the osgViewer.ViewerBase.renderingTraversals() method whether to call osgViewer.ViewerBase.releaseContext() on the last context that was made current by the thread calling osgViewer.ViewerBase.renderingTraversals(). Note, when running multi-threaded viewer no threads will be made current or release current. Setting this hint to false can enable the frame loop to be lazy about calling osgViewer.ViewerBase.makeCurrent() and osgViewer.ViewerBase.releaseContext() on each new frame, helping performance. However, if you frame loop is managing multiple graphics context all from the main frame thread then this hint must be left on, otherwise the wrong context could be left active, introducing errors in rendering.

Параметры

hint (bool) –

:getReleaseContextAtEndOfFrameHint()

Hint to tell the osgViewer.ViewerBase.renderingTraversals() method whether to call osgViewer.ViewerBase.releaseContext().

Тип результата

bool

:setUpdateVisitor(osgUtil.UpdateVisitor updateVisitor)

Параметры

updateVisitor (osgUtil.UpdateVisitor) –

:getUpdateVisitor()

Тип результата

osgUtil.UpdateVisitor

:addUpdateOperation(osg.Operation operation)

Add an update operation.

Параметры

operation (osg.Operation) –

:removeUpdateOperation(osg.Operation operation)

Параметры

operation (osg.Operation) –

:setRealizeOperation(osg.Operation operation)

Set the graphics operation to call on realization of the viewers graphics windows.

Параметры

operation (osg.Operation) –

:getRealizeOperation()

Get the graphics operation to call on realization of the viewers graphics windows.

Тип результата

osg.Operation

:setRunFrameScheme(osgViewer.ViewerBase.FrameScheme fs)

Параметры

fs (osgViewer.ViewerBase.FrameScheme) –

:getRunFrameScheme()

Тип результата

osgViewer.ViewerBase.FrameScheme

:setRunMaxFrameRate(double frameRate)

Параметры

frameRate (double) –

:getRunMaxFrameRate()

Тип результата

double

:run()

Execute a main frame loop. Equivalent to while (!viewer:done()) viewer:frame() Also calls osgViewer.ViewerBase.realize() if the viewer is not already realized, and installs trackball manipulator if one is not already assigned.

Тип результата

int

:checkNeedToDoFrame()

Check to see if the new frame is required, called by osgViewer.ViewerBase.run() when FrameScheme is set to osgViewer.ViewerBase.ON_DEMAND.

Тип результата

bool

:checkEvents()

Check to see if events have been received, return true if events are now available.

Тип результата

bool

:frame()

:frame(double simulationTime)

Render a complete new frame. Calls osgViewer.ViewerBase.advance(), osgViewer.ViewerBase.eventTraversal(), osgViewer.ViewerBase.updateTraversal(), osgViewer.ViewerBase.renderingTraversals().

Параметры

simulationTime (double) –

:advance()

:advance(double simulationTime)

Параметры

simulationTime (double) –

:eventTraversal()

:updateTraversal()

:renderingTraversals()

:getCameras()

Тип результата

osgViewer.ViewerBase.Cameras

:getCameras(bool onlyActive)

Параметры

onlyActive (bool) –

Тип результата

osgViewer.ViewerBase.Cameras

:getContexts()

Тип результата

osgViewer.ViewerBase.Contexts

:getContexts(bool onlyValid)

Параметры

onlyValid (bool) –

Тип результата

osgViewer.ViewerBase.Contexts

:getWindows()

Тип результата

osgViewer.ViewerBase.Windows

:getWindows(bool onlyValid)

Параметры

onlyValid (bool) –

Тип результата

osgViewer.ViewerBase.Windows

:getScenes()

Тип результата

osgViewer.ViewerBase.Scenes

:getScenes(bool onlyValid)

Параметры

onlyValid (bool) –

Тип результата

osgViewer.ViewerBase.Scenes

:getViews()

Тип результата

osgViewer.ViewerBase.Views

:getViews(bool onlyValid)

Параметры

onlyValid (bool) –

Тип результата

osgViewer.ViewerBase.Views

:elapsedTime()

Тип результата

double

:getViewerFrameStamp()

Тип результата

osg.FrameStamp