mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Add characteristicCellSize to RimView
This commit is contained in:
@@ -399,6 +399,8 @@ void RivWellPathPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBasicList* m
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RivWellPathPartMgr::appendDynamicGeometryPartsToModel(RimView* view, cvf::ModelBasicList* model)
|
void RivWellPathPartMgr::appendDynamicGeometryPartsToModel(RimView* view, cvf::ModelBasicList* model)
|
||||||
{
|
{
|
||||||
|
CVF_ASSERT(view && model);
|
||||||
|
|
||||||
RimWellPathCollection* wellPathCollection = this->wellPathCollection();
|
RimWellPathCollection* wellPathCollection = this->wellPathCollection();
|
||||||
if (!wellPathCollection) return;
|
if (!wellPathCollection) return;
|
||||||
|
|
||||||
@@ -410,31 +412,24 @@ void RivWellPathPartMgr::appendDynamicGeometryPartsToModel(RimView* view, cvf::M
|
|||||||
if (wellPathCollection->wellPathVisibility() != RimWellPathCollection::FORCE_ALL_ON && m_rimWellPath->showWellPath() == false)
|
if (wellPathCollection->wellPathVisibility() != RimWellPathCollection::FORCE_ALL_ON && m_rimWellPath->showWellPath() == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
cvf::ref<caf::DisplayCoordTransform> displayCoordTransform = view->displayCoordTransform();
|
|
||||||
double characteristicCellSize = 10.0;
|
|
||||||
QDateTime currentDateTime;
|
QDateTime currentDateTime;
|
||||||
|
double characteristicCellSize = 10.0;
|
||||||
|
|
||||||
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>(view);
|
RimCase* rimCase = nullptr;
|
||||||
if (eclipseView)
|
view->firstAncestorOrThisOfType(rimCase);
|
||||||
|
if (rimCase)
|
||||||
{
|
{
|
||||||
RigMainGrid* mainGrid = eclipseView->mainGrid();
|
std::vector<QDateTime> timeStepDates = rimCase->timeStepDates();
|
||||||
if (mainGrid)
|
|
||||||
{
|
|
||||||
characteristicCellSize = mainGrid->characteristicIJCellSize();
|
|
||||||
}
|
|
||||||
|
|
||||||
RimEclipseCase* eclipseCase = nullptr;
|
|
||||||
view->firstAncestorOrThisOfType(eclipseCase);
|
|
||||||
if (eclipseCase)
|
|
||||||
{
|
|
||||||
std::vector<QDateTime> timeStepDates = eclipseCase->timeStepDates();
|
|
||||||
|
|
||||||
if (view->currentTimeStep() < timeStepDates.size())
|
if (view->currentTimeStep() < timeStepDates.size())
|
||||||
{
|
{
|
||||||
currentDateTime = timeStepDates[view->currentTimeStep()];
|
currentDateTime = timeStepDates[view->currentTimeStep()];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
characteristicCellSize = rimCase->characteristicCellSize();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
cvf::ref<caf::DisplayCoordTransform> displayCoordTransform = view->displayCoordTransform();
|
||||||
|
|
||||||
appendPerforationsToModel(currentDateTime, model, displayCoordTransform.p(), characteristicCellSize);
|
appendPerforationsToModel(currentDateTime, model, displayCoordTransform.p(), characteristicCellSize);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,6 +62,8 @@ public:
|
|||||||
|
|
||||||
virtual void updateFormationNamesData() = 0;
|
virtual void updateFormationNamesData() = 0;
|
||||||
|
|
||||||
|
virtual double characteristicCellSize() const = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;
|
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -679,6 +679,20 @@ void RimEclipseCase::reloadDataAndUpdate()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
double RimEclipseCase::characteristicCellSize() const
|
||||||
|
{
|
||||||
|
const RigEclipseCaseData* rigEclipseCase = eclipseCaseData();
|
||||||
|
if (rigEclipseCase)
|
||||||
|
{
|
||||||
|
return rigEclipseCase->mainGrid()->characteristicIJCellSize();
|
||||||
|
}
|
||||||
|
|
||||||
|
return 10.0;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -100,6 +100,9 @@ public:
|
|||||||
void reloadDataAndUpdate();
|
void reloadDataAndUpdate();
|
||||||
virtual void reloadEclipseGridFile() = 0;
|
virtual void reloadEclipseGridFile() = 0;
|
||||||
|
|
||||||
|
|
||||||
|
virtual double characteristicCellSize() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void initAfterRead();
|
virtual void initAfterRead();
|
||||||
virtual void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue );
|
virtual void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue );
|
||||||
|
|||||||
@@ -289,6 +289,21 @@ cvf::BoundingBox RimGeoMechCase::allCellsBoundingBox() const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
double RimGeoMechCase::characteristicCellSize() const
|
||||||
|
{
|
||||||
|
if (geoMechData() && geoMechData()->femParts())
|
||||||
|
{
|
||||||
|
double cellSize = geoMechData()->femParts()->characteristicElementSize();
|
||||||
|
|
||||||
|
return cellSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 10.0;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -65,9 +65,12 @@ public:
|
|||||||
virtual cvf::BoundingBox activeCellsBoundingBox() const;
|
virtual cvf::BoundingBox activeCellsBoundingBox() const;
|
||||||
virtual cvf::BoundingBox allCellsBoundingBox() const;
|
virtual cvf::BoundingBox allCellsBoundingBox() const;
|
||||||
|
|
||||||
|
virtual double characteristicCellSize() const override;
|
||||||
|
|
||||||
// Fields:
|
// Fields:
|
||||||
caf::PdmChildArrayField<RimGeoMechView*> geoMechViews;
|
caf::PdmChildArrayField<RimGeoMechView*> geoMechViews;
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static std::vector<QDateTime> dateTimeVectorFromTimeStepStrings(const QStringList& timeStepStrings);
|
static std::vector<QDateTime> dateTimeVectorFromTimeStepStrings(const QStringList& timeStepStrings);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user