mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-16 10:22:15 -05:00
#3540 Create seperate 2d view with parallel, look down and linked views
This commit is contained in:
1 parent
45531865ba
commit
f80472ffa6
50 files changed
+1014
-177
No files matched your search
@@ -22,6 +22,7 @@
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaOptionItemFactory.h"
|
||||
|
||||
#include "Rim2dEclipseView.h"
|
||||
#include "RimCase.h"
|
||||
#include "RimGridView.h"
|
||||
#include "RimViewLinker.h"
|
||||
@@ -47,19 +48,21 @@ void RicLinkVisibleViewsFeatureUi::setViews(const std::vector<RimGridView*>& all
|
||||
|
||||
RimGridView* activeView = RiaApplication::instance()->activeGridView();
|
||||
|
||||
// Set Active view as master view
|
||||
for (size_t i = 0; i < allViews.size(); i++)
|
||||
std::vector<RimGridView*> masterCandidates = masterViewCandidates();
|
||||
|
||||
// Set Active view as master view if the active view isn't a contour map.
|
||||
for (size_t i = 0; i < masterCandidates.size(); i++)
|
||||
{
|
||||
if (activeView == allViews[i])
|
||||
if (activeView == masterCandidates[i])
|
||||
{
|
||||
m_masterView = allViews[i];
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback to use first view if no active view is present
|
||||
if (!m_masterView && allViews.size() > 0)
|
||||
if (!m_masterView && masterCandidates.size() > 0)
|
||||
{
|
||||
m_masterView = allViews[0];
|
||||
m_masterView = masterCandidates[0];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,6 +74,24 @@ RimGridView* RicLinkVisibleViewsFeatureUi::masterView()
|
||||
return m_masterView;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimGridView*> RicLinkVisibleViewsFeatureUi::masterViewCandidates() const
|
||||
{
|
||||
std::vector<RimGridView*> masterCandidates;
|
||||
// Set Active view as master view if the active view isn't a contour map.
|
||||
for (size_t i = 0; i < m_allViews.size(); i++)
|
||||
{
|
||||
Rim2dEclipseView* contourMap = dynamic_cast<Rim2dEclipseView*>(m_allViews[i]);
|
||||
if (contourMap == nullptr)
|
||||
{
|
||||
masterCandidates.push_back(m_allViews[i]);
|
||||
}
|
||||
}
|
||||
return masterCandidates;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -81,7 +102,7 @@ QList<caf::PdmOptionItemInfo> RicLinkVisibleViewsFeatureUi::calculateValueOption
|
||||
|
||||
if (fieldNeedingOptions == &m_masterView)
|
||||
{
|
||||
for (RimGridView* v : m_allViews)
|
||||
for (RimGridView* v : masterViewCandidates())
|
||||
{
|
||||
RiaOptionItemFactory::appendOptionItemFromViewNameAndCaseName(v, &options);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user