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

OSG Update Callback to change the color of an electrode position when the event position changed. More...

#include <WElectrodePositionCallback.h>

+ Inheritance diagram for WElectrodePositionCallback:
+ Collaboration diagram for WElectrodePositionCallback:

Public Member Functions

 WElectrodePositionCallback (std::size_t channelID, WPropDouble colorSensitivity, std::shared_ptr< WFlag< std::shared_ptr< WEEGEvent > > > event, osg::ref_ptr< const osgSim::ScalarsToColors > colorMap)
 Constructor. More...
 
virtual void update (osg::NodeVisitor *, osg::Drawable *drawable)
 Callback method called by the NodeVisitor. More...
 

Private Attributes

const std::size_t m_channelID
 the number of the channel More...
 
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...
 
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...
 
const osg::ref_ptr< const osgSim::ScalarsToColors > m_colorMap
 the ScalarsToColors object mapping the potentials at the electrodes to colors More...
 

Detailed Description

OSG Update Callback to change the color of an electrode position when the event position changed.

Note
Only add it to a ShapeDrawable!

Definition at line 45 of file WElectrodePositionCallback.h.

Constructor & Destructor Documentation

◆ WElectrodePositionCallback()

WElectrodePositionCallback::WElectrodePositionCallback ( std::size_t  channelID,
WPropDouble  colorSensitivity,
std::shared_ptr< WFlag< std::shared_ptr< WEEGEvent > > >  event,
osg::ref_ptr< const osgSim::ScalarsToColors >  colorMap 
)

Constructor.

Parameters
channelIDthe number of the channel
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
colorMapthe object mapping the electrode potentials to colors

Definition at line 40 of file WElectrodePositionCallback.cpp.

Member Function Documentation

◆ update()

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

Callback method called by the NodeVisitor.

Changes the color of the electrode position according to the event.

Parameters
drawableThe drawable this callback is connected to. Should be a ShapeDrawable.

Definition at line 53 of file WElectrodePositionCallback.cpp.

References m_channelID, m_colorMap, m_colorSensitivity, m_currentColorSensitivity, m_currentTime, and m_event.

Member Data Documentation

◆ m_channelID

const std::size_t WElectrodePositionCallback::m_channelID
private

the number of the channel

Definition at line 78 of file WElectrodePositionCallback.h.

Referenced by update().

◆ m_colorMap

const osg::ref_ptr< const osgSim::ScalarsToColors > WElectrodePositionCallback::m_colorMap
private

the ScalarsToColors object mapping the potentials at the electrodes to colors

Definition at line 107 of file WElectrodePositionCallback.h.

Referenced by update().

◆ m_colorSensitivity

WPropDouble WElectrodePositionCallback::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 96 of file WElectrodePositionCallback.h.

Referenced by update().

◆ m_currentColorSensitivity

double WElectrodePositionCallback::m_currentColorSensitivity
private

the sensitivity of the color map which is currently used

Definition at line 83 of file WElectrodePositionCallback.h.

Referenced by update().

◆ m_currentTime

double WElectrodePositionCallback::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 90 of file WElectrodePositionCallback.h.

Referenced by update().

◆ m_event

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

event marking a special time position as WFlag

Definition at line 101 of file WElectrodePositionCallback.h.

Referenced by update().


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