mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
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:
@@ -48,7 +48,7 @@ private:
|
||||
~RiaCompletionTypeCalculationScheduler() override;
|
||||
|
||||
RiaCompletionTypeCalculationScheduler( const RiaCompletionTypeCalculationScheduler& o ) = delete;
|
||||
void operator=( const RiaCompletionTypeCalculationScheduler& o ) = delete;
|
||||
void operator=( const RiaCompletionTypeCalculationScheduler& o ) = delete;
|
||||
|
||||
private:
|
||||
std::vector<caf::PdmPointer<RimEclipseCase>> m_eclipseCasesToRecalculate;
|
||||
|
@@ -1446,10 +1446,10 @@ void RiaGuiApplication::applyGuiPreferences( const RiaPreferences*
|
||||
reply = QMessageBox::question( activeMainWindow(),
|
||||
QString( "Apply %1 to Existing Views or Plots?" ).arg( listString ),
|
||||
QString( "You have changed default %1 and have existing views or plots with "
|
||||
"different settings.\n" )
|
||||
"different settings.\n" )
|
||||
.arg( listString ) +
|
||||
QString( "Do you want to apply the new default settings to all existing "
|
||||
"views?" ),
|
||||
"views?" ),
|
||||
QMessageBox::Ok | QMessageBox::Cancel );
|
||||
applySettingsToAllViews = ( reply == QMessageBox::Ok );
|
||||
}
|
||||
@@ -1674,7 +1674,7 @@ bool RiaGuiApplication::notify( QObject* receiver, QEvent* event )
|
||||
memoryExhaustedBox = new QMessageBox( QMessageBox::Critical,
|
||||
"ResInsight Exhausted Memory",
|
||||
"Memory is Exhausted!\n ResInsight could not allocate the memory needed, and is now "
|
||||
"unstable and will probably crash soon." );
|
||||
"unstable and will probably crash soon." );
|
||||
}
|
||||
|
||||
bool done = false;
|
||||
|
@@ -64,12 +64,14 @@ QDateTime RiaDateStringParser::parseDateString( const std::string& dateString, O
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaDateStringParser::parseDateStringWithSeparators( const std::string& dateString, int& year, int& month, int& day, OrderPreference preference )
|
||||
{
|
||||
auto tryParseAllYearFirst = []( const std::string& dateString, int& year, int& month, int& day ) {
|
||||
auto tryParseAllYearFirst = []( const std::string& dateString, int& year, int& month, int& day )
|
||||
{
|
||||
return tryParseYearFirst( dateString, year, month, day ) || tryParseDayFirst( dateString, year, month, day ) ||
|
||||
tryParseMonthFirst( dateString, year, month, day );
|
||||
};
|
||||
|
||||
auto tryParseAllDayFirst = []( const std::string& dateString, int& year, int& month, int& day ) {
|
||||
auto tryParseAllDayFirst = []( const std::string& dateString, int& year, int& month, int& day )
|
||||
{
|
||||
return tryParseDayFirst( dateString, year, month, day ) || tryParseYearFirst( dateString, year, month, day ) ||
|
||||
tryParseMonthFirst( dateString, year, month, day );
|
||||
};
|
||||
@@ -83,12 +85,14 @@ bool RiaDateStringParser::parseDateStringWithSeparators( const std::string& date
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaDateStringParser::parseDateStringWithoutSeparators( const std::string& dateString, int& year, int& month, int& day, OrderPreference preference )
|
||||
{
|
||||
auto tryParseAllYearFirstNoSeparators = []( const std::string& dateString, int& year, int& month, int& day ) {
|
||||
auto tryParseAllYearFirstNoSeparators = []( const std::string& dateString, int& year, int& month, int& day )
|
||||
{
|
||||
return tryParseYearFirstNoSeparators( dateString, year, month, day ) ||
|
||||
tryParseDayFirstNoSeparators( dateString, year, month, day ) || tryParseMonthFirstNoSeparators( dateString, year, month, day );
|
||||
};
|
||||
|
||||
auto tryParseAllDayFirstNoSeparators = []( const std::string& dateString, int& year, int& month, int& day ) {
|
||||
auto tryParseAllDayFirstNoSeparators = []( const std::string& dateString, int& year, int& month, int& day )
|
||||
{
|
||||
return tryParseDayFirstNoSeparators( dateString, year, month, day ) || tryParseYearFirstNoSeparators( dateString, year, month, day ) ||
|
||||
tryParseMonthFirstNoSeparators( dateString, year, month, day );
|
||||
};
|
||||
|
@@ -61,11 +61,11 @@ void RiaImageTools::distanceTransform2d( std::vector<std::vector<unsigned int>>&
|
||||
}
|
||||
}
|
||||
|
||||
auto f = []( int64_t x, int64_t i, const std::vector<std::vector<int64_t>>& g, int64_t y ) {
|
||||
return ( x - i ) * ( x - i ) + g[i][y] * g[i][y];
|
||||
};
|
||||
auto f = []( int64_t x, int64_t i, const std::vector<std::vector<int64_t>>& g, int64_t y )
|
||||
{ return ( x - i ) * ( x - i ) + g[i][y] * g[i][y]; };
|
||||
|
||||
auto sep = []( int64_t i, int64_t u, const std::vector<std::vector<int64_t>>& g, int64_t y ) {
|
||||
auto sep = []( int64_t i, int64_t u, const std::vector<std::vector<int64_t>>& g, int64_t y )
|
||||
{
|
||||
if ( i == u ) return (int64_t)0;
|
||||
|
||||
int64_t numerator = u * u - i * i + g[u][y] * g[u][y] - g[i][y] * g[i][y];
|
||||
|
@@ -89,7 +89,7 @@ public:
|
||||
dateFormatString( const QString& fullDateFormat,
|
||||
RiaDefines::DateFormatComponents dateComponents = RiaDefines::DateFormatComponents::DATE_FORMAT_YEAR_MONTH_DAY );
|
||||
static QString
|
||||
timeFormatString( const QString& fullTimeFormat,
|
||||
timeFormatString( const QString& fullTimeFormat,
|
||||
RiaDefines::TimeFormatComponents timeComponents = RiaDefines::TimeFormatComponents::TIME_FORMAT_HOUR_MINUTE_SECOND );
|
||||
|
||||
static QList<caf::PdmOptionItemInfo> createOptionItems( const std::vector<time_t>& timeSteps );
|
||||
|
@@ -33,10 +33,13 @@ std::vector<const RigWellPath*> RiaSimWellBranchTools::simulationWellBranches( c
|
||||
{
|
||||
std::vector<RimEclipseCase*> simCases = RimEclipseCaseTools::eclipseCases();
|
||||
|
||||
auto caseItr = std::find_if( simCases.begin(), simCases.end(), [&simWellName]( const RimEclipseCase* eclCase ) {
|
||||
const auto& eclData = eclCase->eclipseCaseData();
|
||||
return eclData != nullptr && eclData->hasSimulationWell( simWellName );
|
||||
} );
|
||||
auto caseItr = std::find_if( simCases.begin(),
|
||||
simCases.end(),
|
||||
[&simWellName]( const RimEclipseCase* eclCase )
|
||||
{
|
||||
const auto& eclData = eclCase->eclipseCaseData();
|
||||
return eclData != nullptr && eclData->hasSimulationWell( simWellName );
|
||||
} );
|
||||
RimEclipseCase* eclipseCase = caseItr != simCases.end() ? *caseItr : nullptr;
|
||||
RigEclipseCaseData* eclCaseData = eclipseCase != nullptr ? eclipseCase->eclipseCaseData() : nullptr;
|
||||
return eclCaseData != nullptr ? eclCaseData->simulationWellBranches( simWellName, false, useAutoDetectionOfBranches )
|
||||
|
@@ -80,9 +80,8 @@ void RiaStdStringTools::splitByDelimiter( const std::string& str, Container& con
|
||||
template <typename InputIt>
|
||||
std::string join( InputIt begin, InputIt end, const std::string& separator = ", " )
|
||||
{
|
||||
auto compose_key = [&separator]( std::string& key, const std::string& key_part ) -> std::string {
|
||||
return key.empty() ? key_part : key + separator + key_part;
|
||||
};
|
||||
auto compose_key = [&separator]( std::string& key, const std::string& key_part ) -> std::string
|
||||
{ return key.empty() ? key_part : key + separator + key_part; };
|
||||
|
||||
return std::accumulate( begin, end, std::string(), compose_key );
|
||||
}
|
||||
|
@@ -243,7 +243,7 @@ QStringList RiaSummaryStringTools::dataSourceNames( const std::vector<RimSummary
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::set<RifEclipseSummaryAddress> RiaSummaryStringTools::computeFilteredAddresses( const QStringList& textFilters,
|
||||
std::set<RifEclipseSummaryAddress> RiaSummaryStringTools::computeFilteredAddresses( const QStringList& textFilters,
|
||||
const std::set<RifEclipseSummaryAddress>& sourceAddresses,
|
||||
bool includeDiffCurves )
|
||||
{
|
||||
|
@@ -79,11 +79,14 @@ QString RiaWellNameComparer::tryMatchNameInList( QString searchName, const std::
|
||||
}
|
||||
|
||||
// Try matching ignoring spaces, dashes and underscores
|
||||
matchedName = tryMatchName( searchName, nameList, []( const QString& str ) {
|
||||
QString s = str;
|
||||
s = removeWellNamePrefix( s );
|
||||
return s.remove( ' ' ).remove( '-' ).remove( '_' );
|
||||
} );
|
||||
matchedName = tryMatchName( searchName,
|
||||
nameList,
|
||||
[]( const QString& str )
|
||||
{
|
||||
QString s = str;
|
||||
s = removeWellNamePrefix( s );
|
||||
return s.remove( ' ' ).remove( '-' ).remove( '_' );
|
||||
} );
|
||||
|
||||
if ( !matchedName.isEmpty() )
|
||||
{
|
||||
|
@@ -223,8 +223,8 @@ void RiaSCurveCalculator::initializeByFinding_q1q2( cvf::Vec3d p1, double azi1,
|
||||
const double maxStepSize = 1.0e9;
|
||||
const double maxLengthToQ = 1.0e10;
|
||||
bool enableBackstepping = false;
|
||||
//#define USE_JACOBI_UPDATE
|
||||
//#define DEBUG_OUTPUT_ON
|
||||
// #define USE_JACOBI_UPDATE
|
||||
// #define DEBUG_OUTPUT_ON
|
||||
|
||||
// Needs the initial partial derivatives to see the direction of change
|
||||
// dR1/dq1, dR1/dq2, dR2/dq1, dR2/dq2
|
||||
|
Reference in New Issue
Block a user