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

« back to all changes in this revision

Viewing changes to src/modules/eegView/WLabelsTransformCallback.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 WLABELSTRANSFORMCALLBACK_H
 
26
#define WLABELSTRANSFORMCALLBACK_H
 
27
 
 
28
#include <osg/Node>
 
29
#include <osg/NodeCallback>
 
30
#include <osg/NodeVisitor>
 
31
 
 
32
#include "core/common/WPropertyTypes.h"
 
33
 
 
34
 
 
35
/**
 
36
 * OSG Node Callback to update the MatrixTransform Node of the labels used for
 
37
 * panning and zooming.
 
38
 */
 
39
class WLabelsTransformCallback : public osg::NodeCallback
 
40
{
 
41
public:
 
42
    /**
 
43
     * Constructor
 
44
     *
 
45
     * \param yPos     the y position in pixel at the lower edge as property
 
46
     * \param ySpacing the distance between two curves of the graph in pixel as
 
47
     *                 property
 
48
     */
 
49
    WLabelsTransformCallback( WPropDouble yPos, WPropDouble ySpacing );
 
50
 
 
51
    /**
 
52
     * Callback method called by the NodeVisitor when visiting a node.
 
53
     * Change the matrix according to the properties.
 
54
     *
 
55
     * \param node The node this callback is connected to. Should be a
 
56
     *             MatrixTransform node.
 
57
     * \param nv   The node visitor which performs the traversal. Should be an
 
58
     *             update visitor.
 
59
     */
 
60
    virtual void operator()( osg::Node* node, osg::NodeVisitor* nv );
 
61
 
 
62
protected:
 
63
private:
 
64
    /**
 
65
     * the y position in pixel at the lower edge which is currently used
 
66
     */
 
67
    double m_currentYPos;
 
68
 
 
69
    /**
 
70
     * the distance between two curves of the graph in pixel which is currently
 
71
     * used
 
72
     */
 
73
    double m_currentYSpacing;
 
74
 
 
75
    /**
 
76
     * the y position in pixel at the lower edge as property
 
77
     */
 
78
    WPropDouble m_yPos;
 
79
 
 
80
    /**
 
81
     * the distance between two curves of the graph in pixel as property
 
82
     */
 
83
    WPropDouble m_ySpacing;
 
84
};
 
85
 
 
86
#endif  // WLABELSTRANSFORMCALLBACK_H