OpenWalnut  1.5.0dev
Public Member Functions | Private Attributes | List of all members
WHeadSurfaceCallback Class Reference

OSG Update Callback to change the color of a head surface by changing its 1D texture coordinates when an event position changed. More...

#include <WHeadSurfaceCallback.h>

+ Inheritance diagram for WHeadSurfaceCallback:
+ Collaboration diagram for WHeadSurfaceCallback:

Public Member Functions

 WHeadSurfaceCallback (const std::vector< std::size_t > &channelIDs, WPropDouble colorSensitivity, std::shared_ptr< WFlag< std::shared_ptr< WEEGEvent > > > event)
 Constructor. More...
 
virtual void update (osg::NodeVisitor *, osg::Drawable *drawable)
 Callback method called by the NodeVisitor. More...
 

Private Attributes

double m_currentColorSensitivity
 the sensitivity of the color map which is currently used More...
 
double m_currentTime
 The time position which is currently used. More...
 
const std::vector< std::size_t > m_channelIDs
 the mapping from vertex indices to channel IDs More...
 
WPropDouble m_colorSensitivity
 The sensitivity of the color map as property. More...
 
std::shared_ptr< WFlag< std::shared_ptr< WEEGEvent > > > m_event
 event marking a special time position as WFlag More...
 

Detailed Description

OSG Update Callback to change the color of a head surface by changing its 1D texture coordinates when an event position changed.

Note
Only add it to a Geometry with a 1D texture!

Definition at line 44 of file WHeadSurfaceCallback.h.

Constructor & Destructor Documentation

◆ WHeadSurfaceCallback()

WHeadSurfaceCallback::WHeadSurfaceCallback ( const std::vector< std::size_t > &  channelIDs,
WPropDouble  colorSensitivity,
std::shared_ptr< WFlag< std::shared_ptr< WEEGEvent > > >  event 
)

Constructor.

Parameters
channelIDsthe mapping from vertex indices to channel IDs
colorSensitivityThe sensitivity of the color map as property. The color map ranges from -colorSensitivity to +colorSensitivity in microvolt.
eventevent marking a special time position as WFlag

Definition at line 39 of file WHeadSurfaceCallback.cpp.

Member Function Documentation

◆ update()

void WHeadSurfaceCallback::update ( osg::NodeVisitor *  ,
osg::Drawable *  drawable 
)
virtual

Callback method called by the NodeVisitor.

Changes the color of the head surface according to the event.

Parameters
drawableThe drawable this callback is connected to. Should be a Geometry with a 1D texture.

Definition at line 50 of file WHeadSurfaceCallback.cpp.

References m_channelIDs, m_colorSensitivity, m_currentColorSensitivity, m_currentTime, and m_event.

Member Data Documentation

◆ m_channelIDs

const std::vector< std::size_t > WHeadSurfaceCallback::m_channelIDs
private

the mapping from vertex indices to channel IDs

Definition at line 86 of file WHeadSurfaceCallback.h.

Referenced by update().

◆ m_colorSensitivity

WPropDouble WHeadSurfaceCallback::m_colorSensitivity
private

The sensitivity of the color map as property.

The color map ranges from -m_colorSensitivity to +m_colorSensitivity in microvolt.

Definition at line 92 of file WHeadSurfaceCallback.h.

Referenced by update().

◆ m_currentColorSensitivity

double WHeadSurfaceCallback::m_currentColorSensitivity
private

the sensitivity of the color map which is currently used

Definition at line 74 of file WHeadSurfaceCallback.h.

Referenced by update().

◆ m_currentTime

double WHeadSurfaceCallback::m_currentTime
private

The time position which is currently used.

The color is updated if the new time from the m_event is different to this.

Definition at line 81 of file WHeadSurfaceCallback.h.

Referenced by update().

◆ m_event

std::shared_ptr< WFlag< std::shared_ptr< WEEGEvent > > > WHeadSurfaceCallback::m_event
private

event marking a special time position as WFlag

Definition at line 97 of file WHeadSurfaceCallback.h.

Referenced by update().


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