#3573 Draw axis lines across the whole view for 2d Contour Maps.

This commit is contained in:
Gaute Lindkvist
2018-10-31 12:13:04 +01:00
parent e9de865c1f
commit 78d81d2630
8 changed files with 164 additions and 67 deletions

View File

@@ -51,6 +51,8 @@ Rim2dEclipseView::Rim2dEclipseView()
CAF_PDM_InitFieldNoDefault(&m_2dGridProjection, "Grid2dProjection", "2d Grid Projection", "", "", "");
m_2dGridProjection = new Rim2dGridProjection();
CAF_PDM_InitField(&m_showAxisLines, "ShowAxisLines", true, "Show Axis Lines", "", "", "");
m_overlayInfoConfig->setIsActive(false);
m_gridCollection->setActive(false); // This is also not added to the tree view, so cannot be enabled.
wellCollection()->isActive = false;
@@ -76,6 +78,7 @@ void Rim2dEclipseView::initAfterRead()
{
m_gridCollection->setActive(false); // This is also not added to the tree view, so cannot be enabled.
disablePerspectiveProjectionField();
setShowGridBox(false);
meshMode.setValue(NO_MESH);
surfaceMode.setValue(FAULTS);
}
@@ -101,7 +104,7 @@ void Rim2dEclipseView::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering
caf::PdmUiGroup* viewGroup = uiOrdering.addNewGroup("Viewer");
viewGroup->add(this->userDescriptionField());
viewGroup->add(this->backgroundColorField());
viewGroup->add(this->showGridBoxField());
viewGroup->add(&m_showAxisLines);
uiOrdering.skipRemainingFields(true);
}
@@ -177,7 +180,7 @@ void Rim2dEclipseView::updateLegends()
void Rim2dEclipseView::updateViewWidgetAfterCreation()
{
m_viewer->showAxisCross(false);
m_viewer->showEdgeTickMarksXY(true);
m_viewer->showEdgeTickMarksXY(true, m_showAxisLines());
m_viewer->enableNavigationRotation(false);
Rim3dView::updateViewWidgetAfterCreation();
@@ -203,3 +206,19 @@ void Rim2dEclipseView::onLoadDataAndUpdate()
m_viewer->setView(cvf::Vec3d(0, 0, -1), cvf::Vec3d(0, 1, 0));
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim2dEclipseView::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
{
if (changedField == &m_showAxisLines)
{
m_viewer->showEdgeTickMarksXY(true, m_showAxisLines());
scheduleCreateDisplayModelAndRedraw();
}
else
{
RimEclipseView::fieldChangedByUi(changedField, oldValue, newValue);
}
}

View File

@@ -39,10 +39,12 @@ protected:
void updateViewWidgetAfterCreation() override;
void updateViewFollowingRangeFilterUpdates() override;
void onLoadDataAndUpdate() override;
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
private:
cvf::ref<Riv2dGridProjectionPartMgr> m_grid2dProjectionPartMgr;
caf::PdmChildField<Rim2dGridProjection*> m_2dGridProjection;
caf::PdmField<bool> m_showAxisLines;
};

View File

@@ -763,6 +763,14 @@ void Rim3dView::setBackgroundColor(const cvf::Color3f& newBackgroundColor)
m_backgroundColor = newBackgroundColor;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim3dView::setShowGridBox(bool showGridBox)
{
m_showGridBox = showGridBox;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -107,6 +107,7 @@ public:
void setFaultMeshSurfDrawstyle();
void setSurfaceDrawstyle();
void setBackgroundColor(const cvf::Color3f& newBackgroundColor);
void setShowGridBox(bool showGridBox);
void disableLighting(bool disable);
bool isLightingDisabled() const;
@@ -206,7 +207,6 @@ private:
protected:
caf::PdmFieldHandle* userDescriptionField() override { return &m_name; }
caf::PdmFieldHandle* backgroundColorField() { return &m_backgroundColor; }
caf::PdmFieldHandle* showGridBoxField() { return &m_showGridBox; }
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;