#3790 Z scale label. Display in upper left corner

This commit is contained in:
Bjørn Erik Jensen
2018-12-10 13:03:53 +01:00
parent a6493042d4
commit 488798c3d8
7 changed files with 64 additions and 5 deletions

View File

@@ -123,6 +123,8 @@ Rim3dView::Rim3dView(void)
CAF_PDM_InitField(&m_disableLighting, "DisableLighting", false, "Disable Results Lighting", "", "Disable light model for scalar result colors", "");
CAF_PDM_InitField(&m_showZScaleLabel, "ShowZScale", true, "Show Z Scale Label", "", "", "");
m_crossSectionVizModel = new cvf::ModelBasicList;
m_crossSectionVizModel->setName("CrossSectionModel");
@@ -194,6 +196,7 @@ QWidget* Rim3dView::createViewWidget(QWidget* mainWindowParent)
this->axisLabels(&xLabel, &yLabel, &zLabel);
m_viewer->setAxisLabels(xLabel, yLabel, zLabel);
updateZScaleLabel();
return m_viewer->layoutWidget();
}
@@ -265,6 +268,7 @@ void Rim3dView::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrd
viewGroup->add(&m_name);
viewGroup->add(&m_backgroundColor);
viewGroup->add(&m_showZScaleLabel);
viewGroup->add(&m_showGridBox);
viewGroup->add(&isPerspectiveView);
viewGroup->add(&m_disableLighting);
@@ -574,7 +578,7 @@ void Rim3dView::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const
m_viewer->update();
updateZScaleLabel();
}
RiuMainWindow::instance()->updateScaleValue();
@@ -636,6 +640,11 @@ void Rim3dView::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const
m_viewer->animationControl()->setTimeout(maximumFrameRate != 0 ? 1000/maximumFrameRate : std::numeric_limits<int>::max());
}
}
else if (changedField == &m_showZScaleLabel)
{
m_viewer->showZScaleLabel(m_showZScaleLabel());
m_viewer->update();
}
}
//--------------------------------------------------------------------------------------------------
@@ -752,6 +761,16 @@ void Rim3dView::updateAnnotationItems()
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim3dView::updateZScaleLabel()
{
// Update Z scale label
int scale = static_cast<int>(scaleZ());
m_viewer->setZScale(scale);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -140,6 +140,7 @@ public:
void createHighlightAndGridBoxDisplayModelWithRedraw();
void updateGridBoxData();
void updateAnnotationItems();
void updateZScaleLabel();
bool isMasterView() const;
@@ -243,5 +244,5 @@ private:
caf::PdmField<cvf::Vec3d> m_cameraPointOfInterest;
caf::PdmField< cvf::Color3f > m_backgroundColor;
caf::PdmField<bool> m_showGridBox;
caf::PdmField<bool> m_showZScaleLabel;
};