Merge pull request #4975 from OPM/janitor-issues-2

Janitor issues (2)
This commit is contained in:
Magne Sjaastad 2019-11-03 14:47:13 +01:00 committed by GitHub
commit ee3f6a5a43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
55 changed files with 286 additions and 289 deletions

View File

@ -31,6 +31,8 @@ class RiaFeatureCommandContext
public:
static RiaFeatureCommandContext* instance();
RiaFeatureCommandContext( const RiaFeatureCommandContext& ) = delete;
QObject* object() const;
void setObject( QObject* object );

View File

@ -53,7 +53,9 @@ void RiaImageFileCompare::reset()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RiaImageFileCompare::runComparison( QString imgFileName, QString refFileName, QString diffFileName )
bool RiaImageFileCompare::runComparison( const QString& imgFileName,
const QString& refFileName,
const QString& diffFileName )
{
reset();

View File

@ -39,7 +39,7 @@ public:
explicit RiaImageFileCompare( QString compareExecutable );
~RiaImageFileCompare();
bool runComparison( QString imgFileName, QString refFileName, QString diffFileName );
bool runComparison( const QString& imgFileName, const QString& refFileName, const QString& diffFileName );
bool imagesEqual() const;
ErrorType error() const;
QString errorMessage() const;

View File

@ -39,7 +39,7 @@ RiaProjectModifier::RiaProjectModifier() {}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaProjectModifier::setReplaceCaseFirstOccurrence( QString newGridFileName )
void RiaProjectModifier::setReplaceCaseFirstOccurrence( const QString& newGridFileName )
{
m_caseIdToGridFileNameMap[RiaProjectModifier::firstOccurrenceId()] = makeFilePathAbsolute( newGridFileName );
}
@ -47,7 +47,7 @@ void RiaProjectModifier::setReplaceCaseFirstOccurrence( QString newGridFileName
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaProjectModifier::setReplaceCase( int caseIdToReplace, QString newGridFileName )
void RiaProjectModifier::setReplaceCase( int caseIdToReplace, const QString& newGridFileName )
{
if ( caseIdToReplace >= 0 )
{
@ -58,7 +58,7 @@ void RiaProjectModifier::setReplaceCase( int caseIdToReplace, QString newGridFil
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaProjectModifier::setReplaceSourceCasesFirstOccurrence( std::vector<QString> newGridFileNames )
void RiaProjectModifier::setReplaceSourceCasesFirstOccurrence( const std::vector<QString>& newGridFileNames )
{
m_groupIdToGridFileNamesMap[RiaProjectModifier::firstOccurrenceId()] = newGridFileNames;
}
@ -66,7 +66,8 @@ void RiaProjectModifier::setReplaceSourceCasesFirstOccurrence( std::vector<QStri
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaProjectModifier::setReplaceSourceCasesById( int caseGroupIdToReplace, std::vector<QString> newGridFileNames )
void RiaProjectModifier::setReplaceSourceCasesById( int caseGroupIdToReplace,
const std::vector<QString>& newGridFileNames )
{
if ( caseGroupIdToReplace >= 0 )
{
@ -237,7 +238,7 @@ void RiaProjectModifier::replacePropertiesFolder( RimProject* project )
/// If \a relOrAbsolutePath is a relative, the current working directory for the process will be
/// used in order to make the path absolute.
//--------------------------------------------------------------------------------------------------
QString RiaProjectModifier::makeFilePathAbsolute( QString relOrAbsolutePath )
QString RiaProjectModifier::makeFilePathAbsolute( const QString& relOrAbsolutePath )
{
QFileInfo theFile( relOrAbsolutePath );
theFile.makeAbsolute();
@ -247,7 +248,7 @@ QString RiaProjectModifier::makeFilePathAbsolute( QString relOrAbsolutePath )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RiaProjectModifier::caseNameFromGridFileName( QString fullGridFilePathName )
QString RiaProjectModifier::caseNameFromGridFileName( const QString& fullGridFilePathName )
{
QString fn = QDir::fromNativeSeparators( fullGridFilePathName );

View File

@ -38,11 +38,11 @@ class RiaProjectModifier : public cvf::Object
public:
RiaProjectModifier();
void setReplaceCaseFirstOccurrence( QString newGridFileName );
void setReplaceCase( int caseIdToReplace, QString newGridFileName );
void setReplaceCaseFirstOccurrence( const QString& newGridFileName );
void setReplaceCase( int caseIdToReplace, const QString& newGridFileName );
void setReplaceSourceCasesFirstOccurrence( std::vector<QString> newGridFileNames );
void setReplaceSourceCasesById( int caseGroupIdToReplace, std::vector<QString> newGridFileNames );
void setReplaceSourceCasesFirstOccurrence( const std::vector<QString>& newGridFileNames );
void setReplaceSourceCasesById( int caseGroupIdToReplace, const std::vector<QString>& newGridFileNames );
void setReplacePropertiesFolderFirstOccurrence( QString newPropertiesFolder );
void setReplacePropertiesFolder( int caseIdToReplace, QString newPropertiesFolder );
@ -54,8 +54,8 @@ private:
void replaceCase( RimProject* project );
void replacePropertiesFolder( RimProject* project );
static QString makeFilePathAbsolute( QString relOrAbsolutePath );
static QString caseNameFromGridFileName( QString fullGridFilePathName );
static QString makeFilePathAbsolute( const QString& relOrAbsolutePath );
static QString caseNameFromGridFileName( const QString& fullGridFilePathName );
static int firstCaseId( RimProject* project );
static int firstGroupId( RimProject* project );

View File

@ -110,7 +110,7 @@ void RicfCommandFileExecutor::executeCommands( QTextStream& stream )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicfCommandFileExecutor::setExportPath( ExportType type, QString path )
void RicfCommandFileExecutor::setExportPath( ExportType type, const QString& path )
{
m_exportPaths[type] = path;
}

View File

@ -53,7 +53,7 @@ public:
~RicfCommandFileExecutor();
void executeCommands( QTextStream& stream );
void setExportPath( ExportType type, QString path );
void setExportPath( ExportType type, const QString& path );
QString getExportPath( ExportType type ) const;
void setLastProjectPath( const QString& path );
QString getLastProjectPath() const;

View File

@ -47,7 +47,7 @@
struct WellBorePartForTransCalc
{
WellBorePartForTransCalc(
cvf::Vec3d lengthsInCell, double wellRadius, double skinFactor, bool isMainBore, QString metaData )
cvf::Vec3d lengthsInCell, double wellRadius, double skinFactor, bool isMainBore, const QString& metaData )
: lengthsInCell( lengthsInCell )
, wellRadius( wellRadius )
, skinFactor( skinFactor )

View File

@ -335,13 +335,15 @@ void RicWellPathExportMswCompletionsImpl::generateWelsegsTable( RifTextDataTable
}
{
generateWelsegsSegments( formatter, exportInfo, {RigCompletionData::FISHBONES_ICD, RigCompletionData::FISHBONES} );
generateWelsegsSegments( formatter, exportInfo, {RigCompletionData::FRACTURE} );
generateWelsegsSegments( formatter,
exportInfo,
{RigCompletionData::PERFORATION_ICD,
RigCompletionData::PERFORATION_ICV,
RigCompletionData::PERFORATION_AICD} );
{ RigCompletionData::FISHBONES_ICD, RigCompletionData::FISHBONES } );
generateWelsegsSegments( formatter, exportInfo, { RigCompletionData::FRACTURE } );
generateWelsegsSegments( formatter,
exportInfo,
{ RigCompletionData::PERFORATION_ICD,
RigCompletionData::PERFORATION_ICV,
RigCompletionData::PERFORATION_AICD } );
}
formatter.tableCompleted();
@ -474,8 +476,8 @@ void RicWellPathExportMswCompletionsImpl::generateCompsegTables( RifTextDataTabl
*/
{
std::set<RigCompletionData::CompletionType> fishbonesTypes = {RigCompletionData::FISHBONES_ICD,
RigCompletionData::FISHBONES};
std::set<RigCompletionData::CompletionType> fishbonesTypes = { RigCompletionData::FISHBONES_ICD,
RigCompletionData::FISHBONES };
generateCompsegTable( formatter, exportInfo, false, fishbonesTypes );
if ( exportInfo.hasSubGridIntersections() )
{
@ -484,7 +486,7 @@ void RicWellPathExportMswCompletionsImpl::generateCompsegTables( RifTextDataTabl
}
{
std::set<RigCompletionData::CompletionType> fractureTypes = {RigCompletionData::FRACTURE};
std::set<RigCompletionData::CompletionType> fractureTypes = { RigCompletionData::FRACTURE };
generateCompsegTable( formatter, exportInfo, false, fractureTypes );
if ( exportInfo.hasSubGridIntersections() )
{
@ -493,10 +495,10 @@ void RicWellPathExportMswCompletionsImpl::generateCompsegTables( RifTextDataTabl
}
{
std::set<RigCompletionData::CompletionType> perforationTypes = {RigCompletionData::PERFORATION,
RigCompletionData::PERFORATION_ICD,
RigCompletionData::PERFORATION_ICV,
RigCompletionData::PERFORATION_AICD};
std::set<RigCompletionData::CompletionType> perforationTypes = { RigCompletionData::PERFORATION,
RigCompletionData::PERFORATION_ICD,
RigCompletionData::PERFORATION_ICV,
RigCompletionData::PERFORATION_AICD };
generateCompsegTable( formatter, exportInfo, false, perforationTypes );
if ( exportInfo.hasSubGridIntersections() )
{
@ -600,7 +602,7 @@ void RicWellPathExportMswCompletionsImpl::generateCompsegHeader( RifTextDataTabl
}
{
std::vector<RifTextDataTableColumn> header = {RifTextDataTableColumn( "Name" )};
std::vector<RifTextDataTableColumn> header = { RifTextDataTableColumn( "Name" ) };
formatter.header( header );
formatter.add( exportInfo.wellPath()->completions()->wellNameForExport() );
formatter.rowCompleted();
@ -613,15 +615,15 @@ void RicWellPathExportMswCompletionsImpl::generateCompsegHeader( RifTextDataTabl
allHeaders.push_back( RifTextDataTableColumn( "Grid" ) );
}
std::vector<RifTextDataTableColumn> commonHeaders = {RifTextDataTableColumn( "I" ),
RifTextDataTableColumn( "J" ),
RifTextDataTableColumn( "K" ),
RifTextDataTableColumn( "Branch no" ),
RifTextDataTableColumn( "Start Length" ),
RifTextDataTableColumn( "End Length" ),
RifTextDataTableColumn( "Dir Pen" ),
RifTextDataTableColumn( "End Range" ),
RifTextDataTableColumn( "Connection Depth" )};
std::vector<RifTextDataTableColumn> commonHeaders = { RifTextDataTableColumn( "I" ),
RifTextDataTableColumn( "J" ),
RifTextDataTableColumn( "K" ),
RifTextDataTableColumn( "Branch no" ),
RifTextDataTableColumn( "Start Length" ),
RifTextDataTableColumn( "End Length" ),
RifTextDataTableColumn( "Dir Pen" ),
RifTextDataTableColumn( "End Range" ),
RifTextDataTableColumn( "Connection Depth" ) };
allHeaders.insert( allHeaders.end(), commonHeaders.begin(), commonHeaders.end() );
formatter.header( allHeaders );
}
@ -709,27 +711,27 @@ void RicWellPathExportMswCompletionsImpl::generateWsegAicdTable( RifTextDataTabl
if ( !foundValve )
{
std::vector<QString> columnDescriptions =
{"Well Name",
"Segment Number",
"Segment Number",
"Strength of AICD",
"Length of AICD",
"Density of Calibration Fluid",
"Viscosity of Calibration Fluid",
"Critical water in liquid fraction for emulsions viscosity model",
"Emulsion viscosity transition region",
"Max ratio of emulsion viscosity to continuous phase viscosity",
"Flow scaling factor method",
"Maximum flowrate for AICD device",
"Volume flow rate exponent, x",
"Viscosity function exponent, y",
"Device OPEN/SHUT",
"Exponent of the oil flowing fraction in the density mixture calculation",
"Exponent of the water flowing fraction in the density mixture calculation",
"Exponent of the gas flowing fraction in the density mixture calculation",
"Exponent of the oil flowing fraction in the density viscosity calculation",
"Exponent of the water flowing fraction in the density viscosity calculation",
"Exponent of the gas flowing fraction in the density viscosity calculation"};
{ "Well Name",
"Segment Number",
"Segment Number",
"Strength of AICD",
"Length of AICD",
"Density of Calibration Fluid",
"Viscosity of Calibration Fluid",
"Critical water in liquid fraction for emulsions viscosity model",
"Emulsion viscosity transition region",
"Max ratio of emulsion viscosity to continuous phase viscosity",
"Flow scaling factor method",
"Maximum flowrate for AICD device",
"Volume flow rate exponent, x",
"Viscosity function exponent, y",
"Device OPEN/SHUT",
"Exponent of the oil flowing fraction in the density mixture calculation",
"Exponent of the water flowing fraction in the density mixture calculation",
"Exponent of the gas flowing fraction in the density mixture calculation",
"Exponent of the oil flowing fraction in the density viscosity calculation",
"Exponent of the water flowing fraction in the density viscosity calculation",
"Exponent of the gas flowing fraction in the density viscosity calculation" };
tighterFormatter.keyword( "WSEGAICD" );
tighterFormatter.comment( "Column Overview:" );
@ -1009,7 +1011,7 @@ RicMswExportInfo RicWellPathExportMswCompletionsImpl::generateFracturesMswExport
RicExportFractureCompletionsImpl::generateCompdatValues( caseToApply,
wellPath->completions()->wellNameForExport(),
wellPath->wellPathGeometry(),
{fracture},
{ fracture },
nullptr,
nullptr );
@ -1745,10 +1747,7 @@ void RicWellPathExportMswCompletionsImpl::assignBranchAndSegmentNumbers( const R
if ( completion->completionType() == RigCompletionData::FISHBONES_ICD )
{
++segmentNumber; // Skip a segment number because we need one for the ICD
if ( completion->completionType() == RigCompletionData::FISHBONES_ICD )
{
completion->setBranchNumber( ++branchNumber );
}
completion->setBranchNumber( ++branchNumber );
}
}
}

View File

@ -125,13 +125,13 @@ void RicWellPathFractureReportItem::setUnitSystem( RiaEclipseUnitTools::UnitSyst
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicWellPathFractureReportItem::setPressureDepletionParameters( bool performPDDScaling,
QString timeStepString,
QString wbhpString,
double userWBHP,
double actualWBHP,
double minPressureDrop,
double maxPressureDrop )
void RicWellPathFractureReportItem::setPressureDepletionParameters( bool performPDDScaling,
const QString& timeStepString,
const QString& wbhpString,
double userWBHP,
double actualWBHP,
double minPressureDrop,
double maxPressureDrop )
{
m_performPressureDepletionScaling = performPDDScaling;
m_pressureDepletionTimeStepString = timeStepString;

View File

@ -38,13 +38,13 @@ public:
void setHeightAndHalfLength( double height, double halfLength );
void setAreaWeightedPermeability( double permeability );
void setUnitSystem( RiaEclipseUnitTools::UnitSystem unitSystem );
void setPressureDepletionParameters( bool performPressureDepletionScaling,
QString timeStepString,
QString wbhpString,
double userWBHP,
double actualWBHP,
double minPressureDrop,
double maxPressureDrop );
void setPressureDepletionParameters( bool performPressureDepletionScaling,
const QString& timeStepString,
const QString& wbhpString,
double userWBHP,
double actualWBHP,
double minPressureDrop,
double maxPressureDrop );
QString wellPathNameForExport() const;
QString fractureName() const;

View File

@ -72,10 +72,7 @@ void RicAddEclipseInputPropertyFeature::onActionTriggered( bool isChecked )
defaultDir = QFileInfo( fileNames.last() ).absolutePath();
app->setLastUsedDialogDirectory( "INPUT_FILES", defaultDir );
if ( inputPropertyCollection )
{
addEclipseInputProperty( fileNames, inputPropertyCollection );
}
addEclipseInputProperty( fileNames, inputPropertyCollection );
}
//--------------------------------------------------------------------------------------------------

View File

@ -136,8 +136,8 @@ class IjkBoundingBox
public:
IjkBoundingBox()
: m_min( {MAX_SIZE_T, MAX_SIZE_T, MAX_SIZE_T} )
, m_max( {MAX_SIZE_T, MAX_SIZE_T, MAX_SIZE_T} )
: m_min( { MAX_SIZE_T, MAX_SIZE_T, MAX_SIZE_T } )
, m_max( { MAX_SIZE_T, MAX_SIZE_T, MAX_SIZE_T } )
{
}
@ -172,7 +172,7 @@ public:
{
if ( !isValid() )
{
m_min = m_max = {i, j, k};
m_min = m_max = { i, j, k };
}
else
{
@ -370,16 +370,16 @@ void RicExportLgrFeature::writeLgrs( QTextStream& stream, const std::vector<LgrI
RifTextDataTableFormatter formatter( stream );
formatter.comment( QString( "LGR: " ) + lgrInfo.name );
formatter.keyword( "CARFIN" );
formatter.header( {RifTextDataTableColumn( "Name" ),
RifTextDataTableColumn( "I1" ),
RifTextDataTableColumn( "I2" ),
RifTextDataTableColumn( "J1" ),
RifTextDataTableColumn( "J2" ),
RifTextDataTableColumn( "K1" ),
RifTextDataTableColumn( "K2" ),
RifTextDataTableColumn( "NX" ),
RifTextDataTableColumn( "NY" ),
RifTextDataTableColumn( "NZ" )} );
formatter.header( { RifTextDataTableColumn( "Name" ),
RifTextDataTableColumn( "I1" ),
RifTextDataTableColumn( "I2" ),
RifTextDataTableColumn( "J1" ),
RifTextDataTableColumn( "J2" ),
RifTextDataTableColumn( "K1" ),
RifTextDataTableColumn( "K2" ),
RifTextDataTableColumn( "NX" ),
RifTextDataTableColumn( "NY" ),
RifTextDataTableColumn( "NZ" ) } );
formatter.add( lgrInfo.name );
formatter.addOneBasedCellIndex( lgrInfo.mainGridStartCell.i() );
@ -553,7 +553,7 @@ std::vector<LgrInfo>
for ( const auto& intersectionCell : intersectingCells )
{
auto lgrName = lgrNameFactory.newName( "", lgrId );
lgrs.push_back( buildLgr( lgrId++, lgrName, eclipseCase, wellPath->name(), {intersectionCell}, lgrSizes ) );
lgrs.push_back( buildLgr( lgrId++, lgrName, eclipseCase, wellPath->name(), { intersectionCell }, lgrSizes ) );
}
return lgrs;
}
@ -724,7 +724,7 @@ std::vector<RigCompletionDataGridCell>
std::map<CompletionInfo, std::vector<RigCompletionDataGridCell>>
RicExportLgrFeature::cellsIntersectingCompletions_PerCompletion(
RimEclipseCase* eclipseCase,
const std::vector<RimWellPath*> wellPaths,
const std::vector<RimWellPath*>& wellPaths,
size_t timeStep,
const std::set<RigCompletionData::CompletionType>& completionTypes,
QStringList* wellsIntersectingOtherLgrs )
@ -944,9 +944,9 @@ const RigGridBase* RicExportLgrFeature::hostGrid( const RigMainGrid* mainGrid, s
//--------------------------------------------------------------------------------------------------
LgrNameFactory::LgrNameFactory()
{
m_counters = {{RigCompletionData::FRACTURE, {"FRAC", 1}},
{RigCompletionData::FISHBONES, {"FB", 1}},
{RigCompletionData::PERFORATION, {"PERF", 1}}};
m_counters = { { RigCompletionData::FRACTURE, { "FRAC", 1 } },
{ RigCompletionData::FISHBONES, { "FB", 1 } },
{ RigCompletionData::PERFORATION, { "PERF", 1 } } };
}
//--------------------------------------------------------------------------------------------------

View File

@ -232,7 +232,7 @@ private:
static std::map<CompletionInfo, std::vector<RigCompletionDataGridCell>>
cellsIntersectingCompletions_PerCompletion( RimEclipseCase* eclipseCase,
const std::vector<RimWellPath*> wellPaths,
const std::vector<RimWellPath*>& wellPaths,
size_t timeStep,
const std::set<RigCompletionData::CompletionType>& completionTypes,
QStringList* wellsIntersectingOtherLgrs );

View File

@ -49,10 +49,7 @@ CAF_CMD_SOURCE_INIT( RicConvertAllFractureTemplatesToFieldFeature, "RicConvertAl
//--------------------------------------------------------------------------------------------------
void RicConvertAllFractureTemplatesToFieldFeature::onActionTriggered( bool isChecked )
{
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
if ( !pdmUiItem ) return;
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>( pdmUiItem );
auto objHandle = caf::SelectionManager::instance()->selectedItemOfType<caf::PdmObjectHandle>();
if ( !objHandle ) return;
RimFractureTemplateCollection* fracTempColl = nullptr;

View File

@ -49,14 +49,12 @@ CAF_CMD_SOURCE_INIT( RicConvertAllFractureTemplatesToMetricFeature, "RicConvertA
//--------------------------------------------------------------------------------------------------
void RicConvertAllFractureTemplatesToMetricFeature::onActionTriggered( bool isChecked )
{
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
if ( !pdmUiItem ) return;
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>( pdmUiItem );
auto objHandle = caf::SelectionManager::instance()->selectedItemOfType<caf::PdmObjectHandle>();
if ( !objHandle ) return;
RimFractureTemplateCollection* fracTempColl = nullptr;
objHandle->firstAncestorOrThisOfType( fracTempColl );
if ( !fracTempColl ) return;
std::vector<RimEllipseFractureTemplate*> ellipseFracTemplates;
fracTempColl->descendantsIncludingThisOfType( ellipseFracTemplates );

View File

@ -51,15 +51,11 @@ CAF_CMD_SOURCE_INIT( RicCreateDuplicateTemplateInOtherUnitSystemFeature, "RicCon
//--------------------------------------------------------------------------------------------------
void RicCreateDuplicateTemplateInOtherUnitSystemFeature::onActionTriggered( bool isChecked )
{
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
if ( !pdmUiItem ) return;
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>( pdmUiItem );
auto objHandle = caf::SelectionManager::instance()->selectedItemOfType<caf::PdmObjectHandle>();
if ( !objHandle ) return;
RimFractureTemplate* fractureTemplate = nullptr;
objHandle->firstAncestorOrThisOfType( fractureTemplate );
if ( !fractureTemplate ) return;
RimFractureTemplateCollection* fractureTemplateCollection = nullptr;
@ -95,10 +91,7 @@ void RicCreateDuplicateTemplateInOtherUnitSystemFeature::onActionTriggered( bool
//--------------------------------------------------------------------------------------------------
void RicCreateDuplicateTemplateInOtherUnitSystemFeature::setupActionLook( QAction* actionToSetup )
{
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
if ( !pdmUiItem ) return;
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>( pdmUiItem );
auto objHandle = caf::SelectionManager::instance()->selectedItemOfType<caf::PdmObjectHandle>();
if ( !objHandle ) return;
RimFractureTemplate* fractureTemplate = nullptr;

View File

@ -139,10 +139,7 @@ bool RicNewSimWellFractureAtPosFeature::isCommandEnabled()
RimProject* proj = RiaApplication::instance()->project();
if ( proj->allFractureTemplates().empty() ) return false;
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
if ( !pdmUiItem ) return false;
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>( pdmUiItem );
auto objHandle = caf::SelectionManager::instance()->selectedItemOfType<caf::PdmObjectHandle>();
if ( !objHandle ) return false;
RimSimWellInView* eclipseWell = nullptr;

View File

@ -54,10 +54,7 @@ void RicNewSimWellFractureFeature::onActionTriggered( bool isChecked )
RimProject* proj = RiaApplication::instance()->project();
if ( proj->allFractureTemplates().empty() ) return;
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
if ( !pdmUiItem ) return;
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>( pdmUiItem );
auto objHandle = caf::SelectionManager::instance()->selectedItemOfType<caf::PdmObjectHandle>();
if ( !objHandle ) return;
RimSimWellInView* eclipseWell = nullptr;
@ -126,10 +123,7 @@ bool RicNewSimWellFractureFeature::isCommandEnabled()
RimProject* proj = RiaApplication::instance()->project();
if ( proj->allFractureTemplates().empty() ) return false;
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
if ( !pdmUiItem ) return false;
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>( pdmUiItem );
auto objHandle = caf::SelectionManager::instance()->selectedItemOfType<caf::PdmObjectHandle>();
if ( !objHandle ) return false;
RimSimWellInView* simWell = nullptr;

View File

@ -208,7 +208,7 @@ bool RicImportSummaryCasesFeature::createSummaryCasesFromFiles( const QStringLis
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicImportSummaryCasesFeature::addSummaryCases( const std::vector<RimSummaryCase*> cases )
void RicImportSummaryCasesFeature::addSummaryCases( const std::vector<RimSummaryCase*>& cases )
{
RiaApplication* app = RiaApplication::instance();
RimProject* proj = app->project();
@ -223,7 +223,7 @@ void RicImportSummaryCasesFeature::addSummaryCases( const std::vector<RimSummary
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicImportSummaryCasesFeature::addCasesToGroupIfRelevant( const std::vector<RimSummaryCase*> cases )
void RicImportSummaryCasesFeature::addCasesToGroupIfRelevant( const std::vector<RimSummaryCase*>& cases )
{
std::vector<RimSummaryCaseCollection*> selectedColl = caf::selectedObjectsByTypeStrict<RimSummaryCaseCollection*>();

View File

@ -44,8 +44,8 @@ public:
static bool createSummaryCasesFromFiles( const QStringList& fileName,
std::vector<RimSummaryCase*>* newCases,
bool ensembleOrGroup = false );
static void addSummaryCases( const std::vector<RimSummaryCase*> cases );
static void addCasesToGroupIfRelevant( const std::vector<RimSummaryCase*> cases );
static void addSummaryCases( const std::vector<RimSummaryCase*>& cases );
static void addCasesToGroupIfRelevant( const std::vector<RimSummaryCase*>& cases );
static QStringList runRecursiveSummaryCaseFileSearchDialog( const QString& dialogTitle, const QString& pathCacheName );

View File

@ -145,8 +145,8 @@ public:
RicSummaryCaseRestartDialogResult( Status _status,
RicSummaryCaseRestartDialog::ImportOptions _summaryImportOption,
RicSummaryCaseRestartDialog::ImportOptions _gridImportOption,
QStringList _summaryFiles,
QStringList _gridFiles,
const QStringList& _summaryFiles,
const QStringList& _gridFiles,
bool _applyToAll )
: status( _status )
, summaryImportOption( _summaryImportOption )

View File

@ -483,7 +483,6 @@ bool RifCsvUserDataParser::parseColumnBasedData( const AsciiDataParseOptions& pa
//--------------------------------------------------------------------------------------------------
bool RifCsvUserDataParser::parseLineBasedData()
{
bool errors = false;
QTextStream* dataStream = openDataStream();
std::map<RifEclipseSummaryAddress, std::vector<std::pair<time_t, double>>> addressesAndData;
std::vector<int> colIndexes;
@ -493,7 +492,7 @@ bool RifCsvUserDataParser::parseLineBasedData()
bool headerFound = false;
bool expectErrorValue = false;
while ( !dataStream->atEnd() && !errors )
while ( !dataStream->atEnd() )
{
lineCount++;
@ -597,7 +596,6 @@ bool RifCsvUserDataParser::parseLineBasedData()
}
closeDataStream();
if ( !errors )
{
std::vector<Column> columnInfoList;
for ( const auto& item : addressesAndData )
@ -624,7 +622,8 @@ bool RifCsvUserDataParser::parseLineBasedData()
TableData td( "", "", columnInfoList );
m_tableData = td;
}
return !errors;
return true;
}
//--------------------------------------------------------------------------------------------------

View File

@ -286,7 +286,7 @@ std::set<QDateTime>
///
//--------------------------------------------------------------------------------------------------
std::set<QDateTime> RifReaderEclipseRft::availableTimeSteps(
const QString& wellName, const std::set<RifEclipseRftAddress::RftWellLogChannelType> relevantChannels )
const QString& wellName, const std::set<RifEclipseRftAddress::RftWellLogChannelType>& relevantChannels )
{
if ( !m_ecl_rft_file )
{

View File

@ -49,8 +49,8 @@ public:
std::set<QDateTime> availableTimeSteps( const QString& wellName ) override;
std::set<QDateTime>
availableTimeSteps( const QString& wellName,
const std::set<RifEclipseRftAddress::RftWellLogChannelType> relevantChannels ) override;
availableTimeSteps( const QString& wellName,
const std::set<RifEclipseRftAddress::RftWellLogChannelType>& relevantChannels ) override;
std::set<QDateTime> availableTimeSteps( const QString& wellName,
const RifEclipseRftAddress::RftWellLogChannelType& wellLogChannelName ) override;

View File

@ -59,10 +59,10 @@ std::set<RifEclipseRftAddress> RifReaderEnsembleStatisticsRft::eclipseRftAddress
}
else if ( regularAddress.wellLogChannel() == RifEclipseRftAddress::PRESSURE )
{
std::set<RifEclipseRftAddress::RftWellLogChannelType> statChannels = {RifEclipseRftAddress::PRESSURE_P10,
RifEclipseRftAddress::PRESSURE_P50,
RifEclipseRftAddress::PRESSURE_P90,
RifEclipseRftAddress::PRESSURE_MEAN};
std::set<RifEclipseRftAddress::RftWellLogChannelType> statChannels = { RifEclipseRftAddress::PRESSURE_P10,
RifEclipseRftAddress::PRESSURE_P50,
RifEclipseRftAddress::PRESSURE_P90,
RifEclipseRftAddress::PRESSURE_MEAN };
for ( auto channel : statChannels )
{
statisticsAddresses.insert(
@ -132,7 +132,7 @@ std::set<QDateTime> RifReaderEnsembleStatisticsRft::availableTimeSteps(
///
//--------------------------------------------------------------------------------------------------
std::set<QDateTime> RifReaderEnsembleStatisticsRft::availableTimeSteps(
const QString& wellName, const std::set<RifEclipseRftAddress::RftWellLogChannelType> relevantChannels )
const QString& wellName, const std::set<RifEclipseRftAddress::RftWellLogChannelType>& relevantChannels )
{
std::set<QDateTime> allTimeSteps;
for ( auto summaryCase : m_summaryCaseCollection->allSummaryCases() )

View File

@ -36,8 +36,8 @@ public:
std::set<QDateTime> availableTimeSteps( const QString& wellName,
const RifEclipseRftAddress::RftWellLogChannelType& wellLogChannelName ) override;
std::set<QDateTime>
availableTimeSteps( const QString& wellName,
const std::set<RifEclipseRftAddress::RftWellLogChannelType> relevantChannels ) override;
availableTimeSteps( const QString& wellName,
const std::set<RifEclipseRftAddress::RftWellLogChannelType>& relevantChannels ) override;
std::set<RifEclipseRftAddress::RftWellLogChannelType> availableWellLogChannels( const QString& wellName ) override;
std::set<QString> wellNames() override;

View File

@ -330,7 +330,7 @@ std::set<QDateTime> RifReaderFmuRft::availableTimeSteps( const QString& wellName
auto it = m_allWellObservations.find( wellName );
if ( it != m_allWellObservations.end() )
{
return {it->second.dateTime};
return { it->second.dateTime };
}
return {};
}
@ -339,8 +339,8 @@ std::set<QDateTime> RifReaderFmuRft::availableTimeSteps( const QString& wellName
///
//--------------------------------------------------------------------------------------------------
std::set<QDateTime>
RifReaderFmuRft::availableTimeSteps( const QString& wellName,
const std::set<RifEclipseRftAddress::RftWellLogChannelType> relevantChannels )
RifReaderFmuRft::availableTimeSteps( const QString& wellName,
const std::set<RifEclipseRftAddress::RftWellLogChannelType>& relevantChannels )
{
if ( relevantChannels.count( RifEclipseRftAddress::TVD ) || relevantChannels.count( RifEclipseRftAddress::MD ) ||
relevantChannels.count( RifEclipseRftAddress::PRESSURE ) )
@ -362,7 +362,7 @@ std::set<RifEclipseRftAddress::RftWellLogChannelType> RifReaderFmuRft::available
if ( !m_allWellObservations.empty() )
{
return {RifEclipseRftAddress::TVD, RifEclipseRftAddress::MD, RifEclipseRftAddress::PRESSURE};
return { RifEclipseRftAddress::TVD, RifEclipseRftAddress::MD, RifEclipseRftAddress::PRESSURE };
}
return {};
}

View File

@ -75,8 +75,8 @@ public:
void values( const RifEclipseRftAddress& rftAddress, std::vector<double>* values ) override;
std::set<QDateTime>
availableTimeSteps( const QString& wellName,
const std::set<RifEclipseRftAddress::RftWellLogChannelType> relevantChannels ) override;
availableTimeSteps( const QString& wellName,
const std::set<RifEclipseRftAddress::RftWellLogChannelType>& relevantChannels ) override;
std::set<QDateTime> availableTimeSteps( const QString& wellName ) override;
std::set<QDateTime> availableTimeSteps( const QString& wellName,
const RifEclipseRftAddress::RftWellLogChannelType& wellLogChannelName ) override;

View File

@ -34,8 +34,8 @@ public:
virtual void values( const RifEclipseRftAddress& rftAddress, std::vector<double>* values ) = 0;
virtual std::set<QDateTime>
availableTimeSteps( const QString& wellName,
const std::set<RifEclipseRftAddress::RftWellLogChannelType> relevantChannels ) = 0;
availableTimeSteps( const QString& wellName,
const std::set<RifEclipseRftAddress::RftWellLogChannelType>& relevantChannels ) = 0;
virtual std::set<QDateTime> availableTimeSteps( const QString& wellName ) = 0;
virtual std::set<QDateTime>
availableTimeSteps( const QString& wellName,

View File

@ -388,7 +388,7 @@ void RifStimPlanXmlReader::getGriddingValues( QXmlStreamReader& xmlStream,
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RifStimPlanXmlReader::getAttributeValueDouble( QXmlStreamReader& xmlStream, QString parameterName )
double RifStimPlanXmlReader::getAttributeValueDouble( QXmlStreamReader& xmlStream, const QString& parameterName )
{
double value = HUGE_VAL;
for ( const QXmlStreamAttribute& attr : xmlStream.attributes() )
@ -404,7 +404,7 @@ double RifStimPlanXmlReader::getAttributeValueDouble( QXmlStreamReader& xmlStrea
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RifStimPlanXmlReader::getAttributeValueString( QXmlStreamReader& xmlStream, QString parameterName )
QString RifStimPlanXmlReader::getAttributeValueString( QXmlStreamReader& xmlStream, const QString& parameterName )
{
QString parameterValue;
for ( const QXmlStreamAttribute& attr : xmlStream.attributes() )

View File

@ -54,8 +54,8 @@ private:
MirrorMode mirrorMode,
RiaEclipseUnitTools::UnitSystem requiredUnit );
static double getAttributeValueDouble( QXmlStreamReader& xmlStream, QString parameterName );
static QString getAttributeValueString( QXmlStreamReader& xmlStream, QString parameterName );
static double getAttributeValueDouble( QXmlStreamReader& xmlStream, const QString& parameterName );
static QString getAttributeValueString( QXmlStreamReader& xmlStream, const QString& parameterName );
static void getGriddingValues( QXmlStreamReader& xmlStream, std::vector<double>& gridValues, size_t& startNegValues );
static std::vector<std::vector<double>> getAllDepthDataAtTimeStep( QXmlStreamReader& xmlStream );

View File

@ -35,6 +35,8 @@ public:
RiaGrpcServer( int portNumber );
~RiaGrpcServer();
RiaGrpcServer( const RiaGrpcServer& ) = delete;
int portNumber() const;
bool isRunning() const;
void run();

View File

@ -85,11 +85,12 @@ void RimPolylinesFromFileAnnotation::readPolyLinesFile( QString* errorMessage )
{
QString line = stream.readLine();
QStringList commentLineSegs = line.split( "#", QString::KeepEmptyParts );
if ( commentLineSegs.size() == 0 ) continue; // Empty line
if ( commentLineSegs.empty() ) continue; // Empty line
QStringList lineSegs = commentLineSegs[0].split( QRegExp( "\\s+" ), QString::SkipEmptyParts );
if ( lineSegs.size() == 0 ) continue; // No data
if ( lineSegs.empty() ) continue; // No data
if ( lineSegs.size() != 3 )
{
if ( errorMessage )
@ -97,7 +98,6 @@ void RimPolylinesFromFileAnnotation::readPolyLinesFile( QString* errorMessage )
continue;
}
if ( lineSegs.size() == 3 ) // Normal case
{
bool isNumberParsingOk = true;
bool isOk = true;

View File

@ -926,8 +926,6 @@ QList<caf::PdmOptionItemInfo> RimWellLogTrack::calculateValueOptions( const caf:
{
QList<caf::PdmOptionItemInfo> options;
if ( options.size() > 0 ) return options;
if ( fieldNeedingOptions == &m_regionAnnotationType )
{
options.push_back(

View File

@ -29,7 +29,7 @@
//==================================================================================================
///
//==================================================================================================
RigCompletionData::RigCompletionData( const QString wellName,
RigCompletionData::RigCompletionData( const QString& wellName,
const RigCompletionDataGridCell& cellIndex,
double orderingValue )
: m_wellName( wellName )

View File

@ -81,7 +81,7 @@ public:
CT_UNDEFINED
};
RigCompletionData( const QString wellName, const RigCompletionDataGridCell& cellIndex, double orderingValue );
RigCompletionData( const QString& wellName, const RigCompletionDataGridCell& cellIndex, double orderingValue );
~RigCompletionData();
RigCompletionData( const RigCompletionData& other );

View File

@ -37,7 +37,7 @@
///
//--------------------------------------------------------------------------------------------------
RigNumberOfFloodedPoreVolumesCalculator::RigNumberOfFloodedPoreVolumesCalculator( RimEclipseCase* caseToApply,
const std::vector<QString> tracerNames )
const std::vector<QString>& tracerNames )
{
RigMainGrid* mainGrid = caseToApply->eclipseCaseData()->mainGrid();
@ -197,7 +197,7 @@ void RigNumberOfFloodedPoreVolumesCalculator::calculate( RigMainGrid*
std::vector<const std::vector<double>*> flowrateIatAllTimeSteps,
std::vector<const std::vector<double>*> flowrateJatAllTimeSteps,
std::vector<const std::vector<double>*> flowrateKatAllTimeSteps,
const std::vector<RigConnection> connections,
const std::vector<RigConnection>& connections,
std::vector<const std::vector<double>*> flowrateNNCatAllTimeSteps,
std::vector<std::vector<double>> summedTracersAtAllTimesteps )
{
@ -290,11 +290,11 @@ void RigNumberOfFloodedPoreVolumesCalculator::calculate( RigMainGrid*
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigNumberOfFloodedPoreVolumesCalculator::distributeNNCflow( std::vector<RigConnection> connections,
RimEclipseCase* caseToApply,
std::vector<double> summedTracerValues,
const std::vector<double>* flowrateNNC,
std::vector<double>& flowrateIntoCell )
void RigNumberOfFloodedPoreVolumesCalculator::distributeNNCflow( const std::vector<RigConnection>& connections,
RimEclipseCase* caseToApply,
const std::vector<double>& summedTracerValues,
const std::vector<double>* flowrateNNC,
std::vector<double>& flowrateIntoCell )
{
RigActiveCellInfo* actCellInfo = caseToApply->eclipseCaseData()->activeCellInfo( RiaDefines::MATRIX_MODEL );
@ -325,9 +325,9 @@ void RigNumberOfFloodedPoreVolumesCalculator::distributeNNCflow( std::vector<Rig
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigNumberOfFloodedPoreVolumesCalculator::distributeNeighbourCellFlow( RigMainGrid* mainGrid,
RimEclipseCase* caseToApply,
std::vector<double> summedTracerValues,
void RigNumberOfFloodedPoreVolumesCalculator::distributeNeighbourCellFlow( RigMainGrid* mainGrid,
RimEclipseCase* caseToApply,
const std::vector<double>& summedTracerValues,
const std::vector<double>* flrWatResultI,
const std::vector<double>* flrWatResultJ,
const std::vector<double>* flrWatResultK,

View File

@ -33,8 +33,8 @@ class RigConnection;
class RigNumberOfFloodedPoreVolumesCalculator
{
public:
explicit RigNumberOfFloodedPoreVolumesCalculator( RimEclipseCase* caseToApply,
const std::vector<QString> tracerNames );
explicit RigNumberOfFloodedPoreVolumesCalculator( RimEclipseCase* caseToApply,
const std::vector<QString>& tracerNames );
// Used to "steal" the data from this one using swap
@ -49,19 +49,19 @@ private:
std::vector<const std::vector<double>*> flowrateIatAllTimeSteps,
std::vector<const std::vector<double>*> flowrateJatAllTimeSteps,
std::vector<const std::vector<double>*> flowrateKatAllTimeSteps,
const std::vector<RigConnection> connections,
const std::vector<RigConnection>& connections,
std::vector<const std::vector<double>*> flowrateNNCatAllTimeSteps,
std::vector<std::vector<double>> summedTracersAtAllTimesteps );
void distributeNNCflow( std::vector<RigConnection> connections,
RimEclipseCase* caseToApply,
std::vector<double> summedTracerValues,
const std::vector<double>* flowrateNNC,
std::vector<double>& flowrateIntoCell );
void distributeNNCflow( const std::vector<RigConnection>& connections,
RimEclipseCase* caseToApply,
const std::vector<double>& summedTracerValues,
const std::vector<double>* flowrateNNC,
std::vector<double>& flowrateIntoCell );
void distributeNeighbourCellFlow( RigMainGrid* mainGrid,
RimEclipseCase* caseToApply,
std::vector<double> summedTracerValues,
const std::vector<double>& summedTracerValues,
const std::vector<double>* flrWatResultI,
const std::vector<double>* flrWatResultJ,
const std::vector<double>* flrWatResultK,

View File

@ -566,10 +566,10 @@ size_t RigStimPlanFractureDefinition::resultIndex( const QString& resultName, co
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigStimPlanFractureDefinition::setDataAtTimeValue( QString resultName,
QString unit,
std::vector<std::vector<double>> data,
double timeStepValue )
void RigStimPlanFractureDefinition::setDataAtTimeValue( const QString& resultName,
const QString& unit,
const std::vector<std::vector<double>>& data,
double timeStepValue )
{
size_t resIndex = resultIndex( resultName, unit );

View File

@ -85,7 +85,10 @@ public:
std::vector<std::pair<QString, QString>> getStimPlanPropertyNamesUnits() const;
void setDataAtTimeValue( QString resultName, QString unit, std::vector<std::vector<double>> data, double timeStepValue );
void setDataAtTimeValue( const QString& resultName,
const QString& unit,
const std::vector<std::vector<double>>& data,
double timeStepValue );
const std::vector<std::vector<double>>&
getDataAtTimeIndex( const QString& resultName, const QString& unit, size_t timeStepIndex ) const;

View File

@ -132,10 +132,12 @@ double GeometryTools::getAngle( const cvf::Vec3d& positiveNormalAxis, const cvf:
double GeometryTools::getAngle( const cvf::Vec3d& v1, const cvf::Vec3d& v2 )
{
bool isOk = false;
cvf::Vec3d v1N = v1.getNormalized( &isOk );
bool isOk = false;
cvf::Vec3d v1N = v1.getNormalized( &isOk );
if ( !isOk ) return 0;
cvf::Vec3d v2N = v2.getNormalized();
cvf::Vec3d v2N = v2.getNormalized( &isOk );
if ( !isOk ) return 0;
double cosAng = v1N * v2N;

View File

@ -85,7 +85,9 @@ public:
private:
Riu3dSelectionManager();
~Riu3dSelectionManager();
Riu3dSelectionManager( const Riu3dSelectionManager& ) = delete;
void operator=( const Riu3dSelectionManager& o ) = delete;
void deleteAllItemsFromSelection( int role );

View File

@ -52,6 +52,9 @@ class RiuGridCrossQwtPlot : public RiuQwtPlotWidget, public RiuInterfaceToViewWi
public:
RiuGridCrossQwtPlot( RimPlotInterface* plotDefinition, QWidget* parent = nullptr );
~RiuGridCrossQwtPlot();
RiuGridCrossQwtPlot( const RiuGridCrossQwtPlot& ) = delete;
void addOrUpdateDataSetLegend( RimGridCrossPlotDataSet* dataSetToShowLegendFor );
void removeDataSetLegend( RimGridCrossPlotDataSet* dataSetToShowLegendFor );
void removeDanglingDataSetLegends();

View File

@ -42,14 +42,14 @@ RiuPlotAnnotationTool::~RiuPlotAnnotationTool()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuPlotAnnotationTool::attachNamedRegions( QwtPlot* plot,
const std::vector<QString>& names,
const std::pair<double, double> xRange,
const std::vector<std::pair<double, double>> yPositions,
RegionDisplay regionDisplay,
const caf::ColorTable& colorTable,
int shadingAlphaByte,
bool showNames /*= true */,
void RiuPlotAnnotationTool::attachNamedRegions( QwtPlot* plot,
const std::vector<QString>& names,
const std::pair<double, double> xRange,
const std::vector<std::pair<double, double>>& yPositions,
RegionDisplay regionDisplay,
const caf::ColorTable& colorTable,
int shadingAlphaByte,
bool showNames /*= true */,
TrackSpan trackSpan /*= FULL_WIDTH*/ )
{
if ( names.size() != yPositions.size() ) return;
@ -131,7 +131,7 @@ void RiuPlotAnnotationTool::attachNamedRegions( QwtPlot*
//--------------------------------------------------------------------------------------------------
void RiuPlotAnnotationTool::attachWellPicks( QwtPlot* plot,
const std::vector<QString>& names,
const std::vector<double> yPositions )
const std::vector<double>& yPositions )
{
detachAllAnnotations();

View File

@ -58,16 +58,16 @@ public:
RiuPlotAnnotationTool(){};
~RiuPlotAnnotationTool();
void attachNamedRegions( QwtPlot* plot,
const std::vector<QString>& names,
const std::pair<double, double> xRange,
const std::vector<std::pair<double, double>> yPositions,
RegionDisplay regionDisplay,
const caf::ColorTable& colorTable,
int shadingAlphaByte,
bool showNames = true,
TrackSpan trackSpan = FULL_WIDTH );
void attachWellPicks( QwtPlot* plot, const std::vector<QString>& names, const std::vector<double> yPositions );
void attachNamedRegions( QwtPlot* plot,
const std::vector<QString>& names,
const std::pair<double, double> xRange,
const std::vector<std::pair<double, double>>& yPositions,
RegionDisplay regionDisplay,
const caf::ColorTable& colorTable,
int shadingAlphaByte,
bool showNames = true,
TrackSpan trackSpan = FULL_WIDTH );
void attachWellPicks( QwtPlot* plot, const std::vector<QString>& names, const std::vector<double>& yPositions );
void attachAnnotationLine( QwtPlot* plot, const QColor& color, const QString& annotationText, const double yPosition );

View File

@ -192,9 +192,9 @@ void RiuPvtPlotWidget::plotCurves( RiaEclipseUnitTools::UnitSystem
const std::vector<RigFlowDiagSolverInterface::PvtCurve>& curveArr,
double pressure,
double pointMarkerYValue,
QString pointMarkerLabel,
QString plotTitle,
QString yAxisTitle )
const QString& pointMarkerLabel,
const QString& plotTitle,
const QString& yAxisTitle )
{
m_qwtPlot->detachItems( QwtPlotItem::Rtti_PlotCurve );
m_qwtPlot->detachItems( QwtPlotItem::Rtti_PlotMarker );
@ -567,10 +567,10 @@ RiuPvtPlotPanel::~RiuPvtPlotPanel() {}
void RiuPvtPlotPanel::setPlotData( RiaEclipseUnitTools::UnitSystem unitSystem,
const std::vector<RigFlowDiagSolverInterface::PvtCurve>& fvfCurveArr,
const std::vector<RigFlowDiagSolverInterface::PvtCurve>& viscosityCurveArr,
FvfDynProps fvfDynProps,
ViscosityDynProps viscosityDynProps,
CellValues cellValues,
QString cellReferenceText )
const FvfDynProps& fvfDynProps,
const ViscosityDynProps& viscosityDynProps,
const CellValues& cellValues,
const QString& cellReferenceText )
{
// cvf::Trace::show("RiuPvtPlotPanel::setPlotData()");

View File

@ -63,9 +63,9 @@ public:
const std::vector<RigFlowDiagSolverInterface::PvtCurve>& curveArr,
double pressure,
double pointMarkerYValue,
QString pointMarkerLabel,
QString plotTitle,
QString yAxisTitle );
const QString& pointMarkerLabel,
const QString& plotTitle,
const QString& yAxisTitle );
void applyFontSizes( bool replot );
private:
@ -127,10 +127,10 @@ public:
void setPlotData( RiaEclipseUnitTools::UnitSystem unitSystem,
const std::vector<RigFlowDiagSolverInterface::PvtCurve>& fvfCurveArr,
const std::vector<RigFlowDiagSolverInterface::PvtCurve>& viscosityCurveArr,
FvfDynProps fvfDynProps,
ViscosityDynProps viscosityDynProps,
CellValues cellValues,
QString cellReferenceText );
const FvfDynProps& fvfDynProps,
const ViscosityDynProps& viscosityDynProps,
const CellValues& cellValues,
const QString& cellReferenceText );
void clearPlot();
RiuPvtPlotUpdater* plotUpdater();
void applyFontSizes( bool replot );

View File

@ -184,8 +184,8 @@ void RiuRelativePermeabilityPlotPanel::setPlotData( RiaEclipseUnitTools::UnitSys
const std::vector<RigFlowDiagSolverInterface::RelPermCurve>& relPermCurves,
double swat,
double sgas,
QString caseName,
QString cellReferenceText )
const QString& caseName,
const QString& cellReferenceText )
{
// cvf::Trace::show("Set RelPerm plot data");

View File

@ -52,8 +52,8 @@ public:
const std::vector<RigFlowDiagSolverInterface::RelPermCurve>& relPermCurves,
double swat,
double sgas,
QString caseName,
QString cellReferenceText );
const QString& caseName,
const QString& cellReferenceText );
void clearPlot();
RiuRelativePermeabilityPlotUpdater* plotUpdater();
void applyFontSizes( bool replot );

View File

@ -60,6 +60,8 @@ public:
{
}
SummaryIdentifierAndField( const SummaryIdentifierAndField& ) = delete;
SummaryIdentifierAndField( RifEclipseSummaryAddress::SummaryIdentifierType summaryIdentifier )
: m_summaryIdentifier( summaryIdentifier )
, m_pdmField( new caf::PdmField<std::vector<QString>>() )
@ -90,55 +92,55 @@ private:
//--------------------------------------------------------------------------------------------------
RiuSummaryCurveDefSelection::RiuSummaryCurveDefSelection()
: m_identifierFieldsMap( {
{RifEclipseSummaryAddress::SUMMARY_FIELD,
{{new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME )}}},
{RifEclipseSummaryAddress::SUMMARY_AQUIFER,
{{new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_AQUIFER_NUMBER )},
{new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME )}}},
{RifEclipseSummaryAddress::SUMMARY_NETWORK,
{{new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME )}}},
{RifEclipseSummaryAddress::SUMMARY_MISC,
{{new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME )}}},
{RifEclipseSummaryAddress::SUMMARY_REGION,
{{new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_REGION_NUMBER )},
{new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME )}}},
{RifEclipseSummaryAddress::SUMMARY_REGION_2_REGION,
{{new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_REGION_2_REGION )},
{new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME )}}},
{RifEclipseSummaryAddress::SUMMARY_WELL_GROUP,
{{new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_WELL_GROUP_NAME )},
{new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME )}}},
{RifEclipseSummaryAddress::SUMMARY_WELL,
{{new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_WELL_NAME )},
{new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME )}}},
{RifEclipseSummaryAddress::SUMMARY_WELL_COMPLETION,
{{new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_WELL_NAME )},
{new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_CELL_IJK )},
{new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME )}}},
{RifEclipseSummaryAddress::SUMMARY_WELL_COMPLETION_LGR,
{{new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_LGR_NAME )},
{new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_WELL_NAME )},
{new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_CELL_IJK )},
{new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME )}}},
{RifEclipseSummaryAddress::SUMMARY_WELL_LGR,
{{new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_LGR_NAME )},
{new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_WELL_NAME )},
{new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME )}}},
{RifEclipseSummaryAddress::SUMMARY_WELL_SEGMENT,
{{new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_WELL_NAME )},
{new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_SEGMENT_NUMBER )},
{new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME )}}},
{RifEclipseSummaryAddress::SUMMARY_BLOCK,
{{new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_CELL_IJK )},
{new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME )}}},
{RifEclipseSummaryAddress::SUMMARY_BLOCK_LGR,
{{new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_LGR_NAME )},
{new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_CELL_IJK )},
{new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME )}}},
{RifEclipseSummaryAddress::SUMMARY_CALCULATED,
{{new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME )}}},
{RifEclipseSummaryAddress::SUMMARY_IMPORTED,
{{new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME )}}},
{ RifEclipseSummaryAddress::SUMMARY_FIELD,
{ { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) } } },
{ RifEclipseSummaryAddress::SUMMARY_AQUIFER,
{ { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_AQUIFER_NUMBER ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) } } },
{ RifEclipseSummaryAddress::SUMMARY_NETWORK,
{ { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) } } },
{ RifEclipseSummaryAddress::SUMMARY_MISC,
{ { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) } } },
{ RifEclipseSummaryAddress::SUMMARY_REGION,
{ { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_REGION_NUMBER ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) } } },
{ RifEclipseSummaryAddress::SUMMARY_REGION_2_REGION,
{ { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_REGION_2_REGION ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) } } },
{ RifEclipseSummaryAddress::SUMMARY_WELL_GROUP,
{ { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_WELL_GROUP_NAME ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) } } },
{ RifEclipseSummaryAddress::SUMMARY_WELL,
{ { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_WELL_NAME ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) } } },
{ RifEclipseSummaryAddress::SUMMARY_WELL_COMPLETION,
{ { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_WELL_NAME ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_CELL_IJK ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) } } },
{ RifEclipseSummaryAddress::SUMMARY_WELL_COMPLETION_LGR,
{ { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_LGR_NAME ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_WELL_NAME ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_CELL_IJK ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) } } },
{ RifEclipseSummaryAddress::SUMMARY_WELL_LGR,
{ { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_LGR_NAME ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_WELL_NAME ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) } } },
{ RifEclipseSummaryAddress::SUMMARY_WELL_SEGMENT,
{ { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_WELL_NAME ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_SEGMENT_NUMBER ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) } } },
{ RifEclipseSummaryAddress::SUMMARY_BLOCK,
{ { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_CELL_IJK ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) } } },
{ RifEclipseSummaryAddress::SUMMARY_BLOCK_LGR,
{ { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_LGR_NAME ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_CELL_IJK ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) } } },
{ RifEclipseSummaryAddress::SUMMARY_CALCULATED,
{ { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) } } },
{ RifEclipseSummaryAddress::SUMMARY_IMPORTED,
{ { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) } } },
} )
{
CAF_PDM_InitFieldNoDefault( &m_selectedSources, "SummaryCases", "Cases", "", "", "" );
@ -573,8 +575,8 @@ void RiuSummaryCurveDefSelection::setFieldChangedHandler( const std::function<vo
//--------------------------------------------------------------------------------------------------
void RiuSummaryCurveDefSelection::setDefaultSelection( const std::vector<SummarySource*>& defaultSources )
{
RimProject* proj = RiaApplication::instance()->project();
auto allSumCases = proj->allSummaryCases();
RimProject* proj = RiaApplication::instance()->project();
auto allSumCases = proj->allSummaryCases();
if ( allSumCases.size() > 0 )
{

View File

@ -45,6 +45,9 @@ public:
RiuTofAccumulatedPhaseFractionsPlot( RimTofAccumulatedPhaseFractionsPlot* plotDefinition, QWidget* parent = nullptr );
~RiuTofAccumulatedPhaseFractionsPlot() override;
RiuTofAccumulatedPhaseFractionsPlot( const RiuTofAccumulatedPhaseFractionsPlot& ) = delete;
void operator=( const RiuTofAccumulatedPhaseFractionsPlot& o ) = delete;
RimTofAccumulatedPhaseFractionsPlot* ownerPlotDefinition();
RimViewWindow* ownerViewWindow() const override;

View File

@ -74,6 +74,9 @@ class RiuViewer : public caf::Viewer, public RiuInterfaceToViewWindow
public:
RiuViewer( const QGLFormat& format, QWidget* parent );
~RiuViewer() override;
RiuViewer( const RiuViewer& ) = delete;
void clearRimView();
void setDefaultView();
cvf::Vec3d pointOfInterest();

View File

@ -357,7 +357,7 @@ void RiuWellPathComponentPlotItem::addMarker( double posX
int size,
RiuQwtSymbol::PointSymbolEnum symbolType,
cvf::Color4f baseColor,
QString label /*= QString("")*/,
const QString& label /*= QString("")*/,
Qt::Alignment labelAlignment /*= Qt::AlignTop*/,
Qt::Orientation labelOrientation /*= Qt::Vertical*/,
bool drawLine /*= false*/,
@ -384,7 +384,7 @@ QwtPlotItem* RiuWellPathComponentPlotItem::createMarker( double
int size,
RiuQwtSymbol::PointSymbolEnum symbolType,
cvf::Color4f baseColor,
QString label /*= QString("")*/,
const QString& label /*= QString("")*/,
Qt::Alignment labelAlignment /*= Qt::AlignTop*/,
Qt::Orientation labelOrientation /*= Qt::Vertical*/,
bool drawLine /*= false*/,

View File

@ -85,7 +85,7 @@ private:
int size,
RiuQwtSymbol::PointSymbolEnum symbolType,
cvf::Color4f baseColor,
QString label = QString( "" ),
const QString& label = QString( "" ),
Qt::Alignment labelAlignment = Qt::AlignVCenter | Qt::AlignRight,
Qt::Orientation labelOrientation = Qt::Horizontal,
bool drawLine = false,
@ -95,7 +95,7 @@ private:
int size,
RiuQwtSymbol::PointSymbolEnum symbolType,
cvf::Color4f baseColor,
QString label = QString( "" ),
const QString& label = QString( "" ),
Qt::Alignment labelAlignment = Qt::AlignVCenter | Qt::AlignRight,
Qt::Orientation labelOrientation = Qt::Horizontal,
bool drawLine = false,