diff --git a/ApplicationCode/ModelVisualization/RivWellPathCollectionPartMgr.cpp b/ApplicationCode/ModelVisualization/RivWellPathCollectionPartMgr.cpp index f2f7714f77..c3f79c55a8 100644 --- a/ApplicationCode/ModelVisualization/RivWellPathCollectionPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivWellPathCollectionPartMgr.cpp @@ -66,7 +66,8 @@ void RivWellPathCollectionPartMgr::setScaleTransform(cvf::Transform * scaleTrans //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RivWellPathCollectionPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBasicList* model, cvf::Vec3d displayModelOffset, cvf::Transform* scaleTransform, double characteristicCellSize, cvf::BoundingBox boundingBox) +void RivWellPathCollectionPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBasicList* model, cvf::Vec3d displayModelOffset, + cvf::Transform* scaleTransform, double characteristicCellSize, cvf::BoundingBox wellPathClipBoundingBox) { setScaleTransform(scaleTransform); @@ -77,7 +78,7 @@ void RivWellPathCollectionPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBa { RivWellPathPartMgr* partMgr = m_wellPathCollection->wellPaths[wIdx]->partMgr(); partMgr->setScaleTransform(scaleTransform); - partMgr->appendStaticGeometryPartsToModel(model, displayModelOffset, characteristicCellSize, boundingBox); + partMgr->appendStaticGeometryPartsToModel(model, displayModelOffset, characteristicCellSize, wellPathClipBoundingBox); } } diff --git a/ApplicationCode/ModelVisualization/RivWellPathCollectionPartMgr.h b/ApplicationCode/ModelVisualization/RivWellPathCollectionPartMgr.h index 2486d7b6c4..386e83d8f6 100644 --- a/ApplicationCode/ModelVisualization/RivWellPathCollectionPartMgr.h +++ b/ApplicationCode/ModelVisualization/RivWellPathCollectionPartMgr.h @@ -54,7 +54,7 @@ public: cvf::Vec3d displayModelOffset, cvf::Transform* scaleTransform, double characteristicCellSize, - cvf::BoundingBox boundingBox); + cvf::BoundingBox wellPathClipBoundingBox); private: caf::PdmPointer m_wellPathCollection; diff --git a/ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp b/ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp index a097483387..5f823baf58 100644 --- a/ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp @@ -95,7 +95,8 @@ RivWellPathPartMgr::~RivWellPathPartMgr() //-------------------------------------------------------------------------------------------------- /// The pipe geometry needs to be rebuilt on scale change to keep the pipes round //-------------------------------------------------------------------------------------------------- -void RivWellPathPartMgr::buildWellPathParts(cvf::Vec3d displayModelOffset, double characteristicCellSize, cvf::BoundingBox boundingBox) +void RivWellPathPartMgr::buildWellPathParts(cvf::Vec3d displayModelOffset, double characteristicCellSize, + cvf::BoundingBox wellPathClipBoundingBox) { if (m_wellPathCollection.isNull()) return; @@ -127,7 +128,7 @@ void RivWellPathPartMgr::buildWellPathParts(cvf::Vec3d displayModelOffset, doubl for (size_t idx = 0; idx < wellPathGeometry->m_wellPathPoints.size(); idx++) { cvf::Vec3d point = wellPathGeometry->m_wellPathPoints[idx]; - if (point.z() < (boundingBox.max().z() + m_wellPathCollection->wellPathClipZDistance)) + if (point.z() < (wellPathClipBoundingBox.max().z() + m_wellPathCollection->wellPathClipZDistance)) clippedPoints.push_back(point); } if (clippedPoints.size() < 2) return; @@ -220,7 +221,8 @@ void RivWellPathPartMgr::buildWellPathParts(cvf::Vec3d displayModelOffset, doubl //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RivWellPathPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBasicList* model, cvf::Vec3d displayModelOffset, double characteristicCellSize, cvf::BoundingBox boundingBox) +void RivWellPathPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBasicList* model, cvf::Vec3d displayModelOffset, + double characteristicCellSize, cvf::BoundingBox wellPathClipBoundingBox) { if (m_wellPathCollection.isNull()) return; if (m_rimWellPath.isNull()) return; @@ -234,7 +236,7 @@ void RivWellPathPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBasicList* m if (m_needsTransformUpdate) { // The pipe geometry needs to be rebuilt on scale change to keep the pipes round - buildWellPathParts(displayModelOffset, characteristicCellSize, boundingBox); + buildWellPathParts(displayModelOffset, characteristicCellSize, wellPathClipBoundingBox); } std::list::iterator it; diff --git a/ApplicationCode/ModelVisualization/RivWellPathPartMgr.h b/ApplicationCode/ModelVisualization/RivWellPathPartMgr.h index 0f01a673cd..911c816d19 100644 --- a/ApplicationCode/ModelVisualization/RivWellPathPartMgr.h +++ b/ApplicationCode/ModelVisualization/RivWellPathPartMgr.h @@ -49,7 +49,8 @@ public: void scheduleGeometryRegen() { m_needsTransformUpdate = true; }//printf("R"); } - void appendStaticGeometryPartsToModel(cvf::ModelBasicList* model, cvf::Vec3d displayModelOffset, double characteristicCellSize, cvf::BoundingBox boundingBox); + void appendStaticGeometryPartsToModel(cvf::ModelBasicList* model, cvf::Vec3d displayModelOffset, + double characteristicCellSize, cvf::BoundingBox wellPathClipBoundingBox); private: caf::PdmPointer m_wellPathCollection; @@ -58,7 +59,7 @@ private: cvf::ref m_scaleTransform; bool m_needsTransformUpdate; - void buildWellPathParts(cvf::Vec3d displayModelOffset, double characteristicCellSize, cvf::BoundingBox boundingBox); + void buildWellPathParts(cvf::Vec3d displayModelOffset, double characteristicCellSize, cvf::BoundingBox wellPathClipBoundingBox); struct RivPipeBranchData { diff --git a/ApplicationCode/ProjectDataModel/RimEclipseView.cpp b/ApplicationCode/ProjectDataModel/RimEclipseView.cpp index 04e03dacc0..aa4ad8775f 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseView.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseView.cpp @@ -446,7 +446,10 @@ void RimEclipseView::createDisplayModel() scene->addModel(model); // Add well paths, if any - addWellPathsToScene(scene.p(), mainGrid->displayModelOffset(), mainGrid->characteristicIJCellSize(), currentActiveCellInfo()->geometryBoundingBox(), m_reservoirGridPartManager->scaleTransform()); + addWellPathsToScene(scene.p(), mainGrid->displayModelOffset(), + mainGrid->characteristicIJCellSize(), + currentActiveCellInfo()->geometryBoundingBox(), + m_reservoirGridPartManager->scaleTransform()); if (frameIndex == 0) m_viewer->setMainScene(scene.p()); @@ -634,7 +637,11 @@ void RimEclipseView::updateCurrentTimeStep() RigMainGrid* mainGrid = caseData ? caseData->mainGrid() : NULL; CVF_ASSERT(mainGrid); - addWellPathsToScene(frameScene, mainGrid->displayModelOffset(), mainGrid->characteristicIJCellSize(), currentActiveCellInfo()->geometryBoundingBox(), m_reservoirGridPartManager->scaleTransform()); + addWellPathsToScene(frameScene, + mainGrid->displayModelOffset(), + mainGrid->characteristicIJCellSize(), + currentActiveCellInfo()->geometryBoundingBox(), + m_reservoirGridPartManager->scaleTransform()); } } diff --git a/ApplicationCode/ProjectDataModel/RimGeoMechView.cpp b/ApplicationCode/ProjectDataModel/RimGeoMechView.cpp index a39ebe4f12..f1415e94dc 100644 --- a/ApplicationCode/ProjectDataModel/RimGeoMechView.cpp +++ b/ApplicationCode/ProjectDataModel/RimGeoMechView.cpp @@ -247,7 +247,8 @@ void RimGeoMechView::createDisplayModel() double characteristicCellSize = geoMechCase()->geoMechData()->femParts()->characteristicElementSize(); cvf::BoundingBox femBBox = geoMechCase()->geoMechData()->femParts()->boundingBox(); - addWellPathsToScene(scene.p(), cvf::Vec3d(0, 0, 0), characteristicCellSize, femBBox, scaleTransform()); + addWellPathsToScene(scene.p(), cvf::Vec3d(0, 0, 0), + characteristicCellSize, femBBox, scaleTransform()); } // If the animation was active before recreating everything, make viewer view current frame @@ -286,7 +287,8 @@ void RimGeoMechView::updateCurrentTimeStep() double characteristicCellSize = geoMechCase()->geoMechData()->femParts()->characteristicElementSize(); cvf::BoundingBox femBBox = geoMechCase()->geoMechData()->femParts()->boundingBox(); - addWellPathsToScene(frameScene, cvf::Vec3d(0, 0, 0), characteristicCellSize, femBBox, scaleTransform()); + addWellPathsToScene(frameScene, cvf::Vec3d(0, 0, 0), + characteristicCellSize, femBBox, scaleTransform()); } } diff --git a/ApplicationCode/ProjectDataModel/RimView.cpp b/ApplicationCode/ProjectDataModel/RimView.cpp index 847eddce78..bbd35258d1 100644 --- a/ApplicationCode/ProjectDataModel/RimView.cpp +++ b/ApplicationCode/ProjectDataModel/RimView.cpp @@ -448,7 +448,9 @@ void RimView::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QV //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimView::addWellPathsToScene(cvf::Scene* scene, const cvf::Vec3d& displayModelOffset, double characteristicCellSize, const cvf::BoundingBox& boundingBox, cvf::Transform* scaleTransform) +void RimView::addWellPathsToScene(cvf::Scene* scene, const cvf::Vec3d& displayModelOffset, + double characteristicCellSize, const cvf::BoundingBox& wellPathClipBoundingBox, + cvf::Transform* scaleTransform) { CVF_ASSERT(scene); CVF_ASSERT(scaleTransform); @@ -478,7 +480,8 @@ void RimView::addWellPathsToScene(cvf::Scene* scene, const cvf::Vec3d& displayMo if (wellPathCollectionPartMgr) { - wellPathCollectionPartMgr->appendStaticGeometryPartsToModel(wellPathModelBasicList.p(), displayModelOffset, scaleTransform, characteristicCellSize, boundingBox); + wellPathCollectionPartMgr->appendStaticGeometryPartsToModel(wellPathModelBasicList.p(), displayModelOffset, + scaleTransform, characteristicCellSize, wellPathClipBoundingBox); } wellPathModelBasicList->updateBoundingBoxesRecursive(); diff --git a/ApplicationCode/ProjectDataModel/RimView.h b/ApplicationCode/ProjectDataModel/RimView.h index 6e065acf57..f9c62a3e75 100644 --- a/ApplicationCode/ProjectDataModel/RimView.h +++ b/ApplicationCode/ProjectDataModel/RimView.h @@ -110,7 +110,11 @@ public: protected: void setDefaultView(); - void addWellPathsToScene(cvf::Scene* scene, const cvf::Vec3d& displayModelOffset, double characteristicCellSize, const cvf::BoundingBox& boundingBox, cvf::Transform* scaleTransform); + void addWellPathsToScene(cvf::Scene* scene, + const cvf::Vec3d& displayModelOffset, + double characteristicCellSize, + const cvf::BoundingBox& wellPathClipBoundingBox, + cvf::Transform* scaleTransform); virtual void createDisplayModel() = 0; virtual void updateDisplayModelVisibility() = 0;