DYTSrouce/src/scene/ui/QueryElevationWidget.h

40 lines
990 B
C
Raw Normal View History

2025-01-12 17:35:51 +00:00
#pragma once
2025-01-21 00:52:43 +00:00
#include <string>
2025-01-12 17:35:51 +00:00
#include <osgGA/GUIEventHandler>
#include <osgWidget/Box>
#include <osgWidget/Label>
#include <osgEarth/MapNode>
class QueryElevationWidget : public osgWidget::Box {
class QueryElevationEventHandler : public osgGA::GUIEventHandler {
public:
QueryElevationEventHandler(osgEarth::MapNode* mapNode, QueryElevationWidget* widget);
~QueryElevationEventHandler() override;
bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa) override;
private:
osgEarth::MapNode* mapNode_;
QueryElevationWidget* widget_;
};
public:
QueryElevationWidget(class OEScene* oeScene);
~QueryElevationWidget() override;
void AttachViewUI(class OsgViewUI* ui);
void OnUpdateGeoPoint(double x, double y, double z);
void ResetCanvasPosition(double width, double height);
2025-01-21 00:52:43 +00:00
private:
std::string GetElevationString(double x, double y, double z);
2025-01-12 17:35:51 +00:00
private:
class OEScene* oeScene_;
osg::ref_ptr<osgWidget::Label> label_;
};