Janitor : Avoid include of header file in header

This commit is contained in:
Magne Sjaastad
2021-05-26 11:31:47 +02:00
parent 3fca5f15ae
commit 9d58769f89
29 changed files with 140 additions and 105 deletions

View File

@@ -27,6 +27,7 @@
#include "RigVirtualPerforationTransmissibilities.h"
#include "RigWellLogExtractor.h"
#include "RigWellPath.h"
#include "RigWellResultPoint.h"
#include "Rim3dView.h"
#include "RimEclipseView.h"
@@ -269,7 +270,7 @@ void RivSimWellPipesPartMgr::buildWellPipeParts( const caf::DisplayCoordTransfor
if ( simWellData && simWellData->hasWellResult( frameIndex ) )
{
const RigWellResultFrame& wResFrame = simWellData->wellResultFrame( frameIndex );
const RigWellResultFrame* wResFrame = simWellData->wellResultFrame( frameIndex );
std::vector<CompletionVizData> completionVizDataItems;
@@ -290,7 +291,7 @@ void RivSimWellPipesPartMgr::buildWellPipeParts( const caf::DisplayCoordTransfor
{
size_t globalCellIndex = intersectionInfo.globCellIndex;
const RigWellResultPoint* wResCell =
wResFrame.findResultCellWellHeadIncluded( 0, globalCellIndex );
wResFrame->findResultCellWellHeadIncluded( 0, globalCellIndex );
if ( !wResCell || !wResCell->isValid() )
{
@@ -373,7 +374,7 @@ void RivSimWellPipesPartMgr::updatePipeResultColor( size_t frameIndex )
const double hcInjectorState = 3.5;
const double closedState = 4.5;
const RigWellResultFrame& wResFrame = simWellData->wellResultFrame( frameIndex );
const RigWellResultFrame* wResFrame = simWellData->wellResultFrame( frameIndex );
// Setup a scalar mapper
cvf::ref<cvf::ScalarMapperDiscreteLinear> scalarMapper = new cvf::ScalarMapperDiscreteLinear;
@@ -423,8 +424,8 @@ void RivSimWellPipesPartMgr::updatePipeResultColor( size_t frameIndex )
if ( cellIds[wcIdx].isCell() )
{
wResCell = wResFrame.findResultCellWellHeadExcluded( cellIds[wcIdx].m_gridIndex,
cellIds[wcIdx].m_gridCellIndex );
wResCell = wResFrame->findResultCellWellHeadExcluded( cellIds[wcIdx].m_gridIndex,
cellIds[wcIdx].m_gridCellIndex );
}
if ( wResCell )
@@ -433,7 +434,7 @@ void RivSimWellPipesPartMgr::updatePipeResultColor( size_t frameIndex )
if ( wResCell->m_isOpen )
{
switch ( wResFrame.m_productionType )
switch ( wResFrame->m_productionType )
{
case RiaDefines::WellProductionType::PRODUCER:
cellState = producerState;
@@ -478,7 +479,7 @@ void RivSimWellPipesPartMgr::updatePipeResultColor( size_t frameIndex )
wellBranch.m_surfaceDrawable->setTextureCoordArray( surfTexCoords.p() );
wellBranch.m_largeSurfaceDrawable->setTextureCoordArray( surfTexCoords.p() );
if ( wResFrame.m_isOpen )
if ( wResFrame->m_isOpen )
{
// Use slightly larger geometry for open wells to avoid z-fighting when two wells are located at the
// same position

View File

@@ -43,6 +43,7 @@ class RivPipeGeometryGenerator;
class Rim3dView;
class RimSimWellInView;
class RivWellConnectionFactorGeometryGenerator;
struct RigWellResultPoint;
class RivSimWellPipesPartMgr : public cvf::Object
{

View File

@@ -28,6 +28,7 @@
#include "RigFlowDiagResults.h"
#include "RigMainGrid.h"
#include "RigSimWellData.h"
#include "RigWellResultPoint.h"
#include "cafDisplayCoordTransform.h"
#include "cafEffectGenerator.h"
@@ -62,12 +63,12 @@ void RivWellConnectionsPartMgr::appendDynamicGeometryPartsToModel( cvf::ModelBas
if ( !m_rimReservoirView->eclipseCase() ) return;
if ( !m_rimWell->showWell() ) return;
if ( !m_rimWell->simWellData()->hasWellResult( frameIndex ) ) return;
if ( !m_rimWell->simWellData()->wellResultFrame( frameIndex ).m_isOpen ) return;
if ( m_rimWell->simWellData()->wellResultFrame( frameIndex ).m_productionType ==
if ( !m_rimWell->simWellData()->wellResultFrame( frameIndex )->m_isOpen ) return;
if ( m_rimWell->simWellData()->wellResultFrame( frameIndex )->m_productionType ==
RiaDefines::WellProductionType::UNDEFINED_PRODUCTION_TYPE )
return;
bool isProducer = ( m_rimWell->simWellData()->wellResultFrame( frameIndex ).m_productionType ==
bool isProducer = ( m_rimWell->simWellData()->wellResultFrame( frameIndex )->m_productionType ==
RiaDefines::WellProductionType::PRODUCER );
double pipeRadius = m_rimWell->pipeRadius();
@@ -131,12 +132,12 @@ void RivWellConnectionsPartMgr::appendDynamicGeometryPartsToModel( cvf::ModelBas
{
if ( otherWell == m_rimWell ) continue;
if ( !otherWell->simWellData()->hasWellResult( frameIndex ) ) continue;
if ( !otherWell->simWellData()->wellResultFrame( frameIndex ).m_isOpen ) continue;
if ( otherWell->simWellData()->wellResultFrame( frameIndex ).m_productionType ==
if ( !otherWell->simWellData()->wellResultFrame( frameIndex )->m_isOpen ) continue;
if ( otherWell->simWellData()->wellResultFrame( frameIndex )->m_productionType ==
RiaDefines::WellProductionType::UNDEFINED_PRODUCTION_TYPE )
continue;
bool isOtherProducer = ( otherWell->simWellData()->wellResultFrame( frameIndex ).m_productionType ==
bool isOtherProducer = ( otherWell->simWellData()->wellResultFrame( frameIndex )->m_productionType ==
RiaDefines::WellProductionType::PRODUCER );
{

View File

@@ -24,6 +24,7 @@
#include "RigActiveCellInfo.h"
#include "RigCell.h"
#include "RigSimWellData.h"
#include "RigWellResultPoint.h"
#include "RimEclipseCase.h"
#include "RimEclipseView.h"
@@ -98,7 +99,7 @@ void RivWellDiskPartMgr::buildWellDiskParts( size_t frameIndex, const caf::Displ
if ( !well->simWellData()->hasWellResult( frameIndex ) ) return;
auto productionType = well->simWellData()->wellResultFrame( frameIndex ).m_productionType;
auto productionType = well->simWellData()->wellResultFrame( frameIndex )->m_productionType;
double pipeRadius = m_rimWell->pipeRadius();
unsigned int numSectors = 100;

View File

@@ -27,6 +27,7 @@
#include "RigEclipseCaseData.h"
#include "RigMainGrid.h"
#include "RigSimWellData.h"
#include "RigWellResultPoint.h"
#include "RimEclipseCase.h"
#include "RimEclipseView.h"
@@ -107,12 +108,12 @@ void RivWellHeadPartMgr::buildWellHeadParts( size_t f
if ( !well->simWellData()->hasWellResult( frameIndex ) ) return;
const RigWellResultFrame& wellResultFrame = well->simWellData()->wellResultFrame( frameIndex );
const RigWellResultFrame* wellResultFrame = well->simWellData()->wellResultFrame( frameIndex );
double pipeRadius = m_rimWell->pipeRadius();
int pipeCrossSectionVxCount = m_rimWell->pipeCrossSectionVertexCount();
if ( wellResultFrame.m_isOpen )
if ( wellResultFrame->m_isOpen )
{
// Use slightly larger well head arrow when well is open
pipeRadius *= 1.1;
@@ -181,7 +182,7 @@ void RivWellHeadPartMgr::buildWellHeadParts( size_t f
double arrowLength =
characteristicCellSize * simWellInViewCollection()->wellHeadScaleFactor() * m_rimWell->wellHeadScaleFactor();
if ( wellResultFrame.m_isOpen )
if ( wellResultFrame->m_isOpen )
{
// Use slightly larger well head arrow when well is open
arrowLength = 1.1 * arrowLength;
@@ -191,13 +192,13 @@ void RivWellHeadPartMgr::buildWellHeadParts( size_t f
textPosition.z() += 1.2 * arrowLength;
cvf::Mat4f matr;
if ( wellResultFrame.m_productionType != RiaDefines::WellProductionType::PRODUCER )
if ( wellResultFrame->m_productionType != RiaDefines::WellProductionType::PRODUCER )
{
matr = cvf::Mat4f::fromRotation( cvf::Vec3f( 1.0f, 0.0f, 0.0f ), cvf::Math::toRadians( 180.0f ) );
}
double ijScaleFactor = arrowLength / 6;
if ( wellResultFrame.m_isOpen )
if ( wellResultFrame->m_isOpen )
{
ijScaleFactor *= 1.1;
}
@@ -205,7 +206,7 @@ void RivWellHeadPartMgr::buildWellHeadParts( size_t f
matr( 1, 1 ) *= ijScaleFactor;
matr( 2, 2 ) *= arrowLength;
if ( wellResultFrame.m_productionType != RiaDefines::WellProductionType::PRODUCER )
if ( wellResultFrame->m_productionType != RiaDefines::WellProductionType::PRODUCER )
{
arrowPosition.z() += arrowLength;
}
@@ -251,21 +252,21 @@ void RivWellHeadPartMgr::buildWellHeadParts( size_t f
if ( wellColl && wellColl->showConnectionStatusColors() )
{
if ( wellResultFrame.m_isOpen )
if ( wellResultFrame->m_isOpen )
{
if ( wellResultFrame.m_productionType == RiaDefines::WellProductionType::PRODUCER )
if ( wellResultFrame->m_productionType == RiaDefines::WellProductionType::PRODUCER )
{
headColor = cvf::Color4f( cvf::Color3::GREEN );
}
else if ( wellResultFrame.m_productionType == RiaDefines::WellProductionType::OIL_INJECTOR )
else if ( wellResultFrame->m_productionType == RiaDefines::WellProductionType::OIL_INJECTOR )
{
headColor = cvf::Color4f( cvf::Color3::ORANGE );
}
else if ( wellResultFrame.m_productionType == RiaDefines::WellProductionType::GAS_INJECTOR )
else if ( wellResultFrame->m_productionType == RiaDefines::WellProductionType::GAS_INJECTOR )
{
headColor = cvf::Color4f( cvf::Color3::RED );
}
else if ( wellResultFrame.m_productionType == RiaDefines::WellProductionType::WATER_INJECTOR )
else if ( wellResultFrame->m_productionType == RiaDefines::WellProductionType::WATER_INJECTOR )
{
headColor = cvf::Color4f( cvf::Color3::BLUE );
}

View File

@@ -22,6 +22,7 @@
#include "RigMainGrid.h"
#include "RigSimWellData.h"
#include "RigWellResultPoint.h"
#include "RimEclipseCase.h"
#include "RimEclipseView.h"
@@ -79,11 +80,11 @@ void RivWellSpheresPartMgr::appendDynamicGeometryPartsToModel( cvf::ModelBasicLi
if ( !rigWellResult->hasWellResult( frameIndex ) ) return;
const RigWellResultFrame& wellResultFrame = rigWellResult->wellResultFrame( frameIndex );
const RigWellResultFrame* wellResultFrame = rigWellResult->wellResultFrame( frameIndex );
std::vector<std::pair<cvf::Vec3f, cvf::Color3f>> centerColorPairs;
for ( const RigWellResultBranch& wellResultBranch : wellResultFrame.m_wellResultBranches )
for ( const RigWellResultBranch& wellResultBranch : wellResultFrame->m_wellResultBranches )
{
for ( const RigWellResultPoint& wellResultPoint : wellResultBranch.m_branchResultPoints )
{
@@ -108,7 +109,7 @@ void RivWellSpheresPartMgr::appendDynamicGeometryPartsToModel( cvf::ModelBasicLi
}
}
cvf::ref<cvf::Part> part = createPart( centerColorPairs, wellResultFrame.m_isOpen );
cvf::ref<cvf::Part> part = createPart( centerColorPairs, wellResultFrame->m_isOpen );
model->addPart( part.p() );
}
@@ -190,7 +191,7 @@ cvf::ref<cvf::Part> RivWellSpheresPartMgr::createPart( std::vector<std::pair<cvf
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::Color3f RivWellSpheresPartMgr::wellCellColor( const RigWellResultFrame& wellResultFrame,
cvf::Color3f RivWellSpheresPartMgr::wellCellColor( const RigWellResultFrame* wellResultFrame,
const RigWellResultPoint& wellResultPoint )
{
// Colours should be synchronized with RivWellPipesPartMgr::updatePipeResultColor
@@ -207,7 +208,7 @@ cvf::Color3f RivWellSpheresPartMgr::wellCellColor( const RigWellResultFrame& wel
{
if ( wellResultPoint.m_isOpen )
{
switch ( wellResultFrame.m_productionType )
switch ( wellResultFrame->m_productionType )
{
case RiaDefines::WellProductionType::PRODUCER:
cellColor = cvf::Color3f::GREEN;

View File

@@ -54,7 +54,7 @@ public:
void appendDynamicGeometryPartsToModel( cvf::ModelBasicList* model, size_t frameIndex );
private:
cvf::Color3f wellCellColor( const RigWellResultFrame& wellResultFrame, const RigWellResultPoint& wellResultPoint );
cvf::Color3f wellCellColor( const RigWellResultFrame* wellResultFrame, const RigWellResultPoint& wellResultPoint );
cvf::ref<cvf::Part> createPart( std::vector<std::pair<cvf::Vec3f, cvf::Color3f>>& centerColorPairs, bool isWellOpen );
private: