OpenWalnut  1.5.0dev
Public Member Functions | Public Attributes | List of all members
WMTemplate::SafeUpdateCallback Class Reference

Node callback to change the color of the shapes inside the root node. More...

+ Inheritance diagram for WMTemplate::SafeUpdateCallback:
+ Collaboration diagram for WMTemplate::SafeUpdateCallback:

Public Member Functions

 SafeUpdateCallback (WMTemplate *module)
 Constructor. More...
 
virtual void operator() (osg::Node *node, osg::NodeVisitor *nv)
 operator () - called during the update traversal. More...
 

Public Attributes

WMTemplatem_module
 Pointer used to access members of the module to modify the node. More...
 
bool m_initialUpdate
 Denotes whether the update callback is called the first time. More...
 

Detailed Description

Node callback to change the color of the shapes inside the root node.

For more details on this class, refer to the documentation in moduleMain().

Definition at line 319 of file WMTemplate.h.

Constructor & Destructor Documentation

◆ SafeUpdateCallback()

WMTemplate::SafeUpdateCallback::SafeUpdateCallback ( WMTemplate module)
inlineexplicit

Constructor.

Parameters
modulejust set the creating module as pointer for later reference.

Definition at line 327 of file WMTemplate.h.

Member Function Documentation

◆ operator()()

void WMTemplate::SafeUpdateCallback::operator() ( osg::Node *  node,
osg::NodeVisitor *  nv 
)
virtual

operator () - called during the update traversal.

Parameters
nodethe osg node
nvthe node visitor

Definition at line 773 of file WMTemplate.cpp.

References WMTemplate::m_aColor, m_initialUpdate, and m_module.

Member Data Documentation

◆ m_initialUpdate

bool WMTemplate::SafeUpdateCallback::m_initialUpdate

Denotes whether the update callback is called the first time.

It is especially useful to set some initial value even if the property has not yet changed.

Definition at line 350 of file WMTemplate.h.

Referenced by operator()().

◆ m_module

WMTemplate* WMTemplate::SafeUpdateCallback::m_module

Pointer used to access members of the module to modify the node.

Please do not use shared_ptr here as this would prevent deletion of the module as the callback contains a reference to it. It is safe to use a simple pointer here as callback get deleted before the module.

Definition at line 344 of file WMTemplate.h.

Referenced by operator()().


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