mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3540 Create seperate 2d view with parallel, look down and linked views
This commit is contained in:
parent
45531865ba
commit
f80472ffa6
@ -13,6 +13,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicGeoMechPropertyFilterNewFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicGeoMechPropertyFilterNewInViewFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicGeoMechPropertyFilterNewExec.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewViewFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNew2dContourViewFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicPropertyFilterNewExec.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicRangeFilterExecImpl.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicRangeFilterInsertExec.h
|
||||
@ -91,6 +92,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicGeoMechPropertyFilterNewFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicGeoMechPropertyFilterNewInViewFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicGeoMechPropertyFilterNewExec.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewViewFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNew2dContourViewFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicRangeFilterExecImpl.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicRangeFilterInsertExec.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicRangeFilterInsertFeature.cpp
|
||||
|
99
ApplicationCode/Commands/RicNew2dContourViewFeature.cpp
Normal file
99
ApplicationCode/Commands/RicNew2dContourViewFeature.cpp
Normal file
@ -0,0 +1,99 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2018- Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RicNew2dContourViewFeature.h"
|
||||
|
||||
#include "Rim2dEclipseView.h"
|
||||
#include "Rim2dEclipseViewCollection.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimEclipseCase.h"
|
||||
#include "Rim3dView.h"
|
||||
|
||||
#include "Riu3DMainWindowTools.h"
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include <QAction>
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicNew2dContourViewFeature, "RicNew2dContourViewFeature");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicNew2dContourViewFeature::isCommandEnabled()
|
||||
{
|
||||
bool selectedView = caf::SelectionManager::instance()->selectedItemOfType<RimEclipseView>() != nullptr;
|
||||
bool selectedCase = caf::SelectionManager::instance()->selectedItemOfType<RimEclipseCase>() != nullptr;
|
||||
bool selectedMapCollection = caf::SelectionManager::instance()->selectedItemOfType<Rim2dEclipseViewCollection>();
|
||||
return selectedView || selectedCase || selectedMapCollection;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNew2dContourViewFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
RimEclipseView* reservoirView = caf::SelectionManager::instance()->selectedItemOfType<RimEclipseView>();
|
||||
RimEclipseCase* eclipseCase = caf::SelectionManager::instance()->selectedItemAncestorOfType<RimEclipseCase>();
|
||||
Rim2dEclipseView* contourMap = nullptr;
|
||||
|
||||
// Find case to insert into
|
||||
if (reservoirView)
|
||||
{
|
||||
contourMap = eclipseCase->create2dContourMapFrom3dView(reservoirView);
|
||||
}
|
||||
else if (eclipseCase)
|
||||
{
|
||||
contourMap = eclipseCase->create2dContourMap();
|
||||
}
|
||||
|
||||
if (contourMap)
|
||||
{
|
||||
// Must be run before buildViewItems, as wells are created in this function
|
||||
contourMap->loadDataAndUpdate();
|
||||
|
||||
if (eclipseCase)
|
||||
{
|
||||
eclipseCase->updateConnectedEditors();
|
||||
}
|
||||
caf::SelectionManager::instance()->setSelectedItem(contourMap);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNew2dContourViewFeature::setupActionLook(QAction* actionToSetup)
|
||||
{
|
||||
Rim2dEclipseView* contourMap = caf::SelectionManager::instance()->selectedItemOfType<Rim2dEclipseView>();
|
||||
RimEclipseView* eclipseView = caf::SelectionManager::instance()->selectedItemOfType<RimEclipseView>();
|
||||
if (contourMap)
|
||||
{
|
||||
actionToSetup->setText("Duplicate Contour Map");
|
||||
}
|
||||
else if (eclipseView)
|
||||
{
|
||||
actionToSetup->setText("New Contour Map From 3d View");
|
||||
}
|
||||
else
|
||||
{
|
||||
actionToSetup->setText("New Contour Map");
|
||||
}
|
||||
actionToSetup->setIcon(QIcon(":/3DView16x16.png"));
|
||||
}
|
36
ApplicationCode/Commands/RicNew2dContourViewFeature.h
Normal file
36
ApplicationCode/Commands/RicNew2dContourViewFeature.h
Normal file
@ -0,0 +1,36 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2015- Statoil ASA
|
||||
// Copyright (C) 2015- Ceetron Solutions AS
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicNew2dContourViewFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
protected:
|
||||
// Overrides
|
||||
bool isCommandEnabled() override;
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
};
|
@ -19,6 +19,7 @@
|
||||
|
||||
#include "RicNewViewFeature.h"
|
||||
|
||||
#include "Rim2dEclipseView.h"
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimGeoMechCase.h"
|
||||
@ -158,9 +159,12 @@ RimEclipseView* RicNewViewFeature::selectedEclipseView()
|
||||
std::vector<RimEclipseView*> selection;
|
||||
caf::SelectionManager::instance()->objectsByType(&selection);
|
||||
|
||||
if (selection.size() > 0)
|
||||
for (RimEclipseView* view : selection)
|
||||
{
|
||||
return selection[0];
|
||||
if (dynamic_cast<Rim2dEclipseView*>(view) == nullptr)
|
||||
{
|
||||
return view;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
|
@ -77,11 +77,10 @@ void RicRangeFilterNewExec::redo()
|
||||
|
||||
Riu3DMainWindowTools::selectAsCurrentItem(rangeFilter);
|
||||
|
||||
// Trigger update of view following the range filter update
|
||||
RimGridView* view = nullptr;
|
||||
m_cellRangeFilterCollection->firstAncestorOrThisOfTypeAsserted(view);
|
||||
|
||||
//Enable display of grid cells, to be able to show generated range filter
|
||||
view->showGridCells(true);
|
||||
view->rangeFiltersUpdated();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,9 @@
|
||||
#include "RicTogglePerspectiveViewFeature.h"
|
||||
|
||||
#include "RiuViewer.h"
|
||||
#include "Rim2dEclipseView.h"
|
||||
#include "Rim3dView.h"
|
||||
#include "RimGridView.h"
|
||||
#include "RiuMainWindow.h"
|
||||
#include "RiaApplication.h"
|
||||
|
||||
@ -34,7 +36,9 @@ CAF_CMD_SOURCE_INIT(RicTogglePerspectiveViewFeature, "RicTogglePerspectiveViewFe
|
||||
bool RicTogglePerspectiveViewFeature::isCommandEnabled()
|
||||
{
|
||||
this->action(); // Retrieve the action to update the looks
|
||||
return RiaApplication::instance()->activeGridView() && RiaApplication::instance()->activeReservoirView()->viewer();
|
||||
RimGridView* activeGridView = RiaApplication::instance()->activeGridView();
|
||||
Rim2dEclipseView* view2d = dynamic_cast<Rim2dEclipseView*>(activeGridView);
|
||||
return !view2d && activeGridView && RiaApplication::instance()->activeReservoirView()->viewer();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -63,7 +63,14 @@ bool RicLinkVisibleViewsFeature::isCommandEnabled()
|
||||
}
|
||||
|
||||
|
||||
if (visibleGridViews.size() >= 2 && (linkedviews.size() < visibleGridViews.size())) return true;
|
||||
if (visibleGridViews.size() >= 2 && (linkedviews.size() < visibleGridViews.size()))
|
||||
{
|
||||
std::vector<RimGridView*> views;
|
||||
findNotLinkedVisibleViews(views);
|
||||
RicLinkVisibleViewsFeatureUi testUi;
|
||||
testUi.setViews(views);
|
||||
return !testUi.masterViewCandidates().empty();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -37,8 +37,9 @@ class RicLinkVisibleViewsFeatureUi : public caf::PdmObject
|
||||
public:
|
||||
RicLinkVisibleViewsFeatureUi(void);
|
||||
|
||||
void setViews(const std::vector<RimGridView*>& allViews);
|
||||
RimGridView* masterView();
|
||||
void setViews(const std::vector<RimGridView*>& allViews);
|
||||
RimGridView* masterView();
|
||||
std::vector<RimGridView*> masterViewCandidates() const;
|
||||
|
||||
protected:
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions,
|
||||
|
@ -68,7 +68,8 @@ RivWindowEdgeAxesOverlayItem::RivWindowEdgeAxesOverlayItem(Font* font)
|
||||
m_frameColor(Color3::WHITE),
|
||||
m_lineWidth(1),
|
||||
m_font(font),
|
||||
m_isSwitchingYAxisValueSign(true)
|
||||
m_isSwitchingYAxisValueSign(true),
|
||||
m_domainAxes(XZ_AXES)
|
||||
{
|
||||
CVF_ASSERT(font);
|
||||
CVF_ASSERT(!font->isEmpty());
|
||||
@ -99,7 +100,7 @@ void RivWindowEdgeAxesOverlayItem::setDisplayCoordTransform(const caf::DisplayCo
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivWindowEdgeAxesOverlayItem::updateGeomerySizes()
|
||||
{
|
||||
String str = String::number(99999.0);
|
||||
String str = String::number(-1.999e-17);
|
||||
m_textSize = m_font->textExtent(str);
|
||||
m_pixelSpacing = 2.0f;
|
||||
m_tickLineLength = m_textSize.y() *0.3f;
|
||||
@ -137,8 +138,8 @@ void RivWindowEdgeAxesOverlayItem::updateFromCamera(const Camera* camera)
|
||||
double domainMinX = windowOrigoInDomain.x();
|
||||
double domainMaxX = windowMaxInDomain.x();
|
||||
|
||||
double domainMinY = windowOrigoInDomain.z();
|
||||
double domainMaxY = windowMaxInDomain.z();
|
||||
double domainMinY = m_domainAxes == XY_AXES ? windowOrigoInDomain.y() : windowOrigoInDomain.z();
|
||||
double domainMaxY = m_domainAxes == XY_AXES ? windowMaxInDomain.y() : windowMaxInDomain.z();
|
||||
|
||||
int xTickMaxCount = m_windowSize.x()/(2*m_textSize.x());
|
||||
int yTickMaxCount = m_windowSize.y()/(2*m_textSize.x());
|
||||
@ -156,7 +157,15 @@ void RivWindowEdgeAxesOverlayItem::updateFromCamera(const Camera* camera)
|
||||
Vec3d windowPoint;
|
||||
for (double domainX : m_domainCoordsXValues)
|
||||
{
|
||||
Vec3d displayDomainTick(domainX, 0, domainMinY);
|
||||
Vec3d displayDomainTick;
|
||||
if (m_domainAxes == XY_AXES)
|
||||
{
|
||||
displayDomainTick = Vec3d(domainX, domainMinY, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
displayDomainTick = Vec3d(domainX, 0, domainMinY);
|
||||
}
|
||||
if ( m_dispalyCoordsTransform.notNull() )
|
||||
{
|
||||
displayDomainTick = m_dispalyCoordsTransform->transformToDisplayCoord(displayDomainTick);
|
||||
@ -168,7 +177,17 @@ void RivWindowEdgeAxesOverlayItem::updateFromCamera(const Camera* camera)
|
||||
m_windowTickYValues.clear();
|
||||
for (double domainY : m_domainCoordsYValues)
|
||||
{
|
||||
Vec3d displayDomainTick(domainMinX, 0, domainY);
|
||||
Vec3d displayDomainTick;
|
||||
|
||||
if (m_domainAxes == XY_AXES)
|
||||
{
|
||||
displayDomainTick = Vec3d(domainMinX, domainY, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
displayDomainTick = Vec3d(domainMinX, 0, domainY);
|
||||
}
|
||||
|
||||
if ( m_dispalyCoordsTransform.notNull() )
|
||||
{
|
||||
displayDomainTick = m_dispalyCoordsTransform->transformToDisplayCoord(displayDomainTick);
|
||||
@ -614,3 +633,19 @@ const Color3f& RivWindowEdgeAxesOverlayItem::lineColor() const
|
||||
return m_lineColor;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivWindowEdgeAxesOverlayItem::setDomainAxes(DomainAxes axes)
|
||||
{
|
||||
m_domainAxes = axes;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivWindowEdgeAxesOverlayItem::setIsSwitchingYAxisSign(bool switchSign)
|
||||
{
|
||||
m_isSwitchingYAxisValueSign = switchSign;
|
||||
}
|
||||
|
||||
|
@ -82,6 +82,13 @@ class RivWindowEdgeAxesOverlayItem : public cvf::OverlayItem
|
||||
using TextDrawer = cvf::TextDrawer;
|
||||
using Camera = cvf::Camera;
|
||||
public:
|
||||
enum DomainAxes
|
||||
{
|
||||
XY_AXES,
|
||||
XZ_AXES
|
||||
};
|
||||
public:
|
||||
|
||||
RivWindowEdgeAxesOverlayItem(Font* font);
|
||||
~RivWindowEdgeAxesOverlayItem() override;
|
||||
|
||||
@ -93,7 +100,8 @@ public:
|
||||
void setLineColor(const Color3f& lineColor);
|
||||
const Color3f& lineColor() const;
|
||||
void setFrameColor(const Color4f& frameColor);
|
||||
|
||||
void setDomainAxes(DomainAxes axes);
|
||||
void setIsSwitchingYAxisSign(bool switchSign);
|
||||
int frameBorderWidth() { return static_cast<int>( m_frameBorderWidth); }
|
||||
int frameBorderHeight() { return static_cast<int>( m_frameBorderHeight); }
|
||||
|
||||
@ -127,6 +135,7 @@ private:
|
||||
float m_tickLineLength;
|
||||
float m_pixelSpacing;
|
||||
bool m_isSwitchingYAxisValueSign;
|
||||
DomainAxes m_domainAxes;
|
||||
|
||||
std::vector<double> m_domainCoordsXValues;
|
||||
std::vector<double> m_domainCoordsYValues;
|
||||
|
@ -118,6 +118,8 @@ ${CMAKE_CURRENT_LIST_DIR}/RimWellLogRftCurveNameConfig.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimDataSourceSteppingTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellLogCurveCommonDataSource.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/Rim2dGridProjection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/Rim2dEclipseView.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/Rim2dEclipseViewCollection.h
|
||||
)
|
||||
|
||||
|
||||
@ -240,6 +242,8 @@ ${CMAKE_CURRENT_LIST_DIR}/RimWellLogRftCurveNameConfig.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimDataSourceSteppingTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellLogCurveCommonDataSource.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/Rim2dGridProjection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/Rim2dEclipseView.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/Rim2dEclipseViewCollection.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
|
192
ApplicationCode/ProjectDataModel/Rim2dEclipseView.cpp
Normal file
192
ApplicationCode/ProjectDataModel/Rim2dEclipseView.cpp
Normal file
@ -0,0 +1,192 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2018- Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "Rim2dEclipseView.h"
|
||||
|
||||
#include "Riv2dGridProjectionPartMgr.h"
|
||||
#include "RiuViewer.h"
|
||||
|
||||
#include "Rim2dGridProjection.h"
|
||||
#include "Rim3dOverlayInfoConfig.h"
|
||||
#include "RimCellRangeFilterCollection.h"
|
||||
#include "RimEclipseCellColors.h"
|
||||
#include "RimEclipsePropertyFilterCollection.h"
|
||||
#include "RimFaultInViewCollection.h"
|
||||
#include "RimGridCollection.h"
|
||||
#include "RimSimWellInViewCollection.h"
|
||||
|
||||
#include "cafPdmUiTreeOrdering.h"
|
||||
|
||||
#include "cvfCamera.h"
|
||||
#include "cvfModelBasicList.h"
|
||||
#include "cvfPart.h"
|
||||
#include "cvfScene.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT(Rim2dEclipseView, "Rim2dEclipseView");
|
||||
|
||||
const cvf::Mat4d defaultViewMatrix(1, 0, 0, 0,
|
||||
0, 1, 0, 0,
|
||||
0, 0, 1, 1000,
|
||||
0, 0, 0, 1);
|
||||
|
||||
Rim2dEclipseView::Rim2dEclipseView()
|
||||
{
|
||||
CAF_PDM_InitObject("2d Contour Map", ":/3DView16x16.png", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_2dGridProjection, "Grid2dProjection", "2d Grid Projection", "", "", "");
|
||||
m_2dGridProjection = new Rim2dGridProjection();
|
||||
|
||||
m_overlayInfoConfig->setIsActive(false);
|
||||
m_gridCollection->setActive(false); // This is also not added to the tree view, so cannot be enabled.
|
||||
wellCollection()->isActive = false;
|
||||
faultCollection()->showFaultCollection = false;
|
||||
|
||||
|
||||
m_grid2dProjectionPartMgr = new Riv2dGridProjectionPartMgr(grid2dProjection());
|
||||
|
||||
((RiuViewerToViewInterface*)this)->setCameraPosition(defaultViewMatrix);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
Rim2dGridProjection* Rim2dEclipseView::grid2dProjection() const
|
||||
{
|
||||
return m_2dGridProjection().p();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Rim2dEclipseView::initAfterRead()
|
||||
{
|
||||
m_gridCollection->setActive(false); // This is also not added to the tree view, so cannot be enabled.
|
||||
disablePerspectiveProjectionField();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Rim2dEclipseView::createDisplayModel()
|
||||
{
|
||||
RimEclipseView::createDisplayModel();
|
||||
|
||||
if (this->viewer()->mainCamera()->viewMatrix() == defaultViewMatrix)
|
||||
{
|
||||
this->zoomAll();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Rim2dEclipseView::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/)
|
||||
{
|
||||
uiTreeOrdering.add(m_overlayInfoConfig());
|
||||
uiTreeOrdering.add(m_2dGridProjection);
|
||||
uiTreeOrdering.add(cellResult());
|
||||
uiTreeOrdering.add(wellCollection());
|
||||
uiTreeOrdering.add(faultCollection());
|
||||
uiTreeOrdering.add(m_rangeFilterCollection());
|
||||
uiTreeOrdering.add(eclipsePropertyFilterCollection());
|
||||
|
||||
uiTreeOrdering.skipRemainingChildren();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Rim2dEclipseView::updateCurrentTimeStep()
|
||||
{
|
||||
RimEclipseView::updateCurrentTimeStep();
|
||||
if (m_2dGridProjection->isChecked())
|
||||
{
|
||||
m_2dGridProjection->generateResults();
|
||||
}
|
||||
|
||||
cvf::Scene* frameScene = m_viewer->frame(m_currentTimeStep);
|
||||
|
||||
if (m_2dGridProjection->isChecked())
|
||||
{
|
||||
cvf::String name = "Grid2dProjection";
|
||||
this->removeModelByName(frameScene, name);
|
||||
|
||||
cvf::ref<cvf::ModelBasicList> grid2dProjectionModelBasicList = new cvf::ModelBasicList;
|
||||
grid2dProjectionModelBasicList->setName(name);
|
||||
|
||||
cvf::ref<caf::DisplayCoordTransform> transForm = this->displayCoordTransform();
|
||||
|
||||
m_grid2dProjectionPartMgr->appendProjectionToModel(grid2dProjectionModelBasicList.p(), transForm.p());
|
||||
grid2dProjectionModelBasicList->updateBoundingBoxesRecursive();
|
||||
frameScene->addModel(grid2dProjectionModelBasicList.p());
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Rim2dEclipseView::updateLegends()
|
||||
{
|
||||
if (m_viewer)
|
||||
{
|
||||
m_viewer->removeAllColorLegends();
|
||||
}
|
||||
|
||||
if (m_2dGridProjection && m_2dGridProjection->isChecked())
|
||||
{
|
||||
RimRegularLegendConfig* projectionLegend = m_2dGridProjection->legendConfig();
|
||||
if (projectionLegend && projectionLegend->showLegend())
|
||||
{
|
||||
m_2dGridProjection->updateLegend();
|
||||
m_viewer->addColorLegendToBottomLeftCorner(projectionLegend->titledOverlayFrame());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Rim2dEclipseView::updateViewWidgetAfterCreation()
|
||||
{
|
||||
m_viewer->showAxisCross(false);
|
||||
m_viewer->showEdgeTickMarksXY(true);
|
||||
m_viewer->enableNavigationRotation(false);
|
||||
|
||||
Rim3dView::updateViewWidgetAfterCreation();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Rim2dEclipseView::updateViewFollowingRangeFilterUpdates()
|
||||
{
|
||||
m_2dGridProjection->setCheckState(true);
|
||||
scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Rim2dEclipseView::onLoadDataAndUpdate()
|
||||
{
|
||||
RimEclipseView::onLoadDataAndUpdate();
|
||||
if (m_viewer)
|
||||
{
|
||||
m_viewer->setView(cvf::Vec3d(0, 0, -1), cvf::Vec3d(0, 1, 0));
|
||||
}
|
||||
}
|
47
ApplicationCode/ProjectDataModel/Rim2dEclipseView.h
Normal file
47
ApplicationCode/ProjectDataModel/Rim2dEclipseView.h
Normal file
@ -0,0 +1,47 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2018- Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RimEclipseView.h"
|
||||
|
||||
class Riv2dGridProjectionPartMgr;
|
||||
|
||||
class Rim2dEclipseView : public RimEclipseView
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
public:
|
||||
Rim2dEclipseView();
|
||||
Rim2dGridProjection* grid2dProjection() const;
|
||||
|
||||
protected:
|
||||
void initAfterRead() override;
|
||||
void createDisplayModel() override;
|
||||
void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override;
|
||||
void updateCurrentTimeStep() override;
|
||||
void updateLegends() override;
|
||||
void updateViewWidgetAfterCreation() override;
|
||||
void updateViewFollowingRangeFilterUpdates() override;
|
||||
void onLoadDataAndUpdate() override;
|
||||
|
||||
private:
|
||||
cvf::ref<Riv2dGridProjectionPartMgr> m_grid2dProjectionPartMgr;
|
||||
caf::PdmChildField<Rim2dGridProjection*> m_2dGridProjection;
|
||||
|
||||
};
|
||||
|
@ -0,0 +1,42 @@
|
||||
#include "Rim2dEclipseViewCollection.h"
|
||||
|
||||
#include "Rim2dEclipseView.h"
|
||||
#include "RimCase.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT(Rim2dEclipseViewCollection, "Eclipse2dViewCollection");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
Rim2dEclipseViewCollection::Rim2dEclipseViewCollection()
|
||||
{
|
||||
CAF_PDM_InitObject("2D Contour Maps", ":/CrossSection16x16.png", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_2dEclipseViews, "EclipseViews", "Contour Maps", ":/CrossSection16x16.png", "", "");
|
||||
m_2dEclipseViews.uiCapability()->setUiTreeHidden(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
Rim2dEclipseViewCollection::~Rim2dEclipseViewCollection()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<Rim2dEclipseView*> Rim2dEclipseViewCollection::views()
|
||||
{
|
||||
return m_2dEclipseViews.childObjects();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Rim2dEclipseViewCollection::push_back(Rim2dEclipseView* contourMap)
|
||||
{
|
||||
m_2dEclipseViews.push_back(contourMap);
|
||||
}
|
||||
|
@ -0,0 +1,41 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2018- Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmChildArrayField.h"
|
||||
|
||||
class Rim2dEclipseView;
|
||||
|
||||
class Rim2dEclipseViewCollection : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
public:
|
||||
Rim2dEclipseViewCollection();
|
||||
~Rim2dEclipseViewCollection() override;
|
||||
|
||||
std::vector<Rim2dEclipseView*> views();
|
||||
void push_back(Rim2dEclipseView* contourMap);
|
||||
private:
|
||||
caf::PdmChildArrayField<Rim2dEclipseView*> m_2dEclipseViews;
|
||||
};
|
||||
|
||||
|
||||
|
@ -58,7 +58,6 @@ Rim2dGridProjection::Rim2dGridProjection()
|
||||
|
||||
setName("2d Grid Projection");
|
||||
nameField()->uiCapability()->setUiReadOnly(true);
|
||||
setCheckState(false); // Default is off
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -134,13 +133,27 @@ void Rim2dGridProjection::generateResults()
|
||||
{
|
||||
generateGridMapping();
|
||||
int nVertices = vertexCount();
|
||||
m_aggregatedResults.resize(nVertices);
|
||||
m_aggregatedResults.resize(nVertices, std::numeric_limits<double>::infinity());
|
||||
|
||||
#pragma omp parallel for
|
||||
for (int index = 0; index < nVertices; ++index)
|
||||
RimEclipseView* view = nullptr;
|
||||
firstAncestorOrThisOfTypeAsserted(view);
|
||||
int timeStep = view->currentTimeStep();
|
||||
|
||||
RimEclipseResultCase* eclipseCase = nullptr;
|
||||
firstAncestorOrThisOfTypeAsserted(eclipseCase);
|
||||
RimEclipseCellColors* cellColors = view->cellResult();
|
||||
|
||||
m_resultAccessor = RigResultAccessorFactory::createFromResultDefinition(eclipseCase->eclipseCaseData(), 0, timeStep, cellColors);
|
||||
CVF_ASSERT(m_resultAccessor.notNull());
|
||||
|
||||
if (!cellColors->isTernarySaturationSelected())
|
||||
{
|
||||
cvf::Vec2ui ij = ijFromGridIndex(index);
|
||||
m_aggregatedResults[index] = value(ij.x(), ij.y());
|
||||
#pragma omp parallel for
|
||||
for (int index = 0; index < nVertices; ++index)
|
||||
{
|
||||
cvf::Vec2ui ij = ijFromGridIndex(index);
|
||||
m_aggregatedResults[index] = value(ij.x(), ij.y());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -197,7 +210,7 @@ void Rim2dGridProjection::updateDefaultSampleSpacingFromGrid()
|
||||
{
|
||||
if (m_sampleSpacing < 0.0)
|
||||
{
|
||||
m_sampleSpacing = mainGrid()->characteristicIJCellSize();
|
||||
m_sampleSpacing = mainGrid()->characteristicIJCellSize() * 0.5;
|
||||
}
|
||||
}
|
||||
|
||||
@ -206,24 +219,6 @@ void Rim2dGridProjection::updateDefaultSampleSpacingFromGrid()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double Rim2dGridProjection::value(uint i, uint j) const
|
||||
{
|
||||
RimEclipseView* view = nullptr;
|
||||
firstAncestorOrThisOfTypeAsserted(view);
|
||||
int timeStep = view->currentTimeStep();
|
||||
|
||||
RimEclipseResultCase* eclipseCase = nullptr;
|
||||
firstAncestorOrThisOfTypeAsserted(eclipseCase);
|
||||
RimEclipseCellColors* cellColors = view->cellResult();
|
||||
|
||||
if (cellColors->isTernarySaturationSelected())
|
||||
{
|
||||
return std::numeric_limits<double>::infinity();
|
||||
}
|
||||
|
||||
cvf::ref<RigResultAccessor> resultAccessor =
|
||||
RigResultAccessorFactory::createFromResultDefinition(eclipseCase->eclipseCaseData(), 0, timeStep, cellColors);
|
||||
|
||||
CVF_ASSERT(resultAccessor.notNull());
|
||||
|
||||
const std::vector<std::pair<size_t, float>>& matchingCells = cellsAtPos2d(i, j);
|
||||
if (!matchingCells.empty())
|
||||
{
|
||||
@ -235,7 +230,7 @@ double Rim2dGridProjection::value(uint i, uint j) const
|
||||
for (auto cellIdxAndWeight : matchingCells)
|
||||
{
|
||||
size_t cellIdx = cellIdxAndWeight.first;
|
||||
double cellValue = resultAccessor->cellScalarGlobIdx(cellIdx);
|
||||
double cellValue = m_resultAccessor->cellScalarGlobIdx(cellIdx);
|
||||
calculator.addValueAndWeight(cellValue, cellIdxAndWeight.second);
|
||||
}
|
||||
return calculator.weightedMean();
|
||||
@ -246,7 +241,7 @@ double Rim2dGridProjection::value(uint i, uint j) const
|
||||
for (auto cellIdxAndWeight : matchingCells)
|
||||
{
|
||||
size_t cellIdx = cellIdxAndWeight.first;
|
||||
double cellValue = resultAccessor->cellScalarGlobIdx(cellIdx);
|
||||
double cellValue = m_resultAccessor->cellScalarGlobIdx(cellIdx);
|
||||
maxValue = std::max(maxValue, cellValue);
|
||||
}
|
||||
return maxValue;
|
||||
@ -257,7 +252,7 @@ double Rim2dGridProjection::value(uint i, uint j) const
|
||||
for (auto cellIdxAndWeight : matchingCells)
|
||||
{
|
||||
size_t cellIdx = cellIdxAndWeight.first;
|
||||
double cellValue = resultAccessor->cellScalarGlobIdx(cellIdx);
|
||||
double cellValue = m_resultAccessor->cellScalarGlobIdx(cellIdx);
|
||||
minValue = std::min(minValue, cellValue);
|
||||
}
|
||||
return minValue;
|
||||
@ -324,8 +319,10 @@ void Rim2dGridProjection::calculateCellRangeVisibility()
|
||||
const RigMainGrid* grid = mainGrid();
|
||||
m_cellVisibility = new cvf::UByteArray(grid->cellCount());
|
||||
|
||||
std::vector<RimCellRangeFilterCollection*> rangeFilterCollections;
|
||||
eclipseCase()->descendantsIncludingThisOfType(rangeFilterCollections);
|
||||
RimEclipseView* view = nullptr;
|
||||
firstAncestorOrThisOfTypeAsserted(view);
|
||||
|
||||
RimCellRangeFilterCollection* rangeFilterCollection = view->rangeFilterCollection();
|
||||
|
||||
const RigActiveCellInfo* activeCellInfo = eclipseCase()->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL);
|
||||
|
||||
@ -335,17 +332,30 @@ void Rim2dGridProjection::calculateCellRangeVisibility()
|
||||
(*m_cellVisibility)[cellIndex] = activeCellInfo->isActive(cellIndex);
|
||||
}
|
||||
|
||||
if (rangeFilterCollections.front()->hasActiveFilters())
|
||||
if (rangeFilterCollection && rangeFilterCollection->isActive())
|
||||
{
|
||||
cvf::CellRangeFilter cellRangeFilter;
|
||||
rangeFilterCollections.front()->compoundCellRangeFilter(&cellRangeFilter, grid->gridIndex());
|
||||
rangeFilterCollection->compoundCellRangeFilter(&cellRangeFilter, grid->gridIndex());
|
||||
|
||||
#pragma omp parallel for
|
||||
for (int cellIndex = 0; cellIndex < static_cast<int>(grid->cellCount()); ++cellIndex)
|
||||
if (cellRangeFilter.hasIncludeRanges())
|
||||
{
|
||||
size_t i, j, k;
|
||||
grid->ijkFromCellIndex(cellIndex, &i, &j, &k);
|
||||
(*m_cellVisibility)[cellIndex] = (*m_cellVisibility)[cellIndex] && cellRangeFilter.isCellVisible(i, j, k, false);
|
||||
#pragma omp parallel for
|
||||
for (int cellIndex = 0; cellIndex < static_cast<int>(grid->cellCount()); ++cellIndex)
|
||||
{
|
||||
size_t i, j, k;
|
||||
grid->ijkFromCellIndex(cellIndex, &i, &j, &k);
|
||||
(*m_cellVisibility)[cellIndex] = (*m_cellVisibility)[cellIndex] && cellRangeFilter.isCellVisible(i, j, k, false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
#pragma omp parallel for
|
||||
for (int cellIndex = 0; cellIndex < static_cast<int>(grid->cellCount()); ++cellIndex)
|
||||
{
|
||||
size_t i, j, k;
|
||||
grid->ijkFromCellIndex(cellIndex, &i, &j, &k);
|
||||
(*m_cellVisibility)[cellIndex] = (*m_cellVisibility)[cellIndex] && !cellRangeFilter.isCellExcluded(i, j, k, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -391,9 +401,8 @@ std::vector<std::pair<size_t, float>> Rim2dGridProjection::visibleCellsAndWeight
|
||||
std::vector<std::pair<size_t, float>> matchingVisibleCellsAndWeight;
|
||||
|
||||
cvf::Vec3d hexCorners[8];
|
||||
for (int i = 0; i < allCellIndices.size(); ++i)
|
||||
for (size_t globalCellIdx : allCellIndices)
|
||||
{
|
||||
size_t globalCellIdx = allCellIndices[i];
|
||||
if ((*m_cellVisibility)[globalCellIdx])
|
||||
{
|
||||
size_t localCellIdx = 0u;
|
||||
@ -499,7 +508,7 @@ void Rim2dGridProjection::defineEditorAttribute(const caf::PdmFieldHandle* field
|
||||
if (myAttr)
|
||||
{
|
||||
double characteristicSize = mainGrid()->characteristicIJCellSize();
|
||||
myAttr->m_minimum = 0.25 * characteristicSize;
|
||||
myAttr->m_minimum = 0.2 * characteristicSize;
|
||||
myAttr->m_maximum = 2.0 * characteristicSize;
|
||||
}
|
||||
}
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include "cvfVector2.h"
|
||||
|
||||
class RigMainGrid;
|
||||
class RigResultAccessor;
|
||||
class RimEclipseResultCase;
|
||||
|
||||
//==================================================================================================
|
||||
@ -93,5 +94,5 @@ protected:
|
||||
std::vector<double> m_aggregatedResults;
|
||||
std::vector<std::vector<std::pair<size_t, float>>> m_projected3dGridIndices;
|
||||
|
||||
|
||||
cvf::ref<RigResultAccessor> m_resultAccessor;
|
||||
};
|
||||
|
@ -51,7 +51,7 @@
|
||||
|
||||
CAF_PDM_SOURCE_INIT(Rim2dIntersectionView, "Intersection2dView");
|
||||
|
||||
const cvf::Mat4d defaultIntersectinoViewMatrix(1, 0, 0, 0,
|
||||
const cvf::Mat4d defaultViewMatrix(1, 0, 0, 0,
|
||||
0, 0, 1, 0,
|
||||
0, -1, 0, 1000,
|
||||
0, 0, 0, 1);
|
||||
@ -86,7 +86,7 @@ Rim2dIntersectionView::Rim2dIntersectionView(void)
|
||||
|
||||
hasUserRequestedAnimation = true;
|
||||
|
||||
((RiuViewerToViewInterface*)this)->setCameraPosition(defaultIntersectinoViewMatrix );
|
||||
((RiuViewerToViewInterface*)this)->setCameraPosition(defaultViewMatrix );
|
||||
|
||||
disableGridBoxField();
|
||||
disablePerspectiveProjectionField();
|
||||
@ -513,7 +513,7 @@ void Rim2dIntersectionView::createDisplayModel()
|
||||
updateCurrentTimeStep();
|
||||
}
|
||||
|
||||
if ( this->viewer()->mainCamera()->viewMatrix() == defaultIntersectinoViewMatrix )
|
||||
if ( this->viewer()->mainCamera()->viewMatrix() == defaultViewMatrix )
|
||||
{
|
||||
this->zoomAll();
|
||||
}
|
||||
@ -663,7 +663,7 @@ void Rim2dIntersectionView::resetLegendsInViewer()
|
||||
m_viewer->showAnimationProgress(true);
|
||||
m_viewer->showHistogram(false);
|
||||
m_viewer->showInfoText(false);
|
||||
m_viewer->showEdgeTickMarks(true);
|
||||
m_viewer->showEdgeTickMarksXZ(true);
|
||||
|
||||
m_viewer->setMainScene(new cvf::Scene());
|
||||
m_viewer->enableNavigationRotation(false);
|
||||
|
@ -263,6 +263,14 @@ bool Rim3dOverlayInfoConfig::isActive() const
|
||||
return m_active;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Rim3dOverlayInfoConfig::setIsActive(bool active)
|
||||
{
|
||||
m_active = active;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -83,6 +83,7 @@ public:
|
||||
bool showCaseInfo() const;
|
||||
bool showResultInfo() const;
|
||||
bool isActive() const;
|
||||
void setIsActive(bool active);
|
||||
|
||||
enum StatisticsTimeRangeType
|
||||
{
|
||||
|
@ -917,6 +917,15 @@ void Rim3dView::disablePerspectiveProjectionField()
|
||||
isPerspectiveView.xmlCapability()->setIOWritable(false);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Rim3dView::enablePerspectiveProjectionField()
|
||||
{
|
||||
isPerspectiveView.uiCapability()->setUiHidden(false);
|
||||
isPerspectiveView.xmlCapability()->setIOWritable(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -148,6 +148,7 @@ protected:
|
||||
virtual void setDefaultView();
|
||||
void disableGridBoxField();
|
||||
void disablePerspectiveProjectionField();
|
||||
void enablePerspectiveProjectionField();
|
||||
cvf::Mat4d cameraPosition() const;
|
||||
cvf::Vec3d cameraPointOfInterest() const;
|
||||
|
||||
@ -205,18 +206,17 @@ private:
|
||||
protected:
|
||||
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
|
||||
virtual void updateViewWidgetAfterCreation() override;
|
||||
|
||||
private:
|
||||
// Overridden ViewWindow methods:
|
||||
|
||||
QWidget* createViewWidget(QWidget* mainWindowParent) override;
|
||||
void updateViewWidgetAfterCreation() override;
|
||||
void updateMdiWindowTitle() override;
|
||||
void deleteViewWidget() override;
|
||||
QWidget* viewWidget() override;
|
||||
|
||||
// Implementation of RiuViewerToViewInterface
|
||||
|
||||
void setCameraPosition(const cvf::Mat4d& cameraPosition) override { m_cameraPosition = cameraPosition; }
|
||||
void setCameraPointOfInterest(const cvf::Vec3d& cameraPointOfInterest) override { m_cameraPointOfInterest = cameraPointOfInterest;}
|
||||
QString timeStepName(int frameIdx) const override;
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "Rim2dEclipseViewCollection.h"
|
||||
#include "Rim3dOverlayInfoConfig.h"
|
||||
#include "Rim3dWellLogCurveCollection.h"
|
||||
#include "Rim3dWellLogExtractionCurve.h"
|
||||
@ -155,10 +156,15 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
|
||||
menuBuilder << "RicPasteEclipseViewsFeature";
|
||||
menuBuilder << "Separator";
|
||||
menuBuilder << "RicNewViewFeature";
|
||||
menuBuilder << "RicNew2dContourViewFeature";
|
||||
menuBuilder << "Separator";
|
||||
menuBuilder << "RicCopyReferencesToClipboardFeature";
|
||||
menuBuilder << "RicSaveEclipseInputVisibleCellsFeature";
|
||||
}
|
||||
else if (dynamic_cast<Rim2dEclipseViewCollection*>(uiItem))
|
||||
{
|
||||
menuBuilder << "RicNew2dContourViewFeature";
|
||||
}
|
||||
else if (dynamic_cast<RimCaseCollection*>(uiItem))
|
||||
{
|
||||
menuBuilder << "RicPasteEclipseCasesFeature";
|
||||
@ -178,6 +184,7 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
|
||||
menuBuilder << "Separator";
|
||||
|
||||
menuBuilder << "RicNewViewFeature";
|
||||
menuBuilder << "RicNew2dContourViewFeature";
|
||||
menuBuilder << "RicShowFlowCharacteristicsPlotFeature";
|
||||
menuBuilder << "RicEclipseCaseNewGroupFeature";
|
||||
menuBuilder << "Separator";
|
||||
|
@ -34,6 +34,8 @@
|
||||
#include "RigSimWellData.h"
|
||||
#include "RigVirtualPerforationTransmissibilities.h"
|
||||
|
||||
#include "Rim2dEclipseView.h"
|
||||
#include "Rim2dEclipseViewCollection.h"
|
||||
#include "Rim2dIntersectionViewCollection.h"
|
||||
#include "RimCaseCollection.h"
|
||||
#include "RimCellEdgeColors.h"
|
||||
@ -98,6 +100,10 @@ RimEclipseCase::RimEclipseCase()
|
||||
CAF_PDM_InitFieldNoDefault(&m_filesContainingFaultsSemColSeparated, "CachedFileNamesContainingFaults", "", "", "", "");
|
||||
m_filesContainingFaultsSemColSeparated.uiCapability()->setUiHidden(true);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_2dContourMapsCollection, "ContourMaps", "2d Contour Maps", "", "", "");
|
||||
m_2dContourMapsCollection = new Rim2dEclipseViewCollection;
|
||||
m_2dContourMapsCollection.uiCapability()->setUiTreeHidden(true);
|
||||
|
||||
// Obsolete fields
|
||||
CAF_PDM_InitFieldNoDefault(&m_filesContainingFaults_OBSOLETE, "FilesContainingFaults", "", "", "", "");
|
||||
m_filesContainingFaults_OBSOLETE.xmlCapability()->setIOWritable(false);
|
||||
@ -234,6 +240,11 @@ void RimEclipseCase::initAfterRead()
|
||||
|
||||
riv->setEclipseCase(this);
|
||||
}
|
||||
for (Rim2dEclipseView* contourMap : m_2dContourMapsCollection->views())
|
||||
{
|
||||
contourMap->setEclipseCase(this);
|
||||
}
|
||||
|
||||
|
||||
if (caseUserDescription().isEmpty() && !m_caseName_OBSOLETE().isEmpty())
|
||||
{
|
||||
@ -298,6 +309,66 @@ RimEclipseView* RimEclipseCase::createCopyAndAddView(const RimEclipseView* sourc
|
||||
return rimEclipseView;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
Rim2dEclipseView* RimEclipseCase::create2dContourMapFrom3dView(const RimEclipseView* sourceView)
|
||||
{
|
||||
Rim2dEclipseView* contourMap =
|
||||
dynamic_cast<Rim2dEclipseView*>(sourceView->xmlCapability()->copyAndCastByXmlSerialization(
|
||||
Rim2dEclipseView::classKeywordStatic(),
|
||||
sourceView->classKeyword(),
|
||||
caf::PdmDefaultObjectFactory::instance()));
|
||||
CVF_ASSERT(contourMap);
|
||||
|
||||
contourMap->setEclipseCase(this);
|
||||
|
||||
caf::PdmDocument::updateUiIconStateRecursively(contourMap);
|
||||
|
||||
size_t i = m_2dContourMapsCollection->views().size();
|
||||
contourMap->setName(QString("Contour Map %1").arg(i + 1));
|
||||
m_2dContourMapsCollection->push_back(contourMap);
|
||||
|
||||
// Resolve references after contour map has been inserted into Rim structures
|
||||
contourMap->resolveReferencesRecursively();
|
||||
contourMap->initAfterReadRecursively();
|
||||
|
||||
return contourMap;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
Rim2dEclipseView* RimEclipseCase::create2dContourMap()
|
||||
{
|
||||
Rim2dEclipseView* contourMap = new Rim2dEclipseView();
|
||||
contourMap->setEclipseCase(this);
|
||||
|
||||
// Set default values
|
||||
{
|
||||
contourMap->cellResult()->setResultType(RiaDefines::DYNAMIC_NATIVE);
|
||||
|
||||
if (RiaApplication::instance()->preferences()->loadAndShowSoil)
|
||||
{
|
||||
contourMap->cellResult()->setResultVariable("SOIL");
|
||||
}
|
||||
|
||||
contourMap->hasUserRequestedAnimation = true;
|
||||
|
||||
contourMap->cellEdgeResult()->setResultVariable("MULT");
|
||||
contourMap->cellEdgeResult()->enableCellEdgeColors = false;
|
||||
contourMap->fractureColors()->setDefaultResultName();
|
||||
}
|
||||
|
||||
caf::PdmDocument::updateUiIconStateRecursively(contourMap);
|
||||
|
||||
size_t i = m_2dContourMapsCollection->views().size();
|
||||
contourMap->setName(QString("Contour Map %1").arg(i + 1));
|
||||
m_2dContourMapsCollection->push_back(contourMap);
|
||||
|
||||
return contourMap;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -504,7 +575,10 @@ void RimEclipseCase::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering
|
||||
{
|
||||
uiTreeOrdering.add(&m_2dIntersectionViewCollection);
|
||||
}
|
||||
|
||||
if (!m_2dContourMapsCollection->views().empty())
|
||||
{
|
||||
uiTreeOrdering.add(&m_2dContourMapsCollection);
|
||||
}
|
||||
uiTreeOrdering.skipRemainingChildren(true);
|
||||
}
|
||||
|
||||
@ -830,9 +904,14 @@ bool RimEclipseCase::openReserviorCase()
|
||||
std::vector<Rim3dView*> RimEclipseCase::allSpecialViews() const
|
||||
{
|
||||
std::vector<Rim3dView*> views;
|
||||
for (size_t vIdx = 0; vIdx < reservoirViews.size(); ++vIdx)
|
||||
for (RimEclipseView* view : reservoirViews)
|
||||
{
|
||||
views.push_back(reservoirViews[vIdx]);
|
||||
views.push_back(view);
|
||||
}
|
||||
|
||||
for (Rim2dEclipseView* view : m_2dContourMapsCollection->views())
|
||||
{
|
||||
views.push_back(view);
|
||||
}
|
||||
|
||||
return views;
|
||||
@ -900,6 +979,14 @@ void RimEclipseCase::reloadDataAndUpdate()
|
||||
reservoirView->updateAnnotationItems();
|
||||
}
|
||||
|
||||
for (Rim2dEclipseView* contourMap : m_2dContourMapsCollection->views())
|
||||
{
|
||||
CVF_ASSERT(contourMap);
|
||||
contourMap->loadDataAndUpdate();
|
||||
contourMap->updateGridBoxData();
|
||||
contourMap->updateAnnotationItems();
|
||||
}
|
||||
|
||||
RimProject* project = RiaApplication::instance()->project();
|
||||
if (project)
|
||||
{
|
||||
|
@ -45,6 +45,8 @@ class RigMainGrid;
|
||||
class RimCaseCollection;
|
||||
class RimIdenticalGridCaseGroup;
|
||||
class RimReservoirCellResultsStorage;
|
||||
class Rim2dEclipseView;
|
||||
class Rim2dEclipseViewCollection;
|
||||
class RimEclipseView;
|
||||
class RigVirtualPerforationTransmissibilities;
|
||||
|
||||
@ -85,6 +87,8 @@ public:
|
||||
|
||||
RimEclipseView* createAndAddReservoirView();
|
||||
RimEclipseView* createCopyAndAddView(const RimEclipseView* sourceView);
|
||||
Rim2dEclipseView* create2dContourMapFrom3dView(const RimEclipseView* reservoirView);
|
||||
Rim2dEclipseView* create2dContourMap();
|
||||
|
||||
const RigVirtualPerforationTransmissibilities* computeAndGetVirtualPerforationTransmissibilities();
|
||||
|
||||
@ -111,8 +115,8 @@ public:
|
||||
|
||||
void setFormationNames(RimFormationNames* formationNames) override;
|
||||
|
||||
std::set<QString> sortedSimWellNames() const;
|
||||
|
||||
std::set<QString> sortedSimWellNames() const;
|
||||
|
||||
protected:
|
||||
void initAfterRead() override;
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
@ -137,6 +141,8 @@ private:
|
||||
caf::PdmField<QString> m_filesContainingFaultsSemColSeparated;
|
||||
caf::PdmField<bool> m_releaseResultMemory;
|
||||
|
||||
caf::PdmChildField<Rim2dEclipseViewCollection*> m_2dContourMapsCollection;
|
||||
|
||||
cvf::ref<RigEclipseCaseData> m_rigEclipseCase;
|
||||
QString m_timeStepFormatString;
|
||||
std::map<QString, cvf::Color3f> m_wellToColorMap;
|
||||
|
@ -145,7 +145,7 @@ void RimEclipsePropertyFilter::fieldChangedByUi(const caf::PdmFieldHandle* chang
|
||||
this->updateIconState();
|
||||
this->uiCapability()->updateConnectedEditors();
|
||||
|
||||
parentContainer()->updateDisplayModelNotifyManagedViews();
|
||||
parentContainer()->updateDisplayModelNotifyManagedViews(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,6 @@
|
||||
#include "RigSimWellData.h"
|
||||
#include "RigVirtualPerforationTransmissibilities.h"
|
||||
|
||||
#include "Rim2dGridProjection.h"
|
||||
#include "Rim3dOverlayInfoConfig.h"
|
||||
#include "RimCellEdgeColors.h"
|
||||
#include "RimCellRangeFilterCollection.h"
|
||||
@ -68,7 +67,6 @@
|
||||
#include "RiuSelectionManager.h"
|
||||
#include "RiuViewer.h"
|
||||
|
||||
#include "Riv2dGridProjectionPartMgr.h"
|
||||
#include "RivReservoirSimWellsPartMgr.h"
|
||||
#include "RivReservoirViewPartMgr.h"
|
||||
#include "RivSingleCellPartGenerator.h"
|
||||
@ -160,7 +158,6 @@ RimEclipseView::RimEclipseView()
|
||||
|
||||
m_reservoirGridPartManager = new RivReservoirViewPartMgr(this);
|
||||
m_simWellsPartManager = new RivReservoirSimWellsPartMgr(this);
|
||||
m_grid2dProjectionPartMgr = new Riv2dGridProjectionPartMgr(grid2dProjection());
|
||||
m_eclipseCase = nullptr;
|
||||
}
|
||||
|
||||
@ -313,7 +310,7 @@ void RimEclipseView::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c
|
||||
this->scheduleGeometryRegen(PROPERTY_FILTERED);
|
||||
|
||||
scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -566,10 +563,6 @@ void RimEclipseView::createDisplayModel()
|
||||
void RimEclipseView::updateCurrentTimeStep()
|
||||
{
|
||||
m_propertyFilterCollection()->updateFromCurrentTimeStep();
|
||||
if (m_2dGridProjection->isChecked())
|
||||
{
|
||||
m_2dGridProjection->generateResults();
|
||||
}
|
||||
|
||||
updateLegends(); // To make sure the scalar mappers are set up correctly
|
||||
|
||||
@ -783,21 +776,7 @@ void RimEclipseView::updateCurrentTimeStep()
|
||||
|
||||
simWellFracturesModelBasicList->updateBoundingBoxesRecursive();
|
||||
frameScene->addModel(simWellFracturesModelBasicList.p());
|
||||
}
|
||||
if (m_2dGridProjection->isChecked())
|
||||
{
|
||||
cvf::String name = "Grid2dProjection";
|
||||
this->removeModelByName(frameScene, name);
|
||||
|
||||
cvf::ref<cvf::ModelBasicList> grid2dProjectionModelBasicList = new cvf::ModelBasicList;
|
||||
grid2dProjectionModelBasicList->setName(name);
|
||||
|
||||
cvf::ref<caf::DisplayCoordTransform> transForm = this->displayCoordTransform();
|
||||
|
||||
m_grid2dProjectionPartMgr->appendProjectionToModel(grid2dProjectionModelBasicList.p(), transForm.p());
|
||||
grid2dProjectionModelBasicList->updateBoundingBoxesRecursive();
|
||||
frameScene->addModel(grid2dProjectionModelBasicList.p());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1141,16 +1120,6 @@ void RimEclipseView::updateLegends()
|
||||
RimRegularLegendConfig* virtLegend = m_virtualPerforationResult->legendConfig();
|
||||
m_viewer->addColorLegendToBottomLeftCorner(virtLegend->titledOverlayFrame());
|
||||
}
|
||||
|
||||
if (m_2dGridProjection && m_2dGridProjection->isChecked())
|
||||
{
|
||||
RimRegularLegendConfig* projectionLegend = m_2dGridProjection->legendConfig();
|
||||
if (projectionLegend && projectionLegend->showLegend())
|
||||
{
|
||||
m_2dGridProjection->updateLegend();
|
||||
m_viewer->addColorLegendToBottomLeftCorner(projectionLegend->titledOverlayFrame());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -1538,7 +1507,6 @@ void RimEclipseView::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering
|
||||
|
||||
uiTreeOrdering.add(m_rangeFilterCollection());
|
||||
uiTreeOrdering.add(m_propertyFilterCollection());
|
||||
uiTreeOrdering.add(m_2dGridProjection());
|
||||
uiTreeOrdering.skipRemainingChildren(true);
|
||||
}
|
||||
|
||||
@ -1743,7 +1711,11 @@ const RimEclipsePropertyFilterCollection* RimEclipseView::eclipsePropertyFilterC
|
||||
void RimEclipseView::setOverridePropertyFilterCollection(RimEclipsePropertyFilterCollection* pfc)
|
||||
{
|
||||
m_overridePropertyFilterCollection = pfc;
|
||||
|
||||
if (m_overridePropertyFilterCollection != nullptr)
|
||||
{
|
||||
m_propertyFilterCollection->isActive = m_overridePropertyFilterCollection->isActive;
|
||||
}
|
||||
uiCapability()->updateConnectedEditors();
|
||||
this->scheduleGeometryRegen(PROPERTY_FILTERED);
|
||||
this->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
|
@ -57,7 +57,6 @@ class RimStimPlanColors;
|
||||
class RimVirtualPerforationResults;
|
||||
class RiuViewer;
|
||||
class RivReservoirSimWellsPartMgr;
|
||||
class Riv2dGridProjectionPartMgr;
|
||||
class RivIntersectionPartMgr;
|
||||
class RivReservoirViewPartMgr;
|
||||
|
||||
@ -93,7 +92,7 @@ public:
|
||||
bool showMainGrid() const;
|
||||
|
||||
// Access internal objects
|
||||
const RimPropertyFilterCollection* propertyFilterCollection() const override;
|
||||
const RimPropertyFilterCollection* propertyFilterCollection() const override;
|
||||
|
||||
RimEclipsePropertyFilterCollection* eclipsePropertyFilterCollection();
|
||||
const RimEclipsePropertyFilterCollection* eclipsePropertyFilterCollection() const;
|
||||
@ -105,7 +104,7 @@ public:
|
||||
|
||||
void setEclipseCase(RimEclipseCase* reservoir);
|
||||
RimEclipseCase* eclipseCase() const;
|
||||
RimCase* ownerCase() const override;
|
||||
RimCase* ownerCase() const override;
|
||||
|
||||
RigMainGrid* mainGrid() const;
|
||||
|
||||
@ -113,7 +112,7 @@ public:
|
||||
|
||||
bool isTimeStepDependentDataVisible() const override;
|
||||
|
||||
void scheduleGeometryRegen(RivCellSetEnum geometryType) override;
|
||||
void scheduleGeometryRegen(RivCellSetEnum geometryType) override;
|
||||
void scheduleReservoirGridGeometryRegen();
|
||||
void scheduleSimWellGeometryRegen();
|
||||
void updateDisplayModelForWellResults();
|
||||
@ -122,7 +121,6 @@ public:
|
||||
|
||||
bool isVirtualConnectionFactorGeometryVisible() const;
|
||||
|
||||
|
||||
const std::vector<RivCellSetEnum>& visibleGridParts() const;
|
||||
const RivReservoirViewPartMgr* reservoirGridPartManager() const;
|
||||
RivReservoirViewPartMgr* reservoirGridPartManager();
|
||||
@ -131,42 +129,42 @@ public:
|
||||
void calculateVisibleWellCellsIncFence(cvf::UByteArray* visibleCells, RigGridBase * grid);
|
||||
|
||||
// Overridden PDM methods:
|
||||
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
void updateIconStateForFilterCollections();
|
||||
|
||||
void axisLabels(cvf::String* xLabel, cvf::String* yLabel, cvf::String* zLabel) override;
|
||||
void axisLabels(cvf::String* xLabel, cvf::String* yLabel, cvf::String* zLabel) override;
|
||||
|
||||
bool isUsingFormationNames() const override;
|
||||
bool isUsingFormationNames() const override;
|
||||
|
||||
void calculateCurrentTotalCellVisibility(cvf::UByteArray* totalVisibility, int timeStep) override;
|
||||
void calculateCurrentTotalCellVisibility(cvf::UByteArray* totalVisibility, int timeStep) override;
|
||||
|
||||
std::vector<RimLegendConfig*> legendConfigs() const override;
|
||||
virtual std::vector<RimLegendConfig*> legendConfigs() const override;
|
||||
cvf::Color4f colorFromCellCategory(RivCellSetEnum geometryType) const;
|
||||
|
||||
protected:
|
||||
void initAfterRead() override;
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override;
|
||||
void onLoadDataAndUpdate() override;
|
||||
virtual void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override;
|
||||
virtual void onLoadDataAndUpdate() override;
|
||||
|
||||
void createPartCollectionFromSelection(cvf::Collection<cvf::Part>* parts) override;
|
||||
bool showActiveCellsOnly() override;
|
||||
virtual void updateCurrentTimeStep() override;
|
||||
virtual void createDisplayModel() override;
|
||||
|
||||
private:
|
||||
void createDisplayModel() override;
|
||||
void updateDisplayModelVisibility() override;
|
||||
void updateCurrentTimeStep() override;
|
||||
|
||||
void indicesToVisibleGrids(std::vector<size_t>* gridIndices);
|
||||
void updateScaleTransform() override;
|
||||
cvf::Transform* scaleTransform() override;
|
||||
void updateScaleTransform() override;
|
||||
cvf::Transform* scaleTransform() override;
|
||||
|
||||
void updateStaticCellColors() override;
|
||||
void updateStaticCellColors() override;
|
||||
void updateStaticCellColors(RivCellSetEnum geometryType);
|
||||
|
||||
void updateLegends() override;
|
||||
virtual void updateLegends() override;
|
||||
void updateMinMaxValuesAndAddLegendToView(QString legendLabel, RimEclipseCellColors* resultColors, RigCaseCellResultsData* cellResultsData);
|
||||
void resetLegendsInViewer() override;
|
||||
void resetLegendsInViewer() override;
|
||||
void updateVirtualConnectionLegendRanges();
|
||||
|
||||
std::set<RivCellSetEnum> allVisibleFaultGeometryTypes() const;
|
||||
@ -199,7 +197,6 @@ private:
|
||||
|
||||
cvf::ref<RivReservoirViewPartMgr> m_reservoirGridPartManager;
|
||||
cvf::ref<RivReservoirSimWellsPartMgr> m_simWellsPartManager;
|
||||
cvf::ref<Riv2dGridProjectionPartMgr> m_grid2dProjectionPartMgr;
|
||||
|
||||
std::vector<RivCellSetEnum> m_visibleGridParts;
|
||||
};
|
||||
|
@ -88,7 +88,7 @@ void RimGeoMechPropertyFilter::fieldChangedByUi(const caf::PdmFieldHandle* chang
|
||||
this->updateFilterName();
|
||||
this->uiCapability()->updateConnectedEditors();
|
||||
|
||||
parentContainer()->updateDisplayModelNotifyManagedViews();
|
||||
parentContainer()->updateDisplayModelNotifyManagedViews(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -717,6 +717,8 @@ void RimGeoMechView::scheduleGeometryRegen(RivCellSetEnum geometryType)
|
||||
void RimGeoMechView::setOverridePropertyFilterCollection(RimGeoMechPropertyFilterCollection* pfc)
|
||||
{
|
||||
m_overridePropertyFilterCollection = pfc;
|
||||
m_propertyFilterCollection->isActive = m_overridePropertyFilterCollection->isActive;
|
||||
m_propertyFilterCollection.uiCapability()->updateConnectedEditors();
|
||||
|
||||
this->scheduleGeometryRegen(PROPERTY_FILTERED);
|
||||
this->scheduleCreateDisplayModelAndRedraw();
|
||||
|
@ -20,7 +20,6 @@
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "Rim2dGridProjection.h"
|
||||
#include "Rim3dOverlayInfoConfig.h"
|
||||
#include "RimCellRangeFilterCollection.h"
|
||||
#include "RimGridCollection.h"
|
||||
@ -63,9 +62,6 @@ RimGridView::RimGridView()
|
||||
m_gridCollection.uiCapability()->setUiHidden(true);
|
||||
m_gridCollection = new RimGridCollection();
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_2dGridProjection, "Grid2dProjection", "2d Grid Projection", "", "", "");
|
||||
m_2dGridProjection = new Rim2dGridProjection();
|
||||
|
||||
m_previousGridModeMeshLinesWasFaults = false;
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_overlayInfoConfig, "OverlayInfoConfig", "Info Box", "", "", "");
|
||||
@ -113,7 +109,6 @@ RimGridView::~RimGridView(void)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridView::showGridCells(bool enableGridCells)
|
||||
{
|
||||
|
||||
m_gridCollection->setActive(enableGridCells);
|
||||
|
||||
createDisplayModel();
|
||||
@ -147,6 +142,14 @@ RimIntersectionCollection* RimGridView::crossSectionCollection() const
|
||||
return m_crossSectionCollection();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridView::rangeFiltersUpdated()
|
||||
{
|
||||
updateViewFollowingRangeFilterUpdates();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -193,6 +196,13 @@ void RimGridView::setOverrideRangeFilterCollection(RimCellRangeFilterCollection*
|
||||
if (m_overrideRangeFilterCollection()) delete m_overrideRangeFilterCollection();
|
||||
|
||||
m_overrideRangeFilterCollection = rfc;
|
||||
// Maintain a link in the active-selection
|
||||
if (m_overrideRangeFilterCollection)
|
||||
{
|
||||
m_rangeFilterCollection->isActive = m_overrideRangeFilterCollection->isActive;
|
||||
m_rangeFilterCollection()->uiCapability()->updateConnectedEditors();
|
||||
}
|
||||
|
||||
this->scheduleGeometryRegen(RANGE_FILTERED);
|
||||
this->scheduleGeometryRegen(RANGE_FILTERED_INACTIVE);
|
||||
|
||||
@ -266,14 +276,6 @@ bool RimGridView::isGridVisualizationMode() const
|
||||
return this->m_gridCollection->isActive();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
Rim2dGridProjection* RimGridView::grid2dProjection() const
|
||||
{
|
||||
return m_2dGridProjection().p();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -282,6 +284,14 @@ Rim3dOverlayInfoConfig* RimGridView::overlayInfoConfig() const
|
||||
return m_overlayInfoConfig;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridView::updateViewFollowingRangeFilterUpdates()
|
||||
{
|
||||
showGridCells(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -38,7 +38,7 @@ public:
|
||||
~RimGridView(void) override;
|
||||
|
||||
void showGridCells(bool enableGridCells);
|
||||
|
||||
|
||||
Rim3dOverlayInfoConfig* overlayInfoConfig() const;
|
||||
|
||||
cvf::ref<cvf::UByteArray> currentTotalCellVisibility();
|
||||
@ -46,6 +46,8 @@ public:
|
||||
RimIntersectionCollection* crossSectionCollection() const;
|
||||
|
||||
virtual const RimPropertyFilterCollection* propertyFilterCollection() const = 0;
|
||||
|
||||
void rangeFiltersUpdated();
|
||||
RimCellRangeFilterCollection* rangeFilterCollection();
|
||||
const RimCellRangeFilterCollection* rangeFilterCollection() const;
|
||||
|
||||
@ -57,11 +59,10 @@ public:
|
||||
RimViewLinker* assosiatedViewLinker() const override;
|
||||
|
||||
|
||||
bool isGridVisualizationMode() const override;
|
||||
|
||||
Rim2dGridProjection* grid2dProjection() const;
|
||||
bool isGridVisualizationMode() const override;
|
||||
|
||||
protected:
|
||||
virtual void updateViewFollowingRangeFilterUpdates();
|
||||
void initAfterRead() override;
|
||||
void onTimeStepChanged() override;
|
||||
virtual void calculateCurrentTotalCellVisibility(cvf::UByteArray* totalVisibility, int timeStep) = 0;
|
||||
@ -75,7 +76,6 @@ protected: // Fields
|
||||
caf::PdmChildField<RimCellRangeFilterCollection*> m_rangeFilterCollection;
|
||||
caf::PdmChildField<RimCellRangeFilterCollection*> m_overrideRangeFilterCollection;
|
||||
caf::PdmChildField<RimGridCollection*> m_gridCollection;
|
||||
caf::PdmChildField<Rim2dGridProjection*> m_2dGridProjection;
|
||||
protected:
|
||||
cvf::ref<cvf::UByteArray> m_currentReservoirCellVisibility;
|
||||
|
||||
|
@ -223,7 +223,10 @@ void RimIntersectionCollection::scheduleCreateDisplayModelAndRedraw2dIntersectio
|
||||
{
|
||||
for (RimIntersection* isection: m_intersections)
|
||||
{
|
||||
isection->correspondingIntersectionView()->scheduleCreateDisplayModelAndRedraw();
|
||||
if (isection->correspondingIntersectionView())
|
||||
{
|
||||
isection->correspondingIntersectionView()->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
#include "RimPropertyFilter.h"
|
||||
|
||||
#include "RimPropertyFilterCollection.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimPropertyFilter, "PropertyFilter");
|
||||
|
||||
|
@ -39,7 +39,7 @@ protected:
|
||||
void setCategoryNames(const std::vector<QString>& categoryNames);
|
||||
void setCategoryNamesAndValues(const std::vector<std::pair<QString, int>>& categoryNamesAndValues);
|
||||
void clearCategories();
|
||||
|
||||
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;
|
||||
|
||||
protected:
|
||||
|
@ -19,7 +19,9 @@
|
||||
|
||||
#include "RimPropertyFilterCollection.h"
|
||||
#include "Rim3dView.h"
|
||||
#include "RimPropertyFilter.h"
|
||||
#include "RimViewController.h"
|
||||
#include "RimViewLinker.h"
|
||||
|
||||
CAF_PDM_XML_ABSTRACT_SOURCE_INIT(RimPropertyFilterCollection, "RimPropertyFilterCollection"); // Abstract class
|
||||
|
||||
@ -44,13 +46,24 @@ RimPropertyFilterCollection::~RimPropertyFilterCollection()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPropertyFilterCollection::updateDisplayModelNotifyManagedViews() const
|
||||
void RimPropertyFilterCollection::updateDisplayModelNotifyManagedViews(RimPropertyFilter* changedFilter) const
|
||||
{
|
||||
Rim3dView* view = nullptr;
|
||||
this->firstAncestorOrThisOfType(view);
|
||||
CVF_ASSERT(view);
|
||||
if (!view) return;
|
||||
|
||||
if (view->isMasterView())
|
||||
{
|
||||
RimViewLinker* viewLinker = view->assosiatedViewLinker();
|
||||
if (viewLinker)
|
||||
{
|
||||
// Update data for property filter
|
||||
// Update of display model is handled by view->scheduleGeometryRegen, also for managed views
|
||||
viewLinker->updatePropertyFilters(changedFilter);
|
||||
}
|
||||
}
|
||||
|
||||
view->scheduleGeometryRegen(PROPERTY_FILTERED);
|
||||
view->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
@ -64,7 +77,7 @@ void RimPropertyFilterCollection::fieldChangedByUi(const caf::PdmFieldHandle* ch
|
||||
updateIconState();
|
||||
uiCapability()->updateConnectedEditors();
|
||||
|
||||
updateDisplayModelNotifyManagedViews();
|
||||
updateDisplayModelNotifyManagedViews(nullptr);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -21,6 +21,8 @@
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmField.h"
|
||||
|
||||
class RimPropertyFilter;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
@ -41,7 +43,7 @@ public:
|
||||
|
||||
virtual void loadAndInitializePropertyFilters() = 0;
|
||||
|
||||
void updateDisplayModelNotifyManagedViews() const;
|
||||
void updateDisplayModelNotifyManagedViews(RimPropertyFilter* changedFilter) const;
|
||||
virtual void updateIconState() = 0;
|
||||
|
||||
protected:
|
||||
|
@ -714,6 +714,14 @@ bool RimRegularLegendConfig::showLegend() const
|
||||
return m_showLegend;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimRegularLegendConfig::setShowLegend(bool show)
|
||||
{
|
||||
m_showLegend = show;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -121,6 +121,7 @@ public:
|
||||
|
||||
cvf::ScalarMapper* scalarMapper() { return m_currentScalarMapper.p(); }
|
||||
bool showLegend() const;
|
||||
void setShowLegend(bool show);
|
||||
|
||||
const caf::TitledOverlayFrame* titledOverlayFrame() const override;
|
||||
caf::TitledOverlayFrame* titledOverlayFrame() override;
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include "RigGeoMechCaseData.h"
|
||||
#include "RigMainGrid.h"
|
||||
|
||||
#include "Rim2dEclipseView.h"
|
||||
#include "Rim3dView.h"
|
||||
#include "RimCase.h"
|
||||
#include "RimCellRangeFilter.h"
|
||||
@ -411,6 +412,16 @@ void RimViewController::updateOptionSensitivity()
|
||||
}
|
||||
}
|
||||
|
||||
if (isCameraControlPossible())
|
||||
{
|
||||
this->m_syncCamera.uiCapability()->setUiReadOnly(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->m_syncCamera.uiCapability()->setUiReadOnly(true);
|
||||
this->m_syncCamera = false;
|
||||
}
|
||||
|
||||
if (isPropertyFilterControlPossible())
|
||||
{
|
||||
this->m_syncPropertyFilters.uiCapability()->setUiReadOnly(false);
|
||||
@ -442,6 +453,7 @@ void RimViewController::updateOptionSensitivity()
|
||||
}
|
||||
|
||||
m_syncVisibleCells.uiCapability()->setUiReadOnly(!this->isMasterAndDepViewDifferentType());
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -460,6 +472,7 @@ void RimViewController::setManagedView(RimGridView* view)
|
||||
m_managedView = view;
|
||||
|
||||
updateOptionSensitivity();
|
||||
updateDefaultOptions();
|
||||
updateOverrides();
|
||||
updateResultColorsControl();
|
||||
updateCameraLink();
|
||||
@ -550,6 +563,16 @@ void RimViewController::updateLegendDefinitions()
|
||||
viewLinker->updateCellResult();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewController::updateDefaultOptions()
|
||||
{
|
||||
m_syncCellResult = isCellResultControlAdvisable();
|
||||
m_syncRangeFilters = isRangeFilterControlAdvisable();
|
||||
m_syncPropertyFilters = isPropertyFilterControlAdvisable();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -644,6 +667,16 @@ RimGridView* RimViewController::masterView() const
|
||||
return ownerViewLinker()->masterView();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimViewController::isCameraControlPossible() const
|
||||
{
|
||||
Rim2dEclipseView* contourMapMasterView = dynamic_cast<Rim2dEclipseView*>(masterView());
|
||||
Rim2dEclipseView* contourMapManagedView = dynamic_cast<Rim2dEclipseView*>(managedEclipseView());
|
||||
return !(contourMapMasterView || contourMapManagedView);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -844,7 +877,7 @@ bool RimViewController::isRangeFilterControlPossible() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimViewController::isRangeFilterMappingApliccable() const
|
||||
bool RimViewController::isRangeFilterMappingApplicable() const
|
||||
{
|
||||
if (!isMasterAndDepViewDifferentType()) return false;
|
||||
|
||||
@ -873,6 +906,36 @@ bool RimViewController::isRangeFilterMappingApliccable() const
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimViewController::isCellResultControlAdvisable() const
|
||||
{
|
||||
bool contourMapMasterView = dynamic_cast<Rim2dEclipseView*>(masterView()) != nullptr;
|
||||
bool contourMapManagedView = dynamic_cast<Rim2dEclipseView*>(managedEclipseView()) != nullptr;
|
||||
return !isMasterAndDepViewDifferentType() && contourMapMasterView != contourMapManagedView;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimViewController::isRangeFilterControlAdvisable() const
|
||||
{
|
||||
bool contourMapMasterView = dynamic_cast<Rim2dEclipseView*>(masterView()) != nullptr;
|
||||
bool contourMapManagedView = dynamic_cast<Rim2dEclipseView*>(managedEclipseView()) != nullptr;
|
||||
return isRangeFilterControlPossible() && contourMapMasterView != contourMapManagedView;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimViewController::isPropertyFilterControlAdvisable() const
|
||||
{
|
||||
bool contourMapMasterView = dynamic_cast<Rim2dEclipseView*>(masterView()) != nullptr;
|
||||
bool contourMapManagedView = dynamic_cast<Rim2dEclipseView*>(managedEclipseView()) != nullptr;
|
||||
return isPropertyFilterControlPossible() && contourMapMasterView != contourMapManagedView;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -963,7 +1026,7 @@ void RimViewController::updateRangeFilterOverrides(RimCellRangeFilter* changedRa
|
||||
RimCellRangeFilterCollection* overrideRangeFilterColl = dynamic_cast<RimCellRangeFilterCollection*>(objectCopy);
|
||||
|
||||
// Convert the range filter to fit in the managed view if needed
|
||||
if (isRangeFilterMappingApliccable())
|
||||
if (isRangeFilterMappingApplicable())
|
||||
{
|
||||
RimEclipseView* eclipseMasterView = dynamic_cast<RimEclipseView*>(masterView());
|
||||
RimGeoMechView* geoMasterView = dynamic_cast<RimGeoMechView*>(masterView());
|
||||
@ -1006,6 +1069,16 @@ void RimViewController::updateRangeFilterOverrides(RimCellRangeFilter* changedRa
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewController::updatePropertyFilterOverrides(RimPropertyFilter* changedPropertyFilter)
|
||||
{
|
||||
updateOverrides();
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -34,6 +34,7 @@ class RimGeoMechView;
|
||||
class RimViewLinker;
|
||||
class RigCaseToCaseCellMapper;
|
||||
class RimCellRangeFilter;
|
||||
class RimPropertyFilter;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
@ -77,7 +78,7 @@ public:
|
||||
|
||||
void updateRangeFilterOverrides(RimCellRangeFilter* changedRangeFilter);
|
||||
void applyRangeFilterCollectionByUserChoice();
|
||||
|
||||
void updatePropertyFilterOverrides(RimPropertyFilter* changedPropertyFilter);
|
||||
|
||||
protected: // Pdm overridden methods
|
||||
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
@ -94,10 +95,16 @@ private:
|
||||
void updateResultColorsControl();
|
||||
void updateLegendDefinitions();
|
||||
|
||||
void updateDefaultOptions();
|
||||
|
||||
bool isCameraControlPossible() const;
|
||||
bool isMasterAndDepViewDifferentType() const;
|
||||
bool isRangeFilterControlPossible() const;
|
||||
bool isPropertyFilterControlPossible() const;
|
||||
bool isRangeFilterMappingApliccable() const;
|
||||
bool isRangeFilterMappingApplicable() const;
|
||||
bool isCellResultControlAdvisable() const;
|
||||
bool isRangeFilterControlAdvisable() const;
|
||||
bool isPropertyFilterControlAdvisable() const;
|
||||
|
||||
RimEclipseView* managedEclipseView() const;
|
||||
RimGeoMechView* managedGeoView() const;
|
||||
|
@ -570,6 +570,17 @@ void RimViewLinker::applyRangeFilterCollectionByUserChoice()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewLinker::updatePropertyFilters(RimPropertyFilter* changedPropertyFilter)
|
||||
{
|
||||
for (RimViewController* viewLink : m_viewControllers)
|
||||
{
|
||||
viewLink->updatePropertyFilterOverrides(changedPropertyFilter);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -38,6 +38,7 @@ class RimViewController;
|
||||
class RiuViewer;
|
||||
class RimGridView;
|
||||
class RimCellRangeFilter;
|
||||
class RimPropertyFilter;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
@ -71,6 +72,8 @@ public:
|
||||
void updateRangeFilters(RimCellRangeFilter* changedRangeFilter);
|
||||
void applyRangeFilterCollectionByUserChoice();
|
||||
|
||||
void updatePropertyFilters(RimPropertyFilter* changedPropertyFilter);
|
||||
|
||||
void scheduleGeometryRegenForDepViews(RivCellSetEnum geometryType);
|
||||
void scheduleCreateDisplayModelAndRedrawForDependentViews();
|
||||
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "RiaRegressionTest.h"
|
||||
#include "RiaRegressionTestRunner.h"
|
||||
|
||||
#include "Rim2dEclipseView.h"
|
||||
#include "Rim2dIntersectionView.h"
|
||||
#include "Rim3dView.h"
|
||||
#include "RimCellEdgeColors.h"
|
||||
@ -795,6 +796,14 @@ void RiuMainWindow::setResultInfo(const QString& info) const
|
||||
m_resultInfoPanel->setInfo(info);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMainWindow::refreshViewActions()
|
||||
{
|
||||
this->slotRefreshViewActions();
|
||||
}
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
// Action slots
|
||||
@ -839,7 +848,9 @@ void RiuMainWindow::slotRefreshEditActions()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMainWindow::slotRefreshViewActions()
|
||||
{
|
||||
bool enabled = RiaApplication::instance()->activeGridView() != nullptr;
|
||||
RimGridView* gridView = RiaApplication::instance()->activeGridView();
|
||||
Rim2dEclipseView* view2d = dynamic_cast<Rim2dEclipseView*>(gridView);
|
||||
bool enabled = gridView != nullptr && view2d == nullptr;
|
||||
m_viewFromNorth->setEnabled(enabled);
|
||||
m_viewFromSouth->setEnabled(enabled);
|
||||
m_viewFromEast->setEnabled(enabled);
|
||||
@ -1543,15 +1554,20 @@ void RiuMainWindow::slotToggleFaultLabelsAction(bool showLabels)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMainWindow::refreshDrawStyleActions()
|
||||
{
|
||||
Rim3dView* view = RiaApplication::instance()->activeReservoirView();
|
||||
bool is3DView = view != nullptr;
|
||||
bool isGridView = RiaApplication::instance()->activeGridView() != nullptr;
|
||||
RimGridView* gridView = RiaApplication::instance()->activeGridView();
|
||||
Rim2dEclipseView* view2d = dynamic_cast<Rim2dEclipseView*>(gridView);
|
||||
bool is2dMap = view2d != nullptr;
|
||||
bool is3dGridView = gridView != nullptr && !is2dMap;
|
||||
|
||||
m_drawStyleLinesAction->setEnabled(is3DView);
|
||||
m_drawStyleLinesSolidAction->setEnabled(is3DView);
|
||||
m_drawStyleSurfOnlyAction->setEnabled(is3DView);
|
||||
m_drawStyleFaultLinesSolidAction->setEnabled(is3DView);
|
||||
m_disableLightingAction->setEnabled(is3DView);
|
||||
Rim3dView* view = RiaApplication::instance()->activeReservoirView();
|
||||
bool is3dView = view != nullptr && !is2dMap;
|
||||
|
||||
|
||||
m_drawStyleLinesAction->setEnabled(is3dView);
|
||||
m_drawStyleLinesSolidAction->setEnabled(is3dView);
|
||||
m_drawStyleSurfOnlyAction->setEnabled(is3dView);
|
||||
m_drawStyleFaultLinesSolidAction->setEnabled(is3dView);
|
||||
m_disableLightingAction->setEnabled(is3dView);
|
||||
|
||||
bool lightingDisabledInView = view ? view->isLightingDisabled() : false;
|
||||
|
||||
@ -1559,8 +1575,8 @@ void RiuMainWindow::refreshDrawStyleActions()
|
||||
m_disableLightingAction->setChecked(lightingDisabledInView);
|
||||
m_disableLightingAction->blockSignals(false);
|
||||
|
||||
m_drawStyleHideGridCellsAction->setEnabled(isGridView);
|
||||
if (isGridView)
|
||||
m_drawStyleHideGridCellsAction->setEnabled(is3dGridView);
|
||||
if (is3dGridView)
|
||||
{
|
||||
m_drawStyleHideGridCellsAction->blockSignals(true);
|
||||
m_drawStyleHideGridCellsAction->setChecked(!view->isGridVisualizationMode());
|
||||
@ -1570,9 +1586,9 @@ void RiuMainWindow::refreshDrawStyleActions()
|
||||
RimEclipseView* eclView = dynamic_cast<RimEclipseView*>(view);
|
||||
|
||||
bool hasEclipseView = eclView != nullptr;
|
||||
m_showWellCellsAction->setEnabled(hasEclipseView);
|
||||
m_showWellCellsAction->setEnabled(hasEclipseView && !is2dMap);
|
||||
|
||||
if (hasEclipseView)
|
||||
if (hasEclipseView && !is2dMap)
|
||||
{
|
||||
m_showWellCellsAction->blockSignals(true);
|
||||
eclView->wellCollection()->updateStateForVisibilityCheckboxes();
|
||||
|
@ -93,7 +93,8 @@ public:
|
||||
|
||||
void setResultInfo(const QString& info) const;
|
||||
|
||||
void refreshAnimationActions();
|
||||
void refreshViewActions();
|
||||
void refreshAnimationActions();
|
||||
void updateScaleValue();
|
||||
|
||||
RiuProcessMonitor* processMonitor();
|
||||
|
@ -824,14 +824,33 @@ void RiuViewer::updateGridBoxData(double scaleZ,
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuViewer::showEdgeTickMarks(bool enable)
|
||||
void RiuViewer::showEdgeTickMarksXY(bool enable)
|
||||
{
|
||||
m_mainRendering->removeOverlayItem(m_windowEdgeAxisOverlay.p());
|
||||
|
||||
if (enable)
|
||||
{
|
||||
m_windowEdgeAxisOverlay->setDomainAxes(RivWindowEdgeAxesOverlayItem::XY_AXES);
|
||||
m_windowEdgeAxisOverlay->setIsSwitchingYAxisSign(false);
|
||||
m_mainRendering->addOverlayItem(m_windowEdgeAxisOverlay.p());
|
||||
}
|
||||
|
||||
m_showWindowEdgeAxes = enable;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuViewer::showEdgeTickMarksXZ(bool enable)
|
||||
{
|
||||
m_mainRendering->removeOverlayItem(m_windowEdgeAxisOverlay.p());
|
||||
|
||||
if (enable)
|
||||
{
|
||||
m_windowEdgeAxisOverlay->setDomainAxes(RivWindowEdgeAxesOverlayItem::XZ_AXES);
|
||||
m_windowEdgeAxisOverlay->setIsSwitchingYAxisSign(true);
|
||||
m_mainRendering->addOverlayItem(m_windowEdgeAxisOverlay.p());
|
||||
}
|
||||
|
||||
|
@ -90,7 +90,8 @@ public:
|
||||
const cvf::Vec3d& displayModelOffset,
|
||||
const cvf::Color3f& backgroundColor,
|
||||
const cvf::BoundingBox& domainCoordBoundingBox);
|
||||
void showEdgeTickMarks(bool enable);
|
||||
void showEdgeTickMarksXY(bool enable);
|
||||
void showEdgeTickMarksXZ(bool enable);
|
||||
|
||||
void updateAnnotationItems();
|
||||
|
||||
|
@ -185,6 +185,29 @@ PdmObjectHandle* PdmXmlObjectHandle::copyByXmlSerialization(PdmObjectFactory* ob
|
||||
return objectCopy;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmObjectHandle* PdmXmlObjectHandle::copyAndCastByXmlSerialization(const QString& destinationClassKeyword, const QString& sourceClassKeyword, PdmObjectFactory* objectFactory)
|
||||
{
|
||||
this->setupBeforeSaveRecursively();
|
||||
|
||||
QString xmlString = this->writeObjectToXmlString();
|
||||
|
||||
PdmObjectHandle* upgradedObject = objectFactory->create(destinationClassKeyword);
|
||||
QXmlStreamReader inputStream(xmlString);
|
||||
|
||||
QXmlStreamReader::TokenType tt;
|
||||
tt = inputStream.readNext(); // Start of document
|
||||
tt = inputStream.readNext();
|
||||
QString classKeyword = inputStream.name().toString();
|
||||
CAF_ASSERT(classKeyword == sourceClassKeyword);
|
||||
|
||||
xmlObj(upgradedObject)->readFields(inputStream, objectFactory);
|
||||
|
||||
return upgradedObject;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -37,6 +37,9 @@ public:
|
||||
QString writeObjectToXmlString() const;
|
||||
static PdmObjectHandle* readUnknownObjectFromXmlString(const QString& xmlString, PdmObjectFactory* objectFactory);
|
||||
PdmObjectHandle* copyByXmlSerialization(PdmObjectFactory* objectFactory);
|
||||
PdmObjectHandle* copyAndCastByXmlSerialization(const QString& destinationClassKeyword,
|
||||
const QString& sourceClassKeyword,
|
||||
PdmObjectFactory* objectFactory);
|
||||
|
||||
// Main XML serialization methods that is used internally by the document serialization system
|
||||
// Not supposed to be used directly.
|
||||
|
Loading…
Reference in New Issue
Block a user