(#584) Linked Views: Use Range filter mapping only when ecl bbox is inside geom bbox

Set range and propfilter linking default off
This commit is contained in:
Jacob Støren 2015-10-24 11:56:15 +02:00
parent 0405584bb6
commit 658849eefc
3 changed files with 43 additions and 5 deletions

View File

@ -76,8 +76,8 @@ RimViewController::RimViewController(void)
m_syncVisibleCells.xmlCapability()->setIOWritable(false);
m_syncVisibleCells.xmlCapability()->setIOReadable(false);
CAF_PDM_InitField(&m_syncRangeFilters, "SyncRangeFilters", true, "Range Filters", "", "", "");
CAF_PDM_InitField(&m_syncPropertyFilters, "SyncPropertyFilters", true,"Property Filters", "", "", "");
CAF_PDM_InitField(&m_syncRangeFilters, "SyncRangeFilters", false, "Range Filters", "", "", "");
CAF_PDM_InitField(&m_syncPropertyFilters, "SyncPropertyFilters", false,"Property Filters", "", "", "");
}
//--------------------------------------------------------------------------------------------------
@ -729,7 +729,30 @@ bool RimViewController::isVisibleCellsOveridden()
//--------------------------------------------------------------------------------------------------
bool RimViewController::isRangeFilterControlPossible()
{
return true; //!isMasterAndDepViewDifferentType();
if (!isMasterAndDepViewDifferentType()) return true;
// Make sure the cases are in the same domain
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>(masterView());
RimGeoMechView* geomView = dynamic_cast<RimGeoMechView*>(masterView());
if (!geomView) geomView = managedGeoView();
if (!eclipseView) eclipseView = managedEclipseView();
if (eclipseView && geomView)
{
if (eclipseView->eclipseCase()->reservoirData() && geomView->geoMechCase()->geoMechData())
{
RigMainGrid* eclGrid = eclipseView->eclipseCase()->reservoirData()->mainGrid();
RigFemPart* femPart = geomView->geoMechCase()->geoMechData()->femParts()->part(0);
if (eclGrid && femPart)
{
cvf::BoundingBox fembb = femPart->boundingBox();
cvf::BoundingBox eclbb = eclGrid->boundingBox();
return fembb.contains(eclbb.min()) && fembb.contains(eclbb.max());
}
}
}
return false;
}
//--------------------------------------------------------------------------------------------------

View File

@ -477,3 +477,17 @@ void RigMainGrid::findIntersectingCells(const cvf::BoundingBox& inputBB, std::ve
m_cellSearchTree->findIntersections(inputBB, cellIndices);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::BoundingBox RigMainGrid::boundingBox() const
{
if (m_boundingBox.isValid()) return m_boundingBox;
for (size_t i = 0; i < m_nodes.size(); ++i)
{
m_boundingBox.add(m_nodes[i]);
}
return m_boundingBox;
}

View File

@ -69,7 +69,7 @@ public:
void setFlipAxis(bool flipXAxis, bool flipYAxis);
void findIntersectingCells(const cvf::BoundingBox& inputBB, std::vector<size_t>* cellIndices) const;
cvf::BoundingBox boundingBox() const;
private:
void initAllSubGridsParentGridPointer();
void initAllSubCellsMainGridCellIndex();
@ -87,7 +87,8 @@ private:
cvf::ref<RigFaultsPrCellAccumulator> m_faultsPrCellAcc;
cvf::Vec3d m_displayModelOffset;
mutable cvf::ref<cvf::BoundingBoxTree> m_cellSearchTree;
mutable cvf::ref<cvf::BoundingBoxTree> m_cellSearchTree;
mutable cvf::BoundingBox m_boundingBox;
bool m_flipXAxis;
bool m_flipYAxis;