OpenWalnut  1.5.0dev
WEEGEvent.h
1 //---------------------------------------------------------------------------
2 //
3 // Project: OpenWalnut ( http://www.openwalnut.org )
4 //
5 // Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
6 // For more information see http://www.openwalnut.org/copying
7 //
8 // This file is part of OpenWalnut.
9 //
10 // OpenWalnut is free software: you can redistribute it and/or modify
11 // it under the terms of the GNU Lesser General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // OpenWalnut is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public License
21 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
22 //
23 //---------------------------------------------------------------------------
24 
25 #ifndef WEEGEVENT_H
26 #define WEEGEVENT_H
27 
28 #include <cstddef>
29 #include <memory>
30 #include <vector>
31 
32 #include <osg/Node>
33 #include <osg/ref_ptr>
34 
35 #include "core/common/exceptions/WOutOfBounds.h"
36 #include "core/dataHandler/WDataSetDipoles.h"
37 #include "core/dataHandler/WEEG2.h"
38 #include "core/graphicsEngine/WGEGroupNode.h"
39 
40 
41 /**
42  * A special time position in an EEG recording with corresponding data.
43  */
44 class WEEGEvent
45 {
46 public:
47  /**
48  * Constructor
49  *
50  * \param time time position in seconds
51  * \param yPos y position in pixels
52  * \param eeg pointer to the loaded EEG dataset
53  * \param segmentID number of the segment
54  * \param parentNode node where m_node is inserted and removed from
55  * \param snapToDipole whether the selected time position should be snapped to an active dipole
56  * \param proofOfConcept whether we only show the proof of concept or the real dipoles
57  * \param dipoles pointer to the loaded dipoles dataset
58  */
59  WEEGEvent( double time,
60  double yPos,
61  std::shared_ptr< WEEG2 > eeg,
62  std::size_t segmentID,
63  osg::ref_ptr< WGEGroupNode > parentNode,
64  bool snapToDipole,
65  bool proofOfConcept,
66  std::shared_ptr< WDataSetDipoles > dipoles );
67 
68  /**
69  * Constructor for an empty event
70  */
71  WEEGEvent();
72 
73  /**
74  * Destructor, removing m_node from m_parentNode
75  */
76  ~WEEGEvent();
77 
78  /**
79  * Get the time position
80  *
81  * \return time position in seconds
82  */
83  double getTime() const;
84 
85  /**
86  * Get the value of each channel at the time position
87  *
88  * \return values as reference to a vector
89  */
90  const std::vector< double >& getValues() const;
91 
92 protected:
93 private:
94  double m_time; //!< time position in seconds
95 
96  std::vector< double > m_values; //!< the value of each channel at the given time position
97 
98  osg::ref_ptr< osg::Node > m_node; //!< OSG node representing the event
99 
100  osg::ref_ptr< WGEGroupNode > m_parentNode; //!< parent node, where m_node is inserted and removed from
101 };
102 
103 #endif // WEEGEVENT_H
A special time position in an EEG recording with corresponding data.
Definition: WEEGEvent.h:45
const std::vector< double > & getValues() const
Get the value of each channel at the time position.
Definition: WEEGEvent.cpp:186
WEEGEvent()
Constructor for an empty event.
Definition: WEEGEvent.cpp:168
osg::ref_ptr< WGEGroupNode > m_parentNode
parent node, where m_node is inserted and removed from
Definition: WEEGEvent.h:100
double getTime() const
Get the time position.
Definition: WEEGEvent.cpp:181
double m_time
time position in seconds
Definition: WEEGEvent.h:94
~WEEGEvent()
Destructor, removing m_node from m_parentNode.
Definition: WEEGEvent.cpp:173
std::vector< double > m_values
the value of each channel at the given time position
Definition: WEEGEvent.h:96
osg::ref_ptr< osg::Node > m_node
OSG node representing the event.
Definition: WEEGEvent.h:98