]> git.mxchange.org Git - flightgear.git/blob - src/Cockpit/od_gauge.hxx
VoiceSynthesizer: add some test/debug properties
[flightgear.git] / src / Cockpit / od_gauge.hxx
1 // Owner Drawn Gauge helper class
2 //
3 // Moved to SimGear by Thomas Geymayer - October 2012
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License as
7 // published by the Free Software Foundation; either version 2 of the
8 // License, or (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful, but
11 // WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 // General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
18 //
19 //
20
21 #ifndef _OD_GAUGE_HXX
22 #define _OD_GAUGE_HXX
23
24 #include <Canvas/canvas_fwd.hpp>
25
26 #include <simgear/canvas/ODGauge.hxx>
27 #include <simgear/canvas/CanvasPlacement.hxx>
28
29 class SGPropertyNode;
30
31 /**
32  * Owner Drawn Gauge helper class
33  */
34 class FGODGauge:
35   public simgear::canvas::ODGauge
36 {
37   public:
38     FGODGauge();
39     virtual ~FGODGauge();
40
41     /**
42      * Replace an opengl texture name inside a given branch of the scene graph.
43      * This is to replace a static texture by a dynamic one
44      *
45      * @param branch        Scene graph branch to use for search
46      * @param name          texture filename
47      * @param new_texture   dynamic texture to replace the old one
48      * @return A list of groups which override the given texture
49      */
50     static
51     simgear::canvas::Placements set_texture( osg::Node* branch,
52                                              const char * name,
53                                              osg::Texture2D* new_texture );
54
55     /**
56      * Replace an opengl texture name inside the aircraft scene graph.
57      * This is to replace a static texture by a dynamic one
58      *
59      * @param branch        Scene graph branch to search for matching
60      * @param name          texture filename
61      * @param new_texture   dynamic texture to replace the old one
62      * @return A list of groups which override the given texture
63      */
64     static
65     simgear::canvas::Placements
66     set_aircraft_texture( const char * name,
67                           osg::Texture2D* new_texture );
68
69     /**
70      * Replace an opengl texture name inside a given branch of the scene graph.
71      * This is to replace a static texture by a dynamic one. The replacement
72      * is base on certain filtering criteria which have to be stored in string
73      * value childs of the placement node. Recognized nodes are:
74      *   - texture  Match the name of the texture
75      *   - node     Match the name of the object
76      *   - parent   Match any of the object parents names (all the tree upwards)
77      *
78      * @param placement the node containing the replacement criteria
79      * @param new_texture dynamic texture to replace the old one
80      * @param an optional cull callback which will be installed on any matching
81      *        object
82      * @return A list of groups which override the given texture
83      */
84     static
85     simgear::canvas::Placements
86     set_texture( osg::Node* branch,
87                  SGPropertyNode* placement,
88                  osg::Texture2D* new_texture,
89                  osg::NodeCallback* cull_callback = 0,
90                  const simgear::canvas::CanvasWeakPtr& canvas =
91                    simgear::canvas::CanvasWeakPtr() );
92
93     /**
94      * Replace an opengl texture name inside the aircraft scene graph.
95      *
96      * @param placement the node containing the replacement criteria
97      * @param new_texture dynamic texture to replace the old one
98      * @param an optional cull callback which will be installed on any matching
99      *        object
100      * @return A list of groups which override the given texture
101      */
102     static
103     simgear::canvas::Placements
104     set_aircraft_texture( SGPropertyNode* placement,
105                           osg::Texture2D* new_texture,
106                           osg::NodeCallback* cull_callback = 0,
107                           const simgear::canvas::CanvasWeakPtr& canvas =
108                             simgear::canvas::CanvasWeakPtr() );
109
110 };
111
112 #endif // _OD_GAUGE_HXX