mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge with Flow Gui additions
This commit is contained in:
commit
8562d0e98b
@ -80,7 +80,7 @@ void RicWellPathsImportSsihubFeature::onActionTriggered(bool isChecked)
|
||||
|
||||
|
||||
// Keep a copy of the import settings, and restore if cancel is pressed in the import wizard
|
||||
QString copyOfOriginalObject = xmlObj(app->project()->wellPathImport())->writeObjectToXmlString();
|
||||
QString copyOfOriginalObject = app->project()->wellPathImport()->writeObjectToXmlString();
|
||||
|
||||
RiuWellImportWizard wellImportwizard(app->preferences()->ssihubAddress, wellPathsFolderPath, app->project()->wellPathImport(), RiuMainWindow::instance());
|
||||
|
||||
@ -111,7 +111,7 @@ void RicWellPathsImportSsihubFeature::onActionTriggered(bool isChecked)
|
||||
}
|
||||
else
|
||||
{
|
||||
xmlObj(app->project()->wellPathImport())->readObjectFromXmlString(copyOfOriginalObject, caf::PdmDefaultObjectFactory::instance());
|
||||
app->project()->wellPathImport()->readObjectFromXmlString(copyOfOriginalObject, caf::PdmDefaultObjectFactory::instance());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -95,7 +95,7 @@ void RivCellEdgeGeometryUtils::addCellEdgeResultsToDrawableGeo(
|
||||
|
||||
if (opacityLevel < 1.0f)
|
||||
{
|
||||
isWellPipeVisible = &(cellResultColors->reservoirView()->wellCollection()->resultWellPipeVisibilities(timeStepIndex));
|
||||
isWellPipeVisible = &(cellResultColors->reservoirView()->wellCollection()->resultWellGeometryVisibilities(timeStepIndex));
|
||||
gridCellToWellindexMap = eclipseCase->gridCellToResultWellIndex(gridIndex);
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,6 @@ RivReservoirWellSpheresPartMgr::RivReservoirWellSpheresPartMgr(RimEclipseView* r
|
||||
{
|
||||
m_reservoirView = reservoirView;
|
||||
|
||||
m_scaleTransform = new cvf::Transform();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -48,13 +47,13 @@ RivReservoirWellSpheresPartMgr::~RivReservoirWellSpheresPartMgr()
|
||||
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivReservoirWellSpheresPartMgr::setScaleTransform(cvf::Transform * scaleTransform)
|
||||
void RivReservoirWellSpheresPartMgr::clearGeometryCache()
|
||||
{
|
||||
m_scaleTransform = scaleTransform;
|
||||
|
||||
m_wellSpheresPartMgrs.clear();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -62,23 +61,24 @@ void RivReservoirWellSpheresPartMgr::setScaleTransform(cvf::Transform * scaleTra
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivReservoirWellSpheresPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model, size_t frameIndex)
|
||||
{
|
||||
if (!m_reservoirView->wellCollection()->showCellCenterSpheres) return;
|
||||
|
||||
if (m_reservoirView->wellCollection()->wellSphereVisibility == RimEclipseWellCollection::PIPES_FORCE_ALL_OFF) return;
|
||||
|
||||
if (!m_reservoirView->wellCollection()->isActive()) return;
|
||||
|
||||
if (m_reservoirView->wellCollection()->wells.size() != m_wellSpheresPartMgrs.size())
|
||||
{
|
||||
clearGeometryCache();
|
||||
|
||||
for (RimEclipseWell* rimWell : m_reservoirView->wellCollection()->wells())
|
||||
{
|
||||
RivWellSpheresPartMgr* wppmgr = new RivWellSpheresPartMgr(m_reservoirView, rimWell);
|
||||
m_wellSpheresPartMgrs.push_back(wppmgr);
|
||||
wppmgr->setScaleTransform(m_scaleTransform.p());
|
||||
}
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < m_wellSpheresPartMgrs.size(); i++)
|
||||
{
|
||||
if (m_reservoirView->wellCollection()->wells[i]->showWell())
|
||||
if (m_reservoirView->wellCollection()->wells[i]->isWellSpheresVisible(frameIndex))
|
||||
{
|
||||
m_wellSpheresPartMgrs.at(i)->appendDynamicGeometryPartsToModel(model, frameIndex);
|
||||
}
|
||||
|
@ -25,7 +25,6 @@
|
||||
|
||||
namespace cvf
|
||||
{
|
||||
class Transform;
|
||||
class ModelBasicList;
|
||||
}
|
||||
|
||||
@ -38,18 +37,11 @@ public:
|
||||
RivReservoirWellSpheresPartMgr(RimEclipseView* reservoirView);
|
||||
~RivReservoirWellSpheresPartMgr();
|
||||
|
||||
void clearGeometryCache();
|
||||
|
||||
void setScaleTransform(cvf::Transform* scaleTransform);
|
||||
|
||||
void appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model, size_t frameIndex);
|
||||
|
||||
private:
|
||||
|
||||
|
||||
private:
|
||||
caf::PdmPointer<RimEclipseView> m_reservoirView;
|
||||
cvf::ref<cvf::Transform> m_scaleTransform;
|
||||
|
||||
cvf::Collection< RivWellSpheresPartMgr > m_wellSpheresPartMgrs;
|
||||
|
||||
};
|
||||
|
@ -63,7 +63,7 @@ RivTernaryTextureCoordsCreator::RivTernaryTextureCoordsCreator(
|
||||
m_resultAccessor->setTernaryResultAccessors(soil.p(), sgas.p(), swat.p());
|
||||
|
||||
cvf::ref<RigPipeInCellEvaluator> pipeInCellEval =
|
||||
new RigPipeInCellEvaluator(cellResultColors->reservoirView()->wellCollection()->resultWellPipeVisibilities(timeStepIndex),
|
||||
new RigPipeInCellEvaluator(cellResultColors->reservoirView()->wellCollection()->resultWellGeometryVisibilities(timeStepIndex),
|
||||
eclipseCase->gridCellToResultWellIndex(gridIndex));
|
||||
|
||||
const RivTernaryScalarMapper* mapper = ternaryLegendConfig->scalarMapper();
|
||||
|
@ -46,7 +46,7 @@ RivTextureCoordsCreator::RivTextureCoordsCreator(RimEclipseCellColors* cellResul
|
||||
m_resultAccessor = RigResultAccessorFactory::createResultAccessor(eclipseCase, gridIndex, timeStepIndex, cellResultColors);
|
||||
|
||||
cvf::ref<RigPipeInCellEvaluator> pipeInCellEval =
|
||||
new RigPipeInCellEvaluator(cellResultColors->reservoirView()->wellCollection()->resultWellPipeVisibilities(timeStepIndex),
|
||||
new RigPipeInCellEvaluator(cellResultColors->reservoirView()->wellCollection()->resultWellGeometryVisibilities(timeStepIndex),
|
||||
eclipseCase->gridCellToResultWellIndex(gridIndex));
|
||||
|
||||
const cvf::ScalarMapper* mapper = cellResultColors->legendConfig()->scalarMapper();
|
||||
|
@ -18,6 +18,8 @@
|
||||
|
||||
#include "RivWellSpheresPartMgr.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RigCaseData.h"
|
||||
#include "RigMainGrid.h"
|
||||
|
||||
@ -28,7 +30,6 @@
|
||||
|
||||
#include "RiuViewer.h"
|
||||
|
||||
|
||||
#include "cafDisplayCoordTransform.h"
|
||||
#include "cafEffectGenerator.h"
|
||||
#include "cafPdmFieldCvfColor.h"
|
||||
@ -44,7 +45,6 @@
|
||||
#include "cvfGeometryBuilderTriangles.h"
|
||||
#include "cvfOpenGLResourceManager.h"
|
||||
#include "cvfShaderProgram.h"
|
||||
#include "RiaApplication.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@ -63,6 +63,7 @@ RivWellSpheresPartMgr::~RivWellSpheresPartMgr()
|
||||
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -70,7 +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_rimReservoirView->eclipseCase()->reservoirData()) return;
|
||||
|
||||
const RigMainGrid* mainGrid = m_rimReservoirView->eclipseCase()->reservoirData()->mainGrid();
|
||||
CVF_ASSERT(mainGrid);
|
||||
@ -114,51 +115,6 @@ 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;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -52,23 +52,13 @@ public:
|
||||
RivWellSpheresPartMgr(RimEclipseView* reservoirView, RimEclipseWell* well);
|
||||
~RivWellSpheresPartMgr();
|
||||
|
||||
void setScaleTransform(cvf::Transform * scaleTransform) { m_scaleTransform = scaleTransform; scheduleGeometryRegen();}
|
||||
|
||||
void scheduleGeometryRegen() { m_needsTransformUpdate = true; }
|
||||
|
||||
void appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model, size_t frameIndex);
|
||||
|
||||
private:
|
||||
static cvf::ref<cvf::DrawableGeo> createSphere(double radius, const cvf::Vec3d& pos);
|
||||
cvf::ref<cvf::Part> createPart(cvf::DrawableGeo* geo, const cvf::Color3f& color);
|
||||
|
||||
cvf::Color3f wellCellColor(const RigWellResultFrame& wellResultFrame, const RigWellResultPoint& wellResultPoint);
|
||||
cvf::ref<cvf::Part> createPart(std::vector<std::pair<cvf::Vec3f, cvf::Color3f> >& centerColorPairs);
|
||||
|
||||
private:
|
||||
caf::PdmPointer<RimEclipseView> m_rimReservoirView;
|
||||
caf::PdmPointer<RimEclipseWell> m_rimWell;
|
||||
|
||||
cvf::ref<cvf::Transform> m_scaleTransform;
|
||||
bool m_needsTransformUpdate;
|
||||
};
|
||||
|
@ -90,7 +90,6 @@ RimCellEdgeColors::~RimCellEdgeColors()
|
||||
void RimCellEdgeColors::setReservoirView(RimEclipseView* ownerReservoirView)
|
||||
{
|
||||
m_reservoirView = ownerReservoirView;
|
||||
this->m_legendConfig()->setReservoirView(ownerReservoirView);
|
||||
m_singleVarEdgeResultColors->setReservoirView(ownerReservoirView);
|
||||
}
|
||||
|
||||
|
@ -135,7 +135,6 @@ void RimEclipseCellColors::changeLegendConfig(QString resultVarNameOfNewLegend)
|
||||
if (!found)
|
||||
{
|
||||
RimLegendConfig* newLegend = new RimLegendConfig;
|
||||
newLegend->setReservoirView(m_reservoirView);
|
||||
newLegend->resultVariableName = resultVarNameOfNewLegend;
|
||||
m_legendConfigData.push_back(newLegend);
|
||||
|
||||
@ -225,13 +224,6 @@ void RimEclipseCellColors::setReservoirView(RimEclipseView* ownerReservoirView)
|
||||
this->setEclipseCase(ownerReservoirView->eclipseCase());
|
||||
|
||||
m_reservoirView = ownerReservoirView;
|
||||
|
||||
for (size_t i = 0; i < m_legendConfigData.size(); i++)
|
||||
{
|
||||
m_legendConfigData[i]->setReservoirView(ownerReservoirView);
|
||||
}
|
||||
|
||||
this->ternaryLegendConfig()->setReservoirView(ownerReservoirView);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -124,7 +124,6 @@ RimEclipseView::RimEclipseView()
|
||||
this->cellResult()->setReservoirView(this);
|
||||
|
||||
this->cellEdgeResult()->setReservoirView(this);
|
||||
this->cellEdgeResult()->legendConfig()->setReservoirView(this);
|
||||
this->cellEdgeResult()->legendConfig()->setColorRangeMode(RimLegendConfig::PINK_WHITE);
|
||||
|
||||
this->faultResultSettings()->setReservoirView(this);
|
||||
@ -132,7 +131,6 @@ RimEclipseView::RimEclipseView()
|
||||
m_reservoirGridPartManager = new RivReservoirViewPartMgr(this);
|
||||
m_pipesPartManager = new RivReservoirPipesPartMgr(this);
|
||||
m_wellSpheresPartManager = new RivReservoirWellSpheresPartMgr(this);
|
||||
|
||||
|
||||
m_reservoir = NULL;
|
||||
}
|
||||
@ -270,8 +268,6 @@ void RimEclipseView::updateScaleTransform()
|
||||
|
||||
this->scaleTransform()->setLocalTransform(scale);
|
||||
m_pipesPartManager->setScaleTransform(this->scaleTransform());
|
||||
m_wellSpheresPartManager->setScaleTransform(this->scaleTransform());
|
||||
|
||||
|
||||
if (m_viewer) m_viewer->updateCachedValuesInScene();
|
||||
}
|
||||
@ -500,7 +496,6 @@ void RimEclipseView::createDisplayModel()
|
||||
|
||||
if (frameModels.size() > 1 && this->hasUserRequestedAnimation())
|
||||
{
|
||||
m_viewer->animationControl()->setCurrentFrameOnly(m_currentTimeStep);
|
||||
m_viewer->setCurrentFrame(m_currentTimeStep);
|
||||
}
|
||||
else
|
||||
@ -669,7 +664,6 @@ void RimEclipseView::updateCurrentTimeStep()
|
||||
m_pipesPartManager->appendDynamicGeometryPartsToModel(wellPipeModelBasicList.p(), m_currentTimeStep);
|
||||
m_wellSpheresPartManager->appendDynamicGeometryPartsToModel(wellPipeModelBasicList.p(), m_currentTimeStep);
|
||||
|
||||
|
||||
wellPipeModelBasicList->updateBoundingBoxesRecursive();
|
||||
|
||||
this->removeModelByName(frameScene, wellPipeModelBasicList->name());
|
||||
@ -902,6 +896,7 @@ void RimEclipseView::scheduleReservoirGridGeometryRegen()
|
||||
void RimEclipseView::schedulePipeGeometryRegen()
|
||||
{
|
||||
m_pipesPartManager->scheduleGeometryRegen();
|
||||
m_wellSpheresPartManager->clearGeometryCache();
|
||||
}
|
||||
|
||||
|
||||
@ -1310,6 +1305,7 @@ void RimEclipseView::updateDisplayModelForWellResults()
|
||||
{
|
||||
m_reservoirGridPartManager->clearGeometryCache();
|
||||
m_pipesPartManager->clearGeometryCache();
|
||||
m_wellSpheresPartManager->clearGeometryCache();
|
||||
|
||||
syncronizeWellsWithResults();
|
||||
|
||||
|
@ -42,6 +42,7 @@ RimEclipseWell::RimEclipseWell()
|
||||
CAF_PDM_InitField(&showWellLabel, "ShowWellLabel", true, "Show well label", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&showWellPipes, "ShowWellPipe", true, "Show well pipe", "", "", "");
|
||||
CAF_PDM_InitField(&showWellSpheres, "ShowWellSpheres", true, "Show well spheres", "", "", "");
|
||||
CAF_PDM_InitField(&pipeRadiusScaleFactor, "WellPipeRadiusScale",1.0, "Pipe radius scale", "", "", "");
|
||||
CAF_PDM_InitField(&wellPipeColor, "WellPipeColor", cvf::Color3f(0.588f, 0.588f, 0.804f), "Well pipe color", "", "", "");
|
||||
|
||||
@ -121,6 +122,10 @@ void RimEclipseWell::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c
|
||||
{
|
||||
if (m_reservoirView) m_reservoirView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
else if (&showWellSpheres == changedField)
|
||||
{
|
||||
if (m_reservoirView) m_reservoirView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
else if (&wellPipeColor == changedField)
|
||||
{
|
||||
if (m_reservoirView) m_reservoirView->scheduleCreateDisplayModelAndRedraw();
|
||||
@ -146,7 +151,80 @@ caf::PdmFieldHandle* RimEclipseWell::objectToggleField()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEclipseWell::calculateWellPipeVisibility(size_t frameIndex)
|
||||
bool RimEclipseWell::visibleCellsInstersectsWell(size_t frameIndex)
|
||||
{
|
||||
if (this->wellResults() == nullptr) return false;
|
||||
|
||||
if (!wellResults()->hasWellResult(frameIndex)) return false;
|
||||
|
||||
const std::vector<RivCellSetEnum>& visGridParts = m_reservoirView->visibleGridParts();
|
||||
cvf::cref<RivReservoirViewPartMgr> rvMan = m_reservoirView->reservoirGridPartManager();
|
||||
|
||||
for (size_t gpIdx = 0; gpIdx < visGridParts.size(); ++gpIdx)
|
||||
{
|
||||
const RigWellResultFrame& wrsf = this->wellResults()->wellResultFrame(frameIndex);
|
||||
|
||||
// First check the wellhead:
|
||||
|
||||
size_t gridIndex = wrsf.m_wellHead.m_gridIndex;
|
||||
size_t gridCellIndex = wrsf.m_wellHead.m_gridCellIndex;
|
||||
|
||||
if (gridIndex != cvf::UNDEFINED_SIZE_T && gridCellIndex != cvf::UNDEFINED_SIZE_T)
|
||||
{
|
||||
cvf::cref<cvf::UByteArray> cellVisibility = rvMan->cellVisibility(visGridParts[gpIdx], gridIndex, frameIndex);
|
||||
if ((*cellVisibility)[gridCellIndex])
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Then check the rest of the well, with all the branches
|
||||
|
||||
const std::vector<RigWellResultBranch>& wellResSegments = wrsf.m_wellResultBranches;
|
||||
for (size_t wsIdx = 0; wsIdx < wellResSegments.size(); ++wsIdx)
|
||||
{
|
||||
const std::vector<RigWellResultPoint>& wsResCells = wellResSegments[wsIdx].m_branchResultPoints;
|
||||
for (size_t cIdx = 0; cIdx < wsResCells.size(); ++cIdx)
|
||||
{
|
||||
if (wsResCells[cIdx].isCell())
|
||||
{
|
||||
gridIndex = wsResCells[cIdx].m_gridIndex;
|
||||
gridCellIndex = wsResCells[cIdx].m_gridCellIndex;
|
||||
|
||||
cvf::cref<cvf::UByteArray> cellVisibility = rvMan->cellVisibility(visGridParts[gpIdx], gridIndex, frameIndex);
|
||||
if ((*cellVisibility)[gridCellIndex])
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseWell::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
caf::PdmUiGroup* pipeGroup = uiOrdering.addNewGroup("Appearance");
|
||||
pipeGroup->add(&showWellPipes);
|
||||
pipeGroup->add(&showWellSpheres);
|
||||
pipeGroup->add(&showWellLabel);
|
||||
pipeGroup->add(&wellPipeColor);
|
||||
pipeGroup->add(&pipeRadiusScaleFactor);
|
||||
|
||||
caf::PdmUiGroup* filterGroup = uiOrdering.addNewGroup("Range filter");
|
||||
filterGroup->add(&showWellCells);
|
||||
filterGroup->add(&showWellCellFence);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEclipseWell::isWellPipeVisible(size_t frameIndex)
|
||||
{
|
||||
if (m_reservoirView == NULL) return false;
|
||||
if (this->wellResults() == NULL) return false;
|
||||
@ -171,10 +249,10 @@ bool RimEclipseWell::calculateWellPipeVisibility(size_t frameIndex)
|
||||
if (m_reservoirView->wellCollection()->wellPipeVisibility() == RimEclipseWellCollection::PIPES_FORCE_ALL_OFF)
|
||||
return false;
|
||||
|
||||
if ( this->showWell() == false )
|
||||
if (this->showWell() == false)
|
||||
return false;
|
||||
|
||||
if ( this->showWellPipes() == false )
|
||||
if (this->showWellPipes() == false)
|
||||
return false;
|
||||
|
||||
if (m_reservoirView->wellCollection()->wellPipeVisibility() == RimEclipseWellCollection::PIPES_INDIVIDUALLY)
|
||||
@ -185,51 +263,7 @@ bool RimEclipseWell::calculateWellPipeVisibility(size_t frameIndex)
|
||||
|
||||
if (m_reservoirView->wellCollection()->wellPipeVisibility() == RimEclipseWellCollection::PIPES_OPEN_IN_VISIBLE_CELLS)
|
||||
{
|
||||
const std::vector<RivCellSetEnum>& visGridParts = m_reservoirView->visibleGridParts();
|
||||
cvf::cref<RivReservoirViewPartMgr> rvMan = m_reservoirView->reservoirGridPartManager();
|
||||
|
||||
for (size_t gpIdx = 0; gpIdx < visGridParts.size(); ++gpIdx)
|
||||
{
|
||||
const RigWellResultFrame& wrsf = this->wellResults()->wellResultFrame(frameIndex);
|
||||
|
||||
// First check the wellhead:
|
||||
|
||||
size_t gridIndex = wrsf.m_wellHead.m_gridIndex;
|
||||
size_t gridCellIndex = wrsf.m_wellHead.m_gridCellIndex;
|
||||
|
||||
if (gridIndex != cvf::UNDEFINED_SIZE_T && gridCellIndex != cvf::UNDEFINED_SIZE_T)
|
||||
{
|
||||
cvf::cref<cvf::UByteArray> cellVisibility = rvMan->cellVisibility(visGridParts[gpIdx], gridIndex, frameIndex);
|
||||
if ((*cellVisibility)[gridCellIndex])
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Then check the rest of the well, with all the branches
|
||||
|
||||
const std::vector<RigWellResultBranch>& wellResSegments = wrsf.m_wellResultBranches;
|
||||
for (size_t wsIdx = 0; wsIdx < wellResSegments.size(); ++wsIdx)
|
||||
{
|
||||
const std::vector<RigWellResultPoint>& wsResCells = wellResSegments[wsIdx].m_branchResultPoints;
|
||||
for (size_t cIdx = 0; cIdx < wsResCells.size(); ++ cIdx)
|
||||
{
|
||||
if (wsResCells[cIdx].isCell())
|
||||
{
|
||||
gridIndex = wsResCells[cIdx].m_gridIndex;
|
||||
gridCellIndex = wsResCells[cIdx].m_gridCellIndex;
|
||||
|
||||
cvf::cref<cvf::UByteArray> cellVisibility = rvMan->cellVisibility(visGridParts[gpIdx], gridIndex, frameIndex);
|
||||
if ((*cellVisibility)[gridCellIndex])
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return visibleCellsInstersectsWell(frameIndex);
|
||||
}
|
||||
|
||||
CVF_ASSERT(false); // Never end here. have you added new pipe visibility modes ?
|
||||
@ -240,28 +274,51 @@ bool RimEclipseWell::calculateWellPipeVisibility(size_t frameIndex)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseWell::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
bool RimEclipseWell::isWellSpheresVisible(size_t frameIndex)
|
||||
{
|
||||
caf::PdmUiGroup* pipeGroup = uiOrdering.addNewGroup("Appearance");
|
||||
pipeGroup->add(&showWellPipes);
|
||||
pipeGroup->add(&showWellLabel);
|
||||
pipeGroup->add(&wellPipeColor);
|
||||
pipeGroup->add(&pipeRadiusScaleFactor);
|
||||
if (m_reservoirView == NULL) return false;
|
||||
if (this->wellResults() == NULL) return false;
|
||||
|
||||
caf::PdmUiGroup* filterGroup = uiOrdering.addNewGroup("Range filter");
|
||||
filterGroup->add(&showWellCells);
|
||||
filterGroup->add(&showWellCellFence);
|
||||
}
|
||||
if (frameIndex >= this->wellResults()->m_resultTimeStepIndexToWellTimeStepIndex.size())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEclipseWell::isWellPipeVisible(size_t frameIndex)
|
||||
{
|
||||
CVF_ASSERT(m_resultWellIndex != cvf::UNDEFINED_SIZE_T);
|
||||
size_t wellTimeStepIndex = this->wellResults()->m_resultTimeStepIndexToWellTimeStepIndex[frameIndex];
|
||||
if (wellTimeStepIndex == cvf::UNDEFINED_SIZE_T)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Return the possibly cached value
|
||||
return m_reservoirView->wellCollection()->resultWellPipeVisibilities(frameIndex)[m_resultWellIndex];
|
||||
if (!m_reservoirView->wellCollection()->isActive())
|
||||
return false;
|
||||
|
||||
if (m_reservoirView->wellCollection()->wellSphereVisibility() == RimEclipseWellCollection::PIPES_FORCE_ALL_ON)
|
||||
return true;
|
||||
|
||||
if (m_reservoirView->wellCollection()->wellSphereVisibility() == RimEclipseWellCollection::PIPES_FORCE_ALL_OFF)
|
||||
return false;
|
||||
|
||||
if (this->showWell() == false)
|
||||
return false;
|
||||
|
||||
if (this->showWellSpheres() == false)
|
||||
return false;
|
||||
|
||||
if (m_reservoirView->wellCollection()->wellSphereVisibility() == RimEclipseWellCollection::PIPES_INDIVIDUALLY)
|
||||
return true;
|
||||
|
||||
if (m_reservoirView->crossSectionCollection()->hasActiveIntersectionForSimulationWell(this))
|
||||
return true;
|
||||
|
||||
if (m_reservoirView->wellCollection()->wellSphereVisibility() == RimEclipseWellCollection::PIPES_OPEN_IN_VISIBLE_CELLS)
|
||||
{
|
||||
return visibleCellsInstersectsWell(frameIndex);
|
||||
}
|
||||
|
||||
CVF_ASSERT(false); // Never end here. have you added new pipe visibility modes ?
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -53,8 +53,9 @@ public:
|
||||
size_t resultWellIndex() { return m_resultWellIndex; }
|
||||
|
||||
bool isWellPipeVisible(size_t frameIndex);
|
||||
bool isWellSpheresVisible(size_t frameIndex);
|
||||
|
||||
bool calculateWellPipeVisibility(size_t frameIndex);
|
||||
bool visibleCellsInstersectsWell(size_t frameIndex);
|
||||
|
||||
virtual caf::PdmFieldHandle* userDescriptionField();
|
||||
virtual caf::PdmFieldHandle* objectToggleField();
|
||||
@ -71,6 +72,7 @@ public:
|
||||
caf::PdmField<bool> showWellCellFence;
|
||||
|
||||
caf::PdmField<bool> showWellPipes;
|
||||
caf::PdmField<bool> showWellSpheres;
|
||||
caf::PdmField<cvf::Color3f> wellPipeColor;
|
||||
caf::PdmField<double> pipeRadiusScaleFactor;
|
||||
|
||||
|
@ -108,7 +108,7 @@ RimEclipseWellCollection::RimEclipseWellCollection()
|
||||
|
||||
CAF_PDM_InitField(&isAutoDetectingBranches, "IsAutoDetectingBranches", true, "Geometry based branch detection", "", "Toggle wether the well pipe visualization will try to detect when a part of the well \nis really a branch, and thus is starting from wellhead", "");
|
||||
|
||||
CAF_PDM_InitField(&showCellCenterSpheres, "showCellCenterSpheres", false, "Show sphere in cell center", "", "", "");
|
||||
CAF_PDM_InitField(&wellSphereVisibility, "wellSphereVisibility", WellVisibilityEnum(PIPES_FORCE_ALL_OFF), "Global well sphere visibility", "", "", "");
|
||||
CAF_PDM_InitField(&cellCenterSpheresScaleFactor, "CellCenterSphereScale", 0.2, "Cell Center sphere radius", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&wells, "Wells", "Wells", "", "", "");
|
||||
@ -178,17 +178,17 @@ bool RimEclipseWellCollection::hasVisibleWellCells()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Used to know if we need animation of timesteps due to the wells
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEclipseWellCollection::hasVisibleWellPipes()
|
||||
bool RimEclipseWellCollection::hasVisibleWellPipes()
|
||||
{
|
||||
if (!this->isActive()) return false;
|
||||
if (this->wellPipeVisibility() == PIPES_FORCE_ALL_OFF) return false;
|
||||
if (this->wellPipeVisibility() == PIPES_FORCE_ALL_OFF && this->wellSphereVisibility() == PIPES_FORCE_ALL_OFF ) return false;
|
||||
if (this->wells().size() == 0 ) return false;
|
||||
if (this->wellPipeVisibility() == PIPES_FORCE_ALL_ON) return true;
|
||||
if (this->wellSphereVisibility() == PIPES_FORCE_ALL_ON) return true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -227,7 +227,7 @@ void RimEclipseWellCollection::fieldChangedByUi(const caf::PdmFieldHandle* chang
|
||||
m_reservoirView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
}
|
||||
else if ( &showCellCenterSpheres == changedField
|
||||
else if ( &wellSphereVisibility == changedField
|
||||
|| &cellCenterSpheresScaleFactor == changedField)
|
||||
{
|
||||
if (m_reservoirView)
|
||||
@ -296,9 +296,8 @@ void RimEclipseWellCollection::defineUiOrdering(QString uiConfigName, caf::PdmUi
|
||||
wellPipe->add(&wellPipeVisibility);
|
||||
wellPipe->add(&pipeRadiusScaleFactor);
|
||||
|
||||
//TODO: Add Well sphere group
|
||||
caf::PdmUiGroup* cellCenterSpheres = uiOrdering.addNewGroup("Well cell center spheres");
|
||||
cellCenterSpheres->add(&showCellCenterSpheres);
|
||||
cellCenterSpheres->add(&wellSphereVisibility);
|
||||
cellCenterSpheres->add(&cellCenterSpheresScaleFactor);
|
||||
|
||||
caf::PdmUiGroup* advancedGroup = uiOrdering.addNewGroup("Advanced");
|
||||
@ -318,9 +317,9 @@ caf::PdmFieldHandle* RimEclipseWellCollection::objectToggleField()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<cvf::ubyte>& RimEclipseWellCollection::resultWellPipeVisibilities(size_t frameIndex)
|
||||
const std::vector<cvf::ubyte>& RimEclipseWellCollection::resultWellGeometryVisibilities(size_t frameIndex)
|
||||
{
|
||||
calculateIsWellPipesVisible(frameIndex);
|
||||
calculateWellGeometryVisibility(frameIndex);
|
||||
return m_framesOfResultWellPipeVisibilities[frameIndex];
|
||||
}
|
||||
|
||||
@ -335,7 +334,7 @@ void RimEclipseWellCollection::scheduleIsWellPipesVisibleRecalculation()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseWellCollection::calculateIsWellPipesVisible(size_t frameIndex)
|
||||
void RimEclipseWellCollection::calculateWellGeometryVisibility(size_t frameIndex)
|
||||
{
|
||||
if (m_framesOfResultWellPipeVisibilities.size() > frameIndex && m_framesOfResultWellPipeVisibilities[frameIndex].size()) return;
|
||||
|
||||
@ -347,7 +346,10 @@ void RimEclipseWellCollection::calculateIsWellPipesVisible(size_t frameIndex)
|
||||
|
||||
for (size_t i = 0; i < wells().size(); ++i)
|
||||
{
|
||||
m_framesOfResultWellPipeVisibilities[frameIndex][wells[i]->resultWellIndex()] = wells[i]->calculateWellPipeVisibility(frameIndex);
|
||||
bool wellPipeVisible = wells[i]->isWellPipeVisible(frameIndex);
|
||||
bool wellSphereVisible = wells[i]->isWellSpheresVisible(frameIndex);
|
||||
|
||||
m_framesOfResultWellPipeVisibilities[frameIndex][wells[i]->resultWellIndex()] = wellPipeVisible || wellSphereVisible;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ public:
|
||||
|
||||
RimEclipseWellCollection();
|
||||
virtual ~RimEclipseWellCollection();
|
||||
|
||||
|
||||
void setReservoirView(RimEclipseView* ownerReservoirView);
|
||||
|
||||
enum WellVisibilityType
|
||||
@ -102,7 +102,7 @@ public:
|
||||
|
||||
caf::PdmField<bool> isAutoDetectingBranches;
|
||||
|
||||
caf::PdmField<bool> showCellCenterSpheres;
|
||||
caf::PdmField<WellVisibilityEnum> wellSphereVisibility;
|
||||
caf::PdmField<double> cellCenterSpheresScaleFactor;
|
||||
|
||||
|
||||
@ -113,7 +113,7 @@ public:
|
||||
bool hasVisibleWellPipes();
|
||||
void sortWellsByName();
|
||||
|
||||
const std::vector<cvf::ubyte>& resultWellPipeVisibilities(size_t frameIndex);
|
||||
const std::vector<cvf::ubyte>& resultWellGeometryVisibilities(size_t frameIndex);
|
||||
void scheduleIsWellPipesVisibleRecalculation();
|
||||
|
||||
protected:
|
||||
@ -122,7 +122,7 @@ protected:
|
||||
virtual caf::PdmFieldHandle* objectToggleField();
|
||||
private:
|
||||
|
||||
void calculateIsWellPipesVisible(size_t frameIndex);
|
||||
void calculateWellGeometryVisibility(size_t frameIndex);
|
||||
|
||||
RimEclipseView* m_reservoirView;
|
||||
std::vector< std::vector< cvf::ubyte > >
|
||||
|
@ -84,9 +84,6 @@ RimGeoMechView::RimGeoMechView(void)
|
||||
m_propertyFilterCollection = new RimGeoMechPropertyFilterCollection();
|
||||
m_propertyFilterCollection.uiCapability()->setUiHidden(true);
|
||||
|
||||
//this->cellResult()->setReservoirView(this);
|
||||
this->cellResult()->legendConfig()->setReservoirView(this);
|
||||
|
||||
m_scaleTransform = new cvf::Transform();
|
||||
m_vizLogic = new RivGeoMechVizLogic(this);
|
||||
}
|
||||
@ -257,7 +254,6 @@ void RimGeoMechView::createDisplayModel()
|
||||
|
||||
if (isTimeStepDependentDataVisible())
|
||||
{
|
||||
m_viewer->animationControl()->setCurrentFrameOnly(m_currentTimeStep);
|
||||
m_viewer->setCurrentFrame(m_currentTimeStep);
|
||||
}
|
||||
else
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "RimEclipseCellColors.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimGeoMechResultDefinition.h"
|
||||
#include "RimViewLinker.h"
|
||||
|
||||
#include "cafCategoryLegend.h"
|
||||
#include "cafCategoryMapper.h"
|
||||
@ -182,7 +183,19 @@ void RimLegendConfig::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
|
||||
updateLegend();
|
||||
|
||||
if (m_reservoirView) m_reservoirView->updateCurrentTimeStepAndRedraw();
|
||||
RimView* view = nullptr;
|
||||
this->firstAncestorOrThisOfType(view);
|
||||
|
||||
if (view)
|
||||
{
|
||||
RimViewLinker* viewLinker = view->assosiatedViewLinker();
|
||||
if (viewLinker)
|
||||
{
|
||||
viewLinker->updateCellResult();
|
||||
}
|
||||
|
||||
view->updateCurrentTimeStepAndRedraw();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -758,6 +771,15 @@ cvf::OverlayItem* RimLegendConfig::legend()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimLegendConfig::setUiValuesFromLegendConfig(const RimLegendConfig* otherLegendConfig)
|
||||
{
|
||||
QString serializedObjectString = otherLegendConfig->writeObjectToXmlString();
|
||||
this->readObjectFromXmlString(serializedObjectString, caf::PdmDefaultObjectFactory::instance());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -57,8 +57,6 @@ public:
|
||||
RimLegendConfig();
|
||||
virtual ~RimLegendConfig();
|
||||
|
||||
void setReservoirView(RimView* ownerReservoirView) {m_reservoirView = ownerReservoirView; }
|
||||
|
||||
caf::PdmField<QString> resultVariableName; // Used internally to describe the variable this legend setup is used for
|
||||
|
||||
enum RangeModeType
|
||||
@ -126,10 +124,10 @@ private:
|
||||
cvf::ref<cvf::Color3ubArray> interpolateColorArray(const cvf::Color3ubArray& colorArray, cvf::uint targetColorCount);
|
||||
double roundToNumSignificantDigits(double value, double precision);
|
||||
|
||||
friend class RimViewLinker;
|
||||
void setUiValuesFromLegendConfig(const RimLegendConfig* otherLegendConfig);
|
||||
|
||||
private:
|
||||
caf::PdmPointer<RimView> m_reservoirView;
|
||||
|
||||
cvf::ref<cvf::ScalarMapperDiscreteLinear> m_linDiscreteScalarMapper;
|
||||
cvf::ref<cvf::ScalarMapperDiscreteLog> m_logDiscreteScalarMapper;
|
||||
cvf::ref<cvf::ScalarMapperContinuousLog> m_logSmoothScalarMapper;
|
||||
|
@ -25,6 +25,18 @@
|
||||
|
||||
#include "cafPdmPointer.h"
|
||||
|
||||
namespace caf
|
||||
{
|
||||
template<>
|
||||
void caf::AppEnum< RimMultiSnapshotDefinition::SnapShotDirectionEnum >::setUp()
|
||||
{
|
||||
addItem(RimMultiSnapshotDefinition::RANGEFILTER_I, "I", "i-direction");
|
||||
addItem(RimMultiSnapshotDefinition::RANGEFILTER_J, "J", "j-direction");
|
||||
addItem(RimMultiSnapshotDefinition::RANGEFILTER_K, "K", "k-direction");
|
||||
|
||||
setDefault(RimMultiSnapshotDefinition::RANGEFILTER_K);
|
||||
}
|
||||
}
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimMultiSnapshotDefinition, "MultiSnapshotDefinition");
|
||||
|
||||
@ -40,6 +52,12 @@ RimMultiSnapshotDefinition::RimMultiSnapshotDefinition()
|
||||
CAF_PDM_InitFieldNoDefault(&viewObject, "View", "View", "", "", "");
|
||||
CAF_PDM_InitField(&timeStepStart, "TimeStepStart", 0, "Timestep Start", "", "", "");
|
||||
CAF_PDM_InitField(&timeStepEnd, "TimeStepEnd", 0, "Timestep End", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&sliceDirection, "SnapShotDirection", caf::AppEnum<SnapShotDirectionEnum>(RANGEFILTER_K), "Range Filter direction", "", "", "");
|
||||
CAF_PDM_InitField(&startSliceIndex, "RangeFilterStart", 0, "RangeFilter Start", "", "", "");
|
||||
CAF_PDM_InitField(&endSliceIndex, "RangeFilterEnd", 0, "RangeFilter End", "", "", "");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -69,7 +87,7 @@ QList<caf::PdmOptionItemInfo> RimMultiSnapshotDefinition::calculateValueOptions(
|
||||
options.push_back(caf::PdmOptionItemInfo(c->caseUserDescription(), QVariant::fromValue(caf::PdmPointer<caf::PdmObjectHandle>(c))));
|
||||
}
|
||||
|
||||
options.push_back(caf::PdmOptionItemInfo("All", QVariant::fromValue(caf::PdmPointer<caf::PdmObjectHandle>(nullptr))));
|
||||
//options.push_back(caf::PdmOptionItemInfo("All", QVariant::fromValue(caf::PdmPointer<caf::PdmObjectHandle>(nullptr))));
|
||||
}
|
||||
else if (fieldNeedingOptions == &viewObject)
|
||||
{
|
||||
@ -82,9 +100,34 @@ QList<caf::PdmOptionItemInfo> RimMultiSnapshotDefinition::calculateValueOptions(
|
||||
}
|
||||
}
|
||||
|
||||
options.push_back(caf::PdmOptionItemInfo("All", QVariant::fromValue(caf::PdmPointer<caf::PdmObjectHandle>(nullptr))));
|
||||
//options.push_back(caf::PdmOptionItemInfo("All", QVariant::fromValue(caf::PdmPointer<caf::PdmObjectHandle>(nullptr))));
|
||||
}
|
||||
else if (fieldNeedingOptions == &timeStepEnd)
|
||||
{
|
||||
getTimeStepStrings(options);
|
||||
|
||||
}
|
||||
else if (fieldNeedingOptions == &timeStepStart)
|
||||
{
|
||||
getTimeStepStrings(options);
|
||||
}
|
||||
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimMultiSnapshotDefinition::getTimeStepStrings(QList<caf::PdmOptionItemInfo> &options)
|
||||
{
|
||||
if (!caseObject()) return;
|
||||
|
||||
QStringList timeSteps = caseObject()->timeStepStrings();
|
||||
for (int i = 0; i < timeSteps.size(); i++)
|
||||
{
|
||||
options.push_back(caf::PdmOptionItemInfo(timeSteps[i], i));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmPtrField.h"
|
||||
#include "cafAppEnum.h"
|
||||
|
||||
class RimCase;
|
||||
class RimView;
|
||||
@ -42,6 +43,20 @@ public:
|
||||
caf::PdmField<int> timeStepStart;
|
||||
caf::PdmField<int> timeStepEnd;
|
||||
|
||||
enum SnapShotDirectionEnum
|
||||
{
|
||||
RANGEFILTER_I,
|
||||
RANGEFILTER_J,
|
||||
RANGEFILTER_K
|
||||
};
|
||||
|
||||
caf::PdmField< caf::AppEnum< SnapShotDirectionEnum > > sliceDirection;
|
||||
caf::PdmField<int> startSliceIndex;
|
||||
caf::PdmField<int> endSliceIndex;
|
||||
|
||||
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;
|
||||
|
||||
void getTimeStepStrings(QList<caf::PdmOptionItemInfo> &options);
|
||||
|
||||
};
|
||||
|
@ -19,15 +19,17 @@
|
||||
|
||||
#include "RimTernaryLegendConfig.h"
|
||||
|
||||
#include "cafPdmUiPushButtonEditor.h"
|
||||
#include "cafPdmUiTextEditor.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimViewLinker.h"
|
||||
|
||||
#include "RivTernarySaturationOverlayItem.h"
|
||||
#include "RivTernaryScalarMapper.h"
|
||||
|
||||
#include "cafPdmUiPushButtonEditor.h"
|
||||
#include "cafPdmUiTextEditor.h"
|
||||
|
||||
#include "cvfqtUtils.h"
|
||||
|
||||
#include <cmath>
|
||||
@ -152,7 +154,19 @@ void RimTernaryLegendConfig::fieldChangedByUi(const caf::PdmFieldHandle* changed
|
||||
updateLabelText();
|
||||
updateLegend();
|
||||
|
||||
if (m_reservoirView) m_reservoirView->updateCurrentTimeStepAndRedraw();
|
||||
RimView* view = nullptr;
|
||||
this->firstAncestorOrThisOfType(view);
|
||||
|
||||
if (view)
|
||||
{
|
||||
RimViewLinker* viewLinker = view->assosiatedViewLinker();
|
||||
if (viewLinker)
|
||||
{
|
||||
viewLinker->updateCellResult();
|
||||
}
|
||||
|
||||
view->updateCurrentTimeStepAndRedraw();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -231,6 +245,15 @@ void RimTernaryLegendConfig::recreateLegend()
|
||||
updateLegend();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimTernaryLegendConfig::setUiValuesFromLegendConfig(const RimTernaryLegendConfig* otherLegendConfig)
|
||||
{
|
||||
QString serializedObjectString = otherLegendConfig->writeObjectToXmlString();
|
||||
this->readObjectFromXmlString(serializedObjectString, caf::PdmDefaultObjectFactory::instance());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Rounding the double value to given number of significant digits
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -65,15 +65,13 @@ public:
|
||||
RimTernaryLegendConfig();
|
||||
virtual ~RimTernaryLegendConfig();
|
||||
|
||||
void setReservoirView(RimEclipseView* ownerReservoirView) {m_reservoirView = ownerReservoirView; }
|
||||
|
||||
void setAutomaticRanges(TernaryArrayIndex ternaryIndex, double globalMin, double globalMax, double localMin, double localMax);
|
||||
void ternaryRanges(double& soilLower, double& soilUpper, double& sgasLower, double& sgasUpper, double& swatLower, double& swatUpper) const;
|
||||
|
||||
void recreateLegend();
|
||||
|
||||
RivTernarySaturationOverlayItem* legend();
|
||||
RivTernaryScalarMapper* scalarMapper();
|
||||
RivTernaryScalarMapper* scalarMapper();
|
||||
|
||||
protected:
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
||||
@ -84,7 +82,9 @@ private:
|
||||
void updateLegend();
|
||||
void updateLabelText();
|
||||
double roundToNumSignificantDigits(double value, double precision);
|
||||
|
||||
|
||||
friend class RimViewLinker;
|
||||
void setUiValuesFromLegendConfig(const RimTernaryLegendConfig* otherLegendConfig);
|
||||
|
||||
private:
|
||||
caf::PdmField<int> precision;
|
||||
@ -107,7 +107,6 @@ private:
|
||||
std::vector<double> m_localAutoMax;
|
||||
std::vector<double> m_localAutoMin;
|
||||
|
||||
caf::PdmPointer<RimEclipseView> m_reservoirView;
|
||||
cvf::ref<RivTernarySaturationOverlayItem> m_legend;
|
||||
cvf::ref<RivTernaryScalarMapper> m_scalarMapper;
|
||||
};
|
||||
|
@ -137,10 +137,8 @@ public:
|
||||
void setScaleZAndUpdate(double scaleZ);
|
||||
|
||||
// Animation
|
||||
int currentTimeStep() { return m_currentTimeStep;}
|
||||
void setCurrentTimeStep(int frameIdx);
|
||||
int currentTimeStep() const { return m_currentTimeStep;}
|
||||
void updateCurrentTimeStepAndRedraw();
|
||||
void endAnimation();
|
||||
|
||||
virtual void scheduleGeometryRegen(RivCellSetEnum geometryType) = 0;
|
||||
void scheduleCreateDisplayModelAndRedraw();
|
||||
@ -230,6 +228,11 @@ protected:
|
||||
|
||||
private:
|
||||
RimViewLinker* viewLinkerIfMasterView() const;
|
||||
|
||||
friend class RiuViewer;
|
||||
void setCurrentTimeStep(int frameIdx);
|
||||
void endAnimation();
|
||||
|
||||
private:
|
||||
bool m_previousGridModeMeshLinesWasFaults;
|
||||
caf::PdmField<bool> m_disableLighting;
|
||||
|
@ -66,9 +66,10 @@ RimViewController::RimViewController(void)
|
||||
CAF_PDM_InitFieldNoDefault(&m_managedView, "ManagedView", "Linked View", "", "", "");
|
||||
m_managedView.uiCapability()->setUiTreeChildrenHidden(true);
|
||||
|
||||
CAF_PDM_InitField(&m_syncCamera, "SyncCamera", true, "Camera", "", "", "");
|
||||
CAF_PDM_InitField(&m_syncTimeStep, "SyncTimeStep", true, "Time Step", "", "", "");
|
||||
CAF_PDM_InitField(&m_syncCellResult, "SyncCellResult", false, "Cell Color Result", "", "", "");
|
||||
CAF_PDM_InitField(&m_syncCamera, "SyncCamera", true, "Camera", "", "", "");
|
||||
CAF_PDM_InitField(&m_syncTimeStep, "SyncTimeStep", true, "Time Step", "", "", "");
|
||||
CAF_PDM_InitField(&m_syncCellResult, "SyncCellResult", false, "Cell Result", "", "", "");
|
||||
CAF_PDM_InitField(&m_syncLegendDefinitions, "SyncLegendDefinitions", true, " Legend Definition", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&m_syncVisibleCells, "SyncVisibleCells", false, "Visible Cells", "", "", "");
|
||||
/// We do not support this. Consider to remove sometime
|
||||
@ -185,6 +186,10 @@ void RimViewController::fieldChangedByUi(const caf::PdmFieldHandle* changedField
|
||||
managedGeoView()->cellResult()->updateIconState();
|
||||
}
|
||||
}
|
||||
else if (changedField == &m_syncLegendDefinitions)
|
||||
{
|
||||
updateLegendDefinitions();
|
||||
}
|
||||
else if (changedField == &m_syncRangeFilters)
|
||||
{
|
||||
if (!m_syncRangeFilters)
|
||||
@ -365,6 +370,7 @@ void RimViewController::updateOptionSensitivity()
|
||||
{
|
||||
isMasterAndDependentViewDifferentType = true;
|
||||
}
|
||||
|
||||
if (geoMasterView && !managedGeoView())
|
||||
{
|
||||
isMasterAndDependentViewDifferentType = true;
|
||||
@ -374,10 +380,22 @@ void RimViewController::updateOptionSensitivity()
|
||||
{
|
||||
this->m_syncCellResult.uiCapability()->setUiReadOnly(true);
|
||||
this->m_syncCellResult = false;
|
||||
|
||||
this->m_syncLegendDefinitions.uiCapability()->setUiReadOnly(true);
|
||||
this->m_syncLegendDefinitions = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
this->m_syncCellResult.uiCapability()->setUiReadOnly(false);
|
||||
|
||||
if (this->m_syncCellResult)
|
||||
{
|
||||
this->m_syncLegendDefinitions.uiCapability()->setUiReadOnly(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->m_syncLegendDefinitions.uiCapability()->setUiReadOnly(true);
|
||||
}
|
||||
}
|
||||
|
||||
if (isPropertyFilterControlPossible())
|
||||
@ -390,7 +408,6 @@ void RimViewController::updateOptionSensitivity()
|
||||
this->m_syncPropertyFilters = false;
|
||||
}
|
||||
|
||||
|
||||
if (isRangeFilterControlPossible())
|
||||
{
|
||||
this->m_syncRangeFilters.uiCapability()->setUiReadOnly(false);
|
||||
@ -440,6 +457,7 @@ void RimViewController::defineUiOrdering(QString uiConfigName, caf::PdmUiOrderin
|
||||
scriptGroup->add(&m_syncCamera);
|
||||
scriptGroup->add(&m_syncTimeStep);
|
||||
scriptGroup->add(&m_syncCellResult);
|
||||
scriptGroup->add(&m_syncLegendDefinitions);
|
||||
|
||||
caf::PdmUiGroup* visibleCells = uiOrdering.addNewGroup("Link Cell Filters");
|
||||
visibleCells->add(&m_syncVisibleCells);
|
||||
@ -498,6 +516,17 @@ void RimViewController::updateResultColorsControl()
|
||||
viewLinker->updateCellResult();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewController::updateLegendDefinitions()
|
||||
{
|
||||
if (!this->isLegendDefinitionsControlled()) return;
|
||||
|
||||
RimViewLinker* viewLinker = ownerViewLinker();
|
||||
viewLinker->updateCellResult();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -714,6 +743,21 @@ bool RimViewController::isResultColorControlled()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimViewController::isLegendDefinitionsControlled()
|
||||
{
|
||||
if (ownerViewLinker()->isActive() && this->m_isActive())
|
||||
{
|
||||
return m_syncLegendDefinitions;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -61,6 +61,7 @@ public:
|
||||
bool isTimeStepLinked();
|
||||
|
||||
bool isResultColorControlled();
|
||||
bool isLegendDefinitionsControlled();
|
||||
bool isRangeFiltersControlled();
|
||||
|
||||
bool isVisibleCellsOveridden();
|
||||
@ -90,6 +91,7 @@ private:
|
||||
void updateCameraLink();
|
||||
void updateTimeStepLink();
|
||||
void updateResultColorsControl();
|
||||
void updateLegendDefinitions();
|
||||
|
||||
bool isMasterAndDepViewDifferentType();
|
||||
bool isRangeFilterControlPossible();
|
||||
@ -111,6 +113,7 @@ private:
|
||||
|
||||
// Overridden properties
|
||||
caf::PdmField<bool> m_syncCellResult;
|
||||
caf::PdmField<bool> m_syncLegendDefinitions;
|
||||
|
||||
caf::PdmField<bool> m_syncRangeFilters;
|
||||
caf::PdmField<bool> m_syncVisibleCells;
|
||||
|
@ -24,7 +24,6 @@
|
||||
#include "RigCaseData.h"
|
||||
|
||||
#include "RimCase.h"
|
||||
|
||||
#include "RimEclipseCellColors.h"
|
||||
#include "RimEclipseInputCase.h"
|
||||
#include "RimEclipseResultCase.h"
|
||||
@ -34,16 +33,17 @@
|
||||
#include "RimGeoMechCellColors.h"
|
||||
#include "RimGeoMechResultDefinition.h"
|
||||
#include "RimGeoMechView.h"
|
||||
#include "RimViewController.h"
|
||||
#include "RimLegendConfig.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimTernaryLegendConfig.h"
|
||||
#include "RimView.h"
|
||||
#include "RimViewController.h"
|
||||
#include "RimViewLinkerCollection.h"
|
||||
|
||||
#include "RiuViewer.h"
|
||||
|
||||
#include "cvfCamera.h"
|
||||
#include "cvfScene.h"
|
||||
#include "cafFrameAnimationControl.h"
|
||||
#include "cvfMatrix4.h"
|
||||
#include "cafPdmUiTreeOrdering.h"
|
||||
|
||||
@ -102,7 +102,6 @@ void RimViewLinker::updateTimeStep(RimView* sourceView, int timeStep)
|
||||
if (m_masterView && m_masterView->viewer() && sourceView != m_masterView)
|
||||
{
|
||||
m_masterView->viewer()->setCurrentFrame(timeStep);
|
||||
m_masterView->viewer()->animationControl()->setCurrentFrameOnly(timeStep);
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < m_viewControllers.size(); i++)
|
||||
@ -116,7 +115,6 @@ void RimViewLinker::updateTimeStep(RimView* sourceView, int timeStep)
|
||||
&& viewLink->managedView()->viewer())
|
||||
{
|
||||
viewLink->managedView()->viewer()->setCurrentFrame(timeStep);
|
||||
viewLink->managedView()->viewer()->animationControl()->setCurrentFrameOnly(timeStep);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -147,6 +145,16 @@ void RimViewLinker::updateCellResult()
|
||||
eclipeView->cellResult()->setPorosityModel(eclipseCellResultDefinition->porosityModel());
|
||||
eclipeView->cellResult()->setResultType(eclipseCellResultDefinition->resultType());
|
||||
eclipeView->cellResult()->setResultVariable(eclipseCellResultDefinition->resultVariable());
|
||||
|
||||
if (viewLink->isLegendDefinitionsControlled())
|
||||
{
|
||||
eclipeView->cellResult()->legendConfig()->setUiValuesFromLegendConfig(masterEclipseView->cellResult()->legendConfig());
|
||||
eclipeView->cellResult()->legendConfig()->updateLegend();
|
||||
|
||||
eclipeView->cellResult()->ternaryLegendConfig()->setUiValuesFromLegendConfig(masterEclipseView->cellResult()->ternaryLegendConfig());
|
||||
eclipeView->cellResult()->ternaryLegendConfig()->updateLegend();
|
||||
}
|
||||
|
||||
eclipeView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
|
||||
@ -174,6 +182,13 @@ void RimViewLinker::updateCellResult()
|
||||
if (viewLink->isResultColorControlled())
|
||||
{
|
||||
geoView->cellResult()->setResultAddress(geoMechResultDefinition->resultAddress());
|
||||
|
||||
if (viewLink->isLegendDefinitionsControlled())
|
||||
{
|
||||
geoView->cellResult()->legendConfig()->setUiValuesFromLegendConfig(masterGeoView->cellResult()->legendConfig());
|
||||
geoView->cellResult()->legendConfig()->updateLegend();
|
||||
}
|
||||
|
||||
geoView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
|
||||
|
@ -66,6 +66,7 @@ public:
|
||||
void updateScaleZ(RimView* sourceView, double scaleZ);
|
||||
|
||||
void updateCellResult();
|
||||
|
||||
void updateRangeFilters(RimCellRangeFilter* changedRangeFilter);
|
||||
void applyRangeFilterCollectionByUserChoice();
|
||||
|
||||
|
@ -18,18 +18,27 @@
|
||||
|
||||
#include "RiuExportMultipleSnapshotsWidget.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RimCase.h"
|
||||
#include "RimMultiSnapshotDefinition.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimView.h"
|
||||
|
||||
#include "cafCmdFeatureManager.h"
|
||||
#include "cafPdmUiTableView.h"
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include <QFileDialog>
|
||||
#include <QAbstractItemView>
|
||||
#include <QBoxLayout>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QMenu>
|
||||
#include <QPushButton>
|
||||
#include <QTableView>
|
||||
#include <QToolButton>
|
||||
#include <QWidget>
|
||||
|
||||
|
||||
@ -42,6 +51,10 @@ RiuExportMultipleSnapshotsWidget::RiuExportMultipleSnapshotsWidget(QWidget* pare
|
||||
{
|
||||
setWindowTitle("Export Multiple Snapshots");
|
||||
|
||||
int nWidth = 800;
|
||||
int nHeight = 300;
|
||||
resize(nWidth, nHeight);
|
||||
|
||||
QVBoxLayout* dialogLayout = new QVBoxLayout;
|
||||
setLayout(dialogLayout);
|
||||
|
||||
@ -58,11 +71,40 @@ RiuExportMultipleSnapshotsWidget::RiuExportMultipleSnapshotsWidget(QWidget* pare
|
||||
|
||||
dialogLayout->addWidget(m_pdmTableView);
|
||||
|
||||
// Export folder
|
||||
{
|
||||
QHBoxLayout* layout = new QHBoxLayout;
|
||||
|
||||
layout->addWidget(new QLabel("Export folder"));
|
||||
|
||||
// Save images in snapshot catalog relative to project directory
|
||||
QString snapshotFolderName = RiaApplication::instance()->createAbsolutePathFromProjectRelativePath("snapshots");
|
||||
|
||||
m_lineEdit = new QLineEdit(snapshotFolderName);
|
||||
|
||||
QToolButton* button = new QToolButton;
|
||||
button->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred));
|
||||
button->setText(QLatin1String("..."));
|
||||
|
||||
layout->addWidget(m_lineEdit);
|
||||
layout->addWidget(button);
|
||||
|
||||
connect(button, SIGNAL(clicked()), this, SLOT(folderSelectionClicked()));
|
||||
|
||||
dialogLayout->addLayout(layout);
|
||||
}
|
||||
|
||||
|
||||
// Buttons
|
||||
QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
|
||||
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
|
||||
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
||||
|
||||
QPushButton* exportButton = new QPushButton(tr("Export"));
|
||||
exportButton->setDefault(true);
|
||||
buttonBox->addButton(exportButton, QDialogButtonBox::ActionRole);
|
||||
connect(exportButton, SIGNAL(clicked()), this, SLOT(exportSnapshots()));
|
||||
|
||||
dialogLayout->addWidget(buttonBox);
|
||||
}
|
||||
|
||||
@ -86,9 +128,14 @@ void RiuExportMultipleSnapshotsWidget::customMenuRequested(QPoint pos)
|
||||
QMenu menu;
|
||||
menu.addAction(commandManager->action("PdmListField_DeleteItem","Delete row"));
|
||||
|
||||
QAction* newRowAction = new QAction("Add new row", this);
|
||||
QAction* newRowAction = new QAction("New row", this);
|
||||
connect(newRowAction, SIGNAL(triggered()), SLOT(addSnapshotItem()));
|
||||
menu.addAction(newRowAction);
|
||||
|
||||
QAction* clearAllRows = new QAction("Clear", this);
|
||||
connect(clearAllRows, SIGNAL(triggered()), SLOT(deleteAllSnapshotItems()));
|
||||
menu.addAction(clearAllRows);
|
||||
|
||||
|
||||
// Qt doc: QAbstractScrollArea and its subclasses that map the context menu event to coordinates of the viewport().
|
||||
QPoint globalPos = m_pdmTableView->tableView()->viewport()->mapToGlobal(pos);
|
||||
@ -96,6 +143,48 @@ void RiuExportMultipleSnapshotsWidget::customMenuRequested(QPoint pos)
|
||||
menu.exec(globalPos);
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuExportMultipleSnapshotsWidget::deleteAllSnapshotItems()
|
||||
{
|
||||
if (!m_rimProject) return;
|
||||
|
||||
m_rimProject->multiSnapshotDefinitions.deleteAllChildObjects();
|
||||
|
||||
m_rimProject->multiSnapshotDefinitions.uiCapability()->updateConnectedEditors();
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuExportMultipleSnapshotsWidget::exportSnapshots()
|
||||
{
|
||||
// TODO: wire up call of static method
|
||||
// RicExportMultipleSnapshotsFeature::staticMethod()
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuExportMultipleSnapshotsWidget::folderSelectionClicked()
|
||||
{
|
||||
QString defaultPath = m_lineEdit->text();
|
||||
|
||||
QString directoryPath = QFileDialog::getExistingDirectory(m_lineEdit,
|
||||
tr("Get existing directory"),
|
||||
defaultPath,
|
||||
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
|
||||
|
||||
if (!directoryPath.isEmpty())
|
||||
{
|
||||
m_lineEdit->setText(directoryPath);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -104,7 +193,54 @@ void RiuExportMultipleSnapshotsWidget::addSnapshotItem()
|
||||
if (!m_rimProject) return;
|
||||
|
||||
RimMultiSnapshotDefinition* multiSnapshot = new RimMultiSnapshotDefinition();
|
||||
// TODO: init with available time step from
|
||||
|
||||
|
||||
//Getting default value from last entered line:
|
||||
if (m_rimProject->multiSnapshotDefinitions.size() > 0)
|
||||
{
|
||||
RimMultiSnapshotDefinition* other = m_rimProject->multiSnapshotDefinitions[m_rimProject->multiSnapshotDefinitions.size() - 1];
|
||||
|
||||
multiSnapshot->caseObject = other->caseObject();
|
||||
multiSnapshot->viewObject = other->viewObject();
|
||||
multiSnapshot->timeStepStart = other->timeStepStart();
|
||||
multiSnapshot->timeStepEnd = other->timeStepEnd();
|
||||
|
||||
|
||||
// Variant using copy based on xml string
|
||||
// QString copyOfOriginalObject = other->writeObjectToXmlString();
|
||||
// multiSnapshot->readObjectFromXmlString(copyOfOriginalObject, caf::PdmDefaultObjectFactory::instance());
|
||||
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
std::vector<RimCase*> cases;
|
||||
proj->allCases(cases);
|
||||
RimCase* CaseExample = nullptr;
|
||||
RimView* ViewExample = nullptr;
|
||||
|
||||
if (cases.size() > 0)
|
||||
{
|
||||
CaseExample = cases.at(0);
|
||||
multiSnapshot->caseObject = CaseExample;
|
||||
|
||||
std::vector<RimView*> viewExamples;
|
||||
viewExamples = CaseExample->views();
|
||||
|
||||
if (viewExamples.size() > 0)
|
||||
{
|
||||
ViewExample = viewExamples.at(0);
|
||||
multiSnapshot->viewObject = ViewExample;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
m_rimProject->multiSnapshotDefinitions.push_back(multiSnapshot);
|
||||
m_rimProject->multiSnapshotDefinitions.uiCapability()->updateConnectedEditors();
|
||||
|
@ -27,6 +27,7 @@ namespace caf {
|
||||
}
|
||||
|
||||
class QWidget;
|
||||
class QLineEdit;
|
||||
|
||||
class RiuExportMultipleSnapshotsWidget : public QDialog
|
||||
{
|
||||
@ -38,8 +39,13 @@ public:
|
||||
private slots:
|
||||
void customMenuRequested(QPoint pos);
|
||||
void addSnapshotItem();
|
||||
void deleteAllSnapshotItems();
|
||||
void exportSnapshots();
|
||||
|
||||
void folderSelectionClicked();
|
||||
|
||||
private:
|
||||
RimProject* m_rimProject;
|
||||
caf::PdmUiTableView* m_pdmTableView;
|
||||
QLineEdit* m_lineEdit;
|
||||
};
|
||||
|
@ -40,6 +40,7 @@
|
||||
#include "cafCategoryLegend.h"
|
||||
#include "cafCeetronPlusNavigation.h"
|
||||
#include "cafEffectGenerator.h"
|
||||
#include "cafFrameAnimationControl.h"
|
||||
|
||||
#include "cvfCamera.h"
|
||||
#include "cvfFont.h"
|
||||
@ -610,6 +611,8 @@ void RiuViewer::setCurrentFrame(int frameIndex)
|
||||
CVF_ASSERT(firstRendering);
|
||||
|
||||
if (m_rimView) m_rimView->setCurrentTimeStep(frameIndex);
|
||||
|
||||
animationControl()->setCurrentFrameOnly(frameIndex);
|
||||
|
||||
caf::Viewer::slotSetCurrentFrame(frameIndex);
|
||||
}
|
||||
|
@ -884,10 +884,10 @@ void WellSelectionPage::buildWellTreeView()
|
||||
RimWellPathEntry* wellPathEntry = oilField->wells[wIdx];
|
||||
|
||||
// Create a copy of the PdmObject, as it is not supported to have multiple parents of any objects
|
||||
QString objStr = xmlObj(wellPathEntry)->writeObjectToXmlString();
|
||||
QString objStr = wellPathEntry->writeObjectToXmlString();
|
||||
|
||||
RimWellPathEntry* wellPathCopy = new RimWellPathEntry;
|
||||
xmlObj(wellPathCopy)->readObjectFromXmlString(objStr, caf::PdmDefaultObjectFactory::instance());
|
||||
wellPathCopy->readObjectFromXmlString(objStr, caf::PdmDefaultObjectFactory::instance());
|
||||
|
||||
fieldGroup->objects.push_back(wellPathCopy);
|
||||
}
|
||||
|
@ -417,7 +417,7 @@ elseif (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
||||
set(CPACK_GENERATOR ZIP)
|
||||
endif()
|
||||
|
||||
if(NOT ${RESINSIGHT_OCTAVE_PLUGIN_MKOCTFILE} EQUAL "")
|
||||
if(RESINSIGHT_OCTAVE_PLUGIN_MKOCTFILE)
|
||||
get_filename_component(RESINSIGHT_OCTAVE_DIRECTORY ${RESINSIGHT_OCTAVE_PLUGIN_MKOCTFILE} DIRECTORY)
|
||||
|
||||
execute_process (COMMAND octave-config -v
|
||||
|
@ -15,7 +15,7 @@ public:
|
||||
// Xml Serializing
|
||||
public:
|
||||
virtual void readFieldData(QXmlStreamReader& xmlStream, PdmObjectFactory* objectFactory);
|
||||
virtual void writeFieldData(QXmlStreamWriter& xmlStream);
|
||||
virtual void writeFieldData(QXmlStreamWriter& xmlStream) const;
|
||||
private:
|
||||
FieldType* m_field;
|
||||
};
|
||||
@ -39,7 +39,7 @@ public:
|
||||
// Xml Serializing
|
||||
public:
|
||||
virtual void readFieldData(QXmlStreamReader& xmlStream, PdmObjectFactory* objectFactory);
|
||||
virtual void writeFieldData(QXmlStreamWriter& xmlStream);
|
||||
virtual void writeFieldData(QXmlStreamWriter& xmlStream) const;
|
||||
virtual void resolveReferences();
|
||||
|
||||
private:
|
||||
@ -68,7 +68,7 @@ public:
|
||||
// Xml Serializing
|
||||
public:
|
||||
virtual void readFieldData(QXmlStreamReader& xmlStream, PdmObjectFactory* objectFactory);
|
||||
virtual void writeFieldData(QXmlStreamWriter& xmlStream);
|
||||
virtual void writeFieldData(QXmlStreamWriter& xmlStream) const;
|
||||
virtual void resolveReferences();
|
||||
|
||||
private:
|
||||
@ -92,7 +92,7 @@ public:
|
||||
// Xml Serializing
|
||||
public:
|
||||
virtual void readFieldData(QXmlStreamReader& xmlStream, PdmObjectFactory* objectFactory);
|
||||
virtual void writeFieldData(QXmlStreamWriter& xmlStream);
|
||||
virtual void writeFieldData(QXmlStreamWriter& xmlStream) const;
|
||||
private:
|
||||
FieldType* m_field;
|
||||
};
|
||||
@ -110,7 +110,7 @@ public:
|
||||
// Xml Serializing
|
||||
public:
|
||||
virtual void readFieldData(QXmlStreamReader& xmlStream, PdmObjectFactory* objectFactory);
|
||||
virtual void writeFieldData(QXmlStreamWriter& xmlStream);
|
||||
virtual void writeFieldData(QXmlStreamWriter& xmlStream) const;
|
||||
private:
|
||||
FieldType* m_field;
|
||||
};
|
||||
|
@ -30,7 +30,7 @@ template<typename FieldType >
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
template<typename FieldType >
|
||||
void caf::PdmFieldXmlCap<FieldType>::writeFieldData(QXmlStreamWriter& xmlStream)
|
||||
void caf::PdmFieldXmlCap<FieldType>::writeFieldData(QXmlStreamWriter& xmlStream) const
|
||||
{
|
||||
this->assertValid();
|
||||
PdmFieldWriter<typename FieldType::FieldDataType>::writeFieldData(m_field->value(), xmlStream);
|
||||
@ -79,7 +79,7 @@ template<typename FieldType >
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
template<typename DataType >
|
||||
void caf::PdmFieldXmlCap< caf::PdmPtrField<DataType*> >::writeFieldData(QXmlStreamWriter& xmlStream)
|
||||
void caf::PdmFieldXmlCap< caf::PdmPtrField<DataType*> >::writeFieldData(QXmlStreamWriter& xmlStream) const
|
||||
{
|
||||
this->assertValid();
|
||||
|
||||
@ -142,7 +142,7 @@ template<typename FieldType >
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
template<typename DataType >
|
||||
void caf::PdmFieldXmlCap< caf::PdmPtrArrayField<DataType*> >::writeFieldData(QXmlStreamWriter& xmlStream)
|
||||
void caf::PdmFieldXmlCap< caf::PdmPtrArrayField<DataType*> >::writeFieldData(QXmlStreamWriter& xmlStream) const
|
||||
{
|
||||
this->assertValid();
|
||||
|
||||
@ -264,7 +264,7 @@ void caf::PdmFieldXmlCap< caf::PdmChildField<DataType*> >::readFieldData(QXmlStr
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
template<typename DataType >
|
||||
void caf::PdmFieldXmlCap< caf::PdmChildField<DataType*> >::writeFieldData(QXmlStreamWriter& xmlStream)
|
||||
void caf::PdmFieldXmlCap< caf::PdmChildField<DataType*> >::writeFieldData(QXmlStreamWriter& xmlStream) const
|
||||
{
|
||||
if (m_field->m_fieldValue.rawPtr() == NULL) return;
|
||||
|
||||
@ -287,7 +287,7 @@ void caf::PdmFieldXmlCap< caf::PdmChildField<DataType*> >::writeFieldData(QXmlSt
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
template<typename DataType>
|
||||
void caf::PdmFieldXmlCap< caf::PdmChildArrayField<DataType*> >::writeFieldData(QXmlStreamWriter& xmlStream)
|
||||
void caf::PdmFieldXmlCap< caf::PdmChildArrayField<DataType*> >::writeFieldData(QXmlStreamWriter& xmlStream) const
|
||||
{
|
||||
typename std::vector< PdmPointer<DataType> >::iterator it;
|
||||
for (it = m_field->m_pointers.begin(); it != m_field->m_pointers.end(); ++it)
|
||||
|
@ -25,17 +25,18 @@ public:
|
||||
PdmXmlFieldHandle(PdmFieldHandle* owner , bool giveOwnership);
|
||||
virtual ~PdmXmlFieldHandle() { }
|
||||
|
||||
PdmFieldHandle* fieldHandle() { return m_owner; }
|
||||
PdmFieldHandle* fieldHandle() { return m_owner; }
|
||||
const PdmFieldHandle* fieldHandle() const { return m_owner; }
|
||||
|
||||
bool isIOReadable() { return m_isIOReadable; }
|
||||
bool isIOWritable() { return m_isIOWritable; }
|
||||
void setIOWritable(bool isWritable) { m_isIOWritable = isWritable; }
|
||||
void setIOReadable(bool isReadable) { m_isIOReadable = isReadable; }
|
||||
bool isIOReadable() const { return m_isIOReadable; }
|
||||
bool isIOWritable() const { return m_isIOWritable; }
|
||||
void setIOWritable(bool isWritable) { m_isIOWritable = isWritable; }
|
||||
void setIOReadable(bool isReadable) { m_isIOReadable = isReadable; }
|
||||
|
||||
QString childClassKeyword();
|
||||
|
||||
virtual void readFieldData(QXmlStreamReader& xmlStream, PdmObjectFactory* objectFactory) = 0;
|
||||
virtual void writeFieldData(QXmlStreamWriter& xmlStream) = 0;
|
||||
virtual void writeFieldData(QXmlStreamWriter& xmlStream) const = 0;
|
||||
|
||||
virtual void resolveReferences() { };
|
||||
|
||||
|
@ -108,13 +108,13 @@ void PdmXmlObjectHandle::readFields(QXmlStreamReader& xmlStream, PdmObjectFactor
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void PdmXmlObjectHandle::writeFields(QXmlStreamWriter& xmlStream)
|
||||
void PdmXmlObjectHandle::writeFields(QXmlStreamWriter& xmlStream) const
|
||||
{
|
||||
std::vector<PdmFieldHandle*> fields;
|
||||
m_owner->fields(fields);
|
||||
for (size_t it = 0; it < fields.size(); ++it)
|
||||
{
|
||||
PdmXmlFieldHandle* field = fields[it]->xmlCapability();
|
||||
const PdmXmlFieldHandle* field = fields[it]->xmlCapability();
|
||||
if (field && field->isIOWritable())
|
||||
{
|
||||
QString keyword = field->fieldHandle()->keyword();
|
||||
@ -188,7 +188,7 @@ PdmObjectHandle* PdmXmlObjectHandle::copyByXmlSerialization(PdmObjectFactory* ob
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString PdmXmlObjectHandle::writeObjectToXmlString()
|
||||
QString PdmXmlObjectHandle::writeObjectToXmlString() const
|
||||
{
|
||||
QString xmlString;
|
||||
QXmlStreamWriter outputStream(&xmlString);
|
||||
|
@ -30,18 +30,18 @@ public:
|
||||
virtual ~PdmXmlObjectHandle() { }
|
||||
|
||||
/// The classKeyword method is overridden in subclasses by the CAF_PDM_XML_HEADER_INIT macro
|
||||
virtual QString classKeyword() = 0;
|
||||
virtual QString classKeyword() const = 0;
|
||||
|
||||
/// Convenience methods to serialize/de-serialize this particular object (with children)
|
||||
void readObjectFromXmlString(const QString& xmlString, PdmObjectFactory* objectFactory);
|
||||
QString writeObjectToXmlString();
|
||||
QString writeObjectToXmlString() const;
|
||||
static PdmObjectHandle* readUnknownObjectFromXmlString(const QString& xmlString, PdmObjectFactory* objectFactory);
|
||||
PdmObjectHandle* copyByXmlSerialization(PdmObjectFactory* objectFactory);
|
||||
|
||||
// Main XML serialization methods that is used internally by the document serialization system
|
||||
// Not supposed to be used directly.
|
||||
void readFields(QXmlStreamReader& inputStream, PdmObjectFactory* objectFactory);
|
||||
void writeFields(QXmlStreamWriter& outputStream);
|
||||
void writeFields(QXmlStreamWriter& outputStream) const;
|
||||
|
||||
/// Check if a string is a valid Xml element name
|
||||
static bool isValidXmlElementName(const QString& name);
|
||||
|
@ -22,7 +22,7 @@
|
||||
// To be renamed CAF_PDM_XML_HEADER_INIT
|
||||
#define CAF_PDM_XML_HEADER_INIT \
|
||||
public: \
|
||||
virtual QString classKeyword() { return classKeywordStatic(); } \
|
||||
virtual QString classKeyword() const { return classKeywordStatic(); } \
|
||||
static QString classKeywordStatic(); \
|
||||
\
|
||||
static bool Error_You_forgot_to_add_the_macro_CAF_PDM_XML_HEADER_INIT_and_or_CAF_PDM_XML_SOURCE_INIT_to_your_cpp_file_for_this_class()
|
||||
|
Loading…
Reference in New Issue
Block a user