~ubuntu-branches/ubuntu/precise/openwalnut/precise

« back to all changes in this revision

Viewing changes to src/modules/eegView/WEEGEvent.h

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Eichelbaum
  • Date: 2011-06-21 10:26:54 UTC
  • Revision ID: james.westby@ubuntu.com-20110621102654-rq0zf436q949biih
Tags: upstream-1.2.5
ImportĀ upstreamĀ versionĀ 1.2.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
 
30
#include <vector>
 
31
 
 
32
#include <boost/shared_ptr.hpp>
 
33
 
 
34
#include <osg/Node>
 
35
#include <osg/ref_ptr>
 
36
 
 
37
#include "core/common/exceptions/WOutOfBounds.h"
 
38
#include "core/dataHandler/WEEG2.h"
 
39
#include "core/graphicsEngine/WGEGroupNode.h"
 
40
 
 
41
 
 
42
/**
 
43
 * A special time position in an EEG recording with corresponding data.
 
44
 */
 
45
class WEEGEvent
 
46
{
 
47
public:
 
48
    /**
 
49
     * Constructor
 
50
     *
 
51
     * \param time       time position in seconds
 
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
     */
 
56
    WEEGEvent( double time,
 
57
               boost::shared_ptr< WEEG2 > eeg,
 
58
               std::size_t segmentID,
 
59
               osg::ref_ptr< WGEGroupNode > parentNode ) throw( WOutOfBounds );
 
60
 
 
61
    /**
 
62
     * Constructor for an empty event
 
63
     */
 
64
    WEEGEvent();
 
65
 
 
66
    /**
 
67
     * Destructor, removing m_node from m_parentNode
 
68
     */
 
69
    ~WEEGEvent();
 
70
 
 
71
    /**
 
72
     * Get the time position
 
73
     *
 
74
     * \return time position in seconds
 
75
     */
 
76
    double getTime() const;
 
77
 
 
78
    /**
 
79
     * Get the value of each channel at the time position
 
80
     *
 
81
     * \return values as reference to a vector
 
82
     */
 
83
    const std::vector< double >& getValues() const;
 
84
 
 
85
protected:
 
86
private:
 
87
    const double m_time; //!< time position in seconds
 
88
 
 
89
    std::vector< double > m_values; //!< the value of each channel at the given time position
 
90
 
 
91
    osg::ref_ptr< osg::Node > m_node; //!< OSG node representing the event
 
92
 
 
93
    osg::ref_ptr< WGEGroupNode > m_parentNode; //!< parent node, where m_node is inserted and removed from
 
94
};
 
95
 
 
96
#endif  // WEEGEVENT_H