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

« back to all changes in this revision

Viewing changes to src/modules/coordinateHUD/WMCoordinateHUD.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 WMCOORDINATEHUD_H
 
26
#define WMCOORDINATEHUD_H
 
27
 
 
28
#include <string>
 
29
 
 
30
#include <osg/Geode>
 
31
 
 
32
#include "core/common/WItemSelection.h"
 
33
#include "core/common/WItemSelector.h"
 
34
 
 
35
#include "core/graphicsEngine/WGEManagedGroupNode.h"
 
36
#include "core/graphicsEngine/WGEZoomTrackballManipulator.h"
 
37
#include "core/graphicsEngine/shaders/WGEShader.h"
 
38
 
 
39
#include "core/kernel/WModule.h"
 
40
#include "core/kernel/WModuleInputData.h"
 
41
#include "core/kernel/WModuleOutputData.h"
 
42
 
 
43
/**
 
44
 * This module shows a coordinatesystem as HUD.
 
45
 * The attenuation can be customized to users needs.
 
46
 */
 
47
class WMCoordinateHUD: public WModule, public osg::Referenced
 
48
{
 
49
    public:
 
50
 
 
51
        /**
 
52
         * Default constructor.
 
53
         */
 
54
        WMCoordinateHUD();
 
55
 
 
56
        /**
 
57
         * Destructor.
 
58
         */
 
59
        virtual ~WMCoordinateHUD();
 
60
 
 
61
        /**
 
62
         * Gives back the name of this module.
 
63
         * \return the module's name.
 
64
         */
 
65
        virtual const std::string getName() const;
 
66
 
 
67
        /**
 
68
         * Gives back a description of this module.
 
69
         * \return description to module.
 
70
         */
 
71
        virtual const std::string getDescription() const;
 
72
 
 
73
        /**
 
74
         * Due to the prototype design pattern used to build modules, this method returns a new instance of this method. NOTE: it
 
75
         * should never be initialized or modified in some other way. A simple new instance is required.
 
76
         *
 
77
         * \return the prototype used to create every module in OpenWalnut.
 
78
         */
 
79
        virtual boost::shared_ptr< WModule > factory() const;
 
80
 
 
81
        /**
 
82
         * Get the icon for this module in XPM format.
 
83
         * \return The icon.
 
84
         */
 
85
        virtual const char** getXPMIcon() const;
 
86
 
 
87
    protected:
 
88
 
 
89
        /**
 
90
         * Entry point after loading the module. Runs in separate thread.
 
91
         */
 
92
        virtual void moduleMain();
 
93
 
 
94
        /**
 
95
         * Initialize the connectors this module is using.
 
96
         */
 
97
        virtual void connectors();
 
98
 
 
99
        /**
 
100
         * Initialize the properties for this module.
 
101
         */
 
102
        virtual void properties();
 
103
 
 
104
        /**
 
105
         * Build the geode for colorfull coordinate axis
 
106
         */
 
107
        virtual void buildColorAxis();
 
108
 
 
109
        /**
 
110
         * build the geode for black & white coordinate axis
 
111
         */
 
112
        virtual void buildBWAxis();
 
113
 
 
114
        /**
 
115
         * build the geode for black & white coordinate cube
 
116
         */
 
117
        virtual void buildColorCube();
 
118
 
 
119
        /**
 
120
         * build the geometry of the cube
 
121
         *
 
122
         * \return the cube vertices
 
123
         */
 
124
        virtual osg::Vec3Array* buildCubeVertices();
 
125
 
 
126
        /**
 
127
         * build the geometry of the axis
 
128
         *
 
129
         * \return the axis vertices
 
130
         */
 
131
        virtual osg::Vec3Array* buildAxisVertices();
 
132
 
 
133
        /**
 
134
         * create caption for medical plane
 
135
         */
 
136
        virtual void buildCaption();
 
137
 
 
138
        /**
 
139
         * The root node used for this modules graphics.
 
140
         */
 
141
        osg::ref_ptr< WGEManagedGroupNode > m_rootNode;
 
142
 
 
143
        /**
 
144
         * The geometry rendered by this module.
 
145
         */
 
146
        osg::ref_ptr< osg::Geode > m_geode;
 
147
 
 
148
        /**
 
149
         * The caption rendered by this module.
 
150
         */
 
151
        osg::ref_ptr< osg::Geode > m_txtGeode;
 
152
 
 
153
 
 
154
    private:
 
155
 
 
156
        /**
 
157
         * the shader
 
158
         */
 
159
        osg::ref_ptr< WGEShader > m_shader;
 
160
 
 
161
        /**
 
162
         * A condition used to notify about changes in several properties.
 
163
         */
 
164
        boost::shared_ptr< WCondition > m_propCondition;
 
165
 
 
166
        /**
 
167
         * A property allowing the user to select ONE item of some list
 
168
         */
 
169
        WPropSelection m_aSingleSelection;
 
170
 
 
171
        /**
 
172
         * A list of items that can be selected using m_aSingleSelection or m_aMultiSelection.
 
173
         */
 
174
        boost::shared_ptr< WItemSelection > m_possibleSelections;
 
175
};
 
176
 
 
177
#endif  // WMCOORDINATEHUD_H