Add const and remove dependency to RimView

This commit is contained in:
Magne Sjaastad
2017-06-19 22:53:19 +02:00
parent 210bdab4c3
commit b9ee3d6d4a
10 changed files with 110 additions and 68 deletions

View File

@@ -639,15 +639,9 @@ void RimEclipseView::updateCurrentTimeStep()
cvf::ref<cvf::ModelBasicList> wellPathModelBasicList = new cvf::ModelBasicList;
wellPathModelBasicList->setName(name);
RigMainGrid* mainGrid = this->mainGrid();
if (mainGrid)
{
wellPathsPartManager()->appendDynamicGeometryPartsToModel(this, wellPathModelBasicList.p());
addDynamicWellPathsToModel(wellPathModelBasicList.p(), currentActiveCellInfo()->geometryBoundingBox());
wellPathModelBasicList->updateBoundingBoxesRecursive();
frameScene->addModel(wellPathModelBasicList.p());
}
frameScene->addModel(wellPathModelBasicList.p());
}
}
}

View File

@@ -254,14 +254,32 @@ void RimGeoMechView::updateCurrentTimeStep()
cvf::Scene* frameScene = m_viewer->frame(m_currentTimeStep);
if (frameScene)
{
// Grid model
cvf::ref<cvf::ModelBasicList> frameParts = new cvf::ModelBasicList;
frameParts->setName("GridModel");
m_vizLogic->appendPartsToModel(m_currentTimeStep, frameParts.p());
frameParts->updateBoundingBoxesRecursive();
{
// Grid model
cvf::String name = "GridModel";
this->removeModelByName(frameScene, name);
this->removeModelByName(frameScene, frameParts->name());
frameScene->addModel(frameParts.p());
cvf::ref<cvf::ModelBasicList> frameParts = new cvf::ModelBasicList;
frameParts->setName(name);
m_vizLogic->appendPartsToModel(m_currentTimeStep, frameParts.p());
frameParts->updateBoundingBoxesRecursive();
frameScene->addModel(frameParts.p());
}
// Well Paths
{
cvf::String name = "WellPathMod";
this->removeModelByName(frameScene, name);
cvf::ref<cvf::ModelBasicList> wellPathModelBasicList = new cvf::ModelBasicList;
wellPathModelBasicList->setName(name);
cvf::BoundingBox femBBox = geoMechCase()->geoMechData()->femParts()->boundingBox();
addDynamicWellPathsToModel(wellPathModelBasicList.p(), femBBox);
frameScene->addModel(wellPathModelBasicList.p());
}
}
}
@@ -278,6 +296,7 @@ void RimGeoMechView::updateCurrentTimeStep()
{
crossSectionCollection->applySingleColorEffect();
}
}
else
{

View File

@@ -746,6 +746,31 @@ void RimView::addWellPathsToModel(cvf::ModelBasicList* wellPathModelBasicList,
wellPathModelBasicList->updateBoundingBoxesRecursive();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimView::addDynamicWellPathsToModel(cvf::ModelBasicList* wellPathModelBasicList, const cvf::BoundingBox& wellPathClipBoundingBox)
{
if (!this->ownerCase()) return;
cvf::ref<caf::DisplayCoordTransform> transForm = displayCoordTransform();
QDateTime currentTimeStamp;
std::vector<QDateTime> timeStamps = ownerCase()->timeStepDates();
if (currentTimeStep() < timeStamps.size())
{
currentTimeStamp = timeStamps[currentTimeStep()];
}
wellPathsPartManager()->appendDynamicGeometryPartsToModel(wellPathModelBasicList,
currentTimeStamp,
this->ownerCase()->characteristicCellSize(),
wellPathClipBoundingBox,
transForm.p());
wellPathModelBasicList->updateBoundingBoxesRecursive();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -180,6 +180,9 @@ protected:
void addWellPathsToModel(cvf::ModelBasicList* wellPathModelBasicList,
const cvf::BoundingBox& wellPathClipBoundingBox);
void addDynamicWellPathsToModel(cvf::ModelBasicList* wellPathModelBasicList,
const cvf::BoundingBox& wellPathClipBoundingBox);
static void removeModelByName(cvf::Scene* scene, const cvf::String& modelName);
virtual void createDisplayModel() = 0;