The Nebula Device 3: Graphics::View Class Reference

The Nebula Device 3

Graphics::View Class Reference

#include <view.h>

Inheritance diagram for Graphics::View:

Core::RefCounted


Detailed Description

A graphics View is used to render a Stage through a CameraEntity into a RenderTarget. Any number of views can be associated with the same Stage. Views may depend on other views. When a View is rendered, it will first ask the Views it depends on to render themselves. Subclasses of View may implement their own rendering strategies.

(C) 2007 Radon Labs GmbH

Public Member Functions

 View ()
 constructor
virtual ~View ()
 destructor
bool IsAttachedToServer () const
 return true if currently attached to graphics server
const Util::StringAtomGetName () const
 get human-readable name
void SetStage (const Ptr< Stage > &stage)
 set the stage this View is associated with
const Ptr< Stage > & GetStage () const
 get the stage this View is associated with
void SetCameraEntity (const Ptr< CameraEntity > &camera)
 set the CameraEntity this View looks through
const Ptr
< CameraEntity > & 
GetCameraEntity () const
 get the CameraEntity this View looks through
void SetRenderTarget (const Ptr< CoreGraphics::RenderTarget > &renderTarget)
 set the render target this view renders to
const Ptr
< CoreGraphics::RenderTarget > & 
GetRenderTarget () const
 get the render target this view renders to
void SetFrameShader (const Ptr< Frame::FrameShader > &frameShader)
 set the view's frame shader
const Ptr
< Frame::FrameShader > & 
GetFrameShader () const
 get the view's frame shader
void AddDependency (const Ptr< View > &view)
 add a view which this view depends on
const Util::Array
< Ptr< View > > & 
GetDependencies () const
 get all dependency views
virtual void UpdateVisibilityLinks ()
 update the visibility links for this view
virtual void Render ()
 render the view into its render target
virtual void RenderDebug ()
 render a debug view of the world
virtual void RenderDebugSimple ()
 render a debug view of the world, without begin and end shape renderering
int GetRefCount () const
 get the current refcount
void AddRef ()
 increment refcount by one
void Release ()
 decrement refcount and destroy object if refcount is zero
bool IsInstanceOf (const Rtti &rtti) const
 return true if this object is instance of given class
bool IsInstanceOf (const Util::String &className) const
 return true if this object is instance of given class by string
bool IsInstanceOf (const Util::FourCC &classFourCC) const
 return true if this object is instance of given class by fourcc
bool IsA (const Rtti &rtti) const
 return true if this object is instance of given class, or a derived class
bool IsA (const Util::String &rttiName) const
 return true if this object is instance of given class, or a derived class, by string
bool IsA (const Util::FourCC &rttiFourCC) const
 return true if this object is instance of given class, or a derived class, by fourcc
const Util::StringGetClassName () const
 get the class name
Util::FourCC GetClassFourCC () const
 get the class FourCC code

Static Public Member Functions

static void DumpRefCountingLeaks ()
 dump refcounting leaks, call at end of application (NEBULA3_DEBUG builds only!)

Protected Member Functions

void SetName (const Util::StringAtom &name)
 set a human-readable name of the view
virtual void OnAttachToServer ()
 called when attached to graphics server
virtual void OnRemoveFromServer ()
 called when detached from graphics server
void ResolveVisibleLights ()
 resolve visible lights
void ResolveVisibleModelNodeInstances ()
 resolve visibility for optimal batch rendering

Member Function Documentation

void Graphics::View::UpdateVisibilityLinks (  )  [virtual]

update the visibility links for this view

This method updates the visibility links for the view's camera. This method should usually be called before Render().

void Graphics::View::Render (  )  [virtual]

render the view into its render target

This method renders the current view into the render target. This method must be called sometimes after UpdateVisibilityLinks()

void Graphics::View::RenderDebug (  )  [virtual]

render a debug view of the world

Renders a debug visualization. Can be called alone or after Render().

void Graphics::View::RenderDebugSimple (  )  [virtual]

render a debug view of the world, without begin and end shape renderering

Renders a debug visualization. Must be called inside Begin and End of shaperenderer.

void Graphics::View::ResolveVisibleLights (  )  [protected]

resolve visible lights

This attaches visible lights to the light and shadow server.

Todo:
: currently this methods needs to go over all visible graphics entities to find the lights...

void Graphics::View::ResolveVisibleModelNodeInstances (  )  [protected]

resolve visibility for optimal batch rendering

Resolve all visible ModelNodeInstances by following the visibility links of our camera. This is necessary as preparation for rendering.

int Core::RefCounted::GetRefCount (  )  const [inline, inherited]

get the current refcount

Return the current refcount of the object.

void Core::RefCounted::AddRef (  )  [inline, inherited]

increment refcount by one

Increment the refcount of the object.

void Core::RefCounted::Release (  )  [inline, inherited]

decrement refcount and destroy object if refcount is zero

Decrement the refcount and destroy object if refcount is zero.

const Util::String & Core::RefCounted::GetClassName (  )  const [inline, inherited]

get the class name

Get the class name of the object.

Util::FourCC Core::RefCounted::GetClassFourCC (  )  const [inline, inherited]

get the class FourCC code

Get the class FourCC of the object.

void Core::RefCounted::DumpRefCountingLeaks (  )  [static, inherited]

dump refcounting leaks, call at end of application (NEBULA3_DEBUG builds only!)

This method should be called as the very last before an application exits.