modified bug
This commit is contained in:
parent
8fee163887
commit
1cff02124a
@ -93,7 +93,6 @@ ConeWave::ConeWave() {
|
|||||||
coneAlpha_ = 0.7f;
|
coneAlpha_ = 0.7f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ConeWave::~ConeWave(void)
|
ConeWave::~ConeWave(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,7 +18,10 @@ ConeWaveComponent::ConeWaveComponent(SceneComponent* parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ConeWaveComponent::~ConeWaveComponent() {
|
ConeWaveComponent::~ConeWaveComponent() {
|
||||||
coneWave_->Destory();
|
if (coneWave_->referenceCount() > 0)
|
||||||
|
{
|
||||||
|
coneWave_->Destory();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string ConeWaveComponent::GetTypeName() {
|
std::string ConeWaveComponent::GetTypeName() {
|
||||||
|
|||||||
@ -152,7 +152,8 @@ bool EntitiesManager::DeleteEntity(Entity* entity) {
|
|||||||
// Immediate deletion to ensure scene graph resources are released
|
// Immediate deletion to ensure scene graph resources are released
|
||||||
// before viewer/context teardown. Using deleteLater() may invoke
|
// before viewer/context teardown. Using deleteLater() may invoke
|
||||||
// QObject cleanup after OSG/GL objects are gone, causing crashes.
|
// QObject cleanup after OSG/GL objects are gone, causing crashes.
|
||||||
delete entity;
|
entity->deleteLater();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -32,7 +32,7 @@ void LabelComponent::AttachEntity(Entity* entity) {
|
|||||||
|
|
||||||
if (entity && !entity->GetName().isEmpty()) {
|
if (entity && !entity->GetName().isEmpty()) {
|
||||||
LOG_INFO("LabelComponent: Attaching to entity '{}'", entity->GetName().toUtf8().data());
|
LOG_INFO("LabelComponent: Attaching to entity '{}'", entity->GetName().toUtf8().data());
|
||||||
SetText(entity->GetName().toLocal8Bit().data());
|
SetText(entity->GetName().toStdString());
|
||||||
|
|
||||||
Entity* entity = GetEntity();
|
Entity* entity = GetEntity();
|
||||||
if (nullptr != entity) {
|
if (nullptr != entity) {
|
||||||
@ -114,7 +114,7 @@ void LabelComponent::SetText(const std::string& text) {
|
|||||||
text_ = text;
|
text_ = text;
|
||||||
needUpdate_ = true;
|
needUpdate_ = true;
|
||||||
if (textNode_.valid()) {
|
if (textNode_.valid()) {
|
||||||
textNode_->setText(text_);
|
textNode_->setText(text_, osgText::String::ENCODING_UTF8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -152,11 +152,12 @@ void LabelComponent::CreateTextNode() {
|
|||||||
billboard_->setMode(osg::Billboard::POINT_ROT_EYE);
|
billboard_->setMode(osg::Billboard::POINT_ROT_EYE);
|
||||||
|
|
||||||
textNode_ = new osgText::Text();
|
textNode_ = new osgText::Text();
|
||||||
|
textNode_->setFont("fonts/simhei.ttf");
|
||||||
|
|
||||||
textNode_->setAlignment(osgText::Text::CENTER_BOTTOM);
|
textNode_->setAlignment(osgText::Text::CENTER_BOTTOM);
|
||||||
textNode_->setAxisAlignment(osgText::Text::SCREEN);
|
textNode_->setAxisAlignment(osgText::Text::SCREEN);
|
||||||
textNode_->setCharacterSizeMode(osgText::Text::SCREEN_COORDS);
|
textNode_->setCharacterSizeMode(osgText::Text::SCREEN_COORDS);
|
||||||
textNode_->setText(text_);
|
textNode_->setText(text_, osgText::String::ENCODING_UTF8);
|
||||||
textNode_->setPosition(osg::Vec3(0.0f, 0.0f, 0.0f));
|
textNode_->setPosition(osg::Vec3(0.0f, 0.0f, 0.0f));
|
||||||
|
|
||||||
billboard_->addDrawable(textNode_.get(), osg::Vec3(0.0f, 0.0f, 5.0f));
|
billboard_->addDrawable(textNode_.get(), osg::Vec3(0.0f, 0.0f, 5.0f));
|
||||||
@ -179,7 +180,7 @@ void LabelComponent::CreateTextNode() {
|
|||||||
|
|
||||||
void LabelComponent::UpdateTextNode() {
|
void LabelComponent::UpdateTextNode() {
|
||||||
if (textNode_.valid()) {
|
if (textNode_.valid()) {
|
||||||
textNode_->setText(text_);
|
textNode_->setText(text_, osgText::String::ENCODING_UTF8);
|
||||||
textNode_->setCharacterSize(fontSize_);
|
textNode_->setCharacterSize(fontSize_);
|
||||||
textNode_->setColor(color_);
|
textNode_->setColor(color_);
|
||||||
|
|
||||||
@ -188,6 +189,6 @@ void LabelComponent::UpdateTextNode() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void LabelComponent::UpdateText(const QString& text) {
|
void LabelComponent::UpdateText(const QString& text) {
|
||||||
SetText(text.toLocal8Bit().data());
|
SetText(text.toStdString());
|
||||||
needUpdate_ = true;
|
needUpdate_ = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,14 +11,15 @@
|
|||||||
|
|
||||||
|
|
||||||
struct ColorLabel : public osgWidget::Label {
|
struct ColorLabel : public osgWidget::Label {
|
||||||
ColorLabel(const char* label) :
|
ColorLabel(std::string label) :
|
||||||
osgWidget::Label("", "") {
|
osgWidget::Label("", "") {
|
||||||
setFont("fonts/Vera.ttf");
|
setFont("fonts/simhei.ttf");
|
||||||
setFontSize(14);
|
setFontSize(14);
|
||||||
setFontColor(1.0f, 1.0f, 1.0f, 1.0f);
|
setFontColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||||
addHeight(18.0f);
|
addHeight(18.0f);
|
||||||
setCanFill(true);
|
setCanFill(true);
|
||||||
setLabel(label);
|
//setLabel(label);
|
||||||
|
getText()->setText(label, osgText::String::ENCODING_UTF8);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -27,7 +28,7 @@ QueryElevationWidget::QueryElevationWidget(OEScene* oeScene)
|
|||||||
, oeScene_(oeScene) {
|
, oeScene_(oeScene) {
|
||||||
LOG_INFO("actor self={}", spdlog::fmt_lib::ptr(this));
|
LOG_INFO("actor self={}", spdlog::fmt_lib::ptr(this));
|
||||||
|
|
||||||
label_ = new ColorLabel(GetElevationString(0, 0, 0).c_str());
|
label_ = new ColorLabel(GetElevationString(0, 0, 0));
|
||||||
addWidget(label_);
|
addWidget(label_);
|
||||||
getBackground()->setColor(0.0f, 0.0f, 0.0f, 0.3f);
|
getBackground()->setColor(0.0f, 0.0f, 0.0f, 0.3f);
|
||||||
}
|
}
|
||||||
@ -61,8 +62,8 @@ void QueryElevationWidget::OnUpdateGeoPoint(double x, double y, double z) {
|
|||||||
|
|
||||||
dyt_check(nullptr != label_);
|
dyt_check(nullptr != label_);
|
||||||
|
|
||||||
label_->setLabel(GetElevationString(x, y, z));
|
label_->getText()->setText(GetElevationString(x, y, z), osgText::String::ENCODING_UTF8);
|
||||||
|
//label_->setLabel(GetElevationString(x, y, z));
|
||||||
}
|
}
|
||||||
|
|
||||||
void QueryElevationWidget::ResetCanvasPosition(double width, double height) {
|
void QueryElevationWidget::ResetCanvasPosition(double width, double height) {
|
||||||
@ -75,7 +76,7 @@ std::string QueryElevationWidget::GetElevationString(double x, double y, double
|
|||||||
QString info = QObject::tr("longitude:") + QString::number(x, 'f', 6) + ", "
|
QString info = QObject::tr("longitude:") + QString::number(x, 'f', 6) + ", "
|
||||||
+ QObject::tr("latitude:") + QString::number(y, 'f', 6) + ", "
|
+ QObject::tr("latitude:") + QString::number(y, 'f', 6) + ", "
|
||||||
+ QObject::tr("altitude:") + QString::number(z, 'f', 6);
|
+ QObject::tr("altitude:") + QString::number(z, 'f', 6);
|
||||||
return std::string(info.toLocal8Bit().constData());
|
return info.toStdString();
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryElevationWidget::QueryElevationEventHandler::QueryElevationEventHandler(
|
QueryElevationWidget::QueryElevationEventHandler::QueryElevationEventHandler(
|
||||||
|
|||||||
@ -2907,17 +2907,17 @@
|
|||||||
<translation>应用程序崩溃</translation>
|
<translation>应用程序崩溃</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../scene/ui/QueryElevationWidget.cpp" line="75"/>
|
<location filename="../scene/ui/QueryElevationWidget.cpp" line="76"/>
|
||||||
<source>longitude:</source>
|
<source>longitude:</source>
|
||||||
<translation>经度:</translation>
|
<translation>经度:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../scene/ui/QueryElevationWidget.cpp" line="76"/>
|
<location filename="../scene/ui/QueryElevationWidget.cpp" line="77"/>
|
||||||
<source>latitude:</source>
|
<source>latitude:</source>
|
||||||
<translation>纬度:</translation>
|
<translation>纬度:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../scene/ui/QueryElevationWidget.cpp" line="77"/>
|
<location filename="../scene/ui/QueryElevationWidget.cpp" line="78"/>
|
||||||
<source>altitude:</source>
|
<source>altitude:</source>
|
||||||
<translation>高度:</translation>
|
<translation>高度:</translation>
|
||||||
</message>
|
</message>
|
||||||
|
|||||||
@ -518,6 +518,13 @@ void AddParamSetting::slotButtonCommit()
|
|||||||
|
|
||||||
sett.setValue("Value", strValue);
|
sett.setValue("Value", strValue);
|
||||||
}
|
}
|
||||||
|
else if (strType == "a+bi")
|
||||||
|
{
|
||||||
|
QLineEdit* pCuralue = (QLineEdit*)ui.tableWidget->cellWidget(iRow, 6);
|
||||||
|
QString strValue = pCuralue->text();
|
||||||
|
QString strIn = QString("%1 = %2;").arg(strName).arg(strValue);
|
||||||
|
out << strIn << "\n";
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sett.setValue("MaxValue", 0);
|
sett.setValue("MaxValue", 0);
|
||||||
|
|||||||
@ -53,6 +53,8 @@ MainFrame::MainFrame(QWidget *parent) :
|
|||||||
InitUI();
|
InitUI();
|
||||||
|
|
||||||
SetTitleBar(ui->titleFrame);
|
SetTitleBar(ui->titleFrame);
|
||||||
|
|
||||||
|
setObjectName("MainFrame");
|
||||||
}
|
}
|
||||||
|
|
||||||
MainFrame::~MainFrame()
|
MainFrame::~MainFrame()
|
||||||
|
|||||||
@ -508,6 +508,14 @@ void SurfacePanel::slotEndLoadData()
|
|||||||
if (nullptr != dockWidget_)
|
if (nullptr != dockWidget_)
|
||||||
{
|
{
|
||||||
dockWidget_->setWindowTitle(m_title);
|
dockWidget_->setWindowTitle(m_title);
|
||||||
|
|
||||||
|
if (m_thread)
|
||||||
|
{
|
||||||
|
m_thread->requestExit();
|
||||||
|
m_thread->wait();
|
||||||
|
m_thread->deleteLater();
|
||||||
|
m_thread = nullptr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -7578,8 +7578,8 @@ QString QtTransfromPropertyManager::valueText(const QtProperty* property) const
|
|||||||
|
|
||||||
QTransformAttribute c = it.value();
|
QTransformAttribute c = it.value();
|
||||||
osg::Vec3 t = c.GetLocation();
|
osg::Vec3 t = c.GetLocation();
|
||||||
osg::Vec3 r = c.GetLocation();
|
osg::Vec3 r = c.GetRotation();
|
||||||
osg::Vec3 s = c.GetLocation();
|
osg::Vec3 s = c.GetScale();
|
||||||
return QCoreApplication::translate("QtPropertyBrowserUtils", "[%1, %2, %3] [%4, %5, %6] [%7, %8, %9]")
|
return QCoreApplication::translate("QtPropertyBrowserUtils", "[%1, %2, %3] [%4, %5, %6] [%7, %8, %9]")
|
||||||
.arg(t.x()).arg(t.y()).arg(t.z())
|
.arg(t.x()).arg(t.y()).arg(t.z())
|
||||||
.arg(r.x()).arg(r.y()).arg(r.z())
|
.arg(r.x()).arg(r.y()).arg(r.z())
|
||||||
|
|||||||
@ -96,7 +96,7 @@ void WorkSpaceDlg::OnSure() {
|
|||||||
workSpace->SetDescribe(ui->etDescribe->toPlainText());
|
workSpace->SetDescribe(ui->etDescribe->toPlainText());
|
||||||
workSpace->SetCommondFilePath(commondPath_);
|
workSpace->SetCommondFilePath(commondPath_);
|
||||||
// Execute commands configured for onCreate right after workspace is set up
|
// Execute commands configured for onCreate right after workspace is set up
|
||||||
workSpace->ExecuteCommands(WorkSpace::CommandWhen::OnCreate);
|
//workSpace->ExecuteCommands(WorkSpace::CommandWhen::OnCreate);
|
||||||
|
|
||||||
WorkSpaceManager::Get().SetCurrent(workSpace);
|
WorkSpaceManager::Get().SetCurrent(workSpace);
|
||||||
accept();
|
accept();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user