mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-25 06:38:13 -05:00
#12008 Improve display of curves from selected cells in 3D view
* Remove obsolete base class * Add conversion between one/zero-based IJK * Move code to RiaTextStringTools * Add automatic update of grid cell curves when clicking in 3D view * Fix missing conversion to QString
This commit is contained in:
1 parent
f743957b0a
commit
860588d755
29 files changed
+402
-272
No files matched your search
@@ -206,6 +206,25 @@ bool RiaTextStringTools::isNumber( const QString& text, const QString& decimalPo
|
||||
return RiaStdStringTools::isNumber( stdString, decimalChar );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QVector<double> RiaTextStringTools::parseDoubleValues( const QString& input )
|
||||
{
|
||||
// Flexible regex to extract three double numbers with any surrounding text
|
||||
QRegularExpression coordRegex( R"([-+]?\d+\.?\d*)" );
|
||||
QRegularExpressionMatchIterator it = coordRegex.globalMatch( input );
|
||||
|
||||
QVector<double> coords;
|
||||
while ( it.hasNext() )
|
||||
{
|
||||
QRegularExpressionMatch match = it.next();
|
||||
coords.append( match.captured().toDouble() );
|
||||
}
|
||||
|
||||
return coords;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -46,6 +46,8 @@ QString replaceTemplateTextWithValues( const QString& templateText, const std::m
|
||||
bool isTextEqual( QStringView text, QStringView compareText );
|
||||
bool isNumber( const QString& text, const QString& decimalPoint );
|
||||
|
||||
QVector<double> parseDoubleValues( const QString& input );
|
||||
|
||||
} // namespace RiaTextStringTools
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK( 6, 8, 0 )
|
||||
|
||||
Reference in new issue
Block a user