Janitor : Use enum class

This commit is contained in:
Magne Sjaastad
2021-05-26 10:56:21 +02:00
parent 19d650f619
commit 3fca5f15ae
18 changed files with 100 additions and 90 deletions

View File

@@ -435,19 +435,19 @@ void RivSimWellPipesPartMgr::updatePipeResultColor( size_t frameIndex )
{
switch ( wResFrame.m_productionType )
{
case RigWellResultFrame::PRODUCER:
case RiaDefines::WellProductionType::PRODUCER:
cellState = producerState;
break;
case RigWellResultFrame::OIL_INJECTOR:
case RiaDefines::WellProductionType::OIL_INJECTOR:
cellState = hcInjectorState;
break;
case RigWellResultFrame::GAS_INJECTOR:
case RiaDefines::WellProductionType::GAS_INJECTOR:
cellState = hcInjectorState;
break;
case RigWellResultFrame::WATER_INJECTOR:
case RiaDefines::WellProductionType::WATER_INJECTOR:
cellState = waterInjectorState;
break;
case RigWellResultFrame::UNDEFINED_PRODUCTION_TYPE:
case RiaDefines::WellProductionType::UNDEFINED_PRODUCTION_TYPE:
cellState = defaultState;
break;
}

View File

@@ -64,11 +64,11 @@ void RivWellConnectionsPartMgr::appendDynamicGeometryPartsToModel( cvf::ModelBas
if ( !m_rimWell->simWellData()->hasWellResult( frameIndex ) ) return;
if ( !m_rimWell->simWellData()->wellResultFrame( frameIndex ).m_isOpen ) return;
if ( m_rimWell->simWellData()->wellResultFrame( frameIndex ).m_productionType ==
RigWellResultFrame::UNDEFINED_PRODUCTION_TYPE )
RiaDefines::WellProductionType::UNDEFINED_PRODUCTION_TYPE )
return;
bool isProducer =
( m_rimWell->simWellData()->wellResultFrame( frameIndex ).m_productionType == RigWellResultFrame::PRODUCER );
bool isProducer = ( m_rimWell->simWellData()->wellResultFrame( frameIndex ).m_productionType ==
RiaDefines::WellProductionType::PRODUCER );
double pipeRadius = m_rimWell->pipeRadius();
cvf::Vec3d wellHeadTop;
@@ -133,11 +133,11 @@ void RivWellConnectionsPartMgr::appendDynamicGeometryPartsToModel( cvf::ModelBas
if ( !otherWell->simWellData()->hasWellResult( frameIndex ) ) continue;
if ( !otherWell->simWellData()->wellResultFrame( frameIndex ).m_isOpen ) continue;
if ( otherWell->simWellData()->wellResultFrame( frameIndex ).m_productionType ==
RigWellResultFrame::UNDEFINED_PRODUCTION_TYPE )
RiaDefines::WellProductionType::UNDEFINED_PRODUCTION_TYPE )
continue;
bool isOtherProducer =
( otherWell->simWellData()->wellResultFrame( frameIndex ).m_productionType == RigWellResultFrame::PRODUCER );
bool isOtherProducer = ( otherWell->simWellData()->wellResultFrame( frameIndex ).m_productionType ==
RiaDefines::WellProductionType::PRODUCER );
{
std::string otherWellName = otherWell->name().toStdString();

View File

@@ -315,8 +315,9 @@ void RivWellDiskPartMgr::buildWellDiskParts( size_t frameIndex, const caf::Displ
}
// Add visual indicator for well type injector
if ( productionType == RigWellResultFrame::OIL_INJECTOR || productionType == RigWellResultFrame::GAS_INJECTOR ||
productionType == RigWellResultFrame::WATER_INJECTOR )
if ( productionType == RiaDefines::WellProductionType::OIL_INJECTOR ||
productionType == RiaDefines::WellProductionType::GAS_INJECTOR ||
productionType == RiaDefines::WellProductionType::WATER_INJECTOR )
{
cvf::GeometryBuilderFaceList builder;
cvf::Vec3f pos( 0.0, 0.0, 0.0 );
@@ -514,17 +515,17 @@ RimSimWellInViewCollection* RivWellDiskPartMgr::simWellInViewCollection()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::Color4f RivWellDiskPartMgr::getWellInjectionColor( RigWellResultFrame::WellProductionType productionType )
cvf::Color4f RivWellDiskPartMgr::getWellInjectionColor( RiaDefines::WellProductionType productionType )
{
if ( productionType == RigWellResultFrame::OIL_INJECTOR )
if ( productionType == RiaDefines::WellProductionType::OIL_INJECTOR )
{
return cvf::Color4f( cvf::Color3::ORANGE );
}
else if ( productionType == RigWellResultFrame::GAS_INJECTOR )
else if ( productionType == RiaDefines::WellProductionType::GAS_INJECTOR )
{
return cvf::Color4f( cvf::Color3::RED );
}
else if ( productionType == RigWellResultFrame::WATER_INJECTOR )
else if ( productionType == RiaDefines::WellProductionType::WATER_INJECTOR )
{
return cvf::Color4f( cvf::Color3::BLUE );
}

View File

@@ -18,12 +18,11 @@
#pragma once
#include "RigWellResultPoint.h"
#include "cafPdmPointer.h"
#include "cvfObject.h"
#include "cvfString.h"
#include "cvfVector3.h"
namespace cvf
{
@@ -39,9 +38,15 @@ namespace caf
class DisplayCoordTransform;
}
namespace RiaDefines
{
enum class WellProductionType : short;
}
class Rim3dView;
class RimSimWellInView;
class RimSimWellInViewCollection;
class RigWellResultFrame;
class RivWellDiskPartMgr : public cvf::Object
{
@@ -65,7 +70,7 @@ private:
Rim3dView* viewWithSettings();
RimSimWellInViewCollection* simWellInViewCollection();
static cvf::Color4f getWellInjectionColor( RigWellResultFrame::WellProductionType productionType );
static cvf::Color4f getWellInjectionColor( RiaDefines::WellProductionType productionType );
static QString formatNumber( double num );
static double baseScaleFactor();

View File

@@ -191,7 +191,7 @@ void RivWellHeadPartMgr::buildWellHeadParts( size_t f
textPosition.z() += 1.2 * arrowLength;
cvf::Mat4f matr;
if ( wellResultFrame.m_productionType != RigWellResultFrame::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 ) );
}
@@ -205,7 +205,7 @@ void RivWellHeadPartMgr::buildWellHeadParts( size_t f
matr( 1, 1 ) *= ijScaleFactor;
matr( 2, 2 ) *= arrowLength;
if ( wellResultFrame.m_productionType != RigWellResultFrame::PRODUCER )
if ( wellResultFrame.m_productionType != RiaDefines::WellProductionType::PRODUCER )
{
arrowPosition.z() += arrowLength;
}
@@ -253,19 +253,19 @@ void RivWellHeadPartMgr::buildWellHeadParts( size_t f
{
if ( wellResultFrame.m_isOpen )
{
if ( wellResultFrame.m_productionType == RigWellResultFrame::PRODUCER )
if ( wellResultFrame.m_productionType == RiaDefines::WellProductionType::PRODUCER )
{
headColor = cvf::Color4f( cvf::Color3::GREEN );
}
else if ( wellResultFrame.m_productionType == RigWellResultFrame::OIL_INJECTOR )
else if ( wellResultFrame.m_productionType == RiaDefines::WellProductionType::OIL_INJECTOR )
{
headColor = cvf::Color4f( cvf::Color3::ORANGE );
}
else if ( wellResultFrame.m_productionType == RigWellResultFrame::GAS_INJECTOR )
else if ( wellResultFrame.m_productionType == RiaDefines::WellProductionType::GAS_INJECTOR )
{
headColor = cvf::Color4f( cvf::Color3::RED );
}
else if ( wellResultFrame.m_productionType == RigWellResultFrame::WATER_INJECTOR )
else if ( wellResultFrame.m_productionType == RiaDefines::WellProductionType::WATER_INJECTOR )
{
headColor = cvf::Color4f( cvf::Color3::BLUE );
}

View File

@@ -209,16 +209,16 @@ cvf::Color3f RivWellSpheresPartMgr::wellCellColor( const RigWellResultFrame& wel
{
switch ( wellResultFrame.m_productionType )
{
case RigWellResultFrame::PRODUCER:
case RiaDefines::WellProductionType::PRODUCER:
cellColor = cvf::Color3f::GREEN;
break;
case RigWellResultFrame::OIL_INJECTOR:
case RiaDefines::WellProductionType::OIL_INJECTOR:
cellColor = cvf::Color3f::RED;
break;
case RigWellResultFrame::GAS_INJECTOR:
case RiaDefines::WellProductionType::GAS_INJECTOR:
cellColor = cvf::Color3f::RED;
break;
case RigWellResultFrame::WATER_INJECTOR:
case RiaDefines::WellProductionType::WATER_INJECTOR:
cellColor = cvf::Color3f::BLUE;
break;
}