modified bug

This commit is contained in:
pimin 2025-11-20 21:03:48 +08:00
parent 8fee163887
commit 1cff02124a
11 changed files with 43 additions and 21 deletions

View File

@ -93,7 +93,6 @@ ConeWave::ConeWave() {
coneAlpha_ = 0.7f;
}
ConeWave::~ConeWave(void)
{
}

View File

@ -18,7 +18,10 @@ ConeWaveComponent::ConeWaveComponent(SceneComponent* parent)
}
ConeWaveComponent::~ConeWaveComponent() {
if (coneWave_->referenceCount() > 0)
{
coneWave_->Destory();
}
}
std::string ConeWaveComponent::GetTypeName() {

View File

@ -152,7 +152,8 @@ bool EntitiesManager::DeleteEntity(Entity* entity) {
// Immediate deletion to ensure scene graph resources are released
// before viewer/context teardown. Using deleteLater() may invoke
// QObject cleanup after OSG/GL objects are gone, causing crashes.
delete entity;
entity->deleteLater();
return true;
}

View File

@ -32,7 +32,7 @@ void LabelComponent::AttachEntity(Entity* entity) {
if (entity && !entity->GetName().isEmpty()) {
LOG_INFO("LabelComponent: Attaching to entity '{}'", entity->GetName().toUtf8().data());
SetText(entity->GetName().toLocal8Bit().data());
SetText(entity->GetName().toStdString());
Entity* entity = GetEntity();
if (nullptr != entity) {
@ -114,7 +114,7 @@ void LabelComponent::SetText(const std::string& text) {
text_ = text;
needUpdate_ = true;
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);
textNode_ = new osgText::Text();
textNode_->setFont("fonts/simhei.ttf");
textNode_->setAlignment(osgText::Text::CENTER_BOTTOM);
textNode_->setAxisAlignment(osgText::Text::SCREEN);
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));
billboard_->addDrawable(textNode_.get(), osg::Vec3(0.0f, 0.0f, 5.0f));
@ -179,7 +180,7 @@ void LabelComponent::CreateTextNode() {
void LabelComponent::UpdateTextNode() {
if (textNode_.valid()) {
textNode_->setText(text_);
textNode_->setText(text_, osgText::String::ENCODING_UTF8);
textNode_->setCharacterSize(fontSize_);
textNode_->setColor(color_);
@ -188,6 +189,6 @@ void LabelComponent::UpdateTextNode() {
}
void LabelComponent::UpdateText(const QString& text) {
SetText(text.toLocal8Bit().data());
SetText(text.toStdString());
needUpdate_ = true;
}

View File

@ -11,14 +11,15 @@
struct ColorLabel : public osgWidget::Label {
ColorLabel(const char* label) :
ColorLabel(std::string label) :
osgWidget::Label("", "") {
setFont("fonts/Vera.ttf");
setFont("fonts/simhei.ttf");
setFontSize(14);
setFontColor(1.0f, 1.0f, 1.0f, 1.0f);
addHeight(18.0f);
setCanFill(true);
setLabel(label);
//setLabel(label);
getText()->setText(label, osgText::String::ENCODING_UTF8);
}
};
@ -27,7 +28,7 @@ QueryElevationWidget::QueryElevationWidget(OEScene* oeScene)
, oeScene_(oeScene) {
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_);
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_);
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) {
@ -75,7 +76,7 @@ std::string QueryElevationWidget::GetElevationString(double x, double y, double
QString info = QObject::tr("longitude:") + QString::number(x, 'f', 6) + ", "
+ QObject::tr("latitude:") + QString::number(y, 'f', 6) + ", "
+ QObject::tr("altitude:") + QString::number(z, 'f', 6);
return std::string(info.toLocal8Bit().constData());
return info.toStdString();
}
QueryElevationWidget::QueryElevationEventHandler::QueryElevationEventHandler(

View File

@ -2907,17 +2907,17 @@
<translation></translation>
</message>
<message>
<location filename="../scene/ui/QueryElevationWidget.cpp" line="75"/>
<location filename="../scene/ui/QueryElevationWidget.cpp" line="76"/>
<source>longitude:</source>
<translation></translation>
</message>
<message>
<location filename="../scene/ui/QueryElevationWidget.cpp" line="76"/>
<location filename="../scene/ui/QueryElevationWidget.cpp" line="77"/>
<source>latitude:</source>
<translation></translation>
</message>
<message>
<location filename="../scene/ui/QueryElevationWidget.cpp" line="77"/>
<location filename="../scene/ui/QueryElevationWidget.cpp" line="78"/>
<source>altitude:</source>
<translation></translation>
</message>

View File

@ -518,6 +518,13 @@ void AddParamSetting::slotButtonCommit()
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
{
sett.setValue("MaxValue", 0);

View File

@ -53,6 +53,8 @@ MainFrame::MainFrame(QWidget *parent) :
InitUI();
SetTitleBar(ui->titleFrame);
setObjectName("MainFrame");
}
MainFrame::~MainFrame()

View File

@ -508,6 +508,14 @@ void SurfacePanel::slotEndLoadData()
if (nullptr != dockWidget_)
{
dockWidget_->setWindowTitle(m_title);
if (m_thread)
{
m_thread->requestExit();
m_thread->wait();
m_thread->deleteLater();
m_thread = nullptr;
}
}
}

View File

@ -7578,8 +7578,8 @@ QString QtTransfromPropertyManager::valueText(const QtProperty* property) const
QTransformAttribute c = it.value();
osg::Vec3 t = c.GetLocation();
osg::Vec3 r = c.GetLocation();
osg::Vec3 s = c.GetLocation();
osg::Vec3 r = c.GetRotation();
osg::Vec3 s = c.GetScale();
return QCoreApplication::translate("QtPropertyBrowserUtils", "[%1, %2, %3] [%4, %5, %6] [%7, %8, %9]")
.arg(t.x()).arg(t.y()).arg(t.z())
.arg(r.x()).arg(r.y()).arg(r.z())

View File

@ -96,7 +96,7 @@ void WorkSpaceDlg::OnSure() {
workSpace->SetDescribe(ui->etDescribe->toPlainText());
workSpace->SetCommondFilePath(commondPath_);
// 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);
accept();