awViewing.Viewer Class Reference

Inheritance diagram for awViewing.Viewer:
Inheritance graph
[legend]

List of all members.

Public Member Functions

  __init__ ()
  This class encapsulates the creation of a window for viewing a scene file specified as an argument.
  __del__ ()
bool  initialize (awInput::EventDispatcher dispatcher)
  initialize must be called prior to invoking "realize".
bool  stopRequested ()
  Do not use the following methods if you plan to call either "run" or "runAsynchronous".
bool  step ()
  cleanup ()
bool  isDone ()
  isDone should only be used after realize().
bool  run ()
  The run method is a convenience function for clients that don't wish to control the render loop themselves.
bool  runAsynchronous ()
  runAsynchronous is similar to run except that it first spawns a new thread in which to run the viewer loop.
bool  waitAsynchronous ()
CameraRef  getCamera (int viewport=0)
ViewStateRef  getViewState (int viewport=0)
  setMouseMode (MouseMode)
  clearButtonState ()
IntersectorRef  createIntersector (int drawElements)
  Allocate a new Intersector or Selector.
IntersectorRef  createIntersector (int drawElements, float x, float y)
BoxIntersectorRef  createBoxIntersector (int drawElements)
  setPositionAndSize (int x, int y, int width, int height)
  Methods for setting the Position and size of the display CameraID is the index of the camera, starting at zero.
  getPositionAndSize (int x, int y, int width, int height)
  getWindowSize (int width, int height)
  setAutoCam (awViewing::AutoCamInterface)
awViewing::AutoCamInterface  getAutoCam ()
AutoCam::CameraParameters  getAutoCamParameters ()
  setAutoCamParameters (AutoCam::CameraParameters params)
bool  pollAutoCamChangePending ()
  setAutoCamChangePending (bool state)
  setAutoCamWalking (bool state)
bool  getAutoCamWalking ()
  setDrawMode (DrawMode drawMode)
  Changes the draw mode.
  setSelectionDrawMode (DrawMode drawMode)
DrawMode  getSelectionDrawMode ()
bool  setShadingMode (ShadingMode shadingMode)
  requestRedraw ()
  Request that the view be refreshed.
  printModel (str subrootName)
  printShadows ()
  setParentWindow (long win)
  This method sets the parent window within which the viewer window will be created.
bool  hasParentWindow ()
  Test whether the viewer has a parent window.
NativeWindow  getNativeWindow ()
  setDefaultImagePath (str)
  If a texture can't be found, this will be used.
  getImplementation ()
  getImplementation allows those with access only to the base class interface to get at the native implemenation for this display object.
SnapperRef  getSnapper ()
  setNumActiveViewports (int i)
int  numActiveViewports ()
  getViewportRegion (float x, float y, float w, float h, float px, float py)
  getViewportRegion (float x, float y, float w, float h, int index)
  setActivityStatus (bool state)
  setActivityStatus overrides our base class so we can do something extra.
  userActivity (awInput::EventQueue)
  userActivity implements the EventQueueClient pure virtual interface.
  enableClientMode (bool flag)
bool  isClientModeEnabled ()
  enableSynchronizedSwap (bool flag)
bool  isSynchronizedSwapEnabled ()
  syncSwapBuffers ()
  computeSWAALevelForThisFrame ()
  setPointOfInterest (awLinear::Point pos)
  setTextureSizeLimit (int)
  Limit the texture size; -1 sets it to hardware limit It is recommended to use a power of two.
bool  setEnableRT (bool state)
  setEnableRT will switch in/out of Rapid RT rendering:.
bool  getEnableRT ()
bool  getRTUpdateMode ()
  The RT update mode indicates whether Rapid RT shaders are being updated synchronously with non-RT shaders.
bool  setEnableRTCluster (bool state)
bool  getEnableRTCluster ()
  setRTCluster (str host, int port, int threads)
  setRTMaxAODistanceDefault (float)
int  getRTCurrentProgressTime ()
  Returns the time in seconds since the progressive rendering restarted.
awOGS::StyleProxyRef  getStyleProxy (int viewportIndex=0)
awOGS::SSAOProxyRef  getSSAOProxy (int viewportIndex=0)
awOGS::RapidRTProxyRef  getRapidRTProxy (int viewportIndex=0)
awOGS::RapidRTProxyRef  getSnapperRapidRTProxy ()
  setUseFade (bool value)
  setFadeFactor (float value)
  setFadeColor (float r, float g, float b)
  setEnableCulling (bool enable)
  shutDown ()
awSupport::DrawCacheMapRef  getDrawCache ()
  setDrawCache (awSupport::DrawCacheMapRef)
  resetDrawCache ()
  saveDrawCache (str dir, bool isSaveCurrent)
  setScriptRunning (bool running)
bool  getScriptRunning ()
bool  hasShadowCaster (awScene::ShadowCasterRef caster)
awScene::ShadowCasterRef  addShadowCaster (awScene::ShadowCasterRef caster)
  setEnvironmentLight (awSupport::ValueParameterGroupRef envLight)
  ApplyBloomParameters (NativeRenderer renderer)

Protected Member Functions

bool  computeCurrentSWAALevel ()
  awaitDrawCompletion ()
bool  checkBusy ()
bool  ifReallyIdleThenSleep ()
  realize ()
  The realize method is intended to actually instantiate the target for the renderer (i.e.
bool  renderFrame (float time)
  Sub-classes should implement renderFrame to actually draw the current frames image.
bool  update ()
  Update performs scene graph modifications after each frame has completed rendering.
  makeCurrent ()
  Make the viewer Rendering context current for the calling thread...
int  getViewportIndex (float x, float y)
  updateViewportsRegions ()
  onDrawElementsChanged (int drawElements)

Member Function Documentation

awViewing.Viewer.__init__ ( )

This class encapsulates the creation of a window for viewing a scene file specified as an argument.

awViewing.Viewer.__del__ ( )

Reimplemented from awViewing.Display.

bool awViewing.Viewer.initialize ( awInput::EventDispatcher  dispatcher )

initialize must be called prior to invoking "realize".

If initialize returns false then some undefined error likely occurred.

Reimplemented from awViewing.Display.

bool awViewing.Viewer.stopRequested ( )

Do not use the following methods if you plan to call either "run" or "runAsynchronous".

Reimplemented from awViewing.Display.

bool awViewing.Viewer.step ( )

Reimplemented from awViewing.Display.

awViewing.Viewer.cleanup ( )

Reimplemented from awViewing.Display.

bool awViewing.Viewer.isDone ( )

isDone should only be used after realize().

Reimplemented from awViewing.Display.

bool awViewing.Viewer.run ( )

The run method is a convenience function for clients that don't wish to control the render loop themselves.

It basically does this: realize(); while( !stopRequested() ) step(); cleanup(); It will return false if it was unable to start properly.

bool awViewing.Viewer.runAsynchronous ( )

runAsynchronous is similar to run except that it first spawns a new thread in which to run the viewer loop.

This call is synchronized so that the calling thread will not return from this method until after the viewer has been realized in the new thread. waitSynchronous is the complementary method, which causes the spawned thread to join the calling thread. The value returned from the asynchronous call to the run method is returned. If this is false the viewer did not run successfully.

bool awViewing.Viewer.waitAsynchronous ( )
CameraRef awViewing.Viewer.getCamera ( int  viewport = 0 )

Reimplemented from awViewing.Display.

ViewStateRef awViewing.Viewer.getViewState ( int  viewport = 0 )

Reimplemented from awViewing.Display.

awViewing.Viewer.setMouseMode ( MouseMode  )

Reimplemented from awViewing.Display.

awViewing.Viewer.clearButtonState ( )
IntersectorRef awViewing.Viewer.createIntersector ( int  drawElements )

Allocate a new Intersector or Selector.

The callers are responsible for deleting the returned objects.

Reimplemented from awViewing.Display.

IntersectorRef awViewing.Viewer.createIntersector ( int  drawElements,
float  x,
float  y 
)

Reimplemented from awViewing.Display.

BoxIntersectorRef awViewing.Viewer.createBoxIntersector ( int  drawElements )

Reimplemented from awViewing.Display.

awViewing.Viewer.setPositionAndSize ( int  x,
int  y,
int  width,
int  height 
)

Methods for setting the Position and size of the display CameraID is the index of the camera, starting at zero.

Position (x,y)=(0,0) is the bottom left corner of the screen. Height and width are in pixels and must be greater than zero.

Reimplemented from awViewing.Display.

awViewing.Viewer.getPositionAndSize ( int  x,
int  y,
int  width,
int  height 
)

Reimplemented from awViewing.Display.

awViewing.Viewer.getWindowSize ( int  width,
int  height 
)

Reimplemented from awViewing.Display.

awViewing.Viewer.setAutoCam ( awViewing::AutoCamInterface  )
awViewing::AutoCamInterface awViewing.Viewer.getAutoCam ( )
AutoCam::CameraParameters awViewing.Viewer.getAutoCamParameters ( )

Reimplemented from awViewing.Display.

awViewing.Viewer.setAutoCamParameters ( AutoCam::CameraParameters  params )

Reimplemented from awViewing.Display.

bool awViewing.Viewer.pollAutoCamChangePending ( )

Reimplemented from awViewing.Display.

awViewing.Viewer.setAutoCamChangePending ( bool  state )

Reimplemented from awViewing.Display.

awViewing.Viewer.setAutoCamWalking ( bool  state )
bool awViewing.Viewer.getAutoCamWalking ( )
awViewing.Viewer.setDrawMode ( DrawMode  drawMode )

Changes the draw mode.

If the drawmode is set to wireframe, the scene root will exclude the environment from rendering.

Reimplemented from awViewing.Display.

awViewing.Viewer.setSelectionDrawMode ( DrawMode  drawMode )
DrawMode awViewing.Viewer.getSelectionDrawMode ( )
bool awViewing.Viewer.setShadingMode ( ShadingMode  shadingMode )

Reimplemented from awViewing.Display.

awViewing.Viewer.requestRedraw ( )

Request that the view be refreshed.

If the application is in an idle state, request redraw does not cause it to get out of idle state.

Reimplemented from awViewing.Display.

awViewing.Viewer.printModel ( str  subrootName )

Reimplemented from awViewing.Display.

awViewing.Viewer.printShadows ( )
awViewing.Viewer.setParentWindow ( long  win )

This method sets the parent window within which the viewer window will be created.

We will create the view window with the same size as this parent window.

bool awViewing.Viewer.hasParentWindow ( )

Test whether the viewer has a parent window.

NativeWindow awViewing.Viewer.getNativeWindow ( )
awViewing.Viewer.setDefaultImagePath ( str  )

If a texture can't be found, this will be used.

Reimplemented from awViewing.Display.

awViewing.Viewer.getImplementation ( )

getImplementation allows those with access only to the base class interface to get at the native implemenation for this display object.

Reimplemented from awViewing.Display.

SnapperRef awViewing.Viewer.getSnapper ( )

Reimplemented from awViewing.Display.

awViewing.Viewer.setNumActiveViewports ( int  i )
int awViewing.Viewer.numActiveViewports ( )

Reimplemented from awViewing.Display.

awViewing.Viewer.getViewportRegion ( float  x,
float  y,
float  w,
float  h,
float  px,
float  py 
)

Reimplemented from awViewing.Display.

awViewing.Viewer.getViewportRegion ( float  x,
float  y,
float  w,
float  h,
int  index 
)

Reimplemented from awViewing.Display.

awViewing.Viewer.setActivityStatus ( bool  state )

setActivityStatus overrides our base class so we can do something extra.

Reimplemented from awViewing.Display.

awViewing.Viewer.userActivity ( awInput::EventQueue  )

userActivity implements the EventQueueClient pure virtual interface.

awViewing.Viewer.enableClientMode ( bool  flag )
bool awViewing.Viewer.isClientModeEnabled ( )
awViewing.Viewer.enableSynchronizedSwap ( bool  flag )
bool awViewing.Viewer.isSynchronizedSwapEnabled ( )
awViewing.Viewer.syncSwapBuffers ( )
awViewing.Viewer.computeSWAALevelForThisFrame ( )
awViewing.Viewer.setPointOfInterest ( awLinear::Point  pos )

Reimplemented from awViewing.Display.

awViewing.Viewer.setTextureSizeLimit ( int  )

Limit the texture size; -1 sets it to hardware limit It is recommended to use a power of two.

Reimplemented from awViewing.Display.

bool awViewing.Viewer.setEnableRT ( bool  state )

setEnableRT will switch in/out of Rapid RT rendering:.

Reimplemented from awViewing.Display.

bool awViewing.Viewer.getEnableRT ( )

Reimplemented from awViewing.Display.

bool awViewing.Viewer.getRTUpdateMode ( )

The RT update mode indicates whether Rapid RT shaders are being updated synchronously with non-RT shaders.

See also: Refresh.

Reimplemented from awViewing.Display.

bool awViewing.Viewer.setEnableRTCluster ( bool  state )

Reimplemented from awViewing.Display.

bool awViewing.Viewer.getEnableRTCluster ( )

Reimplemented from awViewing.Display.

awViewing.Viewer.setRTCluster ( str  host,
int  port,
int  threads 
)

Reimplemented from awViewing.Display.

awViewing.Viewer.setRTMaxAODistanceDefault ( float  )

Reimplemented from awViewing.Display.

int awViewing.Viewer.getRTCurrentProgressTime ( )

Returns the time in seconds since the progressive rendering restarted.

awOGS::StyleProxyRef awViewing.Viewer.getStyleProxy ( int  viewportIndex = 0 )
awOGS::SSAOProxyRef awViewing.Viewer.getSSAOProxy ( int  viewportIndex = 0 )
awOGS::RapidRTProxyRef awViewing.Viewer.getRapidRTProxy ( int  viewportIndex = 0 )
awOGS::RapidRTProxyRef awViewing.Viewer.getSnapperRapidRTProxy ( )
awViewing.Viewer.setUseFade ( bool  value )
awViewing.Viewer.setFadeFactor ( float  value )
awViewing.Viewer.setFadeColor ( float  r,
float  g,
float  b 
)
awViewing.Viewer.setEnableCulling ( bool  enable )

Reimplemented from awViewing.Display.

awViewing.Viewer.shutDown ( )
awSupport::DrawCacheMapRef awViewing.Viewer.getDrawCache ( )
awViewing.Viewer.setDrawCache ( awSupport::DrawCacheMapRef  )
awViewing.Viewer.resetDrawCache ( )
awViewing.Viewer.saveDrawCache ( str  dir,
bool  isSaveCurrent 
)
awViewing.Viewer.setScriptRunning ( bool  running )
bool awViewing.Viewer.getScriptRunning ( )
bool awViewing.Viewer.hasShadowCaster ( awScene::ShadowCasterRef  caster )
awScene::ShadowCasterRef awViewing.Viewer.addShadowCaster ( awScene::ShadowCasterRef  caster )
awViewing.Viewer.setEnvironmentLight ( awSupport::ValueParameterGroupRef  envLight )

Reimplemented from awViewing.Display.

awViewing.Viewer.ApplyBloomParameters ( NativeRenderer  renderer )
bool awViewing.Viewer.computeCurrentSWAALevel ( ) [protected]
awViewing.Viewer.awaitDrawCompletion ( ) [protected]

Reimplemented from awViewing.Display.

bool awViewing.Viewer.checkBusy ( ) [protected]
bool awViewing.Viewer.ifReallyIdleThenSleep ( ) [protected]
awViewing.Viewer.realize ( ) [protected]

The realize method is intended to actually instantiate the target for the renderer (i.e.

window or pbuffer) and any support required to run the display context. e.g. window message handling.

Reimplemented from awViewing.Display.

bool awViewing.Viewer.renderFrame ( float  time ) [protected]

Sub-classes should implement renderFrame to actually draw the current frames image.

This method is called from step after dispatching all pending events.

Reimplemented from awViewing.Display.

bool awViewing.Viewer.update ( ) [protected]

Update performs scene graph modifications after each frame has completed rendering.

This base class method should be called by any sub-class overrides. Returns true as long as the stopRequested() flag is not set.

Reimplemented from awViewing.Display.

awViewing.Viewer.makeCurrent ( ) [protected]

Make the viewer Rendering context current for the calling thread...

Reimplemented from awViewing.Display.

int awViewing.Viewer.getViewportIndex ( float  x,
float  y 
) [protected]
awViewing.Viewer.updateViewportsRegions ( ) [protected]
awViewing.Viewer.onDrawElementsChanged ( int  drawElements ) [protected]

Reimplemented from awViewing.Display.


awViewing.Viewer awViewing.Viewer awViewing.Viewer awViewing.Viewer awViewing.Viewer awViewing.Viewer awViewing.Viewer awViewing.Viewer awViewing.Viewer awViewing.Viewer
awViewing.Viewer awViewing.Viewer awViewing.Viewer awViewing.Viewer awViewing.Viewer awViewing.Viewer awViewing.Viewer awViewing.Viewer awViewing.Viewer awViewing.Viewer