OpenWalnut
1.5.0dev
|
This callback is useful to en-/disable nodes using the node mask based on properties. More...
#include <WGENodeMaskCallback.h>
Public Member Functions | |
WGENodeMaskCallback (std::shared_ptr< WBoolFlag > flag) | |
Creates new instance. More... | |
virtual | ~WGENodeMaskCallback () |
Destructor. More... | |
virtual void | operator() (osg::Node *node, osg::NodeVisitor *nv) |
This operator gets called by OSG every update cycle. More... | |
Private Types | |
typedef boost::signals2::signal< void() > | ReactivateSignal |
The type of signal used to reactivate the signal. More... | |
Private Member Functions | |
virtual void | activate () |
Gets called if m_flag changes. More... | |
Private Attributes | |
std::shared_ptr< WBoolFlag > | m_flag |
The flag controlling the node mask. More... | |
boost::signals2::connection | m_connection |
The subscription to the change signal of m_flag. More... | |
boost::signals2::connection | m_reactivateConnection |
This connection gets established during the deactivation in operator() to ensure re-activation. More... | |
ReactivateSignal | m_reactivateSignal |
The reactivation signal. More... | |
This callback is useful to en-/disable nodes using the node mask based on properties.
In contrast to WGEManagedGroupNode, this callback can be added to every kind of node. DO NOT use one instance of this class for multiple nodes. The problem is not very obvious. If a node gets deactivated, its node callback is inactive too. To reactive the node again, the callback somehow needs to remember which node it has deactivated. This is done during the first deactivation in update traversal.
Definition at line 44 of file WGENodeMaskCallback.h.
|
private |
The type of signal used to reactivate the signal.
Definition at line 87 of file WGENodeMaskCallback.h.
|
explicit |
Creates new instance.
flag | the bool property which controls activation. |
Definition at line 29 of file WGENodeMaskCallback.cpp.
References activate(), m_connection, and m_flag.
|
virtual |
|
privatevirtual |
Gets called if m_flag changes.
This handles activation of the node.
Definition at line 45 of file WGENodeMaskCallback.cpp.
References m_flag, and m_reactivateSignal.
Referenced by WGENodeMaskCallback().
|
virtual |
This operator gets called by OSG every update cycle.
node | the osg node |
nv | the node visitor |
Definition at line 53 of file WGENodeMaskCallback.cpp.
References m_flag, m_reactivateConnection, and m_reactivateSignal.
|
private |
The subscription to the change signal of m_flag.
Definition at line 77 of file WGENodeMaskCallback.h.
Referenced by WGENodeMaskCallback(), and ~WGENodeMaskCallback().
|
private |
The flag controlling the node mask.
Definition at line 72 of file WGENodeMaskCallback.h.
Referenced by activate(), operator()(), and WGENodeMaskCallback().
|
private |
This connection gets established during the deactivation in operator() to ensure re-activation.
Definition at line 82 of file WGENodeMaskCallback.h.
Referenced by operator()().
|
private |
The reactivation signal.
Definition at line 92 of file WGENodeMaskCallback.h.
Referenced by activate(), and operator()().