]> git.mxchange.org Git - simgear.git/commitdiff
Expose whether CanvasElement is visible
authorThomas Geymayer <tomgey@gmail.com>
Wed, 13 Feb 2013 11:09:15 +0000 (12:09 +0100)
committerThomas Geymayer <tomgey@gmail.com>
Wed, 13 Feb 2013 11:09:15 +0000 (12:09 +0100)
simgear/canvas/elements/CanvasElement.cxx
simgear/canvas/elements/CanvasElement.hxx

index e11e563b0357c764704677bd4ce864970d483cda..ca4f6c76259286bd79fd74a7ea9a341fd3bab473 100644 (file)
@@ -210,6 +210,12 @@ namespace canvas
     return true;
   }
 
+  //----------------------------------------------------------------------------
+  bool Element::isVisible() const
+  {
+    return _transform->getNodeMask() != 0;
+  }
+
   //----------------------------------------------------------------------------
   osg::ref_ptr<osg::MatrixTransform> Element::getMatrixTransform()
   {
index 39bdd2bc4592d141ca3d7258630ea6ec1868bedb..e6cd3012106cc3ebde542d3647a6e08db0ec780c 100644 (file)
@@ -82,6 +82,11 @@ namespace canvas
       virtual bool hitBound( const osg::Vec2f& pos,
                              const osg::Vec2f& local_pos ) const;
 
+      /**
+       * Get whether the element is visible or hidden (Can be changed with
+       * setting property "visible" accordingly).
+       */
+      bool isVisible() const;
 
       osg::ref_ptr<osg::MatrixTransform> getMatrixTransform();