54 lines
1.4 KiB
C++
54 lines
1.4 KiB
C++
#pragma once
|
|
|
|
#include <osgEarth/MapNode>
|
|
#include <osgEarthUtil/Sky>
|
|
#include <osgEarth/Viewpoint>
|
|
|
|
#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<osg::Node> earthRootNode_;
|
|
osg::ref_ptr<osgEarth::Util::EarthManipulator> earthManipulator_;
|
|
osg::ref_ptr<osgEarth::MapNode> earthMapNode_;
|
|
osg::ref_ptr<osg::Group> entityRoot_;
|
|
osg::ref_ptr<osgEarth::Util::SkyNode> skyDome_;
|
|
osg::ref_ptr<OESceneUI> sceneUI_;
|
|
osgViewer::View* curentView_ {nullptr};
|
|
bool homeViewpointSet_ {false}; // 跟踪home viewpoint是否已经设置
|
|
};
|