1 | #pragma once |
---|
2 | /* -*-c++-*- osgVisual - Copyright (C) 2009-2010 Torben Dannhauer |
---|
3 | * |
---|
4 | * This library is based on OpenSceneGraph, open source and may be redistributed and/or modified under |
---|
5 | * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or |
---|
6 | * (at your option) any later version. The full license is in LICENSE file |
---|
7 | * included with this distribution, and on the openscenegraph.org website. |
---|
8 | * |
---|
9 | * osgVisual requires for some proprietary modules a license from the correspondig manufacturer. |
---|
10 | * You have to aquire licenses for all used proprietary modules. |
---|
11 | * |
---|
12 | * This library is distributed in the hope that it will be useful, |
---|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
15 | * OpenSceneGraph Public License for more details. |
---|
16 | */ |
---|
17 | |
---|
18 | #include <visual_draw2D.h> |
---|
19 | |
---|
20 | |
---|
21 | namespace osgVisual |
---|
22 | { |
---|
23 | |
---|
24 | /** |
---|
25 | * \brief This class demonstrates how to build a Head Up Display. |
---|
26 | * |
---|
27 | * Replace addContent() to integrate own content. |
---|
28 | * |
---|
29 | * @todo : Check, if the update logic should be implemtented in draw2D or here in. |
---|
30 | * |
---|
31 | * @author Torben Dannhauer |
---|
32 | * @date Sep 2009 |
---|
33 | */ |
---|
34 | class visual_hud : public osg::Geode |
---|
35 | { |
---|
36 | public: |
---|
37 | /** |
---|
38 | * \brief Empty Constructor. |
---|
39 | * |
---|
40 | */ |
---|
41 | visual_hud(void); |
---|
42 | |
---|
43 | /** |
---|
44 | * \brief Empty Destructor. |
---|
45 | * |
---|
46 | */ |
---|
47 | ~visual_hud(void); |
---|
48 | |
---|
49 | /** |
---|
50 | * \brief This function initializes the HUD. |
---|
51 | * |
---|
52 | * @param viewer_ : Pointer to the viewer instance to get screen size and screen width. |
---|
53 | * @return : True if initialization was successful. |
---|
54 | */ |
---|
55 | bool init(osgViewer::Viewer *viewer_ ); |
---|
56 | |
---|
57 | private: |
---|
58 | /** |
---|
59 | * \brief This function contains the code to display in the HUD. |
---|
60 | * |
---|
61 | * Subclass this function to integrate own content. |
---|
62 | * |
---|
63 | * @return Pointer to the Geode which contains the HUD content. |
---|
64 | */ |
---|
65 | osg::ref_ptr<osg::Geode> addContent(); |
---|
66 | |
---|
67 | /** |
---|
68 | * This variable contains the width of the rendering screen during the initialization of this node. |
---|
69 | */ |
---|
70 | int screen_width; |
---|
71 | |
---|
72 | /** |
---|
73 | * This variable contains the height of the rendering screen during the initialization of this node. |
---|
74 | */ |
---|
75 | int screen_height; |
---|
76 | }; |
---|
77 | |
---|
78 | } // END NAMESPACE |
---|