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

OSG Update Callback to update the EEG graph of one channel by changing the vertex array of the line strip. More...

#include <WLineStripCallback.h>

+ Inheritance diagram for WLineStripCallback:
+ Collaboration diagram for WLineStripCallback:

Public Member Functions

 WLineStripCallback (std::size_t channelID, WPropDouble timePos, WPropDouble timeRange, std::shared_ptr< WEEG2Segment > segment, double samplingRate)
 Constructor. More...
 
virtual void update (osg::NodeVisitor *, osg::Drawable *drawable)
 Callback method called by the NodeVisitor. More...
 

Private Member Functions

std::size_t clampToRange (double value, std::size_t min, std::size_t max) const
 Convert the given double value to std::size_t and clamp it into the given range. More...
 

Private Attributes

const std::size_t m_channelID
 the number of the channel More...
 
double m_currentTimePos
 the time position in seconds where to start the graph at the left edge which is currently used More...
 
double m_currentTimeRange
 the width of the graph in seconds which is currently used More...
 
WPropDouble m_timePos
 the time position in seconds where to start the graph at the left edge as property More...
 
WPropDouble m_timeRange
 the width of the graph in seconds as property More...
 
std::shared_ptr< WEEG2Segmentm_segment
 pointer to the EEG segment More...
 
double m_samplingRate
 sampling rate used by the recording More...
 

Detailed Description

OSG Update Callback to update the EEG graph of one channel by changing the vertex array of the line strip.

Definition at line 42 of file WLineStripCallback.h.

Constructor & Destructor Documentation

◆ WLineStripCallback()

WLineStripCallback::WLineStripCallback ( std::size_t  channelID,
WPropDouble  timePos,
WPropDouble  timeRange,
std::shared_ptr< WEEG2Segment segment,
double  samplingRate 
)

Constructor.

Parameters
channelIDthe number of the channel
timePosthe time position in seconds where to start the graph at the left edge as property
timeRangethe width of the graph in seconds as property
segmentpointer to the EEG segment
samplingRatesampling rate used by the recording

Definition at line 43 of file WLineStripCallback.cpp.

Member Function Documentation

◆ clampToRange()

std::size_t WLineStripCallback::clampToRange ( double  value,
std::size_t  min,
std::size_t  max 
) const
private

Convert the given double value to std::size_t and clamp it into the given range.

Parameters
valuevalue to convert
minminimum of the valid range
maxmaximum of the valid range
Returns
converted value

Definition at line 131 of file WLineStripCallback.cpp.

Referenced by update().

+ Here is the caller graph for this function:

◆ update()

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

Callback method called by the NodeVisitor.

Changes the vertex array of the line strip according to the properties.

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

Definition at line 58 of file WLineStripCallback.cpp.

References clampToRange(), m_channelID, m_currentTimePos, m_currentTimeRange, m_samplingRate, m_segment, m_timePos, and m_timeRange.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_channelID

const std::size_t WLineStripCallback::m_channelID
private

the number of the channel

Definition at line 75 of file WLineStripCallback.h.

Referenced by update().

◆ m_currentTimePos

double WLineStripCallback::m_currentTimePos
private

the time position in seconds where to start the graph at the left edge which is currently used

Definition at line 81 of file WLineStripCallback.h.

Referenced by update().

◆ m_currentTimeRange

double WLineStripCallback::m_currentTimeRange
private

the width of the graph in seconds which is currently used

Definition at line 86 of file WLineStripCallback.h.

Referenced by update().

◆ m_samplingRate

double WLineStripCallback::m_samplingRate
private

sampling rate used by the recording

Definition at line 107 of file WLineStripCallback.h.

Referenced by update().

◆ m_segment

std::shared_ptr< WEEG2Segment > WLineStripCallback::m_segment
private

pointer to the EEG segment

Definition at line 102 of file WLineStripCallback.h.

Referenced by update().

◆ m_timePos

WPropDouble WLineStripCallback::m_timePos
private

the time position in seconds where to start the graph at the left edge as property

Definition at line 92 of file WLineStripCallback.h.

Referenced by update().

◆ m_timeRange

WPropDouble WLineStripCallback::m_timeRange
private

the width of the graph in seconds as property

Definition at line 97 of file WLineStripCallback.h.

Referenced by update().


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