#2431 : Remove Rim3dView from function parameters

This commit is contained in:
Magne Sjaastad
2018-02-05 14:47:08 +01:00
parent df231ab50a
commit b69fc78361
5 changed files with 49 additions and 47 deletions

View File

@@ -83,9 +83,11 @@ RivWellPathPartMgr::~RivWellPathPartMgr()
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
#ifdef USE_PROTOTYPE_FEATURE_FRACTURES #ifdef USE_PROTOTYPE_FEATURE_FRACTURES
void RivWellPathPartMgr::appendStaticFracturePartsToModel(cvf::ModelBasicList* model, const Rim3dView* rimView) void RivWellPathPartMgr::appendStaticFracturePartsToModel(cvf::ModelBasicList* model)
{ {
const RimEclipseView* eclView = dynamic_cast<const RimEclipseView*>(rimView); if (m_rimView.isNull()) return;
const RimEclipseView* eclView = dynamic_cast<const RimEclipseView*>(m_rimView.p());
if (!eclView) return; if (!eclView) return;
if (!m_rimWellPath || !m_rimWellPath->showWellPath() || !m_rimWellPath->fractureCollection()->isChecked()) return; if (!m_rimWellPath || !m_rimWellPath->showWellPath() || !m_rimWellPath->fractureCollection()->isChecked()) return;

View File

@@ -60,8 +60,7 @@ public:
const caf::DisplayCoordTransform* displayCoordTransform); const caf::DisplayCoordTransform* displayCoordTransform);
#ifdef USE_PROTOTYPE_FEATURE_FRACTURES #ifdef USE_PROTOTYPE_FEATURE_FRACTURES
void appendStaticFracturePartsToModel(cvf::ModelBasicList* model, void appendStaticFracturePartsToModel(cvf::ModelBasicList* model);
const Rim3dView* eclView);
#endif // USE_PROTOTYPE_FEATURE_FRACTURES #endif // USE_PROTOTYPE_FEATURE_FRACTURES
void appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model, void appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model,

View File

@@ -44,12 +44,9 @@ void RivWellPathsPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBasicList*
const cvf::BoundingBox& wellPathClipBoundingBox, const cvf::BoundingBox& wellPathClipBoundingBox,
const caf::DisplayCoordTransform* displayCoordTransform) const caf::DisplayCoordTransform* displayCoordTransform)
{ {
auto wellPathColl = wellPathCollection(); if (!isWellPathVisible()) return;
if (!wellPathColl->isActive()) return; createPartManagersIfRequired();
if (wellPathColl->wellPathVisibility() == RimWellPathCollection::FORCE_ALL_OFF) return;
buildPartManagers();
for (auto& partMgr : m_wellPatshsPartMgrs) for (auto& partMgr : m_wellPatshsPartMgrs)
{ {
@@ -61,22 +58,15 @@ void RivWellPathsPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBasicList*
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
#ifdef USE_PROTOTYPE_FEATURE_FRACTURES #ifdef USE_PROTOTYPE_FEATURE_FRACTURES
void RivWellPathsPartMgr::appendStaticFracturePartsToModel(cvf::ModelBasicList* model, const Rim3dView* rimView) void RivWellPathsPartMgr::appendStaticFracturePartsToModel(cvf::ModelBasicList* model)
{ {
// Display of fractures is not supported in geomech view if (!isWellPathVisible()) return;
const RimEclipseView* eclView = dynamic_cast<const RimEclipseView*>(rimView);
if (!eclView) return;
auto wellPathColl = wellPathCollection(); createPartManagersIfRequired();
if (!wellPathColl->isActive()) return;
if (wellPathColl->wellPathVisibility() == RimWellPathCollection::FORCE_ALL_OFF) return;
buildPartManagers();
for (auto& partMgr : m_wellPatshsPartMgrs) for (auto& partMgr : m_wellPatshsPartMgrs)
{ {
partMgr->appendStaticFracturePartsToModel(model, eclView); partMgr->appendStaticFracturePartsToModel(model);
} }
} }
#endif // USE_PROTOTYPE_FEATURE_FRACTURES #endif // USE_PROTOTYPE_FEATURE_FRACTURES
@@ -89,12 +79,9 @@ void RivWellPathsPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasicList*
const cvf::BoundingBox& wellPathClipBoundingBox, const cvf::BoundingBox& wellPathClipBoundingBox,
const caf::DisplayCoordTransform* displayCoordTransform) const caf::DisplayCoordTransform* displayCoordTransform)
{ {
auto wellPathColl = wellPathCollection(); if (!isWellPathVisible()) return;
if (!wellPathColl->isActive()) return; createPartManagersIfRequired();
if (wellPathColl->wellPathVisibility() == RimWellPathCollection::FORCE_ALL_OFF) return;
buildPartManagers();
for (auto& partMgr : m_wellPatshsPartMgrs) for (auto& partMgr : m_wellPatshsPartMgrs)
{ {
@@ -131,7 +118,7 @@ void RivWellPathsPartMgr::scheduleGeometryRegen() {}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RivWellPathsPartMgr::buildPartManagers() void RivWellPathsPartMgr::createPartManagersIfRequired()
{ {
RimProject* proj = RiaApplication::instance()->project(); RimProject* proj = RiaApplication::instance()->project();
auto wellPaths = proj->allWellPaths(); auto wellPaths = proj->allWellPaths();
@@ -158,3 +145,16 @@ RimWellPathCollection* RivWellPathsPartMgr::wellPathCollection() const
return proj->activeOilField()->wellPathCollection(); return proj->activeOilField()->wellPathCollection();
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RivWellPathsPartMgr::isWellPathVisible() const
{
auto wellPathColl = wellPathCollection();
if (!wellPathColl->isActive()) return false;
if (wellPathColl->wellPathVisibility() == RimWellPathCollection::FORCE_ALL_OFF) return false;
return true;
}

View File

@@ -23,10 +23,12 @@
#include "cvfCollection.h" #include "cvfCollection.h"
#include "cvfObject.h" #include "cvfObject.h"
#include <QDateTime>
#include <map>
#include "cafPdmPointer.h" #include "cafPdmPointer.h"
#include <QDateTime>
#include <map>
namespace cvf namespace cvf
{ {
@@ -54,36 +56,35 @@ public:
explicit RivWellPathsPartMgr(Rim3dView* view); explicit RivWellPathsPartMgr(Rim3dView* view);
~RivWellPathsPartMgr(); ~RivWellPathsPartMgr();
void appendStaticGeometryPartsToModel(cvf::ModelBasicList* model, void appendStaticGeometryPartsToModel(cvf::ModelBasicList* model,
double characteristicCellSize, double characteristicCellSize,
const cvf::BoundingBox& wellPathClipBoundingBox, const cvf::BoundingBox& wellPathClipBoundingBox,
const caf::DisplayCoordTransform* displayCoordTransform); const caf::DisplayCoordTransform* displayCoordTransform);
#ifdef USE_PROTOTYPE_FEATURE_FRACTURES #ifdef USE_PROTOTYPE_FEATURE_FRACTURES
void appendStaticFracturePartsToModel(cvf::ModelBasicList* model, void appendStaticFracturePartsToModel(cvf::ModelBasicList* model);
const Rim3dView* rimView);
#endif // USE_PROTOTYPE_FEATURE_FRACTURES #endif // USE_PROTOTYPE_FEATURE_FRACTURES
void appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model, void appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model,
const QDateTime& timeStamp, const QDateTime& timeStamp,
double characteristicCellSize, double characteristicCellSize,
const cvf::BoundingBox& wellPathClipBoundingBox, const cvf::BoundingBox& wellPathClipBoundingBox,
const caf::DisplayCoordTransform* displayCoordTransform); const caf::DisplayCoordTransform* displayCoordTransform);
size_t segmentIndexFromTriangleIndex(size_t triangleIndex, RimWellPath* wellPath) const; size_t segmentIndexFromTriangleIndex(size_t triangleIndex, RimWellPath* wellPath) const;
private: private:
void clearGeometryCache(); void clearGeometryCache();
void scheduleGeometryRegen(); void scheduleGeometryRegen();
void buildPartManagers(); void createPartManagersIfRequired();
RimWellPathCollection* wellPathCollection() const; RimWellPathCollection* wellPathCollection() const;
bool isWellPathVisible() const;
private: private:
caf::PdmPointer<Rim3dView> m_rimView; caf::PdmPointer<Rim3dView> m_rimView;
cvf::Collection<RivWellPathPartMgr> m_wellPatshsPartMgrs;
cvf::Collection<RivWellPathPartMgr> m_wellPatshsPartMgrs;
std::map<RimWellPath*, RivWellPathPartMgr*> m_mapFromViewToIndex; std::map<RimWellPath*, RivWellPathPartMgr*> m_mapFromViewToIndex;
}; };

View File

@@ -469,7 +469,7 @@ void RimEclipseView::createDisplayModel()
addWellPathsToModel(m_wellPathPipeVizModel.p(), currentActiveCellInfo()->geometryBoundingBox()); addWellPathsToModel(m_wellPathPipeVizModel.p(), currentActiveCellInfo()->geometryBoundingBox());
#ifdef USE_PROTOTYPE_FEATURE_FRACTURES #ifdef USE_PROTOTYPE_FEATURE_FRACTURES
m_wellPathsPartManager->appendStaticFracturePartsToModel(m_wellPathPipeVizModel.p(), this); m_wellPathsPartManager->appendStaticFracturePartsToModel(m_wellPathPipeVizModel.p());
#endif // USE_PROTOTYPE_FEATURE_FRACTURES #endif // USE_PROTOTYPE_FEATURE_FRACTURES
m_wellPathPipeVizModel->updateBoundingBoxesRecursive(); m_wellPathPipeVizModel->updateBoundingBoxesRecursive();
m_viewer->addStaticModelOnce(m_wellPathPipeVizModel.p()); m_viewer->addStaticModelOnce(m_wellPathPipeVizModel.p());