From d661516b025d5a3a9e11ca537198902061a6d158 Mon Sep 17 00:00:00 2001 From: Thomas Geymayer Date: Wed, 13 Feb 2013 12:09:15 +0100 Subject: [PATCH] Expose whether CanvasElement is visible --- simgear/canvas/elements/CanvasElement.cxx | 6 ++++++ simgear/canvas/elements/CanvasElement.hxx | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/simgear/canvas/elements/CanvasElement.cxx b/simgear/canvas/elements/CanvasElement.cxx index e11e563b..ca4f6c76 100644 --- a/simgear/canvas/elements/CanvasElement.cxx +++ b/simgear/canvas/elements/CanvasElement.cxx @@ -210,6 +210,12 @@ namespace canvas return true; } + //---------------------------------------------------------------------------- + bool Element::isVisible() const + { + return _transform->getNodeMask() != 0; + } + //---------------------------------------------------------------------------- osg::ref_ptr Element::getMatrixTransform() { diff --git a/simgear/canvas/elements/CanvasElement.hxx b/simgear/canvas/elements/CanvasElement.hxx index 39bdd2bc..e6cd3012 100644 --- a/simgear/canvas/elements/CanvasElement.hxx +++ b/simgear/canvas/elements/CanvasElement.hxx @@ -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 getMatrixTransform(); -- 2.39.5