Commit 721fd2e9 authored by William McLendon's avatar William McLendon Committed by Kitware Robot
Browse files

Merge topic 'vtkTable_Dump_rowcount'

07f12d14 Added a rowLimit parameter to vtkTable::Dump()
parents e6df451f 07f12d14
...@@ -75,7 +75,7 @@ void vtkTable::PrintSelf(ostream &os, vtkIndent indent) ...@@ -75,7 +75,7 @@ void vtkTable::PrintSelf(ostream &os, vtkIndent indent)
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void vtkTable::Dump( unsigned int colWidth ) void vtkTable::Dump( unsigned int colWidth, int rowLimit )
{ {
if ( ! this->GetNumberOfColumns() ) if ( ! this->GetNumberOfColumns() )
...@@ -121,6 +121,8 @@ void vtkTable::Dump( unsigned int colWidth ) ...@@ -121,6 +121,8 @@ void vtkTable::Dump( unsigned int colWidth )
cout << " |\n" cout << " |\n"
<< lineStr; << lineStr;
if ( rowLimit != 0 )
{
for ( vtkIdType r = 0; r < this->GetNumberOfRows(); ++ r ) for ( vtkIdType r = 0; r < this->GetNumberOfRows(); ++ r )
{ {
for ( int c = 0; c < this->GetNumberOfColumns(); ++ c ) for ( int c = 0; c < this->GetNumberOfColumns(); ++ c )
...@@ -142,10 +144,12 @@ void vtkTable::Dump( unsigned int colWidth ) ...@@ -142,10 +144,12 @@ void vtkTable::Dump( unsigned int colWidth )
} }
} }
cout << " |\n"; cout << " |\n";
if ( rowLimit != -1 && r >= rowLimit )
break;
} }
cout << lineStr; cout << lineStr;
cout.flush(); cout.flush();
}
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
......
...@@ -62,8 +62,11 @@ public: ...@@ -62,8 +62,11 @@ public:
void PrintSelf(ostream &os, vtkIndent indent); void PrintSelf(ostream &os, vtkIndent indent);
// Description: // Description:
// Dump table contents. // Dump table contents. If rowLimit is -1 then the full table
void Dump( unsigned int colWidth = 16 ); // is printed out (Default). If rowLimit is 0 then only the
// header row will be displayed. Otherwise, if rowLimit > 0
// then Dump will print the first rowLimit rows of data.
void Dump( unsigned int colWidth = 16, int rowLimit = -1 );
// Description: // Description:
// Return what type of dataset this is. // Return what type of dataset this is.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment