OpenWalnut
1.5.0dev
|
OSG Update Callback to change the color of an electrode position when the event position changed. More...
#include <WElectrodePositionCallback.h>
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... | |
OSG Update Callback to change the color of an electrode position when the event position changed.
Definition at line 45 of file WElectrodePositionCallback.h.
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.
channelID | the number of the channel |
colorSensitivity | The sensitivity of the color map as property. The color map ranges from -colorSensitivity to +colorSensitivity in microvolt. |
event | event marking a special time position as WFlag |
colorMap | the object mapping the electrode potentials to colors |
Definition at line 40 of file WElectrodePositionCallback.cpp.
|
virtual |
Callback method called by the NodeVisitor.
Changes the color of the electrode position according to the event.
drawable | The 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.
|
private |
the number of the channel
Definition at line 78 of file WElectrodePositionCallback.h.
Referenced by update().
|
private |
the ScalarsToColors object mapping the potentials at the electrodes to colors
Definition at line 107 of file WElectrodePositionCallback.h.
Referenced by update().
|
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().
|
private |
the sensitivity of the color map which is currently used
Definition at line 83 of file WElectrodePositionCallback.h.
Referenced by update().
|
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().
|
private |
event marking a special time position as WFlag
Definition at line 101 of file WElectrodePositionCallback.h.
Referenced by update().