Update clang-format.yml (#10068)

* Update to clang-format-15
Removed two custom .clang-format files in subfolders of AppFwk

* Fixes by clang-format
This commit is contained in:
Magne Sjaastad
2023-04-13 07:05:53 +02:00
committed by GitHub
parent 310b54ef93
commit 952e766c2f
230 changed files with 2010 additions and 2019 deletions

View File

@@ -78,7 +78,7 @@ RimStimPlanModelPlot* RicNewStimPlanModelPlotFeature::createPlot( RimStimPlanMod
plot->setStimPlanModel( stimPlanModel );
{
auto task = progInfo.task( "Creating formation track", 2 );
auto task = progInfo.task( "Creating formation track", 2 );
RimEclipseCase* formationEclipseCase = stimPlanModel->eclipseCaseForType( RimExtractionConfiguration::EclipseCaseType::STATIC_CASE );
createFormationTrack( plot, stimPlanModel, formationEclipseCase );
}

View File

@@ -704,7 +704,8 @@ std::vector<cvf::Vec3d> RicExportFractureCompletionsImpl::computeWellPointsInFra
RiaLogging::info( QString( "Angle: %1 degrees." ).arg( cvf::Math::toDegrees( angle ) ) );
auto rotMat = cvf::GeometryTools::rotationMatrixBetweenVectors( directionToStartPos, directionToStartPosInFracturePlane );
auto rotatePoint = []( const cvf::Vec3d& point, const cvf::Vec3d& offset, auto rotMat ) {
auto rotatePoint = []( const cvf::Vec3d& point, const cvf::Vec3d& offset, auto rotMat )
{
cvf::Vec3d p = point - offset;
p.transformPoint( rotMat );
p += offset;

View File

@@ -412,7 +412,7 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions( const std::v
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RigCompletionData> RicWellPathExportCompletionDataFeatureImpl::computeStaticCompletionsForWellPath( RimWellPath* wellPath,
std::vector<RigCompletionData> RicWellPathExportCompletionDataFeatureImpl::computeStaticCompletionsForWellPath( RimWellPath* wellPath,
RimEclipseCase* eclipseCase )
{
std::vector<RigCompletionData> completionsPerEclipseCell;
@@ -448,7 +448,7 @@ std::vector<RigCompletionData> RicWellPathExportCompletionDataFeatureImpl::compu
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RigCompletionData> RicWellPathExportCompletionDataFeatureImpl::computeDynamicCompletionsForWellPath( RimWellPath* wellPath,
std::vector<RigCompletionData> RicWellPathExportCompletionDataFeatureImpl::computeDynamicCompletionsForWellPath( RimWellPath* wellPath,
RimEclipseCase* eclipseCase,
size_t timeStepIndex )
{
@@ -761,8 +761,8 @@ void RicWellPathExportCompletionDataFeatureImpl::exportWelspecsToFile( RimEclips
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicWellPathExportCompletionDataFeatureImpl::exportWelspeclToFile( RimEclipseCase* gridCase,
QFilePtr exportFile,
void RicWellPathExportCompletionDataFeatureImpl::exportWelspeclToFile( RimEclipseCase* gridCase,
QFilePtr exportFile,
const std::map<QString, std::vector<RigCompletionData>>& completions )
{
QTextStream stream( exportFile.get() );

View File

@@ -102,14 +102,14 @@ public:
calculateCellMainDirection( RimEclipseCase* eclipseCase, size_t globalCellIndex, const cvf::Vec3d& lengthsInCell );
static TransmissibilityData
calculateTransmissibilityData( RimEclipseCase* eclipseCase,
const RimWellPath* wellPath,
const cvf::Vec3d& internalCellLengths,
double skinFactor,
double wellRadius,
size_t globalCellIndex,
bool useLateralNTG,
size_t volumeScaleConstant = 1,
calculateTransmissibilityData( RimEclipseCase* eclipseCase,
const RimWellPath* wellPath,
const cvf::Vec3d& internalCellLengths,
double skinFactor,
double wellRadius,
size_t globalCellIndex,
bool useLateralNTG,
size_t volumeScaleConstant = 1,
RigCompletionData::CellDirection directionForVolumeScaling = RigCompletionData::CellDirection::DIR_I );
static double calculateDFactor( RimEclipseCase* eclipseCase,

View File

@@ -115,14 +115,18 @@ void RicWellPathExportMswCompletionsImpl::exportWellSegmentsForAllCompletions( c
auto allCompletions = wellPath->allCompletionsRecursively();
bool exportFractures =
exportSettings.includeFractures() && std::any_of( allCompletions.begin(), allCompletions.end(), []( auto completion ) {
return completion->isEnabled() && completion->componentType() == RiaDefines::WellPathComponentType::FRACTURE;
} );
exportSettings.includeFractures() &&
std::any_of( allCompletions.begin(),
allCompletions.end(),
[]( auto completion )
{ return completion->isEnabled() && completion->componentType() == RiaDefines::WellPathComponentType::FRACTURE; } );
bool exportFishbones =
exportSettings.includeFishbones() && std::any_of( allCompletions.begin(), allCompletions.end(), []( auto completion ) {
return completion->isEnabled() && completion->componentType() == RiaDefines::WellPathComponentType::FISHBONES;
} );
exportSettings.includeFishbones() &&
std::any_of( allCompletions.begin(),
allCompletions.end(),
[]( auto completion )
{ return completion->isEnabled() && completion->componentType() == RiaDefines::WellPathComponentType::FISHBONES; } );
if ( exportSettings.fileSplit() == RicExportCompletionDataSettingsUi::ExportSplit::SPLIT_ON_WELL && !unifiedWellPathFile )
{
@@ -157,11 +161,14 @@ void RicWellPathExportMswCompletionsImpl::exportWellSegmentsForAllCompletions( c
}
else
{
bool anyPerforationsPresent =
exportSettings.includeFractures() && std::any_of( allCompletions.begin(), allCompletions.end(), []( auto completion ) {
return completion->isEnabled() &&
completion->componentType() == RiaDefines::WellPathComponentType::PERFORATION_INTERVAL;
} );
bool anyPerforationsPresent = exportSettings.includeFractures() &&
std::any_of( allCompletions.begin(),
allCompletions.end(),
[]( auto completion ) {
return completion->isEnabled() &&
completion->componentType() ==
RiaDefines::WellPathComponentType::PERFORATION_INTERVAL;
} );
QString perforationText = anyPerforationsPresent ? "Perforation_" : "";
QString fileName =
@@ -202,11 +209,11 @@ void RicWellPathExportMswCompletionsImpl::exportWellSegmentsForAllCompletions( c
else
{
QString fileName = QString( "%1_Fracture_MSW_%2" ).arg( wellPath->name(), exportSettings.caseToApply->caseUserDescription() );
exportFile = RicWellPathExportCompletionsFileTools::openFileForExport( exportSettings.folder,
exportFile = RicWellPathExportCompletionsFileTools::openFileForExport( exportSettings.folder,
fileName,
"",
exportSettings.exportDataSourceAsComment() );
lgrExportFile = RicWellPathExportCompletionsFileTools::openFileForExport( exportSettings.folder,
lgrExportFile = RicWellPathExportCompletionsFileTools::openFileForExport( exportSettings.folder,
fileName + "_LGR",
"",
exportSettings.exportDataSourceAsComment() );
@@ -237,11 +244,11 @@ void RicWellPathExportMswCompletionsImpl::exportWellSegmentsForAllCompletions( c
else
{
QString fileName = QString( "%1_Fishbones_MSW_%2" ).arg( wellPath->name(), exportSettings.caseToApply->caseUserDescription() );
exportFile = RicWellPathExportCompletionsFileTools::openFileForExport( exportSettings.folder,
exportFile = RicWellPathExportCompletionsFileTools::openFileForExport( exportSettings.folder,
fileName,
"",
exportSettings.exportDataSourceAsComment() );
lgrExportFile = RicWellPathExportCompletionsFileTools::openFileForExport( exportSettings.folder,
lgrExportFile = RicWellPathExportCompletionsFileTools::openFileForExport( exportSettings.folder,
fileName + "_LGR",
"",
exportSettings.exportDataSourceAsComment() );
@@ -350,7 +357,8 @@ void RicWellPathExportMswCompletionsImpl::exportWellSegmentsForFractures( RimEcl
RicMswExportInfo& exportInfo,
const RimWellPath* wellPath,
bool completionSegmentsAfterMainBore,
bool exportLgrData ) {
bool exportLgrData )
{
formatter.setOptionalComment( exportDataSourceAsComment );
double maxSegmentLength = wellPath->mswCompletionParameters()->maxSegmentLength();
@@ -555,9 +563,9 @@ void RicWellPathExportMswCompletionsImpl::updateDataForMultipleItemsInSameGridCe
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicWellPathExportMswCompletionsImpl::generateFishbonesMswExportInfo( const RimEclipseCase* eclipseCase,
const RimWellPath* wellPath,
double initialMD,
void RicWellPathExportMswCompletionsImpl::generateFishbonesMswExportInfo( const RimEclipseCase* eclipseCase,
const RimWellPath* wellPath,
double initialMD,
const std::vector<WellPathCellIntersectionInfo>& cellIntersections,
bool enableSegmentSplitting,
gsl::not_null<RicMswExportInfo*> exportInfo,
@@ -572,14 +580,14 @@ void RicWellPathExportMswCompletionsImpl::generateFishbonesMswExportInfo( const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicWellPathExportMswCompletionsImpl::generateFishbonesMswExportInfo( const RimEclipseCase* eclipseCase,
const RimWellPath* wellPath,
double initialMD,
void RicWellPathExportMswCompletionsImpl::generateFishbonesMswExportInfo( const RimEclipseCase* eclipseCase,
const RimWellPath* wellPath,
double initialMD,
const std::vector<WellPathCellIntersectionInfo>& cellIntersections,
const std::vector<RimFishbones*>& fishbonesSubs,
bool enableSegmentSplitting,
gsl::not_null<RicMswExportInfo*> exportInfo,
gsl::not_null<RicMswBranch*> branch )
const std::vector<RimFishbones*>& fishbonesSubs,
bool enableSegmentSplitting,
gsl::not_null<RicMswExportInfo*> exportInfo,
gsl::not_null<RicMswBranch*> branch )
{
std::vector<WellPathCellIntersectionInfo> filteredIntersections =
filterIntersections( cellIntersections, initialMD, wellPath->wellPathGeometry(), eclipseCase );
@@ -762,12 +770,12 @@ void RicWellPathExportMswCompletionsImpl::generateFishbonesMswExportInfoForWell(
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicWellPathExportMswCompletionsImpl::generateFracturesMswExportInfo( RimEclipseCase* eclipseCase,
const RimWellPath* wellPath,
double initialMD,
bool RicWellPathExportMswCompletionsImpl::generateFracturesMswExportInfo( RimEclipseCase* eclipseCase,
const RimWellPath* wellPath,
double initialMD,
const std::vector<WellPathCellIntersectionInfo>& cellIntersections,
gsl::not_null<RicMswExportInfo*> exportInfo,
gsl::not_null<RicMswBranch*> branch )
gsl::not_null<RicMswExportInfo*> exportInfo,
gsl::not_null<RicMswBranch*> branch )
{
auto mswParameters = wellPath->mswCompletionParameters();
auto fractures = wellPath->fractureCollection()->activeFractures();
@@ -827,13 +835,13 @@ bool RicWellPathExportMswCompletionsImpl::generateFracturesMswExportInfo( RimEcl
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicWellPathExportMswCompletionsImpl::generatePerforationsMswExportInfo( RimEclipseCase* eclipseCase,
const RimWellPath* wellPath,
int timeStep,
double initialMD,
bool RicWellPathExportMswCompletionsImpl::generatePerforationsMswExportInfo( RimEclipseCase* eclipseCase,
const RimWellPath* wellPath,
int timeStep,
double initialMD,
const std::vector<WellPathCellIntersectionInfo>& cellIntersections,
gsl::not_null<RicMswExportInfo*> exportInfo,
gsl::not_null<RicMswBranch*> branch )
gsl::not_null<RicMswExportInfo*> exportInfo,
gsl::not_null<RicMswBranch*> branch )
{
auto perforationIntervals = wellPath->perforationIntervalCollection()->activePerforations();
@@ -938,9 +946,9 @@ std::vector<WellPathCellIntersectionInfo> RicWellPathExportMswCompletionsImpl::g
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RicWellPathExportMswCompletionsImpl::computeIntitialMeasuredDepth( const RimEclipseCase* eclipseCase,
const RimWellPath* wellPath,
const RimMswCompletionParameters* mswParameters,
double RicWellPathExportMswCompletionsImpl::computeIntitialMeasuredDepth( const RimEclipseCase* eclipseCase,
const RimWellPath* wellPath,
const RimMswCompletionParameters* mswParameters,
const std::vector<WellPathCellIntersectionInfo>& allIntersections )
{
if ( allIntersections.empty() ) return 0.0;
@@ -1866,10 +1874,10 @@ std::vector<RimWellPath*> RicWellPathExportMswCompletionsImpl::wellPathsWithTieI
///
//--------------------------------------------------------------------------------------------------
std::pair<double, double>
RicWellPathExportMswCompletionsImpl::calculateOverlapWithActiveCells( double startMD,
double endMD,
RicWellPathExportMswCompletionsImpl::calculateOverlapWithActiveCells( double startMD,
double endMD,
const std::vector<WellPathCellIntersectionInfo>& wellPathIntersections,
const RigActiveCellInfo* activeCellInfo )
const RigActiveCellInfo* activeCellInfo )
{
for ( const WellPathCellIntersectionInfo& intersection : wellPathIntersections )
{

View File

@@ -122,10 +122,10 @@ private:
gsl::not_null<const RigWellPath*> wellPathGeometry,
gsl::not_null<const RimEclipseCase*> eclipseCase );
static std::pair<double, double> calculateOverlapWithActiveCells( double startMD,
double endMD,
static std::pair<double, double> calculateOverlapWithActiveCells( double startMD,
double endMD,
const std::vector<WellPathCellIntersectionInfo>& wellPathIntersections,
const RigActiveCellInfo* activeCellInfo );
const RigActiveCellInfo* activeCellInfo );
static void createWellPathSegments( gsl::not_null<RicMswBranch*> branch,
const std::vector<WellPathCellIntersectionInfo>& cellSegmentIntersections,
@@ -167,10 +167,10 @@ private:
gsl::not_null<RicMswSegment*> segment,
bool* foundSubGridIntersections );
static std::vector<RigCompletionData> generatePerforationIntersections( gsl::not_null<const RimWellPath*> wellPath,
static std::vector<RigCompletionData> generatePerforationIntersections( gsl::not_null<const RimWellPath*> wellPath,
gsl::not_null<const RimPerforationInterval*> perforationInterval,
int timeStep,
gsl::not_null<const RimEclipseCase*> eclipseCase );
int timeStep,
gsl::not_null<const RimEclipseCase*> eclipseCase );
static void assignPerforationIntersections( const std::vector<RigCompletionData>& completionData,
gsl::not_null<RicMswCompletion*> perforationCompletion,

View File

@@ -628,7 +628,7 @@ QString RicWellPathFractureTextReportFeatureImpl::createFractureCompletionSummar
RifTextDataTableColumn( "" ), // Fracture
RifTextDataTableColumn( "" ), // Template
floatNumberColumn( "" ), // Tr
floatNumberColumn( "" ), //#con
floatNumberColumn( "" ), // #con
floatNumberColumn( "" ), // Fcd
RifTextDataTableColumn( "", RifTextDataTableDoubleFormatting( RIF_FLOAT, 1 ), RIGHT ), // Area
RifTextDataTableColumn( meanText, RifTextDataTableDoubleFormatting( RIF_FLOAT, 1 ), RIGHT ), // KfWf

View File

@@ -115,7 +115,7 @@ void RicCreateDepthAdjustedLasFilesFeature::createDepthAdjustedWellLogFileFromEc
RimWellPath* sourceWell,
const std::vector<RimWellPath*> destinationWells,
const std::vector<QString>& selectedResultProperties,
const QString& exportFolder )
const QString& exportFolder )
{
if ( sourceWell->wellLogFiles().empty() ) return;
@@ -142,7 +142,7 @@ void RicCreateDepthAdjustedLasFilesFeature::createDepthAdjustedWellLogFileFromGe
RimWellPath* sourceWell,
const std::vector<RimWellPath*> destinationWells,
const std::vector<QString>& selectedResultProperties,
const QString& exportFolder )
const QString& exportFolder )
{
if ( sourceWell->wellLogFiles().empty() ) return;

View File

@@ -265,9 +265,9 @@ std::string RicCreateDepthAdjustedLasFilesImpl::createDepthUnitText( RiaDefines:
//--------------------------------------------------------------------------------------------------
std::string RicCreateDepthAdjustedLasFilesImpl::createDepthUnitComment( RiaDefines::DepthUnitType depthUnitType )
{
return depthUnitType == RiaDefines::DepthUnitType::UNIT_METER
? "in meters"
: depthUnitType == RiaDefines::DepthUnitType::UNIT_FEET ? "in feet" : "in Connection number";
return depthUnitType == RiaDefines::DepthUnitType::UNIT_METER ? "in meters"
: depthUnitType == RiaDefines::DepthUnitType::UNIT_FEET ? "in feet"
: "in Connection number";
}
//--------------------------------------------------------------------------------------------------

View File

@@ -100,7 +100,7 @@ void RicExportEclipseSectorModelFeature::executeCommand( RimEclipseView*
int faultsProgressPercentage = exportSettings.exportFaults() ? 10 : 0;
int gridProgressPercentage = 100 - resultProgressPercentage - faultsProgressPercentage;
int gridProgressPercentage = 100 - resultProgressPercentage - faultsProgressPercentage;
caf::ProgressInfo progress( gridProgressPercentage + resultProgressPercentage + faultsProgressPercentage, "Export Eclipse Sector Model" );
cvf::Vec3st refinement( exportSettings.refinementCountI(), exportSettings.refinementCountJ(), exportSettings.refinementCountK() );
@@ -157,7 +157,7 @@ void RicExportEclipseSectorModelFeature::executeCommand( RimEclipseView*
QString fileName = dirPath.absoluteFilePath( keyword + ".GRDECL" );
bool worked = RifEclipseInputFileTools::exportKeywords( fileName,
view->eclipseCase()->eclipseCaseData(),
{ keyword },
{ keyword },
exportSettings.writeEchoKeywords(),
min,
max,

View File

@@ -114,9 +114,10 @@ public:
int priority() const
{
return type == RigCompletionData::CompletionType::FRACTURE
? 1
: type == RigCompletionData::CompletionType::FISHBONES ? 2 : type == RigCompletionData::CompletionType::PERFORATION ? 3 : 4;
return type == RigCompletionData::CompletionType::FRACTURE ? 1
: type == RigCompletionData::CompletionType::FISHBONES ? 2
: type == RigCompletionData::CompletionType::PERFORATION ? 3
: 4;
}
// Sort by priority, then name, then number
@@ -190,8 +191,8 @@ private:
const std::vector<RigCompletionDataGridCell>& intersectingCells,
const caf::VecIjk& lgrSizes,
LgrNameFactory& lgrNameFactory );
static std::vector<LgrInfo> buildLgrsPerCompletion( int firstLgrId,
RimEclipseCase* eclipseCase,
static std::vector<LgrInfo> buildLgrsPerCompletion( int firstLgrId,
RimEclipseCase* eclipseCase,
const std::map<CompletionInfo, std::vector<RigCompletionDataGridCell>>& completionInfo,
const caf::VecIjk& lgrSizesPerMainGridCell,
LgrNameFactory& lgrNameFactory );

View File

@@ -39,7 +39,7 @@ public:
static void saveViewWindowToFile( RimViewWindow* viewWindow, const QString& defaultFileBaseName = "image" );
static void saveImageToFile( const QImage& image, const QString& defaultFileBaseName = "image" );
static QString
generateSaveFileName( const QString& defaultFileBaseName = "image", bool supportPDF = false, const QString& defaultExtension = "png" );
generateSaveFileName( const QString& defaultFileBaseName = "image", bool supportPDF = false, const QString& defaultExtension = "png" );
static QIcon icon();
static QString text();

View File

@@ -70,7 +70,7 @@ public:
std::vector<MultipleFracturesOption> fractureOptions( const RigEclipseCaseData* caseData,
const RimWellPath* wellPath,
const std::vector<RicCreateMultipleFracturesOptionItemUi*>& allUiOptions );
RicCreateMultipleFracturesOptionItemUi* firstUiOptionContainingK( size_t k,
RicCreateMultipleFracturesOptionItemUi* firstUiOptionContainingK( size_t k,
const std::vector<RicCreateMultipleFracturesOptionItemUi*>& allUiOptions );
//--------------------------------------------------------------------------------------------------

View File

@@ -116,7 +116,8 @@ std::vector<T*> RicMeshFractureTemplateHelper<T>::createNewTemplatesFromFiles( c
RimFractureTemplateCollection* fracDefColl = oilfield->fractureDefinitionCollection();
if ( !fracDefColl ) return std::vector<T*>();
auto findTemplateByName = []( RimFractureTemplateCollection* coll, const QString& name ) -> T* {
auto findTemplateByName = []( RimFractureTemplateCollection* coll, const QString& name ) -> T*
{
for ( auto t : coll->fractureTemplates() )
if ( t->name() == name ) return dynamic_cast<T*>( t );

View File

@@ -45,7 +45,7 @@ private:
~RicExportToSharingServerScheduler() override;
RicExportToSharingServerScheduler( const RicExportToSharingServerScheduler& o ) = delete;
void operator=( const RicExportToSharingServerScheduler& o ) = delete;
void operator=( const RicExportToSharingServerScheduler& o ) = delete;
void startTimer( int msecs );
void triggerUpdateSession();

View File

@@ -63,9 +63,8 @@ bool RicCloseSummaryCaseInCollectionFeature::isCommandEnabled()
summaryCaseCollections.erase( std::remove_if( summaryCaseCollections.begin(),
summaryCaseCollections.end(),
[]( RimSummaryCaseCollection* coll ) {
return dynamic_cast<RimDerivedEnsembleCaseCollection*>( coll ) != nullptr;
} ),
[]( RimSummaryCaseCollection* coll )
{ return dynamic_cast<RimDerivedEnsembleCaseCollection*>( coll ) != nullptr; } ),
summaryCaseCollections.end() );
return ( summaryCaseMainCollections.size() > 0 || summaryCaseCollections.size() > 0 );

View File

@@ -188,14 +188,15 @@ std::vector<std::pair<QString, RiaDefines::ResultCatType>>
const RigEclipseCaseData* caseData )
{
auto findResultCategory =
[]( const QString& keyword, const std::vector<RiaDefines::ResultCatType>& categories, const RigEclipseCaseData* caseData ) {
// Find the result category for a given keyword
auto resultData = caseData->results( RiaDefines::PorosityModelType::MATRIX_MODEL );
for ( auto category : categories )
if ( resultData->hasResultEntry( RigEclipseResultAddress( category, keyword ) ) ) return category;
[]( const QString& keyword, const std::vector<RiaDefines::ResultCatType>& categories, const RigEclipseCaseData* caseData )
{
// Find the result category for a given keyword
auto resultData = caseData->results( RiaDefines::PorosityModelType::MATRIX_MODEL );
for ( auto category : categories )
if ( resultData->hasResultEntry( RigEclipseResultAddress( category, keyword ) ) ) return category;
return RiaDefines::ResultCatType::UNDEFINED;
};
return RiaDefines::ResultCatType::UNDEFINED;
};
std::vector<std::pair<QString, RiaDefines::ResultCatType>> props;
for ( auto keyword : resultNames )

View File

@@ -61,9 +61,9 @@ public:
std::vector<std::pair<QString, RiaDefines::ResultCatType>> properties() const;
static std::vector<std::pair<QString, RiaDefines::ResultCatType>> properties( const std::vector<QString>& resultNames,
static std::vector<std::pair<QString, RiaDefines::ResultCatType>> properties( const std::vector<QString>& resultNames,
const std::vector<RiaDefines::ResultCatType>& resultCategories,
const RigEclipseCaseData* caseData );
const RigEclipseCaseData* caseData );
void setCaseData( RigEclipseCaseData* caseData );

View File

@@ -70,9 +70,8 @@ bool RicDeleteSummaryCaseCollectionFeature::isCommandEnabled()
selection.erase( std::remove_if( selection.begin(),
selection.end(),
[]( RimSummaryCaseCollection* coll ) {
return dynamic_cast<RimDerivedEnsembleCaseCollection*>( coll ) != nullptr;
} ),
[]( RimSummaryCaseCollection* coll )
{ return dynamic_cast<RimDerivedEnsembleCaseCollection*>( coll ) != nullptr; } ),
selection.end() );
return ( selection.size() > 0 );
}

View File

@@ -112,9 +112,9 @@ void RicElasticPropertiesImportTools::importElasticPropertiesFromFile( const QSt
}
// Sort the matching items by porosity
std::sort( matchingFacies.begin(), matchingFacies.end(), []( const RifElasticProperties& a, const RifElasticProperties& b ) {
return a.porosity < b.porosity;
} );
std::sort( matchingFacies.begin(),
matchingFacies.end(),
[]( const RifElasticProperties& a, const RifElasticProperties& b ) { return a.porosity < b.porosity; } );
std::vector<QString> matchingFormations;
if ( formationName == formationWildCard )

View File

@@ -144,11 +144,12 @@ void RicImportEnsembleFeature::setupActionLook( QAction* actionToSetup )
//--------------------------------------------------------------------------------------------------
QString RicImportEnsembleFeature::askForEnsembleName( const QString& suggestion )
{
RimProject* project = RimProject::current();
std::vector<RimSummaryCaseCollection*> groups = project->summaryGroups();
int ensemblesStartingWithRoot = std::count_if( groups.begin(), groups.end(), [suggestion]( RimSummaryCaseCollection* group ) {
return group->isEnsemble() && group->name().startsWith( suggestion );
} );
RimProject* project = RimProject::current();
std::vector<RimSummaryCaseCollection*> groups = project->summaryGroups();
int ensemblesStartingWithRoot = std::count_if( groups.begin(),
groups.end(),
[suggestion]( RimSummaryCaseCollection* group )
{ return group->isEnsemble() && group->name().startsWith( suggestion ); } );
QInputDialog dialog;
dialog.setInputMode( QInputDialog::TextInput );

View File

@@ -80,8 +80,8 @@ void RicImportObservedDataFeature::selectObservedDataFileInDialog()
}
else
{
errorText = "Not able to import file. Make sure '*.rsm' is used as extension if data is in RMS format "
"or '*.txt' or '*.csv' if data is in CSV format.";
errorText = "Not able to import file. Make sure '*.rsm' is used as extension if data is in RMS format "
"or '*.txt' or '*.csv' if data is in CSV format.";
retryImport = false;
}

View File

@@ -436,9 +436,9 @@ RicSummaryCaseRestartDialogResult RicSummaryCaseRestartDialog::openDialog( const
//--------------------------------------------------------------------------------------------------
RicSummaryCaseRestartDialog::ImportOptions RicSummaryCaseRestartDialog::selectedSummaryImportOption() const
{
return m_summaryReadAllBtn->isChecked()
? ImportOptions::IMPORT_ALL
: m_summarySeparateCasesBtn->isChecked() ? ImportOptions::SEPARATE_CASES : ImportOptions::NOT_IMPORT;
return m_summaryReadAllBtn->isChecked() ? ImportOptions::IMPORT_ALL
: m_summarySeparateCasesBtn->isChecked() ? ImportOptions::SEPARATE_CASES
: ImportOptions::NOT_IMPORT;
}
//--------------------------------------------------------------------------------------------------

View File

@@ -90,7 +90,8 @@ void RicThemeColorEditorFeature::onActionTriggered( bool isChecked )
completer->setWrapAround( false );
editor->setCompleter( completer );
auto generateColorFields = [themeSelector, widget, editor]() -> void {
auto generateColorFields = [themeSelector, widget, editor]() -> void
{
QLayoutItem* item;
if ( widget->layout() )
{
@@ -114,17 +115,20 @@ void RicThemeColorEditorFeature::onActionTriggered( bool isChecked )
column );
QPushButton* colorBox = new QPushButton( "" );
colorBox->setStyleSheet( QString( "background-color: %0;" ).arg( variableValueMap.value( variableName ) ) );
connect( colorBox, &QPushButton::clicked, [variableValueMap, variableName, theme, editor, widget, colorBox]() -> void {
QColor color = QColorDialog::getColor( colorBox->palette().color( QPalette::Button ), widget );
if ( color.isValid() )
{
colorBox->setStyleSheet( QString( "background-color: %0;" ).arg( color.name() ) );
colorBox->style()->unpolish( colorBox );
colorBox->style()->polish( colorBox );
RiuGuiTheme::changeVariableValue( theme, variableName, color.name() );
editor->setPlainText( RiuGuiTheme::applyVariableValueMapToStyleSheet( theme ) );
}
} );
connect( colorBox,
&QPushButton::clicked,
[variableValueMap, variableName, theme, editor, widget, colorBox]() -> void
{
QColor color = QColorDialog::getColor( colorBox->palette().color( QPalette::Button ), widget );
if ( color.isValid() )
{
colorBox->setStyleSheet( QString( "background-color: %0;" ).arg( color.name() ) );
colorBox->style()->unpolish( colorBox );
colorBox->style()->polish( colorBox );
RiuGuiTheme::changeVariableValue( theme, variableName, color.name() );
editor->setPlainText( RiuGuiTheme::applyVariableValueMapToStyleSheet( theme ) );
}
} );
innerLayout->addWidget( colorBox, row++, column + 1 );
if ( row == 10 )
{
@@ -137,12 +141,15 @@ void RicThemeColorEditorFeature::onActionTriggered( bool isChecked )
// A more elegant way, but not supported in old Qt version.
// connect( themeSelector, qOverload<int>( &QComboBox::currentIndexChanged ), [=]() {
connect( themeSelector, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), [=]() {
generateColorFields();
RiaDefines::ThemeEnum theme = static_cast<RiaDefines::ThemeEnum>( themeSelector->currentData().toInt() );
RiuGuiTheme::updateGuiTheme( static_cast<RiaDefines::ThemeEnum>( theme ) );
editor->setPlainText( RiuGuiTheme::loadStyleSheet( theme ) );
} );
connect( themeSelector,
static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ),
[=]()
{
generateColorFields();
RiaDefines::ThemeEnum theme = static_cast<RiaDefines::ThemeEnum>( themeSelector->currentData().toInt() );
RiuGuiTheme::updateGuiTheme( static_cast<RiaDefines::ThemeEnum>( theme ) );
editor->setPlainText( RiuGuiTheme::loadStyleSheet( theme ) );
} );
generateColorFields();
@@ -156,11 +163,14 @@ void RicThemeColorEditorFeature::onActionTriggered( bool isChecked )
QPushButton* button = new QPushButton( "Apply style sheet changes" );
layout->addWidget( button, 6, 1 );
connect( button, &QPushButton::clicked, [themeSelector, editor, generateColorFields]() {
RiaDefines::ThemeEnum theme = static_cast<RiaDefines::ThemeEnum>( themeSelector->currentData().toInt() );
RiuGuiTheme::writeStyleSheetToFile( theme, editor->toPlainText() );
generateColorFields();
} );
connect( button,
&QPushButton::clicked,
[themeSelector, editor, generateColorFields]()
{
RiaDefines::ThemeEnum theme = static_cast<RiaDefines::ThemeEnum>( themeSelector->currentData().toInt() );
RiuGuiTheme::writeStyleSheetToFile( theme, editor->toPlainText() );
generateColorFields();
} );
dialog->setLayout( layout );

View File

@@ -151,7 +151,7 @@ bool RicPasteAsciiDataToSummaryPlotFeature::hasPastedText()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimAsciiDataCurve*> RicPasteAsciiDataToSummaryPlotFeature::parseCurves( QString& data,
std::vector<RimAsciiDataCurve*> RicPasteAsciiDataToSummaryPlotFeature::parseCurves( QString& data,
const RicPasteAsciiDataToSummaryPlotFeatureUi& settings )
{
std::vector<RimAsciiDataCurve*> curves;

View File

@@ -509,9 +509,10 @@ void RicSummaryPlotEditorUi::updatePreviewCurvesFromCurveDefinitions( const std:
// Set single curve set color
auto allCurveSets = m_previewPlot->ensembleCurveSetCollection()->curveSets();
size_t colorIndex = std::count_if( allCurveSets.begin(), allCurveSets.end(), []( RimEnsembleCurveSet* curveSet ) {
return curveSet->colorMode() == RimEnsembleCurveSet::ColorMode::SINGLE_COLOR;
} );
size_t colorIndex = std::count_if( allCurveSets.begin(),
allCurveSets.end(),
[]( RimEnsembleCurveSet* curveSet )
{ return curveSet->colorMode() == RimEnsembleCurveSet::ColorMode::SINGLE_COLOR; } );
curveSet->setColor( RiaColorTables::summaryCurveDefaultPaletteColors().cycledColor3f( colorIndex ) );
// Add curve to plot
@@ -976,9 +977,9 @@ void RicSummaryPlotEditorUi::setInitialCurveVisibility( const RimSummaryPlot* ta
//--------------------------------------------------------------------------------------------------
int ensembleCurveCount( const std::set<RiaSummaryCurveDefinition>& allCurveDefs )
{
return std::count_if( allCurveDefs.begin(), allCurveDefs.end(), []( const RiaSummaryCurveDefinition& def ) {
return def.isEnsembleCurve();
} );
return std::count_if( allCurveDefs.begin(),
allCurveDefs.end(),
[]( const RiaSummaryCurveDefinition& def ) { return def.isEnsembleCurve(); } );
}
//--------------------------------------------------------------------------------------------------

View File

@@ -33,7 +33,7 @@ class RicAsciiExportWellLogPlotFeature : public caf::CmdFeature
public:
static QString
makeValidExportFileName( const RimWellLogPlot* wellLogPlot, const QString& folder, const QString& prefix, bool capitalizeFileName );
makeValidExportFileName( const RimWellLogPlot* wellLogPlot, const QString& folder, const QString& prefix, bool capitalizeFileName );
static bool exportAsciiForWellLogPlot( const QString& fileName, const RimWellLogPlot* wellLogPlot );
protected:

View File

@@ -52,7 +52,7 @@ bool RicNewWellLogPlotFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicNewWellLogPlotFeature::onActionTriggered( bool isChecked )
{
RimWellLogTrack* plotTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack();
RimWellLogTrack* plotTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack();
RimWellLogExtractionCurve* curve = RicWellLogTools::addWellLogExtractionCurve( plotTrack, nullptr, nullptr, nullptr, nullptr, -1, true );
curve->loadDataAndUpdate( true );
RimWellLogPlot* plot = nullptr;

View File

@@ -107,9 +107,10 @@ std::set<RimViewWindow*> RicWellLogFileCloseFeature::referringWellLogPlots( cons
obj->firstAncestorOrThisOfType( wellLogPlot );
RimViewWindow* plot = allocationPlot ? dynamic_cast<RimViewWindow*>( allocationPlot )
: pltPlot ? dynamic_cast<RimViewWindow*>( pltPlot )
: rftPlot ? dynamic_cast<RimViewWindow*>( rftPlot )
: wellLogPlot ? dynamic_cast<RimViewWindow*>( wellLogPlot ) : nullptr;
: pltPlot ? dynamic_cast<RimViewWindow*>( pltPlot )
: rftPlot ? dynamic_cast<RimViewWindow*>( rftPlot )
: wellLogPlot ? dynamic_cast<RimViewWindow*>( wellLogPlot )
: nullptr;
if ( plot != nullptr )
{

View File

@@ -92,7 +92,7 @@ private:
static cvf::ref<cvf::DrawableGeo> createTriangelDrawableGeo( cvf::Vec3fArray* triangleVertexArray );
static cvf::ref<cvf::DrawableGeo> createIndexedTriangelDrawableGeo( cvf::Vec3fArray* triangleVertexArray, cvf::UIntArray* triangleIndices );
static cvf::ref<cvf::Part> createPart( cvf::DrawableGeo* geo, const cvf::Color4f& color, const cvf::String& partName );
static cvf::ref<cvf::Part> createPart( cvf::DrawableGeo* geo, const cvf::Color4f& color, const cvf::String& partName );
private:
std::map<HandleType, cvf::ref<cvf::Part>> m_handleParts; // These arrays have the same length