osgViewer.ViewerBase¶
- class osgViewer.ViewerBase¶
- Represents
c++ class
- Wraps
osgViewer::ViewerBase
- Bases
osgViewer.ViewerBase
is the view base class that is inherited by bothosgViewer.Viewer
andosgViewer.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
) –
- :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 callosgViewer.ViewerBase.configureAffinity()
to set up up the processor affinity of viewer threads.- Параметры
flag (
bool
) –
- :getUseConfigureAffinity()¶
Get whether the
osgViewer.ViewerBase.setUpThreading()
method should callosgViewer.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.
- Тип результата
- :suggestBestThreadingModel()¶
Let the viewer suggest the best threading model for the viewers camera/window setup and the hardware available.
- Тип результата
- :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()¶
-
- Тип результата
- :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 to0
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 callosgViewer.ViewerBase.releaseContext()
on the last context that was made current by the thread callingosgViewer.ViewerBase.renderingTraversals()
. Note, when running multi-threaded viewer no threads will be made current or release current. Setting this hint tofalse
can enable the frame loop to be lazy about callingosgViewer.ViewerBase.makeCurrent()
andosgViewer.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 callosgViewer.ViewerBase.releaseContext()
.- Тип результата
bool
- :setUpdateVisitor(osgUtil.UpdateVisitor updateVisitor)¶
-
- Параметры
updateVisitor (
osgUtil.UpdateVisitor
) –
- :getUpdateVisitor()¶
-
- Тип результата
- :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.
- Тип результата
- :setRunFrameScheme(osgViewer.ViewerBase.FrameScheme fs)¶
-
- Параметры
- :getRunFrameScheme()¶
-
- Тип результата
- :setRunMaxFrameRate(double frameRate)¶
-
- Параметры
frameRate (
double
) –
- :getRunMaxFrameRate()¶
-
- Тип результата
double
- :run()¶
Execute a main frame loop. Equivalent to
while (!viewer:done()) viewer:frame()
Also callsosgViewer.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 toosgViewer.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()¶
-
- Тип результата
- :getCameras(bool onlyActive)
-
- Параметры
onlyActive (
bool
) –- Тип результата
- :getContexts()¶
-
- Тип результата
- :getContexts(bool onlyValid)
-
- Параметры
onlyValid (
bool
) –- Тип результата
- :getWindows()¶
-
- Тип результата
- :getWindows(bool onlyValid)
-
- Параметры
onlyValid (
bool
) –- Тип результата
- :getScenes()¶
-
- Тип результата
- :getScenes(bool onlyValid)
-
- Параметры
onlyValid (
bool
) –- Тип результата
- :getViews()¶
-
- Тип результата
- :getViews(bool onlyValid)
-
- Параметры
onlyValid (
bool
) –- Тип результата
- :elapsedTime()¶
-
- Тип результата
double
- :getViewerFrameStamp()¶
-
- Тип результата