mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Add operations on polygon : Duplicate, exportCsv, exportPol and simplify
SimplfyPolygon applies an operation on polygon to reduce the number of points in a way that the shape of the polygon is conserved.
This commit is contained in:
@@ -118,7 +118,7 @@ void RifCsvDataTableFormatter::tableCompleted()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifCsvDataTableFormatter::outputBuffer()
|
||||
{
|
||||
if ( !m_columnHeaders.empty() )
|
||||
if ( isAnyTextInHeader() )
|
||||
{
|
||||
for ( size_t i = 0; i < m_columnHeaders.size(); i++ )
|
||||
{
|
||||
@@ -152,3 +152,21 @@ void RifCsvDataTableFormatter::outputBuffer()
|
||||
m_columnHeaders.clear();
|
||||
m_buffer.clear();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RifCsvDataTableFormatter::isAnyTextInHeader() const
|
||||
{
|
||||
for ( auto& header : m_columnHeaders )
|
||||
{
|
||||
for ( const auto& titleRow : header.titles )
|
||||
{
|
||||
if ( !titleRow.trimmed().isEmpty() )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ public:
|
||||
|
||||
private:
|
||||
void outputBuffer();
|
||||
bool isAnyTextInHeader() const;
|
||||
|
||||
private:
|
||||
QTextStream& m_out;
|
||||
|
||||
@@ -320,7 +320,13 @@ bool RifTextDataTableFormatter::isAllHeadersEmpty( const std::vector<RifTextData
|
||||
{
|
||||
for ( auto& header : headers )
|
||||
{
|
||||
if ( !header.titles.empty() ) return false;
|
||||
for ( const auto& titleRow : header.titles )
|
||||
{
|
||||
if ( !titleRow.trimmed().isEmpty() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ struct RifTextDataTableColumn
|
||||
, alignment( alignment )
|
||||
, width( width )
|
||||
{
|
||||
titles.push_back( title );
|
||||
titles.emplace_back( title );
|
||||
}
|
||||
|
||||
RifTextDataTableColumn( const QString& title,
|
||||
@@ -104,8 +104,8 @@ struct RifTextDataTableColumn
|
||||
, alignment( alignment )
|
||||
, width( width )
|
||||
{
|
||||
titles.push_back( title );
|
||||
titles.push_back( subTitle );
|
||||
titles.emplace_back( title );
|
||||
titles.emplace_back( subTitle );
|
||||
}
|
||||
|
||||
RifTextDataTableColumn( const QString& title,
|
||||
@@ -118,9 +118,9 @@ struct RifTextDataTableColumn
|
||||
, alignment( alignment )
|
||||
, width( width )
|
||||
{
|
||||
titles.push_back( title );
|
||||
titles.push_back( subTitle1 );
|
||||
titles.push_back( subTitle2 );
|
||||
titles.emplace_back( title );
|
||||
titles.emplace_back( subTitle1 );
|
||||
titles.emplace_back( subTitle2 );
|
||||
}
|
||||
|
||||
QString title() const
|
||||
|
||||
Reference in New Issue
Block a user