mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Refactored GeoMechView createDisplayModel
Made adding well paths less obfuscated Preparing for #314 Property Filter
This commit is contained in:
@@ -473,42 +473,24 @@ void RimView::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QV
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimView::addWellPathsToScene(cvf::Scene* scene, const cvf::Vec3d& displayModelOffset,
|
||||
double characteristicCellSize, const cvf::BoundingBox& wellPathClipBoundingBox,
|
||||
void RimView::addWellPathsToModel(cvf::ModelBasicList* wellPathModelBasicList,
|
||||
const cvf::Vec3d& displayModelOffset,
|
||||
double characteristicCellSize,
|
||||
const cvf::BoundingBox& wellPathClipBoundingBox,
|
||||
cvf::Transform* scaleTransform)
|
||||
{
|
||||
CVF_ASSERT(scene);
|
||||
CVF_ASSERT(scaleTransform);
|
||||
|
||||
cvf::String wellPathModelName = "WellPathModel";
|
||||
std::vector<cvf::Model*> wellPathModels;
|
||||
for (cvf::uint i = 0; i < scene->modelCount(); i++)
|
||||
{
|
||||
if (scene->model(i)->name() == wellPathModelName)
|
||||
{
|
||||
wellPathModels.push_back(scene->model(i));
|
||||
}
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < wellPathModels.size(); i++)
|
||||
{
|
||||
scene->removeModel(wellPathModels[i]);
|
||||
}
|
||||
|
||||
// Append static Well Paths to model
|
||||
cvf::ref<cvf::ModelBasicList> wellPathModelBasicList = new cvf::ModelBasicList;
|
||||
wellPathModelBasicList->setName(wellPathModelName);
|
||||
|
||||
RimOilField* oilFields = RiaApplication::instance()->project() ? RiaApplication::instance()->project()->activeOilField() : NULL;
|
||||
RimWellPathCollection* wellPathCollection = oilFields ? oilFields->wellPathCollection() : NULL;
|
||||
RivWellPathCollectionPartMgr* wellPathCollectionPartMgr = wellPathCollection ? wellPathCollection->wellPathCollectionPartMgr() : NULL;
|
||||
|
||||
if (wellPathCollectionPartMgr)
|
||||
{
|
||||
wellPathCollectionPartMgr->appendStaticGeometryPartsToModel(wellPathModelBasicList.p(), displayModelOffset,
|
||||
scaleTransform, characteristicCellSize, wellPathClipBoundingBox);
|
||||
wellPathCollectionPartMgr->appendStaticGeometryPartsToModel(wellPathModelBasicList,
|
||||
displayModelOffset,
|
||||
scaleTransform,
|
||||
characteristicCellSize,
|
||||
wellPathClipBoundingBox);
|
||||
}
|
||||
|
||||
wellPathModelBasicList->updateBoundingBoxesRecursive();
|
||||
scene->addModel(wellPathModelBasicList.p());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user