#pragma once #include #include #include #include "common/SpdLogger.h" #include "config.h" #include "scene/ui/OESceneUI.h" namespace osgEarth { namespace Util { class EarthManipulator; } } class OEScene : public osg::Group { public: OEScene(); void AttachView(osgViewer::View* view); void DetachView(osgViewer::View* view); bool AddToScene(osg::Node* node) const; void SetHomeViewpoint(const osgEarth::Viewpoint& viewpoint, double duration_s); bool TrackEntity(osg::Node* entity, bool track) const; osgEarth::MapNode* GetMapNode(void) const { dyt_check(earthMapNode_.valid()); return earthMapNode_; } OESceneUI* GetOrCreateSceneUI(); osgEarth::Util::EarthManipulator* GetManipulater() const { return earthManipulator_.get(); } osg::Viewport* GetViewport() const; static const osgEarth::SpatialReference* GetSrs(); private: void Init(); private: osg::ref_ptr earthRootNode_; osg::ref_ptr earthManipulator_; osg::ref_ptr earthMapNode_; osg::ref_ptr entityRoot_; osg::ref_ptr skyDome_; osg::ref_ptr sceneUI_; osgViewer::View* curentView_ {nullptr}; bool homeViewpointSet_ {false}; };