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

GUI event handler class used for the 2D EEG view. More...

#include <WEEGViewHandler.h>

+ Inheritance diagram for WEEGViewHandler:
+ Collaboration diagram for WEEGViewHandler:

Public Member Functions

 WEEGViewHandler (WPropInt labelsWidth, WPropDouble timePos, WPropDouble timeRange, WPropInt graphWidth, WPropDouble yPos, WPropDouble ySpacing, WPropDouble ySensitivity, WPropDouble colorSensitivity, std::shared_ptr< WFlag< std::shared_ptr< WEEGEvent > > > event, osg::ref_ptr< WGEGroupNode > eventParentNode, std::shared_ptr< WEEG2 > eeg, std::size_t segmentID, WPropBool snapToDipole, WPropBool proofOfConcept, std::shared_ptr< WDataSetDipoles > dipoles)
 Constructor. More...
 
virtual bool handle (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &)
 Handle events. More...
 

Private Member Functions

bool markEvent (float x)
 Update the event position according to the clicked position. More...
 

Private Attributes

WPropInt m_labelsWidth
 the width of the label display in pixel as property 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...
 
WPropInt m_graphWidth
 the width of the graph in pixel as property More...
 
WPropDouble m_yPos
 the y position in pixel at the lower edge as property More...
 
WPropDouble m_ySpacing
 the distance between two curves of the graph in pixel as property More...
 
WPropDouble m_ySensitivity
 the sensitivity of the graph in microvolt per pixel as property 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...
 
osg::ref_ptr< WGEGroupNodem_eventParentNode
 parent node, where an marked event position is inserted and removed from More...
 
std::shared_ptr< WEEG2m_eeg
 pointer to the loaded EEG dataset More...
 
std::size_t m_segmentID
 number of the segment More...
 
WPropBool m_snapToDipole
 Property determining whether the selected time position should be snapped to an active dipole. More...
 
WPropBool m_proofOfConcept
 Property determining whether we only show the proof of concept or the real dipoles. More...
 
std::shared_ptr< WDataSetDipolesm_dipoles
 Pointer to the loaded dipoles dataset. More...
 
float m_oldX
 previous mouse x position More...
 
float m_oldY
 previous mouse y position More...
 

Detailed Description

GUI event handler class used for the 2D EEG view.

Definition at line 47 of file WEEGViewHandler.h.

Constructor & Destructor Documentation

◆ WEEGViewHandler()

WEEGViewHandler::WEEGViewHandler ( WPropInt  labelsWidth,
WPropDouble  timePos,
WPropDouble  timeRange,
WPropInt  graphWidth,
WPropDouble  yPos,
WPropDouble  ySpacing,
WPropDouble  ySensitivity,
WPropDouble  colorSensitivity,
std::shared_ptr< WFlag< std::shared_ptr< WEEGEvent > > >  event,
osg::ref_ptr< WGEGroupNode eventParentNode,
std::shared_ptr< WEEG2 eeg,
std::size_t  segmentID,
WPropBool  snapToDipole,
WPropBool  proofOfConcept,
std::shared_ptr< WDataSetDipoles dipoles 
)

Constructor.

Parameters
labelsWidththe width of the label display in pixel as property
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
graphWidththe width of the graph in pixel as property
yPosthe y position in pixel at the lower edge as property
ySpacingthe distance between two curves of the graph in pixel as property
ySensitivitythe sensitivity of the graph in microvolt per pixel as property
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
eventParentNodeparent node, where an marked event position is inserted and removed from
eegpointer to the loaded EEG dataset
segmentIDnumber of the segment
snapToDipoleProperty determining whether the selected time position should be snapped to an active dipole
proofOfConceptProperty determining whether we only show the proof of concept or the real dipoles
dipolespointer to the loaded dipoles dataset

Definition at line 44 of file WEEGViewHandler.cpp.

Member Function Documentation

◆ handle()

bool WEEGViewHandler::handle ( const osgGA::GUIEventAdapter &  ea,
osgGA::GUIActionAdapter &   
)
virtual

Handle events.

Parameters
eaevent class for storing keyboard, mouse and window events
Returns
true if handled, false otherwise

Definition at line 80 of file WEEGViewHandler.cpp.

References m_colorSensitivity, m_graphWidth, m_labelsWidth, m_oldX, m_oldY, m_timePos, m_timeRange, m_yPos, m_ySensitivity, m_ySpacing, and markEvent().

+ Here is the call graph for this function:

◆ markEvent()

bool WEEGViewHandler::markEvent ( float  x)
private

Update the event position according to the clicked position.

Parameters
xthe x coordinate of the mouse pointer in pixel
Returns
true if handled, false otherwise

Definition at line 228 of file WEEGViewHandler.cpp.

References m_dipoles, m_eeg, m_event, m_eventParentNode, m_graphWidth, m_labelsWidth, m_proofOfConcept, m_segmentID, m_snapToDipole, m_timePos, m_timeRange, and m_yPos.

Referenced by handle().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_colorSensitivity

WPropDouble WEEGViewHandler::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 146 of file WEEGViewHandler.h.

Referenced by handle().

◆ m_dipoles

std::shared_ptr< WDataSetDipoles > WEEGViewHandler::m_dipoles
private

Pointer to the loaded dipoles dataset.

Definition at line 181 of file WEEGViewHandler.h.

Referenced by markEvent().

◆ m_eeg

std::shared_ptr< WEEG2 > WEEGViewHandler::m_eeg
private

pointer to the loaded EEG dataset

Definition at line 161 of file WEEGViewHandler.h.

Referenced by markEvent().

◆ m_event

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

event marking a special time position as WFlag

Definition at line 151 of file WEEGViewHandler.h.

Referenced by markEvent().

◆ m_eventParentNode

osg::ref_ptr< WGEGroupNode > WEEGViewHandler::m_eventParentNode
private

parent node, where an marked event position is inserted and removed from

Definition at line 156 of file WEEGViewHandler.h.

Referenced by markEvent().

◆ m_graphWidth

WPropInt WEEGViewHandler::m_graphWidth
private

the width of the graph in pixel as property

Definition at line 125 of file WEEGViewHandler.h.

Referenced by handle(), and markEvent().

◆ m_labelsWidth

WPropInt WEEGViewHandler::m_labelsWidth
private

the width of the label display in pixel as property

Definition at line 109 of file WEEGViewHandler.h.

Referenced by handle(), and markEvent().

◆ m_oldX

float WEEGViewHandler::m_oldX
private

previous mouse x position

Definition at line 183 of file WEEGViewHandler.h.

Referenced by handle().

◆ m_oldY

float WEEGViewHandler::m_oldY
private

previous mouse y position

Definition at line 184 of file WEEGViewHandler.h.

Referenced by handle().

◆ m_proofOfConcept

WPropBool WEEGViewHandler::m_proofOfConcept
private

Property determining whether we only show the proof of concept or the real dipoles.

Definition at line 176 of file WEEGViewHandler.h.

Referenced by markEvent().

◆ m_segmentID

std::size_t WEEGViewHandler::m_segmentID
private

number of the segment

Definition at line 166 of file WEEGViewHandler.h.

Referenced by markEvent().

◆ m_snapToDipole

WPropBool WEEGViewHandler::m_snapToDipole
private

Property determining whether the selected time position should be snapped to an active dipole.

Definition at line 171 of file WEEGViewHandler.h.

Referenced by markEvent().

◆ m_timePos

WPropDouble WEEGViewHandler::m_timePos
private

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

Definition at line 115 of file WEEGViewHandler.h.

Referenced by handle(), and markEvent().

◆ m_timeRange

WPropDouble WEEGViewHandler::m_timeRange
private

the width of the graph in seconds as property

Definition at line 120 of file WEEGViewHandler.h.

Referenced by handle(), and markEvent().

◆ m_yPos

WPropDouble WEEGViewHandler::m_yPos
private

the y position in pixel at the lower edge as property

Definition at line 130 of file WEEGViewHandler.h.

Referenced by handle(), and markEvent().

◆ m_ySensitivity

WPropDouble WEEGViewHandler::m_ySensitivity
private

the sensitivity of the graph in microvolt per pixel as property

Definition at line 140 of file WEEGViewHandler.h.

Referenced by handle().

◆ m_ySpacing

WPropDouble WEEGViewHandler::m_ySpacing
private

the distance between two curves of the graph in pixel as property

Definition at line 135 of file WEEGViewHandler.h.

Referenced by handle().


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