#3778 Annotations. Move z plane settings to in-view collection

This commit is contained in:
Bjørn Erik Jensen
2018-11-29 10:13:19 +01:00
parent b5f0459843
commit 9dc1e8d063
12 changed files with 81 additions and 139 deletions

View File

@@ -36,6 +36,9 @@ RimAnnotationInViewCollection::RimAnnotationInViewCollection()
CAF_PDM_InitField(&m_isActive, "Active", true, "Active", "", "", "");
m_isActive.uiCapability()->setUiHidden(true);
CAF_PDM_InitField(&m_annotationPlaneDepth, "AnnotationPlaneDepth", 0.0, "Annotation Plane Depth", "", "", "");
CAF_PDM_InitField(&m_snapAnnotations, "SnapAnnotations", false, "Snap Annotations to Plane", "", "", "");
}
//--------------------------------------------------------------------------------------------------
@@ -53,6 +56,31 @@ bool RimAnnotationInViewCollection::isActive() const
return m_isActive();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimAnnotationInViewCollection::annotationPlaneZ() const
{
return -m_annotationPlaneDepth();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimAnnotationInViewCollection::snapAnnotations() const
{
return m_snapAnnotations;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimAnnotationInViewCollection::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
{
uiOrdering.add(&m_annotationPlaneDepth);
uiOrdering.add(&m_snapAnnotations);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -61,15 +89,8 @@ void RimAnnotationInViewCollection::fieldChangedByUi(const caf::PdmFieldHandle*
if (&m_isActive == changedField)
{
this->updateUiIconFromToggleField();
RimGridView* view;
firstAncestorOrThisOfType(view);
if (view)
{
//view->hasUserRequestedAnimation = true;
view->scheduleCreateDisplayModelAndRedraw();
}
}
scheduleRedrawOfRelevantViews();
}
//--------------------------------------------------------------------------------------------------