#1025 Created well cell center spheres group box and added sphere radius controls

This commit is contained in:
astridkbjorke 2016-12-08 09:58:43 +01:00
parent 916ab51df4
commit cd6494cc0c
3 changed files with 13 additions and 3 deletions

View File

@ -24,6 +24,8 @@
#include "RimEclipseCase.h"
#include "RimEclipseView.h"
#include "RimEclipseWell.h"
#include "RimEclipseWellCollection.h"
#include "cafDisplayCoordTransform.h"
#include "cafEffectGenerator.h"
@ -88,6 +90,9 @@ void RivWellSpheresPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasicLis
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::Color3f color = wellCellColor(wellResultFrame, wellResultPoint);
@ -95,7 +100,7 @@ void RivWellSpheresPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasicLis
cvf::ref<caf::DisplayCoordTransform> transForm = m_rimReservoirView->displayCoordTransform();
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);
model->addPart(part.p());

View File

@ -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(&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", "", "", "");
wells.uiCapability()->setUiHidden(true);
@ -227,7 +227,8 @@ void RimEclipseWellCollection::fieldChangedByUi(const caf::PdmFieldHandle* chang
m_reservoirView->scheduleCreateDisplayModelAndRedraw();
}
}
else if (&showCellCenterSpheres == changedField)
else if ( &showCellCenterSpheres == changedField
|| &cellCenterSpheresScaleFactor == changedField)
{
if (m_reservoirView)
{
@ -296,6 +297,9 @@ void RimEclipseWellCollection::defineUiOrdering(QString uiConfigName, caf::PdmUi
wellPipe->add(&pipeRadiusScaleFactor);
//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");
advancedGroup->add(&wellCellTransparencyLevel);

View File

@ -103,6 +103,7 @@ public:
caf::PdmField<bool> isAutoDetectingBranches;
caf::PdmField<bool> showCellCenterSpheres;
caf::PdmField<double> cellCenterSpheresScaleFactor;
caf::PdmChildArrayField<RimEclipseWell*> wells;