mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5019 Intersections have first data source as ianctive default
Icon state update for IResDefCollection
This commit is contained in:
parent
fec449dc43
commit
62ed71ed76
@ -161,6 +161,14 @@ RimIntersectionCollection* RimGridView::crossSectionCollection() const
|
|||||||
return m_crossSectionCollection();
|
return m_crossSectionCollection();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimIntersectionResultsDefinitionCollection* RimGridView::separateIntersectionResultsCollection() const
|
||||||
|
{
|
||||||
|
return m_intersectionResultDefCollection;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -45,15 +45,14 @@ public:
|
|||||||
|
|
||||||
cvf::ref<cvf::UByteArray> currentTotalCellVisibility();
|
cvf::ref<cvf::UByteArray> currentTotalCellVisibility();
|
||||||
|
|
||||||
RimIntersectionCollection* crossSectionCollection() const;
|
RimIntersectionCollection* crossSectionCollection() const;
|
||||||
|
RimIntersectionResultsDefinitionCollection* separateIntersectionResultsCollection() const;
|
||||||
|
RimAnnotationInViewCollection* annotationCollection() const;
|
||||||
|
|
||||||
virtual const RimPropertyFilterCollection* propertyFilterCollection() const = 0;
|
virtual const RimPropertyFilterCollection* propertyFilterCollection() const = 0;
|
||||||
|
void rangeFiltersUpdated();
|
||||||
void rangeFiltersUpdated();
|
RimCellRangeFilterCollection* rangeFilterCollection();
|
||||||
RimCellRangeFilterCollection* rangeFilterCollection();
|
const RimCellRangeFilterCollection* rangeFilterCollection() const;
|
||||||
const RimCellRangeFilterCollection* rangeFilterCollection() const;
|
|
||||||
|
|
||||||
RimAnnotationInViewCollection* annotationCollection() const;
|
|
||||||
|
|
||||||
bool hasOverridenRangeFilterCollection();
|
bool hasOverridenRangeFilterCollection();
|
||||||
void setOverrideRangeFilterCollection( RimCellRangeFilterCollection* rfc );
|
void setOverrideRangeFilterCollection( RimCellRangeFilterCollection* rfc );
|
||||||
@ -71,24 +70,22 @@ public:
|
|||||||
bool forceChange = false ) override;
|
bool forceChange = false ) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void updateViewFollowingRangeFilterUpdates();
|
virtual void updateViewFollowingRangeFilterUpdates();
|
||||||
void initAfterRead() override;
|
void onClearReservoirCellVisibilitiesIfNeccessary() override;
|
||||||
void onClearReservoirCellVisibilitiesIfNeccessary() override;
|
virtual void calculateCurrentTotalCellVisibility( cvf::UByteArray* totalVisibility, int timeStep ) = 0;
|
||||||
virtual void calculateCurrentTotalCellVisibility( cvf::UByteArray* totalVisibility, int timeStep ) = 0;
|
void selectOverlayInfoConfig() override;
|
||||||
void selectOverlayInfoConfig() override;
|
RimGridCollection* gridCollection() const;
|
||||||
|
void clearReservoirCellVisibilities();
|
||||||
|
|
||||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
void fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||||
const QVariant& oldValue,
|
const QVariant& oldValue,
|
||||||
const QVariant& newValue ) override;
|
const QVariant& newValue ) override;
|
||||||
|
void initAfterRead() override;
|
||||||
RimGridCollection* gridCollection() const;
|
|
||||||
|
|
||||||
void clearReservoirCellVisibilities();
|
|
||||||
|
|
||||||
protected: // Fields
|
protected: // Fields
|
||||||
caf::PdmChildField<RimIntersectionCollection*> m_crossSectionCollection;
|
caf::PdmChildField<RimIntersectionCollection*> m_crossSectionCollection;
|
||||||
|
|
||||||
caf::PdmChildField<RimIntersectionResultsDefinitionCollection*> m_intersectionResultDefCollection;
|
caf::PdmChildField<RimIntersectionResultsDefinitionCollection*> m_intersectionResultDefCollection;
|
||||||
|
|
||||||
caf::PdmChildField<Rim3dOverlayInfoConfig*> m_overlayInfoConfig;
|
caf::PdmChildField<Rim3dOverlayInfoConfig*> m_overlayInfoConfig;
|
||||||
caf::PdmChildField<RimCellRangeFilterCollection*> m_rangeFilterCollection;
|
caf::PdmChildField<RimCellRangeFilterCollection*> m_rangeFilterCollection;
|
||||||
|
@ -45,6 +45,9 @@
|
|||||||
#include "cafPdmUiPushButtonEditor.h"
|
#include "cafPdmUiPushButtonEditor.h"
|
||||||
|
|
||||||
#include "Rim2dIntersectionView.h"
|
#include "Rim2dIntersectionView.h"
|
||||||
|
#include "RimGridView.h"
|
||||||
|
#include "RimIntersectionResultDefinition.h"
|
||||||
|
#include "RimIntersectionResultsDefinitionCollection.h"
|
||||||
#include "cvfBoundingBox.h"
|
#include "cvfBoundingBox.h"
|
||||||
#include "cvfGeometryTools.h"
|
#include "cvfGeometryTools.h"
|
||||||
#include "cvfPlane.h"
|
#include "cvfPlane.h"
|
||||||
@ -134,6 +137,8 @@ RimIntersection::RimIntersection()
|
|||||||
caf::PdmUiPushButtonEditor::configureEditorForField( &inputTwoAzimuthPointsFromViewerEnabled );
|
caf::PdmUiPushButtonEditor::configureEditorForField( &inputTwoAzimuthPointsFromViewerEnabled );
|
||||||
inputTwoAzimuthPointsFromViewerEnabled = false;
|
inputTwoAzimuthPointsFromViewerEnabled = false;
|
||||||
|
|
||||||
|
CAF_PDM_InitFieldNoDefault( &m_separateDataSource, "SeparateIntersectionDataSource", "Source", "", "", "" );
|
||||||
|
|
||||||
uiCapability()->setUiTreeChildrenHidden( true );
|
uiCapability()->setUiTreeChildrenHidden( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -286,6 +291,17 @@ void RimIntersection::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering
|
|||||||
m_extentLength.uiCapability()->setUiReadOnly( false );
|
m_extentLength.uiCapability()->setUiReadOnly( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString inactiveText;
|
||||||
|
if (!this->activeSeparateResultDefinition())
|
||||||
|
{
|
||||||
|
inactiveText = " (Inactive)";
|
||||||
|
}
|
||||||
|
|
||||||
|
caf::PdmUiGroup* separateResultsGroup = uiOrdering.addNewGroup( "Separate Data Source Reference" + inactiveText );
|
||||||
|
separateResultsGroup->setCollapsedByDefault(true);
|
||||||
|
separateResultsGroup->add(&m_separateDataSource);
|
||||||
|
m_separateDataSource.uiCapability()->setUiName("Source" + inactiveText);
|
||||||
|
|
||||||
updateWellExtentDefaultValue();
|
updateWellExtentDefaultValue();
|
||||||
|
|
||||||
uiOrdering.skipRemainingFields( true );
|
uiOrdering.skipRemainingFields( true );
|
||||||
@ -340,9 +356,52 @@ QList<caf::PdmOptionItemInfo> RimIntersection::calculateValueOptions( const caf:
|
|||||||
options.push_back( caf::PdmOptionItemInfo( QString::number( bIdx + 1 ), QVariant::fromValue( bIdx ) ) );
|
options.push_back( caf::PdmOptionItemInfo( QString::number( bIdx + 1 ), QVariant::fromValue( bIdx ) ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if ( fieldNeedingOptions == &m_separateDataSource )
|
||||||
|
{
|
||||||
|
RimGridView* view;
|
||||||
|
this->firstAncestorOrThisOfTypeAsserted( view );
|
||||||
|
|
||||||
|
std::vector<RimIntersectionResultDefinition*> iResDefs =
|
||||||
|
view->separateIntersectionResultsCollection()->intersectionResultsDefinitions();
|
||||||
|
|
||||||
|
options.push_back( caf::PdmOptionItemInfo( "None", nullptr ) );
|
||||||
|
|
||||||
|
for ( auto iresdef : iResDefs )
|
||||||
|
{
|
||||||
|
options.push_back( caf::PdmOptionItemInfo( iresdef->autoName(), iresdef ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimIntersection::initAfterRead()
|
||||||
|
{
|
||||||
|
updateDefaultSeparateDataSource();
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimIntersection::updateDefaultSeparateDataSource()
|
||||||
|
{
|
||||||
|
if ( m_separateDataSource() == nullptr )
|
||||||
|
{
|
||||||
|
RimGridView* view;
|
||||||
|
this->firstAncestorOrThisOfTypeAsserted( view );
|
||||||
|
|
||||||
|
std::vector<RimIntersectionResultDefinition*> iResDefs =
|
||||||
|
view->separateIntersectionResultsCollection()->intersectionResultsDefinitions();
|
||||||
|
if ( iResDefs.size() )
|
||||||
|
{
|
||||||
|
m_separateDataSource = iResDefs[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -752,6 +811,25 @@ void RimIntersection::appendPointToPolyLine( const cvf::Vec3d& point )
|
|||||||
rebuildGeometryAndScheduleCreateDisplayModel();
|
rebuildGeometryAndScheduleCreateDisplayModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimIntersectionResultDefinition* RimIntersection::activeSeparateResultDefinition()
|
||||||
|
{
|
||||||
|
updateDefaultSeparateDataSource();
|
||||||
|
|
||||||
|
if (!m_separateDataSource) return nullptr;
|
||||||
|
|
||||||
|
if (!m_separateDataSource->isActive()) return nullptr;
|
||||||
|
|
||||||
|
RimGridView* view;
|
||||||
|
this->firstAncestorOrThisOfTypeAsserted( view );
|
||||||
|
|
||||||
|
if (!view->separateIntersectionResultsCollection()->isActive()) return nullptr;
|
||||||
|
|
||||||
|
return m_separateDataSource;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
class RimWellPath;
|
class RimWellPath;
|
||||||
class RivIntersectionPartMgr;
|
class RivIntersectionPartMgr;
|
||||||
|
class RimIntersectionResultDefinition;
|
||||||
class RimSimWellInView;
|
class RimSimWellInView;
|
||||||
class RimSimWellInViewCollection;
|
class RimSimWellInViewCollection;
|
||||||
class Rim2dIntersectionView;
|
class Rim2dIntersectionView;
|
||||||
@ -86,6 +87,8 @@ public:
|
|||||||
std::vector<std::vector<cvf::Vec3d>> polyLines( cvf::Vec3d* flattenedPolylineStartPoint = nullptr ) const;
|
std::vector<std::vector<cvf::Vec3d>> polyLines( cvf::Vec3d* flattenedPolylineStartPoint = nullptr ) const;
|
||||||
void appendPointToPolyLine( const cvf::Vec3d& point );
|
void appendPointToPolyLine( const cvf::Vec3d& point );
|
||||||
|
|
||||||
|
RimIntersectionResultDefinition* activeSeparateResultDefinition();
|
||||||
|
|
||||||
Rim2dIntersectionView* correspondingIntersectionView();
|
Rim2dIntersectionView* correspondingIntersectionView();
|
||||||
RivIntersectionPartMgr* intersectionPartMgr();
|
RivIntersectionPartMgr* intersectionPartMgr();
|
||||||
void rebuildGeometry();
|
void rebuildGeometry();
|
||||||
@ -108,22 +111,19 @@ public:
|
|||||||
void rebuildGeometryAndScheduleCreateDisplayModel();
|
void rebuildGeometryAndScheduleCreateDisplayModel();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
caf::PdmFieldHandle* userDescriptionField() override;
|
caf::PdmFieldHandle* userDescriptionField() override;
|
||||||
caf::PdmFieldHandle* objectToggleField() override;
|
caf::PdmFieldHandle* objectToggleField() override;
|
||||||
|
void fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
const QVariant& oldValue,
|
||||||
const QVariant& oldValue,
|
const QVariant& newValue ) override;
|
||||||
const QVariant& newValue ) override;
|
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||||
|
void defineEditorAttribute( const caf::PdmFieldHandle* field,
|
||||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
QString uiConfigName,
|
||||||
void defineEditorAttribute( const caf::PdmFieldHandle* field,
|
caf::PdmUiEditorAttribute* attribute ) override;
|
||||||
QString uiConfigName,
|
|
||||||
caf::PdmUiEditorAttribute* attribute ) override;
|
|
||||||
|
|
||||||
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
|
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
|
||||||
bool* useOptionsOnly ) override;
|
bool* useOptionsOnly ) override;
|
||||||
|
virtual void initAfterRead() override;
|
||||||
|
|
||||||
private:
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<int> m_branchIndex;
|
caf::PdmField<int> m_branchIndex;
|
||||||
caf::PdmField<double> m_extentLength;
|
caf::PdmField<double> m_extentLength;
|
||||||
@ -136,6 +136,8 @@ private:
|
|||||||
caf::PdmField<std::vector<cvf::Vec3d>> m_customExtrusionPoints;
|
caf::PdmField<std::vector<cvf::Vec3d>> m_customExtrusionPoints;
|
||||||
caf::PdmField<std::vector<cvf::Vec3d>> m_twoAzimuthPoints;
|
caf::PdmField<std::vector<cvf::Vec3d>> m_twoAzimuthPoints;
|
||||||
|
|
||||||
|
caf::PdmPtrField<RimIntersectionResultDefinition*> m_separateDataSource;
|
||||||
|
|
||||||
static void setPushButtonText( bool buttonEnable, caf::PdmUiPushButtonEditorAttribute* attribute );
|
static void setPushButtonText( bool buttonEnable, caf::PdmUiPushButtonEditorAttribute* attribute );
|
||||||
static void setBaseColor( bool enable, caf::PdmUiListEditorAttribute* attribute );
|
static void setBaseColor( bool enable, caf::PdmUiListEditorAttribute* attribute );
|
||||||
|
|
||||||
@ -146,6 +148,7 @@ private:
|
|||||||
void addExtents( std::vector<cvf::Vec3d>& polyLine ) const;
|
void addExtents( std::vector<cvf::Vec3d>& polyLine ) const;
|
||||||
void updateName();
|
void updateName();
|
||||||
static double azimuthInRadians( cvf::Vec3d vec );
|
static double azimuthInRadians( cvf::Vec3d vec );
|
||||||
|
void updateDefaultSeparateDataSource();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
cvf::ref<RivIntersectionPartMgr> m_crossSectionPartMgr;
|
cvf::ref<RivIntersectionPartMgr> m_crossSectionPartMgr;
|
||||||
|
@ -89,7 +89,7 @@ bool RimIntersectionResultDefinition::isActive()
|
|||||||
QString RimIntersectionResultDefinition::autoName() const
|
QString RimIntersectionResultDefinition::autoName() const
|
||||||
{
|
{
|
||||||
QString timestepName;
|
QString timestepName;
|
||||||
QString caseName;
|
QString caseName = "Default undefined source";
|
||||||
|
|
||||||
if ( m_case )
|
if ( m_case )
|
||||||
{
|
{
|
||||||
@ -115,7 +115,7 @@ QString RimIntersectionResultDefinition::autoName() const
|
|||||||
m_geomResultDefinition->resultComponentUiName();
|
m_geomResultDefinition->resultComponentUiName();
|
||||||
}
|
}
|
||||||
|
|
||||||
return caseName + " " + resultVarUiName + " " + timestepName;
|
return resultVarUiName + " " + timestepName + " " + caseName;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -51,6 +51,14 @@ bool RimIntersectionResultsDefinitionCollection::isActive()
|
|||||||
return m_isActive();
|
return m_isActive();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
std::vector<RimIntersectionResultDefinition*> RimIntersectionResultsDefinitionCollection::intersectionResultsDefinitions()
|
||||||
|
{
|
||||||
|
return m_intersectionResultsDefs.childObjects();
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -66,4 +74,13 @@ void RimIntersectionResultsDefinitionCollection::fieldChangedByUi( const caf::Pd
|
|||||||
const QVariant& oldValue,
|
const QVariant& oldValue,
|
||||||
const QVariant& newValue )
|
const QVariant& newValue )
|
||||||
{
|
{
|
||||||
|
this->updateUiIconFromToggleField();
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimIntersectionResultsDefinitionCollection::initAfterRead()
|
||||||
|
{
|
||||||
|
this->updateUiIconFromToggleField();
|
||||||
}
|
}
|
||||||
|
@ -34,11 +34,14 @@ public:
|
|||||||
|
|
||||||
bool isActive();
|
bool isActive();
|
||||||
|
|
||||||
|
std::vector<RimIntersectionResultDefinition*> intersectionResultsDefinitions();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
caf::PdmFieldHandle* objectToggleField() override;
|
caf::PdmFieldHandle* objectToggleField() override;
|
||||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
void fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||||
const QVariant& oldValue,
|
const QVariant& oldValue,
|
||||||
const QVariant& newValue ) override;
|
const QVariant& newValue ) override;
|
||||||
|
virtual void initAfterRead() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<bool> m_isActive;
|
caf::PdmField<bool> m_isActive;
|
||||||
|
Loading…
Reference in New Issue
Block a user