~ubuntu-branches/ubuntu/wily/openwalnut/wily-proposed

« back to all changes in this revision

Viewing changes to .pc/gcc5.patch/src/modules/eegView/WElectrodePositionCallback.h

  • Committer: Package Import Robot
  • Author(s): Michael Terry
  • Date: 2015-08-12 13:14:55 UTC
  • Revision ID: package-import@ubuntu.com-20150812131455-cwndvoy9wwx34ya2
Tags: 1.4.0~rc1+hg3a3147463ee2-1ubuntu4
* debian/patches/gcc5.patch:
  - Work around incompatibility between boost+gcc5 and Qt4, fixing FTBFS

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 WELECTRODEPOSITIONCALLBACK_H
 
26
#define WELECTRODEPOSITIONCALLBACK_H
 
27
 
 
28
#include <cstddef>
 
29
 
 
30
#include <boost/shared_ptr.hpp>
 
31
 
 
32
#include <osg/Drawable>
 
33
#include <osg/ref_ptr>
 
34
#include <osgSim/ScalarsToColors>
 
35
 
 
36
#include "core/common/WFlag.h"
 
37
#include "core/common/WPropertyTypes.h"
 
38
#include "WEEGEvent.h"
 
39
 
 
40
 
 
41
/**
 
42
 * OSG Update Callback to change the color of an electrode position when the
 
43
 * event position changed.
 
44
 * \note Only add it to a ShapeDrawable!
 
45
 */
 
46
class WElectrodePositionCallback : public osg::Drawable::UpdateCallback
 
47
{
 
48
public:
 
49
    /**
 
50
     * Constructor
 
51
     *
 
52
     * \param channelID        the number of the channel
 
53
     * \param colorSensitivity The sensitivity of the color map as property. The
 
54
     *                             color map ranges from -colorSensitivity to
 
55
     *                             +colorSensitivity in microvolt.
 
56
     * \param event            event marking a special time position as WFlag
 
57
     * \param colorMap         the object mapping the electrode potentials to
 
58
     *                             colors
 
59
     */
 
60
    WElectrodePositionCallback( std::size_t channelID,
 
61
                                WPropDouble colorSensitivity,
 
62
                                boost::shared_ptr< WFlag< boost::shared_ptr< WEEGEvent > > > event,
 
63
                                osg::ref_ptr< const osgSim::ScalarsToColors > colorMap );
 
64
 
 
65
    /**
 
66
     * Callback method called by the NodeVisitor.
 
67
     * Changes the color of the electrode position according to the event.
 
68
     *
 
69
     * \param drawable The drawable this callback is connected to. Should be
 
70
     *                     a ShapeDrawable.
 
71
     */
 
72
    virtual void update( osg::NodeVisitor* /*nv*/, osg::Drawable* drawable );
 
73
 
 
74
protected:
 
75
private:
 
76
    /**
 
77
     * the number of the channel
 
78
     */
 
79
    const std::size_t m_channelID;
 
80
 
 
81
    /**
 
82
     * the sensitivity of the color map which is currently used
 
83
     */
 
84
    double m_currentColorSensitivity;
 
85
 
 
86
    /**
 
87
     * The time position which is currently used.
 
88
     * The color is updated if the new time from the m_event is different to
 
89
     * this.
 
90
     */
 
91
    double m_currentTime;
 
92
 
 
93
    /**
 
94
     * The sensitivity of the color map as property. The color map ranges
 
95
     * from -m_colorSensitivity to +m_colorSensitivity in microvolt.
 
96
     */
 
97
    WPropDouble m_colorSensitivity;
 
98
 
 
99
    /**
 
100
     * event marking a special time position as WFlag
 
101
     */
 
102
    boost::shared_ptr< WFlag< boost::shared_ptr< WEEGEvent > > > m_event;
 
103
 
 
104
    /**
 
105
     * the ScalarsToColors object mapping the potentials at the electrodes
 
106
     * to colors
 
107
     */
 
108
    const osg::ref_ptr< const osgSim::ScalarsToColors > m_colorMap;
 
109
};
 
110
 
 
111
#endif  // WELECTRODEPOSITIONCALLBACK_H