modify set home viewpoint

This commit is contained in:
brige 2025-07-03 07:44:12 +08:00
parent 0f6d6e3a72
commit 9cf724588a
4 changed files with 43 additions and 31 deletions

View File

@ -63,8 +63,16 @@ bool OEScene::AddToScene(osg::Node* node) const {
void OEScene::SetHomeViewpoint(const osgEarth::Viewpoint& viewpoint, double duration_s) {
dyt_check(nullptr != earthManipulator_);
earthManipulator_->setViewpoint(viewpoint, duration_s);
//earthManipulator_->setHomeViewpoint(viewpoint, duration_s);
if (homeViewpointSet_) {
LOG_INFO("Home viewpoint already set, skipping...");
return;
}
earthManipulator_->setHomeViewpoint(viewpoint, duration_s);
homeViewpointSet_ = true;
LOG_INFO("Home viewpoint set successfully");
}
bool OEScene::TrackEntity(osg::Node* entity, bool track) const {

View File

@ -49,4 +49,5 @@ private:
osg::ref_ptr<osgEarth::Util::SkyNode> skyDome_;
osg::ref_ptr<OESceneUI> sceneUI_;
osgViewer::View* curentView_ {nullptr};
bool homeViewpointSet_ {false}; // 跟踪home viewpoint是否已经设置
};

View File

@ -944,48 +944,48 @@
<context>
<name>QtConeWaveComponentManager</name>
<message>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8956"/>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8965"/>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8941"/>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8950"/>
<source>ConeWaveComponent</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9053"/>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9038"/>
<source>Height</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9060"/>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9045"/>
<source>Radius</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9067"/>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9052"/>
<source>waveCount</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9077"/>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9062"/>
<source>waveSpeed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9084"/>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9069"/>
<source>baseColor</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9091"/>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9076"/>
<source>waveColor</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9098"/>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9083"/>
<source>ringBrightAlpha</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9105"/>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9090"/>
<source>ringDarkAlpha</source>
<translation type="unfinished"></translation>
</message>
@ -1091,28 +1091,28 @@
<context>
<name>QtDashedLineComponentManager</name>
<message>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9297"/>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9306"/>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9282"/>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9291"/>
<source>DashedLineComponent</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9375"/>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9360"/>
<source>Start</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9382"/>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9367"/>
<source>End</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9389"/>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9374"/>
<source>Radius</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9396"/>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9381"/>
<source>Color</source>
<translation type="unfinished"></translation>
</message>
@ -1128,17 +1128,17 @@
<context>
<name>QtEntityPropertyManager</name>
<message>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8398"/>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8385"/>
<source>Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8405"/>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8392"/>
<source>Visible</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8417"/>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8399"/>
<source>Transform</source>
<translation type="unfinished"></translation>
</message>
@ -1220,13 +1220,13 @@
<context>
<name>QtMeshComponetManager</name>
<message>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8531"/>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8540"/>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8516"/>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8525"/>
<source>MeshComponent</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8613"/>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8598"/>
<source>Mesh</source>
<translation type="unfinished"></translation>
</message>
@ -1275,13 +1275,13 @@
<context>
<name>QtPathComponentManager</name>
<message>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8690"/>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8699"/>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8675"/>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8684"/>
<source>PathComponent</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8772"/>
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8757"/>
<source>Path</source>
<translation type="unfinished"></translation>
</message>

View File

@ -8407,26 +8407,29 @@ void QtEntityPropertyManager::initializeProperty(QtProperty* property) {
\reimp
*/
void QtEntityPropertyManager::uninitializeProperty(QtProperty* property) {
QtProperty* prop = d_ptr->m_nameToPropery[property];
// 清理 Name 属性
QtProperty* prop = d_ptr->m_properyToName.value(property, nullptr);
if (prop) {
d_ptr->m_nameToPropery.remove(prop);
delete prop;
}
d_ptr->m_properyToName.remove(property);
prop = d_ptr->m_visibleToPropery[property];
// 清理 Visible 属性
prop = d_ptr->m_properyToVisible.value(property, nullptr);
if (prop) {
d_ptr->m_visibleToPropery.remove(prop);
delete prop;
}
d_ptr->m_properyToVisible.remove(property);
prop = d_ptr->m_transToPropery[property];
// 清理 Transform 属性
prop = d_ptr->m_properyTotrans.value(property, nullptr);
if (prop) {
d_ptr->m_properyTotrans.remove(prop);
d_ptr->m_transToPropery.remove(prop);
delete prop;
}
d_ptr->m_transToPropery.remove(property);
d_ptr->m_properyTotrans.remove(property);
}
#pragma endregion