fix close crash
This commit is contained in:
parent
8bbf971540
commit
43a30fefe3
@ -1,5 +1,5 @@
|
|||||||
#include "effects/ConeWave.h"
|
#include "effects/ConeWave.h"
|
||||||
/*
|
|
||||||
#include <osg/BlendFunc>
|
#include <osg/BlendFunc>
|
||||||
#include <osg/Material>
|
#include <osg/Material>
|
||||||
#include <osg/Texture2D>
|
#include <osg/Texture2D>
|
||||||
@ -230,18 +230,18 @@ void ConeWave::CreateTexturedCone(osg::Geode* geode) {
|
|||||||
//设置渲染顺序 仿真模型被波束遮盖 ,1000000-指的是若有1000000个Node 则此节点最后一个被渲染
|
//设置渲染顺序 仿真模型被波束遮盖 ,1000000-指的是若有1000000个Node 则此节点最后一个被渲染
|
||||||
// //stateset->setRenderBinDetails(120, "OSGEARTH_SCREEN_SPACE_LAYOUT_BIN");
|
// //stateset->setRenderBinDetails(120, "OSGEARTH_SCREEN_SPACE_LAYOUT_BIN");
|
||||||
stateset->setRenderBinDetails(10, "RenderBin");
|
stateset->setRenderBinDetails(10, "RenderBin");
|
||||||
// osg::ref_ptr<osg::BlendFunc> blendFunc = new osg::BlendFunc();
|
osg::ref_ptr<osg::BlendFunc> blendFunc = new osg::BlendFunc();
|
||||||
// stateset->setAttributeAndModes(blendFunc, osg::StateAttribute::ON);
|
stateset->setAttributeAndModes(blendFunc, osg::StateAttribute::ON);
|
||||||
// osg::ref_ptr<osg::Program> program = new osg::Program();
|
osg::ref_ptr<osg::Program> program = new osg::Program();
|
||||||
// program->addShader(vertexShader);
|
program->addShader(vertexShader);
|
||||||
// program->addShader(fragmentShader);
|
program->addShader(fragmentShader);
|
||||||
//
|
|
||||||
// baseColorUniform_ = new osg::Uniform("baseColor", baseColor_);
|
baseColorUniform_ = new osg::Uniform("baseColor", baseColor_);
|
||||||
// stateset->setMode(GL_CULL_FACE, osg::StateAttribute::ON);
|
stateset->setMode(GL_CULL_FACE, osg::StateAttribute::ON);
|
||||||
// stateset->addUniform(baseColorUniform_);
|
stateset->addUniform(baseColorUniform_);
|
||||||
// // stateset->osg::ref_ptr<osg::Program> program = new osg::Program();
|
// // stateset->osg::ref_ptr<osg::Program> program = new osg::Program();
|
||||||
program->addShader(vertexShader);
|
program->addShader(vertexShader);
|
||||||
program->addShader(fragmentShader);(program, osg::StateAttribute::ON);
|
program->addShader(fragmentShader);(program, osg::StateAttribute::ON);
|
||||||
// // stateset->setAttributeAndModes(new osg::Depth(osg::Depth::LESS, 0.0, 1.0, false));
|
// // stateset->setAttributeAndModes(new osg::Depth(osg::Depth::LESS, 0.0, 1.0, false));
|
||||||
//
|
//
|
||||||
// levelCountUniform_ = new osg::Uniform("num", float(levelCount_));
|
// levelCountUniform_ = new osg::Uniform("num", float(levelCount_));
|
||||||
@ -250,7 +250,7 @@ program->addShader(fragmentShader);(program, osg::StateAttribute::ON);
|
|||||||
// stateset->addUniform(levelCountUniform_);
|
// stateset->addUniform(levelCountUniform_);
|
||||||
// stateset->addUniform(levelHeightUniform_.get());
|
// stateset->addUniform(levelHeightUniform_.get());
|
||||||
}
|
}
|
||||||
*/
|
/*
|
||||||
|
|
||||||
#include <osg/Geode>
|
#include <osg/Geode>
|
||||||
#include <osg/Geometry>
|
#include <osg/Geometry>
|
||||||
@ -528,3 +528,4 @@ void ConeWave::changeWaveBeamConeAppearance( osg::Vec4 color, osg::Vec4 lineColo
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
@ -1,5 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
/*
|
|
||||||
#include <osg/Matrix>
|
#include <osg/Matrix>
|
||||||
#include <osg/Array>
|
#include <osg/Array>
|
||||||
#include <osg/Geometry>
|
#include <osg/Geometry>
|
||||||
@ -62,7 +62,7 @@ private:
|
|||||||
float radius_{ 10.0f };
|
float radius_{ 10.0f };
|
||||||
};
|
};
|
||||||
|
|
||||||
*/
|
/*
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <osg/Node>
|
#include <osg/Node>
|
||||||
@ -82,7 +82,7 @@ public:
|
|||||||
|
|
||||||
void createWaveBeamCone(osg::MatrixTransform* node,double angle, double length, osg::Vec4 color, osg::Vec4 lineColor, double lineWidth);
|
void createWaveBeamCone(osg::MatrixTransform* node,double angle, double length, osg::Vec4 color, osg::Vec4 lineColor, double lineWidth);
|
||||||
|
|
||||||
void changeWaveBeamConeTarget(/*osg::MatrixTransform* mt,*/ double latitude, double longitude, double height, bool ifDynamic);
|
void changeWaveBeamConeTarget(/*osg::MatrixTransform* mt, * / double latitude, double longitude, double height, bool ifDynamic);
|
||||||
|
|
||||||
void changeWaveBeamConeAppearance(osg::Vec4 color, osg::Vec4 lineColor, double lineWidth);
|
void changeWaveBeamConeAppearance(osg::Vec4 color, osg::Vec4 lineColor, double lineWidth);
|
||||||
|
|
||||||
@ -93,4 +93,4 @@ private:
|
|||||||
osg::ref_ptr<osg::MatrixTransform> _waveBeamCone;
|
osg::ref_ptr<osg::MatrixTransform> _waveBeamCone;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
*/
|
||||||
|
@ -13,8 +13,8 @@
|
|||||||
|
|
||||||
ConeWaveComponent::ConeWaveComponent(SceneComponent* parent)
|
ConeWaveComponent::ConeWaveComponent(SceneComponent* parent)
|
||||||
: SceneComponent(parent) {
|
: SceneComponent(parent) {
|
||||||
// coneWave_ = new ConeWave();
|
coneWave_ = new ConeWave();
|
||||||
// coneWave_->InitGeode();
|
coneWave_->InitGeode();
|
||||||
|
|
||||||
colorMap_[1] = osg::Vec4(1.0f, 1.0f, 1.0f, 1.0f);
|
colorMap_[1] = osg::Vec4(1.0f, 1.0f, 1.0f, 1.0f);
|
||||||
colorMap_[2] = osg::Vec4(1.0f, 1.0f, 1.0f, 1.0f);
|
colorMap_[2] = osg::Vec4(1.0f, 1.0f, 1.0f, 1.0f);
|
||||||
@ -84,48 +84,46 @@ void ConeWaveComponent::Update(double dt) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ConeWaveComponent::SetHeight(float height) {
|
void ConeWaveComponent::SetHeight(float height) {
|
||||||
// coneWave_->SetHeight(height);
|
coneWave_->SetHeight(height);
|
||||||
// if (nullptr != mt_) {
|
if (nullptr != mt_) {
|
||||||
// mt_->setMatrix(osg::Matrix::translate(osg::Vec3(0.0f, 0.0f, -coneWave_->GetHeght() * 0.75f)));
|
mt_->setMatrix(osg::Matrix::translate(osg::Vec3(0.0f, 0.0f, -coneWave_->GetHeght() * 0.75f)));
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float ConeWaveComponent::GetHeight() const {
|
float ConeWaveComponent::GetHeight() const {
|
||||||
return 0;// coneWave_->GetHeght();
|
return coneWave_->GetHeght();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConeWaveComponent::SetRadius(float radius) {
|
void ConeWaveComponent::SetRadius(float radius) {
|
||||||
// coneWave_->SetRadius(radius);
|
coneWave_->SetRadius(radius);
|
||||||
}
|
}
|
||||||
|
|
||||||
float ConeWaveComponent::GetRadius() const {
|
float ConeWaveComponent::GetRadius() const {
|
||||||
return 0;// return coneWave_->GetRadius();
|
return coneWave_->GetRadius();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConeWaveComponent::SetLevelCount(int count) {
|
void ConeWaveComponent::SetLevelCount(int count) {
|
||||||
// coneWave_->SetLevelCount(count);
|
coneWave_->SetLevelCount(count);
|
||||||
}
|
}
|
||||||
|
|
||||||
float ConeWaveComponent::GetLevelCount() const {
|
float ConeWaveComponent::GetLevelCount() const {
|
||||||
return 0; // return coneWave_->GetLevelCount();
|
return coneWave_->GetLevelCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConeWaveComponent::SetLevelHeight(float height) {
|
void ConeWaveComponent::SetLevelHeight(float height) {
|
||||||
// coneWave_->SetLevelHeight(height);
|
coneWave_->SetLevelHeight(height);
|
||||||
}
|
}
|
||||||
|
|
||||||
float ConeWaveComponent::GetLevelHeight() const {
|
float ConeWaveComponent::GetLevelHeight() const {
|
||||||
// return coneWave_->GetLevelHeihgt();
|
return coneWave_->GetLevelHeihgt();
|
||||||
return 0.0f;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConeWaveComponent::SetBaseColor(const osg::Vec4& color) {
|
void ConeWaveComponent::SetBaseColor(const osg::Vec4& color) {
|
||||||
// coneWave_->SetBaseColor(color);
|
coneWave_->SetBaseColor(color);
|
||||||
}
|
}
|
||||||
|
|
||||||
const osg::Vec4 ConeWaveComponent::GetBaseColor() const {
|
const osg::Vec4 ConeWaveComponent::GetBaseColor() const {
|
||||||
// return coneWave_->GetBaseColor();
|
return coneWave_->GetBaseColor();
|
||||||
return osg::Vec4();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConeWaveComponent::SetColor1(const osg::Vec4& color) {
|
void ConeWaveComponent::SetColor1(const osg::Vec4& color) {
|
||||||
@ -172,7 +170,7 @@ void ConeWaveComponent::AddToRender() {
|
|||||||
void ConeWaveComponent::Initialize() {
|
void ConeWaveComponent::Initialize() {
|
||||||
mt_ = new osg::MatrixTransform;
|
mt_ = new osg::MatrixTransform;
|
||||||
mt_->addChild(coneWave_);
|
mt_->addChild(coneWave_);
|
||||||
// mt_->setMatrix(osg::Matrix::translate(osg::Vec3(0.0f, 0.0f, -coneWave_->GetHeght() * 0.75f)));
|
mt_->setMatrix(osg::Matrix::translate(osg::Vec3(0.0f, 0.0f, -coneWave_->GetHeght() * 0.75f)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConeWaveComponent::UpdateEvent() {
|
void ConeWaveComponent::UpdateEvent() {
|
||||||
@ -200,24 +198,24 @@ void ConeWaveComponent::UpdateEvent() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
osg::Vec4& color = colorMap_[currentStatus_];
|
osg::Vec4& color = colorMap_[currentStatus_];
|
||||||
// coneWave_->SetBaseColor(color);
|
coneWave_->SetBaseColor(color);
|
||||||
coneWave_->setNodeMask(0xff);
|
coneWave_->setNodeMask(0xff);
|
||||||
|
|
||||||
|
|
||||||
//Timestep* timeStep = workspace->GetTimestep();
|
Timestep* timeStep = workspace->GetTimestep();
|
||||||
//if (nullptr == timeStep) {
|
if (nullptr == timeStep) {
|
||||||
// LOG_WARN("timeStep is nullptr");
|
LOG_WARN("timeStep is nullptr");
|
||||||
// return;
|
return;
|
||||||
//}
|
}
|
||||||
|
|
||||||
//double dt = timeStep->GetCurrent();
|
double dt = timeStep->GetCurrent();
|
||||||
//int value = timeAction_->GetValue(dt);
|
int value = timeAction_->GetValue(dt);
|
||||||
//if (-1 == value) {
|
if (-1 == value) {
|
||||||
// return;
|
return;
|
||||||
//}
|
}
|
||||||
//
|
|
||||||
|
|
||||||
//coneWave_->setNodeMask(value == 0 ? 0x0 : 0xff);
|
coneWave_->setNodeMask(value == 0 ? 0x0 : 0xff);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,23 +78,7 @@ CompositeWidgetManager::CompositeWidgetManager(void)
|
|||||||
_canvasFX->getBackground()->setColor(0, 0, 0, 0);
|
_canvasFX->getBackground()->setColor(0, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
CompositeWidgetManager::~CompositeWidgetManager(void)
|
CompositeWidgetManager::~CompositeWidgetManager(void) {
|
||||||
{
|
|
||||||
delete _canvasN;
|
|
||||||
delete _canvasO;
|
|
||||||
delete _canvasBackGround;
|
|
||||||
delete _canvasFX;
|
|
||||||
|
|
||||||
delete _bgLayer1;
|
|
||||||
delete _bgLayer2;
|
|
||||||
delete _bgLayer3;
|
|
||||||
delete _bgLayer4;
|
|
||||||
delete _bgShadow;
|
|
||||||
|
|
||||||
delete _widgetCenter;
|
|
||||||
delete _widgetN;
|
|
||||||
|
|
||||||
delete _widgetFX;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CompositeWidgetManager::ResetCanvasPosition(double x, double y)
|
void CompositeWidgetManager::ResetCanvasPosition(double x, double y)
|
||||||
@ -164,6 +148,13 @@ void CompositeWidgetManager::AttachViewUI(osgWidget::WindowManager* ui) {
|
|||||||
ui->addChild(_canvasBackGround);
|
ui->addChild(_canvasBackGround);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CompositeWidgetManager::DetachViewUI(OsgViewUI* ui) {
|
||||||
|
ui->removeChild(_canvasO);
|
||||||
|
ui->removeChild(_canvasN);
|
||||||
|
ui->removeChild(_canvasFX);
|
||||||
|
ui->removeChild(_canvasBackGround);
|
||||||
|
}
|
||||||
|
|
||||||
//void CompositeWidgetManager::slotHeading(double angle)
|
//void CompositeWidgetManager::slotHeading(double angle)
|
||||||
//{
|
//{
|
||||||
// SetHeading(angle);
|
// SetHeading(angle);
|
||||||
|
@ -32,6 +32,7 @@ public:
|
|||||||
|
|
||||||
void AttachViewUI(class OsgViewUI* ui);
|
void AttachViewUI(class OsgViewUI* ui);
|
||||||
void AttachViewUI(osgWidget::WindowManager* ui);
|
void AttachViewUI(osgWidget::WindowManager* ui);
|
||||||
|
void DetachViewUI(class OsgViewUI* ui);
|
||||||
|
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
@ -44,23 +45,22 @@ public slots:
|
|||||||
void slotHeading(double angle);
|
void slotHeading(double angle);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
osgWidget::Canvas* _canvasN;
|
osg::ref_ptr<osgWidget::Canvas> _canvasN;
|
||||||
osgWidget::Canvas* _canvasO;
|
osg::ref_ptr<osgWidget::Canvas> _canvasO;
|
||||||
osgWidget::Canvas* _canvasBackGround;
|
osg::ref_ptr<osgWidget::Canvas> _canvasBackGround;
|
||||||
osgWidget::Canvas* _canvasFX;
|
osg::ref_ptr<osgWidget::Canvas> _canvasFX;
|
||||||
|
|
||||||
CompositeWidget* _bgLayer1;
|
osg::ref_ptr<CompositeWidget> _bgLayer1;
|
||||||
osgWidget::Widget* _bgLayer2;
|
osg::ref_ptr<osgWidget::Widget> _bgLayer2;
|
||||||
osgWidget::Widget* _bgLayer3;
|
osg::ref_ptr<osgWidget::Widget> _bgLayer3;
|
||||||
osgWidget::Widget* _bgLayer4;
|
osg::ref_ptr<osgWidget::Widget> _bgLayer4;
|
||||||
osgWidget::Widget* _bgShadow;
|
osg::ref_ptr<osgWidget::Widget> _bgShadow;
|
||||||
|
|
||||||
CompositeWidget* _widgetCenter;
|
osg::ref_ptr<CompositeWidget> _widgetCenter;
|
||||||
|
osg::ref_ptr<CompositeWidget> _widgetN;
|
||||||
|
|
||||||
CompositeWidget* _widgetN;
|
osg::ref_ptr<osgWidget::Widget> _widgetFX;
|
||||||
|
osg::ref_ptr<osgWidget::Widget> _widgetFXBackground;
|
||||||
osgWidget::Widget* _widgetFX;
|
|
||||||
osgWidget::Widget* _widgetFXBackground;
|
|
||||||
|
|
||||||
osg::Vec2 _mouseDirection;
|
osg::Vec2 _mouseDirection;
|
||||||
|
|
||||||
|
@ -18,6 +18,11 @@ OESceneUI::OESceneUI(OEScene* oeScene)
|
|||||||
|
|
||||||
OESceneUI::~OESceneUI(void) {
|
OESceneUI::~OESceneUI(void) {
|
||||||
LOG_INFO("dctor self={}", spdlog::fmt_lib::ptr(this));
|
LOG_INFO("dctor self={}", spdlog::fmt_lib::ptr(this));
|
||||||
|
/* if (compositeWidgetManager_) {
|
||||||
|
compositeWidgetManager_->DetachViewUI();
|
||||||
|
delete compositeWidgetManager_;
|
||||||
|
compositeWidgetManager_ = nullptr;
|
||||||
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
void OESceneUI::InitUI(OsgViewUI* ui) {
|
void OESceneUI::InitUI(OsgViewUI* ui) {
|
||||||
@ -42,6 +47,25 @@ void OESceneUI::InitUI(OsgViewUI* ui) {
|
|||||||
LOG_INFO("exit");
|
LOG_INFO("exit");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OESceneUI::UninitUI(OsgViewUI* ui) {
|
||||||
|
LOG_INFO("enter");
|
||||||
|
if (!isInit_) {
|
||||||
|
LOG_INFO("not init");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (compositeWidgetManager_) {
|
||||||
|
compositeWidgetManager_->DetachViewUI(ui);
|
||||||
|
compositeWidgetManager_ = nullptr;
|
||||||
|
}
|
||||||
|
if (queryElevationWidget_) {
|
||||||
|
queryElevationWidget_->DetachViewUI(ui);
|
||||||
|
queryElevationWidget_ = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
isInit_ = false;
|
||||||
|
LOG_INFO("exit");
|
||||||
|
}
|
||||||
|
|
||||||
void OESceneUI::OnResize(double width, double height) {
|
void OESceneUI::OnResize(double width, double height) {
|
||||||
dyt_check(compositeWidgetManager_);
|
dyt_check(compositeWidgetManager_);
|
||||||
//dyt_check(zoomManager_);
|
//dyt_check(zoomManager_);
|
||||||
|
@ -16,6 +16,7 @@ public:
|
|||||||
~OESceneUI(void) override;
|
~OESceneUI(void) override;
|
||||||
|
|
||||||
void InitUI(OsgViewUI* ui) override;
|
void InitUI(OsgViewUI* ui) override;
|
||||||
|
void UninitUI(OsgViewUI* ui) override;
|
||||||
void OnResize(double width, double height) override;
|
void OnResize(double width, double height) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -43,7 +43,17 @@ void QueryElevationWidget::AttachViewUI(OsgViewUI* ui) {
|
|||||||
ui->addChild(this);
|
ui->addChild(this);
|
||||||
dyt_check(nullptr != oeScene_);
|
dyt_check(nullptr != oeScene_);
|
||||||
osgEarth::MapNode* mapNode = oeScene_->GetMapNode();
|
osgEarth::MapNode* mapNode = oeScene_->GetMapNode();
|
||||||
ui->getView()->addEventHandler(new QueryElevationEventHandler(mapNode, this));
|
eventHandler_ = new QueryElevationEventHandler(mapNode, this);
|
||||||
|
ui->getView()->addEventHandler(eventHandler_);
|
||||||
|
}
|
||||||
|
|
||||||
|
void QueryElevationWidget::DetachViewUI(OsgViewUI* ui) {
|
||||||
|
dyt_check(nullptr != ui);
|
||||||
|
ui->removeChild(this);
|
||||||
|
if (nullptr != eventHandler_) {
|
||||||
|
ui->getView()->removeEventHandler(eventHandler_);
|
||||||
|
eventHandler_ = nullptr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@ public:
|
|||||||
~QueryElevationWidget() override;
|
~QueryElevationWidget() override;
|
||||||
|
|
||||||
void AttachViewUI(class OsgViewUI* ui);
|
void AttachViewUI(class OsgViewUI* ui);
|
||||||
|
void DetachViewUI(class OsgViewUI* ui);
|
||||||
|
|
||||||
void OnUpdateGeoPoint(double x, double y, double z);
|
void OnUpdateGeoPoint(double x, double y, double z);
|
||||||
void ResetCanvasPosition(double width, double height);
|
void ResetCanvasPosition(double width, double height);
|
||||||
@ -34,6 +35,7 @@ private:
|
|||||||
private:
|
private:
|
||||||
class OEScene* oeScene_;
|
class OEScene* oeScene_;
|
||||||
osg::ref_ptr<osgWidget::Label> label_;
|
osg::ref_ptr<osgWidget::Label> label_;
|
||||||
|
osg::ref_ptr<QueryElevationEventHandler> eventHandler_;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -503,132 +503,132 @@
|
|||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/MainWindow.cpp" line="65"/>
|
<location filename="../ui/MainWindow.cpp" line="66"/>
|
||||||
<source>model elements</source>
|
<source>model elements</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/MainWindow.cpp" line="71"/>
|
<location filename="../ui/MainWindow.cpp" line="72"/>
|
||||||
<source>attribte</source>
|
<source>attribte</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/MainWindow.cpp" line="108"/>
|
<location filename="../ui/MainWindow.cpp" line="109"/>
|
||||||
<source>Wave Curve</source>
|
<source>Wave Curve</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/MainWindow.cpp" line="114"/>
|
<location filename="../ui/MainWindow.cpp" line="115"/>
|
||||||
<source>Speed Curve</source>
|
<source>Speed Curve</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/MainWindow.cpp" line="123"/>
|
<location filename="../ui/MainWindow.cpp" line="124"/>
|
||||||
<source>3D Curve</source>
|
<source>3D Curve</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/MainWindow.cpp" line="135"/>
|
<location filename="../ui/MainWindow.cpp" line="136"/>
|
||||||
<source>Target number</source>
|
<source>Target number</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/MainWindow.cpp" line="135"/>
|
<location filename="../ui/MainWindow.cpp" line="136"/>
|
||||||
<source>Signal-to-noise ratio</source>
|
<source>Signal-to-noise ratio</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/MainWindow.cpp" line="136"/>
|
<location filename="../ui/MainWindow.cpp" line="137"/>
|
||||||
<source>Azimuth line of sight</source>
|
<source>Azimuth line of sight</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/MainWindow.cpp" line="136"/>
|
<location filename="../ui/MainWindow.cpp" line="137"/>
|
||||||
<source>Pitch gaze angle</source>
|
<source>Pitch gaze angle</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/MainWindow.cpp" line="137"/>
|
<location filename="../ui/MainWindow.cpp" line="138"/>
|
||||||
<source>azimuth</source>
|
<source>azimuth</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/MainWindow.cpp" line="137"/>
|
<location filename="../ui/MainWindow.cpp" line="138"/>
|
||||||
<source>Pitch angle</source>
|
<source>Pitch angle</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/MainWindow.cpp" line="138"/>
|
<location filename="../ui/MainWindow.cpp" line="139"/>
|
||||||
<source>attribute</source>
|
<source>attribute</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/MainWindow.cpp" line="138"/>
|
<location filename="../ui/MainWindow.cpp" line="139"/>
|
||||||
<source>Doppler</source>
|
<source>Doppler</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/MainWindow.cpp" line="139"/>
|
<location filename="../ui/MainWindow.cpp" line="140"/>
|
||||||
<source>course</source>
|
<source>course</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/MainWindow.cpp" line="139"/>
|
<location filename="../ui/MainWindow.cpp" line="140"/>
|
||||||
<source>Speed</source>
|
<source>Speed</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/MainWindow.cpp" line="140"/>
|
<location filename="../ui/MainWindow.cpp" line="141"/>
|
||||||
<source>longitude</source>
|
<source>longitude</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/MainWindow.cpp" line="140"/>
|
<location filename="../ui/MainWindow.cpp" line="141"/>
|
||||||
<source>latitude</source>
|
<source>latitude</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/MainWindow.cpp" line="141"/>
|
<location filename="../ui/MainWindow.cpp" line="142"/>
|
||||||
<source>distance</source>
|
<source>distance</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/MainWindow.cpp" line="141"/>
|
<location filename="../ui/MainWindow.cpp" line="142"/>
|
||||||
<source>velocity</source>
|
<source>velocity</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/MainWindow.cpp" line="142"/>
|
<location filename="../ui/MainWindow.cpp" line="143"/>
|
||||||
<source>Radial dimensions</source>
|
<source>Radial dimensions</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/MainWindow.cpp" line="142"/>
|
<location filename="../ui/MainWindow.cpp" line="143"/>
|
||||||
<source>Target RCS</source>
|
<source>Target RCS</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/MainWindow.cpp" line="148"/>
|
<location filename="../ui/MainWindow.cpp" line="149"/>
|
||||||
<source>Report Table</source>
|
<source>Report Table</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/MainWindow.cpp" line="157"/>
|
<location filename="../ui/MainWindow.cpp" line="158"/>
|
||||||
<source>Signal Indicator Lamp</source>
|
<source>Signal Indicator Lamp</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/MainWindow.cpp" line="164"/>
|
<location filename="../ui/MainWindow.cpp" line="165"/>
|
||||||
<source>ParamSetting</source>
|
<source>ParamSetting</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/MainWindow.cpp" line="169"/>
|
<location filename="../ui/MainWindow.cpp" line="170"/>
|
||||||
<source>Matlab File</source>
|
<source>Matlab File</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/MainWindow.cpp" line="174"/>
|
<location filename="../ui/MainWindow.cpp" line="175"/>
|
||||||
<source>name: 5year 0412</source>
|
<source>name: 5year 0412</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
@ -694,12 +694,12 @@
|
|||||||
<context>
|
<context>
|
||||||
<name>OsgWidget</name>
|
<name>OsgWidget</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../viewer/OsgWidget.cpp" line="93"/>
|
<location filename="../viewer/OsgWidget.cpp" line="110"/>
|
||||||
<source>warning</source>
|
<source>warning</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../viewer/OsgWidget.cpp" line="94"/>
|
<location filename="../viewer/OsgWidget.cpp" line="111"/>
|
||||||
<source>open dyt file failed</source>
|
<source>open dyt file failed</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
@ -858,17 +858,17 @@
|
|||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../scene/ui/QueryElevationWidget.cpp" line="65"/>
|
<location filename="../scene/ui/QueryElevationWidget.cpp" line="75"/>
|
||||||
<source>longitude:</source>
|
<source>longitude:</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../scene/ui/QueryElevationWidget.cpp" line="66"/>
|
<location filename="../scene/ui/QueryElevationWidget.cpp" line="76"/>
|
||||||
<source>latitude:</source>
|
<source>latitude:</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../scene/ui/QueryElevationWidget.cpp" line="67"/>
|
<location filename="../scene/ui/QueryElevationWidget.cpp" line="77"/>
|
||||||
<source>altitude:</source>
|
<source>altitude:</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -39,6 +39,7 @@ MainWindow::MainWindow(QWidget* parent)
|
|||||||
|
|
||||||
MainWindow::~MainWindow() {
|
MainWindow::~MainWindow() {
|
||||||
//OsgViewer::Get().Uninitialize();
|
//OsgViewer::Get().Uninitialize();
|
||||||
|
UninitUI();
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,6 +188,14 @@ void MainWindow::InitUI() {
|
|||||||
#endif // 1
|
#endif // 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::UninitUI() {
|
||||||
|
if (qtOsgViewWidget_) {
|
||||||
|
qtOsgViewWidget_->Uninitialize();
|
||||||
|
delete qtOsgViewWidget_;
|
||||||
|
qtOsgViewWidget_ = nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::InitDockLayout() {
|
void MainWindow::InitDockLayout() {
|
||||||
while (tabWidget_->count() > 0) {
|
while (tabWidget_->count() > 0) {
|
||||||
tabWidget_->removeTab(0);
|
tabWidget_->removeTab(0);
|
||||||
|
@ -42,6 +42,7 @@ public slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void InitUI();
|
void InitUI();
|
||||||
|
void UninitUI();
|
||||||
|
|
||||||
void InitDockLayout();
|
void InitDockLayout();
|
||||||
void AddDockArea(const QString& strArea);
|
void AddDockArea(const QString& strArea);
|
||||||
|
@ -58,6 +58,7 @@ void OsgViewUI::AddUI(OsgViewUI::ViewUI* viewUI) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void OsgViewUI::RemoveUI(OsgViewUI::ViewUI* viewUI) {
|
void OsgViewUI::RemoveUI(OsgViewUI::ViewUI* viewUI) {
|
||||||
|
viewUI->UninitUI(this);
|
||||||
for (auto it = viewUIs_.begin(); it != viewUIs_.end(); ++it) {
|
for (auto it = viewUIs_.begin(); it != viewUIs_.end(); ++it) {
|
||||||
if (*it == viewUI) {
|
if (*it == viewUI) {
|
||||||
viewUIs_.erase(it);
|
viewUIs_.erase(it);
|
||||||
|
@ -11,6 +11,7 @@ public:
|
|||||||
public:
|
public:
|
||||||
virtual ~ViewUI() = default;
|
virtual ~ViewUI() = default;
|
||||||
virtual void InitUI(OsgViewUI* ui ) = 0;
|
virtual void InitUI(OsgViewUI* ui ) = 0;
|
||||||
|
virtual void UninitUI(OsgViewUI* ui) = 0;
|
||||||
virtual void OnResize(double width, double height) = 0;
|
virtual void OnResize(double width, double height) = 0;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -59,9 +59,10 @@ OsgWidget::~OsgWidget() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OsgWidget::Initialize() {
|
void OsgWidget::Initialize() {
|
||||||
|
LOG_INFO("OsgWidget::Initialize");
|
||||||
QHBoxLayout* layout = new QHBoxLayout(this);
|
QHBoxLayout* layout = new QHBoxLayout(this);
|
||||||
activeScene_ = new OEScene();
|
activeScene_ = new OEScene;
|
||||||
connect(&WorkSpaceManager::Get(), &WorkSpaceManager::WorkSpaceChanged, [this](WorkSpace* workspace) {
|
connect(&WorkSpaceManager::Get(), &WorkSpaceManager::WorkSpaceChanged, [this](WorkSpace* workspace) {
|
||||||
if (nullptr == workspace) {
|
if (nullptr == workspace) {
|
||||||
LOG_WARN("workspace is nullptr");
|
LOG_WARN("workspace is nullptr");
|
||||||
@ -78,6 +79,22 @@ void OsgWidget::Initialize() {
|
|||||||
viewUI_->AddUI(activeScene_->GetOrCreateSceneUI());
|
viewUI_->AddUI(activeScene_->GetOrCreateSceneUI());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OsgWidget::Uninitialize() {
|
||||||
|
LOG_INFO("OsgWidget::Uninitialize");
|
||||||
|
if (nullptr != viewUI_) {
|
||||||
|
viewUI_->RemoveUI(activeScene_->GetOrCreateSceneUI());
|
||||||
|
viewUI_ = nullptr;
|
||||||
|
}
|
||||||
|
if (nullptr != activeScene_) {
|
||||||
|
activeScene_->DetachView(view_);
|
||||||
|
activeScene_ = nullptr;
|
||||||
|
}
|
||||||
|
if (nullptr != view_) {
|
||||||
|
removeView(view_);
|
||||||
|
view_ = nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void OsgWidget::LoadDefaultScene() {
|
void OsgWidget::LoadDefaultScene() {
|
||||||
dyt_check(nullptr != activeScene_);
|
dyt_check(nullptr != activeScene_);
|
||||||
if (nullptr == WorkSpaceManager::Get().LoadDefaultWorkspace(activeScene_)) {
|
if (nullptr == WorkSpaceManager::Get().LoadDefaultWorkspace(activeScene_)) {
|
||||||
|
@ -13,6 +13,7 @@ public:
|
|||||||
~OsgWidget() override;
|
~OsgWidget() override;
|
||||||
|
|
||||||
void Initialize(void);
|
void Initialize(void);
|
||||||
|
void Uninitialize(void);
|
||||||
void LoadDefaultScene(void);
|
void LoadDefaultScene(void);
|
||||||
void OnLoadDyt(const QString& path);
|
void OnLoadDyt(const QString& path);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user