awViewing.Display Class Reference

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

List of all members.

Public Member Functions

  __init__ (bool interactive)
  This class exposes an abstract interface to a display sub-system.
  __del__ ()
bool  setDrawElements (int drawElements)
int  getDrawElements ()
  setScene (awScene::Node)
  setModelRoot (awScene::Node)
  setOverlayRoot (awScene::Node)
  setBackplateRoot (awScene::Node)
bool  initialize (awInput::EventDispatcher dispatcher)
  initialize must be called prior to invoking "realize".
  realize ()
  The realize method is intended to actually instantiate the target for the renderer (i.e.
bool  stopRequested ()
bool  step ()
  cleanup ()
bool  isDone ()
  isDone will only return true after the display has successfully cleaned up via cleanup().
bool  isResetted ()
  reset should be called whenever a scene is closed in order to release any cached state information.
  reset ()
bool  setEnableRT (bool state)
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)
  bindDynamicTextures ()
  releaseDynamicTextures ()
  bindDynamicTexture (int index)
  releaseDynamicTexture (int index)
CameraRef  getCamera (int viewport=0)
ViewStateRef  getViewState (int viewport=0)
AutoCam::CameraParameters  getAutoCamParameters ()
  setAutoCamParameters (AutoCam::CameraParameters params)
bool  pollAutoCamChangePending ()
  setAutoCamChangePending (bool state)
  getPointOfInterest (awLinear::Point pos)
  Todo: Move camera methods to a new Camera class...
  setPointOfInterest (awLinear::Point pos)
  getViewportRegion (float x, float y, float w, float h, float px, float py)
  getViewportRegion (float x, float y, float w, float h, int index)
  enableManualStereo (float winRegionLLXLeft, float winRegionLLYLeft, float winRegionURXLeft, float winRegionURYLeft, float winRegionLLXRight, float winRegionLLYRight, float winRegionURXRight, float winRegionURYRight, float winOffsetLeftX, float winOffsetLeftY, float winOffsetRightX, float winOffsetRightY, float camRotLeftX, float camRotLeftY, float camRotLeftZ, float camRotRightX, float camRotRightY, float camRotRightZ, float camMoveLeftX, float camMoveLeftY, float camMoveLeftZ, float camMoveRightX, float camMoveRightY, float camMoveRightZ)
  Instead of the built in stereo that works from an eye distance, figure out the offsets manually.
  disableManualStereo ()
  setTextureSizeLimit (int)
  Limit the texture size; -1 sets it to hardware limit It is recommended to use a power of two.
  setFrameTimeValue (float timeValue)
float  getFrameTimeValue ()
int  getRefreshRate ()
  setFullScreen (bool fullScreen)
  The fullscreen argument indicates whether the viewer should open a fullscreen window or a normal bordered window.
  toggleFullScreen ()
bool  isFullScreen ()
bool  isInteractive ()
  setMouseMode (MouseMode)
IntersectorRef  createIntersector (int drawElements)
  Allocate a new Intersector or Selector.
IntersectorRef  createIntersector (int drawElements, float x, float y)
BoxIntersectorRef  createBoxIntersector (int drawElements)
  setExitRequest (bool exit)
bool  getExitRequest ()
  setEnableRender (bool state)
  Rendering can be disabled without affecting the execution of the render/event loop...
bool  getEnableRender ()
  setAdvancePerFrame (bool state)
bool  getAdvancePerFrame ()
awInput::EventQueue  getEventQueue ()
awInput::EventDispatcher  getEventDispatcher ()
  setShortDescription (str description)
  Since the viewer can display help/about information we can give it a short description of this application.
  getShortDescription (str description)
  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)
  setDrawMode (DrawMode drawMode)
  Sets the draw mode to a specific mode declared by the DrawMode enum.
DrawMode  getDrawMode ()
bool  setShadingMode (ShadingMode shadingMode)
ShadingMode  getShadingMode ()
bool  setTransparencyTechnique (TransparencyTechnique technique)
TransparencyTechnique  getTransparencyTechnique ()
  showNormals (bool show)
  Turns on and off the display of normals.
  requestRedraw ()
  Request that the view be refreshed.
  setActivityStatus (bool state)
  The activity status indicator is used to prevent the display loop from pausing.
bool  getActivityStatus ()
bool  getIdleState ()
  printModel (str subrootName)
  getImplementation ()
  getImplementation allows those with access only to the base class interface to get at the native implementation for this display object.
int  numActiveViewports ()
SnapperRef  getSnapper ()
  setDefaultImagePath (str)
  If a texture can't be found, this will be used.
  setEnvironmentLight (awSupport::ValueParameterGroupRef envLight)
awSupport::ValueParameterGroupRef  getDisplayOptions ()
  setEnableCulling (bool enable)
  resetBackgroundColor ()
  Window background color.
  setBackgroundColor (float r, float g, float b, float a)
  getBackgroundColorAsDouble (float)
  getBackgroundColorAsFloat (float)
  getBackgroundColorAsRGB (float r, float g, float b)
  This one is useful for Python access with (r,g,b) = display.getBackgroundColorAsRGB().
  setEnableStereoFormat ()
bool  getEnableStereoFormat ()
  reloadBackplateImage ()

Protected Member Functions

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.
  synchronizeGraphs ()
  makeCurrent ()
  Make the viewer Rendering context current for the calling thread...
  setIdleState (bool state)
  checkIdleStatus (bool state)
  postDispatchChecks ()
  awaitDrawCompletion ()
  dispatchEvents ()
  setDirtyCamera (bool dirty)
bool  isDirtyCamera ()
  timerStart ()
  Convenience methods for performance monitoring.
  timerEnd (str what)
  onDrawElementsChanged (int drawElements)

Protected Attributes

awThread::Mutex  myLock
str  myShortDescription
awInput::EventQueue  myEventQueue
awInput::EventDispatcher  myEventDispatcher
awSupport::LocalTimer  myTimer
awLinear::Point  myPointOfInterest
DrawMode  myDrawMode
ShadingMode  myShadingMode
TransparencyTechnique  myTransparencyTechnique
float  mySwapTime
float  myIdleStartTime
float  myTimeReferenceValue
float  myTimeReferenceStart
int  myTimeReferenceCounter
bool  myIdleState
bool  myExitRequest
bool  myIsInteractive
bool  myAdvancePerFrame
bool  myDirtyCamera
bool  myActivityStatus
bool  myRenderEnabled
bool  myFrameStarted

Member Function Documentation

awViewing.Display.__init__ ( bool  interactive )

This class exposes an abstract interface to a display sub-system.

This could be an offline rendering system or an interactive display system.

awViewing.Display.__del__ ( )

Reimplemented in awViewing.Viewer.

bool awViewing.Display.setDrawElements ( int  drawElements )
int awViewing.Display.getDrawElements ( )
awViewing.Display.setScene ( awScene::Node  )
awViewing.Display.setModelRoot ( awScene::Node  )
awViewing.Display.setOverlayRoot ( awScene::Node  )
awViewing.Display.setBackplateRoot ( awScene::Node  )
bool awViewing.Display.initialize ( awInput::EventDispatcher  dispatcher )

initialize must be called prior to invoking "realize".

If initialize returns false then some undefined error occurred.

Sub-classes must invoke this base class method.

Reimplemented in awViewing.Viewer.

awViewing.Display.realize ( )

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 in awViewing.Viewer.

bool awViewing.Display.stopRequested ( )

Reimplemented in awViewing.Viewer.

bool awViewing.Display.step ( )

Reimplemented in awViewing.Viewer.

awViewing.Display.cleanup ( )

Reimplemented in awViewing.Viewer.

bool awViewing.Display.isDone ( )

isDone will only return true after the display has successfully cleaned up via cleanup().

Should be called only after realize().

Reimplemented in awViewing.Viewer.

bool awViewing.Display.isResetted ( )

reset should be called whenever a scene is closed in order to release any cached state information.

awViewing.Display.reset ( )
bool awViewing.Display.setEnableRT ( bool  state )

Reimplemented in awViewing.Viewer.

bool awViewing.Display.getEnableRT ( )

Reimplemented in awViewing.Viewer.

bool awViewing.Display.getRTUpdateMode ( )

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

See also: Refresh.

Reimplemented in awViewing.Viewer.

bool awViewing.Display.setEnableRTCluster ( bool  state )

Reimplemented in awViewing.Viewer.

bool awViewing.Display.getEnableRTCluster ( )

Reimplemented in awViewing.Viewer.

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

Reimplemented in awViewing.Viewer.

awViewing.Display.setRTMaxAODistanceDefault ( float  )

Reimplemented in awViewing.Viewer.

awViewing.Display.bindDynamicTextures ( )
awViewing.Display.releaseDynamicTextures ( )
awViewing.Display.bindDynamicTexture ( int  index )
awViewing.Display.releaseDynamicTexture ( int  index )
CameraRef awViewing.Display.getCamera ( int  viewport = 0 )

Reimplemented in awViewing.Viewer.

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

Reimplemented in awViewing.Viewer.

AutoCam::CameraParameters awViewing.Display.getAutoCamParameters ( )

Reimplemented in awViewing.Viewer.

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

Reimplemented in awViewing.Viewer.

bool awViewing.Display.pollAutoCamChangePending ( )

Reimplemented in awViewing.Viewer.

awViewing.Display.setAutoCamChangePending ( bool  state )

Reimplemented in awViewing.Viewer.

awViewing.Display.getPointOfInterest ( awLinear::Point  pos )

Todo: Move camera methods to a new Camera class...

awViewing.Display.setPointOfInterest ( awLinear::Point  pos )

Reimplemented in awViewing.Viewer.

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

Reimplemented in awViewing.Viewer.

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

Reimplemented in awViewing.Viewer.

awViewing.Display.enableManualStereo ( float  winRegionLLXLeft,
float  winRegionLLYLeft,
float  winRegionURXLeft,
float  winRegionURYLeft,
float  winRegionLLXRight,
float  winRegionLLYRight,
float  winRegionURXRight,
float  winRegionURYRight,
float  winOffsetLeftX,
float  winOffsetLeftY,
float  winOffsetRightX,
float  winOffsetRightY,
float  camRotLeftX,
float  camRotLeftY,
float  camRotLeftZ,
float  camRotRightX,
float  camRotRightY,
float  camRotRightZ,
float  camMoveLeftX,
float  camMoveLeftY,
float  camMoveLeftZ,
float  camMoveRightX,
float  camMoveRightY,
float  camMoveRightZ 
)

Instead of the built in stereo that works from an eye distance, figure out the offsets manually.

awViewing.Display.disableManualStereo ( )
awViewing.Display.setTextureSizeLimit ( int  )

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

Reimplemented in awViewing.Viewer.

awViewing.Display.setFrameTimeValue ( float  timeValue )
float awViewing.Display.getFrameTimeValue ( )
int awViewing.Display.getRefreshRate ( )
awViewing.Display.setFullScreen ( bool  fullScreen )

The fullscreen argument indicates whether the viewer should open a fullscreen window or a normal bordered window.

awViewing.Display.toggleFullScreen ( )
bool awViewing.Display.isFullScreen ( )
bool awViewing.Display.isInteractive ( )
awViewing.Display.setMouseMode ( MouseMode  )

Reimplemented in awViewing.Viewer.

IntersectorRef awViewing.Display.createIntersector ( int  drawElements )

Allocate a new Intersector or Selector.

The callers are responsible for deleting the returned objects.

Reimplemented in awViewing.Viewer.

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

Reimplemented in awViewing.Viewer.

BoxIntersectorRef awViewing.Display.createBoxIntersector ( int  drawElements )

Reimplemented in awViewing.Viewer.

awViewing.Display.setExitRequest ( bool  exit )
bool awViewing.Display.getExitRequest ( )
awViewing.Display.setEnableRender ( bool  state )

Rendering can be disabled without affecting the execution of the render/event loop...

bool awViewing.Display.getEnableRender ( )
awViewing.Display.setAdvancePerFrame ( bool  state )
bool awViewing.Display.getAdvancePerFrame ( )
awInput::EventQueue awViewing.Display.getEventQueue ( )
awInput::EventDispatcher awViewing.Display.getEventDispatcher ( )
awViewing.Display.setShortDescription ( str  description )

Since the viewer can display help/about information we can give it a short description of this application.

awViewing.Display.getShortDescription ( str  description )
awViewing.Display.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 in awViewing.Viewer.

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

Reimplemented in awViewing.Viewer.

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

Reimplemented in awViewing.Viewer.

awViewing.Display.setDrawMode ( DrawMode  drawMode )

Sets the draw mode to a specific mode declared by the DrawMode enum.

Reimplemented in awViewing.Viewer.

DrawMode awViewing.Display.getDrawMode ( )
bool awViewing.Display.setShadingMode ( ShadingMode  shadingMode )

Reimplemented in awViewing.Viewer.

ShadingMode awViewing.Display.getShadingMode ( )
bool awViewing.Display.setTransparencyTechnique ( TransparencyTechnique  technique )
TransparencyTechnique awViewing.Display.getTransparencyTechnique ( )
awViewing.Display.showNormals ( bool  show )

Turns on and off the display of normals.

awViewing.Display.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 in awViewing.Viewer.

awViewing.Display.setActivityStatus ( bool  state )

The activity status indicator is used to prevent the display loop from pausing.

Call this with a value of true when you know you will need a redraw immediately. This differs from request Redraw in that it does not queue an event. Setting the activity status to true takes the application out of the idle state.

Reimplemented in awViewing.Viewer.

bool awViewing.Display.getActivityStatus ( )
bool awViewing.Display.getIdleState ( )
awViewing.Display.printModel ( str  subrootName )

Reimplemented in awViewing.Viewer.

awViewing.Display.getImplementation ( )

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

Reimplemented in awViewing.Viewer.

int awViewing.Display.numActiveViewports ( )

Reimplemented in awViewing.Viewer.

SnapperRef awViewing.Display.getSnapper ( )

Reimplemented in awViewing.Viewer.

awViewing.Display.setDefaultImagePath ( str  )

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

Reimplemented in awViewing.Viewer.

awViewing.Display.setEnvironmentLight ( awSupport::ValueParameterGroupRef  envLight )

Reimplemented in awViewing.Viewer.

awSupport::ValueParameterGroupRef awViewing.Display.getDisplayOptions ( )
awViewing.Display.setEnableCulling ( bool  enable )

Reimplemented in awViewing.Viewer.

awViewing.Display.resetBackgroundColor ( )

Window background color.

awViewing.Display.setBackgroundColor ( float  r,
float  g,
float  b,
float  a 
)
awViewing.Display.getBackgroundColorAsDouble ( float  )
awViewing.Display.getBackgroundColorAsFloat ( float  )
awViewing.Display.getBackgroundColorAsRGB ( float  r,
float  g,
float  b 
)

This one is useful for Python access with (r,g,b) = display.getBackgroundColorAsRGB().

awViewing.Display.setEnableStereoFormat ( )
bool awViewing.Display.getEnableStereoFormat ( )
awViewing.Display.reloadBackplateImage ( )
bool awViewing.Display.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 in awViewing.Viewer.

bool awViewing.Display.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 in awViewing.Viewer.

awViewing.Display.synchronizeGraphs ( ) [protected]
awViewing.Display.makeCurrent ( ) [protected]

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

Reimplemented in awViewing.Viewer.

awViewing.Display.setIdleState ( bool  state ) [protected]
awViewing.Display.checkIdleStatus ( bool  state ) [protected]
awViewing.Display.postDispatchChecks ( ) [protected]
awViewing.Display.awaitDrawCompletion ( ) [protected]

Reimplemented in awViewing.Viewer.

awViewing.Display.dispatchEvents ( ) [protected]
awViewing.Display.setDirtyCamera ( bool  dirty ) [protected]
bool awViewing.Display.isDirtyCamera ( ) [protected]
awViewing.Display.timerStart ( ) [protected]

Convenience methods for performance monitoring.

No-ops with NDEBUG

awViewing.Display.timerEnd ( str  what ) [protected]
awViewing.Display.onDrawElementsChanged ( int  drawElements ) [protected]

Reimplemented in awViewing.Viewer.


Member Data Documentation

awThread::Mutex awViewing.Display.myLock [protected]
awInput::EventQueue awViewing.Display.myEventQueue [protected]
awInput::EventDispatcher awViewing.Display.myEventDispatcher [protected]
awSupport::LocalTimer awViewing.Display.myTimer [protected]
DrawMode awViewing.Display.myDrawMode [protected]
ShadingMode awViewing.Display.myShadingMode [protected]
TransparencyTechnique awViewing.Display.myTransparencyTechnique [protected]

awViewing.Display awViewing.Display awViewing.Display awViewing.Display awViewing.Display awViewing.Display awViewing.Display awViewing.Display awViewing.Display awViewing.Display
awViewing.Display awViewing.Display awViewing.Display awViewing.Display awViewing.Display awViewing.Display awViewing.Display awViewing.Display awViewing.Display awViewing.Display