]> git.mxchange.org Git - flightgear.git/blobdiff - src/Cockpit/od_gauge.hxx
VoiceSynthesizer: add some test/debug properties
[flightgear.git] / src / Cockpit / od_gauge.hxx
index 8c0810401568d65054d080181f4860177af7b3cc..e819a8e3b321b97d07559c1066b8470310f775f7 100644 (file)
@@ -22,9 +22,9 @@
 #define _OD_GAUGE_HXX
 
 #include <Canvas/canvas_fwd.hpp>
-#include <Canvas/placement.hxx>
 
 #include <simgear/canvas/ODGauge.hxx>
+#include <simgear/canvas/CanvasPlacement.hxx>
 
 class SGPropertyNode;
 
@@ -32,31 +32,67 @@ class SGPropertyNode;
  * Owner Drawn Gauge helper class
  */
 class FGODGauge:
-  public simgear::ODGauge
+  public simgear::canvas::ODGauge
 {
   public:
     FGODGauge();
     virtual ~FGODGauge();
 
     /**
-     * Replace an opengl texture name inside the aircraft scene graph.
+     * Replace an opengl texture name inside a given branch of the scene graph.
      * This is to replace a static texture by a dynamic one
-     * @param name texture filename
-     * @param new_texture dynamic texture to replace the old one
+     *
+     * @param branch        Scene graph branch to use for search
+     * @param name          texture filename
+     * @param new_texture   dynamic texture to replace the old one
      * @return A list of groups which override the given texture
      */
     static
-    canvas::Placements set_texture( const char * name,
-                                    osg::Texture2D* new_texture );
+    simgear::canvas::Placements set_texture( osg::Node* branch,
+                                             const char * name,
+                                             osg::Texture2D* new_texture );
 
     /**
      * Replace an opengl texture name inside the aircraft scene graph.
+     * This is to replace a static texture by a dynamic one
+     *
+     * @param branch        Scene graph branch to search for matching
+     * @param name          texture filename
+     * @param new_texture   dynamic texture to replace the old one
+     * @return A list of groups which override the given texture
+     */
+    static
+    simgear::canvas::Placements
+    set_aircraft_texture( const char * name,
+                          osg::Texture2D* new_texture );
+
+    /**
+     * Replace an opengl texture name inside a given branch of the scene graph.
      * This is to replace a static texture by a dynamic one. The replacement
      * is base on certain filtering criteria which have to be stored in string
      * value childs of the placement node. Recognized nodes are:
      *   - texture  Match the name of the texture
      *   - node     Match the name of the object
      *   - parent   Match any of the object parents names (all the tree upwards)
+     *
+     * @param placement the node containing the replacement criteria
+     * @param new_texture dynamic texture to replace the old one
+     * @param an optional cull callback which will be installed on any matching
+     *        object
+     * @return A list of groups which override the given texture
+     */
+    static
+    simgear::canvas::Placements
+    set_texture( osg::Node* branch,
+                 SGPropertyNode* placement,
+                 osg::Texture2D* new_texture,
+                 osg::NodeCallback* cull_callback = 0,
+                 const simgear::canvas::CanvasWeakPtr& canvas =
+                   simgear::canvas::CanvasWeakPtr() );
+
+    /**
+     * Replace an opengl texture name inside the aircraft scene graph.
+     *
      * @param placement the node containing the replacement criteria
      * @param new_texture dynamic texture to replace the old one
      * @param an optional cull callback which will be installed on any matching
@@ -64,9 +100,12 @@ class FGODGauge:
      * @return A list of groups which override the given texture
      */
     static
-    canvas::Placements set_texture( const SGPropertyNode* placement,
-                                    osg::Texture2D* new_texture,
-                                    osg::NodeCallback* cull_callback = 0 );
+    simgear::canvas::Placements
+    set_aircraft_texture( SGPropertyNode* placement,
+                          osg::Texture2D* new_texture,
+                          osg::NodeCallback* cull_callback = 0,
+                          const simgear::canvas::CanvasWeakPtr& canvas =
+                            simgear::canvas::CanvasWeakPtr() );
 
 };