Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Christian Butz
VTK
Commits
07f12d14
Commit
07f12d14
authored
Feb 03, 2011
by
William McLendon
Browse files
Added a rowLimit parameter to vtkTable::Dump()
parent
52c9dfdd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Filtering/vtkTable.cxx
View file @
07f12d14
...
...
@@ -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
()
)
...
...
@@ -121,31 +121,35 @@ void vtkTable::Dump( unsigned int colWidth )
cout
<<
" |
\n
"
<<
lineStr
;
for
(
vtkIdType
r
=
0
;
r
<
this
->
GetNumberOfRows
();
++
r
)
if
(
rowLimit
!=
0
)
{
for
(
int
c
=
0
;
c
<
this
->
GetNumberOf
Column
s
();
++
c
)
for
(
vtkIdType
r
=
0
;
r
<
this
->
GetNumberOf
Row
s
();
++
r
)
{
cout
<<
"| "
;
vtkStdString
str
=
this
->
GetValue
(
r
,
c
).
ToString
();
if
(
colWidth
<
str
.
length
()
)
for
(
int
c
=
0
;
c
<
this
->
GetNumberOfColumns
();
++
c
)
{
cout
<<
str
.
substr
(
0
,
colWidth
);
}
else
{
cout
<<
str
;
for
(
unsigned
int
i
=
static_cast
<
unsigned
int
>
(
str
.
length
());
i
<
colWidth
;
++
i
)
cout
<<
"| "
;
vtkStdString
str
=
this
->
GetValue
(
r
,
c
).
ToString
();
if
(
colWidth
<
str
.
length
()
)
{
cout
<<
" "
;
cout
<<
str
.
substr
(
0
,
colWidth
);
}
else
{
cout
<<
str
;
for
(
unsigned
int
i
=
static_cast
<
unsigned
int
>
(
str
.
length
());
i
<
colWidth
;
++
i
)
{
cout
<<
" "
;
}
}
}
cout
<<
" |
\n
"
;
if
(
rowLimit
!=
-
1
&&
r
>=
rowLimit
)
break
;
}
cout
<<
" |
\n
"
;
cout
<<
lineStr
;
cout
.
flush
();
}
cout
<<
lineStr
;
cout
.
flush
();
}
//----------------------------------------------------------------------------
...
...
Filtering/vtkTable.h
View file @
07f12d14
...
...
@@ -62,8 +62,11 @@ public:
void
PrintSelf
(
ostream
&
os
,
vtkIndent
indent
);
// Description:
// Dump table contents.
void
Dump
(
unsigned
int
colWidth
=
16
);
// Dump table contents. If rowLimit is -1 then the full table
// 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:
// Return what type of dataset this is.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment