diff --git a/src/effects/ConeWave.cpp b/src/effects/ConeWave.cpp index a67d6269..4e5ee310 100644 --- a/src/effects/ConeWave.cpp +++ b/src/effects/ConeWave.cpp @@ -116,7 +116,8 @@ void ConeWave::CreateTexturedCone(osg::Geode* geode) { fragmentShader->setShaderSource(fragSource); osg::StateSet* stateset = coneDrawable_->getOrCreateStateSet(); - stateset->setRenderBinDetails(120, "OSGEARTH_SCREEN_SPACE_LAYOUT_BIN"); + //stateset->setRenderBinDetails(120, "OSGEARTH_SCREEN_SPACE_LAYOUT_BIN"); + stateset->setRenderBinDetails(120, "RenderBin"); osg::ref_ptr blendFunc = new osg::BlendFunc(); stateset->setAttributeAndModes(blendFunc, osg::StateAttribute::ON); osg::ref_ptr program = new osg::Program(); diff --git a/src/scene/OEScene.cpp b/src/scene/OEScene.cpp index 903a76b3..cc9fdd48 100644 --- a/src/scene/OEScene.cpp +++ b/src/scene/OEScene.cpp @@ -29,6 +29,7 @@ OEScene::OEScene() { const std::string& basePath = RecourceHelper::Get().GetBasePath().toStdString(); pathList.push_back(basePath + "/resources/earth/"); pathList.push_back(basePath + "/resources/textures/"); + root_ = new osg::Group; } @@ -50,6 +51,17 @@ void OEScene::AttachView(OsgView* view) { return; } + osg::Node* rootNode = view->GetView()->getSceneData(); + if (nullptr != rootNode) { + int parantCount = rootNode->getNumParents(); + for (int i = 0; i < parantCount; ++i) { + rootNode->getParent(i)->removeChild(rootNode); + } + root_->addChild(rootNode); + } + + view->GetView()->setSceneData(root_); + earthRootNode_ = osgDB::readNodeFile("triton.earth"); if (!earthRootNode_) { LOG_ERROR("read earth node(triton.earth) failed"); @@ -59,36 +71,18 @@ void OEScene::AttachView(OsgView* view) { earthMapNode_ = osgEarth::MapNode::get(earthRootNode_); LOG_INFO("earth map node get success: {}", earthMapNode_.valid()); + g_srs_ = earthMapNode_->getMapSRS(); entityRoot_ = new osg::Group; - if (earthMapNode_) { - earthMapNode_->addChild(entityRoot_); - g_srs_ = earthMapNode_->getMapSRS(); - dyt_check(nullptr != g_srs_); - } + root_->addChild(entityRoot_); skyDome_ = osgEarth::SkyNode::create(); if (!earthMapNode_) { LOG_WARN("eart map node is nullptr"); return; } - - skyDome_->addChild(earthMapNode_); - - osg::Node* node = view->GetView()->getSceneData(); - if (nullptr == node) { - LOG_INFO("view scene data is nullptr, root valid:{}", skyDome_.valid()); - view->GetView()->setSceneData(skyDome_); - } else { - osg::Group* group = node->asGroup(); - if (nullptr != group) { - LOG_INFO("node is group"); - group->addChild(skyDome_); - } else { - LOG_INFO("node is not group"); - } - } - + root_->addChild(skyDome_); + skyDome_->addChild(earthMapNode_); skyDome_->attach(view->GetView()); skyDome_->setAtmosphereVisible(true); @@ -152,7 +146,7 @@ osg::ref_ptr OEScene::LoadCubeMapTextures(const std::string } osg::Group* OEScene::GetData() { - return earthMapNode_; + return root_; } diff --git a/src/scene/OEScene.h b/src/scene/OEScene.h index 0f00b87e..f3f5dc18 100644 --- a/src/scene/OEScene.h +++ b/src/scene/OEScene.h @@ -33,7 +33,7 @@ public: osg::Group* GetData(); inline osg::Group* GetScene(void) { - return earthMapNode_.get(); + return root_.get(); } osgEarth::MapNode* GetMapNode(void) const { @@ -46,6 +46,7 @@ public: OESceneUI* GetOrCreateSceneUI(); private: + osg::ref_ptr root_; osg::ref_ptr earthRootNode_; osg::ref_ptr earthMapNode_; osg::ref_ptr entityRoot_; diff --git a/src/scene/ui/BackGroundWidget.cpp b/src/scene/ui/BackGroundWidget.cpp index 450a51b2..0e5a0d63 100644 --- a/src/scene/ui/BackGroundWidget.cpp +++ b/src/scene/ui/BackGroundWidget.cpp @@ -17,7 +17,7 @@ BackGroundWidget::BackGroundWidget(const std::string& name, //osg::Image *image = ImageUtils::readImage(fileName); LOG_INFO("setimage, {}", fileName); - setImage(fileName, true); + setImage(fileName, false); setTexCoord(0.0f, 0.0f, osgWidget::Widget::LOWER_LEFT); setTexCoord(1.0f, 0.0f, osgWidget::Widget::LOWER_RIGHT); diff --git a/src/scene/ui/QueryElevationWidget.cpp b/src/scene/ui/QueryElevationWidget.cpp index 2cb5eb56..222af2b9 100644 --- a/src/scene/ui/QueryElevationWidget.cpp +++ b/src/scene/ui/QueryElevationWidget.cpp @@ -27,7 +27,7 @@ QueryElevationWidget::QueryElevationWidget(OEScene* oeScene) , oeScene_(oeScene) { LOG_INFO("actor self={}", spdlog::fmt_lib::ptr(this)); - label_ = new ColorLabel("Pick me!"); + label_ = new ColorLabel(""); addWidget(label_); getBackground()->setColor(0.0f, 0.0f, 0.0f, 0.3f); } diff --git a/src/translations/Dyt_zh_CN.qm b/src/translations/Dyt_zh_CN.qm index 77648716..9d80c80d 100644 Binary files a/src/translations/Dyt_zh_CN.qm and b/src/translations/Dyt_zh_CN.qm differ diff --git a/src/translations/Dyt_zh_CN.ts b/src/translations/Dyt_zh_CN.ts index 2f08f417..4180ef24 100644 --- a/src/translations/Dyt_zh_CN.ts +++ b/src/translations/Dyt_zh_CN.ts @@ -356,7 +356,7 @@ new workspace - + 新建空间 @@ -453,32 +453,32 @@ Dyt - + Dyt file manager - + 文件管理 simu manager - + 仿真管理 play manager - + 回放管理 window manager - + 窗口管理 system manager - + 系统管理 @@ -491,12 +491,12 @@ model elements - + 实体 attribte - + 属性 @@ -553,7 +553,7 @@ attribute - + 属性 @@ -645,7 +645,7 @@ Release Track - + 取消关注 @@ -680,7 +680,7 @@ Track - + 关注 @@ -695,7 +695,7 @@ Delete - + 删除 @@ -711,7 +711,7 @@ PlayManagerMenu - + 播放管理菜单 @@ -719,12 +719,12 @@ play - + 播放 stop - + 停止 @@ -744,24 +744,16 @@ up - + 加速 down - + 减速 - - - - - - - - question - + 警告 @@ -773,14 +765,26 @@ has not workspace - + 空间不存在 + + + + + + + + + + + warning + 警告 pause - + 暂停 @@ -788,7 +792,7 @@ attribute - + 属性 @@ -1134,7 +1138,7 @@ Name - + 名称 @@ -1235,7 +1239,7 @@ Name - + 名称 @@ -1259,7 +1263,7 @@ warning - + 警告 @@ -1283,7 +1287,7 @@ Path - + 路径 @@ -1533,7 +1537,7 @@ Name - + 名称 @@ -1615,27 +1619,27 @@ SystemManagerMenu - + 系统管理菜单 exit - + 退出 ui setting - + ui设置 question - + 询问 are you sure to exit - + 确定退出 @@ -1702,52 +1706,52 @@ New WorkSpace - + 新建空间 Name - + 名称 input workspace name - + 空间名称 Path - + 路径 select workspace save path - + 选择路径 ... - + describe - + 描述 Sure - + 确认 Cancel - + 取消 new workspace - + 新建空间 @@ -1758,47 +1762,47 @@ warning - + 警告 name or save path is empty, please check it - + 名称或者路径为空 save current workspace? - + 保存当前空间? current path is contains current folder, do you want to overwrite it? - + 当前空间已存在,是否替换? removeRecursively failed - + 删除失败 mkpath failed - + 创建路径失败 name is exits - + 名称已存在 create workSpace failed - + 创建空间失败 save spaceWork directory - + 保存空间目录 diff --git a/src/ui/Menu/PlayManagerMenu.cpp b/src/ui/Menu/PlayManagerMenu.cpp index 86de20a1..867ab80f 100644 --- a/src/ui/Menu/PlayManagerMenu.cpp +++ b/src/ui/Menu/PlayManagerMenu.cpp @@ -31,14 +31,14 @@ PlayManagerMenu::~PlayManagerMenu() { void PlayManagerMenu::OnPlay() { workSpace_ = WorkSpaceManager::Get().GetCurrent(); if (nullptr == workSpace_) { - QMessageBox::warning(&MainFrame::Get(), tr("question"), tr("has not workspace"), + QMessageBox::warning(&MainFrame::Get(), tr("warning"), tr("has not workspace"), QMessageBox::Ok); LOG_INFO("current is nullptr"); return; } Timestep* timestep = workSpace_->GetTimestep(); if (nullptr == timestep) { - QMessageBox::warning(&MainFrame::Get(), tr("question"), tr("has not workspace"), + QMessageBox::warning(&MainFrame::Get(), tr("warning"), tr("has not workspace"), QMessageBox::Ok); LOG_INFO("current is nullptr"); return; @@ -60,14 +60,14 @@ void PlayManagerMenu::OnPlay() { void PlayManagerMenu::OnStop() { workSpace_ = WorkSpaceManager::Get().GetCurrent(); if (nullptr == workSpace_) { - QMessageBox::warning(&MainFrame::Get(), tr("question"), tr("has not workspace"), + QMessageBox::warning(&MainFrame::Get(), tr("warning"), tr("has not workspace"), QMessageBox::Ok); LOG_INFO("current is nullptr"); return; } Timestep* timestep = workSpace_->GetTimestep(); if (nullptr == timestep) { - QMessageBox::warning(&MainFrame::Get(), tr("question"), tr("has not workspace"), + QMessageBox::warning(&MainFrame::Get(), tr("warning"), tr("has not workspace"), QMessageBox::Ok); LOG_INFO("current is nullptr"); return; @@ -78,14 +78,14 @@ void PlayManagerMenu::OnStop() { void PlayManagerMenu::OnUp() { workSpace_ = WorkSpaceManager::Get().GetCurrent(); if (nullptr == workSpace_) { - QMessageBox::warning(&MainFrame::Get(), tr("question"), tr("has not workspace"), + QMessageBox::warning(&MainFrame::Get(), tr("warning"), tr("has not workspace"), QMessageBox::Ok); LOG_INFO("current is nullptr"); return; } Timestep* timestep = workSpace_->GetTimestep(); if (nullptr == timestep) { - QMessageBox::warning(&MainFrame::Get(), tr("question"), tr("has not workspace"), + QMessageBox::warning(&MainFrame::Get(), tr("warning"), tr("has not workspace"), QMessageBox::Ok); LOG_INFO("current is nullptr"); return; @@ -96,14 +96,14 @@ void PlayManagerMenu::OnUp() { void PlayManagerMenu::OnDown() { workSpace_ = WorkSpaceManager::Get().GetCurrent(); if (nullptr == workSpace_) { - QMessageBox::warning(&MainFrame::Get(), tr("question"), tr("has not workspace"), + QMessageBox::warning(&MainFrame::Get(), tr("warning"), tr("has not workspace"), QMessageBox::Ok); LOG_INFO("current is nullptr"); return; } Timestep* timestep = workSpace_->GetTimestep(); if (nullptr == timestep) { - QMessageBox::warning(&MainFrame::Get(), tr("question"), tr("has not workspace"), + QMessageBox::warning(&MainFrame::Get(), tr("warning"), tr("has not workspace"), QMessageBox::Ok); LOG_INFO("current is nullptr"); return;