mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Add seismic 3d view (#10472)
* Show seismic, surfaces, annotations and wellpaths in new view not requiring a grid loaded first.
This commit is contained in:
parent
5bf2c2a89d
commit
2172199999
@ -275,6 +275,11 @@
|
||||
<file>open-text-editor.svg</file>
|
||||
<file>Seismic16x16.png</file>
|
||||
<file>SeismicDelta16x16.png</file>
|
||||
<file>SeismicView16x16.png</file>
|
||||
<file>SeismicView24x24.png</file>
|
||||
<file>SeismicViews24x24.png</file>
|
||||
<file>SeismicData24x24.png</file>
|
||||
<file>SeismicSection16x16.png</file>
|
||||
<file>Fullscreen.png</file>
|
||||
<file>plot-template-standard.svg</file>
|
||||
<file>plot-template-ensemble.svg</file>
|
||||
|
BIN
ApplicationExeCode/Resources/SeismicData24x24.png
Normal file
BIN
ApplicationExeCode/Resources/SeismicData24x24.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 461 B |
BIN
ApplicationExeCode/Resources/SeismicSection16x16.png
Normal file
BIN
ApplicationExeCode/Resources/SeismicSection16x16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 705 B |
BIN
ApplicationExeCode/Resources/SeismicView16x16.png
Normal file
BIN
ApplicationExeCode/Resources/SeismicView16x16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 825 B |
BIN
ApplicationExeCode/Resources/SeismicView24x24.png
Normal file
BIN
ApplicationExeCode/Resources/SeismicView24x24.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
BIN
ApplicationExeCode/Resources/SeismicViews24x24.png
Normal file
BIN
ApplicationExeCode/Resources/SeismicViews24x24.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
@ -68,6 +68,8 @@
|
||||
#include "RimPlotWindow.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimScriptCollection.h"
|
||||
#include "RimSeismicView.h"
|
||||
#include "RimSeismicViewCollection.h"
|
||||
#include "RimSimWellInViewCollection.h"
|
||||
#include "RimStimPlanColors.h"
|
||||
#include "RimStimPlanModel.h"
|
||||
@ -669,6 +671,14 @@ bool RiaApplication::loadProject( const QString& projectFileName, ProjectLoadAct
|
||||
cas->intersectionViewCollection()->syncFromExistingIntersections( false );
|
||||
}
|
||||
|
||||
for ( RimOilField* oilField : m_project->oilFields )
|
||||
{
|
||||
for ( auto seisView : oilField->seismicViewCollection()->views() )
|
||||
{
|
||||
seisView->loadDataAndUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
// Init summary case groups
|
||||
for ( RimOilField* oilField : m_project->oilFields )
|
||||
{
|
||||
|
@ -230,7 +230,8 @@ enum class View3dContent
|
||||
GEOMECH_DATA = 0b00000010,
|
||||
FLAT_INTERSECTION = 0b00000100,
|
||||
CONTOUR = 0b00001000,
|
||||
ALL = 0b00001111
|
||||
SEISMIC = 0b00010000,
|
||||
ALL = 0b00011111
|
||||
};
|
||||
|
||||
}; // namespace RiaDefines
|
||||
|
@ -102,7 +102,7 @@ void RicTextAnnotation3dEditor::configureAndUpdateUi( const QString& uiConfigNam
|
||||
}
|
||||
|
||||
cvf::ref<caf::DisplayCoordTransform> dispXf = view->displayCoordTransform();
|
||||
double handleSize = 0.7 * view->ownerCase()->characteristicCellSize();
|
||||
double handleSize = 0.7 * view->characteristicCellSize();
|
||||
|
||||
cvf::Vec3d labelPos( textAnnot->m_labelPointXyd() );
|
||||
labelPos.z() *= -1.0;
|
||||
|
@ -8,6 +8,7 @@ set(SOURCE_GROUP_HEADER_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewWellpathSeismicSectionFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicSeismicSectionFromIntersectionFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewSeismicDifferenceFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewSeismicViewFeature.h
|
||||
)
|
||||
|
||||
set(SOURCE_GROUP_SOURCE_FILES
|
||||
@ -20,6 +21,7 @@ set(SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewWellpathSeismicSectionFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicSeismicSectionFromIntersectionFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewSeismicDifferenceFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewSeismicViewFeature.cpp
|
||||
)
|
||||
|
||||
list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES})
|
||||
|
@ -63,7 +63,7 @@ void RicImportSeismicFeature::onActionTriggered( bool isChecked )
|
||||
app->setLastUsedDialogDirectory( "SEISMIC_GRID", QFileInfo( fileName ).absolutePath() );
|
||||
|
||||
auto proj = RimProject::current();
|
||||
auto& seisColl = proj->activeOilField()->seismicCollection();
|
||||
auto& seisColl = proj->activeOilField()->seismicDataCollection();
|
||||
|
||||
if ( !seisColl ) return;
|
||||
|
||||
|
@ -37,6 +37,6 @@ void RicNewInlineSeismicSectionFeature::onActionTriggered( bool isChecked )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewInlineSeismicSectionFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setIcon( QIcon( ":/Seismic16x16.png" ) );
|
||||
actionToSetup->setIcon( QIcon( ":/SeismicSection16x16.png" ) );
|
||||
actionToSetup->setText( "New Inline Section" );
|
||||
}
|
||||
|
@ -37,6 +37,6 @@ void RicNewPolylineSeismicSectionFeature::onActionTriggered( bool isChecked )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewPolylineSeismicSectionFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setIcon( QIcon( ":/Seismic16x16.png" ) );
|
||||
actionToSetup->setIcon( QIcon( ":/SeismicSection16x16.png" ) );
|
||||
actionToSetup->setText( "New Polyline Section" );
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ bool RicNewSeismicDifferenceFeature::isCommandEnabled() const
|
||||
void RicNewSeismicDifferenceFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
auto proj = RimProject::current();
|
||||
auto& seisColl = proj->activeOilField()->seismicCollection();
|
||||
auto& seisColl = proj->activeOilField()->seismicDataCollection();
|
||||
if ( !seisColl ) return;
|
||||
|
||||
auto seismicInput = selectedSeismic();
|
||||
|
@ -0,0 +1,108 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2023 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 "RicNewSeismicViewFeature.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaSeismicDefines.h"
|
||||
|
||||
#include "RimOilField.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSeismicData.h"
|
||||
#include "RimSeismicDataCollection.h"
|
||||
#include "RimSeismicSection.h"
|
||||
#include "RimSeismicSectionCollection.h"
|
||||
#include "RimSeismicView.h"
|
||||
#include "RimSeismicViewCollection.h"
|
||||
|
||||
#include "Riu3DMainWindowTools.h"
|
||||
|
||||
#include "cafPdmUiPropertyViewDialog.h"
|
||||
#include "cafSelectionManagerTools.h"
|
||||
#include "cafUtils.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QMessageBox>
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicNewSeismicViewFeature, "RicNewSeismicViewFeature" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicNewSeismicViewFeature::isCommandEnabled() const
|
||||
{
|
||||
auto proj = RimProject::current();
|
||||
auto& seisColl = proj->activeOilField()->seismicDataCollection();
|
||||
return ( seisColl && !seisColl->isEmpty() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewSeismicViewFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
auto proj = RimProject::current();
|
||||
auto& seisViewColl = proj->activeOilField()->seismicViewCollection();
|
||||
auto& seisDataColl = proj->activeOilField()->seismicDataCollection();
|
||||
if ( !seisViewColl || !seisDataColl ) return;
|
||||
|
||||
std::vector<caf::PdmUiItem*> uiItems;
|
||||
caf::SelectionManager::instance()->selectedItems( uiItems );
|
||||
|
||||
RimSeismicData* selectedData = nullptr;
|
||||
|
||||
if ( uiItems.size() > 0 )
|
||||
{
|
||||
selectedData = dynamic_cast<RimSeismicData*>( uiItems[0] );
|
||||
}
|
||||
|
||||
if ( ( selectedData == nullptr ) && !seisDataColl->isEmpty() )
|
||||
{
|
||||
selectedData = seisDataColl->seismicData()[0];
|
||||
}
|
||||
|
||||
if ( selectedData )
|
||||
{
|
||||
auto view = seisViewColl->addView( selectedData, RiaDefines::SeismicSectionType::SS_INLINE );
|
||||
|
||||
if ( view )
|
||||
{
|
||||
seisViewColl->updateAllRequiredEditors();
|
||||
view->scheduleCreateDisplayModelAndRedraw();
|
||||
|
||||
if ( view->seismicSectionCollection()->size() > 0 )
|
||||
{
|
||||
auto section = view->seismicSectionCollection()->seismicSections()[0];
|
||||
Riu3DMainWindowTools::selectAsCurrentItem( section );
|
||||
}
|
||||
else
|
||||
{
|
||||
Riu3DMainWindowTools::selectAsCurrentItem( view );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewSeismicViewFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setIcon( QIcon( ":/SeismicView16x16.png" ) );
|
||||
actionToSetup->setText( "New Seismic View" );
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2023 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 "cafCmdFeature.h"
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicNewSeismicViewFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
protected:
|
||||
bool isCommandEnabled() const override;
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
};
|
@ -37,6 +37,6 @@ void RicNewWellpathSeismicSectionFeature::onActionTriggered( bool isChecked )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewWellpathSeismicSectionFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setIcon( QIcon( ":/Seismic16x16.png" ) );
|
||||
actionToSetup->setIcon( QIcon( ":/SeismicSection16x16.png" ) );
|
||||
actionToSetup->setText( "New Well Path Section" );
|
||||
}
|
||||
|
@ -37,6 +37,6 @@ void RicNewXlineSeismicSectionFeature::onActionTriggered( bool isChecked )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewXlineSeismicSectionFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setIcon( QIcon( ":/Seismic16x16.png" ) );
|
||||
actionToSetup->setIcon( QIcon( ":/SeismicSection16x16.png" ) );
|
||||
actionToSetup->setText( "New Xline Section" );
|
||||
}
|
||||
|
@ -37,6 +37,6 @@ void RicNewZSliceSeismicSectionFeature::onActionTriggered( bool isChecked )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewZSliceSeismicSectionFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setIcon( QIcon( ":/Seismic16x16.png" ) );
|
||||
actionToSetup->setIcon( QIcon( ":/SeismicSection16x16.png" ) );
|
||||
actionToSetup->setText( "New Depth Slice" );
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ void RicSeismicSectionFromIntersectionFeature::onActionTriggered( bool isChecked
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicSeismicSectionFromIntersectionFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setIcon( QIcon( ":/Seismic16x16.png" ) );
|
||||
actionToSetup->setIcon( QIcon( ":/SeismicSection16x16.png" ) );
|
||||
actionToSetup->setText( "Create as Seismic Section" );
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,7 @@ void RicPolylineTarget3dEditor::configureAndUpdateUi( const QString& uiConfigNam
|
||||
}
|
||||
|
||||
cvf::ref<caf::DisplayCoordTransform> dispXf = view->displayCoordTransform();
|
||||
double handleSize = 0.7 * view->ownerCase()->characteristicCellSize();
|
||||
double handleSize = 0.7 * view->characteristicCellSize();
|
||||
|
||||
m_manipulator->setOrigin( dispXf->transformToDisplayCoord( target->targetPointXYZ() ) );
|
||||
// m_manipulator->setTangent(target->tangent());
|
||||
|
@ -111,7 +111,7 @@ void RicWellTarget3dEditor::configureAndUpdateUi( const QString& uiConfigName )
|
||||
}
|
||||
|
||||
cvf::ref<caf::DisplayCoordTransform> dispXf = view->displayCoordTransform();
|
||||
double handleSize = view->ownerCase()->characteristicCellSize() * geomDef->wellTargetScalingFactor();
|
||||
double handleSize = view->characteristicCellSize() * geomDef->wellTargetScalingFactor();
|
||||
|
||||
m_manipulator->setOrigin( dispXf->transformToDisplayCoord( target->targetPointXYZ() + geomDef->anchorPointXyz() ) );
|
||||
m_manipulator->setTangent( target->tangent() );
|
||||
|
@ -173,7 +173,7 @@ double Riv3dWellLogPlanePartMgr::wellPathCenterToPlotStartOffset( Rim3dWellLogCu
|
||||
}
|
||||
else
|
||||
{
|
||||
double cellSize = m_gridView->ownerCase()->characteristicCellSize();
|
||||
double cellSize = m_gridView->characteristicCellSize();
|
||||
double wellPathOffset = std::min( m_wellPath->wellPathRadius( cellSize ), 0.1 * planeWidth() );
|
||||
return m_wellPath->wellPathRadius( cellSize ) + wellPathOffset;
|
||||
}
|
||||
@ -186,7 +186,7 @@ double Riv3dWellLogPlanePartMgr::planeWidth() const
|
||||
{
|
||||
if ( !m_gridView ) return 0;
|
||||
|
||||
double cellSize = m_gridView->ownerCase()->characteristicCellSize();
|
||||
double cellSize = m_gridView->characteristicCellSize();
|
||||
const Rim3dWellLogCurveCollection* curveCollection = m_wellPath->rim3dWellLogCurveCollection();
|
||||
return cellSize * curveCollection->planeWidthScaling();
|
||||
}
|
||||
|
@ -406,7 +406,7 @@ void RivSimWellPipesPartMgr::appendValvesGeo( const RimEclipseView*
|
||||
if ( !m_simWellInView || !m_simWellInView->isWellValvesVisible( frameIndex ) ) return;
|
||||
if ( !eclipseView || !eclipseView->ownerCase() ) return;
|
||||
|
||||
const auto characteristicCellSize = eclipseView->ownerCase()->characteristicCellSize();
|
||||
const auto characteristicCellSize = eclipseView->characteristicCellSize();
|
||||
const auto coords = pbd.m_pipeGeomGenerator->pipeCenterCoords();
|
||||
|
||||
std::set<std::pair<size_t, size_t>> resultPointWithValve;
|
||||
|
@ -173,7 +173,7 @@ void RivWellConnectionFactorPartMgr::appendDynamicGeometryPartsToModel( cvf::Mod
|
||||
|
||||
if ( !completionVizDataItems.empty() )
|
||||
{
|
||||
double characteristicCellSize = eclView->ownerCase()->characteristicCellSize();
|
||||
double characteristicCellSize = eclView->characteristicCellSize();
|
||||
|
||||
double radius = m_rimWellPath->wellPathRadius( characteristicCellSize ) * m_virtualPerforationResult->geometryScaleFactor();
|
||||
radius *= 2.0; // Enlarge the radius slightly to make the connection factor visible if geometry scale factor is
|
||||
|
@ -86,7 +86,7 @@ void RivWellDiskPartMgr::buildWellDiskParts( size_t frameIndex, const caf::Displ
|
||||
|
||||
RimSimWellInView* well = m_rimWell;
|
||||
|
||||
double characteristicCellSize = viewWithSettings()->ownerCase()->characteristicCellSize();
|
||||
double characteristicCellSize = viewWithSettings()->characteristicCellSize();
|
||||
|
||||
cvf::Vec3d whEndPos;
|
||||
cvf::Vec3d whStartPos;
|
||||
|
@ -91,7 +91,7 @@ void RivWellFracturePartMgr::appendGeometryPartsToModel( cvf::ModelBasicList* mo
|
||||
|
||||
m_visibleFracturePolygons.clear();
|
||||
|
||||
double characteristicCellSize = eclView.ownerCase()->characteristicCellSize();
|
||||
double characteristicCellSize = eclView.characteristicCellSize();
|
||||
|
||||
cvf::Collection<cvf::Part> parts;
|
||||
RimMeshFractureTemplate* stimPlanFracTemplate = dynamic_cast<RimMeshFractureTemplate*>( m_rimFracture->fractureTemplate() );
|
||||
@ -928,7 +928,7 @@ void RivWellFracturePartMgr::appendFracturePerforationLengthParts( const RimEcli
|
||||
auto displayCoordTransform = activeView.displayCoordTransform();
|
||||
if ( displayCoordTransform.isNull() ) return;
|
||||
|
||||
double characteristicCellSize = activeView.ownerCase()->characteristicCellSize();
|
||||
double characteristicCellSize = activeView.characteristicCellSize();
|
||||
double wellPathRadius = 1.0;
|
||||
|
||||
{
|
||||
|
@ -78,7 +78,7 @@ void RivWellHeadPartMgr::buildWellHeadParts( size_t frameIndex, const caf::Displ
|
||||
|
||||
RimSimWellInView* well = m_rimWell;
|
||||
|
||||
double characteristicCellSize = viewWithSettings()->ownerCase()->characteristicCellSize();
|
||||
double characteristicCellSize = viewWithSettings()->characteristicCellSize();
|
||||
|
||||
cvf::Vec3d whEndPos;
|
||||
cvf::Vec3d whStartPos;
|
||||
|
@ -49,18 +49,30 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RivSurfacePartMgr::RivSurfacePartMgr( RimSurfaceInView* surface )
|
||||
RivSurfacePartMgr::RivSurfacePartMgr( RimSurfaceInView* surface, bool nativeOnly )
|
||||
: m_surfaceInView( surface )
|
||||
, m_useNativePartsOnly( nativeOnly )
|
||||
{
|
||||
CVF_ASSERT( surface );
|
||||
|
||||
if ( !nativeOnly )
|
||||
{
|
||||
cvf::ref<RivIntersectionHexGridInterface> hexGrid = m_surfaceInView->createHexGridInterface();
|
||||
m_intersectionGenerator = new RivSurfaceIntersectionGeometryGenerator( m_surfaceInView, hexGrid.p() );
|
||||
}
|
||||
|
||||
m_intersectionFacesTextureCoords = new cvf::Vec2fArray;
|
||||
m_nativeTrianglesTextureCoords = new cvf::Vec2fArray;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RivSurfacePartMgr::isNativePartMgr() const
|
||||
{
|
||||
return m_useNativePartsOnly;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -369,8 +381,9 @@ void RivSurfacePartMgr::generatePartGeometry()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivSurfacePartMgr::generateNativePartGeometry()
|
||||
{
|
||||
auto ownerCase = m_surfaceInView->firstAncestorOrThisOfTypeAsserted<RimCase>();
|
||||
cvf::Vec3d displayModOffsett = ownerCase->displayModelOffset();
|
||||
cvf::Vec3d displayModOffset( 0, 0, 0 );
|
||||
auto ownerCase = m_surfaceInView->firstAncestorOrThisOfType<RimCase>();
|
||||
if ( ownerCase ) displayModOffset = ownerCase->displayModelOffset();
|
||||
|
||||
m_usedSurfaceData = m_surfaceInView->surface()->surfaceData();
|
||||
if ( m_usedSurfaceData.isNull() ) return;
|
||||
@ -381,7 +394,7 @@ void RivSurfacePartMgr::generateNativePartGeometry()
|
||||
cvf::ref<cvf::Vec3fArray> cvfVertices = new cvf::Vec3fArray( vertices.size() );
|
||||
for ( size_t i = 0; i < vertices.size(); ++i )
|
||||
{
|
||||
( *cvfVertices )[i] = cvf::Vec3f( vertices[i] - displayModOffsett );
|
||||
( *cvfVertices )[i] = cvf::Vec3f( vertices[i] - displayModOffset );
|
||||
}
|
||||
|
||||
const std::vector<unsigned>& triangleIndices = m_usedSurfaceData->triangleIndices();
|
||||
|
@ -41,7 +41,7 @@ class RivIntersectionGeometryGeneratorInterface;
|
||||
class RivSurfacePartMgr : public cvf::Object
|
||||
{
|
||||
public:
|
||||
explicit RivSurfacePartMgr( RimSurfaceInView* surface );
|
||||
explicit RivSurfacePartMgr( RimSurfaceInView* surface, bool nativeOnly = false );
|
||||
|
||||
void updateNativeSurfaceColors();
|
||||
void updateCellResultColor( int timeStepIndex );
|
||||
@ -53,11 +53,15 @@ public:
|
||||
|
||||
const RivIntersectionGeometryGeneratorInterface* intersectionGeometryGenerator() const;
|
||||
|
||||
bool isNativePartMgr() const;
|
||||
|
||||
private:
|
||||
void generatePartGeometry();
|
||||
|
||||
void generateNativePartGeometry();
|
||||
|
||||
bool m_useNativePartsOnly;
|
||||
|
||||
cvf::ref<RivSurfaceIntersectionGeometryGenerator> m_intersectionGenerator;
|
||||
|
||||
caf::PdmPointer<RimSurfaceInView> m_surfaceInView;
|
||||
|
@ -209,7 +209,7 @@ size_t RimAnnotationCollection::lineBasedAnnotationsCount() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimAnnotationCollection::updateViewAnnotationCollections()
|
||||
{
|
||||
auto views = gridViewsContainingAnnotations();
|
||||
auto views = viewsContainingAnnotations();
|
||||
|
||||
for ( const auto* view : views )
|
||||
{
|
||||
|
@ -115,9 +115,7 @@ void RimAnnotationCollectionBase::onAnnotationDeleted()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimAnnotationCollectionBase::scheduleRedrawOfRelevantViews()
|
||||
{
|
||||
// Todo: Do a Bounding Box check to see if this annotation actually is relevant for the view
|
||||
|
||||
auto views = gridViewsContainingAnnotations();
|
||||
auto views = viewsContainingAnnotations();
|
||||
if ( !views.empty() )
|
||||
{
|
||||
for ( auto& view : views )
|
||||
@ -130,19 +128,13 @@ void RimAnnotationCollectionBase::scheduleRedrawOfRelevantViews()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimGridView*> RimAnnotationCollectionBase::gridViewsContainingAnnotations() const
|
||||
std::vector<Rim3dView*> RimAnnotationCollectionBase::viewsContainingAnnotations() const
|
||||
{
|
||||
RimProject* project = RimProject::current();
|
||||
if ( !project ) return {};
|
||||
|
||||
std::vector<RimGridView*> views;
|
||||
std::vector<RimGridView*> visibleGridViews;
|
||||
project->allVisibleGridViews( visibleGridViews );
|
||||
|
||||
for ( auto& gridView : visibleGridViews )
|
||||
{
|
||||
views.push_back( gridView );
|
||||
}
|
||||
std::vector<Rim3dView*> views;
|
||||
project->allViews( views );
|
||||
return views;
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
||||
class QString;
|
||||
class RimTextAnnotation;
|
||||
class RimAnnotationGroupCollection;
|
||||
class RimGridView;
|
||||
class Rim3dView;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
@ -52,7 +52,7 @@ public:
|
||||
virtual void onAnnotationDeleted();
|
||||
|
||||
void scheduleRedrawOfRelevantViews();
|
||||
std::vector<RimGridView*> gridViewsContainingAnnotations() const;
|
||||
std::vector<Rim3dView*> viewsContainingAnnotations() const;
|
||||
|
||||
protected:
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
|
@ -112,9 +112,7 @@ void RimAnnotationGroupCollection::fieldChangedByUi( const caf::PdmFieldHandle*
|
||||
if ( changedField == &m_isActive )
|
||||
{
|
||||
updateUiIconFromToggleField();
|
||||
|
||||
auto coll = firstAncestorOrThisOfType<RimAnnotationCollectionBase>();
|
||||
if ( coll ) coll->scheduleRedrawOfRelevantViews();
|
||||
updateViews();
|
||||
}
|
||||
}
|
||||
|
||||
@ -125,3 +123,21 @@ caf::PdmFieldHandle* RimAnnotationGroupCollection::objectToggleField()
|
||||
{
|
||||
return &m_isActive;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimAnnotationGroupCollection::onChildDeleted( caf::PdmChildArrayFieldHandle* childArray,
|
||||
std::vector<caf::PdmObjectHandle*>& referringObjects )
|
||||
{
|
||||
updateViews();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimAnnotationGroupCollection::updateViews()
|
||||
{
|
||||
auto coll = firstAncestorOrThisOfType<RimAnnotationCollectionBase>();
|
||||
if ( coll ) coll->scheduleRedrawOfRelevantViews();
|
||||
}
|
||||
|
@ -58,6 +58,10 @@ public:
|
||||
protected:
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
caf::PdmFieldHandle* objectToggleField() override;
|
||||
void onChildDeleted( caf::PdmChildArrayFieldHandle* childArray, std::vector<caf::PdmObjectHandle*>& referringObjects ) override;
|
||||
|
||||
private:
|
||||
void updateViews();
|
||||
|
||||
protected:
|
||||
caf::PdmField<bool> m_isActive;
|
||||
|
@ -206,20 +206,6 @@ void RimGeoMechView::onLoadDataAndUpdate()
|
||||
progress.incrementProgress();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
void RimGeoMechView::onUpdateScaleTransform()
|
||||
{
|
||||
cvf::Mat4d scale = cvf::Mat4d::IDENTITY;
|
||||
scale( 2, 2 ) = scaleZ();
|
||||
|
||||
scaleTransform()->setLocalTransform( scale );
|
||||
|
||||
if ( nativeOrOverrideViewer() ) nativeOrOverrideViewer()->updateCachedValuesInScene();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -314,7 +300,7 @@ void RimGeoMechView::onCreateDisplayModel()
|
||||
cvf::BoundingBox femBBox = femParts()->boundingBox();
|
||||
|
||||
m_wellPathPipeVizModel->removeAllParts();
|
||||
addWellPathsToModel( m_wellPathPipeVizModel.p(), femBBox );
|
||||
addWellPathsToModel( m_wellPathPipeVizModel.p(), femBBox, ownerCase()->characteristicCellSize() );
|
||||
|
||||
nativeOrOverrideViewer()->addStaticModelOnce( m_wellPathPipeVizModel.p(), isUsingOverrideViewer() );
|
||||
|
||||
@ -443,7 +429,7 @@ void RimGeoMechView::onUpdateDisplayModelForCurrentTimeStep()
|
||||
wellPathModelBasicList->setName( name );
|
||||
|
||||
cvf::BoundingBox femBBox = femParts()->boundingBox();
|
||||
addDynamicWellPathsToModel( wellPathModelBasicList.p(), femBBox );
|
||||
addDynamicWellPathsToModel( wellPathModelBasicList.p(), femBBox, ownerCase()->characteristicCellSize() );
|
||||
|
||||
frameScene->addModel( wellPathModelBasicList.p() );
|
||||
}
|
||||
@ -521,22 +507,6 @@ void RimGeoMechView::setGeoMechCase( RimGeoMechCase* gmCase )
|
||||
cellFilterCollection()->setCase( gmCase );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGeoMechView::onResetLegendsInViewer()
|
||||
{
|
||||
for ( auto legendConfig : legendConfigs() )
|
||||
{
|
||||
if ( legendConfig )
|
||||
{
|
||||
legendConfig->recreateLegend();
|
||||
}
|
||||
}
|
||||
|
||||
nativeOrOverrideViewer()->removeAllColorLegends();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -133,16 +133,12 @@ protected:
|
||||
private:
|
||||
QString createAutoName() const override;
|
||||
|
||||
void onUpdateScaleTransform() override;
|
||||
|
||||
void onClampCurrentTimestep() override;
|
||||
size_t onTimeStepCountRequested() override;
|
||||
|
||||
void onUpdateDisplayModelForCurrentTimeStep() override;
|
||||
void onUpdateStaticCellColors() override;
|
||||
|
||||
void onResetLegendsInViewer() override;
|
||||
|
||||
void onUpdateLegends() override;
|
||||
|
||||
void updateTensorLegendTextAndRanges( RimRegularLegendConfig* legendConfig, int viewerTimeStep );
|
||||
|
@ -111,6 +111,8 @@ QList<caf::PdmOptionItemInfo> RimIntersection::calculateValueOptions( const caf:
|
||||
QList<caf::PdmOptionItemInfo> options;
|
||||
|
||||
if ( fieldNeedingOptions == &m_separateDataSource )
|
||||
{
|
||||
if ( findSeparateResultsCollection() )
|
||||
{
|
||||
std::vector<RimIntersectionResultDefinition*> iResDefs = findSeparateResultsCollection()->intersectionResultsDefinitions();
|
||||
|
||||
@ -119,6 +121,7 @@ QList<caf::PdmOptionItemInfo> RimIntersection::calculateValueOptions( const caf:
|
||||
options.push_back( caf::PdmOptionItemInfo( iresdef->autoName(), iresdef ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
@ -129,7 +132,8 @@ QList<caf::PdmOptionItemInfo> RimIntersection::calculateValueOptions( const caf:
|
||||
RimIntersectionResultsDefinitionCollection* RimIntersection::findSeparateResultsCollection()
|
||||
{
|
||||
auto view = firstAncestorOrThisOfTypeAsserted<RimGridView>();
|
||||
return view->separateIntersectionResultsCollection();
|
||||
if ( view ) return view->separateIntersectionResultsCollection();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -792,19 +792,6 @@ void Rim2dIntersectionView::onUpdateStaticCellColors()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Rim2dIntersectionView::onUpdateScaleTransform()
|
||||
{
|
||||
cvf::Mat4d scale = cvf::Mat4d::IDENTITY;
|
||||
scale( 2, 2 ) = scaleZ();
|
||||
|
||||
scaleTransform()->setLocalTransform( scale );
|
||||
|
||||
if ( nativeOrOverrideViewer() ) nativeOrOverrideViewer()->updateCachedValuesInScene();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -84,7 +84,6 @@ protected:
|
||||
void onClampCurrentTimestep() override;
|
||||
void onUpdateDisplayModelForCurrentTimeStep() override;
|
||||
void onUpdateStaticCellColors() override;
|
||||
void onUpdateScaleTransform() override;
|
||||
cvf::Transform* scaleTransform() override;
|
||||
void onResetLegendsInViewer() override;
|
||||
void onLoadDataAndUpdate() override;
|
||||
|
@ -55,7 +55,10 @@
|
||||
#include "RimGeoMechContourMapView.h"
|
||||
#include "RimGeoMechResultDefinition.h"
|
||||
#include "RimGeoMechView.h"
|
||||
#include "RimGridView.h"
|
||||
#include "RimReservoirCellResultsStorage.h"
|
||||
#include "RimSeismicData.h"
|
||||
#include "RimSeismicView.h"
|
||||
#include "RimSimWellInViewCollection.h"
|
||||
|
||||
#include "RiuViewer.h"
|
||||
@ -157,6 +160,7 @@ RigHistogramData Rim3dOverlayInfoConfig::histogramData()
|
||||
auto geoMechView = dynamic_cast<RimGeoMechView*>( m_viewDef.p() );
|
||||
auto eclipseContourMap = dynamic_cast<RimEclipseContourMapView*>( eclipseView );
|
||||
auto geoMechContourMap = dynamic_cast<RimGeoMechContourMapView*>( geoMechView );
|
||||
auto seismicView = dynamic_cast<RimSeismicView*>( m_viewDef.p() );
|
||||
|
||||
if ( eclipseContourMap )
|
||||
return m_histogramCalculator->histogramData( eclipseContourMap );
|
||||
@ -166,6 +170,10 @@ RigHistogramData Rim3dOverlayInfoConfig::histogramData()
|
||||
return m_histogramCalculator->histogramData( eclipseView, m_statisticsCellRange(), m_statisticsTimeRange() );
|
||||
else if ( geoMechView )
|
||||
return m_histogramCalculator->histogramData( geoMechView, m_statisticsCellRange(), m_statisticsTimeRange() );
|
||||
else if ( seismicView )
|
||||
{
|
||||
return seismicView->histogramData();
|
||||
}
|
||||
return RigHistogramData();
|
||||
}
|
||||
|
||||
@ -188,10 +196,14 @@ QString Rim3dOverlayInfoConfig::timeStepText()
|
||||
QString Rim3dOverlayInfoConfig::caseInfoText()
|
||||
{
|
||||
auto eclipseView = dynamic_cast<RimEclipseView*>( m_viewDef.p() );
|
||||
auto geoMechView = dynamic_cast<RimGeoMechView*>( m_viewDef.p() );
|
||||
|
||||
if ( eclipseView ) return caseInfoText( eclipseView );
|
||||
|
||||
auto geoMechView = dynamic_cast<RimGeoMechView*>( m_viewDef.p() );
|
||||
if ( geoMechView ) return caseInfoText( geoMechView );
|
||||
|
||||
auto seisView = dynamic_cast<RimSeismicView*>( m_viewDef.p() );
|
||||
if ( seisView ) return caseInfoText( seisView );
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
@ -394,6 +406,36 @@ QString Rim3dOverlayInfoConfig::caseInfoText( RimGeoMechView* geoMechView )
|
||||
return infoText;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString Rim3dOverlayInfoConfig::caseInfoText( RimSeismicView* seisView )
|
||||
{
|
||||
QString infoText;
|
||||
|
||||
if ( seisView )
|
||||
{
|
||||
auto seisData = seisView->seismicData();
|
||||
|
||||
if ( seisData )
|
||||
{
|
||||
QString depthRange = QString( "%1 to %2" ).arg( seisData->zMin() ).arg( seisData->zMax() );
|
||||
QString zScale = QString::number( seisView->scaleZ() );
|
||||
QString ilineRange = QString( "%1 to %2" ).arg( seisData->inlineMin() ).arg( seisData->inlineMax() );
|
||||
QString xlineRange = QString( "%1 to %2" ).arg( seisData->xlineMin() ).arg( seisData->xlineMax() );
|
||||
QString seisName = QString::fromStdString( seisData->userDescription() );
|
||||
|
||||
infoText = QString( "<p><b>-- %1 --</b><p>"
|
||||
"<b>Depth Range:</b> %2 <b>Z-Scale:</b> %3<br>"
|
||||
"<b>Inline Range:</b> %4 <br>"
|
||||
"<b>Xline Range:</b> %5 <br>" )
|
||||
.arg( seisName, depthRange, zScale, ilineRange, xlineRange );
|
||||
}
|
||||
}
|
||||
|
||||
return infoText;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -669,7 +711,8 @@ QString Rim3dOverlayInfoConfig::resultInfoText( const RigHistogramData& histData
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Rim3dOverlayInfoConfig::showStatisticsInfoDialog( bool raise )
|
||||
{
|
||||
if ( m_viewDef )
|
||||
auto gridView = dynamic_cast<RimGridView*>( m_viewDef.p() );
|
||||
if ( gridView )
|
||||
{
|
||||
RicGridStatisticsDialog* dialog = getOrCreateGridStatisticsDialog();
|
||||
// Show dialog before setting data due to text edit auto height setting
|
||||
@ -677,7 +720,7 @@ void Rim3dOverlayInfoConfig::showStatisticsInfoDialog( bool raise )
|
||||
dialog->show();
|
||||
|
||||
dialog->setLabel( "Grid statistics" );
|
||||
dialog->updateFromRimView( m_viewDef );
|
||||
dialog->updateFromRimView( gridView );
|
||||
|
||||
if ( raise )
|
||||
{
|
||||
@ -735,7 +778,6 @@ void Rim3dOverlayInfoConfig::update3DInfo()
|
||||
}
|
||||
|
||||
RimGeoMechView* geoMechView = dynamic_cast<RimGeoMechView*>( m_viewDef.p() );
|
||||
|
||||
if ( geoMechView )
|
||||
{
|
||||
m_showVolumeWeightedMean = false;
|
||||
@ -746,6 +788,15 @@ void Rim3dOverlayInfoConfig::update3DInfo()
|
||||
getOrCreateGridStatisticsDialog()->updateFromRimView( geoMechView );
|
||||
}
|
||||
|
||||
RimSeismicView* seisView = dynamic_cast<RimSeismicView*>( m_viewDef.p() );
|
||||
if ( seisView )
|
||||
{
|
||||
m_showVolumeWeightedMean = false;
|
||||
m_showAnimProgress = false;
|
||||
|
||||
updateSeismicInfo( seisView );
|
||||
}
|
||||
|
||||
update3DInfoIn2dViews();
|
||||
}
|
||||
|
||||
@ -764,6 +815,17 @@ void Rim3dOverlayInfoConfig::defineUiOrdering( QString uiConfigName, caf::PdmUiO
|
||||
{
|
||||
caf::PdmUiGroup* visGroup = uiOrdering.addNewGroup( "Visibility" );
|
||||
|
||||
RimSeismicView* seisView = dynamic_cast<RimSeismicView*>( m_viewDef.p() );
|
||||
if ( seisView )
|
||||
{
|
||||
visGroup->add( &m_showCaseInfo );
|
||||
visGroup->add( &m_showHistogram );
|
||||
visGroup->add( &m_showVersionInfo );
|
||||
|
||||
uiOrdering.skipRemainingFields( true );
|
||||
return;
|
||||
}
|
||||
|
||||
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>( m_viewDef.p() );
|
||||
RimEclipseContourMapView* contourMap = dynamic_cast<RimEclipseContourMapView*>( eclipseView );
|
||||
RimGeoMechView* geoMechView = dynamic_cast<RimGeoMechView*>( m_viewDef.p() );
|
||||
@ -816,7 +878,7 @@ void Rim3dOverlayInfoConfig::defineUiOrdering( QString uiConfigName, caf::PdmUiO
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Rim3dOverlayInfoConfig::setReservoirView( RimGridView* ownerReservoirView )
|
||||
void Rim3dOverlayInfoConfig::setReservoirView( Rim3dView* ownerReservoirView )
|
||||
{
|
||||
m_viewDef = ownerReservoirView;
|
||||
}
|
||||
@ -911,6 +973,41 @@ void Rim3dOverlayInfoConfig::updateGeoMech3DInfo( RimGeoMechView* geoMechView )
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Rim3dOverlayInfoConfig::updateSeismicInfo( RimSeismicView* seisView )
|
||||
{
|
||||
RigHistogramData histData;
|
||||
|
||||
if ( m_showResultInfo() || m_showHistogram() )
|
||||
{
|
||||
histData = seisView->histogramData();
|
||||
}
|
||||
|
||||
// Compose text
|
||||
|
||||
QString infoText;
|
||||
|
||||
if ( m_showCaseInfo() )
|
||||
{
|
||||
infoText = caseInfoText( seisView );
|
||||
}
|
||||
|
||||
seisView->viewer()->setInfoText( infoText );
|
||||
|
||||
// Populate histogram
|
||||
|
||||
if ( m_showHistogram() )
|
||||
{
|
||||
if ( histData.isHistogramVectorValid() )
|
||||
{
|
||||
seisView->viewer()->showHistogram( true );
|
||||
seisView->viewer()->setHistogram( histData.min, histData.max, histData.histogram );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -1009,11 +1106,13 @@ void Rim3dOverlayInfoConfig::displayPropertyFilteredStatisticsMessage( bool show
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool Rim3dOverlayInfoConfig::hasInvalidStatisticsCombination()
|
||||
{
|
||||
if ( m_viewDef->propertyFilterCollection() && m_viewDef->propertyFilterCollection()->hasActiveDynamicFilters() &&
|
||||
auto gridView = dynamic_cast<RimGridView*>( m_viewDef.p() );
|
||||
|
||||
if ( gridView && gridView->propertyFilterCollection() && gridView->propertyFilterCollection()->hasActiveDynamicFilters() &&
|
||||
m_statisticsCellRange() == RimHistogramCalculator::StatisticsCellRangeType::VISIBLE_CELLS &&
|
||||
m_statisticsTimeRange() == RimHistogramCalculator::StatisticsTimeRangeType::ALL_TIMESTEPS )
|
||||
{
|
||||
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>( m_viewDef.p() );
|
||||
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>( gridView );
|
||||
if ( !( eclipseView && eclipseView->cellResult()->isFlowDiagOrInjectionFlooding() ) ) // If
|
||||
// isFlowDiagOrInjFlooding
|
||||
// then skip this check as
|
||||
|
@ -39,8 +39,9 @@ class RimGeoMechContourMapView;
|
||||
class RimEclipseContourMapView;
|
||||
class RimEclipseView;
|
||||
class RimGeoMechView;
|
||||
class RimGridView;
|
||||
class Rim3dView;
|
||||
class RicGridStatisticsDialog;
|
||||
class RimSeismicView;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
@ -56,7 +57,7 @@ public:
|
||||
|
||||
void update3DInfo();
|
||||
|
||||
void setReservoirView( RimGridView* ownerView );
|
||||
void setReservoirView( Rim3dView* ownerView );
|
||||
|
||||
void setPosition( cvf::Vec2ui position );
|
||||
|
||||
@ -82,11 +83,13 @@ private:
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
void updateEclipse3DInfo( RimEclipseView* reservoirView );
|
||||
void updateGeoMech3DInfo( RimGeoMechView* geoMechView );
|
||||
void updateSeismicInfo( RimSeismicView* seisView );
|
||||
void update3DInfoIn2dViews() const;
|
||||
QString timeStepText( RimEclipseView* eclipseView );
|
||||
QString timeStepText( RimGeoMechView* geoMechView );
|
||||
QString caseInfoText( RimEclipseView* eclipseView );
|
||||
QString caseInfoText( RimGeoMechView* geoMechView );
|
||||
QString caseInfoText( RimSeismicView* seisView );
|
||||
QString resultInfoText( const RigHistogramData& histData, RimEclipseView* eclipseView, bool showVolumeWeightedMean );
|
||||
QString resultInfoText( const RigHistogramData& histData, RimGeoMechView* geoMechView );
|
||||
|
||||
@ -107,7 +110,7 @@ private:
|
||||
caf::PdmField<caf::AppEnum<RimHistogramCalculator::StatisticsTimeRangeType>> m_statisticsTimeRange;
|
||||
caf::PdmField<caf::AppEnum<RimHistogramCalculator::StatisticsCellRangeType>> m_statisticsCellRange;
|
||||
|
||||
caf::PdmPointer<RimGridView> m_viewDef;
|
||||
caf::PdmPointer<Rim3dView> m_viewDef;
|
||||
cvf::Vec2ui m_position;
|
||||
|
||||
std::unique_ptr<RimHistogramCalculator> m_histogramCalculator;
|
||||
|
@ -30,12 +30,15 @@
|
||||
#include "RicfCommandObject.h"
|
||||
|
||||
#include "Rim3dWellLogCurve.h"
|
||||
#include "RimAnnotationCollection.h"
|
||||
#include "RimAnnotationInViewCollection.h"
|
||||
#include "RimCase.h"
|
||||
#include "RimCellFilterCollection.h"
|
||||
#include "RimGridView.h"
|
||||
#include "RimLegendConfig.h"
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimMeasurement.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimTools.h"
|
||||
#include "RimViewController.h"
|
||||
@ -164,7 +167,7 @@ Rim3dView::Rim3dView()
|
||||
m_cellfilterPartManager = new RivCellFilterPartMgr( this );
|
||||
m_measurementPartManager = new RivMeasurementPartMgr( this );
|
||||
|
||||
setAs3DViewMdiWindow();
|
||||
this->setAs3DViewMdiWindow();
|
||||
|
||||
// Every timer tick, send a signal for updating animations.
|
||||
// Any animation is supposed to connect to this signal
|
||||
@ -198,9 +201,9 @@ Rim3dView::~Rim3dView()
|
||||
}
|
||||
}
|
||||
|
||||
if ( isMasterView() )
|
||||
if ( this->isMasterView() )
|
||||
{
|
||||
RimViewLinker* viewLinker = assosiatedViewLinker();
|
||||
RimViewLinker* viewLinker = this->assosiatedViewLinker();
|
||||
viewLinker->setMasterView( nullptr );
|
||||
|
||||
delete proj->viewLinkerCollection->viewLinker();
|
||||
@ -209,7 +212,7 @@ Rim3dView::~Rim3dView()
|
||||
proj->uiCapability()->updateConnectedEditors();
|
||||
}
|
||||
|
||||
RimViewController* vController = viewController();
|
||||
RimViewController* vController = this->viewController();
|
||||
if ( vController )
|
||||
{
|
||||
vController->setManagedView( nullptr );
|
||||
@ -359,7 +362,7 @@ QWidget* Rim3dView::createViewWidget( QWidget* mainWindowParent )
|
||||
cvf::String yLabel;
|
||||
cvf::String zLabel;
|
||||
|
||||
defineAxisLabels( &xLabel, &yLabel, &zLabel );
|
||||
this->defineAxisLabels( &xLabel, &yLabel, &zLabel );
|
||||
m_viewer->setAxisLabels( xLabel, yLabel, zLabel );
|
||||
|
||||
updateZScaleLabel();
|
||||
@ -400,7 +403,7 @@ void Rim3dView::setId( int id )
|
||||
{
|
||||
m_id = id;
|
||||
QString viewIdTooltip = QString( "View id: %1" ).arg( m_id );
|
||||
setUiToolTip( viewIdTooltip );
|
||||
this->setUiToolTip( viewIdTooltip );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -441,7 +444,7 @@ void Rim3dView::updateMdiWindowTitle()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimViewLinker* Rim3dView::assosiatedViewLinker() const
|
||||
{
|
||||
RimViewLinker* viewLinker = viewLinkerIfMasterView();
|
||||
RimViewLinker* viewLinker = this->viewLinkerIfMasterView();
|
||||
if ( !viewLinker )
|
||||
{
|
||||
RimViewController* viewController = this->viewController();
|
||||
@ -502,7 +505,7 @@ void Rim3dView::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOr
|
||||
|
||||
caf::PdmUiGroup* gridGroup = uiOrdering.addNewGroup( "Grid Appearance" );
|
||||
gridGroup->add( &m_scaleZ );
|
||||
m_scaleZ.uiCapability()->setUiReadOnly( !isScaleZEditable() );
|
||||
m_scaleZ.uiCapability()->setUiReadOnly( !this->isScaleZEditable() );
|
||||
gridGroup->add( &meshMode );
|
||||
gridGroup->add( &surfaceMode );
|
||||
|
||||
@ -533,9 +536,9 @@ QImage Rim3dView::snapshotWindowContent()
|
||||
void Rim3dView::scheduleCreateDisplayModelAndRedraw()
|
||||
{
|
||||
RiaViewRedrawScheduler::instance()->scheduleDisplayModelUpdateAndRedraw( this );
|
||||
if ( isMasterView() )
|
||||
if ( this->isMasterView() )
|
||||
{
|
||||
RimViewLinker* viewLinker = assosiatedViewLinker();
|
||||
RimViewLinker* viewLinker = this->assosiatedViewLinker();
|
||||
if ( viewLinker )
|
||||
{
|
||||
viewLinker->scheduleCreateDisplayModelAndRedrawForDependentViews();
|
||||
@ -579,7 +582,7 @@ std::set<Rim3dView*> Rim3dView::viewsUsingThisAsComparisonView()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool Rim3dView::isScaleZEditable()
|
||||
{
|
||||
return ( viewsUsingThisAsComparisonView().empty() || ( viewController() && viewController()->isCameraLinked() ) );
|
||||
return ( this->viewsUsingThisAsComparisonView().empty() || ( this->viewController() && this->viewController()->isCameraLinked() ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -610,7 +613,7 @@ bool Rim3dView::isTimeStepDependentDataVisibleInThisOrComparisonView() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
size_t Rim3dView::timeStepCount()
|
||||
{
|
||||
return onTimeStepCountRequested();
|
||||
return this->onTimeStepCountRequested();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -618,9 +621,9 @@ size_t Rim3dView::timeStepCount()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString Rim3dView::timeStepName( int frameIdx ) const
|
||||
{
|
||||
if ( ownerCase() )
|
||||
if ( this->ownerCase() )
|
||||
{
|
||||
return ownerCase()->timeStepName( frameIdx );
|
||||
return this->ownerCase()->timeStepName( frameIdx );
|
||||
}
|
||||
return QString( "" );
|
||||
}
|
||||
@ -638,7 +641,7 @@ void Rim3dView::setCurrentTimeStep( int frameIndex )
|
||||
if ( m_currentTimeStep != oldTimeStep )
|
||||
{
|
||||
RiuTimeStepChangedHandler::instance()->handleTimeStepChanged( this );
|
||||
onClearReservoirCellVisibilitiesIfNecessary();
|
||||
this->onClearReservoirCellVisibilitiesIfNecessary();
|
||||
}
|
||||
}
|
||||
|
||||
@ -660,7 +663,7 @@ void Rim3dView::updateDisplayModelForCurrentTimeStepAndRedraw()
|
||||
|
||||
if ( nativeOrOverrideViewer() )
|
||||
{
|
||||
onUpdateDisplayModelForCurrentTimeStep();
|
||||
this->onUpdateDisplayModelForCurrentTimeStep();
|
||||
appendAnnotationsToModel();
|
||||
appendMeasurementToModel();
|
||||
appendCellFiltersToModel();
|
||||
@ -680,7 +683,7 @@ void Rim3dView::updateDisplayModelForCurrentTimeStepAndRedraw()
|
||||
|
||||
m_isCallingUpdateDisplayModelForCurrentTimestepAndRedraw = true;
|
||||
|
||||
std::set<Rim3dView*> containerViews = viewsUsingThisAsComparisonView();
|
||||
std::set<Rim3dView*> containerViews = this->viewsUsingThisAsComparisonView();
|
||||
if ( !containerViews.empty() && !isUsingOverrideViewer() )
|
||||
{
|
||||
for ( auto view : containerViews )
|
||||
@ -701,7 +704,7 @@ void Rim3dView::createDisplayModelAndRedraw()
|
||||
{
|
||||
if ( nativeOrOverrideViewer() )
|
||||
{
|
||||
onClampCurrentTimestep();
|
||||
this->onClampCurrentTimestep();
|
||||
|
||||
onUpdateScaleTransform();
|
||||
|
||||
@ -774,7 +777,7 @@ void Rim3dView::setDefaultView()
|
||||
{
|
||||
if ( m_viewer )
|
||||
{
|
||||
m_viewer->setDefaultView();
|
||||
m_viewer->setDefaultView( -cvf::Vec3d::Z_AXIS, cvf::Vec3d::Y_AXIS );
|
||||
}
|
||||
}
|
||||
|
||||
@ -783,7 +786,7 @@ void Rim3dView::setDefaultView()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Rim3dView::endAnimation()
|
||||
{
|
||||
onUpdateStaticCellColors();
|
||||
this->onUpdateStaticCellColors();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -936,7 +939,7 @@ void Rim3dView::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const
|
||||
|
||||
RiuMainWindow::instance()->updateScaleValue();
|
||||
|
||||
RimViewLinker* viewLinker = assosiatedViewLinker();
|
||||
RimViewLinker* viewLinker = this->assosiatedViewLinker();
|
||||
if ( viewLinker )
|
||||
{
|
||||
viewLinker->updateScaleZ( this, scaleZ() );
|
||||
@ -995,8 +998,8 @@ void Rim3dView::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const
|
||||
fontHolder->updateFonts();
|
||||
}
|
||||
}
|
||||
applyBackgroundColorAndFontChanges();
|
||||
updateConnectedEditors();
|
||||
this->applyBackgroundColorAndFontChanges();
|
||||
this->updateConnectedEditors();
|
||||
}
|
||||
else if ( changedField == &maximumFrameRate )
|
||||
{
|
||||
@ -1024,15 +1027,15 @@ void Rim3dView::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Rim3dView::addWellPathsToModel( cvf::ModelBasicList* wellPathModelBasicList, const cvf::BoundingBox& wellPathClipBoundingBox )
|
||||
void Rim3dView::addWellPathsToModel( cvf::ModelBasicList* wellPathModelBasicList,
|
||||
const cvf::BoundingBox& wellPathClipBoundingBox,
|
||||
double characteristicCellSize )
|
||||
{
|
||||
if ( !ownerCase() ) return;
|
||||
|
||||
cvf::ref<caf::DisplayCoordTransform> transForm = displayCoordTransform();
|
||||
|
||||
m_wellPathsPartManager->appendStaticGeometryPartsToModel( wellPathModelBasicList,
|
||||
transForm.p(),
|
||||
ownerCase()->characteristicCellSize(),
|
||||
characteristicCellSize,
|
||||
wellPathClipBoundingBox );
|
||||
|
||||
wellPathModelBasicList->updateBoundingBoxesRecursive();
|
||||
@ -1041,17 +1044,17 @@ void Rim3dView::addWellPathsToModel( cvf::ModelBasicList* wellPathModelBasicList
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Rim3dView::addDynamicWellPathsToModel( cvf::ModelBasicList* wellPathModelBasicList, const cvf::BoundingBox& wellPathClipBoundingBox )
|
||||
void Rim3dView::addDynamicWellPathsToModel( cvf::ModelBasicList* wellPathModelBasicList,
|
||||
const cvf::BoundingBox& wellPathClipBoundingBox,
|
||||
double characteristicCellSize )
|
||||
{
|
||||
if ( !ownerCase() ) return;
|
||||
|
||||
cvf::ref<caf::DisplayCoordTransform> transForm = displayCoordTransform();
|
||||
|
||||
size_t timeStepIndex = currentTimeStep();
|
||||
m_wellPathsPartManager->appendDynamicGeometryPartsToModel( wellPathModelBasicList,
|
||||
timeStepIndex,
|
||||
transForm.p(),
|
||||
ownerCase()->characteristicCellSize(),
|
||||
characteristicCellSize,
|
||||
wellPathClipBoundingBox );
|
||||
|
||||
wellPathModelBasicList->updateBoundingBoxesRecursive();
|
||||
@ -1062,18 +1065,14 @@ void Rim3dView::addDynamicWellPathsToModel( cvf::ModelBasicList* wellPathModelBa
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Rim3dView::addAnnotationsToModel( cvf::ModelBasicList* annotationsModel )
|
||||
{
|
||||
if ( !ownerCase() ) return;
|
||||
|
||||
auto annotationCollections = descendantsIncludingThisOfType<RimAnnotationInViewCollection>();
|
||||
|
||||
if ( annotationCollections.empty() || !annotationCollections.front()->isActive() )
|
||||
{
|
||||
m_annotationsPartManager->clearGeometryCache();
|
||||
}
|
||||
else
|
||||
|
||||
if ( !annotationCollections.empty() && annotationCollections.front()->isActive() )
|
||||
{
|
||||
cvf::ref<caf::DisplayCoordTransform> transForm = displayCoordTransform();
|
||||
m_annotationsPartManager->appendGeometryPartsToModel( annotationsModel, transForm.p(), ownerCase()->allCellsBoundingBox() );
|
||||
m_annotationsPartManager->appendGeometryPartsToModel( annotationsModel, transForm.p(), domainBoundingBox() );
|
||||
}
|
||||
|
||||
annotationsModel->updateBoundingBoxesRecursive();
|
||||
@ -1084,7 +1083,7 @@ void Rim3dView::addAnnotationsToModel( cvf::ModelBasicList* annotationsModel )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Rim3dView::addCellFiltersToModel( cvf::ModelBasicList* cellFilterModel )
|
||||
{
|
||||
if ( !ownerCase() ) return;
|
||||
if ( !this->ownerCase() ) return;
|
||||
|
||||
cvf::ref<caf::DisplayCoordTransform> transForm = displayCoordTransform();
|
||||
m_cellfilterPartManager->appendGeometryPartsToModel( cellFilterModel, transForm.p(), ownerCase()->allCellsBoundingBox() );
|
||||
@ -1097,7 +1096,7 @@ void Rim3dView::addCellFiltersToModel( cvf::ModelBasicList* cellFilterModel )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Rim3dView::addMeasurementToModel( cvf::ModelBasicList* measureModel )
|
||||
{
|
||||
if ( !ownerCase() ) return;
|
||||
if ( !this->ownerCase() ) return;
|
||||
|
||||
RimMeasurement* measurement = RimProject::current()->measurement();
|
||||
|
||||
@ -1124,7 +1123,7 @@ void Rim3dView::addMeasurementToModel( cvf::ModelBasicList* measureModel )
|
||||
//---------------------------------------------------- ----------------------------------------------
|
||||
bool Rim3dView::isMasterView() const
|
||||
{
|
||||
RimViewLinker* viewLinker = assosiatedViewLinker();
|
||||
RimViewLinker* viewLinker = this->assosiatedViewLinker();
|
||||
return viewLinker && this == viewLinker->masterView();
|
||||
}
|
||||
|
||||
@ -1197,7 +1196,7 @@ void Rim3dView::setScaleZAndUpdate( double scalingFactor )
|
||||
{
|
||||
if ( scaleZ() != scalingFactor )
|
||||
{
|
||||
m_scaleZ.setValueWithFieldChanged( scalingFactor );
|
||||
this->m_scaleZ.setValueWithFieldChanged( scalingFactor );
|
||||
}
|
||||
}
|
||||
|
||||
@ -1230,8 +1229,8 @@ void Rim3dView::updateScaling()
|
||||
dir = viewer()->mainCamera()->direction();
|
||||
up = viewer()->mainCamera()->up();
|
||||
|
||||
eye[2] = poi[2] * m_scaleZ() / scaleTransform()->worldTransform()( 2, 2 ) + ( eye[2] - poi[2] );
|
||||
poi[2] = poi[2] * m_scaleZ() / scaleTransform()->worldTransform()( 2, 2 );
|
||||
eye[2] = poi[2] * m_scaleZ() / this->scaleTransform()->worldTransform()( 2, 2 ) + ( eye[2] - poi[2] );
|
||||
poi[2] = poi[2] * m_scaleZ() / this->scaleTransform()->worldTransform()( 2, 2 );
|
||||
|
||||
viewer()->mainCamera()->setFromLookAt( eye, eye + dir, up );
|
||||
viewer()->setPointOfInterest( poi );
|
||||
@ -1246,7 +1245,7 @@ void Rim3dView::updateScaling()
|
||||
updateGridBoxData();
|
||||
updateZScaleLabel();
|
||||
|
||||
scheduleCreateDisplayModelAndRedraw();
|
||||
this->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -1355,7 +1354,7 @@ void Rim3dView::applyBackgroundColorAndFontChanges()
|
||||
updateConnectedEditors();
|
||||
|
||||
onUpdateLegends();
|
||||
scheduleCreateDisplayModelAndRedraw();
|
||||
this->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -1431,7 +1430,7 @@ void Rim3dView::updateDisplayModelVisibility()
|
||||
viewer()->setEnableMask( mask, false );
|
||||
viewer()->setEnableMask( mask, true );
|
||||
|
||||
onUpdateDisplayModelVisibility();
|
||||
this->onUpdateDisplayModelVisibility();
|
||||
|
||||
viewer()->update();
|
||||
}
|
||||
@ -1627,7 +1626,7 @@ void Rim3dView::appendAnnotationsToModel()
|
||||
if ( frameScene )
|
||||
{
|
||||
cvf::String name = "Annotations";
|
||||
removeModelByName( frameScene, name );
|
||||
this->removeModelByName( frameScene, name );
|
||||
|
||||
cvf::ref<cvf::ModelBasicList> model = new cvf::ModelBasicList;
|
||||
model->setName( name );
|
||||
@ -1649,7 +1648,7 @@ void Rim3dView::appendCellFiltersToModel()
|
||||
if ( frameScene )
|
||||
{
|
||||
cvf::String name = "CellFilters";
|
||||
removeModelByName( frameScene, name );
|
||||
this->removeModelByName( frameScene, name );
|
||||
|
||||
cvf::ref<cvf::ModelBasicList> model = new cvf::ModelBasicList;
|
||||
model->setName( name );
|
||||
@ -1671,7 +1670,7 @@ void Rim3dView::appendMeasurementToModel()
|
||||
if ( frameScene )
|
||||
{
|
||||
cvf::String name = "Measurement";
|
||||
removeModelByName( frameScene, name );
|
||||
this->removeModelByName( frameScene, name );
|
||||
|
||||
cvf::ref<cvf::ModelBasicList> model = new cvf::ModelBasicList;
|
||||
model->setName( name );
|
||||
@ -1748,3 +1747,78 @@ RimViewLinker* Rim3dView::viewLinkerIfMasterView() const
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Rim3dView::onResetLegendsInViewer()
|
||||
{
|
||||
for ( auto legendConfig : legendConfigs() )
|
||||
{
|
||||
if ( legendConfig ) legendConfig->recreateLegend();
|
||||
}
|
||||
|
||||
auto viewer = nativeOrOverrideViewer();
|
||||
if ( viewer ) viewer->removeAllColorLegends();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Rim3dView::onUpdateScaleTransform()
|
||||
{
|
||||
if ( scaleTransform() )
|
||||
{
|
||||
cvf::Mat4d scale = cvf::Mat4d::IDENTITY;
|
||||
scale( 2, 2 ) = scaleZ();
|
||||
|
||||
scaleTransform()->setLocalTransform( scale );
|
||||
|
||||
if ( nativeOrOverrideViewer() ) nativeOrOverrideViewer()->updateCachedValuesInScene();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Rim3dView::updateSurfacesInViewTreeItems()
|
||||
{
|
||||
// default is to do nothing
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double Rim3dView::characteristicCellSize() const
|
||||
{
|
||||
if ( ownerCase() )
|
||||
{
|
||||
return ownerCase()->characteristicCellSize();
|
||||
}
|
||||
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimAnnotationInViewCollection* Rim3dView::annotationCollection() const
|
||||
{
|
||||
return m_annotationCollection;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Rim3dView::syncronizeLocalAnnotationsFromGlobal()
|
||||
{
|
||||
RimProject* proj = RimProject::current();
|
||||
if ( proj && proj->activeOilField() )
|
||||
{
|
||||
RimAnnotationCollection* annotColl = proj->activeOilField()->annotationCollection();
|
||||
if ( annotColl && annotationCollection() )
|
||||
{
|
||||
annotationCollection()->onGlobalCollectionChanged( annotColl );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -44,6 +44,7 @@
|
||||
class RimCase;
|
||||
class RimLegendConfig;
|
||||
class RimWellPathCollection;
|
||||
class RimAnnotationInViewCollection;
|
||||
class RiuViewer;
|
||||
class RivAnnotationsPartMgr;
|
||||
class RivMeasurementPartMgr;
|
||||
@ -125,6 +126,7 @@ public:
|
||||
void setShowGridBox( bool showGridBox );
|
||||
virtual bool isShowingActiveCellsOnly();
|
||||
virtual bool isGridVisualizationMode() const = 0;
|
||||
virtual double characteristicCellSize() const;
|
||||
|
||||
void setBackgroundColor( const cvf::Color3f& newBackgroundColor );
|
||||
cvf::Color3f backgroundColor() const override; // Implementation of RiuViewerToViewInterface
|
||||
@ -165,11 +167,11 @@ public:
|
||||
void updateDisplayModelForCurrentTimeStepAndRedraw();
|
||||
void createHighlightAndGridBoxDisplayModelAndRedraw();
|
||||
void createMeasurementDisplayModelAndRedraw();
|
||||
void updateGridBoxData();
|
||||
void updateAnnotationItems();
|
||||
void resetLegends();
|
||||
|
||||
cvf::BoundingBox domainBoundingBox();
|
||||
virtual void updateGridBoxData();
|
||||
virtual cvf::BoundingBox domainBoundingBox();
|
||||
|
||||
void setScaleZ( double scaleZ );
|
||||
void setScaleZAndUpdate( double scaleZ );
|
||||
@ -187,6 +189,11 @@ public:
|
||||
RimViewLinker* assosiatedViewLinker() const override;
|
||||
RimViewController* viewController() const override;
|
||||
|
||||
virtual void updateSurfacesInViewTreeItems();
|
||||
|
||||
RimAnnotationInViewCollection* annotationCollection() const;
|
||||
void syncronizeLocalAnnotationsFromGlobal();
|
||||
|
||||
protected:
|
||||
static void removeModelByName( cvf::Scene* scene, const cvf::String& modelName );
|
||||
|
||||
@ -203,8 +210,12 @@ protected:
|
||||
|
||||
RimWellPathCollection* wellPathCollection() const;
|
||||
|
||||
void addWellPathsToModel( cvf::ModelBasicList* wellPathModelBasicList, const cvf::BoundingBox& wellPathClipBoundingBox );
|
||||
void addDynamicWellPathsToModel( cvf::ModelBasicList* wellPathModelBasicList, const cvf::BoundingBox& wellPathClipBoundingBox );
|
||||
void addWellPathsToModel( cvf::ModelBasicList* wellPathModelBasicList,
|
||||
const cvf::BoundingBox& wellPathClipBoundingBox,
|
||||
double characteristicCellSize );
|
||||
void addDynamicWellPathsToModel( cvf::ModelBasicList* wellPathModelBasicList,
|
||||
const cvf::BoundingBox& wellPathClipBoundingBox,
|
||||
double characteristicCellSize );
|
||||
void addAnnotationsToModel( cvf::ModelBasicList* annotationsModel );
|
||||
void addMeasurementToModel( cvf::ModelBasicList* measureModel );
|
||||
void addCellFiltersToModel( cvf::ModelBasicList* cellFilterModel );
|
||||
@ -218,21 +229,22 @@ protected:
|
||||
|
||||
// Abstract methods to implement in subclasses
|
||||
|
||||
virtual void onUpdateDisplayModelVisibility(){};
|
||||
virtual void onClearReservoirCellVisibilitiesIfNecessary(){};
|
||||
virtual void onResetLegendsInViewer();
|
||||
virtual void onUpdateScaleTransform();
|
||||
|
||||
virtual void onCreateDisplayModel() = 0;
|
||||
virtual void onUpdateDisplayModelForCurrentTimeStep() = 0;
|
||||
virtual void onUpdateDisplayModelVisibility(){};
|
||||
virtual void onClampCurrentTimestep() = 0;
|
||||
virtual size_t onTimeStepCountRequested() = 0;
|
||||
|
||||
virtual void onClearReservoirCellVisibilitiesIfNecessary(){};
|
||||
virtual bool isTimeStepDependentDataVisible() const = 0;
|
||||
virtual void defineAxisLabels( cvf::String* xLabel, cvf::String* yLabel, cvf::String* zLabel ) = 0;
|
||||
virtual void onCreatePartCollectionFromSelection( cvf::Collection<cvf::Part>* parts ) = 0;
|
||||
virtual void onUpdateStaticCellColors() = 0;
|
||||
virtual void onResetLegendsInViewer() = 0;
|
||||
virtual void onUpdateLegends() = 0;
|
||||
|
||||
virtual void onUpdateScaleTransform() = 0;
|
||||
virtual cvf::Transform* scaleTransform() = 0;
|
||||
|
||||
protected:
|
||||
@ -259,10 +271,13 @@ protected:
|
||||
cvf::ref<cvf::ModelBasicList> m_wellPathPipeVizModel;
|
||||
cvf::ref<cvf::ModelBasicList> m_seismicVizModel;
|
||||
cvf::ref<RivWellPathsPartMgr> m_wellPathsPartManager;
|
||||
cvf::ref<cvf::ModelBasicList> m_highlightVizModel;
|
||||
|
||||
caf::PdmField<double> m_scaleZ;
|
||||
caf::PdmField<double> m_customScaleZ;
|
||||
|
||||
caf::PdmChildField<RimAnnotationInViewCollection*> m_annotationCollection;
|
||||
|
||||
private:
|
||||
friend class RimProject;
|
||||
|
||||
@ -288,9 +303,9 @@ private:
|
||||
// Pure private methods
|
||||
|
||||
void createHighlightAndGridBoxDisplayModel();
|
||||
void appendAnnotationsToModel();
|
||||
void appendMeasurementToModel();
|
||||
void appendCellFiltersToModel();
|
||||
void appendAnnotationsToModel();
|
||||
|
||||
// Pure private methods : Override viewer and comparison view
|
||||
|
||||
@ -320,7 +335,6 @@ private:
|
||||
caf::PdmField<caf::FontTools::RelativeSizeEnum> m_fontSize;
|
||||
|
||||
// 3D display model data
|
||||
cvf::ref<cvf::ModelBasicList> m_highlightVizModel;
|
||||
cvf::ref<RivAnnotationsPartMgr> m_annotationsPartManager;
|
||||
cvf::ref<RivMeasurementPartMgr> m_measurementPartManager;
|
||||
cvf::ref<RivCellFilterPartMgr> m_cellfilterPartManager;
|
||||
|
@ -116,6 +116,7 @@
|
||||
#include "RimSeismicData.h"
|
||||
#include "RimSeismicDataCollection.h"
|
||||
#include "RimSeismicSectionCollection.h"
|
||||
#include "RimSeismicViewCollection.h"
|
||||
#include "RimSimWellFracture.h"
|
||||
#include "RimSimWellInView.h"
|
||||
#include "RimSimWellInViewCollection.h"
|
||||
@ -1055,6 +1056,10 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
|
||||
{
|
||||
menuBuilder << "RicImportSeismicFeature";
|
||||
}
|
||||
else if ( dynamic_cast<RimSeismicViewCollection*>( firstUiItem ) )
|
||||
{
|
||||
menuBuilder << "RicNewSeismicViewFeature";
|
||||
}
|
||||
else if ( dynamic_cast<RimAnnotationCollection*>( firstUiItem ) || dynamic_cast<RimAnnotationGroupCollection*>( firstUiItem ) )
|
||||
{
|
||||
menuBuilder << "RicCreateTextAnnotationFeature";
|
||||
@ -1245,6 +1250,8 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
|
||||
}
|
||||
else if ( dynamic_cast<RimSeismicData*>( firstUiItem ) )
|
||||
{
|
||||
menuBuilder << "RicNewSeismicViewFeature";
|
||||
menuBuilder.addSeparator();
|
||||
menuBuilder << "RicNewSeismicDifferenceFeature";
|
||||
}
|
||||
else if ( dynamic_cast<RimWellLogPlot*>( firstUiItem ) )
|
||||
|
@ -613,7 +613,7 @@ void RimEclipseView::onCreateDisplayModel()
|
||||
// as the fracture geometry depends on the StimPlan legend colors
|
||||
fractureColors()->updateLegendData();
|
||||
|
||||
addWellPathsToModel( m_wellPathPipeVizModel.p(), currentActiveCellInfo()->geometryBoundingBox() );
|
||||
addWellPathsToModel( m_wellPathPipeVizModel.p(), currentActiveCellInfo()->geometryBoundingBox(), ownerCase()->characteristicCellSize() );
|
||||
|
||||
m_wellPathsPartManager->appendStaticFracturePartsToModel( m_wellPathPipeVizModel.p(), currentActiveCellInfo()->geometryBoundingBox() );
|
||||
m_wellPathPipeVizModel->updateBoundingBoxesRecursive();
|
||||
@ -936,7 +936,9 @@ void RimEclipseView::appendWellsAndFracturesToModel()
|
||||
cvf::ref<cvf::ModelBasicList> wellPathModelBasicList = new cvf::ModelBasicList;
|
||||
wellPathModelBasicList->setName( name );
|
||||
|
||||
addDynamicWellPathsToModel( wellPathModelBasicList.p(), currentActiveCellInfo()->geometryBoundingBox() );
|
||||
addDynamicWellPathsToModel( wellPathModelBasicList.p(),
|
||||
currentActiveCellInfo()->geometryBoundingBox(),
|
||||
ownerCase()->characteristicCellSize() );
|
||||
|
||||
frameScene->addModel( wellPathModelBasicList.p() );
|
||||
}
|
||||
@ -1599,22 +1601,6 @@ void RimEclipseView::syncronizeWellsWithResults()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseView::syncronizeLocalAnnotationsFromGlobal()
|
||||
{
|
||||
RimProject* proj = RimProject::current();
|
||||
if ( proj && proj->activeOilField() )
|
||||
{
|
||||
RimAnnotationCollection* annotColl = proj->activeOilField()->annotationCollection();
|
||||
if ( annotColl && annotationCollection() )
|
||||
{
|
||||
annotationCollection()->onGlobalCollectionChanged( annotColl );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -2059,22 +2045,6 @@ void RimEclipseView::setCurrentCellResultData( const std::vector<double>& values
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseView::onResetLegendsInViewer()
|
||||
{
|
||||
for ( auto legendConfig : legendConfigs() )
|
||||
{
|
||||
if ( legendConfig )
|
||||
{
|
||||
legendConfig->recreateLegend();
|
||||
}
|
||||
}
|
||||
|
||||
nativeOrOverrideViewer()->removeAllColorLegends();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -160,8 +160,6 @@ public:
|
||||
std::vector<RimLegendConfig*> legendConfigs() const override;
|
||||
cvf::Color4f colorFromCellCategory( RivCellSetEnum geometryType ) const;
|
||||
|
||||
void syncronizeLocalAnnotationsFromGlobal();
|
||||
|
||||
std::vector<RigEclipseResultAddress> additionalResultsForResultInfo() const;
|
||||
|
||||
protected:
|
||||
@ -203,7 +201,6 @@ private:
|
||||
RimEclipseResultDefinition* eclResDef,
|
||||
int timeStepIndex );
|
||||
|
||||
void onResetLegendsInViewer() override;
|
||||
void updateVirtualConnectionLegendRanges();
|
||||
|
||||
void updateFaultColors();
|
||||
|
@ -19,7 +19,6 @@
|
||||
#include "RimGridView.h"
|
||||
|
||||
#include "Rim3dOverlayInfoConfig.h"
|
||||
#include "RimAnnotationInViewCollection.h"
|
||||
#include "RimCellFilterCollection.h"
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseResultDefinition.h"
|
||||
@ -235,14 +234,6 @@ const RimCellFilterCollection* RimGridView::cellFilterCollection() const
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimAnnotationInViewCollection* RimGridView::annotationCollection() const
|
||||
{
|
||||
return m_annotationCollection;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -22,7 +22,6 @@
|
||||
|
||||
#include "cvfArray.h"
|
||||
|
||||
class RimAnnotationInViewCollection;
|
||||
class RimEclipseContourMapProjection;
|
||||
class Rim3dOverlayInfoConfig;
|
||||
class RimIntersectionCollection;
|
||||
@ -53,7 +52,6 @@ public:
|
||||
virtual RimSurfaceInViewCollection* surfaceInViewCollection() const;
|
||||
RimIntersectionResultsDefinitionCollection* separateIntersectionResultsCollection() const;
|
||||
RimIntersectionResultsDefinitionCollection* separateSurfaceResultsCollection() const;
|
||||
RimAnnotationInViewCollection* annotationCollection() const;
|
||||
RimWellMeasurementInViewCollection* measurementCollection() const;
|
||||
RimSeismicSectionCollection* seismicSectionCollection() const;
|
||||
|
||||
@ -70,7 +68,7 @@ public:
|
||||
bool isGridVisualizationMode() const override;
|
||||
|
||||
void updateWellMeasurements();
|
||||
void updateSurfacesInViewTreeItems();
|
||||
void updateSurfacesInViewTreeItems() override;
|
||||
|
||||
protected:
|
||||
virtual void updateViewFollowingCellFilterUpdates();
|
||||
@ -101,7 +99,6 @@ protected:
|
||||
|
||||
caf::PdmChildField<Rim3dOverlayInfoConfig*> m_overlayInfoConfig;
|
||||
caf::PdmChildField<RimGridCollection*> m_gridCollection;
|
||||
caf::PdmChildField<RimAnnotationInViewCollection*> m_annotationCollection;
|
||||
caf::PdmChildField<RimWellMeasurementInViewCollection*> m_wellMeasurementCollection;
|
||||
caf::PdmChildField<RimSurfaceInViewCollection*> m_surfaceCollection;
|
||||
caf::PdmChildField<RimCellFilterCollection*> m_cellFilterCollection;
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include "RimMeasurement.h"
|
||||
#include "RimObservedDataCollection.h"
|
||||
#include "RimSeismicDataCollection.h"
|
||||
#include "RimSeismicViewCollection.h"
|
||||
#include "RimSummaryCaseMainCollection.h"
|
||||
#include "RimSurfaceCollection.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
@ -65,8 +66,11 @@ RimOilField::RimOilField()
|
||||
surfaceCollection = new RimSurfaceCollection();
|
||||
surfaceCollection->setAsTopmostFolder();
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &seismicCollection, "SeismicCollection", "Seismic Data" );
|
||||
seismicCollection = new RimSeismicDataCollection();
|
||||
CAF_PDM_InitFieldNoDefault( &seismicDataCollection, "SeismicCollection", "Seismic Data" );
|
||||
seismicDataCollection = new RimSeismicDataCollection();
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &seismicViewCollection, "SeismicViewCollection", "Seismic Views" );
|
||||
seismicViewCollection = new RimSeismicViewCollection();
|
||||
|
||||
completionTemplateCollection = new RimCompletionTemplateCollection;
|
||||
analysisModels = new RimEclipseCaseCollection();
|
||||
|
@ -38,6 +38,7 @@ class RimWellPathCollection;
|
||||
class RimAnnotationCollection;
|
||||
class RimMeasurement;
|
||||
class RimSeismicDataCollection;
|
||||
class RimSeismicViewCollection;
|
||||
class RimSurfaceCollection;
|
||||
class RimEnsembleWellLogsCollection;
|
||||
|
||||
@ -69,7 +70,8 @@ public:
|
||||
caf::PdmChildField<RimAnnotationCollection*> annotationCollection;
|
||||
caf::PdmChildField<RimMeasurement*> measurement;
|
||||
caf::PdmChildField<RimSurfaceCollection*> surfaceCollection;
|
||||
caf::PdmChildField<RimSeismicDataCollection*> seismicCollection;
|
||||
caf::PdmChildField<RimSeismicDataCollection*> seismicDataCollection;
|
||||
caf::PdmChildField<RimSeismicViewCollection*> seismicViewCollection;
|
||||
caf::PdmChildField<RimEnsembleWellLogsCollection*> ensembleWellLogsCollection;
|
||||
|
||||
protected:
|
||||
|
@ -73,6 +73,8 @@
|
||||
#include "RimSaturationPressurePlotCollection.h"
|
||||
#include "RimScriptCollection.h"
|
||||
#include "RimSeismicDataCollection.h"
|
||||
#include "RimSeismicView.h"
|
||||
#include "RimSeismicViewCollection.h"
|
||||
#include "RimStimPlanModelPlotCollection.h"
|
||||
#include "RimSummaryCalculation.h"
|
||||
#include "RimSummaryCalculationCollection.h"
|
||||
@ -811,6 +813,18 @@ void RimProject::allViews( std::vector<Rim3dView*>& views ) const
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for ( size_t oilFieldIdx = 0; oilFieldIdx < oilFields().size(); oilFieldIdx++ )
|
||||
{
|
||||
RimOilField* oilField = oilFields[oilFieldIdx];
|
||||
if ( !oilField ) continue;
|
||||
if ( !oilField->seismicViewCollection() ) continue;
|
||||
|
||||
for ( auto seisview : oilField->seismicViewCollection()->views() )
|
||||
{
|
||||
views.push_back( seisview );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -869,6 +883,11 @@ void RimProject::scheduleCreateDisplayModelAndRedrawAllViews()
|
||||
views[viewIdx]->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
}
|
||||
|
||||
for ( auto seisview : activeOilField()->seismicViewCollection()->views() )
|
||||
{
|
||||
seisview->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -1520,7 +1539,12 @@ void RimProject::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, Q
|
||||
if ( oilField->geoMechModels() ) uiTreeOrdering.add( oilField->geoMechModels() );
|
||||
if ( oilField->wellPathCollection() ) uiTreeOrdering.add( oilField->wellPathCollection() );
|
||||
if ( oilField->surfaceCollection() ) uiTreeOrdering.add( oilField->surfaceCollection() );
|
||||
if ( oilField->seismicCollection() ) uiTreeOrdering.add( oilField->seismicCollection() );
|
||||
if ( oilField->seismicDataCollection() )
|
||||
{
|
||||
auto child = uiTreeOrdering.add( "Seismic", ":/Seismic16x16.png" );
|
||||
child->add( oilField->seismicDataCollection() );
|
||||
child->add( oilField->seismicViewCollection() );
|
||||
}
|
||||
if ( oilField->formationNamesCollection() ) uiTreeOrdering.add( oilField->formationNamesCollection() );
|
||||
if ( oilField->completionTemplateCollection() ) uiTreeOrdering.add( oilField->completionTemplateCollection() );
|
||||
if ( oilField->annotationCollection() ) uiTreeOrdering.add( oilField->annotationCollection() );
|
||||
|
@ -384,7 +384,7 @@ void RimTools::seismicDataOptionItems( QList<caf::PdmOptionItemInfo>* options )
|
||||
RimProject* proj = RimProject::current();
|
||||
if ( proj )
|
||||
{
|
||||
const auto& coll = proj->activeOilField()->seismicCollection().p();
|
||||
const auto& coll = proj->activeOilField()->seismicDataCollection().p();
|
||||
|
||||
for ( auto* c : coll->seismicData() )
|
||||
{
|
||||
@ -403,7 +403,7 @@ void RimTools::seismicDataOptionItems( QList<caf::PdmOptionItemInfo>* options, c
|
||||
RimProject* proj = RimProject::current();
|
||||
if ( proj )
|
||||
{
|
||||
const auto& coll = proj->activeOilField()->seismicCollection().p();
|
||||
const auto& coll = proj->activeOilField()->seismicDataCollection().p();
|
||||
|
||||
for ( auto* c : coll->seismicData() )
|
||||
{
|
||||
|
@ -7,6 +7,8 @@ set(SOURCE_GROUP_HEADER_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimSeismicSection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimSeismicAlphaMapper.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimSEGYConvertOptions.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimSeismicViewCollection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimSeismicView.h
|
||||
)
|
||||
|
||||
set(SOURCE_GROUP_SOURCE_FILES
|
||||
@ -18,6 +20,8 @@ set(SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimSEGYConvertOptions.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimSeismicDataInterface.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimSeismicDifferenceData.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimSeismicViewCollection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimSeismicView.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES})
|
||||
|
@ -59,7 +59,7 @@ RimSeismicData::RimSeismicData()
|
||||
, m_fileDataRange( 0, 0 )
|
||||
, m_activeDataRange( 0, 0 )
|
||||
{
|
||||
CAF_PDM_InitObject( "SeismicData", ":/Seismic16x16.png" );
|
||||
CAF_PDM_InitObject( "SeismicData", ":/SeismicData24x24.png" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_userDescription, "SeismicUserDecription", "Name" );
|
||||
|
||||
|
@ -37,7 +37,7 @@ CAF_PDM_SOURCE_INIT( RimSeismicDataCollection, "SeismicDataCollection", "Seismic
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSeismicDataCollection::RimSeismicDataCollection()
|
||||
{
|
||||
CAF_PDM_InitObject( "Seismic", ":/Seismic16x16.png" );
|
||||
CAF_PDM_InitObject( "Data", ":/SeismicData24x24.png" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_seismicData, "SeismicData", "Seismic Data" );
|
||||
m_seismicData.uiCapability()->setUiTreeHidden( true );
|
||||
|
@ -21,6 +21,8 @@
|
||||
#include "RimRegularLegendConfig.h"
|
||||
#include "RimSeismicAlphaMapper.h"
|
||||
|
||||
#include "RigPolyLinesData.h"
|
||||
|
||||
#include "cvfBoundingBox.h"
|
||||
|
||||
CAF_PDM_XML_ABSTRACT_SOURCE_INIT( RimSeismicDataInterface, "SeismicDataInterface" ); // Abstract class.
|
||||
@ -137,3 +139,53 @@ std::vector<double> RimSeismicDataInterface::alphaValues() const
|
||||
{
|
||||
return m_clippedAlphaValues;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimSeismicDataInterface::inlineSpacing()
|
||||
{
|
||||
if ( !hasValidData() ) return 1.0;
|
||||
|
||||
cvf::Vec3d world1 = convertToWorldCoords( inlineMin(), xlineMin(), zMin() );
|
||||
cvf::Vec3d world2 = convertToWorldCoords( inlineMin() + 1, xlineMin(), zMin() );
|
||||
|
||||
return world1.pointDistance( world2 );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSeismicDataInterface::addSeismicOutline( RigPolyLinesData* pld )
|
||||
{
|
||||
if ( pld == nullptr ) return;
|
||||
|
||||
auto outline = worldOutline();
|
||||
if ( outline.size() == 8 )
|
||||
{
|
||||
// seismic bounding box could be all the way up to the sea surface,
|
||||
// make sure to skip bounding box check in drawing code
|
||||
pld->setSkipBoundingBoxCheck( true );
|
||||
|
||||
std::vector<cvf::Vec3d> box;
|
||||
|
||||
for ( auto i : { 4, 0, 1, 3, 2, 0 } )
|
||||
box.push_back( outline[i] );
|
||||
pld->addPolyLine( box );
|
||||
box.clear();
|
||||
|
||||
for ( auto i : { 1, 5, 4, 6, 7, 5 } )
|
||||
box.push_back( outline[i] );
|
||||
pld->addPolyLine( box );
|
||||
box.clear();
|
||||
|
||||
box.push_back( outline[2] );
|
||||
box.push_back( outline[6] );
|
||||
pld->addPolyLine( box );
|
||||
box.clear();
|
||||
|
||||
box.push_back( outline[3] );
|
||||
box.push_back( outline[7] );
|
||||
pld->addPolyLine( box );
|
||||
}
|
||||
}
|
||||
|
@ -32,6 +32,7 @@
|
||||
|
||||
class RimSeismicAlphaMapper;
|
||||
class RimRegularLegendConfig;
|
||||
class RigPolyLinesData;
|
||||
|
||||
namespace cvf
|
||||
{
|
||||
@ -56,6 +57,9 @@ public:
|
||||
virtual bool gridIsEqual( RimSeismicDataInterface* other );
|
||||
virtual RimRegularLegendConfig* legendConfig() const;
|
||||
virtual RimSeismicAlphaMapper* alphaValueMapper() const;
|
||||
virtual double inlineSpacing();
|
||||
|
||||
void addSeismicOutline( RigPolyLinesData* pld );
|
||||
|
||||
// interface to be implemented by subclasses
|
||||
public:
|
||||
|
@ -506,7 +506,7 @@ QList<caf::PdmOptionItemInfo> RimSeismicDifferenceData::calculateValueOptions( c
|
||||
RimProject* proj = RimProject::current();
|
||||
if ( ( proj != nullptr ) && ( m_seismicData1() != nullptr ) )
|
||||
{
|
||||
const auto& coll = proj->activeOilField()->seismicCollection().p();
|
||||
const auto& coll = proj->activeOilField()->seismicDataCollection().p();
|
||||
|
||||
for ( auto seisData : coll->seismicData() )
|
||||
{
|
||||
|
@ -68,7 +68,7 @@ CAF_PDM_SOURCE_INIT( RimSeismicSection, "SeismicSection" );
|
||||
RimSeismicSection::RimSeismicSection()
|
||||
: m_pickTargetsEventHandler( new RicPolylineTargetsPickEventHandler( this ) )
|
||||
{
|
||||
CAF_PDM_InitObject( "Seismic Section", ":/Seismic16x16.png" );
|
||||
CAF_PDM_InitObject( "Seismic Section", ":/SeismicSection16x16.png" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_userDescription, "UserDescription", "Description" );
|
||||
|
||||
@ -478,34 +478,7 @@ cvf::ref<RigPolyLinesData> RimSeismicSection::polyLinesData() const
|
||||
|
||||
if ( m_showSeismicOutline() && m_seismicData != nullptr )
|
||||
{
|
||||
auto outline = m_seismicData->worldOutline();
|
||||
if ( outline.size() == 8 )
|
||||
{
|
||||
// seismic bounding box could be all the way up to the sea surface,
|
||||
// make sure to skip bounding box check in drawing code
|
||||
pld->setSkipBoundingBoxCheck( true );
|
||||
|
||||
std::vector<cvf::Vec3d> box;
|
||||
|
||||
for ( auto i : { 4, 0, 1, 3, 2, 0 } )
|
||||
box.push_back( outline[i] );
|
||||
pld->addPolyLine( box );
|
||||
box.clear();
|
||||
|
||||
for ( auto i : { 1, 5, 4, 6, 7, 5 } )
|
||||
box.push_back( outline[i] );
|
||||
pld->addPolyLine( box );
|
||||
box.clear();
|
||||
|
||||
box.push_back( outline[2] );
|
||||
box.push_back( outline[6] );
|
||||
pld->addPolyLine( box );
|
||||
box.clear();
|
||||
|
||||
box.push_back( outline[3] );
|
||||
box.push_back( outline[7] );
|
||||
pld->addPolyLine( box );
|
||||
}
|
||||
m_seismicData->addSeismicOutline( pld.p() );
|
||||
}
|
||||
|
||||
pld->setLineAppearance( m_lineThickness, m_lineColor, false );
|
||||
@ -752,6 +725,8 @@ void RimSeismicSection::fieldChangedByUi( const caf::PdmFieldHandle* changedFiel
|
||||
}
|
||||
else if ( changedField == &m_showImage )
|
||||
{
|
||||
if ( m_seismicData == nullptr ) return;
|
||||
|
||||
QDialog w;
|
||||
QLabel l;
|
||||
QHBoxLayout layout;
|
||||
|
@ -72,7 +72,7 @@ RimSeismicSection* RimSeismicSectionCollection::addNewSection( RiaDefines::Seism
|
||||
RimProject* proj = RimProject::current();
|
||||
if ( proj )
|
||||
{
|
||||
const auto& coll = proj->activeOilField()->seismicCollection().p();
|
||||
const auto& coll = proj->activeOilField()->seismicDataCollection().p();
|
||||
for ( auto* c : coll->seismicData() )
|
||||
{
|
||||
if ( c->boundingBox()->intersects( view->domainBoundingBox() ) )
|
||||
@ -266,5 +266,5 @@ bool RimSeismicSectionCollection::shouldBeVisibleInTree() const
|
||||
RimProject* proj = RimProject::current();
|
||||
if ( proj == nullptr ) return false;
|
||||
|
||||
return !proj->activeOilField()->seismicCollection()->isEmpty();
|
||||
return !proj->activeOilField()->seismicDataCollection()->isEmpty();
|
||||
}
|
||||
|
580
ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicView.cpp
Normal file
580
ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicView.cpp
Normal file
@ -0,0 +1,580 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2023 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 "RimSeismicView.h"
|
||||
|
||||
#include "RigPolyLinesData.h"
|
||||
|
||||
#include "Rim3dOverlayInfoConfig.h"
|
||||
#include "RimAnnotationCollection.h"
|
||||
#include "RimAnnotationInViewCollection.h"
|
||||
#include "RimLegendConfig.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimRegularLegendConfig.h"
|
||||
#include "RimSeismicData.h"
|
||||
#include "RimSeismicSection.h"
|
||||
#include "RimSeismicSectionCollection.h"
|
||||
#include "RimSurfaceCollection.h"
|
||||
#include "RimSurfaceInViewCollection.h"
|
||||
#include "RimTools.h"
|
||||
|
||||
#include "Riu3DMainWindowTools.h"
|
||||
#include "RiuViewer.h"
|
||||
|
||||
#include "RivPolylinePartMgr.h"
|
||||
|
||||
#include "cafPdmUiTreeOrdering.h"
|
||||
|
||||
#include "cafDisplayCoordTransform.h"
|
||||
#include "cvfModelBasicList.h"
|
||||
#include "cvfPart.h"
|
||||
#include "cvfScene.h"
|
||||
#include "cvfString.h"
|
||||
#include "cvfTransform.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RimSeismicView, "RimSeismicView", "SeismicView" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSeismicView::RimSeismicView()
|
||||
{
|
||||
CAF_PDM_InitObject( "Seismic View", ":/SeismicView24x24.png" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_seismicData, "SeismicData", "Seismic Data" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_surfaceCollection, "SurfaceInViewCollection", "Surface Collection Field" );
|
||||
m_surfaceCollection.uiCapability()->setUiTreeHidden( true );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_seismicSectionCollection, "SeismicSectionCollection", "Seismic Collection Field" );
|
||||
m_seismicSectionCollection.uiCapability()->setUiTreeHidden( true );
|
||||
m_seismicSectionCollection = new RimSeismicSectionCollection();
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_annotationCollection, "AnnotationCollection", "Annotations" );
|
||||
m_annotationCollection.uiCapability()->setUiTreeHidden( true );
|
||||
m_annotationCollection = new RimAnnotationInViewCollection;
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_overlayInfoConfig, "OverlayInfoConfig", "Info Box" );
|
||||
m_overlayInfoConfig = new Rim3dOverlayInfoConfig();
|
||||
m_overlayInfoConfig->setReservoirView( this );
|
||||
m_overlayInfoConfig.uiCapability()->setUiTreeHidden( true );
|
||||
|
||||
m_scaleTransform = new cvf::Transform();
|
||||
|
||||
m_surfaceVizModel = new cvf::ModelBasicList;
|
||||
m_surfaceVizModel->setName( "SurfaceModel" );
|
||||
|
||||
setDeletable( true );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSeismicView::~RimSeismicView()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSeismicView::setSeismicData( RimSeismicData* data )
|
||||
{
|
||||
m_seismicData = data;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSeismicData* RimSeismicView::seismicData() const
|
||||
{
|
||||
return m_seismicData;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSeismicView::addSlice( RiaDefines::SeismicSectionType sectionType )
|
||||
{
|
||||
auto section = m_seismicSectionCollection->addNewSection( sectionType );
|
||||
section->setSeismicData( m_seismicData );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSurfaceInViewCollection* RimSeismicView::surfaceInViewCollection() const
|
||||
{
|
||||
return m_surfaceCollection;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSeismicSectionCollection* RimSeismicView::seismicSectionCollection() const
|
||||
{
|
||||
return m_seismicSectionCollection;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimCase* RimSeismicView::ownerCase() const
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaDefines::View3dContent RimSeismicView::viewContent() const
|
||||
{
|
||||
return RiaDefines::View3dContent::SEISMIC;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimSeismicView::isGridVisualizationMode() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimSeismicView::isUsingFormationNames() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimLegendConfig*> RimSeismicView::legendConfigs() const
|
||||
{
|
||||
std::vector<RimLegendConfig*> legends;
|
||||
|
||||
if ( m_surfaceCollection )
|
||||
{
|
||||
for ( auto legendConfig : m_surfaceCollection->legendConfigs() )
|
||||
{
|
||||
legends.push_back( legendConfig );
|
||||
}
|
||||
}
|
||||
|
||||
for ( auto section : seismicSectionCollection()->seismicSections() )
|
||||
{
|
||||
legends.push_back( section->legendConfig() );
|
||||
}
|
||||
|
||||
legends.erase( std::remove( legends.begin(), legends.end(), nullptr ), legends.end() );
|
||||
|
||||
return legends;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSeismicView::scheduleGeometryRegen( RivCellSetEnum geometryType )
|
||||
{
|
||||
// no need do do anything here
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::BoundingBox RimSeismicView::domainBoundingBox()
|
||||
{
|
||||
cvf::BoundingBox bb;
|
||||
|
||||
if ( m_seismicData )
|
||||
{
|
||||
bb.add( *m_seismicData->boundingBox() );
|
||||
}
|
||||
return bb;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSeismicView::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
|
||||
{
|
||||
if ( changedField == &m_seismicData )
|
||||
{
|
||||
updateGridBoxData();
|
||||
scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
else
|
||||
{
|
||||
Rim3dView::fieldChangedByUi( changedField, oldValue, newValue );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSeismicView::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
||||
{
|
||||
auto genGrp = uiOrdering.addNewGroup( "General" );
|
||||
|
||||
genGrp->add( userDescriptionField() );
|
||||
genGrp->add( &m_seismicData );
|
||||
|
||||
uiOrdering.skipRemainingFields( true );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSeismicView::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/ )
|
||||
{
|
||||
uiTreeOrdering.add( m_overlayInfoConfig() );
|
||||
uiTreeOrdering.add( seismicSectionCollection() );
|
||||
if ( surfaceInViewCollection() ) uiTreeOrdering.add( surfaceInViewCollection() );
|
||||
uiTreeOrdering.add( annotationCollection() );
|
||||
|
||||
uiTreeOrdering.skipRemainingChildren( true );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSeismicView::onCreateDisplayModel()
|
||||
{
|
||||
if ( nativeOrOverrideViewer() == nullptr ) return;
|
||||
|
||||
if ( !m_seismicData ) return;
|
||||
|
||||
// Remove all existing frames from the viewer.
|
||||
nativeOrOverrideViewer()->removeAllFrames( isUsingOverrideViewer() );
|
||||
|
||||
// Set the Main scene in the viewer.
|
||||
cvf::ref<cvf::Scene> mainScene = new cvf::Scene;
|
||||
|
||||
// Seismic sections
|
||||
|
||||
cvf::ref<caf::DisplayCoordTransform> transform = displayCoordTransform();
|
||||
m_seismicVizModel->removeAllParts();
|
||||
|
||||
if ( m_polylinePartMgr.isNull() ) m_polylinePartMgr = new RivPolylinePartMgr( this, this, this );
|
||||
m_polylinePartMgr->appendDynamicGeometryPartsToModel( m_seismicVizModel.p(), transform.p(), domainBoundingBox() );
|
||||
|
||||
m_seismicSectionCollection->appendPartsToModel( this, m_seismicVizModel.p(), transform.p(), domainBoundingBox() );
|
||||
mainScene->addModel( m_seismicVizModel.p() );
|
||||
nativeOrOverrideViewer()->setMainScene( mainScene.p(), isUsingOverrideViewer() );
|
||||
|
||||
// Well path model
|
||||
|
||||
m_wellPathPipeVizModel->removeAllParts();
|
||||
addWellPathsToModel( m_wellPathPipeVizModel.p(), domainBoundingBox(), m_seismicData->inlineSpacing() );
|
||||
nativeOrOverrideViewer()->addStaticModelOnce( m_wellPathPipeVizModel.p(), isUsingOverrideViewer() );
|
||||
|
||||
// Surfaces
|
||||
|
||||
m_surfaceVizModel->removeAllParts();
|
||||
if ( m_surfaceCollection )
|
||||
{
|
||||
bool nativeOnly = true;
|
||||
m_surfaceCollection->appendPartsToModel( m_surfaceVizModel.p(), scaleTransform(), nativeOnly );
|
||||
nativeOrOverrideViewer()->addStaticModelOnce( m_surfaceVizModel.p(), isUsingOverrideViewer() );
|
||||
}
|
||||
|
||||
// Annotations
|
||||
|
||||
cvf::ref<cvf::ModelBasicList> model = new cvf::ModelBasicList;
|
||||
model->setName( "Annotations" );
|
||||
addAnnotationsToModel( model.p() );
|
||||
mainScene->addModel( model.p() );
|
||||
|
||||
onUpdateLegends();
|
||||
if ( m_surfaceCollection )
|
||||
{
|
||||
m_surfaceCollection->applySingleColorEffect();
|
||||
}
|
||||
|
||||
if ( m_seismicData ) nativeOrOverrideViewer()->setPointOfInterest( m_seismicData->boundingBox()->center() );
|
||||
|
||||
m_overlayInfoConfig()->update3DInfo();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSeismicView::onUpdateDisplayModelForCurrentTimeStep()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSeismicView::onClampCurrentTimestep()
|
||||
{
|
||||
m_currentTimeStep = 0;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
size_t RimSeismicView::onTimeStepCountRequested()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimSeismicView::isTimeStepDependentDataVisible() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSeismicView::defineAxisLabels( cvf::String* xLabel, cvf::String* yLabel, cvf::String* zLabel )
|
||||
{
|
||||
*xLabel = "E(x)";
|
||||
*yLabel = "N(y)";
|
||||
*zLabel = "Z";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSeismicView::onCreatePartCollectionFromSelection( cvf::Collection<cvf::Part>* parts )
|
||||
{
|
||||
// no action needed, might be needed if we want to hilite something later
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSeismicView::onUpdateStaticCellColors()
|
||||
{
|
||||
// no action needed
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSeismicView::onUpdateLegends()
|
||||
{
|
||||
if ( nativeOrOverrideViewer() )
|
||||
{
|
||||
if ( !isUsingOverrideViewer() )
|
||||
{
|
||||
nativeOrOverrideViewer()->removeAllColorLegends();
|
||||
}
|
||||
else
|
||||
{
|
||||
std::vector<RimLegendConfig*> legendConfs = this->legendConfigs();
|
||||
|
||||
for ( auto legendConf : legendConfs )
|
||||
{
|
||||
nativeOrOverrideViewer()->removeColorLegend( legendConf->titledOverlayFrame() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( !nativeOrOverrideViewer() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ( m_surfaceCollection && m_surfaceCollection->isChecked() )
|
||||
{
|
||||
m_surfaceCollection->updateLegendRangesTextAndVisibility( nativeOrOverrideViewer(), isUsingOverrideViewer() );
|
||||
}
|
||||
|
||||
if ( m_seismicSectionCollection->isChecked() )
|
||||
{
|
||||
m_seismicSectionCollection->updateLegendRangesTextAndVisibility( nativeOrOverrideViewer(), isUsingOverrideViewer() );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSeismicView::onLoadDataAndUpdate()
|
||||
{
|
||||
updateSurfacesInViewTreeItems();
|
||||
syncronizeLocalAnnotationsFromGlobal();
|
||||
onUpdateScaleTransform();
|
||||
|
||||
updateMdiWindowVisibility();
|
||||
|
||||
if ( m_surfaceCollection ) m_surfaceCollection->loadData();
|
||||
|
||||
scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSeismicView::selectOverlayInfoConfig()
|
||||
{
|
||||
Riu3DMainWindowTools::selectAsCurrentItem( m_overlayInfoConfig );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::Transform* RimSeismicView::scaleTransform()
|
||||
{
|
||||
return m_scaleTransform.p();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimSeismicView::createAutoName() const
|
||||
{
|
||||
if ( m_seismicData != nullptr )
|
||||
{
|
||||
return QString::fromStdString( m_seismicData->userDescription() );
|
||||
}
|
||||
|
||||
return "Seismic View";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSeismicView::updateGridBoxData()
|
||||
{
|
||||
if ( viewer() )
|
||||
{
|
||||
viewer()->updateGridBoxData( m_scaleZ(), cvf::Vec3d::ZERO, backgroundColor(), domainBoundingBox(), fontSize() );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSeismicView::updateSurfacesInViewTreeItems()
|
||||
{
|
||||
RimProject* proj = RimProject::current();
|
||||
RimSurfaceCollection* surfColl = proj->activeOilField()->surfaceCollection();
|
||||
|
||||
if ( surfColl && surfColl->containsSurface() )
|
||||
{
|
||||
if ( !m_surfaceCollection() )
|
||||
{
|
||||
m_surfaceCollection = new RimSurfaceInViewCollection();
|
||||
}
|
||||
|
||||
m_surfaceCollection->setSurfaceCollection( surfColl );
|
||||
m_surfaceCollection->updateFromSurfaceCollection();
|
||||
}
|
||||
else
|
||||
{
|
||||
delete m_surfaceCollection;
|
||||
}
|
||||
|
||||
updateConnectedEditors();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<RigPolyLinesData> RimSeismicView::polyLinesData() const
|
||||
{
|
||||
cvf::ref<RigPolyLinesData> pld = new RigPolyLinesData;
|
||||
|
||||
if ( m_seismicData != nullptr )
|
||||
{
|
||||
m_seismicData->addSeismicOutline( pld.p() );
|
||||
pld->setLineAppearance( 1, { 255, 255, 255 }, false );
|
||||
pld->setZPlaneLock( false, 0.0 );
|
||||
pld->setVisibility( true, false );
|
||||
}
|
||||
else
|
||||
{
|
||||
pld->setVisibility( false, false );
|
||||
}
|
||||
|
||||
return pld;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSeismicView::setDefaultView()
|
||||
{
|
||||
if ( viewer() )
|
||||
{
|
||||
viewer()->setDefaultView( cvf::Vec3d::Y_AXIS, cvf::Vec3d::Z_AXIS );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QList<caf::PdmOptionItemInfo> RimSeismicView::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions )
|
||||
{
|
||||
QList<caf::PdmOptionItemInfo> options;
|
||||
|
||||
if ( fieldNeedingOptions == &m_seismicData )
|
||||
{
|
||||
RimTools::seismicDataOptionItems( &options, domainBoundingBox() );
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimSeismicView::characteristicCellSize() const
|
||||
{
|
||||
if ( m_seismicData != nullptr )
|
||||
{
|
||||
return m_seismicData->inlineSpacing();
|
||||
}
|
||||
|
||||
return Rim3dView::characteristicCellSize();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigHistogramData RimSeismicView::histogramData()
|
||||
{
|
||||
RigHistogramData histData;
|
||||
|
||||
if ( m_seismicData )
|
||||
{
|
||||
auto xvals = m_seismicData->histogramXvalues();
|
||||
auto yvals = m_seismicData->histogramYvalues();
|
||||
|
||||
histData.min = xvals.front();
|
||||
histData.max = xvals.back();
|
||||
histData.mean = 0.0;
|
||||
histData.sum = 0.0;
|
||||
|
||||
histData.histogram.resize( yvals.size() );
|
||||
|
||||
int i = 0;
|
||||
for ( auto val : yvals )
|
||||
{
|
||||
histData.histogram[i++] = (size_t)val;
|
||||
}
|
||||
}
|
||||
return histData;
|
||||
}
|
107
ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicView.h
Normal file
107
ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicView.h
Normal file
@ -0,0 +1,107 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2023 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 "RiaSeismicDefines.h"
|
||||
|
||||
#include "Rim3dView.h"
|
||||
#include "RimPolylinesDataInterface.h"
|
||||
|
||||
#include "cafPdmField.h"
|
||||
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
class RimCase;
|
||||
class RimSeismicData;
|
||||
class RimSurfaceInViewCollection;
|
||||
class RimSeismicSectionCollection;
|
||||
class Rim3dOverlayInfoConfig;
|
||||
class RivPolylinePartMgr;
|
||||
class RigHistogramData;
|
||||
class RimAnnotationInViewCollection;
|
||||
|
||||
class RimSeismicView : public Rim3dView, public RimPolylinesDataInterface
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
RimSeismicView();
|
||||
~RimSeismicView() override;
|
||||
|
||||
void setSeismicData( RimSeismicData* data );
|
||||
RimSeismicData* seismicData() const;
|
||||
|
||||
void addSlice( RiaDefines::SeismicSectionType sectionType );
|
||||
|
||||
RimSurfaceInViewCollection* surfaceInViewCollection() const;
|
||||
RimSeismicSectionCollection* seismicSectionCollection() const;
|
||||
|
||||
RimCase* ownerCase() const override;
|
||||
RiaDefines::View3dContent viewContent() const override;
|
||||
bool isGridVisualizationMode() const override;
|
||||
bool isUsingFormationNames() const override;
|
||||
std::vector<RimLegendConfig*> legendConfigs() const override;
|
||||
void scheduleGeometryRegen( RivCellSetEnum geometryType ) override;
|
||||
|
||||
cvf::BoundingBox domainBoundingBox() override;
|
||||
void updateGridBoxData() override;
|
||||
double characteristicCellSize() const override;
|
||||
RigHistogramData histogramData();
|
||||
|
||||
cvf::ref<RigPolyLinesData> polyLinesData() const override;
|
||||
|
||||
protected:
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "" ) override;
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
|
||||
|
||||
void onCreateDisplayModel() override;
|
||||
void onUpdateDisplayModelForCurrentTimeStep() override;
|
||||
void onClampCurrentTimestep() override;
|
||||
size_t onTimeStepCountRequested() override;
|
||||
bool isTimeStepDependentDataVisible() const override;
|
||||
void defineAxisLabels( cvf::String* xLabel, cvf::String* yLabel, cvf::String* zLabel ) override;
|
||||
void onCreatePartCollectionFromSelection( cvf::Collection<cvf::Part>* parts ) override;
|
||||
void onUpdateStaticCellColors() override;
|
||||
void onUpdateLegends() override;
|
||||
|
||||
void onLoadDataAndUpdate() override;
|
||||
void selectOverlayInfoConfig() override;
|
||||
|
||||
cvf::Transform* scaleTransform() override;
|
||||
|
||||
QString createAutoName() const override;
|
||||
|
||||
void setDefaultView() override;
|
||||
|
||||
void updateSurfacesInViewTreeItems() override;
|
||||
|
||||
private:
|
||||
caf::PdmChildField<RimSurfaceInViewCollection*> m_surfaceCollection;
|
||||
caf::PdmChildField<RimSeismicSectionCollection*> m_seismicSectionCollection;
|
||||
|
||||
caf::PdmChildField<Rim3dOverlayInfoConfig*> m_overlayInfoConfig;
|
||||
|
||||
caf::PdmPtrField<RimSeismicData*> m_seismicData;
|
||||
|
||||
cvf::ref<cvf::ModelBasicList> m_surfaceVizModel;
|
||||
cvf::ref<RivPolylinePartMgr> m_polylinePartMgr;
|
||||
|
||||
cvf::ref<cvf::Transform> m_scaleTransform;
|
||||
};
|
@ -0,0 +1,81 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2023 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 "RimSeismicViewCollection.h"
|
||||
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include "Rim3dView.h"
|
||||
#include "RimGridView.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSeismicView.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RimSeismicViewCollection, "SeismicViewCollection", "SeismicViewCollection" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSeismicViewCollection::RimSeismicViewCollection()
|
||||
{
|
||||
CAF_PDM_InitObject( "Views", ":/SeismicViews24x24.png" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_views, "Views", "Seismic Views" );
|
||||
m_views.uiCapability()->setUiTreeHidden( true );
|
||||
|
||||
setDeletable( false );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSeismicViewCollection::~RimSeismicViewCollection()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimSeismicView*> RimSeismicViewCollection::views() const
|
||||
{
|
||||
return m_views.childrenByType();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimSeismicViewCollection::isEmpty()
|
||||
{
|
||||
return !m_views.hasChildren();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSeismicView* RimSeismicViewCollection::addView( RimSeismicData* data, RiaDefines::SeismicSectionType defaultSection )
|
||||
{
|
||||
RimSeismicView* view = new RimSeismicView();
|
||||
|
||||
view->setSeismicData( data );
|
||||
view->loadDataAndUpdate();
|
||||
|
||||
view->addSlice( defaultSection );
|
||||
|
||||
m_views.push_back( view );
|
||||
|
||||
return view;
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2023 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 "RiaSeismicDefines.h"
|
||||
|
||||
#include "cafPdmField.h"
|
||||
|
||||
#include "cafPdmChildArrayField.h"
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
class RimSeismicView;
|
||||
class RimSeismicData;
|
||||
|
||||
class RimSeismicViewCollection : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
RimSeismicViewCollection();
|
||||
~RimSeismicViewCollection() override;
|
||||
|
||||
bool isEmpty();
|
||||
|
||||
RimSeismicView* addView( RimSeismicData* data, RiaDefines::SeismicSectionType defaultSection );
|
||||
|
||||
std::vector<RimSeismicView*> views() const;
|
||||
|
||||
private:
|
||||
caf::PdmChildArrayField<RimSeismicView*> m_views;
|
||||
};
|
@ -299,18 +299,15 @@ void RimSurfaceCollection::updateViews( const std::vector<RimSurface*>& surfsToR
|
||||
{
|
||||
RimProject* proj = RimProject::current();
|
||||
|
||||
// Make sure the tree items are synchronized
|
||||
std::vector<Rim3dView*> views;
|
||||
proj->allViews( views );
|
||||
|
||||
// Make sure the tree items are synchronized
|
||||
|
||||
for ( auto view : views )
|
||||
{
|
||||
auto gridView = dynamic_cast<RimGridView*>( view );
|
||||
if ( gridView ) gridView->updateSurfacesInViewTreeItems();
|
||||
view->updateSurfacesInViewTreeItems();
|
||||
}
|
||||
|
||||
std::set<RimGridView*> viewsNeedingUpdate;
|
||||
std::set<Rim3dView*> viewsNeedingUpdate;
|
||||
|
||||
for ( auto surf : surfsToReload )
|
||||
{
|
||||
@ -320,7 +317,7 @@ void RimSurfaceCollection::updateViews( const std::vector<RimSurface*>& surfsToR
|
||||
surfInView->clearGeometry();
|
||||
surfInView->surfaceResultDefinition()->legendConfig()->setShowLegend( showLegend );
|
||||
|
||||
auto gridView = surfInView->firstAncestorOrThisOfType<RimGridView>();
|
||||
auto gridView = surfInView->firstAncestorOrThisOfType<Rim3dView>();
|
||||
if ( gridView ) viewsNeedingUpdate.insert( gridView );
|
||||
}
|
||||
}
|
||||
@ -347,8 +344,8 @@ void RimSurfaceCollection::updateViews( const std::vector<RimSurface*>& surfsToR
|
||||
void RimSurfaceCollection::updateViews()
|
||||
{
|
||||
RimProject* proj = RimProject::current();
|
||||
std::vector<RimGridView*> views;
|
||||
proj->allVisibleGridViews( views );
|
||||
std::vector<Rim3dView*> views;
|
||||
proj->allViews( views );
|
||||
|
||||
// Make sure the tree items are synchronized
|
||||
|
||||
|
@ -141,6 +141,20 @@ RivSurfacePartMgr* RimSurfaceInView::surfacePartMgr()
|
||||
return m_surfacePartMgr.p();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RivSurfacePartMgr* RimSurfaceInView::nativeSurfacePartMgr()
|
||||
{
|
||||
bool nativeOnly = true;
|
||||
if ( m_surfacePartMgr.isNull() || !m_surfacePartMgr->isNativePartMgr() )
|
||||
{
|
||||
m_surfacePartMgr = new RivSurfacePartMgr( this, nativeOnly );
|
||||
}
|
||||
|
||||
return m_surfacePartMgr.p();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -221,7 +235,7 @@ void RimSurfaceInView::fieldChangedByUi( const caf::PdmFieldHandle* changedField
|
||||
|
||||
if ( scheduleRedraw )
|
||||
{
|
||||
auto ownerView = firstAncestorOrThisOfTypeAsserted<RimGridView>();
|
||||
auto ownerView = firstAncestorOrThisOfTypeAsserted<Rim3dView>();
|
||||
ownerView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
}
|
||||
@ -242,9 +256,13 @@ void RimSurfaceInView::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderin
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimIntersectionResultsDefinitionCollection* RimSurfaceInView::findSeparateResultsCollection()
|
||||
{
|
||||
auto view = firstAncestorOrThisOfTypeAsserted<RimGridView>();
|
||||
auto view = firstAncestorOrThisOfType<RimGridView>();
|
||||
if ( view )
|
||||
{
|
||||
return view->separateSurfaceResultsCollection();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
|
@ -53,6 +53,7 @@ public:
|
||||
|
||||
void clearGeometry();
|
||||
RivSurfacePartMgr* surfacePartMgr();
|
||||
RivSurfacePartMgr* nativeSurfacePartMgr();
|
||||
const RivIntersectionGeometryGeneratorInterface* intersectionGeometryGenerator() const override;
|
||||
|
||||
void loadDataAndUpdate();
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
#include "RimSurfaceInViewCollection.h"
|
||||
|
||||
#include "Rim3dView.h"
|
||||
#include "RimEnsembleSurface.h"
|
||||
#include "RimGridView.h"
|
||||
#include "RimIntersectionResultDefinition.h"
|
||||
@ -51,7 +52,7 @@ RimSurfaceInViewCollection::RimSurfaceInViewCollection()
|
||||
CAF_PDM_InitFieldNoDefault( &m_collectionsInView, "SurfacesInViewFieldCollections", "SurfacesInViewFieldCollections" );
|
||||
m_collectionsInView.uiCapability()->setUiTreeHidden( true );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_surfacesInView, "SurfacesInViewField", "SurfacesInViewField" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_surfacesInView, "SurfacesInViewField", "Surfaces" );
|
||||
m_surfacesInView.uiCapability()->setUiTreeHidden( true );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_surfaceCollection, "SurfaceCollectionRef", "SurfaceCollection" );
|
||||
@ -279,7 +280,7 @@ void RimSurfaceInViewCollection::clearGeometry()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSurfaceInViewCollection::appendPartsToModel( cvf::ModelBasicList* model, cvf::Transform* scaleTransform )
|
||||
void RimSurfaceInViewCollection::appendPartsToModel( cvf::ModelBasicList* model, cvf::Transform* scaleTransform, bool onlyNativeParts )
|
||||
{
|
||||
if ( !isChecked() ) return;
|
||||
|
||||
@ -287,17 +288,24 @@ void RimSurfaceInViewCollection::appendPartsToModel( cvf::ModelBasicList* model,
|
||||
{
|
||||
if ( coll->isChecked() )
|
||||
{
|
||||
coll->appendPartsToModel( model, scaleTransform );
|
||||
coll->appendPartsToModel( model, scaleTransform, onlyNativeParts );
|
||||
}
|
||||
}
|
||||
|
||||
for ( RimSurfaceInView* surf : m_surfacesInView )
|
||||
{
|
||||
if ( surf->isActive() )
|
||||
{
|
||||
if ( onlyNativeParts )
|
||||
{
|
||||
surf->nativeSurfacePartMgr()->appendNativeGeometryPartsToModel( model, scaleTransform );
|
||||
}
|
||||
else
|
||||
{
|
||||
surf->surfacePartMgr()->appendIntersectionGeometryPartsToModel( model, scaleTransform );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
model->updateBoundingBoxesRecursive();
|
||||
}
|
||||
@ -311,7 +319,7 @@ void RimSurfaceInViewCollection::fieldChangedByUi( const caf::PdmFieldHandle* ch
|
||||
|
||||
if ( changedField == &m_isChecked )
|
||||
{
|
||||
auto ownerView = firstAncestorOrThisOfTypeAsserted<RimGridView>();
|
||||
auto ownerView = firstAncestorOrThisOfTypeAsserted<Rim3dView>();
|
||||
ownerView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ public:
|
||||
void loadData();
|
||||
void clearGeometry();
|
||||
|
||||
void appendPartsToModel( cvf::ModelBasicList* surfaceVizModel, cvf::Transform* scaleTransform );
|
||||
void appendPartsToModel( cvf::ModelBasicList* surfaceVizModel, cvf::Transform* scaleTransform, bool onlyNativeParts = false );
|
||||
void updateCellResultColor( bool hasGeneralCellResult, int timeStepIndex );
|
||||
void applySingleColorEffect();
|
||||
|
||||
|
@ -252,7 +252,7 @@ void RiuViewer::clearRimView()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuViewer::setDefaultView()
|
||||
void RiuViewer::setDefaultView( const cvf::Vec3d& dir, const cvf::Vec3d& up )
|
||||
{
|
||||
cvf::BoundingBox bb = m_mainRendering->boundingBox();
|
||||
if ( !bb.isValid() )
|
||||
@ -273,7 +273,7 @@ void RiuViewer::setDefaultView()
|
||||
}
|
||||
}
|
||||
|
||||
m_mainCamera->fitView( bb, -cvf::Vec3d::Z_AXIS, cvf::Vec3d::Y_AXIS );
|
||||
m_mainCamera->fitView( bb, dir, up );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -79,7 +79,7 @@ public:
|
||||
RiuViewer( const RiuViewer& ) = delete;
|
||||
|
||||
void clearRimView();
|
||||
void setDefaultView();
|
||||
void setDefaultView( const cvf::Vec3d& dir, const cvf::Vec3d& up );
|
||||
cvf::Vec3d pointOfInterest();
|
||||
void setPointOfInterest( cvf::Vec3d poi );
|
||||
void setOwnerReservoirView( RiuViewerToViewInterface* owner );
|
||||
|
@ -60,7 +60,9 @@
|
||||
#include "RimLegendConfig.h"
|
||||
#include "RimPerforationInterval.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSeismicDataInterface.h"
|
||||
#include "RimSeismicSection.h"
|
||||
#include "RimSeismicView.h"
|
||||
#include "RimSimWellInView.h"
|
||||
#include "RimStimPlanFractureTemplate.h"
|
||||
#include "RimSurfaceInView.h"
|
||||
@ -171,6 +173,8 @@ void RiuViewerCommands::addCompareToViewMenu( caf::CmdFeatureMenuBuilder* menuBu
|
||||
RimProject::current()->allViews( views );
|
||||
for ( auto view : views )
|
||||
{
|
||||
if ( dynamic_cast<RimSeismicView*>( view ) ) continue;
|
||||
|
||||
if ( view != mainGridView )
|
||||
{
|
||||
validComparisonViews.push_back( view );
|
||||
@ -263,6 +267,13 @@ void RiuViewerCommands::displayContextMenu( QMouseEvent* event )
|
||||
|
||||
// Check type of view
|
||||
|
||||
RimSeismicView* seisView = dynamic_cast<RimSeismicView*>( mainOrComparisonView );
|
||||
if ( seisView )
|
||||
{
|
||||
// no context menu support in seismic views, yet
|
||||
return;
|
||||
}
|
||||
|
||||
RimGridView* gridView = dynamic_cast<RimGridView*>( mainOrComparisonView );
|
||||
Rim2dIntersectionView* int2dView = dynamic_cast<Rim2dIntersectionView*>( mainOrComparisonView );
|
||||
|
||||
@ -1210,8 +1221,16 @@ bool RiuViewerCommands::handleOverlayItemPicking( int winPosX, int winPosY )
|
||||
for ( const auto& legendConfig : legendConfigs )
|
||||
{
|
||||
if ( legendConfig && legendConfig->titledOverlayFrame() == pickedOverlayItem )
|
||||
{
|
||||
auto seisInterface = legendConfig->firstAncestorOfType<RimSeismicDataInterface>();
|
||||
if ( seisInterface != nullptr )
|
||||
{
|
||||
RiuMainWindow::instance()->selectAsCurrentItem( seisInterface );
|
||||
}
|
||||
else
|
||||
{
|
||||
RiuMainWindow::instance()->selectAsCurrentItem( legendConfig );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user