mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-20 11:48:35 -06:00
#1025 Added Show well spheres check-box option for each well
This commit is contained in:
parent
74defdc219
commit
829c775f63
@ -71,6 +71,7 @@ void RivWellSpheresPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasicLis
|
||||
if (m_rimReservoirView.isNull()) return;
|
||||
if (!m_rimReservoirView->eclipseCase()) return;
|
||||
if (!m_rimReservoirView->eclipseCase()->reservoirData()) return;
|
||||
if (!m_rimWell->showWellSpheres()) return;
|
||||
|
||||
const RigMainGrid* mainGrid = m_rimReservoirView->eclipseCase()->reservoirData()->mainGrid();
|
||||
CVF_ASSERT(mainGrid);
|
||||
@ -114,51 +115,53 @@ void RivWellSpheresPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasicLis
|
||||
model->addPart(part.p());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<cvf::DrawableGeo> RivWellSpheresPartMgr::createSphere(double radius, const cvf::Vec3d& pos)
|
||||
{
|
||||
cvf::Vec3f posFloat(pos);
|
||||
|
||||
cvf::ref<cvf::DrawableGeo> geo = new cvf::DrawableGeo;
|
||||
|
||||
cvf::GeometryBuilderFaceList builder;
|
||||
cvf::GeometryUtils::createSphere(radius, 10, 10, &builder);
|
||||
|
||||
cvf::ref<cvf::Vec3fArray> vertices = builder.vertices();
|
||||
|
||||
// Move sphere coordinates to the destination location
|
||||
for (size_t i = 0; i < vertices->size(); i++)
|
||||
{
|
||||
vertices->set(i, vertices->val(i) + posFloat);
|
||||
}
|
||||
|
||||
cvf::ref<cvf::UIntArray> faceList = builder.faceList();
|
||||
|
||||
geo->setVertexArray(vertices.p());
|
||||
geo->setFromFaceList(*faceList);
|
||||
geo->computeNormals();
|
||||
|
||||
return geo;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<cvf::Part> RivWellSpheresPartMgr::createPart(cvf::DrawableGeo* geo, const cvf::Color3f& color)
|
||||
{
|
||||
cvf::ref<cvf::Part> part = new cvf::Part;
|
||||
part->setDrawable(geo);
|
||||
|
||||
caf::SurfaceEffectGenerator surfaceGen(cvf::Color4f(color), caf::PO_1);
|
||||
cvf::ref<cvf::Effect> eff = surfaceGen.generateCachedEffect();
|
||||
|
||||
part->setEffect(eff.p());
|
||||
|
||||
return part;
|
||||
}
|
||||
//TODO: Transparency må være linka til show cell center spheres og All On/Of for well pipes
|
||||
|
||||
// --------------------------------------------------------------------------------------------------
|
||||
// /
|
||||
// --------------------------------------------------------------------------------------------------
|
||||
// cvf::ref<cvf::DrawableGeo> RivWellSpheresPartMgr::createSphere(double radius, const cvf::Vec3d& pos)
|
||||
// {
|
||||
// cvf::Vec3f posFloat(pos);
|
||||
//
|
||||
// cvf::ref<cvf::DrawableGeo> geo = new cvf::DrawableGeo;
|
||||
//
|
||||
// cvf::GeometryBuilderFaceList builder;
|
||||
// cvf::GeometryUtils::createSphere(radius, 10, 10, &builder);
|
||||
//
|
||||
// cvf::ref<cvf::Vec3fArray> vertices = builder.vertices();
|
||||
//
|
||||
// // Move sphere coordinates to the destination location
|
||||
// for (size_t i = 0; i < vertices->size(); i++)
|
||||
// {
|
||||
// vertices->set(i, vertices->val(i) + posFloat);
|
||||
// }
|
||||
//
|
||||
// cvf::ref<cvf::UIntArray> faceList = builder.faceList();
|
||||
//
|
||||
// geo->setVertexArray(vertices.p());
|
||||
// geo->setFromFaceList(*faceList);
|
||||
// geo->computeNormals();
|
||||
//
|
||||
// return geo;
|
||||
// }
|
||||
//
|
||||
// --------------------------------------------------------------------------------------------------
|
||||
// /
|
||||
// --------------------------------------------------------------------------------------------------
|
||||
// cvf::ref<cvf::Part> RivWellSpheresPartMgr::createPart(cvf::DrawableGeo* geo, const cvf::Color3f& color)
|
||||
// {
|
||||
// cvf::ref<cvf::Part> part = new cvf::Part;
|
||||
// part->setDrawable(geo);
|
||||
//
|
||||
// caf::SurfaceEffectGenerator surfaceGen(cvf::Color4f(color), caf::PO_1);
|
||||
// cvf::ref<cvf::Effect> eff = surfaceGen.generateCachedEffect();
|
||||
//
|
||||
// part->setEffect(eff.p());
|
||||
//
|
||||
// return part;
|
||||
// }
|
||||
//
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -42,6 +42,7 @@ RimEclipseWell::RimEclipseWell()
|
||||
CAF_PDM_InitField(&showWellLabel, "ShowWellLabel", true, "Show well label", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&showWellPipes, "ShowWellPipe", true, "Show well pipe", "", "", "");
|
||||
CAF_PDM_InitField(&showWellSpheres, "ShowWellSpheres", true, "Show well spheres", "", "", "");
|
||||
CAF_PDM_InitField(&pipeRadiusScaleFactor, "WellPipeRadiusScale",1.0, "Pipe radius scale", "", "", "");
|
||||
CAF_PDM_InitField(&wellPipeColor, "WellPipeColor", cvf::Color3f(0.588f, 0.588f, 0.804f), "Well pipe color", "", "", "");
|
||||
|
||||
@ -121,6 +122,10 @@ void RimEclipseWell::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c
|
||||
{
|
||||
if (m_reservoirView) m_reservoirView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
else if (&showWellSpheres == changedField)
|
||||
{
|
||||
if (m_reservoirView) m_reservoirView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
else if (&wellPipeColor == changedField)
|
||||
{
|
||||
if (m_reservoirView) m_reservoirView->scheduleCreateDisplayModelAndRedraw();
|
||||
@ -244,6 +249,7 @@ void RimEclipseWell::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
|
||||
{
|
||||
caf::PdmUiGroup* pipeGroup = uiOrdering.addNewGroup("Appearance");
|
||||
pipeGroup->add(&showWellPipes);
|
||||
pipeGroup->add(&showWellSpheres);
|
||||
pipeGroup->add(&showWellLabel);
|
||||
pipeGroup->add(&wellPipeColor);
|
||||
pipeGroup->add(&pipeRadiusScaleFactor);
|
||||
|
@ -71,6 +71,7 @@ public:
|
||||
caf::PdmField<bool> showWellCellFence;
|
||||
|
||||
caf::PdmField<bool> showWellPipes;
|
||||
caf::PdmField<bool> showWellSpheres;
|
||||
caf::PdmField<cvf::Color3f> wellPipeColor;
|
||||
caf::PdmField<double> pipeRadiusScaleFactor;
|
||||
|
||||
|
@ -109,6 +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(&wellSphereVisibility, "wellSphereVisibility", WellVisibilityEnum(PIPES_OPEN_IN_VISIBLE_CELLS), "Global well sphere visibility", "", "", "");
|
||||
CAF_PDM_InitField(&cellCenterSpheresScaleFactor, "CellCenterSphereScale", 0.2, "Cell Center sphere radius", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&wells, "Wells", "Wells", "", "", "");
|
||||
@ -296,7 +297,6 @@ void RimEclipseWellCollection::defineUiOrdering(QString uiConfigName, caf::PdmUi
|
||||
wellPipe->add(&wellPipeVisibility);
|
||||
wellPipe->add(&pipeRadiusScaleFactor);
|
||||
|
||||
//TODO: Add Well sphere group
|
||||
caf::PdmUiGroup* cellCenterSpheres = uiOrdering.addNewGroup("Well cell center spheres");
|
||||
cellCenterSpheres->add(&showCellCenterSpheres);
|
||||
cellCenterSpheres->add(&cellCenterSpheresScaleFactor);
|
||||
|
@ -103,6 +103,7 @@ public:
|
||||
caf::PdmField<bool> isAutoDetectingBranches;
|
||||
|
||||
caf::PdmField<bool> showCellCenterSpheres;
|
||||
//caf::PdmField<WellVisibilityEnum> wellSphereVisibility;
|
||||
caf::PdmField<double> cellCenterSpheresScaleFactor;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user