OpenWalnut  1.5.0dev
Public Member Functions | Private Attributes | List of all members
WGESwitchCallback< PropType > Class Template Reference

This callback is able to switch a osg::Switch node using a property. More...

#include <WGESwitchCallback.h>

+ Inheritance diagram for WGESwitchCallback< PropType >:
+ Collaboration diagram for WGESwitchCallback< PropType >:

Public Member Functions

 WGESwitchCallback (PropType prop)
 Creates new instance. More...
 
virtual ~WGESwitchCallback ()
 Destructor. More...
 
virtual void operator() (osg::Node *node, osg::NodeVisitor *nv)
 This operator gets called by OSG every update cycle. More...
 

Private Attributes

PropType m_prop
 The prop controlling the node switch. More...
 

Detailed Description

template<typename PropType>
class WGESwitchCallback< PropType >

This callback is able to switch a osg::Switch node using a property.

Although this callback is a template, only int and bool props are useful here. If a bool prop is used, the callback can trigger between child 0 and 1. Technically, WPropDouble is also possible.

Definition at line 36 of file WGESwitchCallback.h.

Constructor & Destructor Documentation

◆ WGESwitchCallback()

template<typename PropType >
WGESwitchCallback< PropType >::WGESwitchCallback ( PropType  prop)
explicit

Creates new instance.

Parameters
propthe property which controls switch.

Definition at line 68 of file WGESwitchCallback.h.

◆ ~WGESwitchCallback()

template<typename PropType >
WGESwitchCallback< PropType >::~WGESwitchCallback
virtual

Destructor.

Definition at line 75 of file WGESwitchCallback.h.

Member Function Documentation

◆ operator()()

template<typename PropType >
void WGESwitchCallback< PropType >::operator() ( osg::Node *  node,
osg::NodeVisitor *  nv 
)
virtual

This operator gets called by OSG every update cycle.

Parameters
nodethe osg node
nvthe node visitor

Definition at line 81 of file WGESwitchCallback.h.

Member Data Documentation

◆ m_prop

template<typename PropType >
PropType WGESwitchCallback< PropType >::m_prop
private

The prop controlling the node switch.

Definition at line 64 of file WGESwitchCallback.h.


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