mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5112 Make selected result definition available through 3ditem selection system
Make PVT, Relperm, Mohr and rResult plot aware
This commit is contained in:
parent
8cc2194764
commit
5556d2d9eb
@ -225,8 +225,8 @@ bool RicNewGridTimeHistoryCurveFeature::isCommandEnabled()
|
|||||||
const RiuEclipseSelectionItem* eclSelectionItem = dynamic_cast<const RiuEclipseSelectionItem*>( items[0] );
|
const RiuEclipseSelectionItem* eclSelectionItem = dynamic_cast<const RiuEclipseSelectionItem*>( items[0] );
|
||||||
if ( eclSelectionItem )
|
if ( eclSelectionItem )
|
||||||
{
|
{
|
||||||
if ( eclSelectionItem->m_view->cellResult()->isFlowDiagOrInjectionFlooding() &&
|
if ( eclSelectionItem->m_resultDefinition->isFlowDiagOrInjectionFlooding() &&
|
||||||
eclSelectionItem->m_view->cellResult()->resultVariable() != RIG_NUM_FLOODED_PV )
|
eclSelectionItem->m_resultDefinition->resultVariable() != RIG_NUM_FLOODED_PV )
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#include "RimGeoMechGeometrySelectionItem.h"
|
#include "RimGeoMechGeometrySelectionItem.h"
|
||||||
|
|
||||||
#include "RimGeoMechCase.h"
|
#include "RimGeoMechCase.h"
|
||||||
|
#include "RimGeoMechResultDefinition.h"
|
||||||
#include "RimGeoMechView.h"
|
#include "RimGeoMechView.h"
|
||||||
|
|
||||||
#include "Riu3dSelectionManager.h"
|
#include "Riu3dSelectionManager.h"
|
||||||
@ -59,7 +60,7 @@ RimGeoMechGeometrySelectionItem::~RimGeoMechGeometrySelectionItem() {}
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimGeoMechGeometrySelectionItem::setFromSelectionItem( const RiuGeoMechSelectionItem* selectionItem )
|
void RimGeoMechGeometrySelectionItem::setFromSelectionItem( const RiuGeoMechSelectionItem* selectionItem )
|
||||||
{
|
{
|
||||||
m_geoMechCase = selectionItem->m_view->geoMechCase();
|
m_geoMechCase = selectionItem->m_resultDefinition->geoMechCase();
|
||||||
|
|
||||||
m_gridIndex = selectionItem->m_gridIndex;
|
m_gridIndex = selectionItem->m_gridIndex;
|
||||||
m_cellIndex = selectionItem->m_cellIndex;
|
m_cellIndex = selectionItem->m_cellIndex;
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#include "RigTimeHistoryResultAccessor.h"
|
#include "RigTimeHistoryResultAccessor.h"
|
||||||
|
|
||||||
#include "RimEclipseCase.h"
|
#include "RimEclipseCase.h"
|
||||||
|
#include "RimEclipseResultDefinition.h"
|
||||||
#include "RimEclipseView.h"
|
#include "RimEclipseView.h"
|
||||||
|
|
||||||
#include "Riu3dSelectionManager.h"
|
#include "Riu3dSelectionManager.h"
|
||||||
@ -61,7 +62,7 @@ void RimEclipseGeometrySelectionItem::setFromSelectionItem( const RiuEclipseSele
|
|||||||
m_cellIndex = selectionItem->m_gridLocalCellIndex;
|
m_cellIndex = selectionItem->m_gridLocalCellIndex;
|
||||||
m_localIntersectionPointInDisplay = selectionItem->m_localIntersectionPointInDisplay;
|
m_localIntersectionPointInDisplay = selectionItem->m_localIntersectionPointInDisplay;
|
||||||
|
|
||||||
m_eclipseCase = selectionItem->m_view->eclipseCase();
|
m_eclipseCase = selectionItem->m_resultDefinition->eclipseCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -2051,12 +2051,13 @@ void RimEclipseView::onCreatePartCollectionFromSelection( cvf::Collection<cvf::P
|
|||||||
if ( items[i]->type() == RiuSelectionItem::ECLIPSE_SELECTION_OBJECT )
|
if ( items[i]->type() == RiuSelectionItem::ECLIPSE_SELECTION_OBJECT )
|
||||||
{
|
{
|
||||||
RiuEclipseSelectionItem* eclipseSelItem = static_cast<RiuEclipseSelectionItem*>( items[i] );
|
RiuEclipseSelectionItem* eclipseSelItem = static_cast<RiuEclipseSelectionItem*>( items[i] );
|
||||||
|
|
||||||
if ( eclipseSelItem && eclipseSelItem->m_view == this )
|
if ( eclipseSelItem && eclipseSelItem->m_view == this )
|
||||||
{
|
{
|
||||||
CVF_ASSERT( eclipseSelItem->m_view->eclipseCase() );
|
CVF_ASSERT( eclipseSelItem->m_resultDefinition->eclipseCase() );
|
||||||
CVF_ASSERT( eclipseSelItem->m_view->eclipseCase()->eclipseCaseData() );
|
CVF_ASSERT( eclipseSelItem->m_resultDefinition->eclipseCase()->eclipseCaseData() );
|
||||||
|
|
||||||
RivSingleCellPartGenerator partGen( eclipseSelItem->m_view->eclipseCase()->eclipseCaseData(),
|
RivSingleCellPartGenerator partGen( eclipseSelItem->m_resultDefinition->eclipseCase()->eclipseCaseData(),
|
||||||
eclipseSelItem->m_gridIndex,
|
eclipseSelItem->m_gridIndex,
|
||||||
eclipseSelItem->m_gridLocalCellIndex );
|
eclipseSelItem->m_gridLocalCellIndex );
|
||||||
|
|
||||||
|
@ -258,6 +258,14 @@ void RimGeoMechResultDefinition::setGeoMechCase( RimGeoMechCase* geomCase )
|
|||||||
m_geomCase = geomCase;
|
m_geomCase = geomCase;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimGeoMechCase* RimGeoMechResultDefinition::geoMechCase() const
|
||||||
|
{
|
||||||
|
return m_geomCase;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -46,7 +46,8 @@ public:
|
|||||||
RimGeoMechResultDefinition( void );
|
RimGeoMechResultDefinition( void );
|
||||||
~RimGeoMechResultDefinition( void ) override;
|
~RimGeoMechResultDefinition( void ) override;
|
||||||
|
|
||||||
void setGeoMechCase( RimGeoMechCase* geomCase );
|
void setGeoMechCase( RimGeoMechCase* geomCase );
|
||||||
|
RimGeoMechCase* geoMechCase() const;
|
||||||
|
|
||||||
RigGeoMechCaseData* ownerCaseData() const;
|
RigGeoMechCaseData* ownerCaseData() const;
|
||||||
bool hasResult();
|
bool hasResult();
|
||||||
|
@ -837,20 +837,24 @@ void RimGeoMechView::calculateCurrentTotalCellVisibility( cvf::UByteArray* total
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimGeoMechView::onCreatePartCollectionFromSelection( cvf::Collection<cvf::Part>* parts )
|
void RimGeoMechView::onCreatePartCollectionFromSelection( cvf::Collection<cvf::Part>* parts )
|
||||||
{
|
{
|
||||||
Riu3dSelectionManager* riuSelManager = Riu3dSelectionManager::instance();
|
Riu3dSelectionManager* riuSelManager = Riu3dSelectionManager::instance();
|
||||||
|
|
||||||
std::vector<RiuSelectionItem*> items;
|
std::vector<RiuSelectionItem*> items;
|
||||||
riuSelManager->selectedItems( items );
|
riuSelManager->selectedItems( items );
|
||||||
|
|
||||||
for ( size_t i = 0; i < items.size(); i++ )
|
for ( size_t i = 0; i < items.size(); i++ )
|
||||||
{
|
{
|
||||||
if ( items[i]->type() == RiuSelectionItem::GEOMECH_SELECTION_OBJECT )
|
if ( items[i]->type() == RiuSelectionItem::GEOMECH_SELECTION_OBJECT )
|
||||||
{
|
{
|
||||||
RiuGeoMechSelectionItem* geomSelItem = static_cast<RiuGeoMechSelectionItem*>( items[i] );
|
RiuGeoMechSelectionItem* geomSelItem = static_cast<RiuGeoMechSelectionItem*>( items[i] );
|
||||||
if ( geomSelItem && geomSelItem->m_view == this && geomSelItem->m_view->geoMechCase() )
|
|
||||||
|
if ( geomSelItem && geomSelItem->m_view == this && geomSelItem->m_resultDefinition->geoMechCase() )
|
||||||
{
|
{
|
||||||
RivSingleCellPartGenerator partGen( geomSelItem->m_view->geoMechCase(),
|
RivSingleCellPartGenerator partGen( geomSelItem->m_resultDefinition->geoMechCase(),
|
||||||
geomSelItem->m_gridIndex,
|
geomSelItem->m_gridIndex,
|
||||||
geomSelItem->m_cellIndex );
|
geomSelItem->m_cellIndex );
|
||||||
cvf::ref<cvf::Part> part = partGen.createPart( geomSelItem->m_color );
|
|
||||||
|
cvf::ref<cvf::Part> part = partGen.createPart( geomSelItem->m_color );
|
||||||
part->setTransform( this->scaleTransform() );
|
part->setTransform( this->scaleTransform() );
|
||||||
|
|
||||||
parts->push_back( part.p() );
|
parts->push_back( part.p() );
|
||||||
|
@ -127,7 +127,7 @@ void RimGridTimeHistoryCurve::setFromSelectionItem( const RiuSelectionItem* sele
|
|||||||
if ( eclSelectionItem->m_view )
|
if ( eclSelectionItem->m_view )
|
||||||
{
|
{
|
||||||
m_eclipseResultDefinition = new RimEclipseResultDefinition;
|
m_eclipseResultDefinition = new RimEclipseResultDefinition;
|
||||||
m_eclipseResultDefinition->simpleCopy( eclSelectionItem->m_view->cellResult() );
|
m_eclipseResultDefinition->simpleCopy( eclSelectionItem->m_resultDefinition );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -142,9 +142,8 @@ void RimGridTimeHistoryCurve::setFromSelectionItem( const RiuSelectionItem* sele
|
|||||||
if ( geoMechSelectionItem->m_view )
|
if ( geoMechSelectionItem->m_view )
|
||||||
{
|
{
|
||||||
m_geoMechResultDefinition = new RimGeoMechResultDefinition;
|
m_geoMechResultDefinition = new RimGeoMechResultDefinition;
|
||||||
m_geoMechResultDefinition->setGeoMechCase( geoMechSelectionItem->m_view->geoMechCase() );
|
m_geoMechResultDefinition->setGeoMechCase( geoMechSelectionItem->m_resultDefinition->geoMechCase() );
|
||||||
m_geoMechResultDefinition->setResultAddress(
|
m_geoMechResultDefinition->setResultAddress( geoMechSelectionItem->m_resultDefinition->resultAddress() );
|
||||||
geoMechSelectionItem->m_view->cellResultResultDefinition()->resultAddress() );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,6 +50,7 @@
|
|||||||
|
|
||||||
#include <QTcpSocket>
|
#include <QTcpSocket>
|
||||||
|
|
||||||
|
#include "RimGeoMechResultDefinition.h"
|
||||||
#include <array>
|
#include <array>
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -639,27 +640,33 @@ public:
|
|||||||
size_t gridIndex;
|
size_t gridIndex;
|
||||||
int caseId;
|
int caseId;
|
||||||
bool validIndex = true;
|
bool validIndex = true;
|
||||||
|
|
||||||
if ( item->type() == RiuSelectionItem::ECLIPSE_SELECTION_OBJECT )
|
if ( item->type() == RiuSelectionItem::ECLIPSE_SELECTION_OBJECT )
|
||||||
{
|
{
|
||||||
const RiuEclipseSelectionItem* eclipseItem = static_cast<const RiuEclipseSelectionItem*>( item );
|
const RiuEclipseSelectionItem* eclipseItem = static_cast<const RiuEclipseSelectionItem*>( item );
|
||||||
|
|
||||||
eclipseItem->m_view->eclipseCase()
|
eclipseItem->m_resultDefinition->eclipseCase()
|
||||||
->eclipseCaseData()
|
->eclipseCaseData()
|
||||||
->grid( eclipseItem->m_gridIndex )
|
->grid( eclipseItem->m_gridIndex )
|
||||||
->ijkFromCellIndex( eclipseItem->m_gridLocalCellIndex, &i, &j, &k );
|
->ijkFromCellIndex( eclipseItem->m_gridLocalCellIndex, &i, &j, &k );
|
||||||
|
|
||||||
gridIndex = eclipseItem->m_gridIndex;
|
gridIndex = eclipseItem->m_gridIndex;
|
||||||
caseId = eclipseItem->m_view->eclipseCase()->caseId;
|
caseId = eclipseItem->m_resultDefinition->eclipseCase()->caseId;
|
||||||
}
|
}
|
||||||
else if ( item->type() == RiuSelectionItem::GEOMECH_SELECTION_OBJECT )
|
else if ( item->type() == RiuSelectionItem::GEOMECH_SELECTION_OBJECT )
|
||||||
{
|
{
|
||||||
const RiuGeoMechSelectionItem* geomechItem = static_cast<const RiuGeoMechSelectionItem*>( item );
|
const RiuGeoMechSelectionItem* geomechItem = static_cast<const RiuGeoMechSelectionItem*>( item );
|
||||||
validIndex = geomechItem->m_view->femParts()
|
|
||||||
|
validIndex = geomechItem->m_resultDefinition->ownerCaseData()
|
||||||
|
->femParts()
|
||||||
->part( geomechItem->m_gridIndex )
|
->part( geomechItem->m_gridIndex )
|
||||||
->getOrCreateStructGrid()
|
->getOrCreateStructGrid()
|
||||||
->ijkFromCellIndex( geomechItem->m_cellIndex, &i, &j, &k );
|
->ijkFromCellIndex( geomechItem->m_cellIndex, &i, &j, &k );
|
||||||
|
|
||||||
CVF_ASSERT( validIndex );
|
CVF_ASSERT( validIndex );
|
||||||
|
|
||||||
gridIndex = geomechItem->m_gridIndex;
|
gridIndex = geomechItem->m_gridIndex;
|
||||||
caseId = geomechItem->m_view->geoMechCase()->caseId;
|
caseId = geomechItem->m_resultDefinition->geoMechCase()->caseId;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -43,6 +43,7 @@
|
|||||||
#include "RimIntersectionCollection.h"
|
#include "RimIntersectionCollection.h"
|
||||||
#include "RimReservoirCellResultsStorage.h"
|
#include "RimReservoirCellResultsStorage.h"
|
||||||
|
|
||||||
|
#include "RimGeoMechResultDefinition.h"
|
||||||
#include "Riu3dSelectionManager.h"
|
#include "Riu3dSelectionManager.h"
|
||||||
#include "RiuMainWindow.h"
|
#include "RiuMainWindow.h"
|
||||||
#include "RiuProcessMonitor.h"
|
#include "RiuProcessMonitor.h"
|
||||||
@ -1397,7 +1398,7 @@ public:
|
|||||||
{
|
{
|
||||||
const RiuEclipseSelectionItem* eclipseItem = static_cast<const RiuEclipseSelectionItem*>( item );
|
const RiuEclipseSelectionItem* eclipseItem = static_cast<const RiuEclipseSelectionItem*>( item );
|
||||||
|
|
||||||
if ( eclipseItem->m_view->eclipseCase()->caseId == reservoirCase->caseId )
|
if ( eclipseItem->m_resultDefinition->eclipseCase()->caseId == reservoirCase->caseId )
|
||||||
{
|
{
|
||||||
selectedCells.push_back(
|
selectedCells.push_back(
|
||||||
std::make_pair( eclipseItem->m_gridIndex, eclipseItem->m_gridLocalCellIndex ) );
|
std::make_pair( eclipseItem->m_gridIndex, eclipseItem->m_gridLocalCellIndex ) );
|
||||||
@ -1407,7 +1408,7 @@ public:
|
|||||||
{
|
{
|
||||||
const RiuGeoMechSelectionItem* geomechItem = static_cast<const RiuGeoMechSelectionItem*>( item );
|
const RiuGeoMechSelectionItem* geomechItem = static_cast<const RiuGeoMechSelectionItem*>( item );
|
||||||
|
|
||||||
if ( geomechItem->m_view->geoMechCase()->caseId == reservoirCase->caseId )
|
if ( geomechItem->m_resultDefinition->geoMechCase()->caseId == reservoirCase->caseId )
|
||||||
{
|
{
|
||||||
selectedCells.push_back( std::make_pair( geomechItem->m_gridIndex, geomechItem->m_cellIndex ) );
|
selectedCells.push_back( std::make_pair( geomechItem->m_gridIndex, geomechItem->m_cellIndex ) );
|
||||||
}
|
}
|
||||||
|
@ -20,13 +20,13 @@
|
|||||||
#include "Riu3dSelectionManager.h"
|
#include "Riu3dSelectionManager.h"
|
||||||
|
|
||||||
#include "Rim2dIntersectionView.h"
|
#include "Rim2dIntersectionView.h"
|
||||||
|
#include "RimEclipseResultDefinition.h"
|
||||||
#include "RimEclipseView.h"
|
#include "RimEclipseView.h"
|
||||||
|
#include "RimGeoMechResultDefinition.h"
|
||||||
#include "RimGeoMechView.h"
|
#include "RimGeoMechView.h"
|
||||||
#include "RimGridView.h"
|
#include "RimGridView.h"
|
||||||
#include "RimSimWellInView.h"
|
#include "RimSimWellInView.h"
|
||||||
#include "RimWellPath.h"
|
#include "RimWellPath.h"
|
||||||
#include "RimEclipseResultDefinition.h"
|
|
||||||
#include "RimGeoMechResultDefinition.h"
|
|
||||||
|
|
||||||
#include "RivSimWellPipeSourceInfo.h"
|
#include "RivSimWellPipeSourceInfo.h"
|
||||||
#include "RivWellPathSourceInfo.h"
|
#include "RivWellPathSourceInfo.h"
|
||||||
@ -157,7 +157,7 @@ void Riu3dSelectionManager::deleteAllItemsFromSelection( int role )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RiuEclipseSelectionItem::RiuEclipseSelectionItem( RimEclipseView* view,
|
RiuEclipseSelectionItem::RiuEclipseSelectionItem( RimGridView* view,
|
||||||
RimEclipseResultDefinition* resultDefinition,
|
RimEclipseResultDefinition* resultDefinition,
|
||||||
size_t timestepIdx,
|
size_t timestepIdx,
|
||||||
size_t gridIndex,
|
size_t gridIndex,
|
||||||
@ -181,7 +181,7 @@ RiuEclipseSelectionItem::RiuEclipseSelectionItem( RimEclipseView*
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RiuGeoMechSelectionItem::RiuGeoMechSelectionItem( RimGeoMechView* view,
|
RiuGeoMechSelectionItem::RiuGeoMechSelectionItem( RimGridView* view,
|
||||||
RimGeoMechResultDefinition* resultDefinition,
|
RimGeoMechResultDefinition* resultDefinition,
|
||||||
size_t timestepIdx,
|
size_t timestepIdx,
|
||||||
size_t gridIndex,
|
size_t gridIndex,
|
||||||
@ -204,7 +204,7 @@ RiuGeoMechSelectionItem::RiuGeoMechSelectionItem( RimGeoMechView* vi
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RiuGeoMechSelectionItem::RiuGeoMechSelectionItem( RimGeoMechView* view,
|
RiuGeoMechSelectionItem::RiuGeoMechSelectionItem( RimGridView* view,
|
||||||
RimGeoMechResultDefinition* resultDefinition,
|
RimGeoMechResultDefinition* resultDefinition,
|
||||||
size_t timestepIdx,
|
size_t timestepIdx,
|
||||||
size_t gridIndex,
|
size_t gridIndex,
|
||||||
|
@ -132,7 +132,7 @@ public:
|
|||||||
class RiuEclipseSelectionItem : public RiuSelectionItem
|
class RiuEclipseSelectionItem : public RiuSelectionItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit RiuEclipseSelectionItem( RimEclipseView* view,
|
explicit RiuEclipseSelectionItem( RimGridView* view,
|
||||||
RimEclipseResultDefinition* resultDefinition,
|
RimEclipseResultDefinition* resultDefinition,
|
||||||
size_t timestepIdx,
|
size_t timestepIdx,
|
||||||
size_t gridIndex,
|
size_t gridIndex,
|
||||||
@ -150,7 +150,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
caf::PdmPointer<RimEclipseView> m_view;
|
caf::PdmPointer<RimGridView> m_view;
|
||||||
caf::PdmPointer<RimEclipseResultDefinition> m_resultDefinition;
|
caf::PdmPointer<RimEclipseResultDefinition> m_resultDefinition;
|
||||||
size_t m_timestepIdx;
|
size_t m_timestepIdx;
|
||||||
size_t m_gridIndex;
|
size_t m_gridIndex;
|
||||||
@ -169,7 +169,7 @@ public:
|
|||||||
class RiuGeoMechSelectionItem : public RiuSelectionItem
|
class RiuGeoMechSelectionItem : public RiuSelectionItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit RiuGeoMechSelectionItem( RimGeoMechView* view,
|
explicit RiuGeoMechSelectionItem( RimGridView* view,
|
||||||
RimGeoMechResultDefinition* resultDefinition,
|
RimGeoMechResultDefinition* resultDefinition,
|
||||||
size_t timestepIdx,
|
size_t timestepIdx,
|
||||||
size_t gridIndex,
|
size_t gridIndex,
|
||||||
@ -178,7 +178,7 @@ public:
|
|||||||
int elementFace,
|
int elementFace,
|
||||||
const cvf::Vec3d& localIntersectionPointInDisplay );
|
const cvf::Vec3d& localIntersectionPointInDisplay );
|
||||||
|
|
||||||
explicit RiuGeoMechSelectionItem( RimGeoMechView* view,
|
explicit RiuGeoMechSelectionItem( RimGridView* view,
|
||||||
RimGeoMechResultDefinition* resultDefinition,
|
RimGeoMechResultDefinition* resultDefinition,
|
||||||
size_t timestepIdx,
|
size_t timestepIdx,
|
||||||
size_t gridIndex,
|
size_t gridIndex,
|
||||||
@ -195,7 +195,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
caf::PdmPointer<RimGeoMechView> m_view;
|
caf::PdmPointer<RimGridView> m_view;
|
||||||
caf::PdmPointer<RimGeoMechResultDefinition> m_resultDefinition;
|
caf::PdmPointer<RimGeoMechResultDefinition> m_resultDefinition;
|
||||||
size_t m_timestepIdx;
|
size_t m_timestepIdx;
|
||||||
size_t m_gridIndex;
|
size_t m_gridIndex;
|
||||||
|
@ -21,9 +21,13 @@
|
|||||||
#include "RiaColorTables.h"
|
#include "RiaColorTables.h"
|
||||||
|
|
||||||
#include "Rim2dIntersectionView.h"
|
#include "Rim2dIntersectionView.h"
|
||||||
|
#include "RimBoxIntersection.h"
|
||||||
|
#include "RimEclipseCellColors.h"
|
||||||
#include "RimEclipseView.h"
|
#include "RimEclipseView.h"
|
||||||
#include "RimExtrudedCurveIntersection.h"
|
#include "RimExtrudedCurveIntersection.h"
|
||||||
|
#include "RimGeoMechCellColors.h"
|
||||||
#include "RimGeoMechView.h"
|
#include "RimGeoMechView.h"
|
||||||
|
#include "RimIntersectionResultDefinition.h"
|
||||||
|
|
||||||
#include "Riu3dSelectionManager.h"
|
#include "Riu3dSelectionManager.h"
|
||||||
#include "RiuViewerCommands.h"
|
#include "RiuViewerCommands.h"
|
||||||
@ -115,48 +119,82 @@ bool RiuCellAndNncPickEventHandler::handle3dPickEvent( const Ric3dPickEvent& eve
|
|||||||
int gmFace = -1;
|
int gmFace = -1;
|
||||||
bool intersectionHit = false;
|
bool intersectionHit = false;
|
||||||
std::array<cvf::Vec3f, 3> intersectionTriangleHit;
|
std::array<cvf::Vec3f, 3> intersectionTriangleHit;
|
||||||
|
RimGeoMechResultDefinition* geomResDef = nullptr;
|
||||||
|
RimEclipseResultDefinition* eclResDef = nullptr;
|
||||||
|
size_t timestepIndex = -1;
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
if ( const RivSourceInfo* rivSourceInfo = dynamic_cast<const RivSourceInfo*>( firstHitPart->sourceInfo() ) )
|
if ( const RivSourceInfo* rivSourceInfo =
|
||||||
|
dynamic_cast<const RivSourceInfo*>( firstHitPart->sourceInfo() ) )
|
||||||
|
{
|
||||||
|
gridIndex = rivSourceInfo->gridIndex();
|
||||||
|
if ( rivSourceInfo->hasCellFaceMapping() )
|
||||||
{
|
{
|
||||||
gridIndex = rivSourceInfo->gridIndex();
|
CVF_ASSERT( rivSourceInfo->m_cellFaceFromTriangleMapper.notNull() );
|
||||||
if ( rivSourceInfo->hasCellFaceMapping() )
|
|
||||||
{
|
|
||||||
CVF_ASSERT( rivSourceInfo->m_cellFaceFromTriangleMapper.notNull() );
|
|
||||||
|
|
||||||
cellIndex = rivSourceInfo->m_cellFaceFromTriangleMapper->cellIndex( firstPartTriangleIndex );
|
cellIndex = rivSourceInfo->m_cellFaceFromTriangleMapper->cellIndex( firstPartTriangleIndex );
|
||||||
face = rivSourceInfo->m_cellFaceFromTriangleMapper->cellFace( firstPartTriangleIndex );
|
face = rivSourceInfo->m_cellFaceFromTriangleMapper->cellFace( firstPartTriangleIndex );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ( const RivFemPickSourceInfo* femSourceInfo =
|
||||||
|
dynamic_cast<const RivFemPickSourceInfo*>( firstHitPart->sourceInfo() ) )
|
||||||
|
{
|
||||||
|
gridIndex = femSourceInfo->femPartIndex();
|
||||||
|
cellIndex = femSourceInfo->triangleToElmMapper()->elementIndex( firstPartTriangleIndex );
|
||||||
|
gmFace = femSourceInfo->triangleToElmMapper()->elementFace( firstPartTriangleIndex );
|
||||||
|
}
|
||||||
|
else if ( const RivExtrudedCurveIntersectionSourceInfo* intersectionSourceInfo =
|
||||||
|
dynamic_cast<const RivExtrudedCurveIntersectionSourceInfo*>( firstHitPart->sourceInfo() ) )
|
||||||
|
{
|
||||||
|
RiuViewerCommands::findCellAndGridIndex( mainOrComparisonView,
|
||||||
|
intersectionSourceInfo,
|
||||||
|
firstPartTriangleIndex,
|
||||||
|
&cellIndex,
|
||||||
|
&gridIndex );
|
||||||
|
|
||||||
|
intersectionHit = true;
|
||||||
|
intersectionTriangleHit = intersectionSourceInfo->triangle( firstPartTriangleIndex );
|
||||||
|
|
||||||
|
if ( RimIntersectionResultDefinition* sepInterResDef = intersectionSourceInfo->intersection()->activeSeparateResultDefinition() )
|
||||||
|
{
|
||||||
|
if ( sepInterResDef->isEclipseResultDefinition() )
|
||||||
|
{
|
||||||
|
eclResDef = sepInterResDef->eclipseResultDefinition();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
geomResDef = sepInterResDef->geoMechResultDefinition();
|
||||||
|
}
|
||||||
|
|
||||||
|
timestepIndex = sepInterResDef->timeStep();
|
||||||
}
|
}
|
||||||
else if ( const RivFemPickSourceInfo* femSourceInfo =
|
}
|
||||||
dynamic_cast<const RivFemPickSourceInfo*>( firstHitPart->sourceInfo() ) )
|
else if ( const RivBoxIntersectionSourceInfo* intersectionBoxSourceInfo =
|
||||||
|
dynamic_cast<const RivBoxIntersectionSourceInfo*>( firstHitPart->sourceInfo() ) )
|
||||||
|
{
|
||||||
|
RiuViewerCommands::findCellAndGridIndex( mainOrComparisonView,
|
||||||
|
intersectionBoxSourceInfo,
|
||||||
|
firstPartTriangleIndex,
|
||||||
|
&cellIndex,
|
||||||
|
&gridIndex );
|
||||||
|
|
||||||
|
intersectionHit = true;
|
||||||
|
intersectionTriangleHit = intersectionBoxSourceInfo->triangle( firstPartTriangleIndex );
|
||||||
|
|
||||||
|
if ( RimIntersectionResultDefinition* sepInterResDef = intersectionBoxSourceInfo->intersectionBox()->activeSeparateResultDefinition() )
|
||||||
{
|
{
|
||||||
gridIndex = femSourceInfo->femPartIndex();
|
if ( sepInterResDef->isEclipseResultDefinition() )
|
||||||
cellIndex = femSourceInfo->triangleToElmMapper()->elementIndex( firstPartTriangleIndex );
|
{
|
||||||
gmFace = femSourceInfo->triangleToElmMapper()->elementFace( firstPartTriangleIndex );
|
eclResDef = sepInterResDef->eclipseResultDefinition();
|
||||||
}
|
}
|
||||||
else if ( const RivExtrudedCurveIntersectionSourceInfo* crossSectionSourceInfo =
|
else
|
||||||
dynamic_cast<const RivExtrudedCurveIntersectionSourceInfo*>( firstHitPart->sourceInfo() ) )
|
{
|
||||||
{
|
geomResDef = sepInterResDef->geoMechResultDefinition();
|
||||||
RiuViewerCommands::findCellAndGridIndex( mainOrComparisonView,
|
}
|
||||||
crossSectionSourceInfo,
|
|
||||||
firstPartTriangleIndex,
|
timestepIndex = sepInterResDef->timeStep();
|
||||||
&cellIndex,
|
|
||||||
&gridIndex );
|
|
||||||
intersectionHit = true;
|
|
||||||
intersectionTriangleHit = crossSectionSourceInfo->triangle( firstPartTriangleIndex );
|
|
||||||
}
|
|
||||||
else if ( const RivBoxIntersectionSourceInfo* intersectionBoxSourceInfo =
|
|
||||||
dynamic_cast<const RivBoxIntersectionSourceInfo*>( firstHitPart->sourceInfo() ) )
|
|
||||||
{
|
|
||||||
RiuViewerCommands::findCellAndGridIndex( mainOrComparisonView,
|
|
||||||
intersectionBoxSourceInfo,
|
|
||||||
firstPartTriangleIndex,
|
|
||||||
&cellIndex,
|
|
||||||
&gridIndex );
|
|
||||||
intersectionHit = true;
|
|
||||||
intersectionTriangleHit = intersectionBoxSourceInfo->triangle( firstPartTriangleIndex );
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
if ( cellIndex == cvf::UNDEFINED_SIZE_T )
|
if ( cellIndex == cvf::UNDEFINED_SIZE_T )
|
||||||
@ -189,17 +227,35 @@ bool RiuCellAndNncPickEventHandler::handle3dPickEvent( const Ric3dPickEvent& eve
|
|||||||
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>( mainOrComparisonView );
|
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>( mainOrComparisonView );
|
||||||
RimGeoMechView* geomView = dynamic_cast<RimGeoMechView*>( mainOrComparisonView );
|
RimGeoMechView* geomView = dynamic_cast<RimGeoMechView*>( mainOrComparisonView );
|
||||||
|
|
||||||
|
RimGridView* associatedGridView = dynamic_cast<RimGridView*>( mainOrComparisonView );
|
||||||
|
|
||||||
if ( intersectionView )
|
if ( intersectionView )
|
||||||
{
|
{
|
||||||
intersectionView->intersection()->firstAncestorOrThisOfType( eclipseView );
|
intersectionView->intersection()->firstAncestorOrThisOfType( associatedGridView );
|
||||||
intersectionView->intersection()->firstAncestorOrThisOfType( geomView );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( eclipseView )
|
// Use the clicked views default settings if we have not found any special stuff
|
||||||
|
|
||||||
|
if ( !eclResDef && !geomResDef )
|
||||||
{
|
{
|
||||||
selItem = new RiuEclipseSelectionItem( eclipseView,
|
if ( eclipseView )
|
||||||
nullptr,
|
{
|
||||||
-1,
|
if ( !eclResDef ) eclResDef = eclipseView->cellResult();
|
||||||
|
if ( timestepIndex == -1 ) timestepIndex = eclipseView->currentTimeStep();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( geomView )
|
||||||
|
{
|
||||||
|
if ( !geomResDef ) geomResDef = geomView->cellResult();
|
||||||
|
if ( timestepIndex == -1 ) timestepIndex = geomView->currentTimeStep();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( eclResDef )
|
||||||
|
{
|
||||||
|
selItem = new RiuEclipseSelectionItem( associatedGridView,
|
||||||
|
eclResDef,
|
||||||
|
timestepIndex,
|
||||||
gridIndex,
|
gridIndex,
|
||||||
cellIndex,
|
cellIndex,
|
||||||
nncIndex,
|
nncIndex,
|
||||||
@ -208,12 +264,12 @@ bool RiuCellAndNncPickEventHandler::handle3dPickEvent( const Ric3dPickEvent& eve
|
|||||||
localIntersectionPoint );
|
localIntersectionPoint );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( geomView )
|
if ( geomResDef )
|
||||||
{
|
{
|
||||||
if ( intersectionHit )
|
if ( intersectionHit )
|
||||||
selItem = new RiuGeoMechSelectionItem( geomView,
|
selItem = new RiuGeoMechSelectionItem( associatedGridView,
|
||||||
nullptr,
|
geomResDef,
|
||||||
-1,
|
timestepIndex,
|
||||||
gridIndex,
|
gridIndex,
|
||||||
cellIndex,
|
cellIndex,
|
||||||
curveColor,
|
curveColor,
|
||||||
@ -221,9 +277,9 @@ bool RiuCellAndNncPickEventHandler::handle3dPickEvent( const Ric3dPickEvent& eve
|
|||||||
localIntersectionPoint,
|
localIntersectionPoint,
|
||||||
intersectionTriangleHit );
|
intersectionTriangleHit );
|
||||||
else
|
else
|
||||||
selItem = new RiuGeoMechSelectionItem( geomView,
|
selItem = new RiuGeoMechSelectionItem( associatedGridView,
|
||||||
nullptr,
|
geomResDef,
|
||||||
-1,
|
timestepIndex,
|
||||||
gridIndex,
|
gridIndex,
|
||||||
cellIndex,
|
cellIndex,
|
||||||
curveColor,
|
curveColor,
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
#include "RigFemResultPosEnum.h"
|
#include "RigFemResultPosEnum.h"
|
||||||
#include "RigGeoMechCaseData.h"
|
#include "RigGeoMechCaseData.h"
|
||||||
|
|
||||||
|
#include "Rim2dIntersectionView.h"
|
||||||
#include "RimGeoMechCase.h"
|
#include "RimGeoMechCase.h"
|
||||||
#include "RimGeoMechCellColors.h"
|
#include "RimGeoMechCellColors.h"
|
||||||
#include "RimGeoMechResultDefinition.h"
|
#include "RimGeoMechResultDefinition.h"
|
||||||
@ -63,7 +64,7 @@
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RiuMohrsCirclePlot::RiuMohrsCirclePlot( QWidget* parent )
|
RiuMohrsCirclePlot::RiuMohrsCirclePlot( QWidget* parent )
|
||||||
: RiuDockedQwtPlot( parent )
|
: RiuDockedQwtPlot( parent )
|
||||||
, m_sourceGeoMechViewOfLastPlot( nullptr )
|
, m_viewToFollowAnimationFrom( nullptr )
|
||||||
, m_scheduleUpdateAxisScaleTimer( nullptr )
|
, m_scheduleUpdateAxisScaleTimer( nullptr )
|
||||||
{
|
{
|
||||||
RiuQwtPlotTools::setCommonPlotBehaviour( this );
|
RiuQwtPlotTools::setCommonPlotBehaviour( this );
|
||||||
@ -99,25 +100,30 @@ RiuMohrsCirclePlot::~RiuMohrsCirclePlot()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuMohrsCirclePlot::appendSelection( const RiuSelectionItem* selectionItem )
|
void RiuMohrsCirclePlot::appendSelection( const RiuSelectionItem* selectionItem )
|
||||||
{
|
{
|
||||||
|
m_viewToFollowAnimationFrom = nullptr;
|
||||||
|
|
||||||
if ( this->isVisible() )
|
if ( this->isVisible() )
|
||||||
{
|
{
|
||||||
m_sourceGeoMechViewOfLastPlot = nullptr;
|
Rim3dView* newFollowAnimView = nullptr;
|
||||||
|
RiuGeoMechSelectionItem* geoMechSelectionItem = nullptr;
|
||||||
|
|
||||||
|
geoMechSelectionItem = extractGeoMechSelectionItem( selectionItem, newFollowAnimView );
|
||||||
|
|
||||||
const RiuGeoMechSelectionItem* geoMechSelectionItem = dynamic_cast<const RiuGeoMechSelectionItem*>(
|
|
||||||
selectionItem );
|
|
||||||
if ( geoMechSelectionItem )
|
if ( geoMechSelectionItem )
|
||||||
{
|
{
|
||||||
RimGeoMechView* geoMechView = geoMechSelectionItem->m_view;
|
|
||||||
CVF_ASSERT( geoMechView );
|
|
||||||
|
|
||||||
const size_t gridIndex = geoMechSelectionItem->m_gridIndex;
|
const size_t gridIndex = geoMechSelectionItem->m_gridIndex;
|
||||||
const size_t cellIndex = geoMechSelectionItem->m_cellIndex;
|
const size_t cellIndex = geoMechSelectionItem->m_cellIndex;
|
||||||
const cvf::Color3f color = geoMechSelectionItem->m_color;
|
const cvf::Color3f color = geoMechSelectionItem->m_color;
|
||||||
|
|
||||||
queryData( geoMechView, gridIndex, cellIndex, cvf::Color3ub( color ) );
|
addOrUpdateCurves( geoMechSelectionItem->m_resultDefinition,
|
||||||
|
geoMechSelectionItem->m_timestepIdx,
|
||||||
|
gridIndex,
|
||||||
|
cellIndex,
|
||||||
|
cvf::Color3ub( color ) );
|
||||||
|
|
||||||
updatePlot();
|
updatePlot();
|
||||||
|
|
||||||
m_sourceGeoMechViewOfLastPlot = geoMechView;
|
m_viewToFollowAnimationFrom = geoMechSelectionItem->m_view;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -133,7 +139,7 @@ void RiuMohrsCirclePlot::clearPlot()
|
|||||||
{
|
{
|
||||||
deletePlotItems();
|
deletePlotItems();
|
||||||
|
|
||||||
m_sourceGeoMechViewOfLastPlot = nullptr;
|
m_viewToFollowAnimationFrom = nullptr;
|
||||||
|
|
||||||
this->replot();
|
this->replot();
|
||||||
}
|
}
|
||||||
@ -148,9 +154,10 @@ void RiuMohrsCirclePlot::updateOnTimeStepChanged( Rim3dView* changedView )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't update the plot if the view that changed time step is different from the view that was the source of the current plot
|
// Don't update the plot if the view that changed time step is different
|
||||||
RimGeoMechView* geoMechView = dynamic_cast<RimGeoMechView*>( changedView );
|
// from the view that was the source of the current plot
|
||||||
if ( !geoMechView || geoMechView != m_sourceGeoMechViewOfLastPlot )
|
|
||||||
|
if ( changedView != m_viewToFollowAnimationFrom )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -160,7 +167,11 @@ void RiuMohrsCirclePlot::updateOnTimeStepChanged( Rim3dView* changedView )
|
|||||||
|
|
||||||
for ( const MohrsCirclesInfo& mohrInfo : mohrsCiclesInfosCopy )
|
for ( const MohrsCirclesInfo& mohrInfo : mohrsCiclesInfosCopy )
|
||||||
{
|
{
|
||||||
queryData( mohrInfo.view, mohrInfo.gridIndex, mohrInfo.elmIndex, mohrInfo.color );
|
addOrUpdateCurves( mohrInfo.geomResDef,
|
||||||
|
changedView->currentTimeStep(),
|
||||||
|
mohrInfo.gridIndex,
|
||||||
|
mohrInfo.elmIndex,
|
||||||
|
mohrInfo.color );
|
||||||
}
|
}
|
||||||
|
|
||||||
updatePlot();
|
updatePlot();
|
||||||
@ -185,7 +196,7 @@ QSize RiuMohrsCirclePlot::minimumSizeHint() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuMohrsCirclePlot::addMohrCircles( const MohrsCirclesInfo& mohrsCirclesInfo )
|
void RiuMohrsCirclePlot::addOrUpdateMohrCircleCurves( const MohrsCirclesInfo& mohrsCirclesInfo )
|
||||||
{
|
{
|
||||||
const cvf::Vec3f& principals = mohrsCirclesInfo.principals;
|
const cvf::Vec3f& principals = mohrsCirclesInfo.principals;
|
||||||
|
|
||||||
@ -263,12 +274,12 @@ void RiuMohrsCirclePlot::deleteCircles()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuMohrsCirclePlot::addEnvelopeCurve( const cvf::Vec3f& principals, RimGeoMechView* view )
|
void RiuMohrsCirclePlot::addorUpdateEnvelopeCurve( const cvf::Vec3f& principals, const RimGeoMechCase* geomCase )
|
||||||
{
|
{
|
||||||
if ( !view ) return;
|
if ( !geomCase ) return;
|
||||||
|
|
||||||
double cohesion = view->geoMechCase()->cohesion();
|
double cohesion = geomCase->cohesion();
|
||||||
double frictionAngle = view->geoMechCase()->frictionAngleDeg();
|
double frictionAngle = geomCase->frictionAngleDeg();
|
||||||
|
|
||||||
if ( cohesion == HUGE_VAL || frictionAngle == HUGE_VAL || frictionAngle >= 90 )
|
if ( cohesion == HUGE_VAL || frictionAngle == HUGE_VAL || frictionAngle >= 90 )
|
||||||
{
|
{
|
||||||
@ -294,17 +305,17 @@ void RiuMohrsCirclePlot::addEnvelopeCurve( const cvf::Vec3f& principals, RimGeoM
|
|||||||
yVals[1] = ( cohesion / x ) * ( x + principals[0] );
|
yVals[1] = ( cohesion / x ) * ( x + principals[0] );
|
||||||
|
|
||||||
// If envelope for the view already exists, check if a "larger" envelope should be created
|
// If envelope for the view already exists, check if a "larger" envelope should be created
|
||||||
if ( m_envolopePlotItems.find( view ) != m_envolopePlotItems.end() )
|
if ( m_envolopePlotItems.find( geomCase ) != m_envolopePlotItems.end() )
|
||||||
{
|
{
|
||||||
if ( yVals[1] <= m_envolopePlotItems[view]->maxYValue() )
|
if ( yVals[1] <= m_envolopePlotItems[geomCase]->maxYValue() )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_envolopePlotItems[view]->detach();
|
m_envolopePlotItems[geomCase]->detach();
|
||||||
delete m_envolopePlotItems[view];
|
delete m_envolopePlotItems[geomCase];
|
||||||
m_envolopePlotItems.erase( view );
|
m_envolopePlotItems.erase( geomCase );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -315,17 +326,17 @@ void RiuMohrsCirclePlot::addEnvelopeCurve( const cvf::Vec3f& principals, RimGeoM
|
|||||||
qwtCurve->setStyle( QwtPlotCurve::Lines );
|
qwtCurve->setStyle( QwtPlotCurve::Lines );
|
||||||
qwtCurve->setRenderHint( QwtPlotItem::RenderAntialiased, true );
|
qwtCurve->setRenderHint( QwtPlotItem::RenderAntialiased, true );
|
||||||
|
|
||||||
const QPen curvePen( envelopeColor( view ) );
|
const QPen curvePen( envelopeColor( geomCase ) );
|
||||||
qwtCurve->setPen( curvePen );
|
qwtCurve->setPen( curvePen );
|
||||||
|
|
||||||
qwtCurve->setTitle( QString( "<b>Envelope for %1</b>, (<b>S<sub>0</sub></b>: %2, <b>Φ</b>: %3)" )
|
qwtCurve->setTitle( QString( "<b>Envelope for %1</b>, (<b>S<sub>0</sub></b>: %2, <b>Φ</b>: %3)" )
|
||||||
.arg( view->geoMechCase()->caseUserDescription )
|
.arg( geomCase->caseUserDescription() )
|
||||||
.arg( cohesion )
|
.arg( cohesion )
|
||||||
.arg( frictionAngle ) );
|
.arg( frictionAngle ) );
|
||||||
|
|
||||||
qwtCurve->attach( this );
|
qwtCurve->attach( this );
|
||||||
|
|
||||||
m_envolopePlotItems[view] = qwtCurve;
|
m_envolopePlotItems[geomCase] = qwtCurve;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -333,7 +344,7 @@ void RiuMohrsCirclePlot::addEnvelopeCurve( const cvf::Vec3f& principals, RimGeoM
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuMohrsCirclePlot::deleteEnvelopes()
|
void RiuMohrsCirclePlot::deleteEnvelopes()
|
||||||
{
|
{
|
||||||
for ( const std::pair<RimGeoMechView*, QwtPlotCurve*>& envelope : m_envolopePlotItems )
|
for ( const std::pair<const RimGeoMechCase*, QwtPlotCurve*>& envelope : m_envolopePlotItems )
|
||||||
{
|
{
|
||||||
envelope.second->detach();
|
envelope.second->detach();
|
||||||
delete envelope.second;
|
delete envelope.second;
|
||||||
@ -345,26 +356,26 @@ void RiuMohrsCirclePlot::deleteEnvelopes()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuMohrsCirclePlot::queryData( RimGeoMechView* geoMechView,
|
bool RiuMohrsCirclePlot::addOrUpdateCurves( const RimGeoMechResultDefinition* geomResDef,
|
||||||
size_t gridIndex,
|
size_t timeStepIndex,
|
||||||
size_t elmIndex,
|
size_t gridIndex,
|
||||||
const cvf::Color3ub& color )
|
size_t elmIndex,
|
||||||
|
const cvf::Color3ub& color )
|
||||||
{
|
{
|
||||||
CVF_ASSERT( geoMechView );
|
RigFemPart* femPart = geomResDef->ownerCaseData()->femParts()->part( gridIndex );
|
||||||
m_sourceGeoMechViewOfLastPlot = geoMechView;
|
|
||||||
|
|
||||||
RigFemPart* femPart = geoMechView->femParts()->part( gridIndex );
|
if ( femPart->elementType( elmIndex ) != HEX8P ) return false;
|
||||||
if ( femPart->elementType( elmIndex ) != HEX8P ) return;
|
|
||||||
|
|
||||||
int frameIdx = geoMechView->currentTimeStep();
|
RigFemPartResultsCollection* resultCollection = geomResDef->geoMechCase()->geoMechData()->femPartResults();
|
||||||
RigFemPartResultsCollection* resultCollection = geoMechView->geoMechCase()->geoMechData()->femPartResults();
|
|
||||||
RigFemResultAddress address( RigFemResultPosEnum::RIG_ELEMENT_NODAL, "SE", "" );
|
RigFemResultAddress address( RigFemResultPosEnum::RIG_ELEMENT_NODAL, "SE", "" );
|
||||||
|
|
||||||
// TODO: All tensors are calculated every time this function is called. FIX
|
// TODO: All tensors are calculated every time this function is called. FIX
|
||||||
std::vector<caf::Ten3f> vertexTensors = resultCollection->tensors( address, 0, frameIdx );
|
|
||||||
|
std::vector<caf::Ten3f> vertexTensors = resultCollection->tensors( address, 0, (int)timeStepIndex );
|
||||||
if ( vertexTensors.empty() )
|
if ( vertexTensors.empty() )
|
||||||
{
|
{
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate average tensor in element
|
// Calculate average tensor in element
|
||||||
@ -379,11 +390,11 @@ void RiuMohrsCirclePlot::queryData( RimGeoMechView* geoMechView,
|
|||||||
|
|
||||||
if ( !isValidPrincipals( principals ) )
|
if ( !isValidPrincipals( principals ) )
|
||||||
{
|
{
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
double cohesion = geoMechView->geoMechCase()->cohesion();
|
double cohesion = geomResDef->geoMechCase()->cohesion();
|
||||||
double frictionAngleDeg = geoMechView->geoMechCase()->frictionAngleDeg();
|
double frictionAngleDeg = geomResDef->geoMechCase()->frictionAngleDeg();
|
||||||
|
|
||||||
size_t i, j, k;
|
size_t i, j, k;
|
||||||
bool validIndex = femPart->getOrCreateStructGrid()->ijkFromCellIndex( elmIndex, &i, &j, &k );
|
bool validIndex = femPart->getOrCreateStructGrid()->ijkFromCellIndex( elmIndex, &i, &j, &k );
|
||||||
@ -397,12 +408,20 @@ void RiuMohrsCirclePlot::queryData( RimGeoMechView* geoMechView,
|
|||||||
i,
|
i,
|
||||||
j,
|
j,
|
||||||
k,
|
k,
|
||||||
geoMechView,
|
geomResDef,
|
||||||
calculateFOS( principals, frictionAngleDeg, cohesion ),
|
calculateFOS( principals, frictionAngleDeg, cohesion ),
|
||||||
color );
|
color );
|
||||||
|
|
||||||
addMohrsCirclesInfo( mohrsCircle );
|
m_mohrsCiclesInfos.push_back( mohrsCircle );
|
||||||
|
|
||||||
|
addorUpdateEnvelopeCurve( mohrsCircle.principals, mohrsCircle.geomResDef->geoMechCase() );
|
||||||
|
addOrUpdateMohrCircleCurves( mohrsCircle );
|
||||||
|
updateTransparentCurvesOnPrincipals();
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -415,18 +434,6 @@ void RiuMohrsCirclePlot::updatePlot()
|
|||||||
scheduleUpdateAxisScale();
|
scheduleUpdateAxisScale();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RiuMohrsCirclePlot::addMohrsCirclesInfo( const MohrsCirclesInfo& mohrsCircleInfo )
|
|
||||||
{
|
|
||||||
m_mohrsCiclesInfos.push_back( mohrsCircleInfo );
|
|
||||||
|
|
||||||
addEnvelopeCurve( mohrsCircleInfo.principals, mohrsCircleInfo.view );
|
|
||||||
addMohrCircles( mohrsCircleInfo );
|
|
||||||
updateTransparentCurvesOnPrincipals();
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
/// Add a transparent curve to make tooltip available on principals crossing the x-axis
|
/// Add a transparent curve to make tooltip available on principals crossing the x-axis
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -568,19 +575,19 @@ float RiuMohrsCirclePlot::calculateFOS( const cvf::Vec3f& principals, double fri
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
QColor RiuMohrsCirclePlot::envelopeColor( RimGeoMechView* view )
|
QColor RiuMohrsCirclePlot::envelopeColor( const RimGeoMechCase* geomCase )
|
||||||
{
|
{
|
||||||
if ( m_envolopeColors.find( view ) == m_envolopeColors.end() )
|
if ( m_envolopeColors.find( geomCase ) == m_envolopeColors.end() )
|
||||||
{
|
{
|
||||||
cvf::Color3ub cvfColor = RiaColorTables::summaryCurveDefaultPaletteColors().cycledColor3ub(
|
cvf::Color3ub cvfColor = RiaColorTables::summaryCurveDefaultPaletteColors().cycledColor3ub(
|
||||||
m_envolopeColors.size() );
|
m_envolopeColors.size() );
|
||||||
|
|
||||||
QColor color( cvfColor.r(), cvfColor.g(), cvfColor.b() );
|
QColor color( cvfColor.r(), cvfColor.g(), cvfColor.b() );
|
||||||
|
|
||||||
m_envolopeColors[view] = color;
|
m_envolopeColors[geomCase] = color;
|
||||||
}
|
}
|
||||||
|
|
||||||
return m_envolopeColors[view];
|
return m_envolopeColors[geomCase];
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -635,7 +642,7 @@ void RiuMohrsCirclePlot::idealAxesEndPoints( double* xMin, double* xMax, double*
|
|||||||
*yMax = -HUGE_VAL;
|
*yMax = -HUGE_VAL;
|
||||||
|
|
||||||
double maxYEnvelope = -HUGE_VAL;
|
double maxYEnvelope = -HUGE_VAL;
|
||||||
for ( const std::pair<RimGeoMechView*, QwtPlotCurve*>& envelope : m_envolopePlotItems )
|
for ( const std::pair<const RimGeoMechCase*, QwtPlotCurve*>& envelope : m_envolopePlotItems )
|
||||||
{
|
{
|
||||||
double tempMax = envelope.second->maxYValue();
|
double tempMax = envelope.second->maxYValue();
|
||||||
if ( tempMax > maxYEnvelope )
|
if ( tempMax > maxYEnvelope )
|
||||||
@ -647,7 +654,7 @@ void RiuMohrsCirclePlot::idealAxesEndPoints( double* xMin, double* xMax, double*
|
|||||||
*yMax = std::max( maxYEnvelope, 1.2 * largestCircleRadiusInPlot() );
|
*yMax = std::max( maxYEnvelope, 1.2 * largestCircleRadiusInPlot() );
|
||||||
|
|
||||||
double minXEvelope = HUGE_VAL;
|
double minXEvelope = HUGE_VAL;
|
||||||
for ( const std::pair<RimGeoMechView*, QwtPlotCurve*>& envelope : m_envolopePlotItems )
|
for ( const std::pair<const RimGeoMechCase*, QwtPlotCurve*>& envelope : m_envolopePlotItems )
|
||||||
{
|
{
|
||||||
double tempMin = envelope.second->minXValue();
|
double tempMin = envelope.second->minXValue();
|
||||||
if ( tempMin < minXEvelope )
|
if ( tempMin < minXEvelope )
|
||||||
@ -712,3 +719,37 @@ void RiuMohrsCirclePlot::setAxesScaleAndReplot()
|
|||||||
|
|
||||||
this->replot();
|
this->replot();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RiuGeoMechSelectionItem* RiuMohrsCirclePlot::extractGeoMechSelectionItem( const RiuSelectionItem* selectionItem,
|
||||||
|
Rim3dView*& newFollowAnimView )
|
||||||
|
{
|
||||||
|
newFollowAnimView = nullptr;
|
||||||
|
RiuGeoMechSelectionItem* geoMechSelectionItem = nullptr;
|
||||||
|
|
||||||
|
geoMechSelectionItem = dynamic_cast<RiuGeoMechSelectionItem*>( const_cast<RiuSelectionItem*>( selectionItem ) );
|
||||||
|
|
||||||
|
if ( geoMechSelectionItem )
|
||||||
|
{
|
||||||
|
// If we clicked in an geoMech view, and hit something using the standard result definition there,
|
||||||
|
// set this up to follow the animation there.
|
||||||
|
|
||||||
|
RimGeoMechView* clickedInEclView = dynamic_cast<RimGeoMechView*>( geoMechSelectionItem->m_view.p() );
|
||||||
|
|
||||||
|
if ( clickedInEclView && clickedInEclView->cellResult() == geoMechSelectionItem->m_resultDefinition.p() )
|
||||||
|
{
|
||||||
|
newFollowAnimView = geoMechSelectionItem->m_view;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
auto intersectionSelItem = dynamic_cast<const Riu2dIntersectionSelectionItem*>( selectionItem );
|
||||||
|
|
||||||
|
if ( intersectionSelItem && intersectionSelItem->geoMechSelectionItem() )
|
||||||
|
{
|
||||||
|
geoMechSelectionItem = intersectionSelItem->geoMechSelectionItem();
|
||||||
|
newFollowAnimView = intersectionSelItem->view();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return geoMechSelectionItem;
|
||||||
|
}
|
||||||
|
@ -35,6 +35,9 @@ class QWidget;
|
|||||||
class Rim3dView;
|
class Rim3dView;
|
||||||
class RimGeoMechView;
|
class RimGeoMechView;
|
||||||
class RiuSelectionItem;
|
class RiuSelectionItem;
|
||||||
|
class RimGeoMechCase;
|
||||||
|
class RimGeoMechResultDefinition;
|
||||||
|
class RiuGeoMechSelectionItem;
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
//
|
//
|
||||||
@ -57,34 +60,34 @@ public:
|
|||||||
private:
|
private:
|
||||||
struct MohrsCirclesInfo
|
struct MohrsCirclesInfo
|
||||||
{
|
{
|
||||||
MohrsCirclesInfo( cvf::Vec3f principals,
|
MohrsCirclesInfo( cvf::Vec3f principals,
|
||||||
size_t gridIndex,
|
size_t gridIndex,
|
||||||
size_t elmIndex,
|
size_t elmIndex,
|
||||||
size_t i,
|
size_t i,
|
||||||
size_t j,
|
size_t j,
|
||||||
size_t k,
|
size_t k,
|
||||||
RimGeoMechView* view,
|
const RimGeoMechResultDefinition* geomResDef,
|
||||||
double factorOfSafety,
|
double factorOfSafety,
|
||||||
cvf::Color3ub color )
|
cvf::Color3ub color )
|
||||||
: principals( principals )
|
: principals( principals )
|
||||||
, gridIndex( gridIndex )
|
, gridIndex( gridIndex )
|
||||||
, elmIndex( elmIndex )
|
, elmIndex( elmIndex )
|
||||||
, i( i )
|
, i( i )
|
||||||
, j( j )
|
, j( j )
|
||||||
, k( k )
|
, k( k )
|
||||||
, view( view )
|
, geomResDef( geomResDef )
|
||||||
, factorOfSafety( factorOfSafety )
|
, factorOfSafety( factorOfSafety )
|
||||||
, color( color )
|
, color( color )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
cvf::Vec3f principals;
|
cvf::Vec3f principals;
|
||||||
size_t gridIndex;
|
size_t gridIndex;
|
||||||
size_t elmIndex;
|
size_t elmIndex;
|
||||||
size_t i, j, k;
|
size_t i, j, k;
|
||||||
RimGeoMechView* view;
|
const RimGeoMechResultDefinition* geomResDef;
|
||||||
double factorOfSafety;
|
double factorOfSafety;
|
||||||
cvf::Color3ub color;
|
cvf::Color3ub color;
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -94,33 +97,36 @@ private:
|
|||||||
|
|
||||||
void idealAxesEndPoints( double* xMin, double* xMax, double* yMax ) const;
|
void idealAxesEndPoints( double* xMin, double* xMax, double* yMax ) const;
|
||||||
|
|
||||||
void addMohrCircles( const MohrsCirclesInfo& mohrsCirclesInfo );
|
void addOrUpdateMohrCircleCurves( const MohrsCirclesInfo& mohrsCirclesInfo );
|
||||||
void deleteCircles();
|
void deleteCircles();
|
||||||
|
|
||||||
void addEnvelopeCurve( const cvf::Vec3f& principals, RimGeoMechView* view );
|
void addorUpdateEnvelopeCurve( const cvf::Vec3f& principals, const RimGeoMechCase* geomCase );
|
||||||
void deleteEnvelopes();
|
void deleteEnvelopes();
|
||||||
|
|
||||||
void queryData( RimGeoMechView* geoMechView, size_t gridIndex, size_t elmIndex, const cvf::Color3ub& color );
|
bool addOrUpdateCurves( const RimGeoMechResultDefinition* geomResDef,
|
||||||
|
size_t timeStepIndex,
|
||||||
|
size_t gridIndex,
|
||||||
|
size_t elmIndex,
|
||||||
|
const cvf::Color3ub& color );
|
||||||
void updatePlot();
|
void updatePlot();
|
||||||
|
|
||||||
void addMohrsCirclesInfo( const MohrsCirclesInfo& mohrsCircleInfo );
|
|
||||||
|
|
||||||
void updateTransparentCurvesOnPrincipals();
|
void updateTransparentCurvesOnPrincipals();
|
||||||
|
|
||||||
double largestCircleRadiusInPlot() const;
|
double largestCircleRadiusInPlot() const;
|
||||||
double smallestPrincipal() const;
|
double smallestPrincipal() const;
|
||||||
double largestPrincipal() const;
|
double largestPrincipal() const;
|
||||||
|
|
||||||
static bool isValidPrincipals( const cvf::Vec3f& principals );
|
QColor envelopeColor( const RimGeoMechCase* geomCase );
|
||||||
|
|
||||||
static float calculateFOS( const cvf::Vec3f& principals, double frictionAngle, double cohesion );
|
|
||||||
|
|
||||||
QColor envelopeColor( RimGeoMechView* view );
|
|
||||||
|
|
||||||
void deletePlotItems();
|
void deletePlotItems();
|
||||||
|
|
||||||
void scheduleUpdateAxisScale();
|
void scheduleUpdateAxisScale();
|
||||||
|
|
||||||
|
static bool isValidPrincipals( const cvf::Vec3f& principals );
|
||||||
|
static float calculateFOS( const cvf::Vec3f& principals, double frictionAngle, double cohesion );
|
||||||
|
static RiuGeoMechSelectionItem* extractGeoMechSelectionItem( const RiuSelectionItem* selectionItem,
|
||||||
|
Rim3dView*& newFollowAnimView );
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void setAxesScaleAndReplot();
|
void setAxesScaleAndReplot();
|
||||||
|
|
||||||
@ -128,12 +134,12 @@ private:
|
|||||||
std::vector<QwtPlotItem*> m_circlePlotItems;
|
std::vector<QwtPlotItem*> m_circlePlotItems;
|
||||||
std::vector<QwtPlotCurve*> m_transparentCurves;
|
std::vector<QwtPlotCurve*> m_transparentCurves;
|
||||||
|
|
||||||
std::map<RimGeoMechView*, QwtPlotCurve*> m_envolopePlotItems;
|
std::map<const RimGeoMechCase*, QwtPlotCurve*> m_envolopePlotItems;
|
||||||
std::map<RimGeoMechView*, QColor> m_envolopeColors;
|
std::map<const RimGeoMechCase*, QColor> m_envolopeColors;
|
||||||
|
|
||||||
std::vector<MohrsCirclesInfo> m_mohrsCiclesInfos;
|
std::vector<MohrsCirclesInfo> m_mohrsCiclesInfos;
|
||||||
|
|
||||||
RimGeoMechView* m_sourceGeoMechViewOfLastPlot;
|
Rim3dView* m_viewToFollowAnimationFrom;
|
||||||
|
|
||||||
QTimer* m_scheduleUpdateAxisScaleTimer;
|
QTimer* m_scheduleUpdateAxisScaleTimer;
|
||||||
};
|
};
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
#include "Rim2dIntersectionView.h"
|
#include "Rim2dIntersectionView.h"
|
||||||
#include "Rim3dView.h"
|
#include "Rim3dView.h"
|
||||||
|
#include "RimEclipseCellColors.h"
|
||||||
#include "RimEclipseResultCase.h"
|
#include "RimEclipseResultCase.h"
|
||||||
#include "RimEclipseView.h"
|
#include "RimEclipseView.h"
|
||||||
#include "RimExtrudedCurveIntersection.h"
|
#include "RimExtrudedCurveIntersection.h"
|
||||||
@ -51,7 +52,7 @@
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RiuPvtPlotUpdater::RiuPvtPlotUpdater( RiuPvtPlotPanel* targetPlotPanel )
|
RiuPvtPlotUpdater::RiuPvtPlotUpdater( RiuPvtPlotPanel* targetPlotPanel )
|
||||||
: m_targetPlotPanel( targetPlotPanel )
|
: m_targetPlotPanel( targetPlotPanel )
|
||||||
, m_sourceEclipseViewOfLastPlot( nullptr )
|
, m_viewToFollowAnimationFrom( nullptr )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,32 +66,26 @@ void RiuPvtPlotUpdater::updateOnSelectionChanged( const RiuSelectionItem* select
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_sourceEclipseViewOfLastPlot = nullptr;
|
Rim3dView* newFollowAnimView = nullptr;
|
||||||
bool mustClearPlot = true;
|
RiuEclipseSelectionItem* eclipseSelectionItem = nullptr;
|
||||||
|
|
||||||
RiuEclipseSelectionItem* eclipseSelectionItem = dynamic_cast<RiuEclipseSelectionItem*>(
|
eclipseSelectionItem = RiuRelativePermeabilityPlotUpdater::extractEclipseSelectionItem( selectionItem,
|
||||||
const_cast<RiuSelectionItem*>( selectionItem ) );
|
newFollowAnimView );
|
||||||
RimEclipseView* eclipseView = eclipseSelectionItem ? eclipseSelectionItem->m_view.p() : nullptr;
|
|
||||||
|
|
||||||
if ( !eclipseSelectionItem && !eclipseView )
|
bool mustClearPlot = true;
|
||||||
|
m_viewToFollowAnimationFrom = nullptr;
|
||||||
|
|
||||||
|
if ( m_targetPlotPanel->isVisible() && eclipseSelectionItem )
|
||||||
{
|
{
|
||||||
const Riu2dIntersectionSelectionItem* intersectionSelItem = dynamic_cast<const Riu2dIntersectionSelectionItem*>(
|
if ( queryDataAndUpdatePlot( eclipseSelectionItem->m_resultDefinition,
|
||||||
selectionItem );
|
eclipseSelectionItem->m_timestepIdx,
|
||||||
if ( intersectionSelItem && intersectionSelItem->eclipseSelectionItem() )
|
eclipseSelectionItem->m_gridIndex,
|
||||||
|
eclipseSelectionItem->m_gridLocalCellIndex,
|
||||||
|
m_targetPlotPanel ) )
|
||||||
{
|
{
|
||||||
eclipseSelectionItem = intersectionSelItem->eclipseSelectionItem();
|
mustClearPlot = false;
|
||||||
eclipseView = eclipseSelectionItem->m_view;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( m_targetPlotPanel->isVisible() && eclipseSelectionItem && eclipseView )
|
m_viewToFollowAnimationFrom = newFollowAnimView;
|
||||||
{
|
|
||||||
const size_t gridIndex = eclipseSelectionItem->m_gridIndex;
|
|
||||||
const size_t gridLocalCellIndex = eclipseSelectionItem->m_gridLocalCellIndex;
|
|
||||||
if ( queryDataAndUpdatePlot( *eclipseView, gridIndex, gridLocalCellIndex, m_targetPlotPanel ) )
|
|
||||||
{
|
|
||||||
mustClearPlot = false;
|
|
||||||
m_sourceEclipseViewOfLastPlot = eclipseView;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,21 +105,30 @@ void RiuPvtPlotUpdater::updateOnTimeStepChanged( Rim3dView* changedView )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't update the plot if the view that changed time step is different from the view that was the source of the current plot
|
// Don't update the plot if the view that changed time step is different
|
||||||
const RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>( changedView );
|
// from the view that was the source of the current plot
|
||||||
if ( !eclipseView || eclipseView != m_sourceEclipseViewOfLastPlot )
|
|
||||||
|
if ( changedView != m_viewToFollowAnimationFrom )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fetch the current global selection and only continue if the selection's view matches the view with time step change
|
// Fetch the current global selection and only continue if the selection's view matches the view with time step change
|
||||||
const RiuEclipseSelectionItem* eclipseSelectionItem = dynamic_cast<const RiuEclipseSelectionItem*>(
|
|
||||||
Riu3dSelectionManager::instance()->selectedItem() );
|
const RiuSelectionItem* selectionItem = Riu3dSelectionManager::instance()->selectedItem();
|
||||||
if ( eclipseSelectionItem && eclipseSelectionItem->m_view == eclipseView )
|
Rim3dView* newFollowAnimView = nullptr;
|
||||||
|
RiuEclipseSelectionItem* eclipseSelectionItem = nullptr;
|
||||||
|
|
||||||
|
eclipseSelectionItem = RiuRelativePermeabilityPlotUpdater::extractEclipseSelectionItem( selectionItem,
|
||||||
|
newFollowAnimView );
|
||||||
|
|
||||||
|
if ( eclipseSelectionItem && newFollowAnimView == changedView )
|
||||||
{
|
{
|
||||||
const size_t gridIndex = eclipseSelectionItem->m_gridIndex;
|
if ( !queryDataAndUpdatePlot( eclipseSelectionItem->m_resultDefinition,
|
||||||
const size_t gridLocalCellIndex = eclipseSelectionItem->m_gridLocalCellIndex;
|
newFollowAnimView->currentTimeStep(),
|
||||||
if ( !queryDataAndUpdatePlot( *eclipseView, gridIndex, gridLocalCellIndex, m_targetPlotPanel ) )
|
eclipseSelectionItem->m_gridIndex,
|
||||||
|
eclipseSelectionItem->m_gridLocalCellIndex,
|
||||||
|
m_targetPlotPanel ) )
|
||||||
{
|
{
|
||||||
m_targetPlotPanel->clearPlot();
|
m_targetPlotPanel->clearPlot();
|
||||||
}
|
}
|
||||||
@ -134,14 +138,15 @@ void RiuPvtPlotUpdater::updateOnTimeStepChanged( Rim3dView* changedView )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RiuPvtPlotUpdater::queryDataAndUpdatePlot( const RimEclipseView& eclipseView,
|
bool RiuPvtPlotUpdater::queryDataAndUpdatePlot( const RimEclipseResultDefinition* eclipseResDef,
|
||||||
size_t gridIndex,
|
size_t timeStepIndex,
|
||||||
size_t gridLocalCellIndex,
|
size_t gridIndex,
|
||||||
RiuPvtPlotPanel* plotPanel )
|
size_t gridLocalCellIndex,
|
||||||
|
RiuPvtPlotPanel* plotPanel )
|
||||||
{
|
{
|
||||||
CVF_ASSERT( plotPanel );
|
CVF_ASSERT( plotPanel );
|
||||||
|
|
||||||
RimEclipseResultCase* eclipseResultCase = dynamic_cast<RimEclipseResultCase*>( eclipseView.eclipseCase() );
|
RimEclipseResultCase* eclipseResultCase = dynamic_cast<RimEclipseResultCase*>( eclipseResDef->eclipseCase() );
|
||||||
RigEclipseCaseData* eclipseCaseData = eclipseResultCase ? eclipseResultCase->eclipseCaseData() : nullptr;
|
RigEclipseCaseData* eclipseCaseData = eclipseResultCase ? eclipseResultCase->eclipseCaseData() : nullptr;
|
||||||
if ( eclipseResultCase && eclipseCaseData && eclipseResultCase->flowDiagSolverInterface() )
|
if ( eclipseResultCase && eclipseCaseData && eclipseResultCase->flowDiagSolverInterface() )
|
||||||
{
|
{
|
||||||
@ -157,8 +162,6 @@ bool RiuPvtPlotUpdater::queryDataAndUpdatePlot( const RimEclipseView& eclipseVie
|
|||||||
eclipseResultCase->flowDiagSolverInterface()
|
eclipseResultCase->flowDiagSolverInterface()
|
||||||
->calculatePvtCurves( RigFlowDiagSolverInterface::PVT_CT_VISCOSITY, activeCellIndex );
|
->calculatePvtCurves( RigFlowDiagSolverInterface::PVT_CT_VISCOSITY, activeCellIndex );
|
||||||
|
|
||||||
const size_t timeStepIndex = static_cast<size_t>( eclipseView.currentTimeStep() );
|
|
||||||
|
|
||||||
// The following calls will read results from file in preparation for the queries below
|
// The following calls will read results from file in preparation for the queries below
|
||||||
RigCaseCellResultsData* cellResultsData = eclipseCaseData->results( RiaDefines::MATRIX_MODEL );
|
RigCaseCellResultsData* cellResultsData = eclipseCaseData->results( RiaDefines::MATRIX_MODEL );
|
||||||
cellResultsData->ensureKnownResultLoaded( RigEclipseResultAddress( RiaDefines::DYNAMIC_NATIVE, "RS" ) );
|
cellResultsData->ensureKnownResultLoaded( RigEclipseResultAddress( RiaDefines::DYNAMIC_NATIVE, "RS" ) );
|
||||||
@ -220,7 +223,11 @@ bool RiuPvtPlotUpdater::queryDataAndUpdatePlot( const RimEclipseView& eclipseVie
|
|||||||
&viscosityDynProps.mu_o,
|
&viscosityDynProps.mu_o,
|
||||||
&viscosityDynProps.mu_g );
|
&viscosityDynProps.mu_g );
|
||||||
|
|
||||||
QString cellRefText = constructCellReferenceText( eclipseCaseData, gridIndex, gridLocalCellIndex, cellPVTNUM );
|
QString cellRefText = RiuRelativePermeabilityPlotUpdater::constructCellReferenceText( eclipseCaseData,
|
||||||
|
gridIndex,
|
||||||
|
gridLocalCellIndex,
|
||||||
|
"PVTNUM",
|
||||||
|
cellPVTNUM );
|
||||||
|
|
||||||
plotPanel->setPlotData( eclipseCaseData->unitsType(),
|
plotPanel->setPlotData( eclipseCaseData->unitsType(),
|
||||||
fvfCurveArr,
|
fvfCurveArr,
|
||||||
@ -236,47 +243,3 @@ bool RiuPvtPlotUpdater::queryDataAndUpdatePlot( const RimEclipseView& eclipseVie
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
QString RiuPvtPlotUpdater::constructCellReferenceText( const RigEclipseCaseData* eclipseCaseData,
|
|
||||||
size_t gridIndex,
|
|
||||||
size_t gridLocalCellIndex,
|
|
||||||
double pvtnum )
|
|
||||||
{
|
|
||||||
const size_t gridCount = eclipseCaseData ? eclipseCaseData->gridCount() : 0;
|
|
||||||
const RigGridBase* grid = gridIndex < gridCount ? eclipseCaseData->grid( gridIndex ) : nullptr;
|
|
||||||
if ( grid && gridLocalCellIndex < grid->cellCount() )
|
|
||||||
{
|
|
||||||
size_t i = 0;
|
|
||||||
size_t j = 0;
|
|
||||||
size_t k = 0;
|
|
||||||
if ( grid->ijkFromCellIndex( gridLocalCellIndex, &i, &j, &k ) )
|
|
||||||
{
|
|
||||||
// Adjust to 1-based Eclipse indexing
|
|
||||||
i++;
|
|
||||||
j++;
|
|
||||||
k++;
|
|
||||||
|
|
||||||
QString retText;
|
|
||||||
if ( gridIndex == 0 )
|
|
||||||
{
|
|
||||||
retText = QString( "Cell: [%1, %2, %3]" ).arg( i ).arg( j ).arg( k );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
retText = QString( "LGR %1, Cell: [%2, %3, %4]" ).arg( gridIndex ).arg( i ).arg( j ).arg( k );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( pvtnum != HUGE_VAL )
|
|
||||||
{
|
|
||||||
retText += QString( " (PVTNUM=%1)" ).arg( pvtnum );
|
|
||||||
}
|
|
||||||
|
|
||||||
return retText;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return QString();
|
|
||||||
}
|
|
||||||
|
@ -26,6 +26,7 @@ class RiuPvtPlotPanel;
|
|||||||
class Rim3dView;
|
class Rim3dView;
|
||||||
class RimEclipseView;
|
class RimEclipseView;
|
||||||
class RigEclipseCaseData;
|
class RigEclipseCaseData;
|
||||||
|
class RimEclipseResultDefinition;
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
//
|
//
|
||||||
@ -41,16 +42,13 @@ public:
|
|||||||
void updateOnTimeStepChanged( Rim3dView* changedView );
|
void updateOnTimeStepChanged( Rim3dView* changedView );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static bool queryDataAndUpdatePlot( const RimEclipseView& eclipseView,
|
static bool queryDataAndUpdatePlot( const RimEclipseResultDefinition* eclipseResultDef,
|
||||||
size_t gridIndex,
|
size_t timeStepIndex,
|
||||||
size_t gridLocalCellIndex,
|
size_t gridIndex,
|
||||||
RiuPvtPlotPanel* plotPanel );
|
size_t gridLocalCellIndex,
|
||||||
static QString constructCellReferenceText( const RigEclipseCaseData* eclipseCaseData,
|
RiuPvtPlotPanel* plotPanel );
|
||||||
size_t gridIndex,
|
|
||||||
size_t gridLocalCellIndex,
|
|
||||||
double pvtnum );
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QPointer<RiuPvtPlotPanel> m_targetPlotPanel;
|
QPointer<RiuPvtPlotPanel> m_targetPlotPanel;
|
||||||
const Rim3dView* m_sourceEclipseViewOfLastPlot;
|
const Rim3dView* m_viewToFollowAnimationFrom;
|
||||||
};
|
};
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
|
|
||||||
#include "Rim2dIntersectionView.h"
|
#include "Rim2dIntersectionView.h"
|
||||||
#include "Rim3dView.h"
|
#include "Rim3dView.h"
|
||||||
|
#include "RimEclipseCellColors.h"
|
||||||
#include "RimEclipseResultCase.h"
|
#include "RimEclipseResultCase.h"
|
||||||
#include "RimEclipseView.h"
|
#include "RimEclipseView.h"
|
||||||
#include "RimExtrudedCurveIntersection.h"
|
#include "RimExtrudedCurveIntersection.h"
|
||||||
@ -50,10 +51,12 @@
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RiuRelativePermeabilityPlotUpdater::RiuRelativePermeabilityPlotUpdater( RiuRelativePermeabilityPlotPanel* targetPlotPanel )
|
RiuRelativePermeabilityPlotUpdater::RiuRelativePermeabilityPlotUpdater( RiuRelativePermeabilityPlotPanel* targetPlotPanel )
|
||||||
: m_targetPlotPanel( targetPlotPanel )
|
: m_targetPlotPanel( targetPlotPanel )
|
||||||
, m_sourceEclipseViewOfLastPlot( nullptr )
|
, m_viewToFollowAnimationFrom( nullptr )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -64,32 +67,25 @@ void RiuRelativePermeabilityPlotUpdater::updateOnSelectionChanged( const RiuSele
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_sourceEclipseViewOfLastPlot = nullptr;
|
Rim3dView* newFollowAnimView = nullptr;
|
||||||
bool mustClearPlot = true;
|
RiuEclipseSelectionItem* eclipseSelectionItem = nullptr;
|
||||||
|
|
||||||
RiuEclipseSelectionItem* eclipseSelectionItem = dynamic_cast<RiuEclipseSelectionItem*>(
|
eclipseSelectionItem = extractEclipseSelectionItem( selectionItem, newFollowAnimView );
|
||||||
const_cast<RiuSelectionItem*>( selectionItem ) );
|
|
||||||
RimEclipseView* eclipseView = eclipseSelectionItem ? eclipseSelectionItem->m_view.p() : nullptr;
|
|
||||||
|
|
||||||
if ( !eclipseSelectionItem && !eclipseView )
|
bool mustClearPlot = true;
|
||||||
|
m_viewToFollowAnimationFrom = nullptr;
|
||||||
|
|
||||||
|
if ( m_targetPlotPanel->isVisible() && eclipseSelectionItem )
|
||||||
{
|
{
|
||||||
const Riu2dIntersectionSelectionItem* intersectionSelItem = dynamic_cast<const Riu2dIntersectionSelectionItem*>(
|
if ( queryDataAndUpdatePlot( eclipseSelectionItem->m_resultDefinition,
|
||||||
selectionItem );
|
eclipseSelectionItem->m_timestepIdx,
|
||||||
if ( intersectionSelItem && intersectionSelItem->eclipseSelectionItem() )
|
eclipseSelectionItem->m_gridIndex,
|
||||||
|
eclipseSelectionItem->m_gridLocalCellIndex,
|
||||||
|
m_targetPlotPanel ) )
|
||||||
{
|
{
|
||||||
eclipseSelectionItem = intersectionSelItem->eclipseSelectionItem();
|
mustClearPlot = false;
|
||||||
eclipseView = eclipseSelectionItem->m_view;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( m_targetPlotPanel->isVisible() && eclipseSelectionItem && eclipseView )
|
m_viewToFollowAnimationFrom = newFollowAnimView;
|
||||||
{
|
|
||||||
const size_t gridIndex = eclipseSelectionItem->m_gridIndex;
|
|
||||||
const size_t gridLocalCellIndex = eclipseSelectionItem->m_gridLocalCellIndex;
|
|
||||||
if ( queryDataAndUpdatePlot( *eclipseView, gridIndex, gridLocalCellIndex, m_targetPlotPanel ) )
|
|
||||||
{
|
|
||||||
mustClearPlot = false;
|
|
||||||
m_sourceEclipseViewOfLastPlot = eclipseView;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -109,21 +105,29 @@ void RiuRelativePermeabilityPlotUpdater::updateOnTimeStepChanged( Rim3dView* cha
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't update the plot if the view that changed time step is different from the view that was the source of the current plot
|
// Don't update the plot if the view that changed time step is different
|
||||||
const RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>( changedView );
|
// from the view that was the source of the current plot
|
||||||
if ( !eclipseView || eclipseView != m_sourceEclipseViewOfLastPlot )
|
|
||||||
|
if ( changedView != m_viewToFollowAnimationFrom )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fetch the current global selection and only continue if the selection's view matches the view with time step change
|
// Fetch the current global selection and only continue if the selection's view matches the view with time step change
|
||||||
const RiuEclipseSelectionItem* eclipseSelectionItem = dynamic_cast<const RiuEclipseSelectionItem*>(
|
|
||||||
Riu3dSelectionManager::instance()->selectedItem() );
|
const RiuSelectionItem* selectionItem = Riu3dSelectionManager::instance()->selectedItem();
|
||||||
if ( eclipseSelectionItem && eclipseSelectionItem->m_view == eclipseView )
|
Rim3dView* newFollowAnimView = nullptr;
|
||||||
|
RiuEclipseSelectionItem* eclipseSelectionItem = nullptr;
|
||||||
|
|
||||||
|
eclipseSelectionItem = extractEclipseSelectionItem( selectionItem, newFollowAnimView );
|
||||||
|
|
||||||
|
if ( eclipseSelectionItem && newFollowAnimView == changedView )
|
||||||
{
|
{
|
||||||
const size_t gridIndex = eclipseSelectionItem->m_gridIndex;
|
if ( !queryDataAndUpdatePlot( eclipseSelectionItem->m_resultDefinition,
|
||||||
const size_t gridLocalCellIndex = eclipseSelectionItem->m_gridLocalCellIndex;
|
newFollowAnimView->currentTimeStep(),
|
||||||
if ( !queryDataAndUpdatePlot( *eclipseView, gridIndex, gridLocalCellIndex, m_targetPlotPanel ) )
|
eclipseSelectionItem->m_gridIndex,
|
||||||
|
eclipseSelectionItem->m_gridLocalCellIndex,
|
||||||
|
m_targetPlotPanel ) )
|
||||||
{
|
{
|
||||||
m_targetPlotPanel->clearPlot();
|
m_targetPlotPanel->clearPlot();
|
||||||
}
|
}
|
||||||
@ -133,18 +137,21 @@ void RiuRelativePermeabilityPlotUpdater::updateOnTimeStepChanged( Rim3dView* cha
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RiuRelativePermeabilityPlotUpdater::queryDataAndUpdatePlot( const RimEclipseView& eclipseView,
|
bool RiuRelativePermeabilityPlotUpdater::queryDataAndUpdatePlot( const RimEclipseResultDefinition* eclipseResDef,
|
||||||
|
size_t timeStepIndex,
|
||||||
size_t gridIndex,
|
size_t gridIndex,
|
||||||
size_t gridLocalCellIndex,
|
size_t gridLocalCellIndex,
|
||||||
RiuRelativePermeabilityPlotPanel* plotPanel )
|
RiuRelativePermeabilityPlotPanel* plotPanel )
|
||||||
{
|
{
|
||||||
CVF_ASSERT( plotPanel );
|
CVF_ASSERT( plotPanel );
|
||||||
|
|
||||||
RimEclipseResultCase* eclipseResultCase = dynamic_cast<RimEclipseResultCase*>( eclipseView.eclipseCase() );
|
RimEclipseResultCase* eclipseResultCase = dynamic_cast<RimEclipseResultCase*>( eclipseResDef->eclipseCase() );
|
||||||
RigEclipseCaseData* eclipseCaseData = eclipseResultCase ? eclipseResultCase->eclipseCaseData() : nullptr;
|
RigEclipseCaseData* eclipseCaseData = eclipseResultCase ? eclipseResultCase->eclipseCaseData() : nullptr;
|
||||||
|
|
||||||
if ( eclipseResultCase && eclipseCaseData && eclipseResultCase->flowDiagSolverInterface() )
|
if ( eclipseResultCase && eclipseCaseData && eclipseResultCase->flowDiagSolverInterface() )
|
||||||
{
|
{
|
||||||
size_t activeCellIndex = CellLookupHelper::mapToActiveCellIndex( eclipseCaseData, gridIndex, gridLocalCellIndex );
|
size_t activeCellIndex = CellLookupHelper::mapToActiveCellIndex( eclipseCaseData, gridIndex, gridLocalCellIndex );
|
||||||
|
|
||||||
if ( activeCellIndex != cvf::UNDEFINED_SIZE_T )
|
if ( activeCellIndex != cvf::UNDEFINED_SIZE_T )
|
||||||
{
|
{
|
||||||
// cvf::Trace::show("Updating RelPerm plot for active cell index: %d", static_cast<int>(activeCellIndex));
|
// cvf::Trace::show("Updating RelPerm plot for active cell index: %d", static_cast<int>(activeCellIndex));
|
||||||
@ -159,7 +166,6 @@ bool RiuRelativePermeabilityPlotUpdater::queryDataAndUpdatePlot( const RimEclips
|
|||||||
cellResultsData->ensureKnownResultLoaded( RigEclipseResultAddress( RiaDefines::STATIC_NATIVE, "SATNUM" ) );
|
cellResultsData->ensureKnownResultLoaded( RigEclipseResultAddress( RiaDefines::STATIC_NATIVE, "SATNUM" ) );
|
||||||
|
|
||||||
// Fetch SWAT and SGAS cell values for the selected cell
|
// Fetch SWAT and SGAS cell values for the selected cell
|
||||||
const size_t timeStepIndex = static_cast<size_t>( eclipseView.currentTimeStep() );
|
|
||||||
cvf::ref<RigResultAccessor> swatAccessor =
|
cvf::ref<RigResultAccessor> swatAccessor =
|
||||||
RigResultAccessorFactory::createFromResultAddress( eclipseCaseData,
|
RigResultAccessorFactory::createFromResultAddress( eclipseCaseData,
|
||||||
gridIndex,
|
gridIndex,
|
||||||
@ -187,8 +193,9 @@ bool RiuRelativePermeabilityPlotUpdater::queryDataAndUpdatePlot( const RimEclips
|
|||||||
: HUGE_VAL;
|
: HUGE_VAL;
|
||||||
// cvf::Trace::show("cellSWAT = %f cellSGAS = %f cellSATNUM = %f", cellSWAT, cellSGAS, cellSATNUM);
|
// cvf::Trace::show("cellSWAT = %f cellSGAS = %f cellSATNUM = %f", cellSWAT, cellSGAS, cellSATNUM);
|
||||||
|
|
||||||
QString cellRefText = constructCellReferenceText( eclipseCaseData, gridIndex, gridLocalCellIndex, cellSATNUM );
|
QString cellRefText =
|
||||||
QString caseName = eclipseResultCase->caseUserDescription;
|
constructCellReferenceText( eclipseCaseData, gridIndex, gridLocalCellIndex, "SATNUM", cellSATNUM );
|
||||||
|
QString caseName = eclipseResultCase->caseUserDescription;
|
||||||
|
|
||||||
plotPanel->setPlotData( eclipseCaseData->unitsType(), relPermCurveArr, cellSWAT, cellSGAS, caseName, cellRefText );
|
plotPanel->setPlotData( eclipseCaseData->unitsType(), relPermCurveArr, cellSWAT, cellSGAS, caseName, cellRefText );
|
||||||
|
|
||||||
@ -205,7 +212,8 @@ bool RiuRelativePermeabilityPlotUpdater::queryDataAndUpdatePlot( const RimEclips
|
|||||||
QString RiuRelativePermeabilityPlotUpdater::constructCellReferenceText( const RigEclipseCaseData* eclipseCaseData,
|
QString RiuRelativePermeabilityPlotUpdater::constructCellReferenceText( const RigEclipseCaseData* eclipseCaseData,
|
||||||
size_t gridIndex,
|
size_t gridIndex,
|
||||||
size_t gridLocalCellIndex,
|
size_t gridLocalCellIndex,
|
||||||
double satnum )
|
const QString& valueName,
|
||||||
|
double cellValue )
|
||||||
{
|
{
|
||||||
const size_t gridCount = eclipseCaseData ? eclipseCaseData->gridCount() : 0;
|
const size_t gridCount = eclipseCaseData ? eclipseCaseData->gridCount() : 0;
|
||||||
const RigGridBase* grid = gridIndex < gridCount ? eclipseCaseData->grid( gridIndex ) : nullptr;
|
const RigGridBase* grid = gridIndex < gridCount ? eclipseCaseData->grid( gridIndex ) : nullptr;
|
||||||
@ -230,9 +238,9 @@ QString RiuRelativePermeabilityPlotUpdater::constructCellReferenceText( const Ri
|
|||||||
{
|
{
|
||||||
retText = QString( "LGR %1, Cell: [%2, %3, %4]" ).arg( gridIndex ).arg( i ).arg( j ).arg( k );
|
retText = QString( "LGR %1, Cell: [%2, %3, %4]" ).arg( gridIndex ).arg( i ).arg( j ).arg( k );
|
||||||
}
|
}
|
||||||
if ( satnum != HUGE_VAL )
|
if ( cellValue != HUGE_VAL )
|
||||||
{
|
{
|
||||||
retText += QString( " (SATNUM=%1)" ).arg( satnum );
|
retText += QString( " (%1=%2)" ).arg( valueName ).arg( cellValue );
|
||||||
}
|
}
|
||||||
|
|
||||||
return retText;
|
return retText;
|
||||||
@ -242,6 +250,45 @@ QString RiuRelativePermeabilityPlotUpdater::constructCellReferenceText( const Ri
|
|||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RiuEclipseSelectionItem*
|
||||||
|
RiuRelativePermeabilityPlotUpdater::extractEclipseSelectionItem( const RiuSelectionItem* selectionItem,
|
||||||
|
Rim3dView*& newFollowAnimView )
|
||||||
|
{
|
||||||
|
newFollowAnimView = nullptr;
|
||||||
|
RiuEclipseSelectionItem* eclipseSelectionItem = nullptr;
|
||||||
|
|
||||||
|
eclipseSelectionItem = dynamic_cast<RiuEclipseSelectionItem*>( const_cast<RiuSelectionItem*>( selectionItem ) );
|
||||||
|
|
||||||
|
if ( eclipseSelectionItem )
|
||||||
|
{
|
||||||
|
// If we clicked in an eclipse view, and hit something using the standard result definition there,
|
||||||
|
// set this up to follow the animation there.
|
||||||
|
|
||||||
|
RimEclipseView* clickedInEclView = dynamic_cast<RimEclipseView*>( eclipseSelectionItem->m_view.p() );
|
||||||
|
|
||||||
|
if ( clickedInEclView && clickedInEclView->cellResult() == eclipseSelectionItem->m_resultDefinition.p() )
|
||||||
|
{
|
||||||
|
newFollowAnimView = eclipseSelectionItem->m_view;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
auto intersectionSelItem = dynamic_cast<const Riu2dIntersectionSelectionItem*>( selectionItem );
|
||||||
|
|
||||||
|
if ( intersectionSelItem && intersectionSelItem->eclipseSelectionItem() )
|
||||||
|
{
|
||||||
|
eclipseSelectionItem = intersectionSelItem->eclipseSelectionItem();
|
||||||
|
newFollowAnimView = intersectionSelItem->view();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return eclipseSelectionItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
@ -255,17 +302,21 @@ size_t CellLookupHelper::mapToActiveCellIndex( const RigEclipseCaseData* eclipse
|
|||||||
size_t gridIndex,
|
size_t gridIndex,
|
||||||
size_t gridLocalCellIndex )
|
size_t gridLocalCellIndex )
|
||||||
{
|
{
|
||||||
const size_t gridCount = eclipseCaseData ? eclipseCaseData->gridCount() : 0;
|
const size_t gridCount = eclipseCaseData ? eclipseCaseData->gridCount() : 0;
|
||||||
const RigGridBase* grid = gridIndex < gridCount ? eclipseCaseData->grid( gridIndex ) : nullptr;
|
|
||||||
|
const RigGridBase* grid = gridIndex < gridCount ? eclipseCaseData->grid( gridIndex ) : nullptr;
|
||||||
|
|
||||||
if ( grid && gridLocalCellIndex < grid->cellCount() )
|
if ( grid && gridLocalCellIndex < grid->cellCount() )
|
||||||
{
|
{
|
||||||
// Note!!
|
// Note!!
|
||||||
// Which type of porosity model to choose? Currently hard-code to MATRIX_MODEL
|
// Which type of porosity model to choose? Currently hard-code to MATRIX_MODEL
|
||||||
const RigActiveCellInfo* activeCellInfo = eclipseCaseData->activeCellInfo( RiaDefines::MATRIX_MODEL );
|
const RigActiveCellInfo* activeCellInfo = eclipseCaseData->activeCellInfo( RiaDefines::MATRIX_MODEL );
|
||||||
|
|
||||||
CVF_ASSERT( activeCellInfo );
|
CVF_ASSERT( activeCellInfo );
|
||||||
|
|
||||||
const size_t reservoirCellIndex = grid->reservoirCellIndex( gridLocalCellIndex );
|
const size_t reservoirCellIndex = grid->reservoirCellIndex( gridLocalCellIndex );
|
||||||
const size_t activeCellIndex = activeCellInfo->cellResultIndex( reservoirCellIndex );
|
const size_t activeCellIndex = activeCellInfo->cellResultIndex( reservoirCellIndex );
|
||||||
|
|
||||||
return activeCellIndex;
|
return activeCellIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,6 +26,9 @@ class RiuRelativePermeabilityPlotPanel;
|
|||||||
class Rim3dView;
|
class Rim3dView;
|
||||||
class RimEclipseView;
|
class RimEclipseView;
|
||||||
class RigEclipseCaseData;
|
class RigEclipseCaseData;
|
||||||
|
class RimEclipseResultDefinition;
|
||||||
|
class RiuSelectionItem;
|
||||||
|
class RiuEclipseSelectionItem;
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
//
|
//
|
||||||
@ -40,19 +43,24 @@ public:
|
|||||||
void updateOnSelectionChanged( const RiuSelectionItem* selectionItem );
|
void updateOnSelectionChanged( const RiuSelectionItem* selectionItem );
|
||||||
void updateOnTimeStepChanged( Rim3dView* changedView );
|
void updateOnTimeStepChanged( Rim3dView* changedView );
|
||||||
|
|
||||||
|
static RiuEclipseSelectionItem* extractEclipseSelectionItem( const RiuSelectionItem* selectionItem,
|
||||||
|
Rim3dView*& newFollowAnimView );
|
||||||
|
static QString constructCellReferenceText( const RigEclipseCaseData* eclipseCaseData,
|
||||||
|
size_t gridIndex,
|
||||||
|
size_t gridLocalCellIndex,
|
||||||
|
const QString& valueName,
|
||||||
|
double cellValue );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static bool queryDataAndUpdatePlot( const RimEclipseView& eclipseView,
|
static bool queryDataAndUpdatePlot( const RimEclipseResultDefinition* eclipseResDef,
|
||||||
size_t gridIndex,
|
size_t timeStepIndex,
|
||||||
size_t gridLocalCellIndex,
|
size_t gridIndex,
|
||||||
RiuRelativePermeabilityPlotPanel* plotPanel );
|
size_t gridLocalCellIndex,
|
||||||
static QString constructCellReferenceText( const RigEclipseCaseData* eclipseCaseData,
|
RiuRelativePermeabilityPlotPanel* plotPanel );
|
||||||
size_t gridIndex,
|
|
||||||
size_t gridLocalCellIndex,
|
|
||||||
double satnum );
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QPointer<RiuRelativePermeabilityPlotPanel> m_targetPlotPanel;
|
QPointer<RiuRelativePermeabilityPlotPanel> m_targetPlotPanel;
|
||||||
const Rim3dView* m_sourceEclipseViewOfLastPlot;
|
const Rim3dView* m_viewToFollowAnimationFrom;
|
||||||
};
|
};
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
|
@ -134,43 +134,41 @@ void RiuSelectionChangedHandler::handleSetSelectedItem( const RiuSelectionItem*
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuSelectionChangedHandler::addCurveFromSelectionItem( const RiuEclipseSelectionItem* eclipseSelectionItem ) const
|
void RiuSelectionChangedHandler::addCurveFromSelectionItem( const RiuEclipseSelectionItem* eclipseSelectionItem ) const
|
||||||
{
|
{
|
||||||
RimEclipseView* eclipseView = eclipseSelectionItem->m_view.p();
|
RimEclipseResultDefinition* eclResDef = eclipseSelectionItem->m_resultDefinition;
|
||||||
|
|
||||||
if ( eclipseView->cellResult()->isFlowDiagOrInjectionFlooding() &&
|
if ( eclResDef->isFlowDiagOrInjectionFlooding() && eclResDef->resultVariable() != RIG_NUM_FLOODED_PV )
|
||||||
eclipseView->cellResult()->resultVariable() != RIG_NUM_FLOODED_PV )
|
|
||||||
{
|
{
|
||||||
// NB! Do not read out data for flow results, as this can be a time consuming operation
|
// NB! Do not read out data for flow results, as this can be a time consuming operation
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if ( eclipseView->cellResult()->hasDynamicResult() &&
|
else if ( eclResDef->hasDynamicResult() && !RiaDefines::isPerCellFaceResult( eclResDef->resultVariable() ) &&
|
||||||
!RiaDefines::isPerCellFaceResult( eclipseView->cellResult()->resultVariable() ) &&
|
eclResDef->eclipseCase() && eclResDef->eclipseCase()->eclipseCaseData() )
|
||||||
eclipseView->eclipseCase() && eclipseView->eclipseCase()->eclipseCaseData() )
|
|
||||||
{
|
{
|
||||||
RiaDefines::PorosityModelType porosityModel = eclipseView->cellResult()->porosityModel();
|
RiaDefines::PorosityModelType porosityModel = eclResDef->porosityModel();
|
||||||
|
|
||||||
std::vector<QDateTime> timeStepDates =
|
std::vector<QDateTime> timeStepDates =
|
||||||
eclipseView->eclipseCase()->eclipseCaseData()->results( porosityModel )->timeStepDates();
|
eclResDef->eclipseCase()->eclipseCaseData()->results( porosityModel )->timeStepDates();
|
||||||
|
|
||||||
QString curveName = eclipseView->eclipseCase()->caseUserDescription();
|
QString curveName = eclResDef->eclipseCase()->caseUserDescription();
|
||||||
curveName += ", ";
|
curveName += ", ";
|
||||||
curveName += eclipseView->cellResult()->resultVariableUiShortName();
|
curveName += eclResDef->resultVariableUiShortName();
|
||||||
curveName += ", ";
|
curveName += ", ";
|
||||||
curveName += QString( "Grid index %1" ).arg( eclipseSelectionItem->m_gridIndex );
|
curveName += QString( "Grid index %1" ).arg( eclipseSelectionItem->m_gridIndex );
|
||||||
curveName += ", ";
|
curveName += ", ";
|
||||||
curveName += RigTimeHistoryResultAccessor::geometrySelectionText( eclipseView->eclipseCase()->eclipseCaseData(),
|
curveName += RigTimeHistoryResultAccessor::geometrySelectionText( eclResDef->eclipseCase()->eclipseCaseData(),
|
||||||
eclipseSelectionItem->m_gridIndex,
|
eclipseSelectionItem->m_gridIndex,
|
||||||
eclipseSelectionItem->m_gridLocalCellIndex );
|
eclipseSelectionItem->m_gridLocalCellIndex );
|
||||||
|
|
||||||
std::vector<double> timeHistoryValues =
|
std::vector<double> timeHistoryValues =
|
||||||
RigTimeHistoryResultAccessor::timeHistoryValues( eclipseView->eclipseCase()->eclipseCaseData(),
|
RigTimeHistoryResultAccessor::timeHistoryValues( eclResDef->eclipseCase()->eclipseCaseData(),
|
||||||
eclipseView->cellResult(),
|
eclResDef,
|
||||||
eclipseSelectionItem->m_gridIndex,
|
eclipseSelectionItem->m_gridIndex,
|
||||||
eclipseSelectionItem->m_gridLocalCellIndex,
|
eclipseSelectionItem->m_gridLocalCellIndex,
|
||||||
timeStepDates.size() );
|
timeStepDates.size() );
|
||||||
CVF_ASSERT( timeStepDates.size() == timeHistoryValues.size() );
|
CVF_ASSERT( timeStepDates.size() == timeHistoryValues.size() );
|
||||||
|
|
||||||
RiuMainWindow::instance()->resultPlot()->addCurve( eclipseView->eclipseCase(),
|
RiuMainWindow::instance()->resultPlot()->addCurve( eclResDef->eclipseCase(),
|
||||||
curveName,
|
curveName,
|
||||||
eclipseSelectionItem->m_color,
|
eclipseSelectionItem->m_color,
|
||||||
timeStepDates,
|
timeStepDates,
|
||||||
@ -183,22 +181,20 @@ void RiuSelectionChangedHandler::addCurveFromSelectionItem( const RiuEclipseSele
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuSelectionChangedHandler::addCurveFromSelectionItem( const RiuGeoMechSelectionItem* geomSelectionItem ) const
|
void RiuSelectionChangedHandler::addCurveFromSelectionItem( const RiuGeoMechSelectionItem* geomSelectionItem ) const
|
||||||
{
|
{
|
||||||
RimGeoMechView* geoMechView = geomSelectionItem->m_view.p();
|
RimGeoMechResultDefinition* geomResDef = geomSelectionItem->m_resultDefinition;
|
||||||
|
|
||||||
if ( geoMechView && geoMechView->cellResultResultDefinition() &&
|
if ( geomResDef && geomResDef->hasResult() && geomResDef->geoMechCase() && geomResDef->geoMechCase()->geoMechData() )
|
||||||
geoMechView->cellResultResultDefinition()->hasResult() && geoMechView->geoMechCase() &&
|
|
||||||
geoMechView->geoMechCase()->geoMechData() )
|
|
||||||
{
|
{
|
||||||
std::unique_ptr<RiuFemTimeHistoryResultAccessor> timeHistResultAccessor;
|
std::unique_ptr<RiuFemTimeHistoryResultAccessor> timeHistResultAccessor;
|
||||||
|
|
||||||
cvf::Vec3d intersectionPointInDomain = geoMechView->displayCoordTransform()->translateToDomainCoord(
|
cvf::Vec3d intersectionPointInDomain = geomSelectionItem->m_view->displayCoordTransform()->translateToDomainCoord(
|
||||||
geomSelectionItem->m_localIntersectionPointInDisplay );
|
geomSelectionItem->m_localIntersectionPointInDisplay );
|
||||||
|
|
||||||
if ( geomSelectionItem->m_hasIntersectionTriangle )
|
if ( geomSelectionItem->m_hasIntersectionTriangle )
|
||||||
{
|
{
|
||||||
timeHistResultAccessor = std::unique_ptr<RiuFemTimeHistoryResultAccessor>(
|
timeHistResultAccessor = std::unique_ptr<RiuFemTimeHistoryResultAccessor>(
|
||||||
new RiuFemTimeHistoryResultAccessor( geoMechView->geoMechCase()->geoMechData(),
|
new RiuFemTimeHistoryResultAccessor( geomResDef->geoMechCase()->geoMechData(),
|
||||||
geoMechView->cellResultResultDefinition()->resultAddress(),
|
geomResDef->resultAddress(),
|
||||||
geomSelectionItem->m_gridIndex,
|
geomSelectionItem->m_gridIndex,
|
||||||
static_cast<int>( geomSelectionItem->m_cellIndex ),
|
static_cast<int>( geomSelectionItem->m_cellIndex ),
|
||||||
geomSelectionItem->m_elementFace,
|
geomSelectionItem->m_elementFace,
|
||||||
@ -208,8 +204,8 @@ void RiuSelectionChangedHandler::addCurveFromSelectionItem( const RiuGeoMechSele
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
timeHistResultAccessor = std::unique_ptr<RiuFemTimeHistoryResultAccessor>(
|
timeHistResultAccessor = std::unique_ptr<RiuFemTimeHistoryResultAccessor>(
|
||||||
new RiuFemTimeHistoryResultAccessor( geoMechView->geoMechCase()->geoMechData(),
|
new RiuFemTimeHistoryResultAccessor( geomResDef->geoMechCase()->geoMechData(),
|
||||||
geoMechView->cellResultResultDefinition()->resultAddress(),
|
geomResDef->resultAddress(),
|
||||||
geomSelectionItem->m_gridIndex,
|
geomSelectionItem->m_gridIndex,
|
||||||
static_cast<int>( geomSelectionItem->m_cellIndex ),
|
static_cast<int>( geomSelectionItem->m_cellIndex ),
|
||||||
geomSelectionItem->m_elementFace,
|
geomSelectionItem->m_elementFace,
|
||||||
@ -217,12 +213,12 @@ void RiuSelectionChangedHandler::addCurveFromSelectionItem( const RiuGeoMechSele
|
|||||||
}
|
}
|
||||||
|
|
||||||
QString curveName;
|
QString curveName;
|
||||||
curveName.append( geoMechView->geoMechCase()->caseUserDescription() + ", " );
|
curveName.append( geomResDef->geoMechCase()->caseUserDescription() + ", " );
|
||||||
|
|
||||||
caf::AppEnum<RigFemResultPosEnum> resPosAppEnum = geoMechView->cellResultResultDefinition()->resultPositionType();
|
caf::AppEnum<RigFemResultPosEnum> resPosAppEnum = geomResDef->resultPositionType();
|
||||||
curveName.append( resPosAppEnum.uiText() + ", " );
|
curveName.append( resPosAppEnum.uiText() + ", " );
|
||||||
curveName.append( geoMechView->cellResultResultDefinition()->resultFieldUiName() + ", " );
|
curveName.append( geomResDef->resultFieldUiName() + ", " );
|
||||||
curveName.append( geoMechView->cellResultResultDefinition()->resultComponentUiName() + " " );
|
curveName.append( geomResDef->resultComponentUiName() + " " );
|
||||||
|
|
||||||
if ( resPosAppEnum == RIG_ELEMENT_NODAL_FACE )
|
if ( resPosAppEnum == RIG_ELEMENT_NODAL_FACE )
|
||||||
{
|
{
|
||||||
@ -243,10 +239,10 @@ void RiuSelectionChangedHandler::addCurveFromSelectionItem( const RiuGeoMechSele
|
|||||||
|
|
||||||
std::vector<double> timeHistoryValues = timeHistResultAccessor->timeHistoryValues();
|
std::vector<double> timeHistoryValues = timeHistResultAccessor->timeHistoryValues();
|
||||||
|
|
||||||
std::vector<QDateTime> dates = geoMechView->geoMechCase()->timeStepDates();
|
std::vector<QDateTime> dates = geomResDef->geoMechCase()->timeStepDates();
|
||||||
if ( dates.size() == timeHistoryValues.size() )
|
if ( dates.size() == timeHistoryValues.size() )
|
||||||
{
|
{
|
||||||
RiuMainWindow::instance()->resultPlot()->addCurve( geoMechView->geoMechCase(),
|
RiuMainWindow::instance()->resultPlot()->addCurve( geomResDef->geoMechCase(),
|
||||||
curveName,
|
curveName,
|
||||||
geomSelectionItem->m_color,
|
geomSelectionItem->m_color,
|
||||||
dates,
|
dates,
|
||||||
@ -260,7 +256,7 @@ void RiuSelectionChangedHandler::addCurveFromSelectionItem( const RiuGeoMechSele
|
|||||||
dummyStepTimes.push_back( i );
|
dummyStepTimes.push_back( i );
|
||||||
}
|
}
|
||||||
|
|
||||||
RiuMainWindow::instance()->resultPlot()->addCurve( geoMechView->geoMechCase(),
|
RiuMainWindow::instance()->resultPlot()->addCurve( geomResDef->geoMechCase(),
|
||||||
curveName,
|
curveName,
|
||||||
geomSelectionItem->m_color,
|
geomSelectionItem->m_color,
|
||||||
dummyStepTimes,
|
dummyStepTimes,
|
||||||
@ -364,39 +360,48 @@ void RiuSelectionChangedHandler::updateResultInfo( const RiuSelectionItem* itemA
|
|||||||
{
|
{
|
||||||
const RiuEclipseSelectionItem* eclipseSelectionItem = static_cast<const RiuEclipseSelectionItem*>( selItem );
|
const RiuEclipseSelectionItem* eclipseSelectionItem = static_cast<const RiuEclipseSelectionItem*>( selItem );
|
||||||
|
|
||||||
RimEclipseView* eclipseView = eclipseSelectionItem->m_view.p();
|
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>( eclipseSelectionItem->m_view.p() );
|
||||||
|
|
||||||
RiuResultTextBuilder textBuilder( eclipseView,
|
if ( eclipseView )
|
||||||
eclipseSelectionItem->m_gridIndex,
|
{
|
||||||
eclipseSelectionItem->m_gridLocalCellIndex,
|
RiuResultTextBuilder textBuilder( eclipseView,
|
||||||
eclipseView->currentTimeStep() );
|
eclipseSelectionItem->m_gridIndex,
|
||||||
textBuilder.setFace( eclipseSelectionItem->m_face );
|
eclipseSelectionItem->m_gridLocalCellIndex,
|
||||||
textBuilder.setNncIndex( eclipseSelectionItem->m_nncIndex );
|
eclipseSelectionItem->m_timestepIdx );
|
||||||
textBuilder.setIntersectionPointInDisplay( eclipseSelectionItem->m_localIntersectionPointInDisplay );
|
textBuilder.setFace( eclipseSelectionItem->m_face );
|
||||||
textBuilder.set2dIntersectionView( intersectionView );
|
textBuilder.setNncIndex( eclipseSelectionItem->m_nncIndex );
|
||||||
|
textBuilder.setIntersectionPointInDisplay( eclipseSelectionItem->m_localIntersectionPointInDisplay );
|
||||||
|
textBuilder.set2dIntersectionView( intersectionView );
|
||||||
|
|
||||||
resultInfo = textBuilder.mainResultText();
|
resultInfo = textBuilder.mainResultText();
|
||||||
|
|
||||||
pickInfo = textBuilder.geometrySelectionText( ", " );
|
pickInfo = textBuilder.geometrySelectionText( ", " );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if ( selItem->type() == RiuSelectionItem::GEOMECH_SELECTION_OBJECT )
|
else if ( selItem->type() == RiuSelectionItem::GEOMECH_SELECTION_OBJECT )
|
||||||
{
|
{
|
||||||
const RiuGeoMechSelectionItem* geomSelectionItem = static_cast<const RiuGeoMechSelectionItem*>( selItem );
|
const RiuGeoMechSelectionItem* geomSelectionItem = static_cast<const RiuGeoMechSelectionItem*>( selItem );
|
||||||
|
|
||||||
RimGeoMechView* geomView = geomSelectionItem->m_view.p();
|
RimGeoMechView* geomView = dynamic_cast<RimGeoMechView*>( geomSelectionItem->m_view.p() );
|
||||||
RiuFemResultTextBuilder textBuilder( geomView,
|
|
||||||
(int)geomSelectionItem->m_gridIndex,
|
|
||||||
(int)geomSelectionItem->m_cellIndex,
|
|
||||||
geomView->currentTimeStep() );
|
|
||||||
textBuilder.setIntersectionPointInDisplay( geomSelectionItem->m_localIntersectionPointInDisplay );
|
|
||||||
textBuilder.setFace( geomSelectionItem->m_elementFace );
|
|
||||||
textBuilder.set2dIntersectionView( intersectionView );
|
|
||||||
if ( geomSelectionItem->m_hasIntersectionTriangle )
|
|
||||||
textBuilder.setIntersectionTriangle( geomSelectionItem->m_intersectionTriangle );
|
|
||||||
|
|
||||||
resultInfo = textBuilder.mainResultText();
|
if ( geomView )
|
||||||
|
{
|
||||||
|
RiuFemResultTextBuilder textBuilder( geomView,
|
||||||
|
(int)geomSelectionItem->m_gridIndex,
|
||||||
|
(int)geomSelectionItem->m_cellIndex,
|
||||||
|
(int)geomSelectionItem->m_timestepIdx );
|
||||||
|
|
||||||
pickInfo = textBuilder.geometrySelectionText( ", " );
|
textBuilder.setIntersectionPointInDisplay( geomSelectionItem->m_localIntersectionPointInDisplay );
|
||||||
|
textBuilder.setFace( geomSelectionItem->m_elementFace );
|
||||||
|
textBuilder.set2dIntersectionView( intersectionView );
|
||||||
|
|
||||||
|
if ( geomSelectionItem->m_hasIntersectionTriangle )
|
||||||
|
textBuilder.setIntersectionTriangle( geomSelectionItem->m_intersectionTriangle );
|
||||||
|
|
||||||
|
resultInfo = textBuilder.mainResultText();
|
||||||
|
|
||||||
|
pickInfo = textBuilder.geometrySelectionText( ", " );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user