mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-07 14:43:10 -06:00
#3793 View auto name. Move ViewNameConfig to 3dView and replace current name field. InitAfterRead update to be backward compatible
This commit is contained in:
parent
fa55e1b3f5
commit
295da5658e
@ -150,11 +150,10 @@ RimContourMapView* RicNewContourMapViewFeature::create2dContourMapFrom3dView(Rim
|
||||
|
||||
contourMap->setEclipseCase(eclipseCase);
|
||||
contourMap->setBackgroundColor(cvf::Color3f(1.0f, 1.0f, 0.98f)); // Ignore original view background
|
||||
contourMap->setDefaultCustomName();
|
||||
|
||||
caf::PdmDocument::updateUiIconStateRecursively(contourMap);
|
||||
|
||||
size_t i = eclipseCase->contourMapCollection()->views().size();
|
||||
contourMap->setName(QString("Contour Map %1").arg(i + 1));
|
||||
eclipseCase->contourMapCollection()->push_back(contourMap);
|
||||
|
||||
contourMap->syncronizeLocalAnnotationsFromGlobal();
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include "RimSimWellInView.h"
|
||||
#include "RimTernaryLegendConfig.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimViewNameConfig.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
#include "RiuViewer.h"
|
||||
@ -41,6 +42,7 @@
|
||||
#include "RivWellPathPartMgr.h"
|
||||
|
||||
#include "cafDisplayCoordTransform.h"
|
||||
#include "cafPdmUiTreeOrdering.h"
|
||||
|
||||
#include "cvfModelBasicList.h"
|
||||
#include "cvfTransform.h"
|
||||
@ -81,6 +83,11 @@ Rim2dIntersectionView::Rim2dIntersectionView(void)
|
||||
CAF_PDM_InitField(&m_showDefiningPoints, "ShowDefiningPoints", true, "Show Points", "", "", "");
|
||||
CAF_PDM_InitField(&m_showAxisLines, "ShowAxisLines", false, "Show Axis Lines", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_nameProxy, "NameProxy", "Name", "", "", "");
|
||||
m_nameProxy.xmlCapability()->disableIO();
|
||||
m_nameProxy.registerGetMethod(this, &Rim2dIntersectionView::getName);
|
||||
m_nameProxy.registerSetMethod(this, &Rim2dIntersectionView::setName);
|
||||
|
||||
m_showWindow = false;
|
||||
m_scaleTransform = new cvf::Transform();
|
||||
m_intersectionVizModel = new cvf::ModelBasicList;
|
||||
@ -91,6 +98,11 @@ Rim2dIntersectionView::Rim2dIntersectionView(void)
|
||||
|
||||
disableGridBoxField();
|
||||
disablePerspectiveProjectionField();
|
||||
|
||||
nameConfig()->hideCaseNameField(true);
|
||||
nameConfig()->hideAggregationTypeField(true);
|
||||
nameConfig()->hidePropertyField(true);
|
||||
nameConfig()->hideSampleSpacingField(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -426,6 +438,30 @@ int Rim2dIntersectionView::timeStepCount()
|
||||
return 0;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString Rim2dIntersectionView::createAutoName() const
|
||||
{
|
||||
return nameConfig()->customName();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString Rim2dIntersectionView::getName() const
|
||||
{
|
||||
return nameConfig()->customName();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Rim2dIntersectionView::setName(const QString& name)
|
||||
{
|
||||
nameConfig()->setCustomName(name);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -758,6 +794,8 @@ void Rim2dIntersectionView::fieldChangedByUi(const caf::PdmFieldHandle* changedF
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Rim2dIntersectionView::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
uiOrdering.add(&m_nameProxy);
|
||||
|
||||
Rim3dView::defineUiOrdering(uiConfigName, uiOrdering);
|
||||
caf::PdmUiGroup* viewGroup = uiOrdering.findGroup("ViewGroup");
|
||||
if (viewGroup)
|
||||
@ -773,3 +811,11 @@ void Rim2dIntersectionView::defineUiOrdering(QString uiConfigName, caf::PdmUiOrd
|
||||
plGroup->add(&m_showDefiningPoints);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Rim2dIntersectionView::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/)
|
||||
{
|
||||
uiTreeOrdering.skipRemainingChildren(true);
|
||||
}
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
#include "Rim3dView.h"
|
||||
#include "cafPdmPtrField.h"
|
||||
#include "cafPdmProxyValueField.h"
|
||||
|
||||
class RimIntersection;
|
||||
class RimRegularLegendConfig;
|
||||
@ -92,11 +93,16 @@ protected:
|
||||
|
||||
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override;
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override;
|
||||
|
||||
bool hasResults();
|
||||
int timeStepCount();
|
||||
|
||||
private:
|
||||
QString createAutoName() const override;
|
||||
QString getName() const;
|
||||
void setName(const QString& name);
|
||||
|
||||
caf::PdmChildField<RimRegularLegendConfig*> m_legendConfig;
|
||||
caf::PdmChildField<RimTernaryLegendConfig*> m_ternaryLegendConfig;
|
||||
@ -110,6 +116,7 @@ protected:
|
||||
cvf::ref<cvf::ModelBasicList> m_intersectionVizModel;
|
||||
cvf::ref<cvf::Transform> m_scaleTransform;
|
||||
|
||||
caf::PdmProxyValueField<QString> m_nameProxy;
|
||||
caf::PdmField<bool> m_showDefiningPoints;
|
||||
caf::PdmField<bool> m_showAxisLines;
|
||||
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include "RimViewController.h"
|
||||
#include "RimViewLinker.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
#include "RimViewNameConfig.h"
|
||||
|
||||
#include "RivAnnotationsPartMgr.h"
|
||||
#include "RivWellPathsPartMgr.h"
|
||||
@ -89,8 +90,11 @@ Rim3dView::Rim3dView(void)
|
||||
RiaPreferences* preferences = app->preferences();
|
||||
CVF_ASSERT(preferences);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_nameConfig, "NameConfig", "", "", "", "");
|
||||
m_nameConfig = new RimViewNameConfig(this);
|
||||
|
||||
CAF_PDM_InitField(&m_name, "UserDescription", QString(""), "Name", "", "", "");
|
||||
CAF_PDM_InitField(&m_name_OBSOLETE, "UserDescription", QString(""), "Name", "", "", "");
|
||||
m_name_OBSOLETE.xmlCapability()->setIOWritable(false);
|
||||
|
||||
CAF_PDM_InitField(&m_cameraPosition, "CameraPosition", cvf::Mat4d::IDENTITY, "", "", "", "");
|
||||
m_cameraPosition.uiCapability()->setUiHidden(true);
|
||||
@ -167,7 +171,7 @@ RiuViewer* Rim3dView::viewer() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Rim3dView::setName(const QString& name)
|
||||
{
|
||||
m_name = name;
|
||||
m_nameConfig->setCustomName(name);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -175,7 +179,7 @@ void Rim3dView::setName(const QString& name)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString Rim3dView::name() const
|
||||
{
|
||||
return m_name;
|
||||
return m_nameConfig->customName();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -225,6 +229,23 @@ void Rim3dView::updateViewWidgetAfterCreation()
|
||||
m_viewer->update();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Rim3dView::initAfterRead()
|
||||
{
|
||||
RimViewWindow::initAfterRead();
|
||||
|
||||
if (!m_name_OBSOLETE().isEmpty())
|
||||
{
|
||||
nameConfig()->setCustomName(m_name_OBSOLETE());
|
||||
nameConfig()->setAddCaseName(false);
|
||||
nameConfig()->setAddAggregationType(false);
|
||||
nameConfig()->setAddProperty(false);
|
||||
nameConfig()->setAddSampleSpacing(false);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -235,11 +256,11 @@ void Rim3dView::updateMdiWindowTitle()
|
||||
QString windowTitle;
|
||||
if (ownerCase())
|
||||
{
|
||||
windowTitle = QString("%1 - %2").arg(ownerCase()->caseUserDescription()).arg(m_name);
|
||||
windowTitle = QString("%1 - %2").arg(ownerCase()->caseUserDescription()).arg(name());
|
||||
}
|
||||
else
|
||||
{
|
||||
windowTitle = m_name;
|
||||
windowTitle = name();
|
||||
}
|
||||
|
||||
m_viewer->layoutWidget()->setWindowTitle(windowTitle);
|
||||
@ -266,7 +287,7 @@ void Rim3dView::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrd
|
||||
{
|
||||
caf::PdmUiGroup* viewGroup = uiOrdering.addNewGroupWithKeyword("Viewer", "ViewGroup");
|
||||
|
||||
viewGroup->add(&m_name);
|
||||
//viewGroup->add(m_nameConfig->nameField());
|
||||
viewGroup->add(&m_backgroundColor);
|
||||
viewGroup->add(&m_showZScaleLabel);
|
||||
viewGroup->add(&m_showGridBox);
|
||||
@ -277,6 +298,8 @@ void Rim3dView::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrd
|
||||
gridGroup->add(&scaleZ);
|
||||
gridGroup->add(&meshMode);
|
||||
gridGroup->add(&surfaceMode);
|
||||
|
||||
uiOrdering.skipRemainingFields(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -535,6 +558,14 @@ bool Rim3dView::isLightingDisabled() const
|
||||
return m_disableLighting();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmFieldHandle* Rim3dView::userDescriptionField()
|
||||
{
|
||||
return m_nameConfig->nameField();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -600,7 +631,7 @@ void Rim3dView::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const
|
||||
RiuMainWindow::instance()->refreshDrawStyleActions();
|
||||
RiuMainWindow::instance()->refreshAnimationActions();
|
||||
}
|
||||
else if (changedField == &m_name)
|
||||
else if (changedField == m_nameConfig->nameField())
|
||||
{
|
||||
updateMdiWindowTitle();
|
||||
|
||||
@ -950,6 +981,14 @@ cvf::Vec3d Rim3dView::cameraPointOfInterest() const
|
||||
return m_cameraPointOfInterest();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimViewNameConfig* Rim3dView::nameConfig() const
|
||||
{
|
||||
return m_nameConfig();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -19,6 +19,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "RiuViewerToViewInterface.h"
|
||||
#include "RimNameConfig.h"
|
||||
#include "RimViewWindow.h"
|
||||
|
||||
#include "RivCellSetEnum.h"
|
||||
@ -43,6 +44,7 @@ class RimWellPathCollection;
|
||||
class RiuViewer;
|
||||
class RivAnnotationsPartMgr;
|
||||
class RivWellPathsPartMgr;
|
||||
class RimViewNameConfig;
|
||||
|
||||
namespace cvf
|
||||
{
|
||||
@ -76,7 +78,7 @@ enum PartRenderMaskEnum
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class Rim3dView : public RimViewWindow, public RiuViewerToViewInterface
|
||||
class Rim3dView : public RimViewWindow, public RiuViewerToViewInterface, public RimNameConfigHolderInterface
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
public:
|
||||
@ -158,7 +160,7 @@ protected:
|
||||
void enablePerspectiveProjectionField();
|
||||
cvf::Mat4d cameraPosition() const;
|
||||
cvf::Vec3d cameraPointOfInterest() const;
|
||||
|
||||
RimViewNameConfig* nameConfig() const;
|
||||
|
||||
RimWellPathCollection* wellPathCollection() const;
|
||||
bool hasVisibleTimeStepDependent3dWellLogCurves() const;
|
||||
@ -212,13 +214,14 @@ private:
|
||||
|
||||
void setupBeforeSave() override;
|
||||
protected:
|
||||
caf::PdmFieldHandle* userDescriptionField() override { return &m_name; }
|
||||
caf::PdmFieldHandle* userDescriptionField() override;
|
||||
caf::PdmFieldHandle* backgroundColorField() { return &m_backgroundColor; }
|
||||
|
||||
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
virtual void updateViewWidgetAfterCreation() override;
|
||||
QWidget* createViewWidget(QWidget* mainWindowParent) override;
|
||||
void initAfterRead() override;
|
||||
|
||||
private:
|
||||
// Overridden ViewWindow methods:
|
||||
@ -238,7 +241,8 @@ private:
|
||||
void appendAnnotationsToModel();
|
||||
|
||||
private:
|
||||
caf::PdmField<QString> m_name;
|
||||
caf::PdmField<QString> m_name_OBSOLETE;
|
||||
caf::PdmChildField<RimViewNameConfig*> m_nameConfig;
|
||||
caf::PdmField<bool> m_disableLighting;
|
||||
caf::PdmField<cvf::Mat4d> m_cameraPosition;
|
||||
caf::PdmField<cvf::Vec3d> m_cameraPointOfInterest;
|
||||
|
@ -61,8 +61,7 @@ RimContourMapView::RimContourMapView()
|
||||
m_gridCollection->setActive(false); // This is also not added to the tree view, so cannot be enabled.
|
||||
setFaultVisParameters();
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_nameConfig, "NameConfig", "", "", "", "");
|
||||
m_nameConfig = new RimViewNameConfig(this);
|
||||
setDefaultCustomName();
|
||||
|
||||
m_contourMapProjectionPartMgr = new RivContourMapProjectionPartMgr(contourMapProjection(), this);
|
||||
|
||||
@ -84,9 +83,9 @@ QString RimContourMapView::createAutoName() const
|
||||
{
|
||||
QStringList autoName;
|
||||
|
||||
if (!m_nameConfig->customName().isEmpty())
|
||||
if (!nameConfig()->customName().isEmpty())
|
||||
{
|
||||
autoName.push_back(m_nameConfig->customName());
|
||||
autoName.push_back(nameConfig()->customName());
|
||||
}
|
||||
|
||||
QStringList generatedAutoTags;
|
||||
@ -94,22 +93,22 @@ QString RimContourMapView::createAutoName() const
|
||||
RimCase* ownerCase = nullptr;
|
||||
this->firstAncestorOrThisOfTypeAsserted(ownerCase);
|
||||
|
||||
if (m_nameConfig->addCaseName())
|
||||
if (nameConfig()->addCaseName())
|
||||
{
|
||||
generatedAutoTags.push_back(ownerCase->caseUserDescription());
|
||||
}
|
||||
|
||||
if (m_nameConfig->addAggregationType())
|
||||
if (nameConfig()->addAggregationType())
|
||||
{
|
||||
generatedAutoTags.push_back(contourMapProjection()->resultAggregationText());
|
||||
}
|
||||
|
||||
if (m_nameConfig->addProperty() && !contourMapProjection()->isColumnResult())
|
||||
if (nameConfig()->addProperty() && !contourMapProjection()->isColumnResult())
|
||||
{
|
||||
generatedAutoTags.push_back(cellResult()->resultVariable());
|
||||
}
|
||||
|
||||
if (m_nameConfig->addSampleSpacing())
|
||||
if (nameConfig()->addSampleSpacing())
|
||||
{
|
||||
generatedAutoTags.push_back(QString("%1").arg(contourMapProjection()->sampleSpacingFactor(), 3, 'f', 2));
|
||||
}
|
||||
@ -121,6 +120,18 @@ QString RimContourMapView::createAutoName() const
|
||||
return autoName.join(": ");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimContourMapView::setDefaultCustomName()
|
||||
{
|
||||
nameConfig()->setCustomName("Contour Map");
|
||||
nameConfig()->hideCaseNameField(false);
|
||||
nameConfig()->hideAggregationTypeField(false);
|
||||
nameConfig()->hidePropertyField(false);
|
||||
nameConfig()->hideSampleSpacingField(false);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -166,7 +177,7 @@ void RimContourMapView::defineUiOrdering(QString uiConfigName, caf::PdmUiOrderin
|
||||
viewGroup->add(&m_showScaleLegend);
|
||||
|
||||
caf::PdmUiGroup* nameGroup = uiOrdering.addNewGroup("Contour Map Name");
|
||||
m_nameConfig->uiOrdering(uiConfigName, *nameGroup);
|
||||
nameConfig()->uiOrdering(uiConfigName, *nameGroup);
|
||||
|
||||
uiOrdering.skipRemainingFields(true);
|
||||
}
|
||||
@ -372,7 +383,7 @@ void RimContourMapView::fieldChangedByUi(const caf::PdmFieldHandle* changedField
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmFieldHandle* RimContourMapView::userDescriptionField()
|
||||
{
|
||||
return m_nameConfig()->nameField();
|
||||
return nameConfig()->nameField();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -25,7 +25,7 @@ class RimViewNameConfig;
|
||||
class RimScaleLegendConfig;
|
||||
class RivContourMapProjectionPartMgr;
|
||||
|
||||
class RimContourMapView : public RimEclipseView, public RimNameConfigHolderInterface
|
||||
class RimContourMapView : public RimEclipseView
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
public:
|
||||
@ -33,6 +33,7 @@ public:
|
||||
RimContourMapProjection* contourMapProjection() const;
|
||||
|
||||
QString createAutoName() const override;
|
||||
void setDefaultCustomName();
|
||||
|
||||
protected:
|
||||
void initAfterRead() override;
|
||||
@ -61,6 +62,5 @@ private:
|
||||
caf::PdmChildField<RimContourMapProjection*> m_contourMapProjection;
|
||||
caf::PdmField<bool> m_showAxisLines;
|
||||
caf::PdmField<bool> m_showScaleLegend;
|
||||
caf::PdmChildField<RimViewNameConfig*> m_nameConfig;
|
||||
};
|
||||
|
||||
|
@ -276,9 +276,6 @@ RimEclipseView* RimEclipseCase::createAndAddReservoirView()
|
||||
|
||||
caf::PdmDocument::updateUiIconStateRecursively(rimEclipseView);
|
||||
|
||||
size_t i = reservoirViews().size();
|
||||
rimEclipseView->setName(QString("View %1").arg(i + 1));
|
||||
|
||||
reservoirViews().push_back(rimEclipseView);
|
||||
|
||||
return rimEclipseView;
|
||||
|
@ -66,6 +66,7 @@
|
||||
#include "RimViewLinker.h"
|
||||
#include "RimVirtualPerforationResults.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
#include "RimViewNameConfig.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
#include "Riu3dSelectionManager.h"
|
||||
@ -168,6 +169,12 @@ RimEclipseView::RimEclipseView()
|
||||
m_reservoirGridPartManager = new RivReservoirViewPartMgr(this);
|
||||
m_simWellsPartManager = new RivReservoirSimWellsPartMgr(this);
|
||||
m_eclipseCase = nullptr;
|
||||
|
||||
nameConfig()->setCustomName("3D View");
|
||||
nameConfig()->hideCaseNameField(false);
|
||||
nameConfig()->hideAggregationTypeField(true);
|
||||
nameConfig()->hidePropertyField(false);
|
||||
nameConfig()->hideSampleSpacingField(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -870,6 +877,14 @@ void RimEclipseView::onLoadDataAndUpdate()
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmFieldHandle* RimEclipseView::userDescriptionField()
|
||||
{
|
||||
return nameConfig()->nameField();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -954,6 +969,40 @@ cvf::Color4f RimEclipseView::colorFromCellCategory(RivCellSetEnum geometryType)
|
||||
return color;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimEclipseView::createAutoName() const
|
||||
{
|
||||
QStringList autoName;
|
||||
|
||||
if (!nameConfig()->customName().isEmpty())
|
||||
{
|
||||
autoName.push_back(nameConfig()->customName());
|
||||
}
|
||||
|
||||
QStringList generatedAutoTags;
|
||||
|
||||
RimCase* ownerCase = nullptr;
|
||||
this->firstAncestorOrThisOfTypeAsserted(ownerCase);
|
||||
|
||||
if (nameConfig()->addCaseName())
|
||||
{
|
||||
generatedAutoTags.push_back(ownerCase->caseUserDescription());
|
||||
}
|
||||
|
||||
if (nameConfig()->addProperty())
|
||||
{
|
||||
generatedAutoTags.push_back(cellResult()->resultVariable());
|
||||
}
|
||||
|
||||
if (!generatedAutoTags.empty())
|
||||
{
|
||||
autoName.push_back(generatedAutoTags.join(", "));
|
||||
}
|
||||
return autoName.join(": ");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -1516,6 +1565,11 @@ void RimEclipseView::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
|
||||
caf::PdmUiGroup* cellGroup = uiOrdering.addNewGroup("Cell Visibility");
|
||||
cellGroup->add(&m_showInactiveCells);
|
||||
cellGroup->add(&m_showInvalidCells);
|
||||
|
||||
caf::PdmUiGroup* nameGroup = uiOrdering.addNewGroup("View Name");
|
||||
nameConfig()->uiOrdering(uiConfigName, *nameGroup);
|
||||
|
||||
uiOrdering.skipRemainingFields(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -149,6 +149,7 @@ protected:
|
||||
virtual void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override;
|
||||
virtual void onLoadDataAndUpdate() override;
|
||||
caf::PdmFieldHandle* userDescriptionField() override;
|
||||
|
||||
void createPartCollectionFromSelection(cvf::Collection<cvf::Part>* parts) override;
|
||||
bool showActiveCellsOnly() override;
|
||||
@ -161,6 +162,8 @@ protected:
|
||||
virtual std::set<RivCellSetEnum> allVisibleFaultGeometryTypes() const;
|
||||
|
||||
private:
|
||||
QString createAutoName() const override;
|
||||
|
||||
void updateDisplayModelVisibility() override;
|
||||
|
||||
std::vector<size_t> indicesToVisibleGrids() const;
|
||||
|
@ -167,8 +167,6 @@ void RimGeoMechCase::reloadDataAndUpdate()
|
||||
RimGeoMechView* RimGeoMechCase::createAndAddReservoirView()
|
||||
{
|
||||
RimGeoMechView* gmv = new RimGeoMechView();
|
||||
size_t i = geoMechViews().size();
|
||||
gmv->setName(QString("View %1").arg(i + 1));
|
||||
|
||||
gmv->setGeoMechCase(this);
|
||||
|
||||
|
@ -40,6 +40,7 @@
|
||||
#include "RimRegularLegendConfig.h"
|
||||
#include "RimTensorResults.h"
|
||||
#include "RimViewLinker.h"
|
||||
#include "RimViewNameConfig.h"
|
||||
|
||||
#include "Riu3DMainWindowTools.h"
|
||||
#include "Riu3dSelectionManager.h"
|
||||
@ -97,6 +98,12 @@ RimGeoMechView::RimGeoMechView(void)
|
||||
m_scaleTransform = new cvf::Transform();
|
||||
m_vizLogic = new RivGeoMechVizLogic(this);
|
||||
m_tensorPartMgr = new RivTensorResultPartMgr(this);
|
||||
|
||||
nameConfig()->setCustomName("GeoMech View");
|
||||
nameConfig()->hideCaseNameField(false);
|
||||
nameConfig()->hideAggregationTypeField(true);
|
||||
nameConfig()->hidePropertyField(false);
|
||||
nameConfig()->hideSampleSpacingField(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -181,6 +188,42 @@ void RimGeoMechView::updateScaleTransform()
|
||||
if (m_viewer) m_viewer->updateCachedValuesInScene();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimGeoMechView::createAutoName() const
|
||||
{
|
||||
QStringList autoName;
|
||||
|
||||
if (!nameConfig()->customName().isEmpty())
|
||||
{
|
||||
autoName.push_back(nameConfig()->customName());
|
||||
}
|
||||
|
||||
QStringList generatedAutoTags;
|
||||
|
||||
RimCase* ownerCase = nullptr;
|
||||
this->firstAncestorOrThisOfTypeAsserted(ownerCase);
|
||||
|
||||
if (nameConfig()->addCaseName())
|
||||
{
|
||||
generatedAutoTags.push_back(ownerCase->caseUserDescription());
|
||||
}
|
||||
|
||||
if (nameConfig()->addProperty())
|
||||
{
|
||||
auto resultName = cellResultResultDefinition()->resultFieldName();
|
||||
if(!resultName.isEmpty())
|
||||
generatedAutoTags.push_back(resultName);
|
||||
}
|
||||
|
||||
if (!generatedAutoTags.empty())
|
||||
{
|
||||
autoName.push_back(generatedAutoTags.join(", "));
|
||||
}
|
||||
return autoName.join(": ");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Create display model,
|
||||
/// or at least empty scenes as frames that is delivered to the viewer
|
||||
@ -826,6 +869,17 @@ bool RimGeoMechView::isUsingFormationNames() const
|
||||
return geoMechPropertyFilterCollection()->isUsingFormationNames();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGeoMechView::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
RimGridView::defineUiOrdering(uiConfigName, uiOrdering);
|
||||
|
||||
caf::PdmUiGroup* nameGroup = uiOrdering.addNewGroup("View Name");
|
||||
nameConfig()->uiOrdering(uiConfigName, *nameGroup);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -848,7 +902,7 @@ void RimGeoMechView::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimGeoMechResultDefinition* RimGeoMechView::cellResultResultDefinition()
|
||||
RimGeoMechResultDefinition* RimGeoMechView::cellResultResultDefinition() const
|
||||
{
|
||||
return cellResult();
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ public:
|
||||
RimCase* ownerCase() const override;
|
||||
|
||||
caf::PdmChildField<RimGeoMechCellColors*> cellResult;
|
||||
RimGeoMechResultDefinition* cellResultResultDefinition();
|
||||
RimGeoMechResultDefinition* cellResultResultDefinition() const;
|
||||
|
||||
const RimPropertyFilterCollection* propertyFilterCollection() const override;
|
||||
|
||||
@ -102,12 +102,15 @@ public:
|
||||
void convertCameraPositionFromOldProjectFiles();
|
||||
|
||||
protected:
|
||||
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override;
|
||||
void onLoadDataAndUpdate() override;
|
||||
|
||||
void createPartCollectionFromSelection(cvf::Collection<cvf::Part>* parts) override;
|
||||
|
||||
private:
|
||||
QString createAutoName() const override;
|
||||
|
||||
void createDisplayModel() override;
|
||||
void updateScaleTransform() override;
|
||||
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include "RimViewController.h"
|
||||
#include "RimViewLinker.h"
|
||||
#include "RimViewLinkerCollection.h"
|
||||
#include "RimViewNameConfig.h"
|
||||
|
||||
#include "Riu3DMainWindowTools.h"
|
||||
|
||||
@ -68,7 +69,6 @@ RimGridView::RimGridView()
|
||||
m_overlayInfoConfig = new Rim3dOverlayInfoConfig();
|
||||
m_overlayInfoConfig->setReservoirView(this);
|
||||
m_overlayInfoConfig.uiCapability()->setUiHidden(true);
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -305,7 +305,7 @@ void RimGridView::updateViewFollowingRangeFilterUpdates()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridView::initAfterRead()
|
||||
{
|
||||
RimViewWindow::initAfterRead();
|
||||
Rim3dView::initAfterRead();
|
||||
|
||||
RimProject* proj = nullptr;
|
||||
firstAncestorOrThisOfType(proj);
|
||||
|
@ -38,7 +38,7 @@ RimNameConfig::RimNameConfig(const RimNameConfigHolderInterface* configHolder /*
|
||||
|
||||
CAF_PDM_InitField(&m_isUsingAutoName_OBSOLETE, "IsUsingAutoName", true, "Add Automatic Name Tags", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_customName, "CustomCurveName", "Custom Name Part", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_autoName, "AutoCurveName", "Full Curve Name", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_autoName, "AutoCurveName", "Full Name", "", "", "");
|
||||
m_isUsingAutoName_OBSOLETE.xmlCapability()->setIOWritable(false);
|
||||
m_autoName.registerGetMethod(this, &RimNameConfig::autoName);
|
||||
m_autoName.xmlCapability()->disableIO();
|
||||
|
@ -30,15 +30,25 @@ CAF_PDM_SOURCE_INIT(RimViewNameConfig, "RimViewNameConfig");
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimViewNameConfig::RimViewNameConfig(const RimNameConfigHolderInterface* configHolder)
|
||||
: RimNameConfig(configHolder)
|
||||
, m_hideAggregationTypeField(false)
|
||||
, m_hideSampleSpacingField(false)
|
||||
{
|
||||
CAF_PDM_InitObject("Contour Map Name Generator", "", "", "");
|
||||
CAF_PDM_InitObject("View Name Generator", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&m_addCaseName, "AddCaseName", true, "Add Case Name", "", "", "");
|
||||
CAF_PDM_InitField(&m_addAggregationType, "AddAggregationType", true, "Add Aggregation Type", "", "", "");
|
||||
CAF_PDM_InitField(&m_addProperty, "AddProperty", true, "Add Property Type", "", "", "");
|
||||
CAF_PDM_InitField(&m_addSampleSpacing, "AddSampleSpacing", false, "Add Sample Spacing", "", "", "");
|
||||
|
||||
m_customName = "Contour Map";
|
||||
m_customName = "";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewNameConfig::setAddCaseName(bool add)
|
||||
{
|
||||
m_addCaseName = add;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -49,6 +59,14 @@ bool RimViewNameConfig::addCaseName() const
|
||||
return m_addCaseName();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewNameConfig::setAddAggregationType(bool add)
|
||||
{
|
||||
m_addAggregationType = add;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -57,6 +75,14 @@ bool RimViewNameConfig::addAggregationType() const
|
||||
return m_addAggregationType();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewNameConfig::setAddProperty(bool add)
|
||||
{
|
||||
m_addProperty = add;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -65,6 +91,14 @@ bool RimViewNameConfig::addProperty() const
|
||||
return m_addProperty();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewNameConfig::setAddSampleSpacing(bool add)
|
||||
{
|
||||
m_addSampleSpacing = add;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -84,14 +118,46 @@ void RimViewNameConfig::enableAllAutoNameTags(bool enable)
|
||||
m_addSampleSpacing = enable;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewNameConfig::hideCaseNameField(bool hide)
|
||||
{
|
||||
m_hideCaseNameField = hide;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewNameConfig::hideAggregationTypeField(bool hide)
|
||||
{
|
||||
m_hideAggregationTypeField = hide;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewNameConfig::hidePropertyField(bool hide)
|
||||
{
|
||||
m_hidePropertyField = hide;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewNameConfig::hideSampleSpacingField(bool hide)
|
||||
{
|
||||
m_hideSampleSpacingField = hide;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewNameConfig::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
RimNameConfig::defineUiOrdering(uiConfigName, uiOrdering);
|
||||
uiOrdering.add(&m_addCaseName);
|
||||
uiOrdering.add(&m_addAggregationType);
|
||||
uiOrdering.add(&m_addProperty);
|
||||
uiOrdering.add(&m_addSampleSpacing);
|
||||
if(!m_hideCaseNameField) uiOrdering.add(&m_addCaseName);
|
||||
if(!m_hideAggregationTypeField) uiOrdering.add(&m_addAggregationType);
|
||||
if(!m_hidePropertyField) uiOrdering.add(&m_addProperty);
|
||||
if(!m_hideSampleSpacingField) uiOrdering.add(&m_addSampleSpacing);
|
||||
}
|
||||
|
@ -31,13 +31,22 @@ class RimViewNameConfig : public RimNameConfig
|
||||
public:
|
||||
RimViewNameConfig(const RimNameConfigHolderInterface* configHolder = nullptr);
|
||||
|
||||
void setAddCaseName(bool add);
|
||||
bool addCaseName() const;
|
||||
void setAddAggregationType(bool add);
|
||||
bool addAggregationType() const;
|
||||
void setAddProperty(bool add);
|
||||
bool addProperty() const;
|
||||
void setAddSampleSpacing(bool add);
|
||||
bool addSampleSpacing() const;
|
||||
|
||||
void enableAllAutoNameTags(bool enable) override;
|
||||
|
||||
void hideCaseNameField(bool hide);
|
||||
void hideAggregationTypeField(bool hide);
|
||||
void hidePropertyField(bool hide);
|
||||
void hideSampleSpacingField(bool hide);
|
||||
|
||||
protected:
|
||||
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
|
||||
@ -46,6 +55,11 @@ private:
|
||||
caf::PdmField<bool> m_addAggregationType;
|
||||
caf::PdmField<bool> m_addProperty;
|
||||
caf::PdmField<bool> m_addSampleSpacing;
|
||||
|
||||
bool m_hideCaseNameField;
|
||||
bool m_hideAggregationTypeField;
|
||||
bool m_hidePropertyField;
|
||||
bool m_hideSampleSpacingField;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user