modify set home viewpoint
This commit is contained in:
parent
0f6d6e3a72
commit
9cf724588a
@ -63,8 +63,16 @@ bool OEScene::AddToScene(osg::Node* node) const {
|
|||||||
|
|
||||||
void OEScene::SetHomeViewpoint(const osgEarth::Viewpoint& viewpoint, double duration_s) {
|
void OEScene::SetHomeViewpoint(const osgEarth::Viewpoint& viewpoint, double duration_s) {
|
||||||
dyt_check(nullptr != earthManipulator_);
|
dyt_check(nullptr != earthManipulator_);
|
||||||
|
|
||||||
earthManipulator_->setViewpoint(viewpoint, duration_s);
|
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 {
|
bool OEScene::TrackEntity(osg::Node* entity, bool track) const {
|
||||||
|
@ -49,4 +49,5 @@ private:
|
|||||||
osg::ref_ptr<osgEarth::Util::SkyNode> skyDome_;
|
osg::ref_ptr<osgEarth::Util::SkyNode> skyDome_;
|
||||||
osg::ref_ptr<OESceneUI> sceneUI_;
|
osg::ref_ptr<OESceneUI> sceneUI_;
|
||||||
osgViewer::View* curentView_ {nullptr};
|
osgViewer::View* curentView_ {nullptr};
|
||||||
|
bool homeViewpointSet_ {false}; // 跟踪home viewpoint是否已经设置
|
||||||
};
|
};
|
||||||
|
@ -944,48 +944,48 @@
|
|||||||
<context>
|
<context>
|
||||||
<name>QtConeWaveComponentManager</name>
|
<name>QtConeWaveComponentManager</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8956"/>
|
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8941"/>
|
||||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8965"/>
|
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8950"/>
|
||||||
<source>ConeWaveComponent</source>
|
<source>ConeWaveComponent</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9053"/>
|
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9038"/>
|
||||||
<source>Height</source>
|
<source>Height</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9060"/>
|
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9045"/>
|
||||||
<source>Radius</source>
|
<source>Radius</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9067"/>
|
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9052"/>
|
||||||
<source>waveCount</source>
|
<source>waveCount</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9077"/>
|
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9062"/>
|
||||||
<source>waveSpeed</source>
|
<source>waveSpeed</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9084"/>
|
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9069"/>
|
||||||
<source>baseColor</source>
|
<source>baseColor</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9091"/>
|
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9076"/>
|
||||||
<source>waveColor</source>
|
<source>waveColor</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9098"/>
|
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9083"/>
|
||||||
<source>ringBrightAlpha</source>
|
<source>ringBrightAlpha</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9105"/>
|
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9090"/>
|
||||||
<source>ringDarkAlpha</source>
|
<source>ringDarkAlpha</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
@ -1091,28 +1091,28 @@
|
|||||||
<context>
|
<context>
|
||||||
<name>QtDashedLineComponentManager</name>
|
<name>QtDashedLineComponentManager</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9297"/>
|
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9282"/>
|
||||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9306"/>
|
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9291"/>
|
||||||
<source>DashedLineComponent</source>
|
<source>DashedLineComponent</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9375"/>
|
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9360"/>
|
||||||
<source>Start</source>
|
<source>Start</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9382"/>
|
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9367"/>
|
||||||
<source>End</source>
|
<source>End</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9389"/>
|
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9374"/>
|
||||||
<source>Radius</source>
|
<source>Radius</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9396"/>
|
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9381"/>
|
||||||
<source>Color</source>
|
<source>Color</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
@ -1128,17 +1128,17 @@
|
|||||||
<context>
|
<context>
|
||||||
<name>QtEntityPropertyManager</name>
|
<name>QtEntityPropertyManager</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8398"/>
|
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8385"/>
|
||||||
<source>Name</source>
|
<source>Name</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8405"/>
|
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8392"/>
|
||||||
<source>Visible</source>
|
<source>Visible</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8417"/>
|
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8399"/>
|
||||||
<source>Transform</source>
|
<source>Transform</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
@ -1220,13 +1220,13 @@
|
|||||||
<context>
|
<context>
|
||||||
<name>QtMeshComponetManager</name>
|
<name>QtMeshComponetManager</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8531"/>
|
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8516"/>
|
||||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8540"/>
|
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8525"/>
|
||||||
<source>MeshComponent</source>
|
<source>MeshComponent</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8613"/>
|
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8598"/>
|
||||||
<source>Mesh</source>
|
<source>Mesh</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
@ -1275,13 +1275,13 @@
|
|||||||
<context>
|
<context>
|
||||||
<name>QtPathComponentManager</name>
|
<name>QtPathComponentManager</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8690"/>
|
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8675"/>
|
||||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8699"/>
|
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8684"/>
|
||||||
<source>PathComponent</source>
|
<source>PathComponent</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8772"/>
|
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8757"/>
|
||||||
<source>Path</source>
|
<source>Path</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -8407,26 +8407,29 @@ void QtEntityPropertyManager::initializeProperty(QtProperty* property) {
|
|||||||
\reimp
|
\reimp
|
||||||
*/
|
*/
|
||||||
void QtEntityPropertyManager::uninitializeProperty(QtProperty* property) {
|
void QtEntityPropertyManager::uninitializeProperty(QtProperty* property) {
|
||||||
QtProperty* prop = d_ptr->m_nameToPropery[property];
|
// 清理 Name 属性
|
||||||
|
QtProperty* prop = d_ptr->m_properyToName.value(property, nullptr);
|
||||||
if (prop) {
|
if (prop) {
|
||||||
d_ptr->m_nameToPropery.remove(prop);
|
d_ptr->m_nameToPropery.remove(prop);
|
||||||
delete prop;
|
delete prop;
|
||||||
}
|
}
|
||||||
d_ptr->m_properyToName.remove(property);
|
d_ptr->m_properyToName.remove(property);
|
||||||
|
|
||||||
prop = d_ptr->m_visibleToPropery[property];
|
// 清理 Visible 属性
|
||||||
|
prop = d_ptr->m_properyToVisible.value(property, nullptr);
|
||||||
if (prop) {
|
if (prop) {
|
||||||
d_ptr->m_visibleToPropery.remove(prop);
|
d_ptr->m_visibleToPropery.remove(prop);
|
||||||
delete prop;
|
delete prop;
|
||||||
}
|
}
|
||||||
d_ptr->m_properyToVisible.remove(property);
|
d_ptr->m_properyToVisible.remove(property);
|
||||||
|
|
||||||
prop = d_ptr->m_transToPropery[property];
|
// 清理 Transform 属性
|
||||||
|
prop = d_ptr->m_properyTotrans.value(property, nullptr);
|
||||||
if (prop) {
|
if (prop) {
|
||||||
d_ptr->m_properyTotrans.remove(prop);
|
d_ptr->m_transToPropery.remove(prop);
|
||||||
delete prop;
|
delete prop;
|
||||||
}
|
}
|
||||||
d_ptr->m_transToPropery.remove(property);
|
d_ptr->m_properyTotrans.remove(property);
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
Loading…
Reference in New Issue
Block a user