mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1025 Added Show well spheres check-box option for each well
This commit is contained in:
@@ -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;
|
||||
// }
|
||||
//
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user