mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1025 Created well cell center spheres group box and added sphere radius controls
This commit is contained in:
parent
916ab51df4
commit
cd6494cc0c
@ -24,6 +24,8 @@
|
|||||||
#include "RimEclipseCase.h"
|
#include "RimEclipseCase.h"
|
||||||
#include "RimEclipseView.h"
|
#include "RimEclipseView.h"
|
||||||
#include "RimEclipseWell.h"
|
#include "RimEclipseWell.h"
|
||||||
|
#include "RimEclipseWellCollection.h"
|
||||||
|
|
||||||
|
|
||||||
#include "cafDisplayCoordTransform.h"
|
#include "cafDisplayCoordTransform.h"
|
||||||
#include "cafEffectGenerator.h"
|
#include "cafEffectGenerator.h"
|
||||||
@ -88,6 +90,9 @@ void RivWellSpheresPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasicLis
|
|||||||
|
|
||||||
const RigCell& rigCell = rigGrid->cell(gridCellIndex);
|
const RigCell& rigCell = rigGrid->cell(gridCellIndex);
|
||||||
|
|
||||||
|
double characteristicCellSize = m_rimReservoirView->eclipseCase()->reservoirData()->mainGrid()->characteristicIJCellSize();
|
||||||
|
double cellRadius = m_rimReservoirView->wellCollection()->cellCenterSpheresScaleFactor() * characteristicCellSize;
|
||||||
|
|
||||||
cvf::Vec3d center = rigCell.center();
|
cvf::Vec3d center = rigCell.center();
|
||||||
|
|
||||||
cvf::Color3f color = wellCellColor(wellResultFrame, wellResultPoint);
|
cvf::Color3f color = wellCellColor(wellResultFrame, wellResultPoint);
|
||||||
@ -95,7 +100,7 @@ void RivWellSpheresPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasicLis
|
|||||||
cvf::ref<caf::DisplayCoordTransform> transForm = m_rimReservoirView->displayCoordTransform();
|
cvf::ref<caf::DisplayCoordTransform> transForm = m_rimReservoirView->displayCoordTransform();
|
||||||
cvf::Vec3d displayCoord = transForm->transformToDisplayCoord(center);
|
cvf::Vec3d displayCoord = transForm->transformToDisplayCoord(center);
|
||||||
|
|
||||||
cvf::ref<cvf::DrawableGeo> geo = createSphere(10, displayCoord);
|
cvf::ref<cvf::DrawableGeo> geo = createSphere(cellRadius, displayCoord);
|
||||||
cvf::ref<cvf::Part> part = createPart(geo.p(), color);
|
cvf::ref<cvf::Part> part = createPart(geo.p(), color);
|
||||||
|
|
||||||
model->addPart(part.p());
|
model->addPart(part.p());
|
||||||
|
@ -109,7 +109,7 @@ RimEclipseWellCollection::RimEclipseWellCollection()
|
|||||||
CAF_PDM_InitField(&isAutoDetectingBranches, "IsAutoDetectingBranches", true, "Geometry based branch detection", "", "Toggle wether the well pipe visualization will try to detect when a part of the well \nis really a branch, and thus is starting from wellhead", "");
|
CAF_PDM_InitField(&isAutoDetectingBranches, "IsAutoDetectingBranches", true, "Geometry based branch detection", "", "Toggle wether the well pipe visualization will try to detect when a part of the well \nis really a branch, and thus is starting from wellhead", "");
|
||||||
|
|
||||||
CAF_PDM_InitField(&showCellCenterSpheres, "showCellCenterSpheres", false, "Show sphere in cell center", "", "", "");
|
CAF_PDM_InitField(&showCellCenterSpheres, "showCellCenterSpheres", false, "Show sphere in cell center", "", "", "");
|
||||||
|
CAF_PDM_InitField(&cellCenterSpheresScaleFactor, "CellCenterSphereScale", 0.2, "Cell Center sphere radius", "", "", "");
|
||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault(&wells, "Wells", "Wells", "", "", "");
|
CAF_PDM_InitFieldNoDefault(&wells, "Wells", "Wells", "", "", "");
|
||||||
wells.uiCapability()->setUiHidden(true);
|
wells.uiCapability()->setUiHidden(true);
|
||||||
@ -227,7 +227,8 @@ void RimEclipseWellCollection::fieldChangedByUi(const caf::PdmFieldHandle* chang
|
|||||||
m_reservoirView->scheduleCreateDisplayModelAndRedraw();
|
m_reservoirView->scheduleCreateDisplayModelAndRedraw();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (&showCellCenterSpheres == changedField)
|
else if ( &showCellCenterSpheres == changedField
|
||||||
|
|| &cellCenterSpheresScaleFactor == changedField)
|
||||||
{
|
{
|
||||||
if (m_reservoirView)
|
if (m_reservoirView)
|
||||||
{
|
{
|
||||||
@ -296,6 +297,9 @@ void RimEclipseWellCollection::defineUiOrdering(QString uiConfigName, caf::PdmUi
|
|||||||
wellPipe->add(&pipeRadiusScaleFactor);
|
wellPipe->add(&pipeRadiusScaleFactor);
|
||||||
|
|
||||||
//TODO: Add Well sphere group
|
//TODO: Add Well sphere group
|
||||||
|
caf::PdmUiGroup* cellCenterSpheres = uiOrdering.addNewGroup("Well cell center spheres");
|
||||||
|
cellCenterSpheres->add(&showCellCenterSpheres);
|
||||||
|
cellCenterSpheres->add(&cellCenterSpheresScaleFactor);
|
||||||
|
|
||||||
caf::PdmUiGroup* advancedGroup = uiOrdering.addNewGroup("Advanced");
|
caf::PdmUiGroup* advancedGroup = uiOrdering.addNewGroup("Advanced");
|
||||||
advancedGroup->add(&wellCellTransparencyLevel);
|
advancedGroup->add(&wellCellTransparencyLevel);
|
||||||
|
@ -103,6 +103,7 @@ public:
|
|||||||
caf::PdmField<bool> isAutoDetectingBranches;
|
caf::PdmField<bool> isAutoDetectingBranches;
|
||||||
|
|
||||||
caf::PdmField<bool> showCellCenterSpheres;
|
caf::PdmField<bool> showCellCenterSpheres;
|
||||||
|
caf::PdmField<double> cellCenterSpheresScaleFactor;
|
||||||
|
|
||||||
|
|
||||||
caf::PdmChildArrayField<RimEclipseWell*> wells;
|
caf::PdmChildArrayField<RimEclipseWell*> wells;
|
||||||
|
Loading…
Reference in New Issue
Block a user