OpenWalnut  1.2.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Private Attributes | List of all members
WGEViewportCallback< T, Source > Class Template Reference

This callback is useful to update viewport information on several nodes supporting it. More...

#include <WGEViewportCallback.h>

+ Inheritance diagram for WGEViewportCallback< T, Source >:

Public Member Functions

 WGEViewportCallback (osg::ref_ptr< Source > reference)
 Creates new instance of viewport callback.
virtual ~WGEViewportCallback ()
 Destructor.
virtual void operator() (osg::Node *node, osg::NodeVisitor *nv)
 This operator gets called by OSG every update cycle.

Private Attributes

osg::ref_ptr< Source > m_reference
 The reference camera to use.

Detailed Description

template<typename T, typename Source = osg::Camera>
class WGEViewportCallback< T, Source >

This callback is useful to update viewport information on several nodes supporting it.

The specified type must support an setViewport method. This is especially useful to keep offscreen render cameras in sync with the scene cam or to update HUD viewport information. Note that the order of execution of callbacks for a node can cause problems as the new viewport might get set after it is needed.

Template Parameters
Tthe type supporting setViewport
Sourcethe type from who the viewport should be acquired by using osg::Viewport* getViewport()

Definition at line 42 of file WGEViewportCallback.h.

Constructor & Destructor Documentation

template<typename T , typename Source >
WGEViewportCallback< T, Source >::WGEViewportCallback ( osg::ref_ptr< Source >  reference)
explicit

Creates new instance of viewport callback.

Parameters
referenceset the viewport to the one of the reference camera.

Definition at line 74 of file WGEViewportCallback.h.

template<typename T , typename Source >
WGEViewportCallback< T, Source >::~WGEViewportCallback ( )
virtual

Destructor.

Definition at line 82 of file WGEViewportCallback.h.

Member Function Documentation

template<typename T , typename Source >
void WGEViewportCallback< T, Source >::operator() ( osg::Node *  node,
osg::NodeVisitor *  nv 
)
virtual

This operator gets called by OSG every update cycle.

It applies the viewport.

Parameters
nodethe osg node
nvthe node visitor

Definition at line 88 of file WGEViewportCallback.h.

Member Data Documentation

template<typename T , typename Source = osg::Camera>
osg::ref_ptr< Source > WGEViewportCallback< T, Source >::m_reference
private

The reference camera to use.

Definition at line 70 of file WGEViewportCallback.h.


The documentation for this class was generated from the following file: