1
0
Fork 0

Canvas: update for SimGear changes.

This commit is contained in:
Thomas Geymayer 2014-05-06 18:08:46 +02:00
parent 4d1aebad79
commit c6371c4152
3 changed files with 10 additions and 10 deletions

View file

@ -19,14 +19,13 @@
#ifndef CANVAS_FWD_HPP_
#define CANVAS_FWD_HPP_
#include <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp>
#include <simgear/structure/SGSharedPtr.hxx>
namespace canvas
{
class Window;
typedef boost::shared_ptr<Window> WindowPtr;
typedef boost::weak_ptr<Window> WindowWeakPtr;
typedef SGSharedPtr<Window> WindowPtr;
typedef SGWeakPtr<Window> WindowWeakPtr;
}
#endif /* CANVAS_FWD_HPP_ */

View file

@ -138,6 +138,5 @@ CanvasMgr::getCanvasTexId(const simgear::canvas::CanvasPtr& canvas) const
void CanvasMgr::handleModelReinit(SGPropertyNode*)
{
for(size_t i = 0; i < _elements.size(); ++i)
boost::static_pointer_cast<sc::Canvas>(_elements[i])
->reloadPlacements("object");
static_cast<sc::Canvas*>(_elements[i].get())->reloadPlacements("object");
}

View file

@ -37,8 +37,8 @@
#include <boost/lexical_cast.hpp>
class DesktopGroup;
typedef boost::shared_ptr<DesktopGroup> DesktopPtr;
typedef boost::weak_ptr<DesktopGroup> DesktopWeakPtr;
typedef SGSharedPtr<DesktopGroup> DesktopPtr;
typedef SGWeakPtr<DesktopGroup> DesktopWeakPtr;
/**
* Event handler
@ -288,9 +288,11 @@ bool DesktopGroup::handleMouse(const osgGA::GUIEventAdapter& ea)
assert(element->getUserData());
canvas::WindowPtr window =
boost::dynamic_pointer_cast<canvas::Window>
dynamic_cast<canvas::Window*>
(
static_cast<sc::Element::OSGUserData*>(element->getUserData())->element
static_cast<sc::Element::OSGUserData*>(
element->getUserData()
)->element.get()
);
if( !window || !window->isCapturingEvents() || !window->isVisible() )