|
|
|
|
@ -381,17 +381,7 @@ bool nmWxVTKRenderContainerWidget::resetRotationCenterWithoutRender()
|
|
|
|
|
{
|
|
|
|
|
Q_ASSERT(isGuiThread());
|
|
|
|
|
cancelRotationCenterPicking();
|
|
|
|
|
if(!isGuiThread() || m_pCameraController == nullptr ||
|
|
|
|
|
!m_pCameraController->resetRotationCenter()) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
double dCenter[3];
|
|
|
|
|
if(!m_pCameraController->getRotationCenter(dCenter)) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return applyRotationCenter(
|
|
|
|
|
dCenter[0], dCenter[1], dCenter[2], true);
|
|
|
|
|
return resetRotationCenterStateWithoutRender();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void nmWxVTKRenderContainerWidget::showReadyState()
|
|
|
|
|
@ -457,6 +447,7 @@ void nmWxVTKRenderContainerWidget::resetCamera()
|
|
|
|
|
cancelRotationCenterPicking();
|
|
|
|
|
// 控制器用返回值表示相机是否确实改变,成功时只提交一次渲染。
|
|
|
|
|
if(m_pCameraController != nullptr && m_pCameraController->resetCamera()) {
|
|
|
|
|
resetRotationCenterStateWithoutRender();
|
|
|
|
|
renderView();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -465,6 +456,7 @@ void nmWxVTKRenderContainerWidget::setTopView()
|
|
|
|
|
{
|
|
|
|
|
cancelRotationCenterPicking();
|
|
|
|
|
if(m_pCameraController != nullptr && m_pCameraController->setTopView()) {
|
|
|
|
|
resetRotationCenterStateWithoutRender();
|
|
|
|
|
renderView();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -473,6 +465,7 @@ void nmWxVTKRenderContainerWidget::setFrontView()
|
|
|
|
|
{
|
|
|
|
|
cancelRotationCenterPicking();
|
|
|
|
|
if(m_pCameraController != nullptr && m_pCameraController->setFrontView()) {
|
|
|
|
|
resetRotationCenterStateWithoutRender();
|
|
|
|
|
renderView();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -481,6 +474,7 @@ void nmWxVTKRenderContainerWidget::setRightView()
|
|
|
|
|
{
|
|
|
|
|
cancelRotationCenterPicking();
|
|
|
|
|
if(m_pCameraController != nullptr && m_pCameraController->setRightView()) {
|
|
|
|
|
resetRotationCenterStateWithoutRender();
|
|
|
|
|
renderView();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -490,6 +484,7 @@ void nmWxVTKRenderContainerWidget::setIsometricView()
|
|
|
|
|
cancelRotationCenterPicking();
|
|
|
|
|
if(m_pCameraController != nullptr &&
|
|
|
|
|
m_pCameraController->setIsometricView()) {
|
|
|
|
|
resetRotationCenterStateWithoutRender();
|
|
|
|
|
renderView();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -507,9 +502,8 @@ void nmWxVTKRenderContainerWidget::setRotationCenter(
|
|
|
|
|
|
|
|
|
|
void nmWxVTKRenderContainerWidget::resetRotationCenter()
|
|
|
|
|
{
|
|
|
|
|
if(resetRotationCenterWithoutRender()) {
|
|
|
|
|
resetRotationCenterWithoutRender();
|
|
|
|
|
renderView();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool nmWxVTKRenderContainerWidget::applyRotationCenter(
|
|
|
|
|
@ -539,6 +533,33 @@ bool nmWxVTKRenderContainerWidget::applyRotationCenter(
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool nmWxVTKRenderContainerWidget::resetRotationCenterStateWithoutRender()
|
|
|
|
|
{
|
|
|
|
|
Q_ASSERT(isGuiThread());
|
|
|
|
|
if(!isGuiThread() || m_pCameraController == nullptr ||
|
|
|
|
|
!m_pCameraController->resetRotationCenter()) {
|
|
|
|
|
hideRotationCenterMarker();
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
double dCenter[3];
|
|
|
|
|
nmVTKRotationCenterMarkerLayer* pMarkerLayer =
|
|
|
|
|
getRotationCenterMarkerLayer();
|
|
|
|
|
if(!m_pCameraController->getRotationCenter(dCenter) ||
|
|
|
|
|
pMarkerLayer == nullptr ||
|
|
|
|
|
!pMarkerLayer->setWorldCenter(
|
|
|
|
|
dCenter[0], dCenter[1], dCenter[2])) {
|
|
|
|
|
// 逻辑中心与显示副本无法确认一致时,不保留陈旧标记。
|
|
|
|
|
hideRotationCenterMarker();
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 由 Ready、能力和 Pick Target 共同决定显隐,不在中心事务中强制显示。
|
|
|
|
|
updateRotationCenterMarkerVisibility();
|
|
|
|
|
synchronizeRotationCenterMarker();
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void nmWxVTKRenderContainerWidget::cancelRotationCenterPicking()
|
|
|
|
|
{
|
|
|
|
|
Q_ASSERT(isGuiThread());
|
|
|
|
|
|