mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-14 17:32:13 -05:00
Merge branch 'dev' into dev-deeper
This commit is contained in:
commit
5e769b337f
26 files changed
+1065
-946
No files matched your search
@@ -502,8 +502,8 @@ QString Rim3dOverlayInfoConfig::caseInfoText(RimEclipseView* eclipseView)
|
||||
QString totCellCount = QString::number(contourMap->contourMapProjection()->numberOfCells());
|
||||
cvf::uint validCellCount = contourMap->contourMapProjection()->numberOfValidCells();
|
||||
QString activeCellCountText = QString::number(validCellCount);
|
||||
QString iSize = QString::number(contourMap->contourMapProjection()->mapSize().x());
|
||||
QString jSize = QString::number(contourMap->contourMapProjection()->mapSize().y());
|
||||
QString iSize = QString::number(contourMap->contourMapProjection()->numberOfElementsIJ().x());
|
||||
QString jSize = QString::number(contourMap->contourMapProjection()->numberOfElementsIJ().y());
|
||||
QString aggregationType = contourMap->contourMapProjection()->resultAggregationText();
|
||||
QString weightingParameterString;
|
||||
if (contourMap->contourMapProjection()->weightingParameter() != "None")
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -65,105 +65,116 @@ public:
|
||||
RimContourMapProjection();
|
||||
~RimContourMapProjection() override;
|
||||
|
||||
void generateVertices(cvf::Vec3fArray* vertices, const caf::DisplayCoordTransform* displayCoordTransform);
|
||||
|
||||
void generateVertices(cvf::Vec3fArray* vertices, const caf::DisplayCoordTransform* displayCoordTransform);
|
||||
ContourPolygons generateContourPolygons(const caf::DisplayCoordTransform* displayCoordTransform);
|
||||
cvf::ref<cvf::Vec3fArray> generatePickPointPolygon(const caf::DisplayCoordTransform* displayCoordTransform);
|
||||
|
||||
void generateResults();
|
||||
|
||||
ResultAggregation resultAggregation() const;
|
||||
double sampleSpacing() const;
|
||||
double sampleSpacingFactor() const;
|
||||
bool showContourLines() const;
|
||||
|
||||
QString resultAggregationText() const;
|
||||
QString resultDescriptionText() const;
|
||||
QString weightingParameter() const;
|
||||
|
||||
double maxValue() const;
|
||||
double minValue() const;
|
||||
double meanValue() const;
|
||||
double sumAllValues() const;
|
||||
double sampleSpacing() const;
|
||||
double sampleSpacingFactor() const;
|
||||
cvf::Vec2ui mapSize() const;
|
||||
cvf::Vec2ui vertexGridSize() const;
|
||||
|
||||
bool showContourLines() const;
|
||||
cvf::Vec2ui numberOfElementsIJ() const;
|
||||
cvf::Vec2ui numberOfVerticesIJ() const;
|
||||
|
||||
const std::vector<double>& aggregatedResults() const;
|
||||
QString weightingParameter() const;
|
||||
bool isMeanResult() const;
|
||||
bool isSummationResult() const;
|
||||
bool isStraightSummationResult() const;
|
||||
static bool isStraightSummationResult(ResultAggregationEnum aggregationType);
|
||||
bool isColumnResult() const;
|
||||
|
||||
double valueAtVertex(uint i, uint j) const;
|
||||
bool hasResultAtVertex(uint i, uint j) const;
|
||||
|
||||
RimRegularLegendConfig* legendConfig() const;
|
||||
|
||||
size_t cellIndex(uint i, uint j) const;
|
||||
size_t vertexIndex(uint i, uint j) const;
|
||||
cvf::Vec2ui ijFromVertexIndex(size_t gridIndex) const;
|
||||
cvf::Vec2ui ijFromCellIndex(size_t mapIndex) const;
|
||||
void updateLegend();
|
||||
|
||||
size_t numberOfVertices() const;
|
||||
uint numberOfCells() const;
|
||||
uint numberOfValidCells() const;
|
||||
size_t numberOfVertices() const;
|
||||
|
||||
ResultAggregation resultAggregation() const;
|
||||
QString resultAggregationText() const;
|
||||
QString resultDescriptionText() const;
|
||||
void updatedWeightingResult();
|
||||
|
||||
bool checkForMapIntersection(const cvf::Vec3d& localPoint3d, cvf::Vec2d* contourMapPoint, cvf::Vec2ui* contourMapCell, double* valueAtPoint) const;
|
||||
void setPickPoint(cvf::Vec2d pickedPoint);
|
||||
bool checkForMapIntersection(const cvf::Vec3d& localPoint3d, cvf::Vec2d* contourMapPoint, cvf::Vec2ui* contourMapCell, double* valueAtPoint) const;
|
||||
void setPickPoint(cvf::Vec2d pickedPoint);
|
||||
|
||||
protected:
|
||||
double valueInCell(uint i, uint j) const;
|
||||
bool hasResultInCell(uint i, uint j) const;
|
||||
|
||||
double calculateValueInCell(uint i, uint j) const;
|
||||
double calculateValueAtVertex(uint i, uint j) const;
|
||||
|
||||
void generateGridMapping();
|
||||
void calculateTotalCellVisibility();
|
||||
cvf::Vec2d globalCellCenterPosition(uint i, uint j) const;
|
||||
cvf::Vec2ui ijFromLocalPos(const cvf::Vec2d& localPos2d) const;
|
||||
|
||||
std::vector<std::pair<size_t, double>> cellsAtIJ(uint i, uint j) const;
|
||||
std::vector<double> xVertexPositions() const;
|
||||
std::vector<double> yVertexPositions() const;
|
||||
|
||||
std::vector<std::pair<size_t, double>> visibleCellsAndOverlapVolumeFrom2dPoint(const cvf::Vec2d& globalPos2d, const std::vector<double>* weightingResultValues = nullptr) const;
|
||||
std::vector<std::pair<size_t, double>> visibleCellsAndLengthInCellFrom2dPoint(const cvf::Vec2d& globalPos2d, const std::vector<double>* weightingResultValues = nullptr) const;
|
||||
double findColumnResult(ResultAggregation resultAggregation, size_t cellGlobalIdx) const;
|
||||
const RimEclipseResultCase* eclipseCase() const;
|
||||
RimEclipseResultCase* eclipseCase();
|
||||
RimContourMapView* view() const;
|
||||
RigMainGrid* mainGrid() const;
|
||||
|
||||
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute) override;
|
||||
void defineEditorAttribute(const caf::PdmFieldHandle* field,
|
||||
QString uiConfigName,
|
||||
caf::PdmUiEditorAttribute* attribute) override;
|
||||
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override;
|
||||
void initAfterRead() override;
|
||||
bool getLegendRangeFrom3dGrid() const;
|
||||
void updateGridInformation();
|
||||
cvf::Vec2ui calculateMapSize() const;
|
||||
void initAfterRead() override;
|
||||
|
||||
private:
|
||||
typedef std::pair<size_t, double> CellIndexAndResult;
|
||||
|
||||
private:
|
||||
void generateGridMapping();
|
||||
|
||||
double valueInCell(uint i, uint j) const;
|
||||
bool hasResultInCell(uint i, uint j) const;
|
||||
|
||||
double calculateValueInCell(uint i, uint j) const;
|
||||
double calculateValueAtVertex(uint i, uint j) const;
|
||||
|
||||
|
||||
std::vector<CellIndexAndResult> cellsAtIJ(uint i, uint j) const;
|
||||
|
||||
std::vector<CellIndexAndResult> visibleCellsAndOverlapVolumeFrom2dPoint(const cvf::Vec2d& globalPos2d, const std::vector<double>* weightingResultValues = nullptr) const;
|
||||
std::vector<CellIndexAndResult> visibleCellsAndLengthInCellFrom2dPoint(const cvf::Vec2d& globalPos2d, const std::vector<double>* weightingResultValues = nullptr) const;
|
||||
double findColumnResult(ResultAggregation resultAggregation, size_t cellGlobalIdx) const;
|
||||
|
||||
bool isMeanResult() const;
|
||||
bool isSummationResult() const;
|
||||
bool isStraightSummationResult() const;
|
||||
static bool isStraightSummationResult(ResultAggregationEnum aggregationType);
|
||||
|
||||
size_t cellIndexFromIJ(uint i, uint j) const;
|
||||
size_t vertexIndexFromIJ(uint i, uint j) const;
|
||||
|
||||
cvf::Vec2ui ijFromVertexIndex(size_t gridIndex) const;
|
||||
cvf::Vec2ui ijFromCellIndex(size_t mapIndex) const;
|
||||
cvf::Vec2ui ijFromLocalPos(const cvf::Vec2d& localPos2d) const;
|
||||
cvf::Vec2d globalCellCenterPosition(uint i, uint j) const;
|
||||
|
||||
std::vector<double> xVertexPositions() const;
|
||||
std::vector<double> yVertexPositions() const;
|
||||
|
||||
bool getLegendRangeFrom3dGrid() const;
|
||||
void updateGridInformation();
|
||||
cvf::Vec2ui calculateMapSize() const;
|
||||
|
||||
RimEclipseResultCase* eclipseCase() const;
|
||||
RimContourMapView* view() const;
|
||||
|
||||
protected:
|
||||
caf::PdmField<double> m_relativeSampleSpacing;
|
||||
caf::PdmField<ResultAggregation> m_resultAggregation;
|
||||
caf::PdmField<bool> m_showContourLines;
|
||||
caf::PdmField<bool> m_weightByParameter;
|
||||
caf::PdmChildField<RimEclipseResultDefinition*> m_weightingResult;
|
||||
cvf::ref<cvf::UByteArray> m_cellGridIdxVisibility;
|
||||
caf::PdmField<double> m_relativeSampleSpacing;
|
||||
caf::PdmField<ResultAggregation> m_resultAggregation;
|
||||
caf::PdmField<bool> m_showContourLines;
|
||||
caf::PdmField<bool> m_weightByParameter;
|
||||
caf::PdmChildField<RimEclipseResultDefinition*> m_weightingResult;
|
||||
cvf::ref<cvf::UByteArray> m_cellGridIdxVisibility;
|
||||
|
||||
std::vector<double> m_aggregatedResults;
|
||||
std::vector<double> m_aggregatedVertexResults;
|
||||
std::vector<double> m_aggregatedResults;
|
||||
std::vector<double> m_aggregatedVertexResults;
|
||||
|
||||
std::vector<std::vector<std::pair<size_t, double>>> m_projected3dGridIndices;
|
||||
|
||||
cvf::ref<RigResultAccessor> m_resultAccessor;
|
||||
cvf::ref<RigResultAccessor> m_resultAccessor;
|
||||
|
||||
cvf::Vec2d m_pickPoint;
|
||||
cvf::Vec2d m_pickPoint;
|
||||
|
||||
cvf::Vec2ui m_mapSize;
|
||||
cvf::BoundingBox m_fullBoundingBox;
|
||||
double m_sampleSpacing;
|
||||
caf::PdmPointer<RimEclipseResultCase> m_eclipseCase;
|
||||
cvf::ref<RigMainGrid> m_mainGrid;
|
||||
cvf::Vec2ui m_mapSize;
|
||||
cvf::BoundingBox m_fullBoundingBox;
|
||||
double m_sampleSpacing;
|
||||
};
|
||||
@@ -120,18 +120,6 @@ QString RimContourMapView::createAutoName() const
|
||||
return autoName.join(": ");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimContourMapView::isTimeStepDependentDataVisible() const
|
||||
{
|
||||
if (RimEclipseView::isTimeStepDependentDataVisible())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return m_contourMapProjection->isChecked();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -153,6 +141,12 @@ void RimContourMapView::createDisplayModel()
|
||||
{
|
||||
RimEclipseView::createDisplayModel();
|
||||
|
||||
if (!this->isTimeStepDependentDataVisible())
|
||||
{
|
||||
// Need to add geometry even if it hasn't happened during dynamic time step update.
|
||||
updateGeometry();
|
||||
}
|
||||
|
||||
if (this->viewer()->mainCamera()->viewMatrix() == defaultViewMatrix)
|
||||
{
|
||||
this->zoomAll();
|
||||
@@ -199,9 +193,16 @@ void RimContourMapView::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrder
|
||||
void RimContourMapView::updateCurrentTimeStep()
|
||||
{
|
||||
static_cast<RimEclipsePropertyFilterCollection*>(nativePropertyFilterCollection())->updateFromCurrentTimeStep();
|
||||
updateGeometry();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimContourMapView::updateGeometry()
|
||||
{
|
||||
this->updateVisibleGeometriesAndCellColors();
|
||||
|
||||
|
||||
if (m_contourMapProjection->isChecked())
|
||||
{
|
||||
m_contourMapProjection->generateResults();
|
||||
|
||||
@@ -33,7 +33,6 @@ public:
|
||||
RimContourMapProjection* contourMapProjection() const;
|
||||
|
||||
QString createAutoName() const override;
|
||||
bool isTimeStepDependentDataVisible() const override;
|
||||
|
||||
protected:
|
||||
void initAfterRead() override;
|
||||
@@ -41,7 +40,7 @@ protected:
|
||||
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override;
|
||||
void updateCurrentTimeStep() override;
|
||||
|
||||
void updateGeometry();
|
||||
void setFaultVisParameters();
|
||||
void appendContourMapProjectionToModel();
|
||||
void appendPickPointVisToModel();
|
||||
|
||||
@@ -476,7 +476,10 @@ void RimGridCollection::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrder
|
||||
{
|
||||
uiTreeOrdering.add(m_persistentLgrs());
|
||||
}
|
||||
uiTreeOrdering.add(m_temporaryLgrs());
|
||||
if (hasTemporaryLgrs())
|
||||
{
|
||||
uiTreeOrdering.add(m_temporaryLgrs());
|
||||
}
|
||||
uiTreeOrdering.skipRemainingChildren(true);
|
||||
}
|
||||
|
||||
@@ -505,3 +508,20 @@ bool RimGridCollection::hasPersistentLgrs() const
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimGridCollection::hasTemporaryLgrs() const
|
||||
{
|
||||
auto mainGrid = this->mainGrid();
|
||||
if (!mainGrid) return false;
|
||||
|
||||
for (size_t i = 1; i < mainGrid->gridCount(); i++)
|
||||
{
|
||||
const auto grid = mainGrid->gridByIndex(i);
|
||||
if (grid->isTempGrid()) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -117,6 +117,7 @@ protected:
|
||||
private:
|
||||
const RigMainGrid* mainGrid() const;
|
||||
bool hasPersistentLgrs() const;
|
||||
bool hasTemporaryLgrs() const;
|
||||
|
||||
caf::PdmField<bool> m_isActive;
|
||||
caf::PdmChildField<RimGridInfo*> m_mainGrid;
|
||||
|
||||
@@ -218,6 +218,13 @@ void RimWellPathAttribute::fieldChangedByUi(const caf::PdmFieldHandle* changedFi
|
||||
m_startMD = wellPath->wellPathGeometry()->measureDepths().front();
|
||||
}
|
||||
}
|
||||
if (changedField == &m_startMD)
|
||||
{
|
||||
if (m_type() == RiaDefines::PACKER)
|
||||
{
|
||||
m_endMD = m_startMD + 50;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
RimWellPathAttributeCollection* collection = nullptr;
|
||||
@@ -237,9 +244,7 @@ void RimWellPathAttribute::fieldChangedByUi(const caf::PdmFieldHandle* changedFi
|
||||
void RimWellPathAttribute::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
bool startDepthAvailable = m_type() != RiaDefines::CASING;
|
||||
bool endDepthAvailable = m_type() != RiaDefines::PACKER;
|
||||
|
||||
m_startMD.uiCapability()->setUiReadOnly(!startDepthAvailable);
|
||||
m_endMD.uiCapability()->setUiReadOnly(!endDepthAvailable);
|
||||
m_diameterInInches.uiCapability()->setUiReadOnly(!isDiameterSupported());
|
||||
}
|
||||
@@ -305,7 +305,7 @@ void RimSummaryCurveAutoName::appendAddressDetails(std::string&
|
||||
if (m_wellSegmentNumber)
|
||||
{
|
||||
if (!text.empty()) text += ":";
|
||||
text += ":" + summaryAddress.wellSegmentNumber();
|
||||
text += std::to_string(summaryAddress.wellSegmentNumber());
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in new issue
Block a user