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_ #ifndef CANVAS_FWD_HPP_
#define CANVAS_FWD_HPP_ #define CANVAS_FWD_HPP_
#include <boost/shared_ptr.hpp> #include <simgear/structure/SGSharedPtr.hxx>
#include <boost/weak_ptr.hpp>
namespace canvas namespace canvas
{ {
class Window; class Window;
typedef boost::shared_ptr<Window> WindowPtr; typedef SGSharedPtr<Window> WindowPtr;
typedef boost::weak_ptr<Window> WindowWeakPtr; typedef SGWeakPtr<Window> WindowWeakPtr;
} }
#endif /* CANVAS_FWD_HPP_ */ #endif /* CANVAS_FWD_HPP_ */

View file

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

View file

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