Better command support for multi-select of polygons

This commit is contained in:
jonjenssen committed 2024-11-29 23:43:03 +01:00
1 parent 3fac7d2045
commit 9ec83836ed
19 files changed
+287 -106

No files matched your search

@@ -103,9 +103,9 @@ bool RimPolygonTools::exportPolygonCsv( const RimPolygon* polygon, const QString
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimPolygonTools::exportPolygonPol( const RimPolygon* polygon, const QString& filePath )
bool RimPolygonTools::exportPolygonPol( const std::vector<RimPolygon*> polygons, const QString& filePath )
{
if ( !polygon ) return false;
if ( polygons.empty() ) return false;
QFile file( filePath );
if ( !file.open( QIODevice::WriteOnly | QIODevice::Text ) ) return false;
@@ -122,20 +122,23 @@ bool RimPolygonTools::exportPolygonPol( const RimPolygon* polygon, const QString
header.emplace_back( " ", RifTextDataTableDoubleFormatting( RIF_FLOAT, precision ) );
formatter.header( header );
for ( const auto& point : polygon->pointsInDomainCoords() )
for ( auto polygon : polygons )
{
formatter.add( point.x() );
formatter.add( point.y() );
formatter.add( -point.z() );
for ( const auto& point : polygon->pointsInDomainCoords() )
{
formatter.add( point.x() );
formatter.add( point.y() );
formatter.add( -point.z() );
formatter.rowCompleted();
}
const double endOfPolygon = 999.0;
formatter.add( endOfPolygon );
formatter.add( endOfPolygon );
formatter.add( endOfPolygon );
formatter.rowCompleted();
}
const double endOfPolygon = 999.0;
formatter.add( endOfPolygon );
formatter.add( endOfPolygon );
formatter.add( endOfPolygon );
formatter.rowCompleted();
formatter.tableCompleted();
file.close();